Skip to content

Commit

Permalink
feat: Make customizable the completion options for the registry list
Browse files Browse the repository at this point in the history
  • Loading branch information
akirak committed Jan 14, 2024
1 parent 0ca65cb commit a2b8553
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions nix3-registry.el
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@
This should be a function that takes a name in a registry as an argument."
:type 'function)

(defcustom nix3-registry-list-completion-options
(list :add-to-registry t
:require-match nil
:no-exact t)
"Plist of options for completion in `nix3-registry-list' command.
These options are passed as arguments to `nix3-registry-complete'."
:type 'plist)

(defface nix3-registry-type-face
'((t :inherit font-lock-type-face))
""
Expand Down Expand Up @@ -246,10 +255,8 @@ registry type and the \"to\" value of the entry."
(defun nix3-registry-list ()
"Display a list of entries in the flake registries."
(interactive)
(let ((name (nix3-registry-complete "Flake: "
:add-to-registry t
:require-match nil
:no-exact t)))
(let ((name (apply #'nix3-registry-complete "Flake: "
nix3-registry-list-completion-options)))
(message "Selected a registry entry %s" name)
(funcall nix3-registry-list-action name)))

Expand Down

0 comments on commit a2b8553

Please sign in to comment.