From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ben Key Newsgroups: gmane.emacs.bugs Subject: bug#8191: Patch to fix bug#8181: 23.2; Dired on Windows 7 Date: Sun, 6 Mar 2011 22:15:51 -0600 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=bcaec52d4b057936cd049ddcc198 X-Trace: dough.gmane.org 1299481634 12857 80.91.229.12 (7 Mar 2011 07:07:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 7 Mar 2011 07:07:14 +0000 (UTC) To: 8191@debbugs.gnu.org, lekktu@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 07 08:07:05 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PwUX2-0003Dx-8a for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Mar 2011 08:07:05 +0100 Original-Received: from localhost ([127.0.0.1]:50340 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwUX0-0000fG-KP for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Mar 2011 02:07:02 -0500 Original-Received: from [140.186.70.92] (port=56856 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwUWs-0000cX-ME for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 02:06:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwUWq-0004zW-D3 for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 02:06:54 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59454) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwUWq-0004zS-BL for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 02:06:52 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PwUKP-0001a3-Pb; Mon, 07 Mar 2011 01:54:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ben Key Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Mar 2011 06:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8191 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org, Juanma Barranquero Original-Received: via spool by submit@debbugs.gnu.org id=B.12994808186037 (code B ref -1); Mon, 07 Mar 2011 06:54:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Mar 2011 06:53:38 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwUK1-0001ZJ-G0 for submit@debbugs.gnu.org; Mon, 07 Mar 2011 01:53:38 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PwRrp-0006bL-W8 for submit@debbugs.gnu.org; Sun, 06 Mar 2011 23:16:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwRrk-0002cn-1N for submit@debbugs.gnu.org; Sun, 06 Mar 2011 23:16:17 -0500 Original-Received: from lists.gnu.org ([199.232.76.165]:46835) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwRrj-0002cd-Sw for submit@debbugs.gnu.org; Sun, 06 Mar 2011 23:16:15 -0500 Original-Received: from [140.186.70.92] (port=45272 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwRri-0000S6-D0 for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2011 23:16:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwRrh-0002cL-7n for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2011 23:16:14 -0500 Original-Received: from mail-bw0-f41.google.com ([209.85.214.41]:33301) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwRrg-0002cA-RQ for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2011 23:16:13 -0500 Original-Received: by bwz17 with SMTP id 17so4035234bwz.0 for ; Sun, 06 Mar 2011 20:16:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=v3P/pDMyeCrQ0bnX5xnPiIu9wPTqcglrm4nA3+3soHU=; b=Fr9RGqNWSM2zAjGf/na8bWcgKsg7KeQ3uonO60i66b5KOfKYojD1cuJBgOl5C8ZyLt tYoJgTdTVGMpIVB0lLu7VDWWs3noyccEh44W/GrJr45WWC4LREZhpe705yj65QC1elwx JjEaHzF7he58XGNTwauhQsREzFvx/dpy0FF6Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=nBoKVgiVggN4VslJ6KGJSKRFXDJjlKNQ9m/zHEX08sJdPrSw+ls4D7IdFnhJm4qCn/ bqiUXnKlOMnglPc1mngrVCzLkZ8GFdIm6jnbWcUMM3+BgXWv14pXCV5rja6HRiXvobab FcUNHNqIUCRg3JBEJwRhoy6/6qnLTfQ5XPQHs= Original-Received: by 10.204.175.194 with SMTP id bb2mr3039866bkb.121.1299471371154; Sun, 06 Mar 2011 20:16:11 -0800 (PST) Original-Received: by 10.204.14.147 with HTTP; Sun, 6 Mar 2011 20:15:51 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Mon, 07 Mar 2011 01:53:35 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 07 Mar 2011 01:54:01 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:44732 Archived-At: --bcaec52d4b057936cd049ddcc198 Content-Type: multipart/alternative; boundary=bcaec52d4b057936c6049ddcc196 --bcaec52d4b057936c6049ddcc196 Content-Type: text/plain; charset=ISO-8859-1 Hello, The attached patch fixes bug #8181: 23.2; Dired on Windows 7. The patch is for the Emacs trunk. I can provide a patch for the Emacs 23 branch if it is decided that this bug is important enough to go into Emacs 23. This patch has been tested on Windows 7 32-bit, Windows 7 64-bit, and Windows XP 32-bit. This patch fixes three problems. 1. The code that was attempting to set the text of the file name text field when processing the CDN_INITDONE WM_NOTIFY message does not work. This is because the code that processes the lpstrFile member of the OPENFILENAME structure to set the initial value of the window is called after the CDN_INITDONE WM_NOTIFY message is processed. The correct way to set the text of the file name text field to "Current Directory" is to set the initial value of the lpstrFile member of the OPENFILENAME structure to "Current Directory" in the only_dir_p case if it does not already have another value. 2. The attempt to find the window handle of the file name text field failed, at least on Windows XP and Windows 7. By using Microsoft Spy++ I was able to discover the correct way to obtain this Window handle. I modified the code in file_dialog_callback that initializes the edit_control using this information. 3. Disabling the file name text field during dialog box initialization has undesirable side effects because this is the window that has focus when the open file dialog box is first opened by default. The end result of disabling a window that would otherwise have focus is that focus lands in no man's land and the user is not able to navigate through the dialog box using the tab key. Instead the system plays the system default error sound every time the tab key was pressed. Now that the window is actually being disabled as a result of change 2, it is necessary to take steps to prevent this from happening. My solution was to set focus to the list box if the file name text field is disabled during dialog box initialization. This part could use a little more work. If it matters, I have already signed the appropriate copyright assignment papers for Emacs. --bcaec52d4b057936c6049ddcc196 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello,

