summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2011-03-01 10:31:00 -0700
committerEric Schulte <schulte.eric@gmail.com>2011-03-01 10:31:00 -0700
commitb6912331715c7da08927b3636b6721af5f5e0c41 (patch)
treec011a3d87eed3cba21387aa5b5d872b2471914f5
parent750502e3bfdfa084c79b23cb10a82909fc097c23 (diff)
downloadorg-mode-b6912331715c7da08927b3636b6721af5f5e0c41.tar.gz
ob: allow passing elisp vectors through to code blocks
* lisp/ob.el (org-babel-read): Pass elisp vectors through to code blocks.
-rw-r--r--lisp/ob.el13
1 files changed, 6 insertions, 7 deletions
diff --git a/lisp/ob.el b/lisp/ob.el
index ea1c968..b0b5fb6 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -1913,16 +1913,15 @@ block but are passed literally to the \"example-block\"."
(defun org-babel-read (cell &optional inhibit-lisp-eval)
"Convert the string value of CELL to a number if appropriate.
-Otherwise if cell looks like lisp (meaning it starts with a \"(\"
-or a \"'\") then read it as lisp, otherwise return it unmodified
-as a string. Optional argument NO-LISP-EVAL inhibits lisp
-evaluation for situations in which is it not appropriate."
+Otherwise if cell looks like lisp (meaning it starts with a
+\"(\", \"'\", \"`\" or a \"[\") then read it as lisp, otherwise
+return it unmodified as a string. Optional argument NO-LISP-EVAL
+inhibits lisp evaluation for situations in which is it not
+appropriate."
(if (and (stringp cell) (not (equal cell "")))
(or (org-babel-number-p cell)
(if (and (not inhibit-lisp-eval)
- (or (equal "(" (substring cell 0 1))
- (equal "'" (substring cell 0 1))
- (equal "`" (substring cell 0 1))))
+ (member (substring cell 0 1) '("(" "'" "`" "[")))
(eval (read cell))
(progn (set-text-properties 0 (length cell) nil cell) cell)))
cell))