emacs-diffs
[Top][All Lists]
Advanced

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

master cfc796f6f24: Add completion for 'doas' to pcomplete


From: Stefan Kangas
Subject: master cfc796f6f24: Add completion for 'doas' to pcomplete
Date: Sun, 22 Oct 2023 18:42:57 -0400 (EDT)

branch: master
commit cfc796f6f24efd7cbc0dcac07f8eccd5200236bd
Author: Antero Mejr <antero@mailbox.org>
Commit: Stefan Kangas <stefankangas@gmail.com>

    Add completion for 'doas' to pcomplete
    
    * lisp/pcmpl-unix.el (pcomplete/doas): New function.
    * etc/NEWS: Announce.  (Bug#66551)
    
    Co-authored-by: Visuwesh <visuweshm@gmail.com>
---
 etc/NEWS           | 4 ++++
 lisp/pcmpl-unix.el | 8 ++++++++
 2 files changed, 12 insertions(+)

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



reply via email to

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