[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 250f9e7f83 2/4: Improve help-enable-variable-value-editing help
From: |
Stefan Kangas |
Subject: |
master 250f9e7f83 2/4: Improve help-enable-variable-value-editing help |
Date: |
Fri, 17 Jun 2022 10:42:09 -0400 (EDT) |
branch: master
commit 250f9e7f8380e208d8ef32dd4d64218b41abbddf
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
Improve help-enable-variable-value-editing help
* lisp/help-fns.el (help-enable-variable-value-editing): Expand
docstring to better explain what effect it has.
(help-fns-edit-variable): Use command substitution.
---
lisp/help-fns.el | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index ca5750723f..18b12ee7b3 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -135,6 +135,11 @@ with the current prefix. The files are chosen according to
(defcustom help-enable-variable-value-editing nil
"If non-nil, allow editing values in *Help* buffers.
+
+To edit the value of a variable, use \\[describe-variable] to
+display a \"*Help*\" buffer, move point after the text
+\"Its value is\" and type \\`e'.
+
Values that aren't readable by the Emacs Lisp reader can't be
edited even if this option is enabled."
:type 'boolean
@@ -1376,9 +1381,10 @@ it is displayed along with the global value."
(prin1 (nth 1 var) (current-buffer))
(pp-buffer)
(goto-char (point-min))
- (insert (format ";; Edit the `%s' variable.\n" (nth 0 var))
- ";; C-c C-c to update the value and exit.\n\n")
(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"))
(setq-local help-fns--edit-variable var)))
(defvar-keymap help-fns--edit-value-mode-map