From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Kevin Vigouroux via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help Subject: Re: non word abbrevs Date: Mon, 08 Nov 2021 06:36:13 +0100 Message-ID: <87v913nr8y.fsf@laposte.net> 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> <976C9A57-FA22-4E47-AF16-C1B20C66E451@traduction-libre.org> Reply-To: Kevin Vigouroux 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="28194"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 08 06:37:37 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 1mjxLd-00078W-50 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 08 Nov 2021 06:37:37 +0100 Original-Received: from localhost ([::1]:42444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjxLb-0000nb-AK for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 08 Nov 2021 00:37:35 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjxKa-0000nS-Pm for help-gnu-emacs@gnu.org; Mon, 08 Nov 2021 00:36:32 -0500 Original-Received: from smtp-outgoing-1803.laposte.net ([160.92.124.104]:40080) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjxKY-0002al-6x for help-gnu-emacs@gnu.org; Mon, 08 Nov 2021 00:36:32 -0500 X-mail-filterd: {"version":"1.3.4", "queueID":"4Hnfwt4ws6zdZLg", "contextId":"9e3c8843-29fd-4d03-b5b3-19c92d9fb15c"} Original-Received: from outgoing-mail.laposte.net (localhost.localdomain [127.0.0.1]) by mlpnf0106.laposte.net (SMTP Server) with ESMTP id 4Hnfwt4ws6zdZLg for ; Mon, 8 Nov 2021 06:36:14 +0100 (CET) X-mail-filterd: {"version":"1.3.4", "queueID":"4Hnfwt26cxzdZLZ", "contextId":"4f03715c-44ad-4908-bc0f-02bc4083b215"} X-lpn-mailing: LEGIT X-lpn-spamrating: 50 X-lpn-spamlevel: not-spam X-lpn-spamcause: OK, (0)(0000)gggruggvucftvghtrhhoucdtuddrgedvuddruddugdektdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfntefrqffuvffgpdggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufhfffgjkfgfgggtgfesthhqredttderjeenucfhrhhomhepmfgvvhhinhcugghighhouhhrohhugicuoehkvgdrvhhighhouhhrohhugieslhgrphhoshhtvgdrnhgvtheqnecuggftrfgrthhtvghrnhepkeetjeetffegveeggeeugeekfeegkeefgedttdevhfffjeegfeekgfefgfekledtnecukfhppeeltddrfedvrdduudefrddujedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledtrdefvddruddufedrudejtddphhgvlhhopegrrhgrghhoghdpmhgrihhlfhhrohhmpehkvgdrvhhighhouhhrohhugieslhgrphhoshhtvgdrnhgvthdprhgtphhtthhopehhvghlphdqghhnuhdqvghmrggtshesghhnuhdrohhrghdpmhhouggvpehsmhhtphhouhht Original-Received: from aragog (arennes-256-1-114-170.w90-32.abo.wanadoo.fr [90.32.113.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mlpnf0106.laposte.net (SMTP Server) with ESMTPSA id 4Hnfwt26cxzdZLZ for ; Mon, 8 Nov 2021 06:36:14 +0100 (CET) Mail-Followup-To: help-gnu-emacs@gnu.org In-Reply-To: (Jean-Christophe Helary's message of "Sun, 7 Nov 2021 12:24:27 +0900") DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=laposte.net; s=lpn-wlmd; t=1636349777; bh=S7Eowtd3IbMDpujHuJ5XGjzbReuyUG9gc+tAVOcg4Hk=; h=From:To:Subject:References:Date:In-Reply-To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; b=S2XTdAbD+S71W5fXAZgBWtWxZA0glCsYI2CByOIqQc/M9qWnCGl/bPv6V51hNKxOEnPKsznMdZlVlmsgKydv7CjKki4VpGUJr6GP55+KTuJMQmXD6+p+l4dmz5d1i4S4u/nps7KB8uFXA5qmaulOxdWGOs6aQ7vDBnLBv+yKHVktWaPkhtMW4l7e8Iw4rZ59JfC9VdjhS4/8MXCGzNfZffVkqvF2fy0U3ToGT6E1ZVpdfyCyNr847zPBhYLR7SIwUJ7PAq3Gw3ydbHWALUkMP5QyMrPcLLuOP5932Td2AKOl2mpXDUZOF9f5typhLBKtzkNTIkAWVuKMZ4v7v5Nl6g==; Received-SPF: pass client-ip=160.92.124.104; envelope-from=ke.vigouroux@laposte.net; helo=smtp-outgoing-1803.laposte.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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:134452 Archived-At: Jean-Christophe Helary writes: >> On Nov 7, 2021, at 12:15, Stefan Monnier via Users list for the GNU Emac= s text editor wrote: > >> Not completely: the original motivation for adding that `:regexp` >> keyword was to handle abbrevs of the form "`foo" as well as others of >> the form "foo/bar" ;-) > > And the overall feature seems severely under-documented... Honestly, I ba= rely understood your explanations... > > Maybe expecting to have abbrevs work way was a mistake, but it does not s= eem possible to have (easy...) arbitrary string expansion in out-of-the-box= -emacs without abbrevs. > > Would there be another more idiomatic way ? > I know about assigning key shortcuts to arbitrary string insertion, > but that needlessly fills the keymaps with shortcuts that could be put > to better use *and* the combination would be longer to enter than a > normal abbrev... > You can insert a Unicode character with `insert-char'. This does not shorten the typing but at least you can insert any character easily. In word processors, you can insert these characters if they are available in the dialog box called =E2=80=9CSpecial Characters=E2=80=9D. >>=20 >>>> You might want to `M-x report-emacs-bug` and request that this >>>> constraint be made more flexible. >>> I will. Thank you again. >>=20 >> In the mean time, you might be able to implement >> a `post-self-insert-hook` which runs expands your abbrevs. > > Christmas in November ? :-) > >> You could start with something like: >>=20 >> (add-hook 'post-self-insert-hook #'my-expand-arrow-abbrevs) >> (defun my-expand-arrow-abbrevs () >> (if (memq (char-before) '(?=3D ?< ?-)) >> (expand-abbrev))) > > I'll try that and will report. Thank you ! --=20 Best regards, Kevin Vigouroux