The attached patch fixes bug #8181: 23.2; Di= red on Windows 7.=A0 The patch is for the Emacs trunk.=A0 I can provide a p= atch for the Emacs 23 branch if it is decided that this bug is important en= ough to go into Emacs 23.

This patch has been tested on Windows 7 32-bit, Windows 7 64-bit, and W= indows XP 32-bit.

This patch fixes three problems.
    The code that was attempting to set the text of the file = name text field when processing the CDN_INITDONE WM_NOTIFY message does not= work.=A0 This is because the code that processes the lpstrFile member of t= he OPENFILENAME structure to set the initial value of the window is called = after the CDN_INITDONE WM_NOTIFY message is process= ed.=A0 The correct way to set the text of the file = name text field to "Current Directory" is to set the initial valu= e of the lpstrFile member of the OPENFILENAME struc= ture to "Current Directory" in the only_d= ir_p case if it does not already have another value.
  1. The attempt to find the window handle of the file name text field failed, at least on Windows XP and Wind= ows 7.=A0 By using Microsoft Spy++ I was able to discover the correct way t= o obtain this Window handle.=A0 I modified the code in file_dialog_callback= that initializes the edit_control using this information.
  2. Disabling the file name text f= ield during dialog box initialization has undesirable side effects because = this is the window that has focus when the open file dialog box is first op= ened by default.=A0 The end result of disabling a window that would otherwi= se have focus is that focus lands in no man's land and the user is not = able to navigate through the dialog box using the tab key.=A0 Instead the s= ystem plays the system default error sound every time the tab key was press= ed.=A0 Now that the window is actually being disabled as a result of change= 2, it is necessary to take steps to prevent this from happening.=A0 My sol= ution was to set focus to the list box if the file = name text field is disabled during dialog box initialization.=A0 This part = could use a little more work.

If it matters, I have already signed the app= ropriate copyright assignment papers for Emacs.


