bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#26272: default-directory: Remark that it must be a directory name


From: Eli Zaretskii
Subject: bug#26272: default-directory: Remark that it must be a directory name
Date: Mon, 27 Mar 2017 17:43:19 +0300

> From: Tino Calancha <tino.calancha@gmail.com>
> Date: Mon, 27 Mar 2017 19:13:05 +0900
> 
> 
> The docstring of `file-name-as-directory' suggests that is
> important that `default-directory' be a directory name, i.e.,
> for instance in GNU/Linux ends with '/'.  The docstring of
> `default-directory' doesn't mention it.

Didn't we discuss that at some point in the past?

>    DEFVAR_PER_BUFFER ("default-directory", &BVAR (current_buffer, directory),
>                    Qstringp,
>                    doc: /* Name of default directory of current buffer.
> -To interactively change the default directory, use command `cd'.  */);
> +It must be a directory name, as the output of `file-name-as-directory'.
> +To interactively change the default directory, use command `cd'.
> +In a Elisp program is better to do
> +(setq default-directory (file-name-as-directory DIR)) */);

A word of advice for the future: it is usually best to start from
informal text that describes well what you mean in your own words, and
then "formalize" it as needed, taking care not to lose key words and
concepts.  If you compare your informal description above with the
patched doc string, I think you will agree with me that the former
says what you mean in a much more clear and concise way.  So something
important got lost in transition, and you tried to make up for that by
adding more explanations and an example.

Here's my suggestion:

  It should be a directory name (as opposed to a directory file-name).
  On GNU and Unix systems, directory names and in a slash `/'.

This basically says what your original description said, which is spot
on.

Thanks.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]