Przeglądaj źródła

Remember: Safer way to access new buffer.

The remember handler was creating a buffer with `find-file-noselect',
and then trying to find it back using `get-file-buffer'.  Apparently
there are situations where this can fail, to we now use directly the
buffer returned by `find-file-noselect'.
Carsten Dominik 16 lat temu
rodzic
commit
28c6318dba
2 zmienionych plików z 4 dodań i 2 usunięć
  1. 3 0
      lisp/ChangeLog
  2. 1 2
      lisp/org-remember.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2008-12-23  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* 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.
 

+ 1 - 2
lisp/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