From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [PATCH] Process hlines in imported tables Date: Fri, 29 Mar 2013 18:01:21 -0600 Message-ID: <87r4ixah7y.fsf@gmail.com> References: <20130329014615.GA49671@BigDog.local> <87wqsq6yd1.fsf@gmail.com> <20130329214238.GA53401@BigDog.local> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:57116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULjEr-00083L-4h for emacs-orgmode@gnu.org; Fri, 29 Mar 2013 20:01:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULjEp-0005tI-26 for emacs-orgmode@gnu.org; Fri, 29 Mar 2013 20:01:41 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:54374) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULjEo-0005tC-Rp for emacs-orgmode@gnu.org; Fri, 29 Mar 2013 20:01:38 -0400 Received: by mail-pa0-f44.google.com with SMTP id bi5so537588pad.31 for ; Fri, 29 Mar 2013 17:01:38 -0700 (PDT) In-Reply-To: <20130329214238.GA53401@BigDog.local> (Rick Frankel's message of "Fri, 29 Mar 2013 17:42:38 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Rick Frankel writes: > On Fri, Mar 29, 2013 at 09:04:42AM -0600, Eric Schulte wrote: >> Rick Frankel 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). --=-=-= Content-Type: text/x-org Content-Disposition: inline; filename=cache.org * 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: --=-=-= Content-Type: text/plain Cheers, -- Eric Schulte http://cs.unm.edu/~eschulte --=-=-=--