From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "D Goel" Newsgroups: gmane.emacs.devel Subject: Emacs and Squiggles as filenames Date: Thu, 07 Jul 2005 15:07:59 -0400 Message-ID: <87ll4iph80.fsf@gnufans.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1120765612 31550 80.91.229.2 (7 Jul 2005 19:46:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 7 Jul 2005 19:46:52 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 07 21:46:51 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DqcJc-0000LH-9n for ged-emacs-devel@m.gmane.org; Thu, 07 Jul 2005 21:45:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DqcKz-0000Rw-J1 for ged-emacs-devel@m.gmane.org; Thu, 07 Jul 2005 15:47:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DqcKJ-0000Lr-WF for emacs-devel@gnu.org; Thu, 07 Jul 2005 15:46:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DqcKI-0000Km-8M for emacs-devel@gnu.org; Thu, 07 Jul 2005 15:46:27 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DqcH5-0007rh-DV for emacs-devel@gnu.org; Thu, 07 Jul 2005 15:43:07 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1Dqbnu-0007mM-21 for emacs-devel@gnu.org; Thu, 07 Jul 2005 15:12:58 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DqbhH-0002vj-7T for emacs-devel@gnu.org; Thu, 07 Jul 2005 21:06:07 +0200 Original-Received: from 24.197.153.99 ([24.197.153.99]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Jul 2005 21:06:07 +0200 Original-Received: from deego by 24.197.153.99 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Jul 2005 21:06:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 41 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 24.197.153.99 X-Face: #5@=vrmx5t3mZaPY8(mR.n+V#:%4NW7j5A&^}@lGp2rK; CQ4%iH1v'gh/^A)w5*6c&R2(P' 4+seYDq8OK'LPI/C(C^A*w|f*t+8, 'T8b#_0~h3!A7GoVroE[cr0Fb'A0%SdU|Lk@gBV&1vA User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:7tuQf7WEukst8QmLd7uQmdvXFnc= 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:40580 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:40580 (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 ? The exception I saw was here: If there exists a file named "~" in my ~/tmp/, I see funny things: (expand-file-name (file-name-nondirectory "~/tmp/~") "~/tmp"), returns =>/home/deego instead of /home/deego/tmp/~ ^^ I had a function doing recursive stuff using directory-files.. and ascending up 2 directories like this caused an infinite loop.. Other interesting things: (file-truename "~/tmp/~") => "/home/deego/tmp/~" Yet, "~/tmp/~" is apparently the correct representation, as returned by (directory-files "~/tmp" t) Moreover, (directory-files "~/tmp" nil) simply returns "~". Is an escape missing somewhere in emacs internals? Or, is an elisp user supposed to call some escaping functions before doing expand-file-name ?