Skip to content

Commit 71900cf

Browse files
committed
tweak(enlight): make the recentering hook buffer-local to enlight
1 parent 8e69d86 commit 71900cf

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

modules/me-ui.el

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
;; Author: Abdelhak Bougouffa (rot13 "nobhtbhssn@srqbencebwrpg.bet")
66
;; Created: 2022-09-20
7-
;; Last modified: 2025-04-19
7+
;; Last modified: 2025-04-30
88

99
;;; Commentary:
1010

@@ -52,6 +52,7 @@
5252
;; Highly customizable startup screen for Emacs
5353
(use-package enlight
5454
:straight (:host github :repo "ichernyshovvv/enlight")
55+
:hook (enlight-mode . +enlight-responsive-h)
5556
:custom
5657
(enlight-content
5758
(enlight-menu
@@ -68,12 +69,14 @@
6869
(enlight-open)
6970
(setq initial-buffer-choice #'enlight))
7071
:config
71-
(satch-add-hook
72-
'(window-size-change-functions window-state-change-functions)
73-
(satch-defun +enlight--recenter-h (&optional _frame)
74-
;; When in Enlight's buffer, we recall `enlight-open' to refresh and recenter the buffer
75-
(when (eq (current-buffer) (get-buffer enlight-buffer-name))
76-
(enlight)))))
72+
(defun +enlight-responsive-h ()
73+
(satch-add-hook
74+
'(window-size-change-functions window-state-change-functions)
75+
(satch-defun +enlight--recenter-h (&optional _frame)
76+
;; When in Enlight's buffer, we recall `enlight-open' to refresh and recenter the buffer
77+
(when (eq (current-buffer) (get-buffer enlight-buffer-name))
78+
(enlight)))
79+
nil 'local)))
7780

7881

7982
;; Display "^L" page breaks as tidy horizontal lines

0 commit comments

Comments
 (0)