* bug#31039: 27.0.50; allow silencing auto-save
@ 2018-04-03 9:06 Aaron Jensen
2018-08-04 0:51 ` Federico
0 siblings, 1 reply; 12+ messages in thread
From: Aaron Jensen @ 2018-04-03 9:06 UTC (permalink / raw)
To: 31039
Currently, keyboard.c calls do-auto-save directly and passes nil to the
NO-MESSAGE arg. It would be nice if there was a way to pass t in these
situations in order to suppress the message. Perhaps a new var to
suppress the auto-save message in all cases?
This has been asked about and/or hacked around (by disabling the normal
auto-save mechanisms and adding an idle timer) a number of times:
https://www.reddit.com/r/emacs/comments/63gmhd/silencing_autosave_messages/
https://emacs.stackexchange.com/questions/12556/disabling-the-auto-saving-done-message
http://pragmaticemacs.com/emacs/make-emacs-a-bit-quieter/
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#31039: 27.0.50; allow silencing auto-save
2018-04-03 9:06 bug#31039: 27.0.50; allow silencing auto-save Aaron Jensen
@ 2018-08-04 0:51 ` Federico
2018-08-06 2:43 ` Noam Postavsky
0 siblings, 1 reply; 12+ messages in thread
From: Federico @ 2018-08-04 0:51 UTC (permalink / raw)
To: aaronjensen; +Cc: 31039
[-- Attachment #1: Type: text/plain, Size: 249 bytes --]
I've prepared a patch to add this feature (see attached file). Since
this is my first contribution to this project (and also my first time
sending a patch via email), it's possible I've made some mistakes
along the way. Any feedback is appreciated.
[-- Attachment #2: auto-save-quiet.patch --]
[-- Type: text/x-diff, Size: 3476 bytes --]
From 7a310b047720a244478a9991f96a86901cf897de Mon Sep 17 00:00:00 2001
From: Federico Tedin <federicotedin@gmail.com>
Date: Fri, 3 Aug 2018 21:26:58 -0300
Subject: [PATCH] Add variable auto-save-quiet
* src/keyboarc.c (auto_save_quiet): New variable, allows suppressing
auto-saving message.
* lisp/cus-start.el (standard): Add auto-save-quiet variable.
* doc/emacs/files.texi: Update manual.
---
doc/emacs/files.texi | 11 ++++++-----
lisp/cus-start.el | 1 +
src/keyboard.c | 8 ++++++--
3 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index a7cc57e4e9..0635aeba71 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -1023,11 +1023,12 @@ Auto Save
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-quiet} variable is set to @code{nil}, 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.
@menu
* Files: Auto Save Files. The file where auto-saved changes are
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index f31d1df309..53c051a4c0 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -345,6 +345,7 @@ minibuffer-prompt-properties--setter
;; keyboard.c
(meta-prefix-char keyboard character)
(auto-save-interval auto-save integer)
+ (auto-save-quiet auto-save boolean)
(auto-save-timeout auto-save (choice (const :tag "off" nil)
(integer :format "%v")))
(echo-keystrokes minibuffer number)
diff --git a/src/keyboard.c b/src/keyboard.c
index 7ab9a6069a..0eb74c6dc7 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -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_quiet, 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_quiet, 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_LISP ("auto-save-quiet", auto_save_quiet,
+ doc: /* Non-nil means do not print any message when auto-saving. */);
+ auto_save_quiet = Qnil;
+
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.
--
2.17.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* bug#31039: 27.0.50; allow silencing auto-save
2018-08-04 0:51 ` Federico
@ 2018-08-06 2:43 ` Noam Postavsky
2018-08-06 14:56 ` Eli Zaretskii
2018-08-06 15:05 ` Eli Zaretskii
0 siblings, 2 replies; 12+ messages in thread
From: Noam Postavsky @ 2018-08-06 2:43 UTC (permalink / raw)
To: Federico; +Cc: aaronjensen, 31039
tags 31039 + patch
quit
Federico <federicotedin@gmail.com> writes:
> I've prepared a patch to add this feature (see attached file). Since
> this is my first contribution to this project (and also my first time
> sending a patch via email), it's possible I've made some mistakes
> along the way. Any feedback is appreciated.
If you can add a NEWS entry mentioning the new variable, it should be
just about ready.
By the way, this patch is small enough to be added regardless, but if
you plan to send much more (the limit is about 15 lines, cumulative for
all of your patches), then you might want to think about getting started
on the copyright assignment.
> + DEFVAR_LISP ("auto-save-quiet", auto_save_quiet,
> + doc: /* Non-nil means do not print any message when auto-saving. */);
> + auto_save_quiet = Qnil;
The C name of the variable should start with V, like the others.
> 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.
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#31039: 27.0.50; allow silencing auto-save
2018-08-06 2:43 ` Noam Postavsky
@ 2018-08-06 14:56 ` Eli Zaretskii
2018-08-06 15:05 ` Eli Zaretskii
1 sibling, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2018-08-06 14:56 UTC (permalink / raw)
To: Noam Postavsky; +Cc: federicotedin, aaronjensen, 31039
> From: Noam Postavsky <npostavs@gmail.com>
> Date: Sun, 05 Aug 2018 22:43:16 -0400
> Cc: aaronjensen@gmail.com, 31039@debbugs.gnu.org
>
> > + DEFVAR_LISP ("auto-save-quiet", auto_save_quiet,
> > + doc: /* Non-nil means do not print any message when auto-saving. */);
> > + auto_save_quiet = Qnil;
>
> The C name of the variable should start with V, like the others.
For a boolean variable, one can use DEFVAR_BOOL, in which case the
"start with V" nuisance can be avoided (and the code will be a tad
more efficient, too).
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#31039: 27.0.50; allow silencing auto-save
2018-08-06 2:43 ` Noam Postavsky
2018-08-06 14:56 ` Eli Zaretskii
@ 2018-08-06 15:05 ` Eli Zaretskii
2018-08-06 23:02 ` Federico
1 sibling, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2018-08-06 15:05 UTC (permalink / raw)
To: Noam Postavsky; +Cc: federicotedin, aaronjensen, 31039
> From: Noam Postavsky <npostavs@gmail.com>
> Date: Sun, 05 Aug 2018 22:43:16 -0400
> Cc: aaronjensen@gmail.com, 31039@debbugs.gnu.org
>
> I've prepared a patch to add this feature (see attached file). Since
> this is my first contribution to this project (and also my first time
> sending a patch via email), it's possible I've made some mistakes
> along the way. Any feedback is appreciated.
Thanks.
> * src/keyboarc.c (auto_save_quiet): New variable, allows suppressing
^^^^^^^^
A typo.
> diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
> index a7cc57e4e9..0635aeba71 100644
> --- a/doc/emacs/files.texi
> +++ b/doc/emacs/files.texi
> @@ -1023,11 +1023,12 @@ Auto Save
>
> 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-quiet} variable is set to @code{nil}, 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.
Each variable (and function and command and macro and ...) described
in the manual must be indexed. So please add
@vindex auto-save-quiet
before this paragraph.
Also, this text should say what is the default of this variable.
Btw, I'd prefer to call the variable auto-save-no-message.
auto-save-quiet might not make its intent clear enough, IMO.
Thanks.
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#31039: 27.0.50; allow silencing auto-save
2018-08-06 15:05 ` Eli Zaretskii
@ 2018-08-06 23:02 ` Federico
2018-08-07 14:54 ` Eli Zaretskii
2018-08-11 9:31 ` Eli Zaretskii
0 siblings, 2 replies; 12+ messages in thread
From: Federico @ 2018-08-06 23:02 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Noam Postavsky, Aaron Jensen, 31039
[-- Attachment #1: Type: text/plain, Size: 339 bytes --]
Noam, Eli: I've applied the fixes you have both mentioned. I ended up
using DEFVAR_BOOL to create the variable, but I'm not sure I used the
variable correctly when calling Fdo_auto_save (the function only takes
Lisp_Object). I have attached a new patch.
Regarding the copyright assignment, mine was approved one or two weeks ago.
Thanks
[-- Attachment #2: auto-save-no-message.patch --]
[-- Type: text/x-diff, Size: 4224 bytes --]
From 8ab8141e70c8d0f97f9bd265275f6ef1a043317c Mon Sep 17 00:00:00 2001
From: Federico Tedin <federicotedin@gmail.com>
Date: Mon, 6 Aug 2018 19:53:05 -0300
Subject: [PATCH] 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: Update manual.
* etc/NEWS: Update news.
---
doc/emacs/files.texi | 13 ++++++++-----
etc/NEWS | 4 ++++
lisp/cus-start.el | 1 +
src/keyboard.c | 8 ++++++--
4 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index a7cc57e4e9..362993c02e 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -1021,13 +1021,16 @@ Auto Save
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 message
+@samp{Auto-saving...} is displayed in the echo area during auto-saving,
+if any files are actually auto-saved. The default value for
+@code{auto-save-no-message} is @code{nil}. 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
diff --git a/etc/NEWS b/etc/NEWS
index 21887f5bfd..49d5afbca9 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -189,6 +189,10 @@ 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
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index f31d1df309..0d4b968748 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -345,6 +345,7 @@ minibuffer-prompt-properties--setter
;; 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)
diff --git a/src/keyboard.c b/src/keyboard.c
index 7ab9a6069a..66041f317b 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -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.
--
2.17.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* bug#31039: 27.0.50; allow silencing auto-save
2018-08-06 23:02 ` Federico
@ 2018-08-07 14:54 ` Eli Zaretskii
2018-08-07 18:36 ` Federico
2018-08-11 9:31 ` Eli Zaretskii
1 sibling, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2018-08-07 14:54 UTC (permalink / raw)
To: Federico; +Cc: npostavs, aaronjensen, 31039
> From: Federico <federicotedin@gmail.com>
> Date: Mon, 6 Aug 2018 20:02:28 -0300
> Cc: Noam Postavsky <npostavs@gmail.com>, Aaron Jensen <aaronjensen@gmail.com>, 31039@debbugs.gnu.org
>
> Noam, Eli: I've applied the fixes you have both mentioned. I ended up
> using DEFVAR_BOOL to create the variable, but I'm not sure I used the
> variable correctly when calling Fdo_auto_save (the function only takes
> Lisp_Object). I have attached a new patch.
LGTM, thanks.
> Regarding the copyright assignment, mine was approved one or two weeks ago.
I don't yet see it on file, but that doesn't have to hold this
contribution.
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#31039: 27.0.50; allow silencing auto-save
2018-08-07 14:54 ` Eli Zaretskii
@ 2018-08-07 18:36 ` Federico
2018-08-11 16:10 ` Aaron Jensen
0 siblings, 1 reply; 12+ messages in thread
From: Federico @ 2018-08-07 18:36 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Noam Postavsky, Aaron Jensen, 31039
Great! Is anything else required on my side?
> I don't yet see it on file, but that doesn't have to hold this
> contribution.
That's strange, considering they've already signed the PDF and sent it
to me. I'll send an email to copright-clerk@fsf.org to see if there
have been any problems.
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#31039: 27.0.50; allow silencing auto-save
2018-08-06 23:02 ` Federico
2018-08-07 14:54 ` Eli Zaretskii
@ 2018-08-11 9:31 ` Eli Zaretskii
2018-08-11 10:11 ` Eli Zaretskii
1 sibling, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2018-08-11 9:31 UTC (permalink / raw)
To: Federico; +Cc: 31039-done, npostavs, aaronjensen
> From: Federico <federicotedin@gmail.com>
> Date: Mon, 6 Aug 2018 20:02:28 -0300
> Cc: Noam Postavsky <npostavs@gmail.com>, Aaron Jensen <aaronjensen@gmail.com>, 31039@debbugs.gnu.org
>
> Noam, Eli: I've applied the fixes you have both mentioned. I ended up
> using DEFVAR_BOOL to create the variable, but I'm not sure I used the
> variable correctly when calling Fdo_auto_save (the function only takes
> Lisp_Object). I have attached a new patch.
>
> Regarding the copyright assignment, mine was approved one or two weeks ago.
Thanks, pushed to the master branch.
A few minor nits for your future contributions:
. For changes in the manuals, the name of the node where the change
is done should be mentioned in parentheses, as if it were a
function.
. Please make sure the NEWS entries are filled according to the
default setting of fill-column (use M-q to do that).
. It is preferable to explicitly mention the new functions/variables
in the log entries for NEWS and the manuals.
You can look at the changes I actually pushed to see how I handled
those issues in this commit.
Thank you for your contribution; your copyright assignment is now on
file.
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#31039: 27.0.50; allow silencing auto-save
2018-08-11 9:31 ` Eli Zaretskii
@ 2018-08-11 10:11 ` Eli Zaretskii
2018-08-11 18:20 ` Federico
0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2018-08-11 10:11 UTC (permalink / raw)
To: Federico; +Cc: aaronjensen, 31039
> Date: Sat, 11 Aug 2018 12:31:34 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 31039-done@debbugs.gnu.org, npostavs@gmail.com, aaronjensen@gmail.com
>
> A few minor nits for your future contributions:
>
> . For changes in the manuals, the name of the node where the change
> is done should be mentioned in parentheses, as if it were a
> function.
> . Please make sure the NEWS entries are filled according to the
> default setting of fill-column (use M-q to do that).
> . It is preferable to explicitly mention the new functions/variables
> in the log entries for NEWS and the manuals.
Sorry, 2 more:
. Always mention the bug number in the log entry.
. When you add a new customizable option, always mark it with the
first Emacs version where the option will appear, in this case
27.1.
Thanks.
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#31039: 27.0.50; allow silencing auto-save
2018-08-07 18:36 ` Federico
@ 2018-08-11 16:10 ` Aaron Jensen
0 siblings, 0 replies; 12+ messages in thread
From: Aaron Jensen @ 2018-08-11 16:10 UTC (permalink / raw)
To: federicotedin; +Cc: 31039
Thank you, Federico!
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#31039: 27.0.50; allow silencing auto-save
2018-08-11 10:11 ` Eli Zaretskii
@ 2018-08-11 18:20 ` Federico
0 siblings, 0 replies; 12+ messages in thread
From: Federico @ 2018-08-11 18:20 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 31039
Thanks Eli, I've taken a look at the commit and noted the corrections
you listed. Also, good to know about the copyright assignment.
On Sat, Aug 11, 2018 at 7:11 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>> Date: Sat, 11 Aug 2018 12:31:34 +0300
>> From: Eli Zaretskii <eliz@gnu.org>
>> Cc: 31039-done@debbugs.gnu.org, npostavs@gmail.com, aaronjensen@gmail.com
>>
>> A few minor nits for your future contributions:
>>
>> . For changes in the manuals, the name of the node where the change
>> is done should be mentioned in parentheses, as if it were a
>> function.
>> . Please make sure the NEWS entries are filled according to the
>> default setting of fill-column (use M-q to do that).
>> . It is preferable to explicitly mention the new functions/variables
>> in the log entries for NEWS and the manuals.
>
> Sorry, 2 more:
>
> . Always mention the bug number in the log entry.
> . When you add a new customizable option, always mark it with the
> first Emacs version where the option will appear, in this case
> 27.1.
>
> Thanks.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2018-08-11 18:20 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-03 9:06 bug#31039: 27.0.50; allow silencing auto-save Aaron Jensen
2018-08-04 0:51 ` Federico
2018-08-06 2:43 ` Noam Postavsky
2018-08-06 14:56 ` Eli Zaretskii
2018-08-06 15:05 ` Eli Zaretskii
2018-08-06 23:02 ` Federico
2018-08-07 14:54 ` Eli Zaretskii
2018-08-07 18:36 ` Federico
2018-08-11 16:10 ` Aaron Jensen
2018-08-11 9:31 ` Eli Zaretskii
2018-08-11 10:11 ` Eli Zaretskii
2018-08-11 18:20 ` Federico
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.