--bcaec52d4b057936c6049ddcc196-- --bcaec52d4b057936cd049ddcc198 Content-Type: application/octet-stream; name="emacs-bug-8181.patch" Content-Disposition: attachment; filename="emacs-bug-8181.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gkyvbshd0 PT09IG1vZGlmaWVkIGZpbGUgJ3NyYy93MzJmbnMuYycKLS0tIHNyYy93MzJmbnMuYwkyMDExLTAy LTE2IDE4OjM5OjQ2ICswMDAwCisrKyBzcmMvdzMyZm5zLmMJMjAxMS0wMy0wNyAwMzo1Nzo0NiAr MDAwMApAQCAtNjAsNiArNjAsOCBAQAogI2luY2x1ZGUgPGRsZ3MuaD4KICNpbmNsdWRlIDxpbW0u aD4KICNkZWZpbmUgRklMRV9OQU1FX1RFWFRfRklFTEQgZWR0MQorI2RlZmluZSBGSUxFX05BTUVf Q09NQk9fQk9YIGNtYjEzCisjZGVmaW5lIEZJTEVfTkFNRV9MSVNUIGxzdDEKIAogI2luY2x1ZGUg ImZvbnQuaCIKICNpbmNsdWRlICJ3MzJmb250LmgiCkBAIC01ODY4LDYgKzU4NzAsMjYgQEAKIAl7 CiAJICBIV05EIGRpYWxvZyA9IEdldFBhcmVudCAoaHduZCk7CiAJICBIV05EIGVkaXRfY29udHJv bCA9IEdldERsZ0l0ZW0gKGRpYWxvZywgRklMRV9OQU1FX1RFWFRfRklFTEQpOworCSAgSFdORCBs aXN0ID0gR2V0RGxnSXRlbShkaWFsb2csIEZJTEVfTkFNRV9MSVNUKTsKKwkgIGlmIChOVUxMID09 IGVkaXRfY29udHJvbCkKKwkgICAgeworCSAgICAgIC8qCisJICAgICAgQXQgbGVhc3Qgb24gV2lu ZG93cyA3LCB0aGUgYWJvdmUgYXR0ZW1wdCB0byBnZXQgdGhlCisJICAgICAgd2luZG93IGhhbmRs ZSB0byB0aGUgRmlsZSBOYW1lIFRleHQgRmllbGQgZmFpbHMuICBUaGUKKwkgICAgICBmb2xsb3dp bmcgY29kZSBkb2VzIHRoZSBqb2IgdGhvdWdoLiAgTm90ZSB0aGF0IHRoaXMKKwkgICAgICBjb2Rl IGlzIGJhc2VkIG9uIG15IGV4YW1pbmF0aW9uIG9mIHRoZSB3aW5kb3cgaGllYXJjaHkKKwkgICAg ICB1c2luZyBNaWNyb3NvZnQgU3B5KysuCisJICAgICAgKi8KKwkgICAgICBIV05EIHRtcCA9IEdl dERsZ0l0ZW0oZGlhbG9nLCBGSUxFX05BTUVfQ09NQk9fQk9YKTsKKwkgICAgICBpZiAoTlVMTCAh PSB0bXApCisJICAgICAgICB7CisJICAgICAgICAgIHRtcCA9IEdldFdpbmRvdyh0bXAsIEdXX0NI SUxEKTsKKwkgICAgICAgICAgaWYgKE5VTEwgIT0gdG1wKQorCSAgICAgICAgICAgIHsKKwkgICAg ICAgICAgICAgIGVkaXRfY29udHJvbCA9IEdldFdpbmRvdyh0bXAsIEdXX0NISUxEKTsKKwkgICAg ICAgICAgICB9CisJICAgICAgICB9CisJICAgIH0KIAogCSAgLyogRGlyZWN0b3JpZXMgaXMgaW4g aW5kZXggMi4gICovCiAJICBpZiAobm90aWZ5LT5scE9GTi0+bkZpbHRlckluZGV4ID09IDIpCkBA IC01ODc1LDYgKzU4OTcsMjAgQEAKIAkgICAgICBDb21tRGxnX09wZW5TYXZlX1NldENvbnRyb2xU ZXh0IChkaWFsb2csIEZJTEVfTkFNRV9URVhUX0ZJRUxELAogCQkJCQkgICAgICAgIkN1cnJlbnQg RGlyZWN0b3J5Iik7CiAJICAgICAgRW5hYmxlV2luZG93IChlZGl0X2NvbnRyb2wsIEZBTFNFKTsK KwkgICAgICBpZiAoQ0ROX0lOSVRET05FID09IG5vdGlmeS0+aGRyLmNvZGUpCisJICAgICAgICB7 CisJICAgICAgICAgIC8qCisJICAgICAgICAgIE5vdCB0aGF0IGF0IGxlYXN0IG9uIFdpbmRvd3Mg NywgdGhlIGFib3ZlIGNhbGwgdG8KKwkgICAgICAgICAgRW5hYmxlV2luZG93IGRpc2FibGVzIHRo ZSB3aW5kb3cgdGhhdCB3b3VsZAorCSAgICAgICAgICBvcmRpbmFyaWx5IGhhdmUgZm9jdXMuICBJ ZiB3ZSBkbyBub3Qgc2V0IGZvY3VzIHRvCisJICAgICAgICAgIHNvbWUgb3RoZXIgd2luZG93IGhl cmUsIGZvY3VzIHdpbGwgbGFuZCBpbiBubyBtYW4ncworCSAgICAgICAgICBsYW5kIGFuZCB0aGUg dXNlciB3aWxsIGJlIHVuYWJsZSB0byB0YWIgdGhyb3VnaCB0aGUKKwkgICAgICAgICAgZGlhbG9n IGJveCAocHJlc3NpbmcgdGFiIHdpbGwgb25seSByZXN1bHQgaW4gYQorCSAgICAgICAgICBiZWVw KS4gIEF2b2lkIHRoYXQgcHJvYmxlbSBieSBzZXR0aW5nIGZvY3VzIHRvIHRoZQorCSAgICAgICAg ICBsaXN0IGhlcmUuCisJICAgICAgICAgICovCisJICAgICAgICAgIFNldEZvY3VzKGxpc3QpOwor CSAgICAgICAgfQogCSAgICB9CiAJICBlbHNlCiAJICAgIHsKQEAgLTU5NDYsMTAgKzU5ODIsMzIg QEAKIAlmaWxlX25hbWVfb25seSsrOwogCiAgICAgICBzdHJuY3B5IChmaWxlbmFtZSwgZmlsZV9u YW1lX29ubHksIE1BWF9QQVRIKTsKKyAgICAgIGlmICgwID09IGZpbGVuYW1lWzBdICYmICEgTklM UChvbmx5X2Rpcl9wKSkKKyAgICAgICAgeworICAgICAgICAgIC8qCisgICAgICAgICAgVGhlIGNv ZGUgaW4gZmlsZV9kaWFsb2dfY2FsbGJhY2sgdGhhdCBhdHRlbXB0cyB0byBzZXQgdGhlIHRleHQK KyAgICAgICAgICBvZiB0aGUgZmlsZSBuYW1lIGVkaXQgd2luZG93IHdoZW4gaGFuZGxpbmcgdGhl IENETl9JTklURE9ORQorICAgICAgICAgIFdNX05PVElGWSBtZXNzYWdlIGRvZXMgbm90IHdvcmsu ICBTZXR0aW5nIGZpbGVuYW1lIHRvICJDdXJyZW50CisgICAgICAgICAgRGlyZWN0b3J5IiBpbiB0 aGUgb25seV9kaXJfcCBjYXNlIGhlcmUgZG9lcyB3b3JrIGhvd2V2ZXIuCisgICAgICAgICAgKi8K KyAgICAgICAgICBzdHJjcHkoZmlsZW5hbWUsICJDdXJyZW50IERpcmVjdG9yeSIpOworCSAgICB9 CiAgICAgICBmaWxlbmFtZVtNQVhfUEFUSF0gPSAnXDAnOwogICAgIH0KICAgZWxzZQotICAgIGZp bGVuYW1lWzBdID0gJ1wwJzsKKyAgICB7CisgICAgICBmaWxlbmFtZVswXSA9ICdcMCc7CisgICAg ICBpZiAoISBOSUxQIChvbmx5X2Rpcl9wKSkKKyAgICAgICAgeworICAgICAgICAgIC8qCisgICAg ICAgICAgVGhlIGNvZGUgaW4gZmlsZV9kaWFsb2dfY2FsbGJhY2sgdGhhdCBhdHRlbXB0cyB0byBz ZXQgdGhlIHRleHQKKyAgICAgICAgICBvZiB0aGUgZmlsZSBuYW1lIGVkaXQgd2luZG93IHdoZW4g aGFuZGxpbmcgdGhlIENETl9JTklURE9ORQorICAgICAgICAgIFdNX05PVElGWSBtZXNzYWdlIGRv ZXMgbm90IHdvcmsuICBTZXR0aW5nIGZpbGVuYW1lIHRvICJDdXJyZW50CisgICAgICAgICAgRGly ZWN0b3J5IiBpbiB0aGUgb25seV9kaXJfcCBjYXNlIGhlcmUgZG9lcyB3b3JrIGhvd2V2ZXIuCisg ICAgICAgICAgKi8KKyAgICAgICAgICBzdHJjcHkoZmlsZW5hbWUsICJDdXJyZW50IERpcmVjdG9y eSIpOworICAgICAgICB9CisgICAgfQogCiAgIHsKICAgICBORVdPUEVORklMRU5BTUUgbmV3X2Zp bGVfZGV0YWlsczsKCg== --bcaec52d4b057936cd049ddcc198--