diff --git a/lisp/subr.el b/lisp/subr.el index 4771ac1fba2..6716c975318 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -6549,6 +6549,13 @@ set-transient-map-timeout (defvar set-transient-map-timer nil "Timer for `set-transient-map-timeout'.") +(defcustom set-transient-map-suppress-message nil + "Whether to suppress a message on activating the transient map. +If non-nil, do not display a message passed to `set-transient-map'." + :group 'convenience + :type 'boolean + :version "31.1") + (defun set-transient-map (map &optional keep-pred on-exit message timeout) "Set MAP as a temporary keymap taking precedence over other keymaps. Normally, MAP is used only once, to look up the very next key. @@ -6561,10 +6568,11 @@ set-transient-map called, with no arguments, after MAP is deactivated. 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 after activating the transient map, unless the user option +`set-transient-map-suppress-message' is also non-nil. 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. @@ -6638,7 +6646,8 @@ set-transient-map (when timeout (when set-transient-map-timer (cancel-timer set-transient-map-timer)) (setq set-transient-map-timer (run-with-idle-timer timeout nil exitfun))) - (when message (message "%s" message)) + (unless set-transient-map-suppress-message + (when message (message "%s" message))) exitfun)) ;;;; Progress reporters.