[Top][All Lists]

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

master 3b835f7: * lisp/subr.el (remove-hook): Add default value (bug#453

From: Juri Linkov
Subject: master 3b835f7: * lisp/subr.el (remove-hook): Add default value (bug#45393)
Date: Tue, 5 Jan 2021 14:00:02 -0500 (EST)

branch: master
commit 3b835f7b81030f482348364e83f384a0fa4c2857
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * lisp/subr.el (remove-hook): Add default value (bug#45393)
 lisp/subr.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/subr.el b/lisp/subr.el
index 50acbd2..a5a979a 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1800,7 +1800,11 @@ unless HOOK has both local and global functions).  If 
 functions have the same representation under `princ', the first
 one will be removed."
-   (let* ((hook (intern (completing-read "Hook variable: " obarray #'boundp 
+   (let* ((default (and (symbolp (variable-at-point))
+                        (symbol-name (variable-at-point))))
+          (hook (intern (completing-read
+                         (format-prompt "Hook variable" default)
+                         obarray #'boundp t nil nil default)))
             (local-variable-p hook)

reply via email to

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