From fe5c0d96c679601fe24d53a54ff1613d24a60020 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Mon, 28 Sep 2009 23:18:01 -0400 Subject: [PATCH] org-babel: tightening up insertion of results Previously, altering the name of a source block, followed by C-c C-c, did not alter the name of the corresponding results. --- contrib/babel/lisp/org-babel.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/contrib/babel/lisp/org-babel.el b/contrib/babel/lisp/org-babel.el index 7d203f96..574c98cd 100644 --- a/contrib/babel/lisp/org-babel.el +++ b/contrib/babel/lisp/org-babel.el @@ -488,10 +488,11 @@ line. If no result exists for this block then create a (progn (move-end-of-line 1) (if (eobp) (insert "\n") (forward-char 1)) (setq end (point)) - (or (progn ;; either an unnamed #+resname: line already exists - (re-search-forward "[^ \f\t\n\r\v]" nil t) - (move-beginning-of-line 1) (looking-at "#\\+resname:")) - ;; or (with optional insert) we need to back up and make one ourselves + (or (and (not name) + (progn ;; either the unnamed #+resname: line already exists + (re-search-forward "[^ \f\t\n\r\v]" nil t) + (move-beginning-of-line 1) (looking-at "#\\+resname:\n"))) + ;; or (with optional insert) we need to back up and make one ourselves (when insert (goto-char end) (open-line 2) (forward-char 1) (insert (concat "#+resname:" (if name (concat " " name)) "\n")) -- 2.11.4.GIT