GNU bug report logs - #50470
27.1; 'company-mode' 'eshell'

Previous Next

Package: emacs;

Reported by: Christophe <ch.bollard <at> laposte.net>

Date: Wed, 8 Sep 2021 06:25:02 UTC

Severity: normal

Found in version 27.1

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


Message #35 received at 50470 <at> debbugs.gnu.org (full text, mbox):

From: <jakanakaevangeli <at> chiru.no>
To: Dmitry Gutov <dgutov <at> yandex.ru>, Christophe <ch.bollard <at> laposte.net>,
 50470 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Subject: Re: bug#50470: 27.1; 'company-mode' 'eshell'
Date: Fri, 10 Dec 2021 11:50:09 +0100
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> On 09.09.2021 04:57, Dmitry Gutov wrote:
>> Hi!
>> 
>> On 08.09.2021 09:23, Christophe via Bug reports for GNU Emacs, the Swiss 
>> army knife of text editors wrote:
>>> Hello,
>>> when company-mode is activate:
>>> (use-package company
>>>    :ensure t
>>>    :init
>>>    (global-company-mode t)
>>>    )
>>> there are some weird things:
>>> - when you type something, if you enter a single quote a blank space 
>>> is added.
>>> ex: $ ls Images/'
>> 
>> This is unfortunately an old problem. I though there was already a bug 
>> report for it, but couldn't find it. Hope someone will find time to dig 
>> in through the leaky abstraction of c-a-p-f -> pcomplete.
>
> Some new details, from 
> https://github.com/company-mode/company-mode/discussions/1276:
>
> When this happens (the user types a quote character and the tab 
> 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 collection.
          ;; 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.




This bug report was last modified 2 years and 54 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.