[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode d6286ce43b 235/500: Add pcomplete support to nix.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode d6286ce43b 235/500: Add pcomplete support to nix.el |
Date: |
Sat, 29 Jan 2022 08:27:09 -0500 (EST) |
branch: elpa/nix-mode
commit d6286ce43b8a52d3d19a7394f186b1a3796354b6
Author: Matthew Bauer <matthew.bauer@obsidian.systems>
Commit: Matthew Bauer <matthew.bauer@obsidian.systems>
Add pcomplete support to nix.el
---
nix.el | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 98 insertions(+)
diff --git a/nix.el b/nix.el
index 12e9780e1f..02c92a1c16 100644
--- a/nix.el
+++ b/nix.el
@@ -16,6 +16,8 @@
;;; Code:
+(require 'pcomplete)
+
(defgroup nix nil
"Nix-related customizations"
:group 'languages)
@@ -55,6 +57,102 @@
(kill-buffer stdout)
result))
+(defvar nix-commands
+ '("add-to-store"
+ "build"
+ "cat-nar"
+ "cat-store"
+ "copy"
+ "copy-sigs"
+ "dump-path"
+ "edit"
+ "eval"
+ "hash-file"
+ "hash-path"
+ "log"
+ "ls-nar"
+ "ls-store"
+ "optimise-store"
+ "path-info"
+ "ping-store"
+ "repl"
+ "run"
+ "search"
+ "show-config"
+ "show-derivation"
+ "sign-paths"
+ "to-base16"
+ "to-base32"
+ "to-base64"
+ "upgrade-nix"
+ "verify"
+ "why-depends"))
+
+(defvar nix-toplevel-options
+ '("-v"
+ "--verbose"
+ "-h"
+ "--help"
+ "--debug"
+ "--help-config"
+ "--option"
+ "--version"))
+
+(defvar nix-config-options
+ '("allowed-uris"
+ "allow-import-from-derivation"
+ "allow-new-priveleges"
+ "allowed-users"
+ "auto-optimise-store"
+ "builders"
+ "builders-use-substitutes"
+ "build-users-group"
+ "compress-build-log"
+ "connect-timeout"
+ "cores"
+ "extra-sandbox-paths"
+ "extra-substituters"
+ "fallback"
+ "fsync-metadata"
+ "hashed-mirrors"
+ "http-connections"
+ "keep-build-log"
+ "keep-derivations"
+ "keep-env-derivations"
+ "keep-outputs"
+ "max-build-log-size"
+ "max-jobs"
+ "max-silent-time"
+ "netrc-file"
+ "plugin-files"
+ "pre-build-hook"
+ "repeat"
+ "require-sigs"
+ "restrict-eval"
+ "sandbox"
+ "sandbox-dev-shm-size"
+ "sandbox-paths"
+ "secret-key-files"
+ "show-trace"
+ "substitute"
+ "substituters"
+ "system"
+ "timeout"
+ "trusted-public-keys"
+ "trusted-subtituters"
+ "trusted-users"))
+
+;;;###autoload
+(defun pcomplete/nix ()
+ "Completion for the nix command."
+ (while (pcomplete-match "^-" 0)
+ (pcomplete-here nix-toplevel-options)
+ (when (string= "--option"
+ (nth (1- pcomplete-index) pcomplete-args))
+ (pcomplete-here nix-config-options)
+ (pcomplete-here)))
+ (pcomplete-here nix-commands))
+
;;;###autoload
(defun nix-build (&optional attr dir)
"Run nix-build.
- [nongnu] elpa/nix-mode 7b47e2b4bc 042/500: Fix formatting., (continued)
- [nongnu] elpa/nix-mode 7b47e2b4bc 042/500: Fix formatting., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 570d60d460 045/500: Rewrite nix-indent-level-parens with while loop., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 8a65262d37 200/500: Remove smartparens feature detection, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode cc23fd6a0e 206/500: Default to indent-relative, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 9f4f5d5860 204/500: Checkdoc of elisp, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode be7184ffcd 209/500: use tab-width instead of hardcoded '2', ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 5a8b334c75 212/500: Merge pull request #42 from serokell/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode b8aed79f89 211/500: No need to indent on = and ; (ruins your day), ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 81680dd7ac 213/500: nix-repl.el: make it work with newer nix repl command, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode a8af6e9203 218/500: Find nix executables at start, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode d6286ce43b 235/500: Add pcomplete support to nix.el,
ELPA Syncer <=
- [nongnu] elpa/nix-mode dd49386cc7 240/500: Remove global-nix-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1be3ca4666 245/500: Clean up nix-shell.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 4ef5d77214 246/500: Add user manual, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 2bc99a4542 247/500: Add new CHANGELOG entry., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 14d1bbb936 248/500: Delete dir-locals.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ae2c44c160 250/500: Add nix-shell-haskell.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode c462eb400b 251/500: Add alias for nix-repl-show, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 47cdb44e2e 255/500: Improve indentation robustness, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1c772ad539 253/500: Remove recommended config, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 295cd6729b 261/500: Add nix-edit.el, ELPA Syncer, 2022/01/29