From: Juri Linkov Date: Tue, 5 Jan 2021 18:59:51 +0000 (+0200) Subject: * lisp/subr.el (remove-hook): Add default value (bug#45393) X-Git-Tag: emacs-28.0.90~4362 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3b835f7b81030f482348364e83f384a0fa4c2857;p=emacs.git * lisp/subr.el (remove-hook): Add default value (bug#45393) --- diff --git a/lisp/subr.el b/lisp/subr.el index 50acbd27905..a5a979a2172 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -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)