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

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

bug#53910: [External] : bug#53910: 29.0.50; context-menu-mode breaks hel


From: Eli Zaretskii
Subject: bug#53910: [External] : bug#53910: 29.0.50; context-menu-mode breaks help in read-only buffers
Date: Sat, 19 Feb 2022 19:22:36 +0200

> Date: Sat, 19 Feb 2022 18:07:03 +0100
> Cc: juri@linkov.net, monnier@iro.umontreal.ca, larsi@gnus.org,
>  spacibba@aol.com, 53910@debbugs.gnu.org
> From: martin rudalics <rudalics@gmx.at>
> 
>  > What exactly do you mean by "interactive use only"?  Several commands
>  > invoke bury-buffer as part of their job -- or do you consider that to
>  > be "interactive use" as well?
> 
> No.  Consider the following two forms:
> 
> (defun foo (&optional buffer)
>    (interactive)
>    (let ((buffer (window-normalize-buffer buffer)))
>      (if (or (and (window-next-sibling)
>                (eq (window-buffer (window-next-sibling)) buffer))
>           (and (window-prev-sibling)
>                (eq (window-buffer (window-prev-sibling)) buffer)))
>       (bury-buffer buffer)
>        (kill-buffer buffer))))
> 
> (defun foo (&optional buffer)
>    (interactive)
>    (if (let ((buffer (window-normalize-buffer buffer)))
>       (or (and (window-next-sibling)
>                (eq (window-buffer (window-next-sibling)) buffer))
>           (and (window-prev-sibling)
>                (eq (window-buffer (window-prev-sibling)) buffer))))
>        (bury-buffer buffer)
>      (kill-buffer buffer)))
> 
> If, after C-x 2, I do M-x foo, the first will leave the windows' buffers
> unchanged while the second will show another buffer in the selected
> window.  So my conclusion is to never use 'bury-buffer' in Lisp code.

That bury-buffer can be mis-used or abused doesn't mean it should not
be used correctly, especially since we do that in many places.
Moreover, bury-buffer does little besides bury-buffer-internal, so I
still don't understand the emotional reaction.





reply via email to

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