From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Mauro Aranda Newsgroups: gmane.emacs.bugs Subject: bug#15485: add-abbrev: don't use hard-coded forward-word Date: Thu, 15 Aug 2019 09:41:26 -0300 Message-ID: References: <524849DB.4090407@easy-emacs.de> <87pnl73y3n.fsf@mouse.gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000e07dd10590273154" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="151150"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 15485@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 15 14:42:15 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 1hyF53-000d5H-Oe for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Aug 2019 14:42:13 +0200 Original-Received: from localhost ([::1]:41564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hyF52-0008Lu-6q for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Aug 2019 08:42:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40905) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hyF4t-0008IR-Kr for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 08:42:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hyF4s-0007xX-3R for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 08:42:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41965) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hyF4r-0007xN-Vz for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 08:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hyF4r-0005A9-Ry for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 08:42:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Aug 2019 12:42:01 +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.156587290919827 (code B ref 15485); Thu, 15 Aug 2019 12:42:01 +0000 Original-Received: (at 15485) by debbugs.gnu.org; 15 Aug 2019 12:41:49 +0000 Original-Received: from localhost ([127.0.0.1]:50786 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyF4d-00059h-AC for submit@debbugs.gnu.org; Thu, 15 Aug 2019 08:41:49 -0400 Original-Received: from mail-lf1-f46.google.com ([209.85.167.46]:45774) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyF4a-00059S-H8 for 15485@debbugs.gnu.org; Thu, 15 Aug 2019 08:41:45 -0400 Original-Received: by mail-lf1-f46.google.com with SMTP id a30so1524952lfk.12 for <15485@debbugs.gnu.org>; Thu, 15 Aug 2019 05:41:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xA7+ACwK7IzfBO1TFMHouN7zHGhv63cKKwdIzO5Gw5Y=; b=XSb/h8BqQZI7v6UyZ09YNknkMIoux1RlqBGSe42ppO0Z2JwbA5w98+hPjdXRyOV+qH udhfqBDCvEDa464h8QRxOuEF+GfG+IyJWnKwzCcw05vYweYZUAznXGgjXzqb0f/gv72V xavd2yu5fsAcMWHVTQs/wUgfLynQEVDpEfYVpR7mIHD5wEsbDN5TTzIOP0bZp9o3Fx4K VCt1USPjQ8NEcg3TzCOX2d0OY+UquIdOtrhdtjK+fFcQ0J5WamN0wxG9SsdeDOgdUxLz 9P9BUUOg3nGd/+sIuX5mBDrKFV7M56b7sqIxr4WAQZA92MHHgR38JdrMLvo7XOkpUOag s6Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xA7+ACwK7IzfBO1TFMHouN7zHGhv63cKKwdIzO5Gw5Y=; b=OjCSHNYUinNtXMUeSS59kpLIknaYRw07ZroZyvLYm1ZQa7qCjeu0OJyRFy6gjO49DC DuFb26AJvifRhYSUstqdCeTiLBdebnLJ9LBfnjsL+wWIks8krh2H3/n1CF2DvnWS5Sry IejE0Yioy25188HUsqkqqLqCBoHbH0r9utBcx5TMgsEmkpKLz6F+dq6nXBgqyQyD+HD6 5fdswF37z4/bBrzskMd2o9J7pDg18qIHpje0VuS+A+OBoaqlpu5hmOqJhZDXvk7uC1z2 ccPfjL6rbCGQh5o2MXLD2CBZOV77A8ZX2te4np6oToxKlkysPjUBvD/K7LZTmuEF+8yt C+ug== X-Gm-Message-State: APjAAAXsdjtRI462S2PUWPQM2hV+pjgpLF7T0VpPWKFnaMb1ZjhDYACz ID50vm3IPHWkeKPvgBoTYn05DfScMo1j99fzh+w= X-Google-Smtp-Source: APXvYqzrgxuGCNqQvKG4D2yd8myn4QgFYe+GRH45cWMW/WBZ5ZxiqDYWJxZc7Lq3BeOrqT9xvFPbutE98j+Q0GLhxOo= X-Received: by 2002:ac2:4c8c:: with SMTP id d12mr2255752lfl.58.1565872898472; Thu, 15 Aug 2019 05:41:38 -0700 (PDT) In-Reply-To: <87pnl73y3n.fsf@mouse.gnus.org> 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:165084 Archived-At: --000000000000e07dd10590273154 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Lars. Lars Ingebrigtsen writes: > Andreas R=C3=B6hler 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-abbre= viation-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. --000000000000e07dd10590273154 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello Lars.

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Andreas R=C3=B6= hler <andreas.roehler@e= asy-emacs.de> writes:
>
>> add-abbrev uses forward-wo= rd to catch the expansion, which isn't good
>> for programming= code.
>>
>> See
>>
>> http://stackoverflow.com/quest= ions/19073674/how-can-i-add-my-personal-abbreviation-to-emmet-mode-in-emacs= /19079683#19079683
>>
>> Suggest to use forward-symbo= l instead, or still better to make if customizable:
>
> `add-ab= brev' doesn't have a doc string itself, but as all the in-tree
&= gt; callers of this function says:
>
> ---
> Don't us= e this function in a Lisp program; use `define-abbrev' instead.
>= ---
>
> So you probably shouldn't use this programmaticall= y, either.

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

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

> However, it's possible that the `forwar= d-word' should perhaps be
> changed, but on the other hand, abbre= v.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?=C2= =A0 I did a search in what I believe are usual places,
but didn't fo= und anything.
--000000000000e07dd10590273154--