From 7babc823092f8d6dcf45f147b3457c5f770af527 Mon Sep 17 00:00:00 2001 From: jao Date: Thu, 2 Sep 2021 00:48:56 +0100 Subject: jenkins: refresh console output, brittlely --- init.org | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/init.org b/init.org index baa1953..fbb826b 100644 --- a/init.org +++ b/init.org @@ -2066,12 +2066,21 @@ ;; optionally: jenkins-colwidth-id, jenkins-colwidth-last-status (setq jenkins-colwidth-name 35) :config - (defun jao-jenkins-first-job () + (defun jao-jenkins-first-job (&rest _) (interactive) (goto-char (point-min)) (when (re-search-forward "^- Job" nil t) (goto-char (match-beginning 0)))) (add-hook 'jenkins-job-view-mode-hook #'jao-jenkins-first-job) + (advice-add 'jenkins-job-render :after #'jao-jenkins-first-job) + + (defun jenkins-refresh-console-output () + (interactive) + (let ((n (buffer-name))) + (when (string-match "\\*jenkins-console-\\([^-]+\\)-\\(.+\\)\\*$" n) + (jenkins-get-console-output (match-string 1 n) (match-string 2 n)) + (goto-char (point-max))))) + :bind (:map jenkins-job-view-mode-map (("n" . next-line) ("p" . previous-line) @@ -2080,7 +2089,7 @@ :map jenkins-console-output-mode-map (("n" . next-line) ("p" . previous-line) - ("g" . jenkins--refresh-console-output)))) + ("g" . jenkins-refresh-console-output)))) #+END_SRC * Programming *** Automatic modes -- cgit v1.2.3