diff --git a/lisp/ob.el b/lisp/ob.el index cdbce127e..56f6b5bae 100644 --- a/lisp/ob.el +++ b/lisp/ob.el @@ -749,31 +749,38 @@ the current subtree." (setf (nth 2 info) (sort (copy-sequence (nth 2 info)) (lambda (a b) (string< (car a) (car b))))) - ((lambda (hash) - (when (org-called-interactively-p 'interactive) (message hash)) - hash) - (sha1 (format "%s-%s" - (mapconcat - #'identity - (delq nil - (mapcar - (lambda (arg) - (let ((v (cdr arg))) - (when (and v (not (and (sequencep v) - (not (consp v)) - (= (length v) 0)))) - ((lambda (el) (format "%S" el)) - (cond - ((and (listp v) ; lists are sorted - (member (car arg) '(:result-params))) - (sort (copy-sequence v) #'string<)) - ((and (stringp v) ; strings are sorted - (member (car arg) '(:results :exports))) - (mapconcat #'identity (sort (split-string v) - #'string<) " ")) - (t v)))))) ; atomic are left untouched - (nth 2 info))) ":") - (nth 1 info)))))) + (labels ((rm (lst) + (dolist (p '("replace" "silent" "append" "prepend")) + (setq lst (remove p lst))) + lst) + (norm (arg) + (let ((v (if (listp (cdr arg)) + (copy-seq (cdr arg)) + (cdr arg)))) + (when (and v (not (and (sequencep v) + (not (consp v)) + (= (length v) 0)))) + (cond + ((and (listp v) ; lists are sorted + (member (car arg) '(:result-params))) + (sort (rm v) #'string<)) + ((and (stringp v) ; strings are sorted + (member (car arg) '(:results :exports))) + (mapconcat #'identity (sort (rm (split-string v)) + #'string<) " ")) + (t v)))))) + ((lambda (hash) + (when (org-called-interactively-p 'interactive) (message hash)) hash) + (let ((it (format "%s-%s" + (mapconcat + #'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) "Return the in-buffer hash associated with INFO."