GNU bug report logs - #61221
30.0.50; [PATCH] Support completion of quoted variable refs in Eshell

Previous Next

Package: emacs;

Reported by: Jim Porter <jporterbugs <at> gmail.com>

Date: Thu, 2 Feb 2023 02:29:01 UTC

Severity: normal

Tags: patch

Found in version 30.0.50

Done: Jim Porter <jporterbugs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Jim Porter <jporterbugs <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 61221 <at> debbugs.gnu.org
Subject: Re: bug#61221: 30.0.50; [PATCH] Support completion of quoted variable
 refs in Eshell
Date: Wed, 22 Feb 2023 22:42:07 -0800
[Message part 1 (text/plain, inline)]
On 2/5/2023 7:33 AM, Stefan Monnier via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
> BTW, a low-tech way to get similar results is to change your completion
> table.  Instead of having entries like
> 
>     user-login-name
> 
> make it contains entries like:
> 
>     user-login-name" ...

I'd thought about this, but it gets a little uglier for more-complex 
cases like bug#53371, which wants to complete things like the "foo" in 
"#<buffer foo>".

> Regarding `pcomplete-exit-function`:
> - It's ugly and I don't like it, but given the general design of the
>    current Pcomplete API, I think it's OK.

Yeah, I'd rather do it by returning some structured object, but that 
would probably require some significant incompatible changes to pcomplete...

> - Please add a good docstring to that variable (the fact that the other
>    vars nearby don't have any is no excuse, instead it's a(nother)
>    problem that should be fixed).

Done.

> - Maybe `pcomplete-exit-function` should override the default exit
>    function (i.e. the handing of `pcomplete-termination-string`) rather
>    than being added to it?
>    E.g. we could start with `pcomplete-exit-function` bound to the
>    default (the one that handles `pcomplete-termination-string`) and let
>    the rest of the code modify it either with `setq` (to completely
>    override) or `add-function`.

I like this a lot better than my previous solution. Done.

I also changed the last patch to return a programmed completion function 
that mimics "~user" completion in 'completion-file-name-table'. That 
seems like a more-consistent way to handle that case, since now Eshell 
"~user" completion works the same as completing any file name.
[0001-Throw-strings-as-the-values-for-eshell-incomplete.patch (text/plain, attachment)]
[0002-Add-support-for-completing-quoted-variables-in-Eshel.patch (text/plain, attachment)]
[0003-Don-t-add-a-space-after-the-trailing-slash-when-comp.patch (text/plain, attachment)]

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

Previous Next


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