]> git.eshelyaron.com Git - emacs.git/commitdiff
; Improve documentation of 'set-transient-map' changes
authorEli Zaretskii <eliz@gnu.org>
Thu, 7 Jul 2022 06:29:51 +0000 (09:29 +0300)
committerEli Zaretskii <eliz@gnu.org>
Thu, 7 Jul 2022 06:29:51 +0000 (09:29 +0300)
* lisp/subr.el (set-transient-map-timeout, set-transient-map): Doc
fixes.

* etc/NEWS: Improve wording of the 'set-transient-map' entry.

* doc/lispref/keymaps.texi (Controlling Active Maps): Fix wording
and passive tense, and improve indexing.  (Bug#21634)

doc/lispref/keymaps.texi
etc/NEWS
lisp/subr.el

index 8df4b6f2b47a16e4d7b19736d83537356c6f8902..f5341f40f0a9a3f572d1f03e6b2d2a6d2a3b1db2 100644 (file)
@@ -1063,15 +1063,19 @@ The optional argument @var{on-exit}, if non-@code{nil}, specifies a
 function that is called, with no arguments, after @var{keymap} is
 deactivated.
 
-The optional argument @var{message}, if a string, specifies the format
-string for the message to display after activating the transient map.
-When the string contains the specifier @samp{%k}, it's replaced with
-the list of keys from the transient map.
-
-The optional argument @var{timeout}, if a number, specifies the number
-of seconds of idle time after which @var{keymap} is deactivated.  The
-value of the argument @var{timeout} can be overridden by the variable
-@code{set-transient-map-timeout}.
+The optional argument @var{message} specifies the message to display
+after activating the transient map.  If @var{message} is a string, it
+is the format string for the message, and any @samp{%k} specifier in
+that string is replaced with the list of keys from the transient map.
+Any other non-@code{nil} value of @var{message} stands for the default
+message format @samp{Repeat with %k}.
+
+@vindex set-transient-map-timeout
+If the optional argument @var{timeout} is non-@code{nil}, it should be
+a number that specifies how many seconds of idle time to wait before
+deactivating @var{keymap}.  The value of the variable
+@code{set-transient-map-timeout}, if non-@code{nil}, overrides the
+value of this argument.
 
 This function works by adding and removing @var{keymap} from the
 variable @code{overriding-terminal-local-map}, which takes precedence
index e1694470258f14056ebbc51bba8d16f830accbd1..2013260c151fa9eb32d85e362701b599fd654e7e 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2279,10 +2279,11 @@ patcomp.el, pc-mode.el, pc-select.el, s-region.el, and sregex.el.
 
 +++
 ** New arguments MESSAGE and TIMEOUT of 'set-transient-map'.
-MESSAGE specifies a string that lists available keys,
-and TIMEOUT deactivates the transient map after the specified
-number of seconds.  The default timeout is defined by
-the new variable 'set-transient-map-timeout'.
+MESSAGE specifies a message to display after activating the transient
+map, including a special formatting spec to list available keys.
+TIMEOUT is the idle time after which to deactivate the transient map.
+The default timeout value can be defined by the new variable
+'set-transient-map-timeout'.
 
 +++
 ** New function 'seq-split'.
index 44d094d28dd1d85e5f40b190f7139d2a798a4aa0..6bf12fd7577da04b606067fbff8904162b33176e 100644 (file)
@@ -6014,9 +6014,10 @@ To test whether a function can be called interactively, use
   'set-temporary-overlay-map #'set-transient-map "24.4")
 
 (defvar set-transient-map-timeout nil
-  "Deactivate the transient map after specified timeout.
-When a number, after idle time of the specified number of seconds
-deactivate the map set by the previous call of `set-transient-map'.")
+  "Timeout in seconds for deactivation of a transient keymap.
+If this is a number, it specifies the amount of idle time
+after which to deactivate the keymap set by `set-transient-map',
+thus overriding the value of the TIMEOUT argument to that function.")
 
 (defvar set-transient-map-timer nil
   "Timer for `set-transient-map-timeout'.")
@@ -6032,16 +6033,18 @@ if it returns non-nil, then MAP stays active.
 Optional arg ON-EXIT, if non-nil, specifies a function that is
 called, with no arguments, after MAP is deactivated.
 
-Optional arg MESSAGE, if a string, specifies the format string for the
-message to display after activating the transient map.  When the string
-contains the specifier %k, it's replaced with the list of keys from the
-transient map.  Other non-nil values of MESSAGE use the message format
-\"Repeat with %k\".  On deactivating the map the displayed message
-is cleared out.
-
-Optional arg TIMEOUT, if a number, specifies the number of seconds
-of idle time after which the map is deactivated.  The variable
-`set-transient-map-timeout' overrides the argument TIMEOUT.
+Optional arg MESSAGE, if non-nil, requests display of an informative
+message after activating the transient map.  If MESSAGE is a string,
+it specifies the format string for the message to display, and the %k
+specifier in the string is replaced with the list of keys from the
+transient map.  Any other non-nil value of MESSAGE means to use the
+message format string \"Repeat with %k\".  Upon deactivating the map,
+the displayed message will be cleared out.
+
+Optional arg TIMEOUT, if non-nil, should be a number specifying the
+number of seconds of idle time after which the map is deactivated.
+The variable `set-transient-map-timeout', if non-nil, overrides the
+value of TIMEOUT.
 
 This function uses `overriding-terminal-local-map', which takes precedence
 over all other keymaps.  As usual, if no match for a key is found in MAP,