summaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2015-12-11 14:09:27 +0300
committerAlex Kost <alezost@gmail.com>2016-01-02 17:25:35 +0300
commit5c8994d9d91e79e900083328b565f85e2171e077 (patch)
tree7f89afad8faddf92bcfece7df9f2c73dd30014ff /emacs
parent32950fc846e1193769a378a1c277eeb02e5a7f9c (diff)
emacs: Use "B" key in "Package List" to display latest builds.
* emacs/guix-ui-package.el (guix-package-list-latest-builds): New procedure. (guix-package-list-mode-map): Bind "B" key to it. (guix-output-list-mode-map): Likewise. * doc/emacs.texi (Emacs List buffer): Document it.
Diffstat (limited to 'emacs')
-rw-r--r--emacs/guix-ui-package.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/emacs/guix-ui-package.el b/emacs/guix-ui-package.el
index 7d2ce1065d..e0c98eaed6 100644
--- a/emacs/guix-ui-package.el
+++ b/emacs/guix-ui-package.el
@@ -34,6 +34,7 @@
(require 'guix-guile)
(require 'guix-entry)
(require 'guix-utils)
+(require 'guix-hydra-build)
(guix-ui-define-entry-type package)
(guix-ui-define-entry-type output)
@@ -546,6 +547,7 @@ This function is used to hide a \"Download\" button if needed."
(delete . ?D)))
(let ((map guix-package-list-mode-map))
+ (define-key map (kbd "B") 'guix-package-list-latest-builds)
(define-key map (kbd "e") 'guix-package-list-edit)
(define-key map (kbd "x") 'guix-package-list-execute)
(define-key map (kbd "i") 'guix-package-list-mark-install)
@@ -720,6 +722,18 @@ The specification is suitable for `guix-process-package-actions'."
(interactive)
(guix-edit (guix-list-current-id)))
+(defun guix-package-list-latest-builds (number &rest args)
+ "Display latest NUMBER of Hydra builds of the current package.
+Interactively, prompt for NUMBER. With prefix argument, prompt
+for all ARGS."
+ (interactive
+ (let ((entry (guix-list-current-entry)))
+ (guix-hydra-build-latest-prompt-args
+ :job (guix-package-name-specification
+ (guix-entry-value entry 'name)
+ (guix-entry-value entry 'version)))))
+ (apply #'guix-hydra-latest-builds number args))
+
;;; Output 'info'
@@ -784,6 +798,7 @@ The specification is suitable for `guix-process-package-actions'."
(delete . ?D)))
(let ((map guix-output-list-mode-map))
+ (define-key map (kbd "B") 'guix-package-list-latest-builds)
(define-key map (kbd "e") 'guix-output-list-edit)
(define-key map (kbd "x") 'guix-output-list-execute)
(define-key map (kbd "i") 'guix-output-list-mark-install)