Subject: bug#53910: [External] : bug#53910: 29.0.50; context-menu-mode breaks help in read-only buffers

From: martin rudalics <[email-masked]>
Date: Sat, 19 Feb 2022 10:41:09 +0100

> Maybe (kill-buffer (window-buffer <WINDOW>)) has the same effect
 > when used in any window, but (bury-buffer (window-buffer <WINDOW>))
 > definitely should be called in the required window, because `bury-buffer`
 > uses `nil` for the WINDOW args, e.g.:
 >
 >        (set-window-dedicated-p nil nil)
 >        (switch-to-prev-buffer nil 'bury)

I recommend against calling 'bury-buffer' in Lisp code: A function that
does

   If BUFFER-OR-NAME is nil or omitted, bury the
   current buffer.  Also, if BUFFER-OR-NAME is nil or omitted,
   remove the current buffer from the selected window if it is
   displayed there.

is clearly intended for interactive use only.

martin