diff options
| author | Juri Linkov | 2019-12-22 00:02:10 +0200 |
|---|---|---|
| committer | Juri Linkov | 2019-12-22 00:02:10 +0200 |
| commit | 485b423e8f0df2711a850be7f254665f64ab0bdb (patch) | |
| tree | 02f294b4daa4ec7718769afe8235a7119b52bcb5 /doc | |
| parent | 678a71ea2d044f19f75e3f45c930c5e3b707e3dc (diff) | |
| download | emacs-485b423e8f0df2711a850be7f254665f64ab0bdb.tar.gz emacs-485b423e8f0df2711a850be7f254665f64ab0bdb.zip | |
New variable set-message-function to show message at the end of the minibuffer
* doc/lispref/display.texi (Displaying Messages): Document
set-message-function and clear-message-function.
* lisp/minibuffer.el (minibuffer-message-clear-timeout): New defcustom.
(minibuffer-message-timer, minibuffer-message-overlay): New variables.
(set-minibuffer-message, clear-minibuffer-message): New functions.
(set-message-function, clear-message-function): Set variables to
set-minibuffer-message and clear-minibuffer-message respectively.
* src/keyboard.c (read_char): Call clear_message when
Vclear_message_function is a function.
* src/xdisp.c (set_message): Call Vset_message_function when it's a function.
(clear_message): Call Vclear_message_function when it's a function.
(syms_of_xdisp): New variables set-message-function and clear-message-function
(bug#38457).
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/display.texi | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 42b049eafde..0085f3b6750 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -306,6 +306,35 @@ reformatted, with undesirable results. Instead, use @code{(message | |||
| 306 | "%s" @var{string})}. | 306 | "%s" @var{string})}. |
| 307 | @end defun | 307 | @end defun |
| 308 | 308 | ||
| 309 | @defvar set-message-function | ||
| 310 | When this variable is non-@code{nil}, @code{message} and related functions | ||
| 311 | call it as a function with one argument that is the message to show. | ||
| 312 | |||
| 313 | When this function returns @code{nil}, the message is displayed in the | ||
| 314 | echo area as usual. When the function returns a string, the returned | ||
| 315 | string is displayed in the echo area. When this function returns | ||
| 316 | other non-@code{nil} values, this means that the message was handled | ||
| 317 | specially, so the same message is not displayed in the echo area. | ||
| 318 | See also @code{clear-message-function} that can be used to clear the | ||
| 319 | message displayed by this function. | ||
| 320 | |||
| 321 | The default value is the function that displays the message at the end | ||
| 322 | of the minibuffer when the minibuffer is active. | ||
| 323 | @end defvar | ||
| 324 | |||
| 325 | @defvar clear-message-function | ||
| 326 | When this variable is non-@code{nil}, @code{message} and related functions | ||
| 327 | call it without arguments when their message is @code{nil} or the empty string. | ||
| 328 | |||
| 329 | Usually this function is called when the next input event arrives. | ||
| 330 | The function is called without arguments. It is expected to clear the | ||
| 331 | message displayed by its counterpart function specified by | ||
| 332 | @code{set-message-function}. | ||
| 333 | |||
| 334 | The default value is the function that clears the message displayed at | ||
| 335 | the end of the minibuffer when the minibuffer is active. | ||
| 336 | @end defvar | ||
| 337 | |||
| 309 | @defvar inhibit-message | 338 | @defvar inhibit-message |
| 310 | When this variable is non-@code{nil}, @code{message} and related functions | 339 | When this variable is non-@code{nil}, @code{message} and related functions |
| 311 | will not use the Echo Area to display messages. | 340 | will not use the Echo Area to display messages. |