From: Juri Linkov <juri@linkov.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 36516@debbugs.gnu.org
Subject: bug#36516: Wrong dynamic abbrev expansion after space
Date: Mon, 08 Jul 2019 01:13:13 +0300 [thread overview]
Message-ID: <87zhlp33kh.fsf@mail.linkov.net> (raw)
In-Reply-To: <83imsg9tfk.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 05 Jul 2019 22:23:43 +0300")
>> 0. emacs -Q
>> 1. Type these two lines:
>> str 1
>> str 2
>> 2. On the third line type:
>> s ;; self-insert-command
>> M-/ ;; dabbrev-expand
>> SPC ;; self-insert-command
>> M-/ ;; dabbrev-expand
>> M-/ ;; dabbrev-expand
>> 3. The word after "str " is expanded to some random word.
>
> Why did you expect something different? The first M-/ copies "2", but
> the next one after that replaces "2" with some alternative, which
> exactly depends on what other buffers you have. I see no bug here,
> you are just expecting from M-/ something it cannot give you. The
> "SPC M-/" trick is already reaching too far out, IMO.
The example in the first part of my bug report demonstrates that
this useful feature works as documented in the manual. Also
using ‘C-M-/’ (‘dabbrev-completion’) confirms that it works
as expected by displaying correct completions for both cases.
BTW, while reading the manual, I noticed the documentation bug in
(info "(emacs) Dynamic Abbrevs") that could be fixed by this patch:
diff --git a/doc/emacs/abbrevs.texi b/doc/emacs/abbrevs.texi
index 9c8a280efb..708adbb8a6 100644
--- a/doc/emacs/abbrevs.texi
+++ b/doc/emacs/abbrevs.texi
@@ -465,7 +465,7 @@ Dabbrev Customization
generally appropriate for expanding symbols in a program source and
also for human-readable text in many languages, but may not be what
you want in a text buffer that includes unusual punctuation characters;
-in that case, the value @code{"\\sw"} might produce better results.
+in that case, the value @code{\\sw} might produce better results.
@vindex dabbrev-abbrev-skip-leading-regexp
In shell scripts and makefiles, a variable name is sometimes prefixed
PS: Also I noticed that the documentation of ‘M-x dissociated-press’
has no references to https://www.gutenberg.org/files/829/829-h/829-h.htm
the text starting with “He then led me to the frame, about the sides,
whereof all his pupils stood in ranks.” But maybe the device described
in Gulliver's Travels has a different text generation algorithm than
dissociated-press, I'm not sure.
next prev parent reply other threads:[~2019-07-07 22:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-05 18:38 bug#36516: Wrong dynamic abbrev expansion after space Juri Linkov
2019-07-05 19:23 ` Eli Zaretskii
2019-07-07 22:13 ` Juri Linkov [this message]
2019-07-08 2:33 ` Eli Zaretskii
2019-07-08 21:35 ` Juri Linkov
2019-07-13 8:10 ` Eli Zaretskii
2019-07-27 17:18 ` Alan Third
2019-07-28 20:47 ` Juri Linkov
2019-08-03 11:34 ` Alan Third
2019-08-03 20:58 ` Juri Linkov
2020-08-22 14:18 ` Lars Ingebrigtsen
2020-08-23 18:43 ` Juri Linkov
2019-07-22 15:34 ` Noam Postavsky
2019-07-23 21:15 ` Juri Linkov
2019-07-23 21:27 ` Noam Postavsky
2019-07-27 10:26 ` Alan Third
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zhlp33kh.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=36516@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).