fix(org): better-jumper support for more links

Doom sets jump points before following most org links. This allows you
to jump back to where you were afterwards using
C-o (better-jumper-jump-backward) or forward with
C-i (better-jumper-jump-forward). It does this by setting a jump point
on the org-open-at-point-functions hook.

However, not all org links' :follow handlers trigger this hook (like id:
or roam: links), and you can get around it by triggering link opener
handlers directly (with M-x org-goto). Most of these link openers use
org-mark-ring-push to record jump points in org's own jumplist, so
advising it to call better-jumper-set-jump should address more of these
fringe cases.

Fix: #6098
This commit is contained in:
Henrik Lissner 2022-02-09 14:33:43 +01:00
parent d833242de7
commit 8179dc641e

View file

@ -1329,6 +1329,9 @@ compelling reason, so..."
(file-writable-p org-id-locations-file))
(add-hook 'org-open-at-point-functions #'doom-set-jump-h)
;; HACK For functions that dodge `org-open-at-point-functions', like
;; `org-id-open', `org-goto', or roam: links.
(advice-add #'org-mark-ring-push :around #'doom-set-jump-a)
;; Add the ability to play gifs, at point or throughout the buffer. However,
;; 'playgifs' is stupid slow and there's not much I can do to fix it; use at