소스 검색

ob: hash construction invariant to order of header arguments

Eric Schulte 14 년 전
부모
커밋
fbb828a107
1개의 변경된 파일11개의 추가작업 그리고 3개의 파일을 삭제
  1. 11 3
      lisp/ob.el

+ 11 - 3
lisp/ob.el

@@ -596,9 +596,17 @@ the current subtree."
   "Generate an sha1 hash based on the value of info."
   (interactive)
   (let* ((info (or info (org-babel-get-src-block-info)))
-         (hash (sha1 (format "%s-%s" (mapconcat (lambda (arg) (format "%S" arg))
-                                                (nth 2 info) ":")
-                             (nth 1 info)))))
+         (hash (sha1
+		(format "%s-%s"
+			(mapconcat
+			 (lambda (arg)
+			   (if (stringp (cdr arg))
+			       (mapconcat
+				#'identity
+				(sort (split-string (cdr arg)) #'string<) " ")
+			     (cdr arg)))
+			 (nth 2 info) ":")
+			(nth 1 info)))))
     (when (interactive-p) (message hash))
     hash))