GNU bug report logs - #61102
28.1; with-selected-window/save-window-excursion calls buffer-list-update-hook only once

Previous Next

Package: emacs;

Reported by: Al Haji-Ali <abdo.haji.ali <at> gmail.com>

Date: Fri, 27 Jan 2023 18:41:02 UTC

Severity: normal

Found in version 28.1

Done: Eli Zaretskii <eliz <at> gnu.org>

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: Al Haji-Ali <abdo.haji.ali <at> gmail.com>
Subject: bug#61102: closed (Re: bug#61102: 28.1; with-selected-window/save-window-excursion
 calls buffer-list-update-hook only once)
Date: Thu, 02 Feb 2023 19:58:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#61102: 28.1; with-selected-window/save-window-excursion calls buffer-list-update-hook only once

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 61102 <at> debbugs.gnu.org.

-- 
61102: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61102
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: abdo.haji.ali <at> gmail.com, 61102-done <at> debbugs.gnu.org
Subject: Re: bug#61102: 28.1; with-selected-window/save-window-excursion calls
 buffer-list-update-hook only once
Date: Thu, 02 Feb 2023 21:56:56 +0200
> Date: Thu, 2 Feb 2023 19:16:34 +0100
> Cc: abdo.haji.ali <at> gmail.com, 61102 <at> debbugs.gnu.org
> From: martin rudalics <rudalics <at> gmx.at>
> 
>  > So do you agree with me that there's no bug here?
> 
> Yes.

Thanks, I'm therefore closing this bug.  (The issue can still be
discussed even though the bug is closed.)

[Message part 3 (message/rfc822, inline)]
From: Al Haji-Ali <abdo.haji.ali <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.1; with-selected-window/save-window-excursion calls
 buffer-list-update-hook only once
Date: Fri, 27 Jan 2023 18:29:06 +0000
The following code:

--8<---------------cut here---------------start------------->8---

(let ((fn (lambda () (message "Buffer changed: %S" (current-buffer)))))
  (add-hook 'buffer-list-update-hook fn)
  (with-selected-window (minibuffer-window)  
    (save-window-excursion nil) nil)
  (remove-hook 'buffer-list-update-hook fn)
  nil)
  
--8<---------------cut here---------------end--------------->8---

Prints "Buffer changed: #<buffer  *Minibuf-0*>" once, even though the selection should return to the currently selected buffer (which is different from the mini-buffer).

I would expect either that the hook 'buffer-list-update-hook is not called at all, or that it is called twice (one time for every change of the selected buffer).

Best regards,
-- Al



This bug report was last modified 2 years and 107 days ago.

Previous Next


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