all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Eli Zaretskii <eliz@gnu.org>,
	emacs-devel@gnu.org, Dmitry Gutov <dgutov@yandex.ru>
Subject: Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names
Date: Mon, 26 Oct 2015 15:02:13 -0500	[thread overview]
Message-ID: <86fv0x8kl6.fsf@stephe-leake.org> (raw)
In-Reply-To: <jwvd1w1ttjt.fsf-monnier+emacsdiffs@gnu.org> (Stefan Monnier's message of "Mon, 26 Oct 2015 13:47:14 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> 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



  parent reply	other threads:[~2015-10-26 20:02 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
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 [this message]
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86fv0x8kl6.fsf@stephe-leake.org \
    --to=stephen_leake@stephe-leake.org \
    --cc=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 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.