org-refile: Fix inconsistency when listing refile targets

* org.el (org-refile-get-targets): Setting org-refile-use-outline-path
to `file' or `buffer-name' causes an additional target for the file’s
root node to be inserted. This functionality was absent when using
`full-file-path'. We now add this since it is convenient and makes the
behavior more consistent.
This commit is contained in:
Sebastian Reuße 2017-05-15 14:54:55 +02:00 committed by Nicolas Goaziou
parent 865ac0952b
commit 2906e50177
1 changed files with 2 additions and 0 deletions

View File

@ -11563,6 +11563,8 @@ order.")
(push (list (file-name-nondirectory f) f nil nil) tgs)) (push (list (file-name-nondirectory f) f nil nil) tgs))
(when (eq org-refile-use-outline-path 'buffer-name) (when (eq org-refile-use-outline-path 'buffer-name)
(push (list (buffer-name (buffer-base-buffer)) f nil nil) tgs)) (push (list (buffer-name (buffer-base-buffer)) f nil nil) tgs))
(when (eq org-refile-use-outline-path 'full-file-path)
(push (list (file-truename (buffer-file-name (buffer-base-buffer))) f nil nil) tgs))
(org-with-wide-buffer (org-with-wide-buffer
(goto-char (point-min)) (goto-char (point-min))
(setq org-outline-path-cache nil) (setq org-outline-path-cache nil)