unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#66551: [PATCH] Add completion for Unix 'doas' command.
@ 2023-10-15  0:39 Antero Mejr via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-15  7:58 ` Stefan Kangas
  0 siblings, 1 reply; 11+ messages in thread
From: Antero Mejr via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-15  0:39 UTC (permalink / raw)
  To: 66551

[-- Attachment #1: Type: text/plain, Size: 111 bytes --]

The attached patch adds a pcomplete procedure for doas, so shell/eshell
will do command completion correctly.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-completion-for-Unix-doas-command.patch --]
[-- Type: text/x-patch, Size: 1544 bytes --]

From df385c3055a23894ecde5943ffb249f94526523d Mon Sep 17 00:00:00 2001
From: Antero Mejr <antero@mailbox.org>
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.
---
 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..ac8b71c0030 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 "su")
+  (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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-10-22 22:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-15  0:39 bug#66551: [PATCH] Add completion for Unix 'doas' command Antero Mejr via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-15  7:58 ` Stefan Kangas
2023-10-15 11:29   ` Antero Mejr via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-15 12:55     ` Stefan Kangas
2023-10-15 13:41       ` Antero Mejr via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-15 14:09         ` Stefan Kangas
2023-10-15 14:35         ` Visuwesh
2023-10-15 16:36           ` Antero Mejr via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-21 10:08             ` Stefan Kangas
2023-10-21 18:47               ` Antero Mejr via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-22 22:44                 ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).