Browse Source

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.
Bastien Guerry 7 years ago
parent
commit
966447c454
2 changed files with 8 additions and 8 deletions
  1. 4 4
      lisp/ob-awk.el
  2. 4 4
      lisp/ob-sh.el

+ 4 - 4
lisp/ob-awk.el

@@ -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

+ 4 - 4
lisp/ob-sh.el

@@ -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.