Subject: bug#78863: closed (Re: bug#78863: 31.0.50; Feature request: add option for greedy looking-back to abbrev-before-point)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 28 Jun 2025 09:56:04 +0000

Your bug report

#78863: 31.0.50; Feature request: add option for greedy looking-back to abbrev-before-point

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
78863: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78863
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#78863: 31.0.50; Feature request: add option for greedy looking-back to abbrev-before-point
From: Eli Zaretskii <[email-masked]>
To: Alexander Prähauser <[email-masked]>
Cc: [email-masked]
Date: Sat, 28 Jun 2025 12:54:55 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> Date: Mon, 23 Jun 2025 16:26:55 +0000
> From: Alexander Prähauser <[email-masked]>
> Cc: [email-masked]
> 
> "Eli Zaretskii" <[email-masked]> writes:
> 
> > [Please use Reply All to reply, to keep the bug tracker CC'd.]
> 
> Oh, sorry, I meant to.
> 
> > Does this mean we can close this bug?  Or would you still like to
> > discuss the extension of the regexp specifications of abbrevs?
> 
> You can as far as I'm concerned. I'm legitimately unsure whether it
> would be useful for other people to have the option I described, but
> with these tools already in place I think it's probably unnecessary.

OK, so closing the bug.

Subject: 31.0.50; Feature request: add option for greedy looking-back to abbrev-before-point
From: Alexander Prähauser <[email-masked]>
To: [email-masked]
Date: Sun, 22 Jun 2025 14:17:15 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

This is a feature request: I have a keyboard layout with many Unicode
symbols like ∀ and such, which I would like to define abbrevs with, so
for instance I would like to define "o∀" to expand to "overall". This
doesn't work when the abbrev is isolated using backward-word, but can be
implemented using the :regexp property of `define-abbrev-table'. I would
like to define many such mixed abbrevs this way, using a regexp like

(rx (group (* (not (or space "-" "_")))))

to isolate abbrevs. The trouble is that `abbrev--before-point' uses

(looking-back re (line-beginning-position))

to isolate an abbrev when a regexp is given, which matches non-greedily.
This could be fixed fairly easily from my understanding by providing an
optional argument to `expand-abbrev' that sets the GREEDY argument of
`looking-back', which would cause `looking-back' to match greedily. I'm
guessing that this would make `looking-back' even slower but it would be
optional and a modern machine should be able to handle the matching, I'd
guess. And it would make the :regexp property of abbrev-tables a lot
more useful, I'd say.