unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Sean Allred <allred.sean@gmail.com>
Cc: 65120@debbugs.gnu.org
Subject: bug#65120: 29.1; directory-abbrev-alist breaks various things when inside an abbreviated directory
Date: Thu, 10 Aug 2023 09:22:38 +0300	[thread overview]
Message-ID: <83r0obju1d.fsf@gnu.org> (raw)
In-Reply-To: <m0fs4rlqv3.fsf@epic96565.epic.com> (message from Sean Allred on Wed, 09 Aug 2023 18:31:50 -0500)

> From: Sean Allred <allred.sean@gmail.com>
> Cc: 65120@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?





      reply	other threads:[~2023-08-10  6:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-06 23:35 bug#65120: 29.1; directory-abbrev-alist breaks various things when inside an abbreviated directory Sean Allred
2023-08-07 15:45 ` Eli Zaretskii
2023-08-09 11:28   ` Sean Allred
2023-08-09 13:21     ` Eli Zaretskii
2023-08-09 23:31       ` Sean Allred
2023-08-10  6:22         ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83r0obju1d.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=65120@debbugs.gnu.org \
    --cc=allred.sean@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).