[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bad file dialog on W32 popped up by a click on C source
From: |
Jason Rumney |
Subject: |
Re: Bad file dialog on W32 popped up by a click on C source |
Date: |
Sun, 12 Jun 2005 19:36:39 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) |
Eli Zaretskii <address@hidden> 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;