GNU bug report logs - #19909
[PATCH] Error out if with-file-notification=w32 is specified on cygwin

Previous Next

Package: emacs;

Reported by: bug-gnu-emacs <at> gnu.org

Date: Fri, 20 Feb 2015 09:49:02 UTC

Severity: minor

Tags: patch

Done: Ken Brown <kbrown <at> cornell.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ken Brown <kbrown <at> cornell.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 19909 <at> debbugs.gnu.org, rpluim <at> gmail.com
Subject: bug#19909: [PATCH] Error out if	with-file-notification=w32	is specified on cygwin
Date: Sat, 28 Feb 2015 11:32:29 -0500
On 2/28/2015 2:59 AM, Eli Zaretskii wrote:
>> Date: Fri, 27 Feb 2015 17:25:54 -0500
>> From: Ken Brown <kbrown <at> cornell.edu>
>> CC: bug-gnu-emacs <at> gnu.org, rpluim <at> gmail.com
>>
>> It looks like it might not take much effort.  What I did for now, just
>> for testing purposes, is to copy into w32notify.c whatever was necessary
>> to make the Cygwin-w32 build compile with w32 file notification.  I
>> tested it briefly and it seems to work.  Obviously it needs much more
>> testing to make sure this doesn't break anything else, and then we can
>> worry about how to do this right.
>
> Thanks.  A few comments:
>
>    . Cygwin doesn't need to call MultiByteToWideChar and
>      WideCharToMultiByte via function pointers, it can call them
>      directly.
>
>    . I think there shouldn't be a need to call filename_to_utf16 and
>      its ilk, but instead use the to_unicode etc., like the rest of
>      Cygwin-w32 code does.  E.g., just use GUI_ENCODE_FILE defined on
>      w32term.h.

It turns out that filename_to_utf16 wasn't even being called in the 
Cygwin-w32 build, because w32_unicode_filenames == 0.

It also turns out that when I "tested" the build, which I did via M-x 
auto-revert-tail-mode, I wasn't actually testing w32notify, because I 
forgot to do this:

diff --git a/src/emacs.c b/src/emacs.c
index ca5633d..342d0fe 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1334,11 +1334,12 @@ Using an Emacs configured with 
--with-x-toolkit=lucid does not have this problem
   globals_of_gfilenotify ();
 #endif

-#ifdef WINDOWSNT
-  globals_of_w32 ();
 #ifdef HAVE_W32NOTIFY
   globals_of_w32notify ();
 #endif
+
+#ifdef WINDOWSNT
+  globals_of_w32 ();
   /* Initialize environment from registry settings.  */
   init_environment (argv);
   init_ntproc (dumping); /* must precede init_editfns.  */
@@ -1512,11 +1513,12 @@ Using an Emacs configured with 
--with-x-toolkit=lucid does not have this problem
       syms_of_dbusbind ();
 #endif /* HAVE_DBUS */

-#ifdef WINDOWSNT
-      syms_of_ntterm ();
 #ifdef HAVE_W32NOTIFY
       syms_of_w32notify ();
-#endif /* HAVE_W32NOTIFY */
+#endif
+
+#ifdef WINDOWSNT
+      syms_of_ntterm ();
 #endif /* WINDOWSNT */

       syms_of_profiler ();


When I add that patch, auto-revert-tail-mode no longer works; there's no 
error message, but the buffer doesn't get auto-reverted when something 
is appended.

I think I have again lost motivation to pursue this further, since gfile 
works fine.  And glib is required for the default Cygwin-w32 build 
anyway, because ImageMagick brings it in, so why not just use it?

Ken




This bug report was last modified 10 years and 79 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.