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

From: João Távora <[email-masked]>
Date: Wed, 29 Nov 2023 13:30:22 +0000

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.

(assoc probe read-symbol-shorthands (lambda (a b) (string-prefix-p b a)))

works