diff options
Diffstat (limited to 'attic/elisp/misc.el')
-rw-r--r-- | attic/elisp/misc.el | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/attic/elisp/misc.el b/attic/elisp/misc.el index 8c6e181..3e12ec1 100644 --- a/attic/elisp/misc.el +++ b/attic/elisp/misc.el @@ -950,3 +950,67 @@ 'notmuch-tree-match-author-face 'notmuch-tree-no-match-author-face))) (propertize auth 'face face))) + +;; winttr + +(defun jao-weather (&optional wide) + (interactive "P") + (if (not wide) + (message "%s" + (jao-shell-string "curl -s" + "https://wttr.in/?format=%l++%m++%C+%c+%t+%w++%p")) + (jao-afio-goto-scratch) + (if-let ((b (get-buffer "*wttr*"))) + (progn (pop-to-buffer b) + (term-send-string (get-buffer-process nil) "clear;curl wttr.in\n")) + (jao-exec-in-term "curl wttr.in" "*wttr*")))) +(global-set-key (kbd "<f5>") #'jao-weather) + +;; so-long +(setq large-file-warning-threshold (* 200 1024 1024)) + +(use-package so-long + :ensure t + :diminish) +(global-so-long-mode 1) + +;;;; code reviews +(use-package code-review + :disabled t + :ensure t + :after forge + :bind (:map magit-status-mode-map + ("C-c C-r" . code-review-forge-pr-at-point))) + +;;;; jenkins +(use-package jenkins + :ensure t + :init + ;; one also needs jenkins-api-token, jenkins-username and jenkins-url + ;; optionally: jenkins-colwidth-id, jenkins-colwidth-last-status + (setq jenkins-colwidth-name 35) + :config + (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) + ("f" . jao-jenkins-first-job) + ("RET" . jenkins--show-console-output-from-job-screen)) + :map jenkins-console-output-mode-map + (("n" . next-line) + ("p" . previous-line) + ("g" . jenkins-refresh-console-output)))) |