From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#36516: Wrong dynamic abbrev expansion after space Date: Mon, 22 Jul 2019 11:34:37 -0400 Message-ID: <85sgqyjd6a.fsf@gmail.com> References: <8736jks4wg.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="261840"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt) Cc: 36516@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 22 17:35:11 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 1hpaLG-0015zk-T5 for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Jul 2019 17:35:11 +0200 Original-Received: from localhost ([::1]:34630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hpaLF-0006W1-Ox for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Jul 2019 11:35:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50479) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hpaLC-0006Nw-1c for bug-gnu-emacs@gnu.org; Mon, 22 Jul 2019 11:35:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hpaLA-00053u-VH for bug-gnu-emacs@gnu.org; Mon, 22 Jul 2019 11:35:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52916) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hpaL9-00052L-R8 for bug-gnu-emacs@gnu.org; Mon, 22 Jul 2019 11:35:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hpaL8-0001fU-3m for bug-gnu-emacs@gnu.org; Mon, 22 Jul 2019 11:35:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Jul 2019 15:35:02 +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.15638096866384 (code B ref 36516); Mon, 22 Jul 2019 15:35:02 +0000 Original-Received: (at 36516) by debbugs.gnu.org; 22 Jul 2019 15:34:46 +0000 Original-Received: from localhost ([127.0.0.1]:33504 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hpaKr-0001eu-QZ for submit@debbugs.gnu.org; Mon, 22 Jul 2019 11:34:45 -0400 Original-Received: from mail-io1-f52.google.com ([209.85.166.52]:36157) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hpaKq-0001eh-Iu for 36516@debbugs.gnu.org; Mon, 22 Jul 2019 11:34:45 -0400 Original-Received: by mail-io1-f52.google.com with SMTP id o9so74926059iom.3 for <36516@debbugs.gnu.org>; Mon, 22 Jul 2019 08:34:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=quzuXTBnYjhPvGWvyvN2lP/2EIMBemLkIySsXxmUDXM=; b=pGFfKaBAZemoSlZB4B+GT8uk6kZf+xcld8FsKUB3b9WSWWDXijlC1fNsWvCj0CyJoW oEWtLYtKa+eFAz5DonnAH459DJqVCCvZKgUWhdIEC/MjrSs70QAYPxxNL9f2xEcV/kEr 9U+9RwJTZX+V8IE1uywTAxs0xpboWzLRxX6UwEcg0qYPAO+T4TkDERlrrYk1/Kn/tx4r lYVWDM4Jev8R4MfNg23ohtwEPh+Siri5hFOzAP4Z/HmNbPbFMHijKLw3q1mD8feghgf0 pMR04Lb/kMhYtqiVFULqoi3wKmbCDpvdeVqnlwqExac1PcQVrvt9hV62gzR4g1F3niAc Mu9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=quzuXTBnYjhPvGWvyvN2lP/2EIMBemLkIySsXxmUDXM=; b=Q5GOrM141gkdEchgxegyeGy0iez/cO+NpVlLIwwgkAMcRLrQw8wgSEIQARV9BD7W+g LqpmJYhn46Vti9nMv1klVa77Xq27EiocUItV8HFL7n1mDBKvuUuSH4ySXSVZO5B9A7gx Jxv9h9tvt8ffkqpaaga3ylXPDoL5EVGMMZXQedmP0XXQRY7KqeMlx74y/Q+hHMdxqLFp a7e4Gnt0/OadsMGn25zYrxJLICbi1svHoNpOP+DfpgfqZAq/EalSwF7H/jbi5REmmEAz vb/yxGnqIkr24wrMXkorX9dDZBYRaFfOFWY+f2fR/R6YZTrtXuMKUj9Dj6HvAXJy3kFc GseA== X-Gm-Message-State: APjAAAXDSgwl1FXu31a4w9rZZorwZzo8zDujZcBa0UsJds9pkN8hns3h gxxvMjMf78YygsJp7BLiRJJ8ePY5 X-Google-Smtp-Source: APXvYqwXOl2h7ICyaUjFg0CafQs3GqBP0ca9wTlqeHRLXJx09WCzbPFU9fTY74Jgb0W8TBB8lWHl8Q== X-Received: by 2002:a5e:c00e:: with SMTP id u14mr33043487iol.196.1563809678713; Mon, 22 Jul 2019 08:34:38 -0700 (PDT) Original-Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.51.196]) by smtp.gmail.com with ESMTPSA id d25sm33021598iom.52.2019.07.22.08.34.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jul 2019 08:34:37 -0700 (PDT) In-Reply-To: <8736jks4wg.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 05 Jul 2019 21:38:39 +0300") 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:163597 Archived-At: Juri Linkov writes: > 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. It's due to this code in dabbrev.el: (defun dabbrev-expand (arg) ... ;; If the user inserts a space after expanding ;; and then asks to expand again, always fetch the next word. (if (and (eq (preceding-char) ?\s) (markerp dabbrev--last-abbrev-location) (marker-position dabbrev--last-abbrev-location) (= (point) (1+ dabbrev--last-abbrev-location))) (progn ;; The "abbrev" to expand is just the space. (setq abbrev " ") ... This triggers on the second M-/ in your recipe above, which causes the third M-/ to expand " " instead of "str ". Not sure what to do about it though. Removing this `if' will fix your case, but probably break others.