Browse Source

babel: don't prematurely remove existing results when not caching

* lisp/ob.el (org-babel-where-is-src-block-result): be sure not to
  remove existing results when the there is no cache header arg
Eric Schulte 14 năm trước cách đây
mục cha
commit
9271692869
1 tập tin đã thay đổi với 7 bổ sung6 xóa
  1. 7 6
      lisp/ob.el

+ 7 - 6
lisp/ob.el

@@ -1013,12 +1013,13 @@ following the source block."
 			    (concat org-babel-result-regexp "\n")))
 			 (prog1 (point)
 			   ;; must remove and rebuild if hash!=old-hash
-			   (unless (or (not hash)
-				       (string= hash (match-string 3)))
-			     (forward-line 1)
-			     (delete-region
-			      end (org-babel-result-end)) nil))))))))
-      (if insert
+			   (if (and hash (not (string= hash (match-string 3))))
+			       (prog1 nil
+				 (forward-line 1)
+				 (delete-region
+				  end (org-babel-result-end)))
+			     (setq end nil)))))))))
+      (if (and insert end)
 	  (progn
 	    (goto-char end)
 	    (unless beg