bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#15485: add-abbrev: don't use hard-coded forward-word


From: Mauro Aranda
Subject: bug#15485: add-abbrev: don't use hard-coded forward-word
Date: Thu, 15 Aug 2019 09:41:26 -0300

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]