Fix interactive spec of some commands bound on the mode line

Use interactive spec '@' for two commands bound on the mode line
that should select the window associated with the mouse click
to avoid toggling the status of the wrong window or buffer.

* lisp/progmodes/elisp-mode.el (elisp-enable-lexical-binding):
Add interactive spec '@' (bug#81178).

* lisp/window.el (toggle-window-dedicated): Add interactive
spec '@' and replace 'current-buffer' with 'window-buffer'
to not assume that it operates on the current buffer.
This commit is contained in:
Juri Linkov 2026-06-25 18:47:39 +03:00
parent e050c74581
commit 5d15b4522b
2 changed files with 5 additions and 4 deletions

View file

@ -694,7 +694,7 @@ happens in interactive invocations.
When calling from Lisp, use nil or a positive number as the value
of INTERACTIVE to enable `lexical-binding', a negative number to
disable it."
(interactive "p")
(interactive "@p")
(let* ((disable-lexbind (or (and (numberp interactive)
(< interactive 0))
(if current-prefix-arg t)))

View file

@ -7993,7 +7993,7 @@ variable to t, strong dedication will be used by default and
\\[universal-argument] will make the window weakly dedicated.
See the info node `(elisp)Dedicated Windows' for more details."
(interactive "i\nP\np")
(interactive "@i\nP\np")
(setq window (window-normalize-window window))
(setq flag (cond
((consp flag)
@ -8012,8 +8012,9 @@ See the info node `(elisp)Dedicated Windows' for more details."
((null status) "no longer")
((eq status t) "now strongly")
(t "now")))
(current-buffer))
(force-mode-line-update)))
(window-buffer window))
(with-current-buffer (window-buffer window)
(force-mode-line-update))))
(defconst display-buffer--action-function-custom-type
'(choice :tag "Function"