From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.bugs Subject: bug#13065: Bug in x-file-dialog with GetOpenFileName Date: Tue, 08 Jan 2013 21:10:35 +0800 Message-ID: <87pq1fhlbo.fsf@gnu.org> References: <83liddr5u8.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1357650726 679 80.91.229.3 (8 Jan 2013 13:12:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Jan 2013 13:12:06 +0000 (UTC) Cc: 13065@debbugs.gnu.org, Du Yanning To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 08 14:12:23 2013 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 1TsYyZ-0007Sc-W3 for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Jan 2013 14:12:20 +0100 Original-Received: from localhost ([::1]:48156 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsYyK-0003Xt-BJ for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Jan 2013 08:12:04 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:44958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsYyF-0003Xl-UI for bug-gnu-emacs@gnu.org; Tue, 08 Jan 2013 08:12:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsYyE-0001kP-78 for bug-gnu-emacs@gnu.org; Tue, 08 Jan 2013 08:11:59 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43108) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsYyE-0001kL-3h for bug-gnu-emacs@gnu.org; Tue, 08 Jan 2013 08:11:58 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TsYyH-00016H-Uc for bug-gnu-emacs@gnu.org; Tue, 08 Jan 2013 08:12:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jason Rumney Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Jan 2013 13:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13065 X-GNU-PR-Package: emacs,w32 X-GNU-PR-Keywords: Original-Received: via spool by 13065-submit@debbugs.gnu.org id=B13065.13576506704168 (code B ref 13065); Tue, 08 Jan 2013 13:12:01 +0000 Original-Received: (at 13065) by debbugs.gnu.org; 8 Jan 2013 13:11:10 +0000 Original-Received: from localhost ([127.0.0.1]:56348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TsYxO-000156-Qt for submit@debbugs.gnu.org; Tue, 08 Jan 2013 08:11:10 -0500 Original-Received: from mail-da0-f53.google.com ([209.85.210.53]:41330) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TsYxJ-00014T-D8 for 13065@debbugs.gnu.org; Tue, 08 Jan 2013 08:11:05 -0500 Original-Received: by mail-da0-f53.google.com with SMTP id x6so189099dac.40 for <13065@debbugs.gnu.org>; Tue, 08 Jan 2013 05:10:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=S3gIUYCwGpdFXJLYKz7+GE4VE2azh5EParxfNN4nyRo=; b=loYwFB+3w/z4Y0W7TuQCb7AFiSrT6J8XECAHfZAFzZEu7ne7IASNH7QapnP7d16UqR KzJSE6Icwg8EeX2h0GTSLCRmgjMp66ASwuzlBTwuLJeBvr4VM1RQ0ZBhHyb7fKIk4IAe NZ+K0e9mIFB0WmBk9Qo9Fucfz5qkKGWYesXZG4rZyWB1kSyVsULPhry8GNfFu/vHIidP GYQRYZezs1rcPMqQr5QC2aFhiWn6HJdd9C2KtNrzDS+kgdpf5uw0nvKIeqAuL87yGx1n 9CN/JiO8AhLiKc/u7UkakYu8zlZoCIhJIXnvGO6C+aEhvSIG49V6u5KFIZaQOYQaGJmG 0c5g== X-Received: by 10.68.223.131 with SMTP id qu3mr198072203pbc.89.1357650651438; Tue, 08 Jan 2013 05:10:51 -0800 (PST) Original-Received: from home.jasonrumney.net ([180.75.201.177]) by mx.google.com with ESMTPS id vk5sm39622761pbc.34.2013.01.08.05.10.43 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Jan 2013 05:10:50 -0800 (PST) Original-Received: by home.jasonrumney.net (Postfix, from userid 1000) id 666FA10AA; Tue, 8 Jan 2013 21:10:35 +0800 (MYT) In-Reply-To: <83liddr5u8.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 04 Dec 2012 21:10:39 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.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:69491 Archived-At: Sorry for the late reply. Eli Zaretskii writes: > a) Windows 7 deprecated this kind of dialogs and instead wants us to > use some hotshot new ones. So it could be simply a bug in the > implementation of this dialog on Windows 7. Is it not just a case of doing the same as we did previously? /* If we compile with _WIN32_WINNT set to 0x0400 (for NT4 compatibility) we end up with the old file dialogs. Define a big enough struct for the new dialog to trick GetOpenFileName into giving us the new dialogs on newer versions of Windows. */ > b) We use a file selection dialog in non-standard ways, to be able to > open directories, not just files. The way we do this employs some > undocumented tricks which I don't fully understand. E.g., when > the hook gets the CDN_INITDONE notification, we access the File > Name field of the dialog, but don't do anything with it, and just > call EnableWindow. Is that really necessary, and if so, why? The purpose is to disable the File Name field when "Directories" is selected so the user does not try to type a filename (which will subsequently be ignored). "Current Directory" is put into the field when it is disabled to indicate to the user that the current directory will be chosen if they press OK. > > c) The filter string uses some "*|*" magic in the directory filter, > which doesn't seem to be documented anywhere. What does it do? Nothing. It has to be different than the *.* that is used for normal file selection, but couldn't be simply * IIRC. The magic is in the callback function and the code that strips away the filename when the dialog call has finished if the "Directories" option is selected. But in this report, the Directory filter was never chosen, so I don't think it is related. You could try removing the Directories portion of the filter string and the callback to be sure.