]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/subr.el (remove-hook): Add default value (bug#45393)
authorJuri Linkov <juri@linkov.net>
Tue, 5 Jan 2021 18:59:51 +0000 (20:59 +0200)
committerJuri Linkov <juri@linkov.net>
Tue, 5 Jan 2021 18:59:51 +0000 (20:59 +0200)
lisp/subr.el

index 50acbd2790505a180db5e114bc46c88083340212..a5a979a2172a9c42d0ed9381e8c5753069d53c56 100644 (file)
@@ -1800,7 +1800,11 @@ unless HOOK has both local and global functions).  If multiple
 functions have the same representation under `princ', the first
 one will be removed."
   (interactive
-   (let* ((hook (intern (completing-read "Hook variable: " obarray #'boundp t)))
+   (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
            (and
             (local-variable-p hook)