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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Alexander Prähauser <ahprae@HIDDEN>; dated Sun, 22 Jun 2025 14:18:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 78863 <at> debbugs.gnu.org:


Received: (at 78863) by debbugs.gnu.org; 23 Jun 2025 11:20:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 23 07:20:18 2025
Received: from localhost ([127.0.0.1]:54609 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uTfDj-0006u5-7n
	for submit <at> debbugs.gnu.org; Mon, 23 Jun 2025 07:20:18 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:45390)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uTfDd-0006rv-Sn
 for 78863 <at> debbugs.gnu.org; Mon, 23 Jun 2025 07:20:13 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1uTfDX-0000MQ-2H; Mon, 23 Jun 2025 07:20:04 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=KjSb+Vp3Pj1AFKzKVw6gBHD+XEUJ46lCMRLQY9Dl7Dg=; b=nFo+0Sl0e45olpCw9jil
 ZWEJ91wAyb8c5QRlGLHewpisZlLE1RuMzYva30JlFSJG80OGaPnww2sBrsCl+85jr9l5bLvJF4Yb9
 uA1SncDMAxAn8hSaHraxsyA04Gm2sIGRSfEMRkMQEYgzALgAkafwqgrCzyLIzEZ3Qt+1MHwajapoU
 r6FkFd2IA/d3N7h9ILpD+8yKd0S39hGXhux2wlwNFEGerU1ek+V9LT2GqL/pDEaZaTqie3og4dNyJ
 MtQLZcy9kR+O2uhhDPocCmjmSeHgzXleAHw+qkGIHJlUZBnb3gB/t/bMd2VUE+Iptd1BSwgY6tcZP
 jSBUNC9VhIoDSQ==;
Date: Mon, 23 Jun 2025 14:19:45 +0300
Message-Id: <86ms9yg0xa.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alexander =?utf-8?Q?Pr=C3=A4hauser?= <ahprae@HIDDEN>
In-Reply-To: <87frfrtxcu.fsf@HIDDEN> (message from Alexander
 =?utf-8?Q?Pr=C3=A4hauser?= on Sun, 22 Jun 2025 19:00:51 +0000)
Subject: Re: bug#78863: 31.0.50;
 Feature request: add option for greedy looking-back to
 abbrev-before-point
References: <87ecvb3lp4.fsf@HIDDEN> <864iw7hllk.fsf@HIDDEN>
 <87o6ufu3qq.fsf@HIDDEN> <86y0tjfxm4.fsf@HIDDEN>
 <87frfrtxcu.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 78863
Cc: 78863 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

