Harden shortcut to jump to any Org heading from anywhere
In the previous implementation, when in some buffer which is not an Org buffer that accidentally contains lines that partially match the regular expression describing an Org heading, errors could occur when the Org refile cache was empty. To address this issue, let's temporarily switch to some Org buffer before generating the list of all Org heading targets.
This commit is contained in:
parent
3099e642ce
commit
8876f04756
|
@ -1044,7 +1044,15 @@ Current Task: %s(replace-regexp-in-string \"%\" \"%%\" (or org-clock-current-tas
|
||||||
"
|
"
|
||||||
("c" (db/org-clock-goto-first-open-checkbox nil)
|
("c" (db/org-clock-goto-first-open-checkbox nil)
|
||||||
nil)
|
nil)
|
||||||
("a" (org-refile '(4)) nil)
|
("a" (with-current-buffer
|
||||||
|
;; Make sure we are in some Org buffer, as `org-refile-get-location'
|
||||||
|
;; might try to parse the current buffer in search for some Org
|
||||||
|
;; headings, possibly producing errors along the way.
|
||||||
|
(->> (org-agenda-files :unrestricted)
|
||||||
|
cl-first
|
||||||
|
get-file-buffer)
|
||||||
|
(org-refile '(4)))
|
||||||
|
nil)
|
||||||
("s" (db/org-clock-goto-first-open-checkbox t)
|
("s" (db/org-clock-goto-first-open-checkbox t)
|
||||||
nil))
|
nil))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user