GNU bug report logs - #36516
Wrong dynamic abbrev expansion after space

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Fri, 5 Jul 2019 19:14:02 UTC

Severity: minor

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Alan Third <alan <at> idiocy.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 36516 <at> debbugs.gnu.org
Subject: bug#36516: Wrong dynamic abbrev expansion after space
Date: Sat, 03 Aug 2019 23:58:13 +0300
>> Maybe it's possible to break out of the vicious cycle of ‘SPC M-/’
>> repetitions by making ‘SPC M-/’ look like a normal expansion, e.g.:
>
> This looks good to me. The only problem is it breaks the test for
> bug#1948. I think it no longer squashes all the spaces.

Sorry for breaking the test, I'll try to find a fix that will pass all tests.

Meanwhile, I started to rely heavily on consequent calls of M-/ and
today this feature reared its ugly head (so then could it be called
a misfeature).  Here's is the case that raises the error:

0. emacs -Q

1. Type these two lines:
str 1
str 2

(optionally set debug-on-error to t)

2. On the third line type:
 s			;; self-insert-command
 M-/			;; dabbrev-expand
 SPC			;; self-insert-command
 M-/			;; dabbrev-expand
 M-/			;; dabbrev-expand
 <backspace>		;; backward-delete-char-untabify
 <backspace>		;; backward-delete-char-untabify
 <backspace>		;; backward-delete-char-untabify
 <backspace>		;; backward-delete-char-untabify
 <backspace>		;; backward-delete-char-untabify

The amount of <backspace> keypresses depends on the length
of the random word expanded, so the intention is to delete
that word and the space character.

 SPC			;; self-insert-command
 M-/			;; dabbrev-expand

and the bug is revealed that signals this error:

Debugger entered--Lisp error: (search-failed "\\(?:\\sw\\|\\s_\\)+")
  re-search-forward("\\(?:\\sw\\|\\s_\\)+")
  dabbrev-expand(nil)
  funcall-interactively(dabbrev-expand nil)
  call-interactively(dabbrev-expand nil nil)
  command-execute(dabbrev-expand)




This bug report was last modified 4 years and 297 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.