From 3b835f7b81030f482348364e83f384a0fa4c2857 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 5 Jan 2021 20:59:51 +0200 Subject: [PATCH] * 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 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) -- 2.39.5