all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#33339: 26; doc string of `write-file`
@ 2018-11-10 22:42 Drew Adams
  2018-11-11 16:20 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2018-11-10 22:42 UTC (permalink / raw)
  To: 33339

 "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''





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#33339: 26; doc string of `write-file`
  2018-11-10 22:42 bug#33339: 26; doc string of `write-file` Drew Adams
@ 2018-11-11 16:20 ` Eli Zaretskii
  0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2018-11-11 16:20 UTC (permalink / raw)
  To: Drew Adams; +Cc: 33339-done

> Date: Sat, 10 Nov 2018 14:42:16 -0800 (PST)
> From: Drew Adams <drew.adams@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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#33339: 26; doc string of `write-file`
       [not found] ` <<83h8gna8mj.fsf@gnu.org>
@ 2018-11-11 16:55   ` Drew Adams
  0 siblings, 0 replies; 3+ messages in thread
From: Drew Adams @ 2018-11-11 16:55 UTC (permalink / raw)
  To: Eli Zaretskii, Drew Adams; +Cc: 33339-done

> >  "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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-11 16:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-10 22:42 bug#33339: 26; doc string of `write-file` Drew Adams
2018-11-11 16:20 ` Eli Zaretskii
     [not found] <<1c69fed6-2e30-46a2-92dd-7f8ae6d62928@default>
     [not found] ` <<83h8gna8mj.fsf@gnu.org>
2018-11-11 16:55   ` Drew Adams

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.