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-step.el | 54 ------------------------------------------------------ 1 file changed, 54 deletions(-) delete mode 100644 buildbot-step.el (limited to 'buildbot-step.el') diff --git a/buildbot-step.el b/buildbot-step.el deleted file mode 100644 index 1058410..0000000 --- a/buildbot-step.el +++ /dev/null @@ -1,54 +0,0 @@ -;; -*- lexical-binding: t; -*- -(require 'buildbot-client) -(require 'buildbot-view) - -(define-derived-mode buildbot-step-mode buildbot-view-mode "Buildbot step" - "Buildbot view for a step") - -(defvar-local buildbot-step-revision-info nil) -(defvar-local buildbot-step-build nil) -(defvar-local buildbot-step-step nil) -(defun buildbot-step-buffer-name (stepid) - (concat "*buildbot step " (number-to-string stepid) "*")) - -(defun buildbot-step-load (revision-info build step) - (let ((buffer-name (buildbot-step-buffer-name (alist-get 'stepid step)))) - (with-current-buffer (get-buffer-create buffer-name) - (buildbot-step-mode) - (setq buildbot-step-revision-info revision-info - buildbot-step-build build - buildbot-step-step step) - (buildbot-step-update)) - (switch-to-buffer buffer-name))) - -(defun buildbot-step-update () - (unless (derived-mode-p 'buildbot-step-mode) - (error "Not in buildbot step mode")) - (let ((inhibit-read-only t)) - (erase-buffer) - (let ((logs (buildbot-get-logs-by-stepid - (alist-get 'stepid buildbot-step-step)))) - (insert (buildbot-step-format - buildbot-step-revision-info - buildbot-step-build - buildbot-step-step - logs)) - (goto-char (point-min))))) - -(defun buildbot-step-reload () - (interactive) - (buildbot-step-update)) -(define-key buildbot-step-mode-map "g" 'buildbot-step-reload) - -(defun buildbot-step-format (revision-info build step logs) - (concat - (buildbot-view-format-revision-info revision-info) - "\n" - (buildbot-view-format-build build) - "\n" - (buildbot-view-format-step step) - (string-join - (mapcar 'buildbot-view-format-log logs) - "\n"))) - -(provide 'buildbot-step) -- cgit v1.2.3