[Please use Reply All to reply, to keep the bug tracker CC'd.]

> Date: Sun, 22 Jun 2025 19:00:51 +0000
> From: Alexander Prähauser <ahprae@HIDDEN>
> 
> "Eli Zaretskii" <eliz@HIDDEN> writes:
> 
> >> Date: Sun, 22 Jun 2025 16:42:59 +0000
> >> From: Alexander Prähauser <ahprae@HIDDEN>
> >> Cc: 78863 <at> debbugs.gnu.org
> >>
> >> "Eli Zaretskii" <eliz@HIDDEN> writes:
> >>
> >> >> Date: Sun, 22 Jun 2025 14:17:15 +0000
> >> >> From:  Alexander Prähauser via "Bug reports for GNU Emacs,
> >> >>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> >> >>
> >> >>
> >> >> 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
> >> >
> >> > This is because by default, word motion stops at the character-script
> >> > boundaries.  But you could override that by suitable changes to
> >> > word-combining-categories, which see.  Did you try that?
> >>
> >> Yeah, but I wasn't very successful. I changed the syntax-class of ∀ to
> >> "w", which lets `backward-word' consider ∀ a word-constituent, but then
> >> `backward-word' stops between the o and the ∀ in o∀. I tried to set
> >> other syntactic properties of ∀  equal to those of o using
> >> `put-char-code-property' but that didn't work either. Looking into it
> >> deeper I suspected that it was because the two belong to different
> >> categories as you say, so I used `char-category-set' and
> >> `modify-category-entry' to add and remove
> >> the categories of ∀ until it had the same categories as o, but
> >> `forward-word' still stopped between the two characters. I have no idea
> >> why.
> >
> > I told you: it's a feature.  See the doc string of forward-word.
> >
> >> At that point I gave up and decided to use a regexp. I'd actually
> >> like to know why it didn't work with all categories set equally but I'm
> >> a bit out of my depth here. I can read lisp and use edebug to track what
> >> happens in lisp-code, but `forward-word' and the function it uses to
> >> determine word-boundaries are C-primitives and I know next to no C. I
> >> tried following the source code but, again, I have no clue why it didn't
> >> work after I equalized the categories. Maybe because I only did it for
> >> the category table of the local buffer (which was *scratch*)?
> >
> > As I told, the way to affect this is to modify the list in
> > word-combining-categories so that a position between latin and symbol
> > script is not considered a border that requires forward-word to stop.
> > Both latin and symbol have known categories (see "M-x describe-categories")
> > so you could use them to customize word-combining-categories.  Its doc
> > string is supposed to explain how; feel free to ask question if it
> > isn't clear enough.
> 
> Oh, I see what you mean now! Thanks, I think this is working!
> 
> I read the documentation of `word-combining-categories' but what
> confused me was that each character has many categories, so I didn't
> know which one to add (which is why I tried to set them equal until I
> found the right one). But now I see what's meant here:
> 
> "Emacs finds no word boundary between characters of different scripts
> if they have categories matching some element of this list.
> 
> More precisely, if an element of this list is a cons of category CAT1
> and CAT2, and a multibyte character C1 which has CAT1 is followed by
> C2 which has CAT2, there's no word boundary between C1 and C2."
> 
> So if any of the categories of C1 is CAT1 and any of the categories in
> C2 is CAT2 there is no boundary in a string C1C2 but there is one in a
> string C2C1. I think I get it now. Thanks again!

Yes, exactly.

Does this mean we can close this bug?  Or would you still like to
discuss the extension of the regexp specifications of abbrevs?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78863; Package emacs. Full text available.

Message received at 78863 <at> debbugs.gnu.org:


Received: (at 78863) by debbugs.gnu.org; 22 Jun 2025 18:19:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 22 14:19:16 2025
Received: from localhost ([127.0.0.1]:49737 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uTPHf-00005Q-Et
	for submit <at> debbugs.gnu.org; Sun, 22 Jun 2025 14:19:16 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:60224)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uTPHd-0008Vv-C2
 for 78863 <at> debbugs.gnu.org; Sun, 22 Jun 2025 14:19:14 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1uTPHW-00061P-Lu; Sun, 22 Jun 2025 14:19:06 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=/XpF4VW46sWRt8hm19SIIVvoAxwxtZHVDikRiZi4vAw=; b=ICJ5oqbJbZy49+7NtGfG
 CJegSm0geo7EUBtKGkFoVPlEegFLeVLptynpZ0+vuu+/eEjVDOT1P8XfIZU83WqbJtLQy0plWh4rp
 2mrNDQGl8vuB9Af5VuzsWxSKwJx71a0fPjrpGmp2GCrFZYNQLqoUWrafN3BmvAof3jgh1gkOJ2J2o
 O54PMxXJeYwp08myBWp8/mxyVKFiaWiPnHp4viFUKVNKIa2AL8gZ3TD6LmAWWiBcAKNphwQhrZfK3
 fLyo/qvnEgf539j0Z0S36lWJ26m/DojAXyWY9gJ1pM+pJB6RzKqT15mMaph4L5gsW80VdhGc5M6+T
 xUtU+6f0MntX2w==;
Date: Sun, 22 Jun 2025 21:18:59 +0300
Message-Id: <86y0tjfxm4.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alexander =?utf-8?Q?Pr=C3=A4hauser?= <ahprae@HIDDEN>
In-Reply-To: <87o6ufu3qq.fsf@HIDDEN> (message from Alexander
 =?utf-8?Q?Pr=C3=A4hauser?= on Sun, 22 Jun 2025 16:42:59 +0000)
Subject: Re: bug#78863: 31.0.50;
 Feature request: add option for greedy looking-back to
 abbrev-before-point
References: <87ecvb3lp4.fsf@HIDDEN> <864iw7hllk.fsf@HIDDEN>
 <87o6ufu3qq.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 78863
Cc: 78863 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Sun, 22 Jun 2025 16:42:59 +0000
> From: Alexander Prähauser <ahprae@HIDDEN>
> Cc: 78863 <at> debbugs.gnu.org
> 
> "Eli Zaretskii" <eliz@HIDDEN> writes:
> 
> >> Date: Sun, 22 Jun 2025 14:17:15 +0000
> >> From:  Alexander Prähauser via "Bug reports for GNU Emacs,
> >>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> >>
> >>
> >> 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
> >
> > This is because by default, word motion stops at the character-script
> > boundaries.  But you could override that by suitable changes to
> > word-combining-categories, which see.  Did you try that?
> 
> Yeah, but I wasn't very successful. I changed the syntax-class of ∀ to
> "w", which lets `backward-word' consider ∀ a word-constituent, but then
> `backward-word' stops between the o and the ∀ in o∀. I tried to set
> other syntactic properties of ∀  equal to those of o using
> `put-char-code-property' but that didn't work either. Looking into it
> deeper I suspected that it was because the two belong to different
> categories as you say, so I used `char-category-set' and
> `modify-category-entry' to add and remove
> the categories of ∀ until it had the same categories as o, but
> `forward-word' still stopped between the two characters. I have no idea
> why.

I told you: it's a feature.  See the doc string of forward-word.

> At that point I gave up and decided to use a regexp. I'd actually
> like to know why it didn't work with all categories set equally but I'm
> a bit out of my depth here. I can read lisp and use edebug to track what
> happens in lisp-code, but `forward-word' and the function it uses to
> determine word-boundaries are C-primitives and I know next to no C. I
> tried following the source code but, again, I have no clue why it didn't
> work after I equalized the categories. Maybe because I only did it for
> the category table of the local buffer (which was *scratch*)?

As I told, the way to affect this is to modify the list in
word-combining-categories so that a position between latin and symbol
script is not considered a border that requires forward-word to stop.
Both latin and symbol have known categories (see "M-x describe-categories")
so you could use them to customize word-combining-categories.  Its doc
string is supposed to explain how; feel free to ask question if it
isn't clear enough.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78863; Package emacs. Full text available.

Message received at 78863 <at> debbugs.gnu.org:


Received: (at 78863) by debbugs.gnu.org; 22 Jun 2025 16:43:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 22 12:43:13 2025
Received: from localhost ([127.0.0.1]:49627 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uTNmi-0006Xv-Sa
	for submit <at> debbugs.gnu.org; Sun, 22 Jun 2025 12:43:13 -0400
Received: from mail-10631.protonmail.ch ([79.135.106.31]:59395)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ahprae@HIDDEN>)
 id 1uTNmg-0006Wj-4Y
 for 78863 <at> debbugs.gnu.org; Sun, 22 Jun 2025 12:43:10 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
 s=protonmail3; t=1750610583; x=1750869783;
 bh=47XmlQ7XhmnI0fqpeUXwZzm2Fj5lD8jZs6Ym1tJ627s=;
 h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References:
 Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:
 Message-ID:BIMI-Selector;
 b=JIhzCPeRIymqXyQxRag5gv9cFuk9xMK4ps1qoduOGbtyyDpnajb+x0UEC11L+Naym
 MaOJYQE2oo5AJnDTHksSUYlnYyjY56cL1hW8bN0N9iXFFP+WMaSiq1vH8D5Jcf3/iW
 hruevyKTHMqbwMItQctuyPhZndNE4EWy0FgDCAoXff7GGIANqQT1nUMdUu+mVtETCi
 3eXWL/wk35AKaqiiSS+1clJ4VIwz8Vw8qxA7zFbGQDBg1AWWp90rEJrVWRo+Xt+Iau
 qvfXfZTQC/rDaZfxrJgwn00CrrmnpJkgLRJhyI0JByha2bZj69Dg2uLVDnYDUZKMYo
 PTcn300aWR/Fg==
Date: Sun, 22 Jun 2025 16:42:59 +0000
To: Eli Zaretskii <eliz@HIDDEN>
From: =?utf-8?Q?Alexander_Pr=C3=A4hauser?= <ahprae@HIDDEN>
Subject: Re: bug#78863: 31.0.50;
 Feature request: add option for greedy looking-back to
 abbrev-before-point
Message-ID: <87o6ufu3qq.fsf@HIDDEN>
In-Reply-To: <864iw7hllk.fsf@HIDDEN>
References: <87ecvb3lp4.fsf@HIDDEN> <864iw7hllk.fsf@HIDDEN>
Feedback-ID: 39886207:user:proton
X-Pm-Message-ID: 0d46e185d1c17d83c7e8046775fb92627a201973
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -1.0 (-)
X-Debbugs-Envelope-To: 78863
Cc: 78863 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.0 (--)

"Eli Zaretskii" <eliz@HIDDEN> writes:

>> Date: Sun, 22 Jun 2025 14:17:15 +0000
>> From:  Alexander Pr=C3=A4hauser via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
>>
>>
>> This is a feature request: I have a keyboard layout with many Unicode
>> symbols like =E2=88=80 and such, which I would like to define abbrevs wi=
th, so
>> for instance I would like to define "o=E2=88=80" to expand to "overall".=
 This
>> doesn't work when the abbrev is isolated using backward-word
>
> This is because by default, word motion stops at the character-script
> boundaries.  But you could override that by suitable changes to
> word-combining-categories, which see.  Did you try that?

Yeah, but I wasn't very successful. I changed the syntax-class of =E2=88=
=80 to
"w", which lets `backward-word' consider =E2=88=80 a word-constituent, but =
then
`backward-word' stops between the o and the =E2=88=80 in o=E2=88=80. I trie=
d to set
other syntactic properties of =E2=88=80  equal to those of o using
`put-char-code-property' but that didn't work either. Looking into it
deeper I suspected that it was because the two belong to different
categories as you say, so I used `char-category-set' and
`modify-category-entry' to add and remove
the categories of =E2=88=80 until it had the same categories as o, but
`forward-word' still stopped between the two characters. I have no idea
why. At that point I gave up and decided to use a regexp. I'd actually
like to know why it didn't work with all categories set equally but I'm
a bit out of my depth here. I can read lisp and use edebug to track what
happens in lisp-code, but `forward-word' and the function it uses to
determine word-boundaries are C-primitives and I know next to no C. I
tried following the source code but, again, I have no clue why it didn't
work after I equalized the categories. Maybe because I only did it for
the category table of the local buffer (which was *scratch*)?





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78863; Package emacs. Full text available.

Message received at 78863 <at> debbugs.gnu.org:


Received: (at 78863) by debbugs.gnu.org; 22 Jun 2025 15:01:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 22 11:01:27 2025
Received: from localhost ([127.0.0.1]:49241 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uTMCE-0006AS-Vd
	for submit <at> debbugs.gnu.org; Sun, 22 Jun 2025 11:01:27 -0400
Received: from mail-10631.protonmail.ch ([79.135.106.31]:56127)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ahprae@HIDDEN>)
 id 1uTMCC-00068u-BQ
 for 78863 <at> debbugs.gnu.org; Sun, 22 Jun 2025 11:01:25 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
 s=protonmail3; t=1750604477; x=1750863677;
 bh=2KV25D47WLdCrkePBz58U1CpY6lrCEZtvM7utawWAy8=;
 h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date:
 Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector;
 b=vFUNWCmMQR0biabM6pngbsgE8Hi5ng31TyuVD9rJyi5I/siOtA557cNq70QBCTdST
 ELe63UJKwWZLiscGanZxQ9FagfOLgASjMsf13qc/18O9JsWs9Hh0dhJcqxzBIAB3g9
 6nJObuZoXCVvbWUkOa+MDbVoPdL2CR2+0Lk2Tyytt0/zdzSG+sLLs1rHLXsjFd1na4
 ewccpTxmLbnK4+JKp82thrH2AhXLt+X6uEVZlPANeInmU5mWybjTMqEe7HZ2J0WoNs
 JGJ7jibc+FOHR7tI8iLJNt8W4EwGWcD/4R5EElVDMvOPGghDy1ciTUz2zWneNLe984
 VmRFW0tDu8Zeg==
Date: Sun, 22 Jun 2025 15:01:14 +0000
To: 78863 <at> debbugs.gnu.org
From: =?utf-8?Q?Alexander_Pr=C3=A4hauser?= <ahprae@HIDDEN>
Subject: Re: Feature request: add option for greedy looking-back to
 abbrev-before-point
Message-ID: <871prb3jnr.fsf@HIDDEN>
Feedback-ID: 39886207:user:proton
X-Pm-Message-ID: 884644fb9f1b29da5f92ee03cb9cd2a83f3d31f8
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -1.0 (-)
X-Debbugs-Envelope-To: 78863
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.0 (--)


This is really stupid, but I just realized that I can use something like

(rx (or space "-" "_" "\n" line-start string-start)
      (group (* (not (or space "-" "_" "\n")))))

for matching, which works. Sorry for overlooking that. So that kind of
lessens the importance of adding an option along the lines I described,
though it might make it less confusing for people wondering why their
abbrevs don't seem to match.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78863; Package emacs. Full text available.

Message received at 78863 <at> debbugs.gnu.org:


Received: (at 78863) by debbugs.gnu.org; 22 Jun 2025 14:56:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 22 10:56:07 2025
Received: from localhost ([127.0.0.1]:49214 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uTM74-0005Eu-Su
	for submit <at> debbugs.gnu.org; Sun, 22 Jun 2025 10:56:07 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:42302)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uTM72-0005E0-EM
 for 78863 <at> debbugs.gnu.org; Sun, 22 Jun 2025 10:56:04 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1uTM6u-0007ss-TO; Sun, 22 Jun 2025 10:55:57 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=+biypmuMejsLwke00zWdO/RbyKln/tYbd/neLM8DT4A=; b=VxlygghG8LPIuK/spNxj
 NyL81FUJJWW8SDQhvy+TK+3CThlRj5XYKMNxY1RgeOULv/TYiLc1ufiDDTBr/KvQELK6n500TT4P7
 mYq+BXivgFmR6W96+2ZXZ2iuZ3il0I4q3yfV1aWDxuya+m7rORorEexw/H+Ua87RVFtHHXFgcltjC
 g3DONiljjU0yADC6/UX8WILeNxDLx0IIEFrUnHuRPWxChjbMbKt7LOqR3COPMalcJonuPcMYfvXbg
 eXlyfcFdqCgl6fTUE6A5ViLNZXkcLpptTzZ7mTH9aSIDnAHghq3WBS4C17+JGki4dCNMaM+qg/PCq
 yMlCvArNMbWVjw==;
Date: Sun, 22 Jun 2025 17:55:35 +0300
Message-Id: <864iw7hllk.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alexander =?utf-8?Q?Pr=C3=A4hauser?= <ahprae@HIDDEN>
In-Reply-To: <87ecvb3lp4.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#78863: 31.0.50;
 Feature request: add option for greedy looking-back to
 abbrev-before-point
References: <87ecvb3lp4.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 78863
Cc: 78863 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Sun, 22 Jun 2025 14:17:15 +0000
> From:  Alexander Prähauser via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> 
> 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

This is because by default, word motion stops at the character-script
boundaries.  But you could override that by suitable changes to
word-combining-categories, which see.  Did you try that?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78863; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 22 Jun 2025 14:17:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 22 10:17:38 2025
Received: from localhost ([127.0.0.1]:49003 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uTLVp-00075O-Ro
	for submit <at> debbugs.gnu.org; Sun, 22 Jun 2025 10:17:38 -0400
Received: from lists.gnu.org ([2001:470:142::17]:34478)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ahprae@HIDDEN>)
 id 1uTLVn-00074z-Qm
 for submit <at> debbugs.gnu.org; Sun, 22 Jun 2025 10:17:36 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ahprae@HIDDEN>)
 id 1uTLVg-0007J4-OC
 for bug-gnu-emacs@HIDDEN; Sun, 22 Jun 2025 10:17:29 -0400
