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
This commit is contained in:
Eric Schulte 2010-07-12 14:38:35 -07:00
parent e8033b7f04
commit 9271692869
1 changed files with 7 additions and 6 deletions

View File

@ -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