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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 61221 <at> debbugs.gnu.org
Subject: Re: bug#61221: 30.0.50; [PATCH] Support completion of quoted
 variable refs in Eshell
Date: Sun, 05 Feb 2023 10:33:42 -0500
> Probably the most controversial part of this patch is in #0002, where
> I added another dynamic variable 'pcomplete-exit-function' that Pcomplete
> handlers can set to tell Pcomplete what to do after exiting
> a completion. Maybe it would be better to have handlers throw some special
> value for 'pcomplete-completions' that contains this info (sort of like the
> value that a 'completion-at-point-function' returns). I'm not sure what the
> best (and most-compatible) way to do this would be...

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"

or

   user-login-name'

or even

   'user-login-name'

[ assuming you change the `pcomplete-stub` so that it also contains the
  leading ' of course.  ]

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.
- 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).
- 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`.


        Stefan





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.