Subject: Re: bug#16197: 24.3.50; no completion on commands following "sudo" in shell and eshell

From: Thierry Volpiatto <[email-masked]>
Date: Tue, 07 Jan 2014 16:26:32 +0100

After applying the patch on previous mail, that among other things fix:

[...] | xargs <completion>
but not
[...] | xargs -<arg> <completion>

This definition of pcomplete/xargs fix it:

--8<---------------cut here---------------start------------->8---
(defun pcomplete/xargs ()
  "Completion for `xargs'."
  (let ((pcomplete-cmd-name (pcomplete-command-name)))
    (cond ((string= "xargs" pcomplete-cmd-name)
           (while (pcomplete-here*
                   (funcall pcomplete-command-completion-function)
                   (pcomplete-arg 'last) t)))
          (t (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1))
                          pcomplete-default-completion-function))))))
--8<---------------cut here---------------end--------------->8---

Note that there is no completion on the args, but that could be done
later (no urge for this).

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