From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#36516: Wrong dynamic abbrev expansion after space Date: Mon, 08 Jul 2019 01:13:13 +0300 Organization: LINKOV.NET Message-ID: <87zhlp33kh.fsf@mail.linkov.net> References: <8736jks4wg.fsf@mail.linkov.net> <83imsg9tfk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="2078"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 36516@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 08 00:22:29 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hkFYB-0000Ie-0A for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Jul 2019 00:22:27 +0200 Original-Received: from localhost ([::1]:37234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkFYA-0002XS-2R for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Jul 2019 18:22:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54015) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkFXn-0002VY-QE for bug-gnu-emacs@gnu.org; Sun, 07 Jul 2019 18:22:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkFXm-0001G6-Ij for bug-gnu-emacs@gnu.org; Sun, 07 Jul 2019 18:22:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48693) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hkFXm-0001FR-3R for bug-gnu-emacs@gnu.org; Sun, 07 Jul 2019 18:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hkFXl-0001Ui-Te for bug-gnu-emacs@gnu.org; Sun, 07 Jul 2019 18:22:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Jul 2019 22:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36516 X-GNU-PR-Package: emacs Original-Received: via spool by 36516-submit@debbugs.gnu.org id=B36516.15625381135723 (code B ref 36516); Sun, 07 Jul 2019 22:22:01 +0000 Original-Received: (at 36516) by debbugs.gnu.org; 7 Jul 2019 22:21:53 +0000 Original-Received: from localhost ([127.0.0.1]:57514 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkFXb-0001UD-5r for submit@debbugs.gnu.org; Sun, 07 Jul 2019 18:21:51 -0400 Original-Received: from bisque.elm.relay.mailchannels.net ([23.83.212.18]:37728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkFXY-0001U4-Sa for 36516@debbugs.gnu.org; Sun, 07 Jul 2019 18:21:49 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id CB1CE14035F; Sun, 7 Jul 2019 22:21:47 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a86.g.dreamhost.com (100-96-38-45.trex.outbound.svc.cluster.local [100.96.38.45]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 2118514153B; Sun, 7 Jul 2019 22:21:46 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a86.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.3); Sun, 07 Jul 2019 22:21:47 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Versed-Name: 32680ff170b6632d_1562538107644_3519150701 X-MC-Loop-Signature: 1562538107644:233363532 X-MC-Ingress-Time: 1562538107644 Original-Received: from pdx1-sub0-mail-a86.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a86.g.dreamhost.com (Postfix) with ESMTP id 0162380137; Sun, 7 Jul 2019 15:21:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=linkov.net; bh=Q53BmA dNhtbW3ynGBx+QMJoYPYs=; b=IDnWlIEpcqlJEhwJrtxGemBOBJNzTZxq/D00Ji JuDfuQNmk4AZPjOd+cCISwRNJw2OO6hSZSDpkkuB+lSXn5GZ2NN+OSN5pphKr6Ul wndHfUF79SL2Zg7Ag+qKOfz9FjGchx1alhp+hPvh9Cj9ts5d0tkFh2fexXU2ZoDC cM4Pw= Original-Received: from mail.jurta.org (m91-129-109-127.cust.tele2.ee [91.129.109.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a86.g.dreamhost.com (Postfix) with ESMTPSA id 0662F80168; Sun, 7 Jul 2019 15:21:39 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a86 In-Reply-To: <83imsg9tfk.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 05 Jul 2019 22:23:43 +0300") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrfeelgddtiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtgfesthekredttderjeenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucffohhmrghinhepghhuthgvnhgsvghrghdrohhrghenucfkphepledurdduvdelrddutdelrdduvdejnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtledruddvjedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegvlhhiiiesghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:162303 Archived-At: >> 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 =E2=80=98C-M-/=E2=80=99 (=E2=80=98dabbrev-completion=E2=80=99) conf= irms 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. =20 @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 =E2=80=98M-x dissociated-pre= ss=E2=80=99 has no references to https://www.gutenberg.org/files/829/829-h/829-h.htm the text starting with =E2=80=9CHe then led me to the frame, about the si= des, whereof all his pupils stood in ranks.=E2=80=9D But maybe the device des= cribed in Gulliver's Travels has a different text generation algorithm than dissociated-press, I'm not sure.