all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Al Haji-Ali <abdo.haji.ali@gmail.com>, martin rudalics <rudalics@gmx.at>
Cc: 61102@debbugs.gnu.org
Subject: bug#61102: 28.1; with-selected-window/save-window-excursion calls buffer-list-update-hook only once
Date: Thu, 02 Feb 2023 12:22:53 +0200	[thread overview]
Message-ID: <83ilgkxt6q.fsf@gnu.org> (raw)
In-Reply-To: <x1ozga3al1p.fsf@gmail.com> (message from Al Haji-Ali on Fri, 27 Jan 2023 18:29:06 +0000)

> From: Al Haji-Ali <abdo.haji.ali@gmail.com>
> 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).

Martin, any comments on this?  FWIW, I'm not sure this is a bug, but
maybe I'm missing something.





  reply	other threads:[~2023-02-02 10:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27 18:29 bug#61102: 28.1; with-selected-window/save-window-excursion calls buffer-list-update-hook only once Al Haji-Ali
2023-02-02 10:22 ` Eli Zaretskii [this message]
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=83ilgkxt6q.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=61102@debbugs.gnu.org \
    --cc=abdo.haji.ali@gmail.com \
    --cc=rudalics@gmx.at \
    /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.