Only run 'eshell-first-time-mode-hook' once per Emacs session

* lisp/eshell/esh-mode.el (eshell-mode): Set 'eshell-first-time-p' to
nil (bug#70610).
This commit is contained in:
Lin Sun 2024-04-27 06:55:49 +00:00 committed by Jim Porter
parent 6171a9a628
commit a2ccda71c1

View 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)