unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Stephen Leake <stephen_leake@stephe-leake.org>
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: Tue, 27 Oct 2015 09:59:43 -0400	[thread overview]
Message-ID: <jwvsi4w2zgg.fsf-monnier+emacsdiffs@gnu.org> (raw)
In-Reply-To: <86fv0x8kl6.fsf@stephe-leake.org> (Stephen Leake's message of "Mon, 26 Oct 2015 15:02:13 -0500")

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

If we really want to be anal-retentive, then at the very least we should
be consistent.

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

I too can come up with hypothetical benefits: my question was about
*concrete* benefits.

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

I see 10 characters saved above.  Doesn't sound like a real performance
advantage [ yes, I know you were referring to another kind of
performance, but without real-world measurements this has no meaning.  ]

> which is not likely to be significant in code that is reading the actual
> disk (that will be the slow part).

So, it seems we agree that there is no performance advantage.

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

My gut feeling is that the risk of introducing a bug when changing
process.c's handling of default-directory is lower than the probability
of fixing latent bugs.

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

No, it was not inconsistent.  "directory name" is used all over the
place to mean "with or without trailing slash, it doesn't matter", so
the original doc-string was fine.


        Stefan



  parent reply	other threads:[~2015-10-27 13:59 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
2015-10-26 20:17                     ` Dmitry Gutov
2015-10-27 13:59                     ` Stefan Monnier [this message]
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=jwvsi4w2zgg.fsf-monnier+emacsdiffs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --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).