From: Carsten Dominik Date: Tue, 23 Dec 2008 23:12:31 +0000 (+0000) Subject: 2008-12-23 Carsten Dominik X-Git-Tag: emacs-pretest-23.0.90~884 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bb31cb3171af96b927917937e94308dd7350af46;p=emacs.git 2008-12-23 Carsten Dominik * org-remember.el (org-remember-handler): Safer way to get a new buffer accessing the target file. * org.el (org-refile-get-location): Handle case of current buffer not having a file associated with it. --- diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog index 2fa968f04cc..9cee6b02a2a 100644 --- a/lisp/org/ChangeLog +++ b/lisp/org/ChangeLog @@ -1,3 +1,11 @@ +2008-12-23 Carsten Dominik + + * org-remember.el (org-remember-handler): Safer way to get a new + buffer accessing the target file. + + * org.el (org-refile-get-location): Handle case of current buffer + not having a file associated with it. + 2008-12-22 Carsten Dominik * org-table.el (org-table-get-formula): Only ask to overwrite diff --git a/lisp/org/org-remember.el b/lisp/org/org-remember.el index c9575e4b852..44d8c7f0c9e 100644 --- a/lisp/org/org-remember.el +++ b/lisp/org/org-remember.el @@ -809,8 +809,7 @@ See also the variable `org-reverse-note-order'." (move-marker org-remember-last-stored-marker (point))) (throw 'quit t)) ;; Find the file - (if (not visiting) (find-file-noselect file)) - (with-current-buffer (or visiting (get-file-buffer file)) + (with-current-buffer (or visiting (find-file-noselect file)) (unless (org-mode-p) (error "Target files for remember notes must be in Org-mode")) (save-excursion diff --git a/lisp/org/org.el b/lisp/org/org.el index 2e2f9533666..a0d3e8d9b28 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -7668,13 +7668,13 @@ operation has put the subtree." (unless org-refile-target-table (error "No refile targets")) (let* ((cbuf (current-buffer)) + (cfn (buffer-file-name (buffer-base-buffer cbuf))) (cfunc (if (and org-refile-use-outline-path org-outline-path-complete-in-steps) 'org-olpath-completing-read 'org-ido-completing-read)) (extra (if org-refile-use-outline-path "/" "")) - (filename (expand-file-name - (buffer-file-name (buffer-base-buffer cbuf)))) + (filename (and cfn (expand-file-name cfn))) (tbl (mapcar (lambda (x) (if (not (equal filename (nth 1 x)))