Ludovic Courtès (2015-06-15 01:07 +0300) wrote: > Alex Kost skribis: > >> Ludovic Courtès (2015-06-10 22:44 +0300) wrote: >> >> [...] >>> Actually ‘sudo’ completion works well by default; e.g., “sudo ha” >>> completes to “sudo halt”. Could it be that there’s another way to >>> achieve that? >> >> ‘sudo’ completions don't work by default (did you check "emacs -Q"?) >> I think you are using some additional package for that. > > Indeed, this must be provided by the ‘pcmpl-args’ package. Thanks for the pointer, that's a great package! Its completions don't use a common 'pcomplete-here' function (and don't rely on 'pcomplete-args' and other global variables). Instead the own "pcmpl-args" code base (and it is big!) is used. So (analogously to 'pcomplete/sudo') the following function may be used to complete "pre-inst-env" properly: