From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.devel Subject: Re: Bad file dialog on W32 popped up by a click on C source Date: Sun, 12 Jun 2005 19:36:39 +0100 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1118602037 3395 80.91.229.2 (12 Jun 2005 18:47:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 12 Jun 2005 18:47:17 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 12 20:47:15 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DhXU1-00027z-HP for ged-emacs-devel@m.gmane.org; Sun, 12 Jun 2005 20:46:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DhXYf-00020A-1T for ged-emacs-devel@m.gmane.org; Sun, 12 Jun 2005 14:51:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DhXXP-0001SS-Gn for emacs-devel@gnu.org; Sun, 12 Jun 2005 14:50:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DhXXI-0001P9-HK for emacs-devel@gnu.org; Sun, 12 Jun 2005 14:50:22 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DhXXI-0001JF-4Q for emacs-devel@gnu.org; Sun, 12 Jun 2005 14:50:20 -0400 Original-Received: from [194.106.33.237] (helo=outmail.freedom2surf.net) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1DhXLW-0005Ke-Qu; Sun, 12 Jun 2005 14:38:11 -0400 Original-Received: from wanchan.jasonrumney.net (i-83-67-23-108.freedom2surf.net [83.67.23.108]) by outmail.freedom2surf.net (8.12.10/8.12.10) with ESMTP id j5CIbEch011145; Sun, 12 Jun 2005 19:37:15 +0100 Original-Received: from TONKOTSU-RAMEN (tonkotsu-ramen.jasonrumney.net [10.0.0.28]) by wanchan.jasonrumney.net (Postfix) with ESMTP id 85D8BDDDF8; Sun, 12 Jun 2005 19:37:40 +0100 (BST) Original-To: Eli Zaretskii In-Reply-To: (Eli Zaretskii's message of "Sun, 12 Jun 2005 21:09:41 +0300") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:38660 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38660 Eli Zaretskii writes: > Strange...doesn't it pop the file selector for you? I only deleted one file, not the whole source tree. Maybe that makes a difference. But the following seems to reproduce the same behaviour: (x-file-dialog "test" "c:/emacs" nil t t) >> If the latter then it is caused by the file-must-exist flag being set, >> which does not work for directories. > > You mean the MUSTMATCH arg to x-file-dialog? That is, should I change > the code so that this flag is ignored for directories? The following change seems to fix it for me, as long as the code that is calling x-file-dialog sets only-dir-p. If the user switches to "Directories" in a dialog that has mustmatch set but not only-dir-p, it still fails but maybe that is OK, since such code is probably expecting a file. Changing the flags does not seem to work once the dialog is active. *** w32fns.c 10 Jun 2005 23:42:01 +0100 1.248 --- w32fns.c 12 Jun 2005 19:19:46 +0100 *************** *** 7833,7839 **** file_details.Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR | OFN_EXPLORER | OFN_ENABLEHOOK); if (!NILP (mustmatch)) ! file_details.Flags |= OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST; file_details.lpfnHook = (LPOFNHOOKPROC) file_dialog_callback; --- 7833,7844 ---- file_details.Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR | OFN_EXPLORER | OFN_ENABLEHOOK); if (!NILP (mustmatch)) ! { ! file_details.Flags |= OFN_PATHMUSTEXIST; ! /* Do not include FILEMUSTEXIST flag if we are expecting a dir. */ ! if (NILP (only_dir_p)) ! file_details.Flags |= OFN_FILEMUSTEXIST; ! } file_details.lpfnHook = (LPOFNHOOKPROC) file_dialog_callback;