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

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

bug#36243: 26.2; defining inverse abbrevs include space


From: Allen Li
Subject: bug#36243: 26.2; defining inverse abbrevs include space
Date: Mon, 17 Jun 2019 12:23:02 -0700

Thanks for suggesting skip-syntax-backward, see new patch.

On Mon, Jun 17, 2019 at 7:44 AM Noam Postavsky <npostavs@gmail.com> wrote:
>
> Allen Li <darkfeline@felesatra.moe> writes:
>
> > Defining an inverse abbrev in a buffer like so (@ is point):
> >
> > some text foo @
> >
> > C-x a i l find outer otter RET
> >
> > defines an abbrev "foo " -> "find outer otter"
>
> > * lisp/abbrev.el (inverse-add-abbrev): Skip trailing nonword
> > characters when defining abbrev.
>
> >  (defun inverse-add-abbrev (table type arg)
> >    (let (name exp start end)
> >      (save-excursion
> > -      (forward-word (1+ (- arg)))
> > +      (if (<= arg 0)
> > +          (forward-word (1+ (- arg)))
> > +        (forward-word (- arg))
> > +        (forward-word))
> >        (setq end (point))
> >        (backward-word 1)
>
> This seems like a somewhat obfuscated way of skipping nonword
> characters.  How about using skip-syntax-backward instead?

Attachment: 0001-Fix-defining-inverse-abbrevs-on-previous-words.patch
Description: Text Data


reply via email to

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