From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Richard M. Stallman" Newsgroups: gmane.emacs.devel Subject: Re: Emacs and Squiggles as filenames Date: Mon, 11 Jul 2005 01:34:57 -0400 Message-ID: References: <87ll4iph80.fsf@gnufans.net> <8564vjhxjw.fsf@lola.goethe.zz> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1121063016 27847 80.91.229.2 (11 Jul 2005 06:23:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 11 Jul 2005 06:23:36 +0000 (UTC) Cc: deego@gnufans.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 11 08:23:28 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DrrhH-0001ml-NC for ged-emacs-devel@m.gmane.org; Mon, 11 Jul 2005 08:23:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Drriq-0007yC-1z for ged-emacs-devel@m.gmane.org; Mon, 11 Jul 2005 02:24:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DrrYA-0005qi-Sj for emacs-devel@gnu.org; Mon, 11 Jul 2005 02:13:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DrrY0-0005lc-VT for emacs-devel@gnu.org; Mon, 11 Jul 2005 02:13:46 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DrrXx-00058R-NE for emacs-devel@gnu.org; Mon, 11 Jul 2005 02:13:41 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Drr6Z-0007gl-An for emacs-devel@gnu.org; Mon, 11 Jul 2005 01:45:23 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1DrqwT-0007fT-E0; Mon, 11 Jul 2005 01:34:57 -0400 Original-To: David Kastrup In-reply-to: <8564vjhxjw.fsf@lola.goethe.zz> (message from David Kastrup on Sun, 10 Jul 2005 10:31:31 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:40751 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:40751 >> (expand-file-name (file-name-nondirectory fname) dir) >> >> >> should return fname back. It is like an identity, right? If not, >> what is the way to *always* correctly do an expand-file-name ? > > This works for me: > (concat (file-name-as-directory "~/tmp") > (file-name-nondirectory "~/tmp/~")) I am afraid that the former version is _so_ ingrained into Elisp code that we should add advice into DOC strings and Elisp manual. It is not just frequent, it is what we have always called "the right way". Using concat has been slightly deprecated, partly because it won't work in the case where the directory name fails to end in a slash. Many places in the code were written to use expand-file-name because it was the preferred method. I think that using concat will always work right when the directory name is properly formatted. However, rather than recommend use of concat, I would rather define a new function specifically for this purpose. It could be called `merge-file-name'.