GNU bug report logs - #65120
29.1; directory-abbrev-alist breaks various things when inside an abbreviated directory

Previous Next

Package: emacs;

Reported by: Sean Allred <allred.sean <at> gmail.com>

Date: Sun, 6 Aug 2023 23:40:01 UTC

Severity: normal

Found in version 29.1

Full log


Message #20 received at 65120 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Sean Allred <allred.sean <at> gmail.com>
Cc: 65120 <at> debbugs.gnu.org
Subject: Re: bug#65120: 29.1; directory-abbrev-alist breaks various things
 when inside an abbreviated directory
Date: Thu, 10 Aug 2023 09:22:38 +0300
> 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.