|
@@ -340,7 +340,7 @@ This includes header arguments, language and name, and is largely
|
|
|
a window into the `org-babel-get-src-block-info' function."
|
|
|
(interactive)
|
|
|
(let ((info (org-babel-get-src-block-info 'light)))
|
|
|
- (flet ((full (it) (> (length it) 0))
|
|
|
+ (org-flet ((full (it) (> (length it) 0))
|
|
|
(printf (fmt &rest args) (princ (apply #'format fmt args))))
|
|
|
(when info
|
|
|
(with-help-window (help-buffer)
|
|
@@ -536,9 +536,9 @@ block."
|
|
|
(indent (car (last info)))
|
|
|
result cmd)
|
|
|
(unwind-protect
|
|
|
- (flet ((call-process-region (&rest args)
|
|
|
+ (org-flet ((call-process-region (&rest args)
|
|
|
(apply 'org-babel-tramp-handle-call-process-region args)))
|
|
|
- (flet ((lang-check (f)
|
|
|
+ (org-flet ((lang-check (f)
|
|
|
(let ((f (intern (concat "org-babel-execute:" f))))
|
|
|
(when (fboundp f) f))))
|
|
|
(setq cmd
|
|
@@ -618,7 +618,7 @@ arguments and pop open the results in a preview buffer."
|
|
|
(l2 (length s2))
|
|
|
(dist (map 'vector (lambda (_) (make-vector (1+ l2) nil))
|
|
|
(number-sequence 1 (1+ l1)))))
|
|
|
- (flet ((in (i j) (aref (aref dist i) j))
|
|
|
+ (org-flet ((in (i j) (aref (aref dist i) j))
|
|
|
(mmin (&rest lst) (apply #'min (remove nil lst))))
|
|
|
(setf (aref (aref dist 0) 0) 0)
|
|
|
(dolist (i (number-sequence 1 l1))
|
|
@@ -789,7 +789,7 @@ with a prefix argument then this is passed on to
|
|
|
(defun org-babel-switch-to-session-with-code (&optional arg info)
|
|
|
"Switch to code buffer and display session."
|
|
|
(interactive "P")
|
|
|
- (flet ((swap-windows
|
|
|
+ (org-flet ((swap-windows
|
|
|
()
|
|
|
(let ((other-window-buffer (window-buffer (next-window))))
|
|
|
(set-window-buffer (next-window) (current-buffer))
|
|
@@ -1017,7 +1017,7 @@ the current subtree."
|
|
|
(setf (nth 2 info)
|
|
|
(sort (copy-sequence (nth 2 info))
|
|
|
(lambda (a b) (string< (car a) (car b)))))
|
|
|
- (labels ((rm (lst)
|
|
|
+ (org-labels ((rm (lst)
|
|
|
(dolist (p '("replace" "silent" "append" "prepend"))
|
|
|
(setq lst (remove p lst)))
|
|
|
lst)
|
|
@@ -1264,7 +1264,7 @@ ALTS is a cons of two character options where each option may be
|
|
|
either the numeric code of a single character or a list of
|
|
|
character alternatives. For example to split on balanced
|
|
|
instances of \"[ \t]:\" set ALTS to '((32 9) . 58)."
|
|
|
- (flet ((matches (ch spec) (if (listp spec) (member ch spec) (equal spec ch)))
|
|
|
+ (org-flet ((matches (ch spec) (if (listp spec) (member ch spec) (equal spec ch)))
|
|
|
(matched (ch last)
|
|
|
(if (consp alts)
|
|
|
(and (matches ch (cdr alts))
|
|
@@ -1292,7 +1292,7 @@ instances of \"[ \t]:\" set ALTS to '((32 9) . 58)."
|
|
|
|
|
|
(defun org-babel-join-splits-near-ch (ch list)
|
|
|
"Join splits where \"=\" is on either end of the split."
|
|
|
- (flet ((last= (str) (= ch (aref str (1- (length str)))))
|
|
|
+ (org-flet ((last= (str) (= ch (aref str (1- (length str)))))
|
|
|
(first= (str) (= ch (aref str 0))))
|
|
|
(reverse
|
|
|
(org-reduce (lambda (acc el)
|
|
@@ -1389,7 +1389,7 @@ names."
|
|
|
Return a cons cell, the `car' of which contains the TABLE less
|
|
|
colnames, and the `cdr' of which contains a list of the column
|
|
|
names. Note: this function removes any hlines in TABLE."
|
|
|
- (flet ((trans (table) (apply #'mapcar* #'list table)))
|
|
|
+ (org-flet ((trans (table) (apply #'mapcar* #'list table)))
|
|
|
(let* ((width (apply 'max
|
|
|
(mapcar (lambda (el) (if (listp el) (length el) 0)) table)))
|
|
|
(table (trans (mapcar (lambda (row)
|
|
@@ -1826,7 +1826,7 @@ If the path of the link is a file path it is expanded using
|
|
|
|
|
|
(defun org-babel-format-result (result &optional sep)
|
|
|
"Format RESULT for writing to file."
|
|
|
- (flet ((echo-res (result)
|
|
|
+ (org-flet ((echo-res (result)
|
|
|
(if (stringp result) result (format "%S" result))))
|
|
|
(if (listp result)
|
|
|
;; table result
|
|
@@ -1933,7 +1933,7 @@ code ---- the results are extracted in the syntax of the source
|
|
|
((member "prepend" result-params)))) ; already there
|
|
|
(setq results-switches
|
|
|
(if results-switches (concat " " results-switches) ""))
|
|
|
- (flet ((wrap (start finish)
|
|
|
+ (org-flet ((wrap (start finish)
|
|
|
(goto-char end) (insert (concat finish "\n"))
|
|
|
(goto-char beg) (insert (concat start "\n"))
|
|
|
(goto-char end) (goto-char (point-at-eol))
|
|
@@ -2058,7 +2058,7 @@ file's directory then expand relative links."
|
|
|
(defun org-babel-examplize-region (beg end &optional results-switches)
|
|
|
"Comment out region using the inline '==' or ': ' org example quote."
|
|
|
(interactive "*r")
|
|
|
- (flet ((chars-between (b e)
|
|
|
+ (org-flet ((chars-between (b e)
|
|
|
(not (string-match "^[\\s]*$" (buffer-substring b e))))
|
|
|
(maybe-cap (str) (if org-babel-capitalize-examplize-region-markers
|
|
|
(upcase str) str)))
|
|
@@ -2106,7 +2106,7 @@ parameters when merging lists."
|
|
|
(cdr (assoc 'exports org-babel-common-header-args-w-values))))
|
|
|
(variable-index 0)
|
|
|
params results exports tangle noweb cache vars shebang comments padline)
|
|
|
- (flet ((e-merge (exclusive-groups &rest result-params)
|
|
|
+ (org-flet ((e-merge (exclusive-groups &rest result-params)
|
|
|
;; maintain exclusivity of mutually exclusive parameters
|
|
|
(let (output)
|
|
|
(mapc (lambda (new-params)
|
|
@@ -2218,11 +2218,11 @@ header argument from buffer or subtree wide properties.")
|
|
|
(defun org-babel-noweb-p (params context)
|
|
|
"Check if PARAMS require expansion in CONTEXT.
|
|
|
CONTEXT may be one of :tangle, :export or :eval."
|
|
|
- (flet ((intersect (as bs)
|
|
|
- (when as
|
|
|
- (if (member (car as) bs)
|
|
|
- (car as)
|
|
|
- (intersect (cdr as) bs)))))
|
|
|
+ (org-labels ((intersect (as bs)
|
|
|
+ (when as
|
|
|
+ (if (member (car as) bs)
|
|
|
+ (car as)
|
|
|
+ (intersect (cdr as) bs)))))
|
|
|
(intersect (case context
|
|
|
(:tangle '("yes" "tangle" "no-export" "strip-export"))
|
|
|
(:eval '("yes" "no-export" "strip-export" "eval"))
|
|
@@ -2267,7 +2267,7 @@ block but are passed literally to the \"example-block\"."
|
|
|
(rx-prefix (concat "\\(" org-babel-src-name-regexp "\\|"
|
|
|
":noweb-ref[ \t]+" "\\)"))
|
|
|
(new-body "") index source-name evaluate prefix blocks-in-buffer)
|
|
|
- (flet ((nb-add (text) (setq new-body (concat new-body text)))
|
|
|
+ (org-flet ((nb-add (text) (setq new-body (concat new-body text)))
|
|
|
(c-wrap (text)
|
|
|
(with-temp-buffer
|
|
|
(funcall (intern (concat lang "-mode")))
|