From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: non word abbrevs Date: Sat, 06 Nov 2021 18:32:59 -0400 Message-ID: References: <2F7AC7B8-48AA-4BF3-B5AA-A4141F248109@traduction-libre.org> <4097001A-F60D-4712-B828-EA778BFCF56E@traduction-libre.org> <2067AA83-8EC0-4429-9189-9E3CCCFD06BB@traduction-libre.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34422"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: help-gnu-emacs To: Jean-Christophe Helary Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 06 23:34:18 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mjUGP-0008kz-SU for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 06 Nov 2021 23:34:18 +0100 Original-Received: from localhost ([::1]:44820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjUGO-00068X-Sw for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 06 Nov 2021 18:34:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjUFQ-00062o-Ty for help-gnu-emacs@gnu.org; Sat, 06 Nov 2021 18:33:17 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:53973) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjUFM-0008Et-6b for help-gnu-emacs@gnu.org; Sat, 06 Nov 2021 18:33:15 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id AB59180512; Sat, 6 Nov 2021 18:33:08 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id DD5CB8054C; Sat, 6 Nov 2021 18:33:06 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1636237986; bh=oBbBqwC/CiVwcL7itSqoJgwjaK1Vfrt9DBsEoYBtZ/Q=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=VAQLSRdqLa6VUh/46JfKTtObcf6Ac7qXFf+icSs81TSwB9SmjXGwkw6PtKUE0TSqX K5njhxyzKoTBZxXZe4+JCYaJyBoRFIsSQ2HgRxqCMgbj5VaAwx172FUNCU38EO3QUK M/g9xjFp03uWWE+HpkJyqq/m2QsxMLozNk8d3J6oO6Ewgkln/HHQL6lD2oQOjv2POA Z8c0N6efsyqz8RkhNs6VHNGtuvU+TKTVThlPdk/ynItbz8uyO9CsBnVX6B1W0Cu+LC kleRftFjb7hcfRryW1yqU9chYJdHxLnkXXeVjS3Lscahci8es0efKWkQyu2vE5Pzvs 9cdvSpftV5I0w== Original-Received: from pastel (unknown [45.72.241.23]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B2B88120432; Sat, 6 Nov 2021 18:33:06 -0400 (EDT) In-Reply-To: <2067AA83-8EC0-4429-9189-9E3CCCFD06BB@traduction-libre.org> (Jean-Christophe Helary's message of "Sat, 6 Nov 2021 17:20:58 +0900") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:134422 Archived-At: Jean-Christophe Helary [2021-11-06 17:20:58] wrote: > Ok, so this time I try your regexp (thank you by the way): >> On Nov 1, 2021, at 21:13, Jean-Christophe Helary wrote: > (define-abbrev-table 'arrows-abbrev-table > '(("->" "=E2=86=92") > ("<-" "=E2=86=90") > ("<->" "=E2=87=86") > ("=3D=3D>" "=E2=87=92") > ("<=3D=3D" "=E2=87=90") > ("<=3D>" "=E2=87=94") > ) > "Arrows as defined on my macOS side." > :regexp "[^<>=3D-]\\([<>=3D-]+\\)") > > (setq local-abbrev-table arrows-abbrev-table) > > and I have the abbrev-mode enabled in the *scratch* buffer where I run > that, and nothing happens when I type -> for ex... =F0=9F=98=A2 I tried the above and then `M-x expand-abbrev` and it worked for my test case, so I guess the problem is in the auto-triggering of abbrevs down in `self-insert-command`. And indeed I see: if (!NILP (BVAR (current_buffer, abbrev_mode)) && synt !=3D Sword && NILP (BVAR (current_buffer, read_only)) && PT > BEGV && (SYNTAX (!NILP (BVAR (current_buffer, enable_multibyte_character= s)) ? XFIXNAT (Fprevious_char ()) : UNIBYTE_TO_CHAR (XFIXNAT (Fprevious_char ()))) =3D=3D Sword)) so it looks like the "auto expand abbrev" feature only works right after a word char, so basically only works for abbrevs whose last char has word syntax. You might want to `M-x report-emacs-bug` and request that this constraint be made more flexible. Stefan