emacs-31 5d15b4522b7: Fix interactive spec of some commands bound on the mode line

Juri Linkov <[email protected]>
Newsgroups gmane.emacs.diffs
Message-ID <[email protected]>
branch: emacs-31
commit 5d15b4522b73b4cff099606cbdf820a60f7e3808
Author: Juri Linkov <[email protected]>
Commit: Juri Linkov <[email protected]>

    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.
---
 lisp/progmodes/elisp-mode.el | 2 +-
 lisp/window.el               | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 5a550b33016..be98e03d342 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -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)))
diff --git a/lisp/window.el b/lisp/window.el
index 601a2b18fe3..5f00801d55c 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -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"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.