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


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#70610: closed (30.0.50; [PATCH] * lisp/eshell/esh-mode.el
 (eshell-first-time-mode-hook): Run the hook for once)
Date: Fri, 03 May 2024 03:17:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 2 May 2024 20:15:42 -0700
with message-id <136a2db9-e459-160b-e3d8-aaef6f877a99 <at> gmail.com>
and subject line Re: bug#70610: 30.0.50; [PATCH] * lisp/eshell/esh-mode.el (eshell-first-time-mode-hook): Run the hook for once
has caused the debbugs.gnu.org bug report #70610,
regarding 30.0.50; [PATCH] * lisp/eshell/esh-mode.el (eshell-first-time-mode-hook): Run the hook for once
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
70610: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70610
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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 3 (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)]
[Message part 5 (message/rfc822, inline)]
From: Jim Porter <jporterbugs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Lin Sun <sunlin7.mail <at> gmail.com>
Cc: 70610-done <at> debbugs.gnu.org
Subject: Re: bug#70610: 30.0.50; [PATCH] * lisp/eshell/esh-mode.el
 (eshell-first-time-mode-hook): Run the hook for once
Date: Thu, 2 May 2024 20:15:42 -0700
On 5/2/2024 2:09 AM, Eli Zaretskii wrote:
>> From: Lin Sun <sunlin7.mail <at> gmail.com>
>> Date: Sat, 27 Apr 2024 16:32:24 +0000
>>
>> 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).
[snip]
> Jim, any comments on this change proposal?

Thanks for the patch, Lin Sun. This looks good, so I've merged it to the 
master branch as a2ccda71c15. Closing this bug now.


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.