Subject: Re: bug#67390: 28; shorthands-font-lock-shorthands assumes shorthand uses same separator

From: João Távora <[email-masked]>
Date: Wed, 29 Nov 2023 23:27:00 +0000

On Wed, Nov 29, 2023 at 1:30 PM João Távora <[email-masked]> wrote:
>
> On Sat, Nov 25, 2023 at 4:03 PM Jonas Bernoulli via Bug reports for
> GNU Emacs, the Swiss army knife of text editors
> <[email-masked]> wrote:
> >
> > Joseph Turner <[email-masked]> writes:
> >
> > > +                          (car (shorthands--find-if
> > > +                                (lambda (short)
> > > +                                  (string-prefix-p short (match-string 1)))
> > > +                                read-symbol-shorthands #'car)))))
> >
> > Or simply:
> >   (car (assoc (match-string 1)
> >               read-symbol-shorthands
> >               #'string-prefix-p))
>
> I don't think it works, at least in my 'assoc', the order
> of string-prefix-p arguments must be switched.  Pity
> assoc or string-prefix-p decs didn't coordinate this.

nevermind, it does work if what you want is to see if the cars
of the alist are prefixes to the key, which is probably your
intention in this snippet.