From: "D Goel" <deego@gnufans.org>
Subject: Emacs and Squiggles as filenames
Date: Thu, 07 Jul 2005 15:07:59 -0400 [thread overview]
Message-ID: <87ll4iph80.fsf@gnufans.net> (raw)
(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 ?
next reply other threads:[~2005-07-07 19:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-07 19:07 D Goel [this message]
2005-07-09 4:21 ` Emacs and Squiggles as filenames Richard M. Stallman
2005-07-09 4:21 ` Richard M. Stallman
2005-07-10 4:05 ` Paul Jarc
2005-07-10 8:31 ` David Kastrup
2005-07-11 5:34 ` Richard M. Stallman
2005-07-11 7:53 ` David Kastrup
2005-07-11 21:14 ` Richard M. Stallman
2005-07-11 12:37 ` D Goel
2005-07-11 13:41 ` David Kastrup
2005-07-11 15:32 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ll4iph80.fsf@gnufans.net \
--to=deego@gnufans.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).