mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-07-16 15:16:26 +00:00
org-refile-get-targets: Barf when target is not an Org buffer
* lisp/org-refile.el (org-refile-get-targets): Display error when target buffer is not in Org mode. If we do not manually throw an error, local variables like `org-complex-heading-regexp' will not be defined, and the user would see a lot more cryptic error.
This commit is contained in:
parent
dcd2ba4a02
commit
1d04af59b6
|
@ -307,6 +307,8 @@ converted to a headline before refiling."
|
|||
(t (error "Bad refiling target description %s" desc)))
|
||||
(dolist (f files)
|
||||
(with-current-buffer (if (bufferp f) f (org-get-agenda-file-buffer f))
|
||||
(unless (derived-mode-p 'org-mode)
|
||||
(error "Major mode in refile target buffer \"%s\" must be `org-mode'" f))
|
||||
(or
|
||||
(setq tgs (org-refile-cache-get (buffer-file-name) descre))
|
||||
(progn
|
||||
|
|
Loading…
Reference in a new issue