From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 4d3a595: `load-path' should contain only directory names Date: Tue, 27 Oct 2015 09:59:43 -0400 Message-ID: References: <20151023135532.11512.53356@vcs.savannah.gnu.org> <83mvv8wejc.fsf@gnu.org> <86bnboeymw.fsf@stephe-leake.org> <83wpuadc9k.fsf@gnu.org> <86d1w1ahsy.fsf@stephe-leake.org> <562E2A8A.1030601@yandex.ru> <83wpu9bns4.fsf@gnu.org> <86fv0x8kl6.fsf@stephe-leake.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1445954407 22371 80.91.229.3 (27 Oct 2015 14:00:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 Oct 2015 14:00:07 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org, Dmitry Gutov To: Stephen Leake Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 27 14:59:58 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zr4n4-0002EP-IN for ged-emacs-devel@m.gmane.org; Tue, 27 Oct 2015 14:59:54 +0100 Original-Received: from localhost ([::1]:59784 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zr4n4-0007EF-4V for ged-emacs-devel@m.gmane.org; Tue, 27 Oct 2015 09:59:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zr4n1-0007EA-C2 for emacs-devel@gnu.org; Tue, 27 Oct 2015 09:59:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zr4mw-0004Zh-8A for emacs-devel@gnu.org; Tue, 27 Oct 2015 09:59:51 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:55361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zr4mw-0004Zb-1B; Tue, 27 Oct 2015 09:59:46 -0400 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t9RDxiF4004245; Tue, 27 Oct 2015 09:59:44 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id A1C5D66236; Tue, 27 Oct 2015 09:59:43 -0400 (EDT) In-Reply-To: <86fv0x8kl6.fsf@stephe-leake.org> (Stephen Leake's message of "Mon, 26 Oct 2015 15:02:13 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5472=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5472> : inlines <3953> : streams <1528262> : uri <2071273> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:192723 Archived-At: >> 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