bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#16197: 24.3.50; no completion on commands following "sudo" in shell


From: Thierry Volpiatto
Subject: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell
Date: Tue, 24 Dec 2013 07:59:05 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> Thierry Volpiatto <thierry.volpiatto@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 






reply via email to

[Prev in Thread] Current Thread [Next in Thread]