Karthik Chikmagalur <[email protected]> writes:

> This is disruptive, and IMO can be improved.  I think if
> org-refile-use-cache is set and the refile cache is invalid,  the
> capture process should not default to its default org-capture-finalize
> behavior.  Instead, org-capture-refile should fail, and the capture
> window should remain open.

Here is what it does:
(let ((org-refile-targets (or refile-targets org-refile-targets)))
      (org-capture-finalize)
      (save-window-excursion
        (with-current-buffer base
          (org-with-point-at pos
            (call-interactively 'org-refile)))))

As you see, org-refile runs after finalization.
So, there is no going back.
The best you can do is jumping to captured entry on failure, so that the
user can proceed manually.

> As a bonus, it would be nice if org-capture-refile offered to refresh
> the refile cache, but it would be enough for it to simply fail and leave
> the capture state unchanged.

Maybe. Patches welcome.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to