GNU bug report logs - #16197
24.3.50; no completion on commands following "sudo" in shell and eshell

Previous Next

Package: emacs;

Reported by: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>

Date: Fri, 20 Dec 2013 08:20:01 UTC

Severity: minor

Tags: fixed, patch

Found in version 24.3.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#16197: 24.3.50;
 no completion on commands following "sudo" in shell and eshell
Date: Tue, 24 Dec 2013 07:59:05 +0100
Thierry Volpiatto <thierry.volpiatto <at> gmail.com> writes:

> Thierry Volpiatto <thierry.volpiatto <at> gmail.com> writes:
>
>> With this I have completion on arguments of commands entered after
>> "sudo" (only in eshell though, not shell for the moment) and emacs is
>> not crashing when hitting TAB.
>
> Now I have the completion in shell also, for this
> `shell-command-completion' have to be redefined.
>
> (defun shell-command-completion ()
>   "Return the completion data for the command at point, if any."
>   (let ((filename (comint-match-partial-filename))
>         (args (split-string
>                (buffer-substring-no-properties
>                 (point) (save-excursion (shell-backward-command 1) (point))))))
>     (if (and filename
>              (save-match-data (not (string-match "[~/]" filename)))
>              (and (string= (car args) "sudo")
>                   (string= filename (cadr args))))
>         (shell--command-completion-data))))
>
> HTH, though the crash happening above should not happen.

So now my completion commands are working both with sudo and without,
the needed modifications are here if somebody is interested to fix this bug:

https://github.com/thierryvolpiatto/emacs-tv-config/blob/master/pcomplete-extension.el

Note that all pcomplete/* commands provided in emacs are not working
with "sudo".

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 





This bug report was last modified 4 years and 238 days ago.

Previous Next


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