home *** CD-ROM | disk | FTP | other *** search
- x-gateway: rodan.UU.NET from bug-lucid-emacs to alt.lucid-emacs.bug; Mon, 9 Nov 1992 14:18:54 EST
- Date: Mon, 9 Nov 1992 11:18:47 PST
- Message-ID: <9211091918.AA06576@thalidomide.lucid>
- X-Windows: Garbage at your fingertips.
- From: jwz@lucid.com (Jamie Zawinski)
- Sender: jwz%thalidomide@lucid.com
- Subject: Re: automatic load-path generation
- Newsgroups: alt.lucid-emacs.bug
- Path: sparky!uunet!wendy-fate.uu.net!bug-lucid-emacs
- Lines: 39
-
- To use the startup.el that I recently sent out, you need to add the
- following forms to the front of it.
-
- I'd really appreciate some feedback (positive or negative) on whether this
- startup code does what you need, because otherwise I'm going to put it in
- 19.4 and get a lot of complaints if it has missed the mark again...
-
- -- Jamie
-
-
- ;; This should really be in files.el, but is used very early.
- (defvar directory-abbrev-alist
- nil
- "*Alist of abbreviations for file directories.
- A list of elements of the form (FROM . TO), each meaning to replace
- FROM with TO when it appears in a directory name.
- This replacement is done when setting up the default directory
- of a newly visited file. *Every* FROM string should start with `^'.
-
- Use this feature when you have directories which you normally refer to
- via absolute symbolic links. Make TO the name of the link, and FROM
- the name it is linked to.")
-
- (defun abbreviate-file-name (filename &optional hack-homedir)
- "Return a version of FILENAME shortened using directory-abbrev-alist.
- See \\[describe-variable] directory-abbrev-alist RET for more information.
- If optional argument HACK-HOMEDIR is non-nil, then This also substitutes
- \"~\" for the user's home directory."
- (let ((tail directory-abbrev-alist))
- (while tail
- (if (string-match (car (car tail)) filename)
- (setq filename
- (concat (cdr (car tail)) (substring filename (match-end 0)))))
- (setq tail (cdr tail))))
- (if (and hack-homedir
- (string-match (concat "^" (regexp-quote (expand-file-name "~")))
- filename))
- (setq filename (concat "~" (substring filename (match-end 0)))))
- filename)
-