GNU bug report logs - #51130
29.0.50; shell completion fails to complete filenames

Previous Next

Package: emacs;

Reported by: Carlos Pita <carlosjosepita2 <at> gmail.com>

Date: Mon, 11 Oct 2021 05:45:02 UTC

Severity: normal

Found in version 29.0.50

Full log


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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 51130 <at> debbugs.gnu.org, Carlos Pita <carlosjosepita2 <at> gmail.com>
Subject: Re: bug#51130: 29.0.50; shell completion fails to complete filenames
Date: Wed, 14 Sep 2022 14:28:26 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> Look at `shell-dynamic-complete-functions`:
>
>     (defcustom shell-dynamic-complete-functions
>       '(comint-c-a-p-replace-by-expanded-history
>         shell-environment-variable-completion
>         shell-command-completion
>         shell-c-a-p-replace-by-expanded-directory
>         pcomplete-completions-at-point
>         shell-filename-completion
>         comint-filename-completion)
>       "List of functions called to perform completion.
>     This variable is used to initialize `comint-dynamic-complete-functions' in the
>     shell buffer."
>       :type '(repeat function)
>       :group 'shell)
>
> if `pcomplete-default-completion-function` is left at its default value,
> then `pcomplete-completions-at-point` will never return nil, so the
> functions that appear after it in the above list will just never
> be used.

Ah, the detail I missed was that pcomplete-completions-at-point is
(partially) controlled by pcomplete-default-completion-function -- from
the documentation, I assumed that pcomplete-default-completion-function
was run after all of the other completion functions had finished.

> The change I introduced tried to preserve as much of the existing
> completion as possible, by only using the non-fallback pcomplete rules
> and keeping the existing `shell-filename-completion` and
> `comint-filename-completion` thingies as the fallback.
>
> I don't know that it's the best choice.  It was just the
> conservative choice.

Could just put an additional function at the end of the list there that
does what pcomplete-completions-at-point does when
pcomplete-default-completion-function isn't set to #'ignore?




This bug report was last modified 1 year and 287 days ago.

Previous Next


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