unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jason Rumney <jasonr@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Bad file dialog on W32 popped up by a click on C source
Date: Sun, 12 Jun 2005 19:36:39 +0100	[thread overview]
Message-ID: <u7jgz1ky0.fsf@jasonrumney.net> (raw)
In-Reply-To: <u4qc378gq.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 12 Jun 2005 21:09:41 +0300")

Eli Zaretskii <eliz@gnu.org> 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;

  reply	other threads:[~2005-06-12 18:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-12 13:33 Bad file dialog on W32 popped up by a click on C source Eli Zaretskii
2005-06-12 14:03 ` Lennart Borgman
2005-06-12 15:11   ` Eli Zaretskii
2005-06-12 16:32   ` Jason Rumney
2005-06-12 17:36 ` Jason Rumney
2005-06-12 18:09   ` Eli Zaretskii
2005-06-12 18:36     ` Jason Rumney [this message]
2005-06-12 20:54       ` Jason Rumney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=u7jgz1ky0.fsf@jasonrumney.net \
    --to=jasonr@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).