diff options
author | Yuchen Pei <hi@ypei.me> | 2023-03-25 01:05:54 +1100 |
---|---|---|
committer | Yuchen Pei <hi@ypei.me> | 2023-03-25 01:05:54 +1100 |
commit | 20fd138b70a92fa3dc8a8a44e95fa2be57da092f (patch) | |
tree | 4761ca11bf0e50255f9939d72dbd20957250c9fa /buildbot-build.el | |
parent | 94172a6c655ea4aefe2960aa5db9fec77130e87d (diff) |
Unify the three modes into one (view mode)
Also, now one can press return at any header to go to the respective
object. For example, in step view, one can jump to the revision view
by pressing return at the revision header on top
Diffstat (limited to 'buildbot-build.el')
-rw-r--r-- | buildbot-build.el | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/buildbot-build.el b/buildbot-build.el deleted file mode 100644 index 9e3d913..0000000 --- a/buildbot-build.el +++ /dev/null @@ -1,61 +0,0 @@ -;; -*- lexical-binding: t; -*- -(require 'buildbot-client) -(require 'buildbot-view) - -(define-derived-mode buildbot-build-mode buildbot-view-mode "Buildbot build" - "Buildbot view for a build") - -(defvar-local buildbot-build-build nil) -(defvar-local buildbot-build-revision-info nil) -(defun buildbot-build-buffer-name (buildid) - (concat "*buildbot build " (number-to-string buildid) "*")) - -(defun buildbot-build-load (build revision-info) - (let ((buffer-name (buildbot-build-buffer-name (alist-get 'id build)))) - (with-current-buffer (get-buffer-create buffer-name) - (buildbot-build-mode) - (setq buildbot-build-build build - buildbot-build-revision-info revision-info) - (buildbot-build-update)) - (switch-to-buffer buffer-name))) - -(defun buildbot-build-update () - (unless (derived-mode-p 'buildbot-build-mode) - (error "Not in buildbot build mode")) - (let ((inhibit-read-only t)) - (erase-buffer) - (let ((steps (buildbot-get-steps-by-buildid - (alist-get 'id buildbot-build-build)))) - (insert (buildbot-build-format - buildbot-build-revision-info - buildbot-build-build - steps)) - (goto-char (point-min))))) - -(defun buildbot-build-reload () - (interactive) - (buildbot-build-update)) -(define-key buildbot-build-mode-map "g" 'buildbot-build-reload) - -(defun buildbot-build-format (revision-info build steps) - (concat - (buildbot-view-format-revision-info revision-info) - "\n" - (buildbot-view-format-build build) - "\n" - (string-join - (mapcar 'buildbot-view-format-step steps) - "\n"))) - -(defun buildbot-build-open-step () - (interactive) - (let ((step (get-text-property (point) 'step))) - (unless step - (error "Not at a step")) - (buildbot-step-load buildbot-build-revision-info - buildbot-build-build - step))) -(define-key buildbot-build-mode-map (kbd "<return>") - 'buildbot-build-open-step) - -(provide 'buildbot-build) |