[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Emacs and Squiggles as filenames

From: D Goel
Subject: Emacs and Squiggles as filenames
Date: Thu, 07 Jul 2005 15:07:59 -0400
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]