unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Philipp Stephani <p.stephani2@gmail.com>
Cc: 25478@debbugs.gnu.org
Subject: bug#25478: 26.0.50; No hooks are called when auto-saving
Date: Fri, 28 Apr 2017 12:27:19 +0300	[thread overview]
Message-ID: <83mvb0naq0.fsf@gnu.org> (raw)
In-Reply-To: <CAArVCkQ-MS-mWtf89320Th0FsuHu2VOPvt9h1Sho4j_MEo43mg@mail.gmail.com> (message from Philipp Stephani on Sat, 22 Apr 2017 19:01:50 +0000)

> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Sat, 22 Apr 2017 19:01:50 +0000
> Cc: rgm@gnu.org, 25478@debbugs.gnu.org
> 
> Here's a patch. 

Thanks.  A few minor comments:

> --- a/doc/emacs/files.texi
> +++ b/doc/emacs/files.texi
> @@ -1040,14 +1040,13 @@ Auto Save Files
>  this happens, save the buffer with @kbd{C-x C-s}, or use @kbd{C-u 1 M-x
>  auto-save-mode}.
>  
> -@vindex auto-save-visited-file-name
> +@vindex auto-save-visited-mode

I wonder whether auto-save-files-mode is a better name, as the
"visited" part looks now out of place.  (If you do rename it, please
also rename the time-interval variable accordingly.)

> +in a separate auto-save file, enable the global minor mode
> +@code{auto-save-visited-mode}.  In this mode, auto-saving is very
> +similar to explicit saving.

"Very similar" begs the question "what's the difference?"  If there
are differences, let's describe them; if there aren't, let's say
"identical to" or "the same as".

>                                Note that this mode is orthogonal to the
> +@code{auto-save} mode described above; you can enable both at the same
> +time.

But if auto-save mode is enabled and auto-save-visited-file-name is
set, then this new mode will not auto-save, right?  This should be
documented.

> @@ -1091,6 +1090,13 @@ Auto Save Control
>  a while; second, it may avoid some auto-saving while you are actually
>  typing.
>  
> +@vindex auto-save-visited-interval

I suggest to mention this variable where you describe the new mode,
since the two descriptions are several tens of lines apart.

> +  When @code{auto-save-visited-mode} is enabled, Emacs will auto-save
> +file-visiting buffers after five seconds of idle time.  You can
> +customize the variable @code{auto-save-visited-interval} to change the
> +idle time interval.  @code{auto-save-interval} and
> +@code{auto-save-timeout} have no effect on this mode.

I think the last sentence should be part of the description of the
mode, not of the variable.  Doing so will also provide a good
opportunity to mention auto-save-visited-interval.

> +(defcustom auto-save-visited-interval 5
> +  "Interval in seconds for `auto-save-visited-mode'.
> +If `auto-save-visited-mode' is enabled, Emacs will save all
> +buffers visiting a file to the visited file after it has been
> +idle for `auto-save-visited-interval' seconds."
> +  :group 'auto-save
> +  :type 'number
> +  :set (lambda (symbol value)
> +         (set-default symbol value)
> +         (when auto-save--timer
> +           (timer-set-idle-time auto-save--timer value :repeat))))

Please add a :version tag to new defcustoms.

> +(define-minor-mode auto-save-visited-mode
> +  "Toggle automatic saving to file-visiting buffers on or off.
> +With a prefix argument ARG, enable regular saving of all buffers
> +vising a file if ARG is positive, and disable it otherwise.
   ^^^^^^
A typo.





  reply	other threads:[~2017-04-28  9:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-18 21:39 bug#25478: 26.0.50; No hooks are called when auto-saving Philipp Stephani
2017-01-19 20:29 ` Glenn Morris
2017-01-20  8:45   ` Eli Zaretskii
2017-01-20 17:42     ` Glenn Morris
2017-03-26 18:21     ` Philipp Stephani
2017-03-26 18:45       ` Eli Zaretskii
2017-03-26 19:17         ` Philipp Stephani
2017-04-22 19:01           ` Philipp Stephani
2017-04-28  9:27             ` Eli Zaretskii [this message]
2017-04-29 18:47               ` Philipp Stephani
2017-04-29 18:49                 ` bug#25478: [PATCH] Reimplement auto-saving to visited files Philipp Stephani
     [not found]                 ` <20170429184909.40204-1-phst@google.com>
2017-04-29 19:20                   ` Eli Zaretskii
2017-04-29 19:31                     ` Philipp Stephani
     [not found]                     ` <CAArVCkR-BeJDgC5tu0PfN-63PRB5UN9Yid-UbuVdT-CpafVeAg@mail.gmail.com>
2020-08-11  8:08                       ` Stefan Kangas
2020-10-01 12:11                         ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83mvb0naq0.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=25478@debbugs.gnu.org \
    --cc=p.stephani2@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).