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 #101 received at 50470 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Christophe <ch.bollard <at> laposte.net>, 50470 <at> debbugs.gnu.org,
 John Wiegley <johnw <at> gnu.org>
Subject: Re: bug#50470: 27.1; 'company-mode' 'eshell'
Date: Sun, 19 Mar 2023 17:30:56 -0700
[Message part 1 (text/plain, inline)]
On 3/19/2023 11:39 AM, Jim Porter wrote:
> Ok, here we are.
Here's an updated patch based on some off-list comments from Stefan. 
Most of them are just small doc/naming tweaks, but a couple are worth 
mentioning here, I think:

On 3/19/2023 12:15 PM, Stefan Monnier wrote:
>> -  (when (memq (char-after) eshell-glob-chars-list)
>> +  (when (and (not (bound-and-true-p eshell-parse-for-completion-p))
>
> Can we (cheaply) arrange so that the var is always defined at this
> point (same for the other uses further down in the patch)?
> Maybe by moving the `defvar` elsewhere (e.g. next to
> `eshell-parse-argument-hook`)?

It's a bit ugly, but I'm trying to follow the conventions in Eshell: 
since completion is an optional extension module for Eshell, other 
modules jump through hoops like this to allow the module to be not-loaded.

Another way to do this (arguably more Eshell-y) would be:

  (when (and (eshell-using-module 'eshell-cmpl)
             eshell-parsing-for-completion)

But that seemed a little overly-verbose for this...

>> +              (if (bound-and-true-p eshell-parse-for-completion-p)
>> +                  "(unevaluated subcommand)"
>
> Any reason we don't return the actual string that we're trying to
> parse instead (i.e. here, the subcommand)?

I wanted something where we could be pretty sure that Pcomplete wouldn't 
treat it specially, since it should be "opaque" to Pcomplete. I changed 
this to be a propertized string with just the NUL character:

  (propertize "\0" 'eshell-argument-stub TYPE)

That should be pretty unlikely to trigger anything in Pcomplete. 
(Arguably, Pcomplete should have some way of marking an argument as "not 
real", but I'm not sure anything outside of Eshell would need that...)
[0001-Avoid-parsing-some-Eshell-forms-when-performing-comp.patch (text/plain, attachment)]

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.