From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "B. T. Raven" Newsgroups: gmane.emacs.help Subject: Re: Converting filenames Date: Wed, 30 Jun 2010 23:25:50 -0500 Message-ID: <4C2C18CE.5020109@nihilo.net> References: <722c8495-60f9-4a06-9c36-2226dc942390@5g2000yqz.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1291842175 32725 80.91.229.12 (8 Dec 2010 21:02:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 8 Dec 2010 21:02:55 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 08 22:02:51 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQR9z-0002jH-Vk for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 22:02:48 +0100 Original-Received: from localhost ([127.0.0.1]:39983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQQwu-0006Ao-N1 for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 15:49:16 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!news3.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.sysmatrix.net!news.sysmatrix.net.POSTED!not-for-mail Original-NNTP-Posting-Date: Wed, 30 Jun 2010 23:25:39 -0500 User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) Original-Newsgroups: gnu.emacs.help In-Reply-To: <722c8495-60f9-4a06-9c36-2226dc942390@5g2000yqz.googlegroups.com> X-No-Archive: yes Original-Lines: 20 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 12.73.132.77 Original-X-Trace: sv3-E9EKua9zVeK9R3GXc1WqT1XTLrh4R3Y0HwOvTm757hJHOSzl/WfUJ0U0a/V6+mv29k+M+h1apqnwAhE!eqMOLMREATuU5Oxe2xhlgGGpLiddH3l8peHz1utCe2tKJdjBA98FIJeBAt2CNG94RaAwec8f+qqG!0oBP Original-X-Complaints-To: abuse@sysmatrix.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Original-Xref: usenet.stanford.edu gnu.emacs.help:179391 X-Originally-To: =?ISO-8859-1?Q?Nordl=F6w?= X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org X-Gmane-Expiry: 2010-12-22 Xref: news.gmane.org gmane.emacs.help:76011 Archived-At: 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