[Top][All Lists]

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

Re: Abbreviated filenames for display

From: Peter Lee
Subject: Re: Abbreviated filenames for display
Date: Tue, 26 Apr 2005 22:12:50 GMT
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (windows-nt)

>>>> Michael Mauger writes:

    >    (putenv "D0" "~/My Documents/Projects/xyz")
    >    (putenv "D1" "/sshx:address@hidden:/home/myuser")
    >    (putenv "D2" "/sshx:address@hidden:/home/myuser")

You can also use abbrev.

(define-abbrev global-abbrev-table "D0" "~/My Documents/Projects/xyz")
(define-abbrev global-abbrev-table "D1" "/sshx:address@hidden:/home/myuser")
(define-abbrev global-abbrev-table "D2" "/sshx:address@hidden:/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:address@hidden:/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)

reply via email to

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