GNU bug report logs - #12931
a bug in Emacs for Windows (win32fns.c: x-file-dialog)

Previous Next

Package: emacs;

Reported by: Du Yanning <duyanning <at> gmail.com>

Date: Mon, 19 Nov 2012 13:55:02 UTC

Severity: normal

Tags: moreinfo, unreproducible

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 12931 in the body.
You can then email your comments to 12931 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#12931; Package emacs. (Mon, 19 Nov 2012 13:55:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Du Yanning <duyanning <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 19 Nov 2012 13:55:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Du Yanning <duyanning <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: a bug in Emacs for Windows (win32fns.c: x-file-dialog)
Date: Mon, 19 Nov 2012 21:53:02 +0800
[Message part 1 (text/plain, inline)]
x-file-dialog uses GetOpenFileName to get a file name.
If you have a buffer that is not visiting any file, when you call
save-buffer through a tool-bar button, x-file-dialog gets called.
However, with GetOpenFileName, you must select an existing file.

We can fix this bug by minimum change.

in x-file-dialog (defined in win32fns.c)

change the line:

    file_opened = GetOpenFileName (file_details);

to

    if (!NILP (mustmatch))
      {
        file_opened = GetOpenFileName (file_details);
      }
    else
      {
        file_opened = GetSaveFileName (file_details);
      }
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12931; Package emacs. (Mon, 19 Nov 2012 19:10:02 GMT) Full text and rfc822 format available.

Message #8 received at 12931 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Du Yanning <duyanning <at> gmail.com>
Cc: 12931 <at> debbugs.gnu.org
Subject: Re: bug#12931: a bug in Emacs for Windows (win32fns.c: x-file-dialog)
Date: Mon, 19 Nov 2012 21:08:02 +0200
> Date: Mon, 19 Nov 2012 21:53:02 +0800
> From: Du Yanning <duyanning <at> gmail.com>
> 
> x-file-dialog uses GetOpenFileName to get a file name.
> If you have a buffer that is not visiting any file, when you call
> save-buffer through a tool-bar button, x-file-dialog gets called.
> However, with GetOpenFileName, you must select an existing file.
> 
> We can fix this bug by minimum change.
> 
> in x-file-dialog (defined in win32fns.c)
> 
> change the line:
> 
>     file_opened = GetOpenFileName (file_details);
> 
> to
> 
>     if (!NILP (mustmatch))
>       {
>         file_opened = GetOpenFileName (file_details);
>       }
>     else
>       {
>         file_opened = GetSaveFileName (file_details);
>       }

Thanks.  However, looking at the current code, I see this:

    file_details->Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR
                           | OFN_EXPLORER | OFN_ENABLEHOOK);

    if (!NILP (mustmatch))
      {
        /* Require that the path to the parent directory exists.  */
        file_details->Flags |= OFN_PATHMUSTEXIST;
        /* If we are looking for a file, require that it exists.  */
        if (NILP (only_dir_p))
          file_details->Flags |= OFN_FILEMUSTEXIST;
      }

which means that the OFN_FILEMUSTEXIST and OFN_PATHMUSTEXIST flags are
_not_ set if mustmatch is nil.  Are you saying that GetOpenFileName
requires the file to exist, even though these flags are not set?  This
seems to contradict the MSDN documentation at

  http://msdn.microsoft.com/en-us/library/windows/desktop/ms646839%28v=vs.85%29.aspx

Or are you saying that the mustmatch flag is set incorrectly when the
buffer is not visiting a file?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12931; Package emacs. (Tue, 20 Nov 2012 16:21:02 GMT) Full text and rfc822 format available.

Message #11 received at 12931 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Du Yanning <duyanning <at> gmail.com>
Cc: 12931 <at> debbugs.gnu.org
Subject: Re: bug#12931: a bug in Emacs for Windows (win32fns.c: x-file-dialog)
Date: Tue, 20 Nov 2012 18:18:54 +0200
You replied only to me, so I'm CC'ing the bug address to get this
archived with the bug.

> Date: Tue, 20 Nov 2012 12:27:10 +0800
> From: Du Yanning <duyanning <at> gmail.com>
> 
> I cannot recreate it every time.
> I do not know the reason. Perhaps it is a problem with my system.
> Sorry for my premature conclusion.
> If I can recreate it, I will contact you.
> I am sorry, and Thank you!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12931; Package emacs,w32. (Thu, 06 Feb 2014 01:40:02 GMT) Full text and rfc822 format available.

Message #14 received at 12931 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Du Yanning <duyanning <at> gmail.com>,  12931 <at> debbugs.gnu.org
Subject: Re: bug#12931: a bug in Emacs for Windows (win32fns.c: x-file-dialog)
Date: Wed, 05 Feb 2014 17:38:04 -0800
Eli Zaretskii <eliz <at> gnu.org> writes:

> You replied only to me, so I'm CC'ing the bug address to get this
> archived with the bug.
>
>> Date: Tue, 20 Nov 2012 12:27:10 +0800
>> From: Du Yanning <duyanning <at> gmail.com>
>> 
>> I cannot recreate it every time.
>> I do not know the reason. Perhaps it is a problem with my system.
>> Sorry for my premature conclusion.
>> If I can recreate it, I will contact you.
>> I am sorry, and Thank you!

Are you still seeing this problem in Emacs 24.3?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Thu, 06 Feb 2014 06:17:02 GMT) Full text and rfc822 format available.

Notification sent to Du Yanning <duyanning <at> gmail.com>:
bug acknowledged by developer. (Thu, 06 Feb 2014 06:17:03 GMT) Full text and rfc822 format available.

Message #19 received at 12931-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: duyanning <at> gmail.com, 12931-done <at> debbugs.gnu.org
Subject: Re: bug#12931: a bug in Emacs for Windows (win32fns.c: x-file-dialog)
Date: Thu, 06 Feb 2014 08:16:39 +0200
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Wed, 05 Feb 2014 17:38:04 -0800
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > You replied only to me, so I'm CC'ing the bug address to get this
> > archived with the bug.
> >
> >> Date: Tue, 20 Nov 2012 12:27:10 +0800
> >> From: Du Yanning <duyanning <at> gmail.com>
> >> 
> >> I cannot recreate it every time.
> >> I do not know the reason. Perhaps it is a problem with my system.
> >> Sorry for my premature conclusion.
> >> If I can recreate it, I will contact you.
> >> I am sorry, and Thank you!
> 
> Are you still seeing this problem in Emacs 24.3?

This is a duplicate of #13065, which was fixed long ago.

Closing.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 06 Mar 2014 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 194 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.