Make org-refile interface for jumping to a target work before first heading

* lisp/org.el (org-refile-get-location): Ignore errors when
collection heading to be excluded.
This commit is contained in:
Carsten Dominik 2011-10-05 16:18:18 +02:00
parent ee3a68216b
commit 1790d6c073
1 changed files with 9 additions and 4 deletions

View File

@ -10477,7 +10477,8 @@ prefix argument (`C-u C-u C-u C-c C-w')."
(cond (goto "Goto") (cond (goto "Goto")
(regionp "Refile region to") (regionp "Refile region to")
(t "Refile subtree to")) default-buffer (t "Refile subtree to")) default-buffer
org-refile-allow-creating-parent-nodes))))) org-refile-allow-creating-parent-nodes
goto)))))
(setq file (nth 1 it) (setq file (nth 1 it)
re (nth 2 it) re (nth 2 it)
pos (nth 3 it)) pos (nth 3 it))
@ -10556,16 +10557,20 @@ prefix argument (`C-u C-u C-u C-c C-w')."
(bookmark-jump "org-refile-last-stored") (bookmark-jump "org-refile-last-stored")
(message "This is the location of the last refile")) (message "This is the location of the last refile"))
(defun org-refile-get-location (&optional prompt default-buffer new-nodes) (defun org-refile-get-location (&optional prompt default-buffer new-nodes
no-exclude)
"Prompt the user for a refile location, using PROMPT. "Prompt the user for a refile location, using PROMPT.
PROMPT should not be suffixed with a colon and a space, because PROMPT should not be suffixed with a colon and a space, because
this function appends the default value from this function appends the default value from
`org-refile-history' automatically, if that is not empty." `org-refile-history' automatically, if that is not empty.
When NO-EXCLUDE is set, do not exclude headlines in the current subtree,
this is used for the GOTO interface."
(let ((org-refile-targets org-refile-targets) (let ((org-refile-targets org-refile-targets)
(org-refile-use-outline-path org-refile-use-outline-path) (org-refile-use-outline-path org-refile-use-outline-path)
excluded-entries) excluded-entries)
(when (and (eq major-mode 'org-mode) (when (and (eq major-mode 'org-mode)
(not org-refile-use-cache)) (not org-refile-use-cache)
(not no-exclude))
(org-map-tree (org-map-tree
(lambda() (lambda()
(setq excluded-entries (setq excluded-entries