mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-07-16 10:16:26 +00:00
ob: not including export-variable headers in cache sha1
* lisp/ob.el (org-babel-sha1-hash): Improving code layout and removing export-variable headers in cache sha1.
This commit is contained in:
parent
dacf18e80a
commit
6ddad0a91a
57
lisp/ob.el
57
lisp/ob.el
|
@ -749,31 +749,38 @@ the current subtree."
|
||||||
(setf (nth 2 info)
|
(setf (nth 2 info)
|
||||||
(sort (copy-sequence (nth 2 info))
|
(sort (copy-sequence (nth 2 info))
|
||||||
(lambda (a b) (string< (car a) (car b)))))
|
(lambda (a b) (string< (car a) (car b)))))
|
||||||
((lambda (hash)
|
(labels ((rm (lst)
|
||||||
(when (org-called-interactively-p 'interactive) (message hash))
|
(dolist (p '("replace" "silent" "append" "prepend"))
|
||||||
hash)
|
(setq lst (remove p lst)))
|
||||||
(sha1 (format "%s-%s"
|
lst)
|
||||||
(mapconcat
|
(norm (arg)
|
||||||
#'identity
|
(let ((v (if (listp (cdr arg))
|
||||||
(delq nil
|
(copy-seq (cdr arg))
|
||||||
(mapcar
|
(cdr arg))))
|
||||||
(lambda (arg)
|
(when (and v (not (and (sequencep v)
|
||||||
(let ((v (cdr arg)))
|
(not (consp v))
|
||||||
(when (and v (not (and (sequencep v)
|
(= (length v) 0))))
|
||||||
(not (consp v))
|
(cond
|
||||||
(= (length v) 0))))
|
((and (listp v) ; lists are sorted
|
||||||
((lambda (el) (format "%S" el))
|
(member (car arg) '(:result-params)))
|
||||||
(cond
|
(sort (rm v) #'string<))
|
||||||
((and (listp v) ; lists are sorted
|
((and (stringp v) ; strings are sorted
|
||||||
(member (car arg) '(:result-params)))
|
(member (car arg) '(:results :exports)))
|
||||||
(sort (copy-sequence v) #'string<))
|
(mapconcat #'identity (sort (rm (split-string v))
|
||||||
((and (stringp v) ; strings are sorted
|
#'string<) " "))
|
||||||
(member (car arg) '(:results :exports)))
|
(t v))))))
|
||||||
(mapconcat #'identity (sort (split-string v)
|
((lambda (hash)
|
||||||
#'string<) " "))
|
(when (org-called-interactively-p 'interactive) (message hash)) hash)
|
||||||
(t v)))))) ; atomic are left untouched
|
(let ((it (format "%s-%s"
|
||||||
(nth 2 info))) ":")
|
(mapconcat
|
||||||
(nth 1 info))))))
|
#'identity
|
||||||
|
(delq nil (mapcar (lambda (arg)
|
||||||
|
(let ((normalized (norm arg)))
|
||||||
|
(when normalized
|
||||||
|
(format "%S" normalized))))
|
||||||
|
(nth 2 info))) ":")
|
||||||
|
(nth 1 info))))
|
||||||
|
(sha1 it))))))
|
||||||
|
|
||||||
(defun org-babel-result-hash (&optional info)
|
(defun org-babel-result-hash (&optional info)
|
||||||
"Return the in-buffer hash associated with INFO."
|
"Return the in-buffer hash associated with INFO."
|
||||||
|
|
Loading…
Reference in a new issue