From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Andreas =?UTF-8?Q?R=C3=B6hler?= Newsgroups: gmane.emacs.bugs Subject: bug#15485: add-abbrev: don't use hard-coded forward-word Date: Thu, 15 Aug 2019 16:37:16 +0200 Message-ID: <1e93bdc1-a85a-b189-8a15-ab5b4441fcf9@easy-emacs.de> References: <524849DB.4090407@easy-emacs.de> <87pnl73y3n.fsf@mouse.gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------4D39560839D0609198F61CC4" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="97716"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 Cc: 15485@debbugs.gnu.org To: Mauro Aranda , Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 15 16:35:20 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hyGqV-000P7q-UU for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Aug 2019 16:35:20 +0200 Original-Received: from localhost ([::1]:42572 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hyGqU-0003T5-HP for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Aug 2019 10:35:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56637) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hyGqJ-0003Sf-59 for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 10:35:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hyGqE-0001Cm-RK for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 10:35:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43302) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hyGqE-0001C2-Mr for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 10:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hyGqE-0001sS-HT for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 10:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Aug 2019 14:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15485 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix Original-Received: via spool by 15485-submit@debbugs.gnu.org id=B15485.15658796857190 (code B ref 15485); Thu, 15 Aug 2019 14:35:02 +0000 Original-Received: (at 15485) by debbugs.gnu.org; 15 Aug 2019 14:34:45 +0000 Original-Received: from localhost ([127.0.0.1]:52123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyGpx-0001ru-Ao for submit@debbugs.gnu.org; Thu, 15 Aug 2019 10:34:45 -0400 Original-Received: from mout.kundenserver.de ([212.227.17.10]:44843) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyGpv-0001rd-Fj for 15485@debbugs.gnu.org; Thu, 15 Aug 2019 10:34:44 -0400 Original-Received: from [192.168.178.39] ([87.123.193.193]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MiIlc-1iSfhS1xRe-00fTRI; Thu, 15 Aug 2019 16:34:36 +0200 In-Reply-To: Content-Language: en-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KICXr6ShtaIZ7UBq7yDewp8hv X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:165097 Archived-At: This is a multi-part message in MIME format. --------------4D39560839D0609198F61CC4 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi all, On 15.08.19 14:41, Mauro Aranda wrote: > Hello Lars. > > Lars Ingebrigtsen > writes: > > > Andreas Röhler > writes: > > > >> add-abbrev uses forward-word to catch the expansion, which isn't good > >> for programming code. > >> > >> See > >> > >> > http://stackoverflow.com/questions/19073674/how-can-i-add-my-personal-abbreviation-to-emmet-mode-in-emacs/19079683#19079683 > >> > >> Suggest to use forward-symbol instead, or still better to make if > customizable: > > > > `add-abbrev' doesn't have a doc string itself, but as all the in-tree > > callers of this function says: > > > > --- > > Don't use this function in a Lisp program; use `define-abbrev' instead. > > --- > > > > So you probably shouldn't use this programmatically, either. > > I don't think the OP wanted to use `add-abbrev' in a Lisp program.  What > I understand is that the problem reported arises when someone wants to > add an abbrev for a programming construct (in the example: "") > it is likely that `add-abbrev' won't give the entire desired > expansion. > > With that being said, at least in current Emacs it is easy to add that > abbrev, by setting the mark and point properly and calling > `add-mode-abbrev' with a 0 prefix argument. > > > However, it's possible that the `forward-word' should perhaps be > > changed, but on the other hand, abbrev.el will probably be deprecated > > any year now in favour of nabbrev.el, so I don't think it's a good idea > > What is nabbrev.el?  I did a search in what I believe are usual places, > but didn't found anything. The idea was to get rid of the restriction only word-syntax chars might compose an abbreviation. After all, when playing with a patched Emacs allowing all chars, it turned out word-chars are much more easy to type, so didn't use symbol-composed abbrevs finally. --------------4D39560839D0609198F61CC4 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Hi all,

On 15.08.19 14:41, Mauro Aranda wrote:
Hello Lars.

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>
>> add-abbrev uses forward-word to catch the expansion, which isn't good
>> for programming code.
>>
>> See
>>
>> http://stackoverflow.com/questions/19073674/how-can-i-add-my-personal-abbreviation-to-emmet-mode-in-emacs/19079683#19079683
>>
>> Suggest to use forward-symbol instead, or still better to make if customizable:
>
> `add-abbrev' doesn't have a doc string itself, but as all the in-tree
> callers of this function says:
>
> ---
> Don't use this function in a Lisp program; use `define-abbrev' instead.
> ---
>
> So you probably shouldn't use this programmatically, either.

I don't think the OP wanted to use `add-abbrev' in a Lisp program.  What
I understand is that the problem reported arises when someone wants to
add an abbrev for a programming construct (in the example: "<?php ?>")
it is likely that `add-abbrev' won't give the entire desired
expansion.

With that being said, at least in current Emacs it is easy to add that
abbrev, by setting the mark and point properly and calling
`add-mode-abbrev' with a 0 prefix argument.

> However, it's possible that the `forward-word' should perhaps be
> changed, but on the other hand, abbrev.el will probably be deprecated
> any year now in favour of nabbrev.el, so I don't think it's a good idea

What is nabbrev.el?  I did a search in what I believe are usual places,
but didn't found anything.


The idea was to get rid of the restriction only word-syntax chars might compose an abbreviation.

After all, when playing with a patched Emacs allowing all chars, it turned out word-chars are much more easy to type, so didn't use symbol-composed abbrevs finally.

--------------4D39560839D0609198F61CC4--