mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-12-27 10:55:04 +00:00
Don't use `org-flet' in ob-awk.el and ob-sh.el
* ob-awk.el (org-babel-awk-var-to-awk): Don't use `org-flet'. * ob-sh.el (org-babel-sh-var-to-string): Ditto.
This commit is contained in:
parent
1edf05f14c
commit
966447c454
@ -97,13 +97,13 @@ called by `org-babel-execute-src-block'"
|
||||
|
||||
(defun org-babel-awk-var-to-awk (var &optional sep)
|
||||
"Return a printed value of VAR suitable for parsing with awk."
|
||||
(org-flet ((echo-var (v) (if (stringp v) v (format "%S" v))))
|
||||
(let ((echo-var (lambda (v) (if (stringp v) v (format "%S" v)))))
|
||||
(cond
|
||||
((and (listp var) (listp (car var)))
|
||||
(orgtbl-to-generic var (list :sep (or sep "\t") :fmt #'echo-var)))
|
||||
(orgtbl-to-generic var (list :sep (or sep "\t") :fmt echo-var)))
|
||||
((listp var)
|
||||
(mapconcat #'echo-var var "\n"))
|
||||
(t (echo-var var)))))
|
||||
(mapconcat echo-var var "\n"))
|
||||
(t (funcall echo-var var)))))
|
||||
|
||||
(defun org-babel-awk-table-or-string (results)
|
||||
"If the results look like a table, then convert them into an
|
||||
|
@ -107,13 +107,13 @@ var of the same value."
|
||||
|
||||
(defun org-babel-sh-var-to-string (var &optional sep)
|
||||
"Convert an elisp value to a string."
|
||||
(org-flet ((echo-var (v) (if (stringp v) v (format "%S" v))))
|
||||
(let ((echo-var (lambda (v) (if (stringp v) v (format "%S" v)))))
|
||||
(cond
|
||||
((and (listp var) (listp (car var)))
|
||||
(orgtbl-to-generic var (list :sep (or sep "\t") :fmt #'echo-var)))
|
||||
(orgtbl-to-generic var (list :sep (or sep "\t") :fmt echo-var)))
|
||||
((listp var)
|
||||
(mapconcat #'echo-var var "\n"))
|
||||
(t (echo-var var)))))
|
||||
(mapconcat echo-var var "\n"))
|
||||
(t (funcall echo-var var)))))
|
||||
|
||||
(defun org-babel-sh-table-or-results (results)
|
||||
"Convert RESULTS to an appropriate elisp value.
|
||||
|
Loading…
Reference in New Issue
Block a user