emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rustom Mody <rustompmody@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Bug: Revert orgtbl-create-or-convert-from-region [6.33x]
Date: Tue, 6 Aug 2013 10:58:03 +0530	[thread overview]
Message-ID: <CAJ+Teoco6z=7x4SA7F5+r0Ri8WDyzKdxMrQEHU=uCRqdUzj+0Q@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1597 bytes --]

I was writing up what I could make out of having program-files with inline
tables.
The example is done for python.  It is exactly what the OP wants but close
enough so giving it here.
This file shows two approaches for making python data structures from
orgtbl with both sender and receiver in same file.

The first table is made with single line comments
The second table is made using python's triple-quote feature
The third is the recipient for both/either of the above

To try out orgtbl minor mode needs to be active after python mode is active.
Also it does not quite work for org 6.33
---------------------------
For the first use M-x orgtbl-toggle-comment followed by C-c C-c (inside the
table) to send to recipient, followed by another M-x orgtbl-toggle-comment

For the second only C-c C-c in the sender table is sufficient


------------------------------------cut here
------------------------------------
# #+ORGTBL: SEND marks orgtbl-to-generic :sep ","
#   | abe   | 1 | 2 | 3 | 4 | 10 |
#   | beth  | 3 | 1 | 5 | 7 | 16 |
#   | cathy | 5 | 6 | 7 | 5 | 23 |
# #+TBLFM: $6=$2+$3+$4+$5


orig_table = """

#+ORGTBL: SEND marks orgtbl-to-generic :lfmt "  \"%s\": [%s,%s,%s,%s,%s],"
:llfmt "  \"%s\": [%s,%s,%s,%s,%s]"
  | abe   | 1 | 2 | 3 | 4 | 10 |
  | beth  | 9 | 1 | 5 | 9 | 24 |
  | cathy | 5 | 6 | 7 | 5 | 23 |
#+TBLFM: $6=$2+$3+$4+$5
"""

stud_db = {
# BEGIN RECEIVE ORGTBL marks
abe,1,2,3,4,10
beth,3,1,5,7,16
cathy,5,6,7,5,23
# END RECEIVE ORGTBL marks
}

----------------------- cut here -----------------------------



-- 
http://www.the-magus.in
http://blog.languager.org

[-- Attachment #2: Type: text/html, Size: 1985 bytes --]

             reply	other threads:[~2013-08-06  5:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-06  5:28 Rustom Mody [this message]
2013-08-06  5:31 ` Bug: Revert orgtbl-create-or-convert-from-region [6.33x] Rustom Mody
  -- strict thread matches above, loose matches on Subject: below --
2013-08-05  7:49 Daniel Hornung
2013-08-05  9:16 ` Thorsten Jolitz
2013-08-05  9:49   ` Daniel Hornung
2013-08-05 13:26     ` Thorsten Jolitz
2013-08-05 14:07       ` Thorsten Jolitz
2013-08-05 14:19       ` Nick Dokos
2013-08-07  8:49         ` Daniel Hornung

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ+Teoco6z=7x4SA7F5+r0Ri8WDyzKdxMrQEHU=uCRqdUzj+0Q@mail.gmail.com' \
    --to=rustompmody@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).