if you are willing to try something as a complete stab in the dark, here is something i have had from many years ago that fixed issues possibly including a defaulting issue. the issues include other stuff too, but i do not understand the code now for health reasons to rule this out as a solution to your problem in addition to the problem i put in the comment and name. i havce carried along this patch for eyars.
commit deaa14b6ed264c259a1f3b805b67b2db3951ba20 Author: Your Name <y...@example.com> Date: 2020-09-20 13:30:55 -0700 === alpha remove the parens from ido completion of olpaths Modified lisp/org-refile.el diff --git a/lisp/org-refile.el b/lisp/org-refile.el index 1e6872b46..8f98e9cf9 100644 --- a/lisp/org-refile.el +++ b/lisp/org-refile.el @@ -617,7 +617,9 @@ this function appends the default value from (tbl (mapcar (lambda (x) (if (and (not (member org-refile-use-outline-path - '(file full-file-path))) + ;; === alpha remove the parens from ido completion of olpaths + '(nil full-file-path))) + ;; '(file full-file-path))) (not (equal filename (nth 1 x)))) (cons (concat (car x) extra " (" (file-name-nondirectory (nth 1 x)) ")") On 3/4/21, Maxim Nikulin <maniku...@gmail.com> wrote: > 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. > > > -- The Kafka Pandemic Please learn what misopathy is. https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html