unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stephen Leake <stephen_leake@stephe-leake.org>
Cc: monnier@IRO.UMontreal.CA, emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only	directory names
Date: Sun, 25 Oct 2015 20:38:31 +0200	[thread overview]
Message-ID: <83wpuadc9k.fsf@gnu.org> (raw)
In-Reply-To: <86bnboeymw.fsf@stephe-leake.org>

> From: Stephen Leake <stephen_leake@stephe-leake.org>
> Cc: Stefan Monnier <monnier@IRO.UMontreal.CA>,  emacs-devel@gnu.org
> Date: Sat, 24 Oct 2015 16:37:43 -0500
> 
> > No, he means without the trailing slash.
> 
> Hmm. I now realize this is confused, and the doc string for `load-path'
> does not match the implementation.
> 
> Here's the `load-path' doc string (from master):
> 
>    List of directories to search for files to load.
>    Each element is a string (directory name) or nil (meaning 
> ‘default-directory’).
>    Initialized during startup as described in Info node ‘(elisp)Library Search’.
> 
> That says "directory name".

> (info "(elisp) Directory Names") says:
> 
>    On GNU and Unix systems, this is simple: a directory name ends in a
>    slash, whereas the directory’s name as a file lacks that slash.
> 
> This info node does not give a canonical phrase for "the directory's name as
> a file". This is the string returned by `directory-file-name'; I guess
> "directory file name" works.

It's easy to get these two confused, especially since one is shorter.

Let's say "directory file name" in the doc string of 'load-path',
since we've been doing that since time immemoriam.

> In emacs -Q, `load-path' has no terminating slashes.

Yes, because startup.el uses directory-files to get the standard
subdirectories of lisp/, and the lisp/ directory itself starts without
the trailing slash (by magic of the processed epaths.in).

> I have the impression that some other documentation uses "directory"
> instead of "directory name", but I can't find a good example at the moment.

I don't think this distinction between "directory" the object and its
name (see Lewis Carrol's immortal text on that) is relevant to the
issue at hand.  Here we are talking about 2 possible forms of the
directory's name.

> So the doc string for `load-path' should be changed to:
> 
>    List of directories to search for files to load.
>    Each element is a string (directory file name) or nil (meaning 
> ‘default-directory’).

Yes, and also a reference to 'directory-file-name' would be useful
here.

>    Initialized during startup as described in Info node ‘(elisp)Library Search’.
> 
> (just added 'file') possibly refilled.
> 
> And the info node should define "directory file name".

Yup.  Patches welcome, thanks in advance.

> However, there is one more quirk; `default-directory' does end in a
> slash, so having nil mean that in `load-path' is inconsistent. Should
> that then be:
> 
>  ... or nil (meaning (directory-file-name default-directory)).
> 
> ?

I don't think this subtlety is relevant.  The issue at hand is the
_form_, not the _semantics_.  As far as the form is concerned, nil
doesn't end in a slash, and you cannot use it in 'concat' for
generating a file name with leading directories anyway; you must use
'expand-file-name', which already does TRT.

> I don't think I've ever had nil in `load-path'; that seems like a bug,
> comparable to having "." in PATH.

No, it's a feature.  I did see that at some point, don't remember
where and why.

> And most of the path iterating code I've written would fail on nil
> (sigh).

If you use 'expand-file-name', it will "just work".




  reply	other threads:[~2015-10-25 18:38 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20151023135532.11512.53356@vcs.savannah.gnu.org>
     [not found] ` <E1Zpcoe-00030Q-LS@vcs.savannah.gnu.org>
