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

Previous Next

Package: emacs;

Reported by: Alexander Prähauser <ahprae <at> protonmail.com>

Date: Sun, 22 Jun 2025 14:18:02 UTC

Severity: wishlist

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Alexander Prähauser <ahprae <at> protonmail.com>
Subject: bug#78863: closed (Re: bug#78863: 31.0.50; Feature request: add
 option for greedy looking-back to abbrev-before-point)
Date: Sat, 28 Jun 2025 09:56:04 +0000
[Message part 1 (text/plain, inline)]
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 78863 <at> debbugs.gnu.org.

-- 
78863: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78863
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Alexander Prähauser <ahprae <at> protonmail.com>
Cc: 78863-done <at> debbugs.gnu.org
Subject: Re: bug#78863: 31.0.50;
 Feature request: add option for greedy looking-back to
 abbrev-before-point
Date: Sat, 28 Jun 2025 12:54:55 +0300
> Date: Mon, 23 Jun 2025 16:26:55 +0000
> From: Alexander Prähauser <ahprae <at> protonmail.com>
> Cc: 78863 <at> debbugs.gnu.org
> 
> "Eli Zaretskii" <eliz <at> gnu.org> 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.

[Message part 3 (message/rfc822, inline)]
From: Alexander Prähauser <ahprae <at> protonmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; Feature request: add option for greedy looking-back to
 abbrev-before-point
Date: Sun, 22 Jun 2025 14:17:15 +0000
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.




This bug report was last modified 56 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.