diff options
| author | Federico Tedin | 2018-08-06 19:53:05 -0300 |
|---|---|---|
| committer | Eli Zaretskii | 2018-08-11 12:24:04 +0300 |
| commit | c024a05e5990f0f9777ff88fffa02382b7522ccc (patch) | |
| tree | 7e3046c8280c4193130a9b5bbbfe7bc011d94d43 | |
| parent | 33344ab911ed6933294b501cb28ff63012f7a567 (diff) | |
| download | emacs-c024a05e5990f0f9777ff88fffa02382b7522ccc.tar.gz emacs-c024a05e5990f0f9777ff88fffa02382b7522ccc.zip | |
Add variable auto-save-no-message
* src/keyboard.c (auto-save-no-message): New variable, allows
suppressing auto-saving message.
* lisp/cus-start.el (standard): Add 'auto-save-no-message' variable.
* doc/emacs/files.texi (Auto Save): Document 'auto-save-no-message'.
* etc/NEWS: Mention 'auto-save-no-message'. (Bug#31039)
| -rw-r--r-- | doc/emacs/files.texi | 13 | ||||
| -rw-r--r-- | etc/NEWS | 5 | ||||
| -rw-r--r-- | lisp/cus-start.el | 1 | ||||
| -rw-r--r-- | src/keyboard.c | 8 |
4 files changed, 20 insertions, 7 deletions
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index a7cc57e4e94..c7d3b40f9d1 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi | |||
| @@ -1021,13 +1021,16 @@ separate file, without altering the file you actually use. This is | |||
| 1021 | called @dfn{auto-saving}. It prevents you from losing more than a | 1021 | called @dfn{auto-saving}. It prevents you from losing more than a |
| 1022 | limited amount of work if the system crashes. | 1022 | limited amount of work if the system crashes. |
| 1023 | 1023 | ||
| 1024 | @vindex auto-save-no-message | ||
| 1024 | When Emacs determines that it is time for auto-saving, it considers | 1025 | When Emacs determines that it is time for auto-saving, it considers |
| 1025 | each buffer, and each is auto-saved if auto-saving is enabled for it | 1026 | each buffer, and each is auto-saved if auto-saving is enabled for it |
| 1026 | and it has been changed since the last time it was auto-saved. The | 1027 | and it has been changed since the last time it was auto-saved. When |
| 1027 | message @samp{Auto-saving...} is displayed in the echo area during | 1028 | the @code{auto-save-no-message} variable is set to @code{nil} (the |
| 1028 | auto-saving, if any files are actually auto-saved. Errors occurring | 1029 | default), the message @samp{Auto-saving...} is displayed in the echo |
| 1029 | during auto-saving are caught so that they do not interfere with the | 1030 | area during auto-saving, if any files are actually auto-saved; to |
| 1030 | execution of commands you have been typing. | 1031 | disable these messages, customize the variable to a non-@code{nil} |
| 1032 | value. Errors occurring during auto-saving are caught so that they do | ||
| 1033 | not interfere with the execution of commands you have been typing. | ||
| 1031 | 1034 | ||
| 1032 | @menu | 1035 | @menu |
| 1033 | * Files: Auto Save Files. The file where auto-saved changes are | 1036 | * Files: Auto Save Files. The file where auto-saved changes are |
| @@ -196,6 +196,11 @@ from a remote host. | |||
| 196 | This triggers to search the program on the remote host as indicated by | 196 | This triggers to search the program on the remote host as indicated by |
| 197 | 'default-directory'. | 197 | 'default-directory'. |
| 198 | 198 | ||
| 199 | +++ | ||
| 200 | ** New variable 'auto-save-no-message'. | ||
| 201 | When set to t, no message will be shown when auto-saving (default | ||
| 202 | value: nil). | ||
| 203 | |||
| 199 | 204 | ||
| 200 | * Editing Changes in Emacs 27.1 | 205 | * Editing Changes in Emacs 27.1 |
| 201 | 206 | ||
diff --git a/lisp/cus-start.el b/lisp/cus-start.el index f31d1df3097..0d4b9687487 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el | |||
| @@ -345,6 +345,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of | |||
| 345 | ;; keyboard.c | 345 | ;; keyboard.c |
| 346 | (meta-prefix-char keyboard character) | 346 | (meta-prefix-char keyboard character) |
| 347 | (auto-save-interval auto-save integer) | 347 | (auto-save-interval auto-save integer) |
| 348 | (auto-save-no-message auto-save boolean) | ||
| 348 | (auto-save-timeout auto-save (choice (const :tag "off" nil) | 349 | (auto-save-timeout auto-save (choice (const :tag "off" nil) |
| 349 | (integer :format "%v"))) | 350 | (integer :format "%v"))) |
| 350 | (echo-keystrokes minibuffer number) | 351 | (echo-keystrokes minibuffer number) |
diff --git a/src/keyboard.c b/src/keyboard.c index 7ab9a6069ad..66041f317b5 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -2626,7 +2626,7 @@ read_char (int commandflag, Lisp_Object map, | |||
| 2626 | && num_nonmacro_input_events - last_auto_save > max (auto_save_interval, 20) | 2626 | && num_nonmacro_input_events - last_auto_save > max (auto_save_interval, 20) |
| 2627 | && !detect_input_pending_run_timers (0)) | 2627 | && !detect_input_pending_run_timers (0)) |
| 2628 | { | 2628 | { |
| 2629 | Fdo_auto_save (Qnil, Qnil); | 2629 | Fdo_auto_save (auto_save_no_message ? Qt : Qnil, Qnil); |
| 2630 | /* Hooks can actually change some buffers in auto save. */ | 2630 | /* Hooks can actually change some buffers in auto save. */ |
| 2631 | redisplay (); | 2631 | redisplay (); |
| 2632 | } | 2632 | } |
| @@ -2691,7 +2691,7 @@ read_char (int commandflag, Lisp_Object map, | |||
| 2691 | if (EQ (tem0, Qt) | 2691 | if (EQ (tem0, Qt) |
| 2692 | && ! CONSP (Vunread_command_events)) | 2692 | && ! CONSP (Vunread_command_events)) |
| 2693 | { | 2693 | { |
| 2694 | Fdo_auto_save (Qnil, Qnil); | 2694 | Fdo_auto_save (auto_save_no_message ? Qt : Qnil, Qnil); |
| 2695 | redisplay (); | 2695 | redisplay (); |
| 2696 | } | 2696 | } |
| 2697 | } | 2697 | } |
| @@ -11391,6 +11391,10 @@ result of looking up the original command in the active keymaps. */); | |||
| 11391 | Zero means disable autosaving due to number of characters typed. */); | 11391 | Zero means disable autosaving due to number of characters typed. */); |
| 11392 | auto_save_interval = 300; | 11392 | auto_save_interval = 300; |
| 11393 | 11393 | ||
| 11394 | DEFVAR_BOOL ("auto-save-no-message", auto_save_no_message, | ||
| 11395 | doc: /* Non-nil means do not print any message when auto-saving. */); | ||
| 11396 | auto_save_no_message = false; | ||
| 11397 | |||
| 11394 | DEFVAR_LISP ("auto-save-timeout", Vauto_save_timeout, | 11398 | DEFVAR_LISP ("auto-save-timeout", Vauto_save_timeout, |
| 11395 | doc: /* Number of seconds idle time before auto-save. | 11399 | doc: /* Number of seconds idle time before auto-save. |
| 11396 | Zero or nil means disable auto-saving due to idleness. | 11400 | Zero or nil means disable auto-saving due to idleness. |