emacs-diffs
[Top][All Lists]
Advanced

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

emacs-29 edd64e64a3: Fix interactive selection of emacs-lock mode, broke


From: Juanma Barranquero
Subject: emacs-29 edd64e64a3: Fix interactive selection of emacs-lock mode, broken by 2a4b0da28c
Date: Tue, 29 Nov 2022 19:40:51 -0500 (EST)

branch: emacs-29
commit edd64e64a389e0f0e6ce670846d4fae79a9d8b35
Author: Juanma Barranquero <lekktu@gmail.com>
Commit: Juanma Barranquero <lekktu@gmail.com>

    Fix interactive selection of emacs-lock mode, broken by 2a4b0da28c
    
    * lisp/emacs-lock.el (emacs-lock--set-mode): Check that
    arg is 4 and prefix is '(4).
    (emacs-lock-mode): Pass also `current-prefix-arg' to
    `emacs-lock--set-mode'.
---
 lisp/emacs-lock.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/emacs-lock.el b/lisp/emacs-lock.el
index 1818e22a92..3c8b81e94d 100644
--- a/lisp/emacs-lock.el
+++ b/lisp/emacs-lock.el
@@ -165,13 +165,14 @@ Return a value appropriate for 
`kill-buffer-query-functions' (which see)."
     (message "Buffer %S is locked and cannot be killed" (buffer-name))
     nil))
 
-(defun emacs-lock--set-mode (mode arg)
+(defun emacs-lock--set-mode (mode arg prefix)
   "Setter function for `emacs-lock-mode'."
   (setq emacs-lock-mode
         (cond ((memq arg '(all exit kill))
                ;; explicit locking mode arg, use it
                arg)
-              ((and (eq arg current-prefix-arg) (consp current-prefix-arg))
+              ;; kludgy, but commit 2a4b0da28c converts arg to number
+              ((and (eq arg 4) (equal prefix '(4)))
                ;; called with C-u M-x emacs-lock-mode, so ask the user
                (intern (completing-read
                         (format-prompt "Locking mode"
@@ -214,7 +215,7 @@ some major modes from being locked under some 
circumstances."
   :group 'emacs-lock
   :variable (emacs-lock-mode .
                              (lambda (mode)
-                               (emacs-lock--set-mode mode arg)))
+                               (emacs-lock--set-mode mode arg 
current-prefix-arg)))
   (when emacs-lock-mode
     (setq emacs-lock--old-mode emacs-lock-mode)
     (setq emacs-lock--try-unlocking



reply via email to

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