From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.bugs Subject: bug#19909: [PATCH] Error out if with-file-notification=w32 is specified on cygwin Date: Sat, 28 Feb 2015 11:32:29 -0500 Message-ID: <54F1ED9D.9040303@cornell.edu> References: <821tlkhq2v.fsf@gmail.com> <83mw48lwvx.fsf@gnu.org> <82wq3cga1n.fsf@gmail.com> <83ioewlv1v.fsf@gnu.org> <82sie0fz1q.fsf@gmail.com> <838ufslitm.fsf@gnu.org> <54E75D96.70601@cornell.edu> <83twygcxif.fsf@gnu.org> <54F0EEF2.1030908@cornell.edu> <83sidq4gb2.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1425141204 21507 80.91.229.3 (28 Feb 2015 16:33:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Feb 2015 16:33:24 +0000 (UTC) Cc: 19909@debbugs.gnu.org, rpluim@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 28 17:33:12 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YRkKE-0005Mm-1D for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Feb 2015 17:33:10 +0100 Original-Received: from localhost ([::1]:41651 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRkKD-00020m-Ca for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Feb 2015 11:33:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRkK9-0001y6-JK for bug-gnu-emacs@gnu.org; Sat, 28 Feb 2015 11:33:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YRkK6-0005b1-PY for bug-gnu-emacs@gnu.org; Sat, 28 Feb 2015 11:33:05 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57208) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRkK6-0005aw-NL for bug-gnu-emacs@gnu.org; Sat, 28 Feb 2015 11:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YRkK6-00028A-C5 for bug-gnu-emacs@gnu.org; Sat, 28 Feb 2015 11:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ken Brown Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Feb 2015 16:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19909 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org, rpluim@gmail.com Original-Received: via spool by submit@debbugs.gnu.org id=B.14251411578158 (code B ref -1); Sat, 28 Feb 2015 16:33:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Feb 2015 16:32:37 +0000 Original-Received: from localhost ([127.0.0.1]:60806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRkJh-00027U-3f for submit@debbugs.gnu.org; Sat, 28 Feb 2015 11:32:37 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:41396) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRkJe-00027F-47 for submit@debbugs.gnu.org; Sat, 28 Feb 2015 11:32:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YRkJX-0005Mz-Nm for submit@debbugs.gnu.org; Sat, 28 Feb 2015 11:32:28 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:43734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRkJX-0005Mq-LX for submit@debbugs.gnu.org; Sat, 28 Feb 2015 11:32:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRkJW-0001aH-IJ for bug-gnu-emacs@gnu.org; Sat, 28 Feb 2015 11:32:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YRkJT-0005L7-Rx for bug-gnu-emacs@gnu.org; Sat, 28 Feb 2015 11:32:26 -0500 Original-Received: from limerock02.mail.cornell.edu ([128.84.13.242]:41406) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRkJT-0005Kv-OK; Sat, 28 Feb 2015 11:32:23 -0500 X-CornellRouted: This message has been Routed already. Original-Received: from authusersmtp.mail.cornell.edu (granite3.serverfarm.cornell.edu [10.16.197.8]) by limerock02.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id t1SGWHq3024384; Sat, 28 Feb 2015 11:32:18 -0500 Original-Received: from [192.168.1.3] (cpe-67-249-176-138.twcny.res.rr.com [67.249.176.138]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id t1SGWG8d008520 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 28 Feb 2015 11:32:17 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 In-Reply-To: <83sidq4gb2.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:99904 Archived-At: On 2/28/2015 2:59 AM, Eli Zaretskii wrote: >> Date: Fri, 27 Feb 2015 17:25:54 -0500 >> From: Ken Brown >> CC: bug-gnu-emacs@gnu.org, rpluim@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