all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Al Haji-Ali <abdo.haji.ali@gmail.com>
To: 61102@debbugs.gnu.org
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	[thread overview]
Message-ID: <x1ozga3al1p.fsf@gmail.com> (raw)


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	other threads:[~2023-01-27 18:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27 18:29 Al Haji-Ali [this message]
2023-02-02 10:22 ` bug#61102: 28.1; with-selected-window/save-window-excursion calls buffer-list-update-hook only once Eli Zaretskii
2023-02-02 15:04   ` martin rudalics
2023-02-02 17:06     ` Eli Zaretskii
2023-02-02 18:16       ` martin rudalics
2023-02-02 19:56         ` Eli Zaretskii
2023-02-02 17:08     ` Al Haji-Ali
2023-02-02 18:17       ` martin rudalics
2023-02-02 21:21         ` Al Haji-Ali
2023-02-03  8:33           ` martin rudalics
2023-02-03 11:49             ` Al Haji-Ali

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=x1ozga3al1p.fsf@gmail.com \
    --to=abdo.haji.ali@gmail.com \
    --cc=61102@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.