[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/zuul d58e139493 08/17: Update zuul-open-build-log imple
From: |
ELPA Syncer |
Subject: |
[elpa] externals/zuul d58e139493 08/17: Update zuul-open-build-log implementation |
Date: |
Tue, 30 Aug 2022 11:58:25 -0400 (EDT) |
branch: externals/zuul
commit d58e13949308b0e96a7490963d3df7df2d1866d0
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>
Update zuul-open-build-log implementation
---
README.md | 15 ++++++++-------
notes.org | 4 ++--
zuul.el | 24 +++++++++++++++++++-----
3 files changed, 29 insertions(+), 14 deletions(-)
diff --git a/README.md b/README.md
index f4ec0f9baa..cc818129ef 100644
--- a/README.md
+++ b/README.md
@@ -38,18 +38,19 @@ The functions `zuul-get-builds` and `zuul-get-buildsets`
needs to be called to r
(zuul-get-builds :change "300203")
```
-A list of builds, or buildsets, can be passed as input to the
`zuul-open-build-log` in order to view a specific build log.
+A query to retrieve builds or buildsets can be provided as input to the
`zuul-open-build-log` in order to view a specific build log.
``` emacs-lisp
-;; For buildsets
+;; Query provided as a list
(zuul-open-build-log
- (zuul-get-buildsets
- :change "300203"))
+ '(zuul-get-buildsets
+ :change "300203"))
-;; For builds
+;; Query provided as a function
(zuul-open-build-log
- (zuul-get-builds
- :change "300203"))
+ (lambda ()
+ '(zuul-get-builds
+ :change "300203")))
```
# Zuul log mode
diff --git a/notes.org b/notes.org
index 050c8e4478..9a96e4146c 100644
--- a/notes.org
+++ b/notes.org
@@ -92,7 +92,7 @@ Select and open a build retrieved with =zuul-get-builds=.
#+begin_src elisp :results none
(let ((zuul-build-display-buffer-action 'display-buffer-pop-up-window))
- (zuul-open-build-log
+ (zuul--open-build-log
(zuul-get-builds
:change "300203")))
#+end_src
@@ -101,7 +101,7 @@ Select and open a build retrieved with =zuul-get-buildsets=.
#+begin_src elisp :results none
(let ((zuul-build-display-buffer-action 'display-buffer-pop-up-window))
- (zuul-open-build-log
+ (zuul--open-build-log
(zuul-get-buildsets
:change "300203")))
#+end_src
diff --git a/zuul.el b/zuul.el
index c7d5a25ca2..2ff40ec697 100644
--- a/zuul.el
+++ b/zuul.el
@@ -274,7 +274,21 @@ Each entry in the list is a property list with the
following properties:
"Return BUILD's data."
(zuul--build-data build))
-(defun zuul-open-build-log (builds-or-buildsets)
+(defun zuul-open-build-log (query)
+ "Open a build log based on QUERY.
+
+Query which can either be a list or a function returning a list.
+The content of the list should be the query function to use as well as
+the parameter to pass to it. Examples of query functions are:
+- `zuul-get-buildsets'
+- `zuul-get-builds'"
+ (when-let ((builds-or-buildsets
+ (apply (if (functionp query)
+ (funcall query)
+ query))))
+ (zuul--open-build-log builds-or-buildsets)))
+
+(defun zuul--open-build-log (builds-or-buildsets)
"Open a build log from an item in list BUILDS-OR-BUILDSETS."
(when (or (and (listp builds-or-buildsets)
(or (zuul-buildset-p (seq-first builds-or-buildsets))
@@ -354,7 +368,7 @@ Optionally provide parameters CHANGE, PROJECT, PATCHSET and
LIMIT."
"Switch to another build."
(interactive)
(let ((zuul--builds zuul--current-builds))
- (zuul-open-build-log
+ (zuul--open-build-log
(zuul--builds zuul--current-build))))
;;;###autoload
@@ -362,7 +376,7 @@ Optionally provide parameters CHANGE, PROJECT, PATCHSET and
LIMIT."
"Switch to a build from a specific buildset."
(interactive)
(let ((zuul--builds zuul--current-builds))
- (zuul-open-build-log
+ (zuul--open-build-log
(zuul--buildsets zuul--current-build))))
;;;###autoload
@@ -398,7 +412,7 @@ Optionally provide parameters CHANGE, PROJECT, PATCHSET and
LIMIT."
(length builds-with-index)))
(next-build
(cdr (assoc next-index builds-with-index))))
- (zuul-open-build-log next-build)))
+ (zuul--open-build-log next-build)))
;;;###autoload
(defun zuul-previous-build ()
@@ -414,7 +428,7 @@ Optionally provide parameters CHANGE, PROJECT, PATCHSET and
LIMIT."
(length builds-with-index)))
(previous-build
(cdr (assoc previous-index builds-with-index))))
- (zuul-open-build-log previous-build)))
+ (zuul--open-build-log previous-build)))
;;;###autoload
(defun zuul-quit-build ()
- [elpa] externals/zuul 0003af3679 10/17: Add functions for anonymized screenshots, (continued)
- [elpa] externals/zuul 0003af3679 10/17: Add functions for anonymized screenshots, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul 36fb6e7a13 15/17: Address feedback from package-lint, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul c3e69263ce 14/17: Update command section in README, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul b14fb97cc0 03/17: Replace keybinding for eldoc-mode, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul c15f79d769 07/17: Add previous/next command in build log, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul 982b0eac12 09/17: Add faces for prompt and input in zuul build, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul 83f68268cc 01/17: Add LICENSE file, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul 58af096228 04/17: Update output to contain cmd as well, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul aecdb85b15 02/17: Add zuul.el, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul ad20c55828 17/17: Update required Emacs version, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul d58e139493 08/17: Update zuul-open-build-log implementation,
ELPA Syncer <=
- [elpa] externals/zuul ef4dba22c6 11/17: Increase anonymity, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul 3c0e5ccd4e 16/17: Address feedback from checkdoc, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul 02c7f26463 12/17: Version 0.2, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul 22d942a78c 13/17: Bump header version in zuul.el, ELPA Syncer, 2022/08/30