GNU bug report logs -
#36243
26.2; defining inverse abbrevs include space
Previous Next
Reported by: Allen Li <darkfeline <at> felesatra.moe>
Date: Sun, 16 Jun 2019 10:36:02 UTC
Severity: normal
Tags: fixed
Found in version 26.2
Fixed in version 27.1
Done: Noam Postavsky <npostavs <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 36243 in the body.
You can then email your comments to 36243 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#36243
; Package
emacs
.
(Sun, 16 Jun 2019 10:36:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Allen Li <darkfeline <at> felesatra.moe>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 16 Jun 2019 10:36:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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"
This abbrev is impossible to expand because it ends in a non-word
character.
It would be more convenient if the inverse abbrev definition commands
skips trailing non-word characters, e.g. in the example above defining
"foo" -> "find outer otter". The use case for this is that I often type
something that I think should be an abbrev and upon finding that it is
not defined, I must delete the previous character before using
inverse-add-{mode,global}-abbrev.
Note that this bug affects all positive prefix arguments to
inverse-add-{mode,global}-abbrev, e.g.:
some text: .... foo @
C-u 2 C-x a i l will attempt to define an abbrev "text: .... " -> "blah",
which is completely useless.
I have attached a patch fixing this, with regression tests.
In GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.8)
of 2019-04-12 built on juergen
Windowing system distributor 'The X.Org Foundation', version 11.0.12005000
[0001-Fix-defining-inverse-abbrevs-on-previous-words.patch (text/x-patch, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#36243
; Package
emacs
.
(Mon, 17 Jun 2019 14:45:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 36243 <at> debbugs.gnu.org (full text, mbox):
Allen Li <darkfeline <at> 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?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#36243
; Package
emacs
.
(Mon, 17 Jun 2019 19:26:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 36243 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Thanks for suggesting skip-syntax-backward, see new patch.
On Mon, Jun 17, 2019 at 7:44 AM Noam Postavsky <npostavs <at> gmail.com> wrote:
>
> Allen Li <darkfeline <at> 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?
[0001-Fix-defining-inverse-abbrevs-on-previous-words.patch (text/x-patch, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#36243
; Package
emacs
.
(Fri, 21 Jun 2019 18:31:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 36243 <at> debbugs.gnu.org (full text, mbox):
Any update on this?
On Mon, Jun 17, 2019 at 7:23 PM Allen Li <darkfeline <at> felesatra.moe> wrote:
>
> Thanks for suggesting skip-syntax-backward, see new patch.
>
> On Mon, Jun 17, 2019 at 7:44 AM Noam Postavsky <npostavs <at> gmail.com> wrote:
> >
> > Allen Li <darkfeline <at> 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?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#36243
; Package
emacs
.
(Sat, 22 Jun 2019 23:36:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 36243 <at> debbugs.gnu.org (full text, mbox):
tags 36243 fixed
close 36243 27.1
quit
Allen Li <darkfeline <at> felesatra.moe> writes:
> Thanks for suggesting skip-syntax-backward, see new patch.
> @@ -354,6 +354,7 @@ inverse-add-abbrev
> (let (name exp start end)
> (save-excursion
> (forward-word (1+ (- arg)))
> + (skip-syntax-backward "^w")
> (setq end (point))
> (backward-word 1)
> (setq start (point)
Perfect, thanks, pushed to master.
2db75262c7 2019-06-22T19:25:44-04:00 "Fix defining inverse abbrevs on previous words (Bug#36243)"
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=2db75262c7395483d1fa9a0c9d93dd3e4d534e1f
Added tag(s) fixed.
Request was from
Noam Postavsky <npostavs <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Sat, 22 Jun 2019 23:36:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 27.1, send any further explanations to
36243 <at> debbugs.gnu.org and Allen Li <darkfeline <at> felesatra.moe>
Request was from
Noam Postavsky <npostavs <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Sat, 22 Jun 2019 23:36:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 21 Jul 2019 11:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 5 years and 331 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.