From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter Lee Newsgroups: gmane.emacs.help Subject: Re: Abbreviated filenames for display Date: Tue, 26 Apr 2005 22:12:50 GMT Organization: x Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1114553458 11614 80.91.229.2 (26 Apr 2005 22:10:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 26 Apr 2005 22:10:58 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 27 00:10:54 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DQYFH-00010C-K2 for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Apr 2005 00:09:31 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DQYL4-0008Bn-Ve for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Apr 2005 18:15:31 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!newscon06.news.prodigy.com!prodigy.net!newsmst01a.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr12.news.prodigy.com.POSTED!404941e6!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (windows-nt) Cancel-Lock: sha1:9mPZJbv6eK5L7YPGN0/yl/fhef8= Original-Lines: 38 Original-NNTP-Posting-Host: 66.194.80.196 Original-X-Complaints-To: abuse@prodigy.net Original-X-Trace: newssvr12.news.prodigy.com 1114553570 ST000 66.194.80.196 (Tue, 26 Apr 2005 18:12:50 EDT) Original-NNTP-Posting-Date: Tue, 26 Apr 2005 18:12:50 EDT X-UserInfo1: TSU[@IONEJW[STT^BJJNOFXBBZ\LPCXLLBWLOOAFBATBTSUBYFWEAE[YJLYPIWKHTFCMZKVMB^[Z^DOBRVVMOSPFHNSYXVDIE@X\BUC@GTSX@DL^GKFFHQCCE\G[JJBMYDYIJCZM@AY]GNGPJD]YNNW\GSX^GSCKHA[]@CCB\[@LATPD\L@J\\PF]VR[QPJN Original-Xref: shelby.stanford.edu gnu.emacs.help:130503 Original-To: help-gnu-emacs@gnu.org 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 Xref: news.gmane.org gmane.emacs.help:26071 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:26071 >>>> Michael Mauger writes: > (putenv "D0" "~/My Documents/Projects/xyz") > (putenv "D1" "/sshx:myuser@unix1.abc.def.com:/home/myuser") > (putenv "D2" "/sshx:myuser@unix2.abc.def.com:/home/myuser") You can also use abbrev. (define-abbrev global-abbrev-table "D0" "~/My Documents/Projects/xyz") (define-abbrev global-abbrev-table "D1" "/sshx:myuser@unix1.abc.def.com:/home/myuser") (define-abbrev global-abbrev-table "D2" "/sshx:myuser@unix2.abc.def.com:/home/myuser") and then type C-x C-f D0[C-x '] ,----[ C-h k C-x ' ] | C-x ' runs the command expand-abbrev | which is an interactive built-in function in `C source code'. | It is bound to C-x ', C-x a ', C-x a e. | (expand-abbrev) | | Expand the abbrev before point, if there is an abbrev there. | Effective when explicitly called even when `abbrev-mode' is nil. | Returns the abbrev symbol, if expansion took place. `---- > For example, rather than showing me > /sshx:myuser@unix2.abc.def.com:/home/myuser/proj/xyz/src/x.sql > as the filename, I want: > $D2/proj/xyz/src/x.sql Take a look at uniquify.el. It comes with cvs emacs... I don't remember if it was part of 21.3 or not... if it wasn't you can search around for it via google. It's a nice package for this type of thing and you can probably configure it to give you what you want. (require 'uniquify) (setq uniquify-buffer-name-style 'post-forward)