From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.bugs Subject: bug#25478: 26.0.50; No hooks are called when auto-saving Date: Sat, 29 Apr 2017 18:47:24 +0000 Message-ID: References: <837f5q6rxq.fsf@gnu.org> <83wpbb98rc.fsf@gnu.org> <83mvb0naq0.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c0d21c293cf6f054e529f13 X-Trace: blaine.gmane.org 1493491698 7391 195.159.176.226 (29 Apr 2017 18:48:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 29 Apr 2017 18:48:18 +0000 (UTC) Cc: 25478@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 29 20:48:10 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4XPe-0001gp-40 for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Apr 2017 20:48:10 +0200 Original-Received: from localhost ([::1]:42010 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d4XPg-00037u-SV for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Apr 2017 14:48:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d4XPa-00037p-SS for bug-gnu-emacs@gnu.org; Sat, 29 Apr 2017 14:48:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d4XPW-0008Tw-2W for bug-gnu-emacs@gnu.org; Sat, 29 Apr 2017 14:48:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48413) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d4XPV-0008Tq-Uy for bug-gnu-emacs@gnu.org; Sat, 29 Apr 2017 14:48:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d4XPV-0001CD-It for bug-gnu-emacs@gnu.org; Sat, 29 Apr 2017 14:48:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Apr 2017 18:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25478 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25478-submit@debbugs.gnu.org id=B25478.14934916624573 (code B ref 25478); Sat, 29 Apr 2017 18:48:01 +0000 Original-Received: (at 25478) by debbugs.gnu.org; 29 Apr 2017 18:47:42 +0000 Original-Received: from localhost ([127.0.0.1]:46612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4XPC-0001Bg-CA for submit@debbugs.gnu.org; Sat, 29 Apr 2017 14:47:42 -0400 Original-Received: from mail-wr0-f169.google.com ([209.85.128.169]:34734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4XPA-0001BT-Rr for 25478@debbugs.gnu.org; Sat, 29 Apr 2017 14:47:41 -0400 Original-Received: by mail-wr0-f169.google.com with SMTP id l9so47888359wre.1 for <25478@debbugs.gnu.org>; Sat, 29 Apr 2017 11:47:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ypUokuhZEY4ji4JPwNBrQ/i/rpqsUARGH1swP5hFyGQ=; b=FG4Q872DEYDrGxCJ50mcJnVqJRY1vWW7lf2vhftANRUOMURKB8ikZ97nhleyT5w55e Ex1behFLJ9vp5MRMPzx6RoQZV2xiwFArggBaaI3gLVeN2QGUgjz0EpmeeIZRVDkLFKqO 0IDtUagzOacWANo9nbwwHlec5pvxXME9bnF+kna62SY6QvQY71Z6t/VVpTME9wg+8PEL TOuKuW0y+MNeqPEG+imqMb7F6jZf+cMl4RxFW7/gwdZzXDz/4mh5PubsGX1lW/c0+vXf d6NXvTEzEcRC44A0j0amrcMyIMNKtDllkw/2j3c4615vbMp+SL6n8gDXPtOLWYIxNSfj kJPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ypUokuhZEY4ji4JPwNBrQ/i/rpqsUARGH1swP5hFyGQ=; b=cEtG/0yZkW+BfTuuk0VsNIVYIpf2tYfe8PgSCovvLcYJ9QFkxbQMToiaDEc6SVrKBi Uk4yR3oJ6J0bQ8M0KEQ4bQ3rpLrrbkOSpTPjvm2BL+wJfcqOq87ndVmE6d7ESoBoWJEM qCYPDP/F5iBL+ZT4npNhYqKmt2tap/C/VjubZetA0mh7qs7DL2UJiYla2hwOhgGZk3nW +6phh3KLqJsvVH64hB+C9DZixH9TfyfyPWAfdKL/0IWJaj3h1PdgRPhvG08SCq9VMmY/ +RFMzVdz/iEaSzo203SEb6OHyfDDO+QWimFjgV0/uURyD/BBZSpid/SqSCijDDlkxu6c oeGQ== X-Gm-Message-State: AN3rC/7aVdILjkunYa4eW0EwsWG2++wSADa0T7lw8AoKnhWVQHT+xk10 TzuqrXeGn45wY2eLb7hYIXS3Um3+rw== X-Received: by 10.223.148.35 with SMTP id 32mr5247268wrq.175.1493491655100; Sat, 29 Apr 2017 11:47:35 -0700 (PDT) In-Reply-To: <83mvb0naq0.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:132110 Archived-At: --94eb2c0d21c293cf6f054e529f13 Content-Type: text/plain; charset=UTF-8 Eli Zaretskii schrieb am Fr., 28. Apr. 2017 um 11:28 Uhr: > > From: Philipp Stephani > > 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.) > I think the name should be sufficiently different from auto-save-mode so that the modes can't be confused. auto-save-files-mode would be confusing, because auto-save-mode also saves files. I think including the "visited" word is useful here because it's the meaningful distinction between the modes: one uses the visited file name, the other doesn't. > > > +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". > Done. > > > 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. > Done. > > > @@ -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. > Done. > > > + 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. > Done. > > > +(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. > Done. > > > +(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. > Done. --94eb2c0d21c293cf6f054e529f13 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= Fr., 28. Apr. 2017 um 11:28=C2=A0Uhr:
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Sat, 22 Apr 2017 19:01:50 +0000
> Cc: rgm@gnu.org, = 25478@debbugs.gn= u.org
>
> Here's a patch.

