guix-commits
[Top][All Lists]
Advanced

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

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


From: Alex Kost
Subject: 01/04: emacs: Add completions for '--type' option of 'refresh' popup.
Date: Mon, 02 Nov 2015 13:00:56 +0000

alezost pushed a commit to branch master
in repository guix.

commit 6407ce8ea1b67024e50273b7d6a1773a16a42322
Author: Alex Kost <address@hidden>
Date:   Wed Oct 28 21:11:36 2015 +0300

    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'.
---
 emacs/guix-base.el       |    4 ++++
 emacs/guix-command.el    |    1 +
 emacs/guix-main.scm      |    5 +++++
 emacs/guix-read.el       |    6 ++++++
 guix/scripts/refresh.scm |    3 ++-
 5 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/emacs/guix-base.el b/emacs/guix-base.el
index 2e99c54..14ea3d4 100644
--- a/emacs/guix-base.el
+++ b/emacs/guix-base.el
@@ -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)))
diff --git a/emacs/guix-command.el b/emacs/guix-command.el
index 36ce7bc..f8a6df7 100644
--- a/emacs/guix-command.el
+++ b/emacs/guix-command.el
@@ -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
diff --git a/emacs/guix-main.scm b/emacs/guix-main.scm
index e29a0a0..9eac518 100644
--- a/emacs/guix-main.scm
+++ b/emacs/guix-main.scm
@@ -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)
diff --git a/emacs/guix-read.el b/emacs/guix-read.el
index 5a7201c..e60af9c 100644
--- a/emacs/guix-read.el
+++ b/emacs/guix-read.el
@@ -137,6 +137,12 @@ keywords are available:
  :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
  :single-prompt "Key policy: ")
diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index 04f6b76..0df4121 100644
--- a/guix/scripts/refresh.scm
+++ b/guix/scripts/refresh.scm
@@ -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))
 
 
 ;;;



reply via email to

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