unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: zhanghj <ccsmile2008@outlook.com>
Cc: Eli Zaretskii <eliz@gnu.org>, 65904@debbugs.gnu.org
Subject: bug#65904: 29.1.50; autorevert can't revert files in a symlink directory
Date: Thu, 14 Sep 2023 13:58:05 +0200	[thread overview]
Message-ID: <87h6nxklv6.fsf@gmx.de> (raw)
In-Reply-To: <OS3P286MB2199C24994074D8CA24C7F53A8F0A@OS3P286MB2199.JPNP286.PROD.OUTLOOK.COM> (zhanghj's message of "Wed, 13 Sep 2023 22:16:23 +0800")

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

zhanghj <ccsmile2008@outlook.com> writes:

Hi,

> How does it work in Emacs 26/27? Why don't you let it keep the old behavior?

That time, it was unspecified, whether symlinked files/directories are
watched. Some file notification backends did, other backends didn't. In
Emacs 29, this was clarified, see (info "(elisp) File Notifications")

--8<---------------cut here---------------start------------->8---
     If FILE is a symlink, it doesn’t follow that link.  Just FILE
     itself will be watched.
--8<---------------cut here---------------end--------------->8---

There is the idea to add a new flag to the `file-notify-add-watch'
function, `follow'. This would allow to follow symlinks, with different
implementations in the different backends. Buth this hasn't been
implemented yet.

If you need this feature urgently in inotify (I guess you're using this
backend), try the appended patch in filenotify.el (untested).

Best regards, Michael.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 534 bytes --]

diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index e9f8d4e515d..6025f35cb6e 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -339,7 +339,6 @@ file-notify--add-watch-inotify
   "Add a watch for FILE in DIR with FLAGS, using inotify."
   (inotify-add-watch dir
                      (append
-                      '(dont-follow)
                       (and (memq 'change flags)
                            '(create delete delete-self modify move-self move))
                       (and (memq 'attribute-change flags)

  reply	other threads:[~2023-09-14 11:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-13  3:55 bug#65904: 29.1.50; autorevert can't revert files in a symlink directory Zhang Haijun
2023-09-13 12:55 ` Eli Zaretskii
2023-09-13 13:12   ` zhanghj
2023-09-13 13:28     ` Eli Zaretskii
2023-09-13 13:33   ` Michael Albinus
2023-09-13 14:16     ` zhanghj
2023-09-14 11:58       ` Michael Albinus [this message]
2023-09-18 21:08         ` zhanghj
2023-09-19  7:18           ` 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=87h6nxklv6.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=65904@debbugs.gnu.org \
    --cc=ccsmile2008@outlook.com \
    --cc=eliz@gnu.org \
    /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).