unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: michael.albinus@gmx.de, 35418@debbugs.gnu.org
Subject: bug#35418: [PATCH] Don't poll auto-revert files that use notification
Date: Sat, 04 May 2019 13:21:19 +0200	[thread overview]
Message-ID: <26e8159ac86da37d9cf555f6cb3f2dcb63ac0a67.camel@acm.org> (raw)
In-Reply-To: <831s1emvz7.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 740 bytes --]

lör 2019-05-04 klockan 12:04 +0300 skrev Eli Zaretskii:
> 
> IOW, only when you describe changes to another node you should start
> on a new line.  The above is the formatting produced by "C-x 4 a" and
> its ilk.

Reformatted.

> No, I meant make "Autorevert" (under its new name) a subsection of
> "Auto Revert", and the 2 subsections of "Autorevert" sub-subsections.
> Or did I misunderstand the problem you were describing?

Done. It seems that a subsection can be directly under a top node
without a section as intermediate step; I didn't know that.

> Yes, but that hint doesn't mention the polling.  I think it's
> important to tell that polling is needed in these rare cases.

Text added.

Thanks again; revised patch attached.

> 

[-- Attachment #2: 0001-Reorganise-auto-revert-nodes-in-the-manual.patch --]
[-- Type: text/x-patch, Size: 10348 bytes --]

From ea7c087df14f302543ce9e2711cc8cbde09dbc30 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= <mattiase@acm.org>
Date: Tue, 30 Apr 2019 22:35:56 +0200
Subject: [PATCH] Reorganise (auto-)revert nodes in the manual

Put all information about auto-revert into a section of its own, and
organise the text in a more logical way.  Previously it was mainly
described in the section about reverting (bug#35418).

* doc/emacs/files.texi (Files): Adjust menu.
(Reverting, Auto Revert, Autorevert): Add node `Auto Revert' and move
text on that topic from `Reverting', rearranged.  Turn the old
`Autorevert' node into a subsection under `Auto Revert'.
* doc/emacs/arevert-xtra.texi (Autorevert): Rename and turn into
subsubsection.
* doc/emacs/buffers.texi (Several Buffers): Adjust references.
* doc/emacs/emacs.texi (Top): Adjust menu.
* doc/emacs/emacs-xtra.texi (Top): Adjust menu.
(Non-File Buffers): Add node and section lines.
---
 doc/emacs/arevert-xtra.texi |  9 +++--
 doc/emacs/buffers.texi      |  4 +-
 doc/emacs/emacs-xtra.texi   |  2 +-
 doc/emacs/emacs.texi        |  4 +-
 doc/emacs/files.texi        | 75 +++++++++++++++++++++----------------
 5 files changed, 51 insertions(+), 43 deletions(-)

diff --git a/doc/emacs/arevert-xtra.texi b/doc/emacs/arevert-xtra.texi
index cd7c1ff895..9e01a10ace 100644
--- a/doc/emacs/arevert-xtra.texi
+++ b/doc/emacs/arevert-xtra.texi
@@ -4,8 +4,9 @@
 @c
 @c This file is included either in emacs-xtra.texi (when producing the
 @c printed version) or in the main Emacs manual (for the on-line version).
-@node Autorevert
-@section Auto Reverting Non-File Buffers
+
+@node Non-File Buffers
+@subsection Auto Reverting Non-File Buffers
 
 Global Auto Revert Mode normally only reverts file buffers.  There are
 two ways to auto-revert certain non-file buffers: by enabling Auto
@@ -43,7 +44,7 @@ Autorevert
 @end menu
 
 @node Auto Reverting the Buffer Menu
-@subsection Auto Reverting the Buffer Menu
+@subsubsection Auto Reverting the Buffer Menu
 
 If auto-reverting of non-file buffers is enabled, the Buffer Menu
 @iftex
@@ -65,7 +66,7 @@ Auto Reverting the Buffer Menu
 automatically erasing the marks.
 
 @node Auto Reverting Dired
-@subsection Auto Reverting Dired buffers
+@subsubsection Auto Reverting Dired buffers
 
 Dired buffers only auto-revert when the file list of the buffer's main
 directory changes (e.g., when a new file is added or deleted).  They
diff --git a/doc/emacs/buffers.texi b/doc/emacs/buffers.texi
index 27fcb7369a..14a0a01ca8 100644
--- a/doc/emacs/buffers.texi
+++ b/doc/emacs/buffers.texi
@@ -568,10 +568,10 @@ Several Buffers
 Auto Revert mode applies to the @file{*Buffer List*} buffer only if
 @code{global-auto-revert-non-file-buffers} is non-@code{nil}.
 @iftex
-@inforef{Autorevert,, emacs-xtra}, for details.
+@inforef{Auto Reverting the Buffer Menu,, emacs-xtra}, for details.
 @end iftex
 @ifnottex
-@xref{Autorevert, global-auto-revert-non-file-buffers}, for details.
+@xref{Auto Reverting the Buffer Menu, global-auto-revert-non-file-buffers}, for details.
 @end ifnottex
 
 @node Indirect Buffers
diff --git a/doc/emacs/emacs-xtra.texi b/doc/emacs/emacs-xtra.texi
index dcd8fae1b6..e9231b4e3a 100644
--- a/doc/emacs/emacs-xtra.texi
+++ b/doc/emacs/emacs-xtra.texi
@@ -59,7 +59,7 @@ Top
 * Picture Mode::        Editing pictures made up of characters using
                          the quarter-plane screen model.
 
-* Autorevert::          Auto Reverting non-file buffers.
+* Non-File Buffers::    Auto Reverting non-file buffers.
 * Subdir Switches::     Subdirectory switches in Dired.
 * Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization.
 * Emerge::              A convenient way of merging two versions of a program.
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index 58ec373029..a34cef221e 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -443,9 +443,7 @@ Top
 * Visiting::            Visiting a file prepares Emacs to edit the file.
 * Saving::              Saving makes your changes permanent.
 * Reverting::           Reverting cancels all the changes not saved.
-@ifnottex
-* Autorevert::          Auto Reverting non-file buffers.
-@end ifnottex
+* Auto Revert::         Keeping buffers automatically up-to-date.
 * Auto Save::           Auto Save periodically protects against loss of data.
 * File Aliases::        Handling multiple names for one file.
 * Directories::         Creating, deleting, and listing file directories.
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index 990b8f1679..c51d076fa2 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -25,9 +25,7 @@ Files
 * Visiting::            Visiting a file prepares Emacs to edit the file.
 * Saving::              Saving makes your changes permanent.
 * Reverting::           Reverting cancels all the changes not saved.
-@ifnottex
-* Autorevert::          Auto Reverting non-file buffers.
-@end ifnottex
+* Auto Revert::         Keeping buffers automatically up-to-date.
 * Auto Save::           Auto Save periodically protects against loss of data.
 * File Aliases::        Handling multiple names for one file.
 * Directories::         Creating, deleting, and listing file directories.
@@ -955,6 +953,11 @@ Reverting
 is not modified.  (If you have edited the text, it would be wrong to
 discard your changes.)
 
+  You can also tell Emacs to revert buffers automatically when their
+visited files change on disk; @pxref{Auto Revert}.
+
+@node Auto Revert
+@section Auto Revert: Keeping buffers automatically up-to-date
 @cindex Global Auto Revert mode
 @cindex mode, Global Auto Revert
 @cindex Auto Revert mode
@@ -962,22 +965,39 @@ Reverting
 @findex global-auto-revert-mode
 @findex auto-revert-mode
 @findex auto-revert-tail-mode
-@vindex auto-revert-interval
-@vindex auto-revert-remote-files
+
+  A buffer can get out of sync with respect to its visited file on
+disk if that file is changed by another program.  To keep it up to
+date, you can enable Auto Revert mode by typing @kbd{M-x auto-revert-mode}.
+This automatically reverts the buffer when its visited file changes on
+disk.  To do the same for all file buffers, type
+@kbd{M-x global-auto-revert-mode} to enable Global Auto Revert mode.
+
+  Auto Revert will not revert a buffer if it has unsaved changes, or if
+its file on disk is deleted or renamed.
+
+  One use of Auto Revert mode is to ``tail'' a file such as a system
+log, so that changes made to that file by other programs are
+continuously displayed.  To do this, just move the point to the end of
+the buffer, and it will stay there as the file contents change.
+However, if you are sure that the file will only change by growing at
+the end, use Auto Revert Tail mode instead
+(@code{auto-revert-tail-mode}).  It is more efficient for this.
+Auto Revert Tail mode also works for remote files.
+
 @vindex auto-revert-verbose
-  You can also tell Emacs to revert buffers periodically.  To do this
-for a specific buffer, enable the minor mode Auto-Revert mode by
-typing @kbd{M-x auto-revert-mode}.  This automatically reverts the
-current buffer when its visited file changes on disk.  To do the same
-for all file buffers, type @kbd{M-x global-auto-revert-mode} to enable
-Global Auto-Revert mode.  These minor modes do not check or revert
-remote files, because that is usually too slow.  This behavior can be
-changed by setting the variable @code{auto-revert-remote-files} to
-non-@code{nil}.
+  When a buffer is auto-reverted, a message is generated.  This can be
+suppressed by setting @code{auto-revert-verbose} to @code{nil}.
+
+@vindex auto-revert-remote-files
+  The Auto Revert modes do not check or revert remote files, because
+that is usually too slow.  This behavior can be changed by setting the
+variable @code{auto-revert-remote-files} to non-@code{nil}.
 
 @cindex file notifications
 @vindex auto-revert-use-notify
-  By default, Auto-Revert mode works using @dfn{file notifications},
+@vindex auto-revert-interval
+  By default, Auto Revert mode works using @dfn{file notifications},
 whereby changes in the filesystem are reported to Emacs by the OS.
 You can disable use of file notifications by customizing the variable
 @code{auto-revert-use-notify} to a @code{nil} value, then Emacs will
@@ -990,31 +1010,20 @@ Reverting
 
 @vindex auto-revert-avoid-polling
 @vindex auto-revert-notify-exclude-dir-regexp
-  By default, Auto-Revert mode will poll files for changes
-periodically even when file notifications are used.  Such polling is
-usually unnecessary, and turning it off may save power by relying on
-notifications only.  To do so, set the variable
+  By default, Auto Revert mode will poll files for changes
+periodically even when file notifications are used.  Polling is
+unnecessary in many cases, and turning it off may save power by
+relying on notifications only.  To do so, set the variable
 @code{auto-revert-avoid-polling} to non-@code{nil}.  However,
 notification is ineffective on certain file systems; mainly network
 file system on Unix-like machines, where files can be altered from
-other machines.  To force polling when
+other machines.  For such file systems, polling may be necessary.
+To force polling when
 @code{auto-revert-avoid-polling} is non-@code{nil}, set
 @code{auto-revert-notify-exclude-dir-regexp} to match files that
 should be excluded from using notification.
 
-  One use of Auto-Revert mode is to ``tail'' a file such as a system
-log, so that changes made to that file by other programs are
-continuously displayed.  To do this, just move the point to the end of
-the buffer, and it will stay there as the file contents change.
-However, if you are sure that the file will only change by growing at
-the end, use Auto-Revert Tail mode instead
-(@code{auto-revert-tail-mode}).  It is more efficient for this.
-Auto-Revert Tail mode works also for remote files.
-
-  When a buffer is auto-reverted, a message is generated.  This can be
-suppressed by setting @code{auto-revert-verbose} to @code{nil}.
-
-  In Dired buffers (@pxref{Dired}), Auto-Revert mode refreshes the
+  In Dired buffers (@pxref{Dired}), Auto Revert mode refreshes the
 buffer when a file is created or deleted in the buffer's directory.
 
   @xref{VC Undo}, for commands to revert to earlier versions of files
-- 
2.20.1


  reply	other threads:[~2019-05-04 11:21 UTC|newest]

Thread overview: 101+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-24 18:14 bug#35418: [PATCH] Don't poll auto-revert files that use notification Mattias Engdegård
2019-04-24 18:58 ` Eli Zaretskii
2019-04-24 19:36   ` Michael Albinus
2019-04-26 20:46     ` Mattias Engdegård
2019-04-27  9:40       ` Michael Albinus
2019-04-27 16:28         ` Mattias Engdegård
2019-04-25  9:56   ` Mattias Engdegård
2019-04-25 10:04     ` Eli Zaretskii
2019-04-25 18:07       ` Mattias Engdegård
2019-04-27  9:27       ` Michael Albinus
2019-04-27  9:54         ` Eli Zaretskii
2019-04-27 10:23           ` Michael Albinus
2019-04-27 16:19         ` Mattias Engdegård
2019-04-27 16:52           ` Eli Zaretskii
2019-04-28 10:21             ` Mattias Engdegård
2019-04-29  7:53               ` Michael Albinus
2019-04-29 11:06                 ` Mattias Engdegård
2019-04-29 12:18                   ` Michael Albinus
2019-04-29 16:24                     ` Eli Zaretskii
2019-04-29 18:29                     ` Mattias Engdegård
2019-04-29 20:17                       ` Michael Albinus
2019-04-30  3:57                         ` Eli Zaretskii
2019-04-30 11:41                           ` Mattias Engdegård
2019-04-30 12:59                             ` Michael Albinus
2019-04-30 13:56                               ` Mattias Engdegård
2019-04-30 14:19                                 ` Michael Albinus
2019-04-29 16:23                   ` Eli Zaretskii
2019-04-29 19:21                     ` Mattias Engdegård
2019-04-29 19:56                       ` Michael Albinus
2019-04-30 21:09                     ` Mattias Engdegård
2019-05-01 17:45                       ` Eli Zaretskii
2019-05-01 19:41                         ` Mattias Engdegård
2019-05-02 12:18                           ` Michael Albinus
2019-05-02 12:53                             ` Mattias Engdegård
2019-05-02 13:02                               ` Michael Albinus
2019-05-03 12:00                                 ` Mattias Engdegård
2019-05-03 13:44                               ` Eli Zaretskii
2019-05-03 14:47                                 ` Mattias Engdegård
2019-05-04  9:04                                   ` Eli Zaretskii
2019-05-04 11:21                                     ` Mattias Engdegård [this message]
2019-05-04 13:41                                       ` Eli Zaretskii
2019-05-04 16:53                                       ` Michael Albinus
2019-05-04 17:08                                         ` Eli Zaretskii
2019-05-04 18:50                                         ` Mattias Engdegård
2019-05-04 19:43                                           ` Michael Albinus
2019-05-04 20:31                                             ` Michael Albinus
2019-05-04 20:46                                               ` Mattias Engdegård
2019-05-05  8:22                                                 ` Michael Albinus
2019-05-05  9:58                                                   ` Mattias Engdegård
2019-05-08  8:34                                                     ` Mattias Engdegård
2019-05-08  8:47                                                       ` Eli Zaretskii
2019-05-08 10:18                                                         ` Mattias Engdegård
2019-05-08 10:58                                                           ` Eli Zaretskii
2019-05-08 11:48                                                             ` Mattias Engdegård
2019-05-08 12:35                                                               ` Eli Zaretskii
2019-05-08 12:58                                                                 ` Mattias Engdegård
2019-05-08 13:09                                                                   ` Michael Albinus
2019-05-08 13:28                                                                   ` Eli Zaretskii
2019-05-08 14:13                                                                     ` Mattias Engdegård
2019-05-08 17:24                                                                       ` Eli Zaretskii
2019-05-08 18:17                                                                         ` Michael Albinus
2019-05-09 11:50                                                               ` Michael Albinus
2019-05-10 15:22                                                                 ` Mattias Engdegård
2019-05-12  8:48                                                                   ` Michael Albinus
2019-05-12 19:49                                                                     ` Mattias Engdegård
2019-05-13 13:35                                                                       ` Michael Albinus
2019-05-14 12:41                                                                         ` Mattias Engdegård
2019-05-14 14:52                                                                           ` Michael Albinus
2019-05-08 10:23                                                       ` Mattias Engdegård
2019-05-09 10:00                                                     ` Mattias Engdegård
2019-05-09 10:48                                                       ` Eli Zaretskii
2019-05-09 11:15                                                         ` Mattias Engdegård
2019-05-10  9:49                                                       ` Michael Albinus
2019-05-10 12:27                                                         ` Mattias Engdegård
2019-05-10 12:43                                                           ` Michael Albinus
2019-05-13 11:34                                                             ` Mattias Engdegård
2019-05-13 15:08                                                               ` Michael Albinus
2019-05-18 17:39                                                                 ` Mattias Engdegård
2019-05-19  9:12                                                                   ` Michael Albinus
2019-05-19 20:25                                                                     ` Mattias Engdegård
2019-05-20  7:30                                                                       ` Michael Albinus
2019-05-20 19:19                                                                         ` Mattias Engdegård
2019-04-29  7:19           ` Michael Albinus
2019-04-29 11:54             ` Mattias Engdegård
2019-04-29 12:26               ` Michael Albinus
2019-04-29 18:58                 ` Mattias Engdegård
2019-04-29 20:04                   ` Michael Albinus
2019-04-30 15:14                   ` Eli Zaretskii
2019-04-24 19:59 ` Michael Albinus
2019-04-25  9:58   ` Mattias Engdegård
2019-04-25 11:04     ` Michael Albinus
2019-04-25 15:22       ` Mattias Engdegård
2019-04-30  1:03 ` Zhang Haijun
2019-04-30  7:06   ` Michael Albinus
2019-05-01  2:17     ` Zhang Haijun
2019-05-01  2:59       ` Zhang Haijun
2019-05-01  3:10         ` Zhang Haijun
2019-05-02 12:30           ` Michael Albinus
2019-05-02 13:24             ` Zhang Haijun
2019-05-02 12:28         ` Michael Albinus
2019-05-02 12:24       ` Michael Albinus

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=26e8159ac86da37d9cf555f6cb3f2dcb63ac0a67.camel@acm.org \
    --to=mattiase@acm.org \
    --cc=35418@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=michael.albinus@gmx.de \
    /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).