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!