From 752413620a8909709af6eb7d52163bd18477b5e8 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Wed, 11 Sep 2024 09:47:50 -0700 Subject: [PATCH] (history) move git-timemachine init to pre-entry hook This still ends up setting the evil state in the original buffer rather than the timemachine buffer, though the evil state is set post-entry. Not sure why. Note the evil state is purely for UI feedback purposes and has no functional effect. --- rigpa-history-mode.el | 7 +++++-- rigpa.el | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/rigpa-history-mode.el b/rigpa-history-mode.el index 3493bfc..aa78e8c 100644 --- a/rigpa-history-mode.el +++ b/rigpa-history-mode.el @@ -50,10 +50,13 @@ :lighter " history" :group 'rigpa) +(defun rigpa--on-history-mode-pre-entry () + "Pre-entry" + (unless git-timemachine-mode + (git-timemachine))) + (defun rigpa--on-history-mode-entry () "Actions to take upon entry into history mode." - (unless git-timemachine-mode - (git-timemachine)) ;; TODO: probably do this via a standard internal ;; rigpa hook in mode registration (evil-history-state)) diff --git a/rigpa.el b/rigpa.el index 8c2d655..7e7a5a3 100644 --- a/rigpa.el +++ b/rigpa.el @@ -271,6 +271,7 @@ :post-entry #'rigpa--on-activity-mode-entry :post-exit #'rigpa--on-activity-mode-post-exit) (rigpa-register-mode chimera-history-mode + :pre-entry #'rigpa--on-history-mode-pre-entry :post-entry #'rigpa--on-history-mode-entry :post-exit #'rigpa--on-history-mode-post-exit) (rigpa-register-mode chimera-tab-mode