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: Alexander Prähauser <ahprae <at> protonmail.com>
To: 78863 <at> debbugs.gnu.org
Subject: bug#78863: 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.