summaryrefslogtreecommitdiff
path: root/lisp/org/ob-table.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2022-11-29 23:05:53 -0500
committerKyle Meyer <kyle@kyleam.com>2022-11-29 23:05:53 -0500
commit0625651e8a61c9effc31ff771f15885a3a37c6e6 (patch)
treedb4c09e8ef119ad4a9a4028c5e615fd58d2dee69 /lisp/org/ob-table.el
parentedd64e64a389e0f0e6ce670846d4fae79a9d8b35 (diff)
downloademacs-0625651e8a61c9effc31ff771f15885a3a37c6e6.tar.gz
emacs-0625651e8a61c9effc31ff771f15885a3a37c6e6.tar.bz2
emacs-0625651e8a61c9effc31ff771f15885a3a37c6e6.zip
Update to Org 9.6-3-ga4d38e
Diffstat (limited to 'lisp/org/ob-table.el')
-rw-r--r--lisp/org/ob-table.el75
1 files changed, 39 insertions, 36 deletions
diff --git a/lisp/org/ob-table.el b/lisp/org/ob-table.el
index f6729e0ece7..e14117cd3bb 100644
--- a/lisp/org/ob-table.el
+++ b/lisp/org/ob-table.el
@@ -4,7 +4,7 @@
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
-;; Homepage: https://orgmode.org
+;; URL: https://orgmode.org
;; This file is part of GNU Emacs.
@@ -53,6 +53,10 @@
;; are optional.
;;; Code:
+
+(require 'org-macs)
+(org-assert-version)
+
(require 'ob-core)
(require 'org-macs)
@@ -108,44 +112,43 @@ as shown in the example below.
;; ensure that all cells prefixed with $'s are strings
(cons (car var)
(delq nil (mapcar
- (lambda (el)
- (if (eq '$ el)
- (prog1 nil (setq quote t))
- (prog1
- (cond
- (quote (format "\"%s\"" el))
- ((stringp el) (org-no-properties el))
- (t el))
- (setq quote nil))))
- (cdr var)))))
+ (lambda (el)
+ (if (eq '$ el)
+ (prog1 nil (setq quote t))
+ (prog1
+ (cond
+ (quote (format "\"%s\"" el))
+ ((stringp el) (org-no-properties el))
+ (t el))
+ (setq quote nil))))
+ (cdr var)))))
variables)))
(unless (stringp source-block)
(setq source-block (symbol-name source-block)))
- (let ((result
- (if (and source-block (> (length source-block) 0))
- (let ((params
- ;; FIXME: Why `eval'?!?!?
- (eval `(org-babel-parse-header-arguments
- (concat
- ":var results="
- ,source-block
- "[" ,header-args "]"
- "("
- (mapconcat
- (lambda (var-spec)
- (if (> (length (cdr var-spec)) 1)
- (format "%S='%S"
- (car var-spec)
- (mapcar #'read (cdr var-spec)))
- (format "%S=%s"
- (car var-spec) (cadr var-spec))))
- ',variables ", ")
- ")")))))
- (org-babel-execute-src-block
- nil (list "emacs-lisp" "results" params)
- '((:results . "silent"))))
- "")))
- (org-trim (if (stringp result) result (format "%S" result)))))))
+ `(let ((result
+ (if ,(and source-block (> (length source-block) 0))
+ (let ((params
+ ',(org-babel-parse-header-arguments
+ (concat
+ ":var results="
+ source-block
+ "[" header-args "]"
+ "("
+ (mapconcat
+ (lambda (var-spec)
+ (if (> (length (cdr var-spec)) 1)
+ (format "%S='%S"
+ (car var-spec)
+ (mapcar #'read (cdr var-spec)))
+ (format "%S=%s"
+ (car var-spec) (cadr var-spec))))
+ variables ", ")
+ ")"))))
+ (org-babel-execute-src-block
+ nil (list "emacs-lisp" "results" params)
+ '((:results . "silent"))))
+ "")))
+ (org-trim (if (stringp result) result (format "%S" result)))))))
(provide 'ob-table)