From 2519752ca39cfe8786a65dd3caca98a689b24777 Mon Sep 17 00:00:00 2001 From: Antero Mejr Date: Sun, 15 Oct 2023 00:32:57 +0000 Subject: [PATCH] Add completion for Unix 'doas' command. * lisp/pcmpl-unix.el (pcomplete/doas): New procedure. * etc/NEWS: Announce. (Bug#66551) --- etc/NEWS | 4 ++++ lisp/pcmpl-unix.el | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index 3bd47a0112b..d73ec031d85 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -477,6 +477,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. +--- +*** Completions for the Unix 'doas' command are now provided. +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..15462637df1 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 "aCLnsu") + (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 -- 2.41.0