GNU bug report logs - #70610
30.0.50; [PATCH] * lisp/eshell/esh-mode.el (eshell-first-time-mode-hook): Run the hook for once

Previous Next

Package: emacs;

Reported by: Lin Sun <sunlin7.mail <at> gmail.com>

Date: Sat, 27 Apr 2024 16:34:02 UTC

Severity: normal

Tags: patch

Found in version 30.0.50

Done: Jim Porter <jporterbugs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lin Sun <sunlin7.mail <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50;
 [PATCH] * lisp/eshell/esh-mode.el (eshell-first-time-mode-hook):
 Run the hook for once
Date: Sat, 27 Apr 2024 16:32:24 +0000
[Message part 1 (text/plain, inline)]
Hi,

The document of `eshell-first-time-mode-hook' says it would be run the
first time eshell started.
> A hook that gets run the first time ‘eshell-mode’ is entered.
> That is to say, the first time during an Emacs session.

But it actually runs every time for an eshell buffer(start an eshell,
exit it, start an eshell again).
Here is the one line code to show that:
(add-hook 'eshell-first-time-mode-hook '(lambda () (message "test")))

The patch will make the `eshell-first-time-mode-hook' only run once as
its document described.

Please help review the patch. Thanks

Best Regards
Lin
[0001-lisp-eshell-esh-mode.el-eshell-first-time-mode-hook-.patch (text/x-patch, attachment)]

This bug report was last modified 1 year and 14 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.