Fix bug with org-goto in buffer without file

Paul Griepentrog writes:

> Every once in a while I use org-mode in a buffer that is not
> associated with a file... and then org-goto gets confused.  To repeat:
>
> BUFFER-NO-FILE
> ---------------
> * One
>   - a
> * Two
>   - b
> ---------------
>
> M-x org-mode
> C-c C-j
> org-get-refile-targets: Wrong type argument: stringp, nil
>
> [...]
>
> This patch fixes it:
This commit is contained in:
Carsten Dominik 2009-12-10 09:18:19 +01:00
parent e5942e12d6
commit 0077ce97ea
2 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2009-12-10 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-get-refile-targets): Catch the case when a buffer
has no file.
* org-latex.el (org-export-as-latex): Cleanup forced line ends
where they are not needed.
(org-export-latex-subcontent): Remove unnecessary newlines.

View File

@ -8986,7 +8986,7 @@ on the system \"/user@host:\"."
(with-current-buffer
(if (bufferp f) f (org-get-agenda-file-buffer f))
(if (bufferp f) (setq f (buffer-file-name (buffer-base-buffer f))))
(setq f (expand-file-name f))
(setq f (and f (expand-file-name f)))
(if (eq org-refile-use-outline-path 'file)
(push (list (file-name-nondirectory f) f nil nil) targets))
(save-excursion