Function: org-babel-read

org-babel-read is a byte-compiled function defined in ob-core.el.gz.

Signature

(org-babel-read CELL &optional INHIBIT-LISP-EVAL)

Documentation

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 and evaluate it as
lisp, otherwise return it unmodified as a string. Optional argument INHIBIT-LISP-EVAL inhibits lisp evaluation for situations in which is it not appropriate.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ob-core.el.gz
(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 and evaluate it as
lisp, otherwise return it unmodified as a string.  Optional
argument INHIBIT-LISP-EVAL inhibits lisp evaluation for
situations in which is it not appropriate."
  (cond ((not (org-string-nw-p cell)) cell)
	((org-babel--string-to-number cell))
	((and (not inhibit-lisp-eval)
	      (or (memq (string-to-char cell) '(?\( ?' ?` ?\[))
		  (string= cell "*this*")))
         ;; FIXME: Arbitrary code evaluation.
	 (eval (read cell) t))
	((save-match-data
           (and (string-match "^[[:space:]]*\"\\(.*\\)\"[[:space:]]*$" cell)
                (not (string-match "[^\\]\"" (match-string 1 cell)))))
         (read cell))
	(t (org-no-properties cell))))