emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Process hlines in imported tables
Date: Fri, 29 Mar 2013 18:01:21 -0600	[thread overview]
Message-ID: <87r4ixah7y.fsf@gmail.com> (raw)
In-Reply-To: <20130329214238.GA53401@BigDog.local> (Rick Frankel's message of "Fri, 29 Mar 2013 17:42:38 -0400")

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

Rick Frankel <rick@rickster.com> writes:

> On Fri, Mar 29, 2013 at 09:04:42AM -0600, Eric Schulte wrote:
>> Rick Frankel <rick@rickster.com> writes:
>> 
>> Users may want to insert a "-" in their tables, and I think it would be
>> surprising to magically replace floating "-" characters with hlines.
>> There are numerous existing options for inserting hlines into tables,
>> e.g., the :colnames header argument, using the raw, wrap and org result
>> types and printing literal Org-mode syntax from your block, additionally
>> any result could be passed through an elisp code block which may insert
>> hline symbols at will.
>> 
>> Is there a specific use case which isn't addressed by the existing
>> functionality?
>
> Yes and no. :colnames works, but often the header comes from the
> processing, so they may not be static (I use a lot of call:s). Also,
> I've been having trouble using the output from raw results as input --
> it seems that unless the results are cached (:cache yes), the table is
> not parsed on input, but passed as a multiline string. I was hoping to
> avoid this problem using value returns (now that  Achim has made the
> perl parsing work better). Here's an example (btw, this breaks in 7.4
> as well):
>

Alright, I've just pushed up changes so that org and wrap results will
expand tables (not just raw).  With this change in place you can now use
":results wrap" to get the results you want, and since they are
delimited, you can then re-use these results in later code blocks.

Here's my version of your example run with the latest from git.  Notice
that it is necessary to add header arguments to call lines (because
these arguments control how results are inserted they must be associated
with the call).


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: cache.org --]
[-- Type: text/x-org, Size: 693 bytes --]

* Cache vs. uncached org
#+name: uncached
#+begin_src elisp :results wrap
  "|c1|c2|
  |-
  |a|1|
  |b|2|"
#+end_src

#+RESULTS: uncached
:RESULTS:
| c1 | c2 |
|----+----|
| a  |  1 |
| b  |  2 |
:END:

#+call: uncached() :results wrap

#+RESULTS: uncached():results wrap
:RESULTS:
| c1 | c2 |
|----+----|
| a  |  1 |
| b  |  2 |
:END:

#+name: cached
#+begin_src elisp :results wrap :cache yes
  "|c1|c2|
  |-
  |a|1|
  |b|2|"
#+end_src

#+RESULTS[0faf1fbb046c9e001622c49242322c225811b162]: cached
:RESULTS:
| c1 | c2 |
|----+----|
| a  |  1 |
| b  |  2 |
:END:

#+call: cached() :results wrap

#+RESULTS: cached():results wrap
:RESULTS:
| c1 | c2 |
|----+----|
| a  |  1 |
| b  |  2 |
:END:

[-- Attachment #3: Type: text/plain, Size: 55 bytes --]


Cheers,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

  reply	other threads:[~2013-03-30  0:01 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-29  1:46 [PATCH] Process hlines in imported tables Rick Frankel
2013-03-29 15:04 ` Eric Schulte
2013-03-29 21:42   ` Rick Frankel
2013-03-30  0:01     ` Eric Schulte [this message]
2013-03-30 23:41       ` Rick Frankel
2013-03-31  0:43         ` Eric Schulte
2013-03-31 12:29           ` Rick Frankel
2013-03-31 13:37             ` Eric Schulte
2013-04-01 16:22               ` babel results handling (was: Process hlines in imported tables) Rick Frankel
2013-04-03 14:18                 ` babel results handling Eric Schulte
2013-04-03 18:02                   ` Achim Gratz
2013-04-04 18:20                   ` Rick Frankel
2013-04-03 18:21             ` [PATCH] Process hlines in imported tables Achim Gratz
2013-04-04 13:59               ` Sebastien Vauban
2013-04-04 15:02                 ` Eric Schulte
2013-04-04 21:01                   ` Sebastien Vauban
2013-04-06 16:30                     ` Eric Schulte
2013-04-15 13:06                     ` Sebastien Vauban
2013-04-15 15:25                       ` Eric Schulte
2013-04-15 19:27                         ` Sebastien Vauban
2013-04-04 18:35                 ` Rick Frankel
2013-04-04 21:05                   ` Sebastien Vauban
2013-04-04 19:29                 ` Achim Gratz
2013-04-06 16:29                   ` Eric Schulte
2013-04-06 17:07                     ` Eric Schulte
2013-04-06 17:24                     ` Bastien
2013-04-06 17:39                       ` Eric Schulte
2013-04-04 18:30               ` Rick Frankel
2013-04-04 20:27                 ` Sebastien Vauban

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=87r4ixah7y.fsf@gmail.com \
    --to=schulte.eric@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).