2015-10-24 13:49   ` [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names Stefan Monnier
2015-10-24 14:02     ` Eli Zaretskii
2015-10-24 21:15       ` Stefan Monnier
2015-10-25  3:35         ` Eli Zaretskii
2015-10-26  2:04           ` Stefan Monnier
2015-10-26  3:34             ` Eli Zaretskii
2015-10-26  9:56               ` Stephen J. Turnbull
2015-10-24 21:37       ` Stephen Leake
2015-10-25 18:38         ` Eli Zaretskii [this message]
2015-10-26 13:19           ` Stephen Leake
2015-10-26 13:28             ` Dmitry Gutov
2015-10-26 16:24               ` Eli Zaretskii
2015-10-26 17:47                 ` Stefan Monnier
2015-10-26 18:30                   ` Eli Zaretskii
2015-10-26 18:47                     ` Dmitry Gutov
2015-10-26 18:58                       ` Eli Zaretskii
2015-10-26 19:01                         ` Dmitry Gutov
2015-10-27 13:49                     ` Stefan Monnier
2015-10-27 18:25                       ` Eli Zaretskii
2015-10-27 19:00                         ` Stefan Monnier
2015-10-27 19:17                           ` Eli Zaretskii
2015-10-27 22:18                             ` Stefan Monnier
2015-10-28  3:42                               ` Eli Zaretskii
2015-10-28  4:21                               ` Stephen J. Turnbull
2015-10-26 18:37                   ` Dmitry Gutov
2015-10-27 13:52                     ` Stefan Monnier
2015-10-28  0:24                       ` Dmitry Gutov
2015-10-28  2:53                         ` Stefan Monnier
2015-10-29  1:04                           ` Dmitry Gutov
2015-10-26 20:02                   ` Stephen Leake
2015-10-26 20:17                     ` Dmitry Gutov
2015-10-27 13:59                     ` Stefan Monnier
2015-10-27 18:27                       ` Eli Zaretskii
2015-10-27 19:01                         ` Stefan Monnier
2015-10-27 19:20                           ` Eli Zaretskii
2015-10-27 22:25                             ` Stefan Monnier
2015-10-28  7:34                               ` David Kastrup
2015-10-28 15:49                                 ` Davis Herring
2015-10-28 15:59                               ` Eli Zaretskii
2015-10-28 16:30                                 ` Stefan Monnier
2015-10-28 16:53                                   ` Eli Zaretskii
2015-10-28 18:22                                     ` Stefan Monnier
2015-10-28 18:48                                       ` Eli Zaretskii
2015-10-28 19:25                                         ` Stefan Monnier
2015-10-28 20:15                                           ` Eli Zaretskii
2015-10-28 20:18                                             ` Dmitry Gutov
2015-10-28 20:44                                               ` Eli Zaretskii
2015-10-29  1:18                                             ` Stefan Monnier
2015-10-29  8:24                                               ` David Kastrup
2015-10-29 16:20                                                 ` Eli Zaretskii
2015-10-28 21:02                                           ` Drew Adams
2015-10-29  1:18                                             ` Stefan Monnier
2015-10-29  3:40                                           ` Eli Zaretskii
2015-10-29  5:50                                             ` Stefan Monnier
2015-11-23 14:14                                         ` Nicolas Richard
2015-11-23 16:26                                           ` Eli Zaretskii
2015-10-28 18:19                                   ` Random832
2015-10-28 22:04                                     ` Random832
2015-10-29  2:34                                       ` Richard Stallman
2015-10-29 13:30                                         ` Wolfgang Jenkner
2015-10-29  2:32                                 ` Richard Stallman
2015-10-29  4:33                                   ` Random832
2015-10-29 16:21                                   ` Eli Zaretskii
2015-10-29 16:31                                     ` Dmitry Gutov
2015-10-29 16:42                                       ` Eli Zaretskii
2015-10-29 18:24                                         ` Dmitry Gutov
2015-10-30  1:10                                           ` Stefan Monnier
2015-10-30  1:09                                     ` Stefan Monnier
2015-10-30  8:00                                       ` Eli Zaretskii
2015-10-30 13:30                                         ` Stefan Monnier
2015-10-30 13:54                                           ` Eli Zaretskii
2015-10-30  1:34                                     ` Richard Stallman
2015-10-30  8:05                                       ` Eli Zaretskii
2015-10-28  1:31                       ` Stephen Leake
2015-10-26 16:21             ` Eli Zaretskii
2015-10-26 17:55               ` Stephen Leake
2015-10-26 18:33                 ` Eli Zaretskii
2015-10-26 19:49                   ` Stephen Leake

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=83wpuadc9k.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    --cc=stephen_leake@stephe-leake.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).