bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#61102: 28.1; with-selected-window/save-window-excursion calls buffer


From: Al Haji-Ali
Subject: bug#61102: 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]