[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only direct
From: |
Stephen Leake |
Subject: |
Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names |
Date: |
Mon, 26 Oct 2015 15:02:13 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt) |
Stefan Monnier <address@hidden> writes:
>> Nothing, except that we can point them to the docs and say that they
>> live dangerously ;-)
>
> So you live dangerously if you forget the trailing slash in
> default-directory, but you live dangerously if you do add it in
> load-path?
Yes, that's what the current implementation provides. I agree it's not
consistent (apparently XEmacs is more consistent here).
> What's the benefit of this pickiness?
When you are writing code that iterates thru load-path, using the
entries for various things (checking that they exist, listing contents),
it helps to know how they are defined.
> Unless there's a real performance advantage (which I fail to see),
The only performance advantage so far is the difference between:
(expand-file-name file dir)
;; full defensive programming
(concat dir file)
;; assuming the doc string is right, and/or has been verified at a
;; higher level
which is not likely to be significant in code that is reading the actual
disk (that will be the slow part).
> I'd rather go the other way and be more permissive and fix
> default-directory so it also works correctly when it doesn't have a
> trailing slash.
You can't "fix" default-directory; you could change its definition, but
then you would have to fix (or at least verify)_every_ use of it, which
is impossible, since it could be used in everyone's private code.
We are changing the doc string of load-path, but only because it was
inconsistent with the actual implementation in core. It is now consistent.
--
-- Stephe
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names, (continued)
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names, Stefan Monnier, 2015/10/27
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names, Eli Zaretskii, 2015/10/27
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names, Stefan Monnier, 2015/10/27
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names, Eli Zaretskii, 2015/10/27
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names, Stephen J. Turnbull, 2015/10/28
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names, Dmitry Gutov, 2015/10/26
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names, Stefan Monnier, 2015/10/27
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names, Dmitry Gutov, 2015/10/27
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names, Stefan Monnier, 2015/10/27
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names, Dmitry Gutov, 2015/10/28
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names,
Stephen Leake <=
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names, Dmitry Gutov, 2015/10/26
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names, Stefan Monnier, 2015/10/27
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names, Eli Zaretskii, 2015/10/27
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names, Stefan Monnier, 2015/10/27
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names, Eli Zaretskii, 2015/10/27
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names, Stefan Monnier, 2015/10/27
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names, David Kastrup, 2015/10/28
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names, Davis Herring, 2015/10/28
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names, Eli Zaretskii, 2015/10/28
- Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names, Stefan Monnier, 2015/10/28