]> git.eshelyaron.com Git - emacs.git/commitdiff
Add variable auto-save-no-message
authorFederico Tedin <federicotedin@gmail.com>
Mon, 6 Aug 2018 22:53:05 +0000 (19:53 -0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 11 Aug 2018 09:24:04 +0000 (12:24 +0300)
* 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)

doc/emacs/files.texi
etc/NEWS
lisp/cus-start.el
src/keyboard.c

index a7cc57e4e9417edbc354c72a3cc0d0b32f57a4b0..c7d3b40f9d15141d1755f9598adc8792c330851e 100644 (file)
@@ -1021,13 +1021,16 @@ separate file, without altering the file you actually use.  This is
 called @dfn{auto-saving}.  It prevents you from losing more than a
 limited amount of work if the system crashes.
 
+@vindex auto-save-no-message
   When Emacs determines that it is time for auto-saving, it considers
 each buffer, and each is auto-saved if auto-saving is enabled for it
-and it has been changed since the last time it was auto-saved.  The
-message @samp{Auto-saving...} is displayed in the echo area during
-auto-saving, if any files are actually auto-saved.  Errors occurring
-during auto-saving are caught so that they do not interfere with the
-execution of commands you have been typing.
+and it has been changed since the last time it was auto-saved.  When
+the @code{auto-save-no-message} variable is set to @code{nil} (the
+default), the message @samp{Auto-saving...} is displayed in the echo
+area during auto-saving, if any files are actually auto-saved; to
+disable these messages, customize the variable to a non-@code{nil}
+value.  Errors occurring during auto-saving are caught so that they do
+not interfere with the execution of commands you have been typing.
 
 @menu
 * Files: Auto Save Files.       The file where auto-saved changes are
index 0b1e6499f411cbe83cf97d1b3d0b39b1cf5f87c8..d918ef3f8b42df2ccc17630c953dcde704acdb1c 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -196,6 +196,11 @@ from a remote host.
 This triggers to search the program on the remote host as indicated by
 'default-directory'.
 
++++
+** New variable 'auto-save-no-message'.
+When set to t, no message will be shown when auto-saving (default
+value: nil).
+
 \f
 * Editing Changes in Emacs 27.1
 
index f31d1df30972724fe1c4cc8092d8c9957e89eafb..0d4b9687487fd6aa816037d7cefe246c69197038 100644 (file)
@@ -345,6 +345,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
             ;; keyboard.c
             (meta-prefix-char keyboard character)
             (auto-save-interval auto-save integer)
+             (auto-save-no-message auto-save boolean)
             (auto-save-timeout auto-save (choice (const :tag "off" nil)
                                                  (integer :format "%v")))
             (echo-keystrokes minibuffer number)
index 7ab9a6069ad73639cbdfe8dc75535bfdf1f34018..66041f317b52368c8ba3d0ffe1be2155bdb5dc74 100644 (file)
@@ -2626,7 +2626,7 @@ read_char (int commandflag, Lisp_Object map,
       && num_nonmacro_input_events - last_auto_save > max (auto_save_interval, 20)
       && !detect_input_pending_run_timers (0))
     {
-      Fdo_auto_save (Qnil, Qnil);
+      Fdo_auto_save (auto_save_no_message ? Qt : Qnil, Qnil);
       /* Hooks can actually change some buffers in auto save.  */
       redisplay ();
     }
@@ -2691,7 +2691,7 @@ read_char (int commandflag, Lisp_Object map,
          if (EQ (tem0, Qt)
              && ! CONSP (Vunread_command_events))
            {
-             Fdo_auto_save (Qnil, Qnil);
+             Fdo_auto_save (auto_save_no_message ? Qt : Qnil, Qnil);
              redisplay ();
            }
        }
@@ -11391,6 +11391,10 @@ result of looking up the original command in the active keymaps.  */);
 Zero means disable autosaving due to number of characters typed.  */);
   auto_save_interval = 300;
 
+  DEFVAR_BOOL ("auto-save-no-message", auto_save_no_message,
+              doc: /* Non-nil means do not print any message when auto-saving. */);
+  auto_save_no_message = false;
+
   DEFVAR_LISP ("auto-save-timeout", Vauto_save_timeout,
               doc: /* Number of seconds idle time before auto-save.
 Zero or nil means disable auto-saving due to idleness.