From: Antero Mejr Date: Sun, 15 Oct 2023 00:32:57 +0000 (+0000) Subject: Add completion for 'doas' to pcomplete X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cfc796f6f24efd7cbc0dcac07f8eccd5200236bd;p=emacs.git Add completion for 'doas' to pcomplete * lisp/pcmpl-unix.el (pcomplete/doas): New function. * etc/NEWS: Announce. (Bug#66551) Co-authored-by: Visuwesh --- diff --git a/etc/NEWS b/etc/NEWS index a3639620ebb..d0880669752 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -491,6 +491,10 @@ When this option is non-nil, remote file names are not completed by Pcomplete. Packages, like 'shell-mode', could set this in order to suppress remote file name completion at all. +--- +*** Completion for the 'doas' command has been added. +Command completion for 'doas' in Eshell and Shell mode will now work. + ** Shell Mode +++ diff --git a/lisp/pcmpl-unix.el b/lisp/pcmpl-unix.el index e6b67256a4c..7af5f2bce74 100644 --- a/lisp/pcmpl-unix.el +++ b/lisp/pcmpl-unix.el @@ -685,6 +685,14 @@ Includes files as well as host names followed by a colon." (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1)) pcomplete-default-completion-function))) +;;;###autoload +(defun pcomplete/doas () + "Completion for the `doas' command." + (pcomplete-opt "C(pcomplete-entries)Lnsu(pcmpl-unix-user-names)") + (funcall pcomplete-command-completion-function) + (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1)) + pcomplete-default-completion-function))) + (provide 'pcmpl-unix) ;;; pcmpl-unix.el ends here