[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
file name aliases, bookmarks and abbrevs
From: |
Matthias Meulien |
Subject: |
file name aliases, bookmarks and abbrevs |
Date: |
09 Jul 2003 17:45:12 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.93 |
Hi,
I have a collection of bookmarks mapped to long directory names; for
example `/usr/share/emacs/21.2.93/lisp/' and
`/[suu/root@localhost]/root/' (I use the nice tramp package) are
mapped respectively to `lisp' and `root'.
I have written a function to create an abbrev per bookmark, so I can
use bookmarks names in the minibuffer when "finding files" (`C-x C-f
root C-x a e ... RET' ):
(defun alt-bookmark-to-abbrevs ()
"Create abbrevs based on `bookmark-alist'."
(dolist (bookmark bookmark-alist)
(let* ((name (car bookmark))
(file (bookmark-get-filename name)))
(define-abbrev global-abbrev-table name file))))
I love it! But all modes share the `global-abbrev-table', so strings
like `lisp' and `root' always expand...
Does there exists a minibuffer abbreviation table ? Or a mechanism of
"conditional expansion" ? Perhaps using `pre-abbrev-expand-hook' and a
more sophisticated `alt-bookmark-to-abbrevs'... Any idea welcome!
Thanks for your attention.
--
Matthias
- file name aliases, bookmarks and abbrevs,
Matthias Meulien <=