From: "Sébastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: org-babel-read should have option NOT to interpret as elisp
Date: Mon, 28 Feb 2011 11:07:27 +0100 [thread overview]
Message-ID: <801v2sqxpc.fsf@somewhere.org> (raw)
In-Reply-To: 877hclbgxz.fsf@gmail.com
Hi Eric,
"Eric Schulte" wrote:
> However I do agree that this would be onerous to have to wrap every cell of
> a table in double quotes...
Aren't we forced to do so, right now? As in the following home-made example:
#+TITLE: Show differences between files
* Code
Assuming you have two directories (namely =xhtml-dir= and =xhtml-dir-bak=,
accessible from this local directory), the following blocks of code will
compare named files (see column 2 of table) in them, in both /text/ and
/binary/ versions.
#+srcname: diff-text
#+begin_src sh :var file=""
diff -sq --strip-trailing-cr xhtml-dir/$file xhtml-dir-bak/$file > /dev/null
case "$?" in
0) echo "identical";;
1) echo "differ";;
2) echo "no such file";;
*) echo "?";;
esac
#+end_src
#+srcname: diff-binary
#+begin_src sh :var file=""
diff -sq xhtml-dir/$file xhtml-dir-bak/$file > /dev/null
case "$?" in
0) echo "identical";;
1) echo "differ";;
2) echo "no such file";;
*) echo "?";;
esac
#+end_src
* Results
| FPH | File | Text | Binary |
|-----+-------------------------------+-----------+-----------|
| M | "Icopreations.xhtml" | identical | identical |
| M | "Ocuevaonspfiessai.xhtml" | identical | differ |
| M | "Ocuevain-tut.xhtml" | differ | differ |
| M | "Ocuevatagessai.xhtml" | identical | differ |
| M | "Ocuf2-stg.xhtml" | differ | differ |
| M | "Ocurolro.xhtml" | identical | differ |
| M | "Ocuroliers.xhtml" | differ | differ |
| M | "Ocurolredit.xhtml" | identical | differ |
| M | "Ocusigletiquebc1233de.xhtml" | differ | differ |
| M | "Rocsaieprestations.xhtml" | identical | identical |
#+TBLFM: $3='(sbe diff-text (file $2))::$4='(sbe diff-binary (file $2))
I had to enclose the filenames between double quotes, for the =sbe= code to
work.
Trying what you wrote on
http://eschulte.github.com/babel-dev/DONE-literal-values-from-tables.html,
that is using $$2 instead of $2 has the following behavior: when evaluating
the table, Org prompts me for a "Lisp expression"!?
Best regards,
Seb
--
Sébastien Vauban
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
next prev parent reply other threads:[~2011-02-28 10:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-27 14:14 org-babel-read should have option NOT to interpret as elisp Vladimir Alexiev
2011-02-27 15:51 ` Eric Schulte
2011-02-27 23:28 ` Vladimir Alexiev
2011-02-27 23:44 ` Eric Schulte
2011-02-28 0:30 ` Vladimir Alexiev
2011-03-01 3:11 ` Eric Schulte
2011-03-01 12:19 ` Vladimir Alexiev
2011-03-01 16:58 ` Eric Schulte
2011-03-02 7:20 ` Vladimir Alexiev
2011-03-02 14:56 ` Eric Schulte
2011-02-28 10:07 ` Sébastien Vauban [this message]
2011-03-01 3:10 ` Eric Schulte
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=801v2sqxpc.fsf@somewhere.org \
--to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
--cc=emacs-orgmode-mXXj517/zsQ@public.gmane.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).