]> git.eshelyaron.com Git - emacs.git/commitdiff
Only run 'eshell-first-time-mode-hook' once per Emacs session
authorLin Sun <sunlin7@hotmail.com>
Sat, 27 Apr 2024 06:55:49 +0000 (06:55 +0000)
committerEshel Yaron <me@eshelyaron.com>
Mon, 6 May 2024 16:36:41 +0000 (18:36 +0200)
* lisp/eshell/esh-mode.el (eshell-mode): Set 'eshell-first-time-p' to
nil (bug#70610).

(cherry picked from commit a2ccda71c15f75edef0711f94351af0dd7241beb)

lisp/eshell/esh-mode.el

index b15f99a03597a9d8ffd819f0bb612f9a71ac8b28..5de200ce4b58884d25e0144fe1df4cda66bc75c1 100644 (file)
@@ -418,8 +418,10 @@ and the hook `eshell-exit-hook'."
 
   (add-hook 'kill-buffer-hook #'eshell-kill-buffer-function t t)
 
-  (if eshell-first-time-p
-      (run-hooks 'eshell-first-time-mode-hook))
+  (when eshell-first-time-p
+    (setq eshell-first-time-p nil)
+    (run-hooks 'eshell-first-time-mode-hook))
+
   (run-hooks 'eshell-post-command-hook))
 
 (put 'eshell-mode 'mode-class 'special)