From b8d7c67a975b78d3b1296f5b54207c6809918458 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Tue, 26 Sep 2023 10:20:21 -0400 Subject: [PATCH] Enable forge-browse-dwim keybinding in magit revision buffers --- emacs/.emacs.d/config/init-git.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/emacs/.emacs.d/config/init-git.el b/emacs/.emacs.d/config/init-git.el index b74fbac..eb31051 100644 --- a/emacs/.emacs.d/config/init-git.el +++ b/emacs/.emacs.d/config/init-git.el @@ -66,9 +66,14 @@ "ghe.spotify.net/api/v3" "ghe.spotify.net" forge-github-repository)) + ;; forge-topic-at-point really should just return nil if the buffer is not readable + (advice-add 'forge-topic-at-point :around + (lambda (oldfn &rest args) + (ignore-errors (apply oldfn args)))) :custom (forge-owned-accounts '((jdormit . (remote-name "jdormit")))) :general - (normal magit-mode-map "yu" #'forge-copy-url-at-point-as-kill)) + (normal magit-mode-map "yu" #'forge-copy-url-at-point-as-kill) + (magit-revision-mode-map [remap magit-browse-thing] #'forge-browse-dwim)) (provide 'init-git)