Received: from mail-0201.mail-europe.com ([51.77.79.158])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ahprae@HIDDEN>)
 id 1uTLVf-0001LC-2O
 for bug-gnu-emacs@HIDDEN; Sun, 22 Jun 2025 10:17:28 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
 s=protonmail3; t=1750601840; x=1750861040;
 bh=OSBF/q+6yuxbAstboC7sohkMlI58YbNjVhIFOg+3RVw=;
 h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date:
 Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector;
 b=cVWCSUhCpTaEmYRfqb0nw25gxW1nOcciF+OFDsnxDDqf7RQnTUvHtmfnlwr1/PzmH
 88bL1uoj3vf36JJSRpR1H50fFMBOcvdPAfkZYW6f2JkKwqtex2Kr9VtSqktoqMhtBg
 ZISlbraw2B5V/s57Lx7K1RgQMzdKKNbUXUjrI/w05kXd6TnhaaQZalLYxAf075Wxu6
 6zSb4dsb88bsMma5tVZp6ig9trO0Dy/6vHKNq8oJvriOpf52L132GY/UP8YA/Wfb7i
 y7WcoZKb/hrTJNCjF6Z6LX1lwq9KZRXLH+rGfCK12045TbNqz4ymnBTuh6rn4nhzUw
 oikPyvqi/SLwA==
Date: Sun, 22 Jun 2025 14:17:15 +0000
To: bug-gnu-emacs@HIDDEN
From: =?utf-8?Q?Alexander_Pr=C3=A4hauser?= <ahprae@HIDDEN>
Subject: 31.0.50; Feature request: add option for greedy looking-back to
 abbrev-before-point
Message-ID: <87ecvb3lp4.fsf@HIDDEN>
Feedback-ID: 39886207:user:proton
X-Pm-Message-ID: b5218f247cdd377ad2395bce9c0e13147a373094
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=51.77.79.158; envelope-from=ahprae@HIDDEN;
 helo=mail-0201.mail-europe.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)


This is a feature request: I have a keyboard layout with many Unicode
symbols like =E2=88=80 and such, which I would like to define abbrevs with,=
 so
for instance I would like to define "o=E2=88=80" to expand to "overall". Th=
is
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.





Acknowledgement sent to Alexander Prähauser <ahprae@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#78863; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 23 Jun 2025 11:30:04 UTC

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