GNU bug report logs -
#65120
29.1; directory-abbrev-alist breaks various things when inside an abbreviated directory
Previous Next
Full log
Message #20 received at 65120 <at> debbugs.gnu.org (full text, mbox):
> From: Sean Allred <allred.sean <at> gmail.com>
> Cc: 65120 <at> debbugs.gnu.org
> Date: Wed, 09 Aug 2023 18:31:50 -0500
>
> In the meantime, I think I'll create a new defcustom/defun pair:
>
> (defcustom directory-abbrev-display-alist
> nil
> "Like `directory-abbrev-alist', but for `abbreviate-file-name-for-display'.")
>
> (defun abbreviate-file-name-for-display (filename)
> "Like `abbreviate-file-name', but is not guaranteed to produce a functional path."
> (let ((directory-abbrev-alist (append directory-abbrev-display-alist
> directory-abbrev-alist)))
> (abbreviate-file-name filename)))
>
> ;; e.g.
> (let ((directory-abbrev-display-alist
> '(("C:/MegaCorpSource" . "@src"))))
> (abbreviate-file-name-for-display "C:/MegaCorpSource/foo"))
> => "@src/foo
>
> (Symbol names prefixed with my package prefix, of course.)
>
> If I get good mileage out of this, would this be the kind of thing I
> could submit a patch for? It turned out prettier than I was expecting.
> (I've already sorted out the FSF paperwork.)
Where and how would this "abbreviated-for-display" file names used in
Emacs?
This bug report was last modified 1 year and 317 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.