[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
org-refile failed due to default option stored by org-goto
From: |
Maxim Nikulin |
Subject: |
org-refile failed due to default option stored by org-goto |
Date: |
Thu, 4 Mar 2021 21:47:51 +0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 |
On 03/03/2021 00:15, Maxim Nikulin wrote:
There is one issue however. Default option option does not work if after
cache clean other command is called, e.g.
- jump using C-u C-c C-j
- clean cache C-u C-u C-u C-c C-w
- try to jump or to refile [C-u] C-c C-w to default offered option
- "user-error: Invalid target location"
I have realized that this issue is rather loosely related to
org-refile-use-cache and I have seen it in a worse variant with disabled
cache.
file init-refile.el:
(package-initialize)
(custom-set-variables
'(org-agenda-files (quote ("~/examples/org/test-notes.org")))
'(org-capture-templates
(quote
(("t" "Test" entry
(file "")
"* %?\n\n%U\n" :empty-lines 1))))
'(org-default-notes-file "~/examples/org/capture.org")
'(org-directory "~/examples/org/")
'(org-modules (quote (org-refile)))
'(org-outline-path-complete-in-steps nil)
'(org-refile-targets (quote ((nil :maxlevel . 5) (org-agenda-files
:maxlevel . 5))))
'(org-refile-use-outline-path t)
)
emacs -Q -L ~/src/emacs/org-mode/lisp/ -L
~/src/emacs/org-mode/contrib/lisp/ -l ~/examples/org/init-refile.el
~/examples/org/test-notes.org
- C-u C-c C-j (org-goto) to some heading in the test-notes.org, e.g.
"Two" / "Third" / "Theme"
- M-x org-capture RET t to capture some note
- Let's assume that target of previously executed org-goto suits for
this note
- C-c C-w RET to refile the note from capture.org file to the heading in
test-notes.org offered as the default option.
Actual result:
- "Invalid target location"
- Captured note is still in the capture.org file but it is not apparent
since capture frame is closed.
Expected result:
- Default option works for refile even if it is remained from org-goto
command
Side note. In some cases it not so easy to close capture frame. If
org-default-note-file is configured to a file in a non-existing
directory then C-c C-k asks to create that directory but does not
discards the note.