From 8179dc641e5595c3ab58ea4ffa021f921396c742 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 9 Feb 2022 14:33:43 +0100 Subject: [PATCH] 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 --- modules/lang/org/config.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index f94834730..ae55f0f1e 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -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