Subject: Re: bug#20280: 25.0.50; Auto revert mode appears to be non-functional

From: "Christopher Carpenter" <[email-masked]>
Date: Thu, 9 Apr 2015 22:22:56 -0500

Hello again Michael,

It doesn't look like libkqueue is linked to my emacs executable to me.

&#10140;  bin git:(master) otool -L emacs-25.0.50
emacs-25.0.50:
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
(compatibility version 45.0.0, current version 1344.72.0)
	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
(compatibility version 1.0.0, current version 275.0.0)
	/usr/local/lib/librsvg-2.2.dylib (compatibility version 39.0.0, current
version 39.3.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
1213.0.0)
	/usr/local/lib/libgio-2.0.0.dylib (compatibility version 4401.0.0,
current version 4401.0.0)
	/usr/local/lib/libgdk_pixbuf-2.0.0.dylib (compatibility version 3001.0.0,
current version 3001.8.0)
	/usr/local/lib/libgobject-2.0.0.dylib (compatibility version 4401.0.0,
current version 4401.0.0)
	/usr/local/lib/libglib-2.0.0.dylib (compatibility version 4401.0.0,
current version 4401.0.0)
	/usr/local/opt/gettext/lib/libintl.8.dylib (compatibility version 10.0.0,
current version 10.3.0)
	/usr/local/lib/libcairo.2.dylib (compatibility version 11403.0.0, current
version 11403.2.0)
	/usr/local/lib/libMagickWand-6.Q16.2.dylib (compatibility version 3.0.0,
current version 3.0.0)
	/usr/local/lib/libMagickCore-6.Q16.2.dylib (compatibility version 3.0.0,
current version 3.0.0)
	/usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current version
10.9.0)
	/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current
version 5.4.0)
	/usr/local/lib/libgnutls.28.dylib (compatibility version 70.0.0, current
version 70.6.0)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
(compatibility version 150.0.0, current version 1152.0.0)
	/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
(compatibility version 64.0.0, current version 600.0.0)
	/System/Library/Frameworks/CoreText.framework/Versions/A/CoreText
(compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
(compatibility version 300.0.0, current version 1152.14.0)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version
228.0.0)

I ran the code you gave there, and did multiple writes to the file. The
following is the only text that appeared in *trace-output* and I believe
it appeared when I activated auto-revert, not when I wrote to the file.

======================================================================
1 -> (file-notify-add-watch "/Users/ccarpenter/test.txt" (change
attribute-chan\
ge) auto-revert-notify-handler)
| 2 -> (file-notify--descriptor 1080241180 "test.txt")
| 2 <- file-notify--descriptor: 1080241180
1 <- file-notify-add-watch: 1080241180

>From my amateur view it looks like we are not getting any notifications.

Does that help any?

Christopher Carpenter

> "Christopher Carpenter" <[email-masked]> writes:
>
> Hi Christopher,
>
>> Unless this is actually a gfilenotify <-> emacs problem(rather than a
>> gfilenotify on mac problem) I'd consider this solved/not a bug. Sorry
>> for
>> wasting time!
>
> Like Eli, I cannot test on a Mac. If you don't mind, I would like to
> misuse you for further investigations.
>
> Even if it is a glib-on-the-mac problem, I would prefer that file
> notifications are not enabled then when building Emacs. This must be
> determined robustly.
>
> glib on OSX (BSD, in fact) uses either kqueue, or it polls for file
> notifications. Maybe you could check, whether libkqueue is linked to
> Emacs.
>
> Furthermore, it might be worth to set traces before running the
> tests. Some thing like this:
>
> (require 'filenotify)
> (require 'trace)
> (dolist (elt (all-completions "file-notify-" obarray 'functionp))
>   (trace-function-background (intern elt)))
>
> You might observe the buffer *trace-output*, whether file notifications
> events arrive.
>
>> Thanks,
>> Christopher Carpenter
>
> Best regards, Michael.
>
>