Thanks.=C2=A0 A few minor comments:

> --- a/doc/emacs/files.texi
> +++ b/doc/emacs/files.texi
> @@ -1040,14 +1040,13 @@ Auto Save Files
>=C2=A0 this happens, save the buffer with @kbd{C-x C-s}, or use @kbd{C-= u 1 M-x
>=C2=A0 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.=C2=A0 (If you do rename it= , please
also rename the time-interval variable accordingly.)
<= br>
I think the name should be sufficiently different from auto-s= ave-mode so that the modes can't be confused. auto-save-files-mode woul= d be confusing, because auto-save-mode also saves files. I think including = the "visited" word is useful here because it's the meaningful= distinction between the modes: one uses the visited file name, the other d= oesn't.
=C2=A0

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

"Very similar" begs the question "what's the difference?= "=C2=A0 If there
are differences, let's describe them; if there aren't, let's sa= y
"identical to" or "the same as".
<= br>
Done.
=C2=A0

>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Note that this mode is orthogonal= to the
> +@code{auto-save} mode described above; you can enable both at the sam= e
> +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?=C2=A0 This should be
documented.

Done.
=C2=A0

> @@ -1091,6 +1090,13 @@ Auto Save Control
>=C2=A0 a while; second, it may avoid some auto-saving while you are act= ually
>=C2=A0 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.

Done.
=C2=A0

> +=C2=A0 When @code{auto-save-visited-mode} is enabled, Emacs will auto= -save
> +file-visiting buffers after five seconds of idle time.=C2=A0 You can<= br> > +customize the variable @code{auto-save-visited-interval} to change th= e
> +idle time interval.=C2=A0 @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.=C2=A0 Doing so will also provide a good
opportunity to mention auto-save-visited-interval.
Done.
=C2=A0

> +(defcustom auto-save-visited-interval 5
> +=C2=A0 "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."
> +=C2=A0 :group 'auto-save
> +=C2=A0 :type 'number
> +=C2=A0 :set (lambda (symbol value)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(set-default symbol value)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(when auto-save--timer
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(timer-set-idle-time auto-sa= ve--timer value :repeat))))

Please add a :version tag to new defcustoms.

Done.
=C2=A0

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

Done.=C2=A0
--94eb2c0d21c293cf6f054e529f13--