GNU bug report logs -
#79485
31.0.50; Loaded files inherit read-symbol-shorthands
Previous Next
Full log
Message #32 received at 79485 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
I think package authors are already aware that all prefixes will be
replaced. It's just that there don't seem to be good alternatives for
dealing with these sorts of namespace issues as all the options have
downsides.
I already mentioned what I wrote below but I forgot to reply all and also
may not have been particularly clear anyway so I'll try again.
My preferred solution would be to make a special character cause the whole
symbol to be matched instead of just the prefix. # is already not readable
at the start of a symbol so it seems like that wouldn't cause conflicts.
For example:
;; read-symbol-shorthands: (
;; ("mvlp-" . "my-very-long-prefix-")
;; ("#db" . "cl-destructuring-bind"))
The idea is that "db" is only replaced when it matches the entire symbol
due to the #. "mvlp-" on the other hand is replaced whenever it occurs as
the prefix of a symbol.
On Mon, Sep 22, 2025 at 12:25 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
> > From: David Rosenbaum <djr7c4 <at> gmail.com>
> > Date: Mon, 22 Sep 2025 10:04:21 -0700
> > Cc: Eli Zaretskii <eliz <at> gnu.org>, 79485 <at> debbugs.gnu.org
> >
> > > Also they were designed to abbreviate prefixes, not full symbol names,
> so the db idea is probably not
> > going to work. As far as I remember, these things were well explained in
> the manual...
> >
> > Intended or not, shorthands are being used this way by packages authors.
> For example, see cond-let and
> > llama.
>
> So maybe we should improve our documentation to explicitly recommend
> against such practices.
>
> Emacs gives Lisp programmers enough rope to hang themselves, but
> hanging themselves is probably not what they want.
>
[Message part 2 (text/html, inline)]
This bug report was last modified today.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.