From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#50470: 27.1; 'company-mode' 'eshell' Date: Mon, 24 Jan 2022 03:50:59 +0200 Message-ID: <01845bee-7637-76f6-2e86-2e2de91f6f6e@yandex.ru> References: <87h7evegav.fsf@debian-BULLSEYE-live-builder-AMD64> <154bd0e9-2779-5a28-5587-a845a982e39f@yandex.ru> <815516d6-262b-4ef1-786e-ec5b4199847c@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16943"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 Cc: Christophe , 50470@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 24 02:52:31 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nBoX0-00044I-Vn for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Jan 2022 02:52:31 +0100 Original-Received: from localhost ([::1]:57952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nBoWz-0001OD-OG for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 23 Jan 2022 20:52:29 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49354) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nBoWX-0001Jz-Ro for bug-gnu-emacs@gnu.org; Sun, 23 Jan 2022 20:52:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48673) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nBoWX-0004mO-IE for bug-gnu-emacs@gnu.org; Sun, 23 Jan 2022 20:52:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nBoWX-0003LV-Hk for bug-gnu-emacs@gnu.org; Sun, 23 Jan 2022 20:52:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Jan 2022 01:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50470 X-GNU-PR-Package: emacs Original-Received: via spool by 50470-submit@debbugs.gnu.org id=B50470.164298907212797 (code B ref 50470); Mon, 24 Jan 2022 01:52:01 +0000 Original-Received: (at 50470) by debbugs.gnu.org; 24 Jan 2022 01:51:12 +0000 Original-Received: from localhost ([127.0.0.1]:41576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBoVj-0003KL-Is for submit@debbugs.gnu.org; Sun, 23 Jan 2022 20:51:11 -0500 Original-Received: from mail-ej1-f50.google.com ([209.85.218.50]:43864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBoVg-0003Jz-0V for 50470@debbugs.gnu.org; Sun, 23 Jan 2022 20:51:10 -0500 Original-Received: by mail-ej1-f50.google.com with SMTP id d10so17169466eje.10 for <50470@debbugs.gnu.org>; Sun, 23 Jan 2022 17:51:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=zYRChrpv1Bl/uxyhuo63qlE00b6K8fT7EgtEiJ4OTBM=; b=i8k/AjAFosFn5sIsu/iA9Sd5T0aS8imOTupzsTQyUQ3hBHSXTUKpg0frjlt/DrEIvJ Hw8NZUX5tCuPURnVU6cmTph0kuUnatC/JDwysrpbMP+ebYihBY4ZrHHYyWcSHpAx45WB Zl2Hh9O2P7PZA9a6EWhAE3zwLr6doDFvZOgHRoIJTvjMSH0jwhbw+s0tIQc40tRIGma4 P5oVS3yqvIqIy0WjnhJerrJTLvPbuZfmFb96i7/Uwk/ql+nw7m8uwlKWPESEQt/jlPbu /kPPL5HIA6O1glWf42OwNk+xj00UUvwFhkBbkBUwsjuZHyrbKm4QyN9S1p/o4pmiFliu zdRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zYRChrpv1Bl/uxyhuo63qlE00b6K8fT7EgtEiJ4OTBM=; b=ZvLBoKhk4TGBjXzb8qvLIZ+EcnTmeB4Afv7BPQbDHp9r9H3AZeP21S2duz8pg7wGuQ iZxRxLo0faMBksEGIGNhvzdiAtz9FRFqhdJhlVNIyjC73vZ8XEHQtwPkqLRPjju2K8Kf DjkAeHXxF2DFon5+a9PjVr6noXVBusOk+OpHDlbntsQP8vWAhIvRuF5jQapy1zuD6+TO 9+LrgLEK0/lM1CDZv5jv0n0waTAQSCA34hkTDhKn63R1BI4WXO9ecWvJmfVy3v/IhKtK 4VxGngz+GDybJ7E9+ewYaRZ32Q6jZIx5pMuNGIYtAHBmWL8KwoX7WYBMs0g06MNlywVv gswg== X-Gm-Message-State: AOAM533maF2kx5aOIr9/0oqiUqK478+YszfMAjGanWiavtXLdwN40bTc 9mg/dyhM/ZIGDBKeG+UhI7CDs2Htbs023A== X-Google-Smtp-Source: ABdhPJzjvojCEy73p5lzWllUdXs9dEUt0wSdV55ZC5a9xFKB8gOr0juK8KCwB6CPWHM8fRCGnZQ6qw== X-Received: by 2002:a17:907:e8d:: with SMTP id ho13mr20569ejc.169.1642989061892; Sun, 23 Jan 2022 17:51:01 -0800 (PST) Original-Received: from [10.111.160.185] ([185.213.155.232]) by smtp.googlemail.com with ESMTPSA id bm13sm5708383edb.67.2022.01.23.17.51.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 23 Jan 2022 17:51:01 -0800 (PST) In-Reply-To: Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:224983 Archived-At: Hi Stefan, On 23.01.2022 05:23, Stefan Monnier wrote: > And the 100% untested patch below is a suggestion for how to try and fix > those kinds of bugs. > Can someone try and maybe make it work? I've tried the patch, and it seems to work already, as well as fix this particular scenario. (Thanks!) Might as well install it, I think. There is a scenario that is more noticeably broken (yet actually better with this patch): a modification of bug#18951. Instead of ls * try ls ~/Docu* ...and [on master] the result is that the asterisk is replaced with the "common part" of the possible completions automatically. If there is nothing to expand with, the asterisk is similarly deleted. With your patch, we get the "Buffer is read-only" error in *Messages* instead, which is probably an improvement. Because it doesn't modify the input, nor break Company completions long-term (after the asterisk is removed). The offending functions is pcomplete-parse-arguments. There is some complex global state going on there, but the following addition seems to fix the problem: @@ -790,6 +804,9 @@ pcomplete-parse-arguments (common-stub (car completions)) (c completions) (len (length common-stub))) + (unless pcomplete-allow-modifications + (setq pcomplete-stub (buffer-substring begin (point))) + (throw 'pcomplete-completions completions)) (while (and c (> len 0)) (while (and (> len 0) (not (string= Not sure if this new value of pcomplete-stub is always TRT, but it has passed a bunch of my experiments successfully.