From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: load-path contains directories or directory names? Date: Sat, 24 Oct 2015 16:46:19 -0500 Message-ID: <867fmcey8k.fsf@stephe-leake.org> References: <86lhauus4x.fsf@stephe-leake.org> <87vb9x42io.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1445723219 28214 80.91.229.3 (24 Oct 2015 21:46:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 Oct 2015 21:46:59 +0000 (UTC) Cc: emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 24 23:46:49 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 1Zq6eF-0008Qw-OF for ged-emacs-devel@m.gmane.org; Sat, 24 Oct 2015 23:46:47 +0200 Original-Received: from localhost ([::1]:45803 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zq6eF-0001zO-3h for ged-emacs-devel@m.gmane.org; Sat, 24 Oct 2015 17:46:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zq6eB-0001zH-Iq for emacs-devel@gnu.org; Sat, 24 Oct 2015 17:46:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zq6e8-0007QP-Co for emacs-devel@gnu.org; Sat, 24 Oct 2015 17:46:43 -0400 Original-Received: from gproxy6-pub.mail.unifiedlayer.com ([67.222.39.168]:54292) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Zq6e8-0007QI-5m for emacs-devel@gnu.org; Sat, 24 Oct 2015 17:46:40 -0400 Original-Received: (qmail 8108 invoked by uid 0); 24 Oct 2015 21:46:30 -0000 Original-Received: from unknown (HELO CMOut01) (10.0.90.82) by gproxy6.mail.unifiedlayer.com with SMTP; 24 Oct 2015 21:46:30 -0000 Original-Received: from host114.hostmonster.com ([74.220.207.114]) by CMOut01 with id Z9mP1r0012UdiVW019mS1n; Sat, 24 Oct 2015 15:46:29 -0600 X-Authority-Analysis: v=2.1 cv=VOBOwb/X c=1 sm=1 tr=0 a=CQdxDb2CKd3SRg4I0/XZPQ==:117 a=CQdxDb2CKd3SRg4I0/XZPQ==:17 a=DsvgjBjRAAAA:8 a=f5113yIGAAAA:8 a=9i_RQKNPAAAA:8 a=hEr_IkYJT6EA:10 a=x_XPkuGwIRMA:10 a=5lJygRwiOn0A:10 a=DDrV8HC6AAAA:8 a=yNTB3roXvoYTG_W392AA:9 Original-Received: from [76.218.37.33] (port=56772 helo=TAKVER2) by host114.hostmonster.com with esmtpa (Exim 4.84) (envelope-from ) id 1Zq6ds-0007xN-35; Sat, 24 Oct 2015 15:46:24 -0600 In-Reply-To: (John Wiegley's message of "Fri, 23 Oct 2015 18:00:34 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt) X-Identified-User: {2442:host114.hostmonster.com:stephele:stephe-leake.org} {sentby:smtp auth 76.218.37.33 authed with stephen_leake@stephe-leake.org} X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 67.222.39.168 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:192590 Archived-At: "John Wiegley" writes: >>>>>> Michael Heerdegen writes: > >> I try to avoid string operations on file names. >> In the above case, using >> (expand-file-name name dir) >> seems cleaner to me. (info "(elisp) Directory Names" says to use: (concat DIRNAME RELFILE) So if I'm iterating thru a path that is defined to contain directory names (as `load-path' is, but see other email), this code is correct: (concat dir name) However, if the path contains directory file names (as `load-path' is implemented), then this code is correct: (concat (file-name-as-directory dir) filename) However, `file-name-as-directory' tolerates ending slashes or not in `dir', so the latter code is robust against people putting the wrong things in the path. Same for `expand-file-name' of course. -- -- Stephe