From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.bugs Subject: bug#50470: 27.1; 'company-mode' 'eshell' Date: Fri, 10 Dec 2021 11:50:09 +0100 Message-ID: <87wnkc3fa6.fsf@miha-pc> 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 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17611"; mail-complaints-to="usenet@ciao.gmane.io" To: Dmitry Gutov , Christophe , 50470@debbugs.gnu.org, Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 10 11:46:21 2021 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 1mvdPx-0004Oi-1W for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Dec 2021 11:46:21 +0100 Original-Received: from localhost ([::1]:53764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mvdPv-00079E-Lr for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Dec 2021 05:46:19 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvdPe-000796-GF for bug-gnu-emacs@gnu.org; Fri, 10 Dec 2021 05:46:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34057) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mvdPe-0007Rz-7U for bug-gnu-emacs@gnu.org; Fri, 10 Dec 2021 05:46:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mvdPe-0000QC-4m for bug-gnu-emacs@gnu.org; Fri, 10 Dec 2021 05:46:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Dec 2021 10:46:02 +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.16391331051549 (code B ref 50470); Fri, 10 Dec 2021 10:46:02 +0000 Original-Received: (at 50470) by debbugs.gnu.org; 10 Dec 2021 10:45:05 +0000 Original-Received: from localhost ([127.0.0.1]:45603 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvdOi-0000Ov-Lu for submit@debbugs.gnu.org; Fri, 10 Dec 2021 05:45:04 -0500 Original-Received: from kamnitnik.top ([209.250.245.214]:54902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvdOf-0000OE-QE for 50470@debbugs.gnu.org; Fri, 10 Dec 2021 05:45:03 -0500 Original-Received: from localhost (BSN-77-156-43.static.siol.net [193.77.156.43]) by kamnitnik.top (Postfix) with ESMTPSA id E00E79C719; Fri, 10 Dec 2021 10:44:59 +0000 (UTC) In-Reply-To: <815516d6-262b-4ef1-786e-ec5b4199847c@yandex.ru> 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:222043 Archived-At: Dmitry Gutov writes: > On 09.09.2021 04:57, Dmitry Gutov wrote: >> Hi! >>=20 >> On 08.09.2021 09:23, Christophe via Bug reports for GNU Emacs, the Swiss= =20 >> army knife of text editors wrote: >>> Hello, >>> when company-mode is activate: >>> (use-package company >>> =C2=A0=C2=A0 :ensure t >>> =C2=A0=C2=A0 :init >>> =C2=A0=C2=A0 (global-company-mode t) >>> =C2=A0=C2=A0 ) >>> there are some weird things: >>> - when you type something, if you enter a single quote a blank space=20 >>> is added. >>> ex: $ ls Images/' >>=20 >> This is unfortunately an old problem. I though there was already a bug=20 >> report for it, but couldn't find it. Hope someone will find time to dig= =20 >> in through the leaky abstraction of c-a-p-f -> pcomplete. > > Some new details, from=20 > https://github.com/company-mode/company-mode/discussions/1276: > > When this happens (the user types a quote character and the tab=20 > character is inserted), In my package capf-autosuggest, I run completion-at-point-functions somewhat like this: (let (;; `pcomplete-completions-at-point' may illegally use ;; `completion-in-region' itself instead of returning a collectio= n. ;; Let's try to outsmart it. (completion-in-region-function (lambda (start end collection predicate) (throw 'illegal-comp-in-region (list start end collection :predicate predicate)))) ;; Prevent `pcomplete-completions-at-point' from inserting a TAB (buffer-read-only t)) ;; `ielm-complete-filename' may illegaly move point (save-excursion (condition-case nil (catch 'illegal-comp-in-region (run-hook-wrapped 'completion-at-point-functions ...)) (buffer-read-only nil)))) This way, old style capf functions are prevented from inserting a TAB or moving point.