summaryrefslogtreecommitdiff
path: root/lisp/help-fns.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2022-07-04 12:12:45 +0200
committerStefan Kangas <stefan@marxist.se>2022-07-04 12:12:45 +0200
commit906b97edb9a7dbc61af4386cb34d4bf89bd0ecfb (patch)
treeaa3bee8f81709db23850caa217174f8c6160000d /lisp/help-fns.el
parentc4e93b67c456b2a7cfc57b13c5d8070eb2b6d167 (diff)
downloademacs-906b97edb9a7dbc61af4386cb34d4bf89bd0ecfb.tar.gz
New command help-fns-edit-mode-cancel
* lisp/help-fns.el (help-fns-edit-mode-cancel): New command. (help-fns--edit-value-mode-map): Bind it to 'C-c C-k'. (help-fns-edit-variable): Advertise it in help text.
Diffstat (limited to 'lisp/help-fns.el')
-rw-r--r--lisp/help-fns.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 705f92b37be..fc691e76424 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -1390,11 +1390,13 @@ it is displayed along with the global value."
(help-fns--edit-value-mode)
(insert (format ";; Edit the `%s' variable.\n" (nth 0 var))
(substitute-command-keys
- ";; \\[help-fns-edit-mode-done] to update the value and exit.\n\n"))
+ ";; `\\[help-fns-edit-mode-done]' to update the value and exit; \
+`\\[help-fns-edit-mode-cancel]' to cancel.\n\n"))
(setq-local help-fns--edit-variable var)))
(defvar-keymap help-fns--edit-value-mode-map
- "C-c C-c" #'help-fns-edit-mode-done)
+ "C-c C-c" #'help-fns-edit-mode-done
+ "C-c C-k" #'help-fns-edit-mode-cancel)
(define-derived-mode help-fns--edit-value-mode emacs-lisp-mode "Elisp"
:interactive nil)
@@ -1420,6 +1422,11 @@ current buffer."
(with-current-buffer help-buffer
(revert-buffer)))))
+(defun help-fns-edit-mode-cancel ()
+ "Kill the buffer without updating the value."
+ (interactive nil help-fns--edit-value-mode)
+ (help-fns-edit-mode-done t))
+
(defun help-fns--run-describe-functions (functions &rest args)
(with-current-buffer standard-output
(unless (bolp)