GNU bug report logs - #33339
26; doc string of `write-file`

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sat, 10 Nov 2018 22:43:01 UTC

Severity: minor

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 33339 in the body.
You can then email your comments to 33339 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#33339; Package emacs. (Sat, 10 Nov 2018 22:43:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 10 Nov 2018 22:43:01 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26; doc string of `write-file`
Date: Sat, 10 Nov 2018 14:42:16 -0800 (PST)
 "If you specify just a directory name as FILENAME, that means to use
  the default file name but in that directory.  You can also yank
  the default file name into the minibuffer to edit it, using M-n."

"The default file name" is undefined.  How is a user to know what we
mean?  It turns out that in this particular case what we mean is this:

(file-name-nondirectory (or buffer-file-name (buffer-name)))

Not obvious from the description.

To start with, the doc string should say that it prompts for a file
name.  If the current buffer is visiting a file then that file's name is
the default file name for reading.  Otherwise the buffer name is the
default file name for reading.

The last part could be more exact.  The default name in that case is
actually this:

 (expand-file-name (file-name-nondirectory (buffer-name))
                   default-directory) 

In GNU Emacs 26.1 (build 1, x86_64-w64-mingw32)
 of 2018-05-30
Repository revision: 07f8f9bc5a51f5aa94eb099f3e15fbe0c20ea1ea
Windowing system distributor `Microsoft Corp.', version 10.0.16299
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sun, 11 Nov 2018 16:22:02 GMT) Full text and rfc822 format available.

Notification sent to Drew Adams <drew.adams <at> oracle.com>:
bug acknowledged by developer. (Sun, 11 Nov 2018 16:22:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 33339-done <at> debbugs.gnu.org
Subject: Re: bug#33339: 26; doc string of `write-file`
Date: Sun, 11 Nov 2018 18:20:36 +0200
> Date: Sat, 10 Nov 2018 14:42:16 -0800 (PST)
> From: Drew Adams <drew.adams <at> oracle.com>
> 
>  "If you specify just a directory name as FILENAME, that means to use
>   the default file name but in that directory.  You can also yank
>   the default file name into the minibuffer to edit it, using M-n."
> 
> "The default file name" is undefined.

It is defined by the very next paragraph of the doc string.  I made it
even more clear.

> To start with, the doc string should say that it prompts for a file
> name.  If the current buffer is visiting a file then that file's name is
> the default file name for reading.  Otherwise the buffer name is the
> default file name for reading.

This is incorrect when the user specifies just the directory name at
the prompt.  I clarified that only the base name is taken from the
buffer.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33339; Package emacs. (Sun, 11 Nov 2018 16:56:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Drew Adams <drew.adams <at> oracle.com>
Cc: 33339-done <at> debbugs.gnu.org
Subject: RE: bug#33339: 26; doc string of `write-file`
Date: Sun, 11 Nov 2018 08:55:25 -0800 (PST)
> >  "If you specify just a directory name as FILENAME, that means to use
> >   the default file name but in that directory.  You can also yank
> >   the default file name into the minibuffer to edit it, using M-n."
> >
> > "The default file name" is undefined.
> 
> It is defined by the very next paragraph of the doc string.

Yes, things are out of order.

> I made it even more clear.

Thank you.

> > To start with, the doc string should say that it prompts for a file
> > name.  If the current buffer is visiting a file then that file's name
> > is the default file name for reading.  Otherwise the buffer name is the
> > default file name for reading.
> 
> This is incorrect when the user specifies just the directory name at
> the prompt.  I clarified that only the base name is taken from the
> buffer.

Thanks.




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

This bug report was last modified 6 years and 192 days ago.

Previous Next


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