all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "B. T. Raven" <nihil@nihilo.net>
To: help-gnu-emacs@gnu.org
Subject: Re: Converting filenames
Date: Wed, 30 Jun 2010 23:31:33 -0500	[thread overview]
Message-ID: <Kp6dnegcP4iEh7HRnZ2dnUVZ_h6dnZ2d@sysmatrix.net> (raw)
In-Reply-To: <4C2C18CE.5020109@nihilo.net>

B. T. Raven wrote:
> Nordlöw wrote:
>> Is there an opposite function of expand-file-name() that converts "/
>> home/per/" to "~/" if I am user per?
>>
>> Thanks in advance,
>> Nordlöw
> 
> I don't think that a general inverse function would be useful since "~/"
> is probably not a symlink or hard link but just string somehow hard
> coded to expand to the fully qualified home path. What would the
> putative abbrev-file-name do with dir/subdir/pic.jpg? The only sensible
> thing is just to return its argument.
> 
> Something like this:
> 
> (if (equal (getenv "home") "/home/per")    (print "~/"))
> 
> illustrates what should happen if the Emacs process belongs to per.
> 
> Ed

Oops, abbreviate-file-name actually exists but returns only "~". You
could wrap it in something that concats the "/"

Ed


  reply	other threads:[~2010-07-01  4:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <722c8495-60f9-4a06-9c36-2226dc942390@5g2000yqz.googlegroups.com>
2010-07-01  0:42 ` Converting filenames Pascal J. Bourguignon
2010-07-01  4:25 ` B. T. Raven
2010-07-01  4:31   ` B. T. Raven [this message]
2010-12-11  7:51     ` Kevin Rodgers
2010-12-11  7:35 ` Drew Adams

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Kp6dnegcP4iEh7HRnZ2dnUVZ_h6dnZ2d@sysmatrix.net \
    --to=nihil@nihilo.net \
    --cc=help-gnu-emacs@gnu.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.