unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Du Yanning <duyanning@gmail.com>
To: 12931@debbugs.gnu.org
Subject: bug#12931: a bug in Emacs for Windows (win32fns.c: x-file-dialog)
Date: Mon, 19 Nov 2012 21:53:02 +0800	[thread overview]
Message-ID: <CALr_ej1OfgGya33i67C8NWGxLNxYZ+reRUMw-xmw7zKyXA03Fg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 584 bytes --]

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);
      }

[-- Attachment #2: Type: text/html, Size: 664 bytes --]

             reply	other threads:[~2012-11-19 13:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-19 13:53 Du Yanning [this message]
2012-11-19 19:08 ` bug#12931: a bug in Emacs for Windows (win32fns.c: x-file-dialog) Eli Zaretskii
     [not found]   ` <CALr_ej2asGEUoTkBRPyryMMm7dFVtmYuixPt+nuXoPV+gYs0sw@mail.gmail.com>
2012-11-20 16:18     ` Eli Zaretskii
2014-02-06  1:38       ` Lars Ingebrigtsen
2014-02-06  6:16         ` Eli Zaretskii

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=CALr_ej1OfgGya33i67C8NWGxLNxYZ+reRUMw-xmw7zKyXA03Fg@mail.gmail.com \
    --to=duyanning@gmail.com \
    --cc=12931@debbugs.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).