emacs: Add completions for '--type' option of 'refresh' popup.

* guix/scripts/refresh.scm: Export '%updaters'.
* emacs/guix-main.scm (refresh-updater-names): New procedure.
* emacs/guix-base.el (guix-refresh-updater-names): New function.
* emacs/guix-read.el (guix-read-refresh-updater-names,
  guix-read-refresh-updater-names-string): New functions.
* emacs/guix-command.el (guix-command-improve-refresh-argument): Use
  'guix-read-refresh-updater-names-string'.
This commit is contained in:
Alex Kost 2015-10-28 21:11:36 +03:00
parent 762b1971d8
commit 6407ce8ea1
5 changed files with 18 additions and 1 deletions

View File

@ -186,6 +186,10 @@ For the meaning of location, see `guix-find-location'."
"Return a list of names of available graph node types."
(guix-eval-read (guix-make-guile-expression 'graph-type-names)))
(guix-memoized-defun guix-refresh-updater-names ()
"Return a list of names of available refresh updater types."
(guix-eval-read (guix-make-guile-expression 'refresh-updater-names)))
(guix-memoized-defun guix-lint-checker-names ()
"Return a list of names of available lint checkers."
(guix-eval-read (guix-make-guile-expression 'lint-checker-names)))

View File

@ -241,6 +241,7 @@ to be modified."
(guix-command-define-argument-improver
guix-command-improve-refresh-argument
'(("--select" :fun guix-read-refresh-subset)
("--type" :fun guix-read-refresh-updater-names-string)
("--key-server" :char ?S)))
(guix-command-define-argument-improver

View File

@ -991,6 +991,11 @@ Return #t if the shell command was executed successfully."
"Return a list of names of available graph node types."
(map node-type-name %node-types))
(define (refresh-updater-names)
"Return a list of names of available refresh updater types."
(map (@ (guix upstream) upstream-updater-name)
(@ (guix scripts refresh) %updaters)))
(define (lint-checker-names)
"Return a list of names of available lint checkers."
(map (lambda (checker)

View File

@ -136,6 +136,12 @@ keywords are available:
:single-reader guix-read-refresh-subset
:single-prompt "Refresh subset: ")
(guix-define-readers
:completions-getter guix-refresh-updater-names
:multiple-reader guix-read-refresh-updater-names
:multiple-prompt "Refresh updater,s: "
:multiple-separator ",")
(guix-define-readers
:completions-var guix-help-key-policies
:single-reader guix-read-key-policy

View File

@ -42,7 +42,8 @@
#:use-module (srfi srfi-26)
#:use-module (srfi srfi-37)
#:use-module (rnrs io ports)
#:export (guix-refresh))
#:export (guix-refresh
%updaters))
;;;