summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2018-07-16 21:20:56 +0300
committerAlex Kost <alezost@gmail.com>2018-07-16 21:38:21 +0300
commitc219561284d8cf34313ca551b94bca9d5132676d (patch)
treee4be71a1ed99d752bfc8d487afbb10b1bd1e748d
parentFix typos in the docstrings (diff)
downloademacs-build-farm-c219561284d8cf34313ca551b94bca9d5132676d.tar.gz
project: Add "B" key to the List buffer
To show latest builds. * build-farm-project.el (build-farm-project-list-read-jobset): New procedure. (build-farm-project-list-latest-builds): New command. (build-farm-project-list-default-hint): Add it. (build-farm-project-list-mode-map): Bind it to "B".
-rw-r--r--build-farm-project.el24
1 files changed, 23 insertions, 1 deletions
diff --git a/build-farm-project.el b/build-farm-project.el
index dbd32fa..eb6b33d 100644
--- a/build-farm-project.el
+++ b/build-farm-project.el
@@ -25,6 +25,7 @@
(require 'bui)
(require 'build-farm)
(require 'build-farm-url)
+(require 'build-farm-build)
(build-farm-define-entry-type project
:search-types '((all . build-farm-project-url))
@@ -111,6 +112,7 @@ See `build-farm-search-url' for the meaning of SEARCH-TYPE and ARGS."
:hint 'build-farm-project-list-hint)
(let ((map build-farm-project-list-mode-map))
+ (define-key map (kbd "B") 'build-farm-project-list-latest-builds)
(define-key map (kbd "J") 'build-farm-project-list-jobsets))
(defface build-farm-project-list-disabled
@@ -120,7 +122,9 @@ See `build-farm-search-url' for the meaning of SEARCH-TYPE and ARGS."
(defvar build-farm-project-list-default-hint
'(("\\[build-farm-project-list-jobsets]")
- " show jobsets of the current project;\n"))
+ " show jobsets of the current project;\n"
+ ("\\[build-farm-project-list-latest-builds]")
+ " show latest builds of the current project;\n"))
(defun build-farm-project-list-hint ()
"Return hint string for a project-list buffer."
@@ -128,6 +132,13 @@ See `build-farm-search-url' for the meaning of SEARCH-TYPE and ARGS."
build-farm-project-list-default-hint
(bui-default-hint)))
+(defun build-farm-project-list-read-jobset ()
+ "Read jobset for the current project."
+ (build-farm-completing-read
+ "Jobset: "
+ (bui-entry-non-void-value (bui-list-current-entry)
+ 'jobsets)))
+
(defun build-farm-project-list-get-name (name entry)
"Return NAME of the project ENTRY.
Colorize it with an appropriate face if needed."
@@ -143,6 +154,17 @@ Colorize it with an appropriate face if needed."
(interactive)
(build-farm-jobsets (bui-list-current-id)))
+(defun build-farm-project-list-latest-builds (number &rest args)
+ "Display latest NUMBER of builds of the current project.
+Interactively, use `build-farm-number-of-builds' variable for
+NUMBER. With prefix argument, prompt for it and for the other
+ARGS."
+ (interactive
+ (build-farm-build-latest-prompt-args
+ :project (bui-list-current-id)
+ :jobset (build-farm-project-list-read-jobset)))
+ (apply #'build-farm-latest-builds number args))
+
;;; Interactive commands