From 20fd138b70a92fa3dc8a8a44e95fa2be57da092f Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Sat, 25 Mar 2023 01:05:54 +1100 Subject: 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 --- buildbot-build.el | 61 ------------------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 buildbot-build.el (limited to 'buildbot-build.el') 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 "") - 'buildbot-build-open-step) - -(provide 'buildbot-build) -- cgit v1.2.3