aboutsummaryrefslogtreecommitdiff
path: root/buildbot-view.el
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2023-03-28 00:14:03 +1100
committerYuchen Pei <hi@ypei.me>2023-03-28 00:14:03 +1100
commit16947d6b1a2679ca94f9986b0dc77683cfad900f (patch)
tree6e74e0eb9c97e0aaa7631ec84398fd1601547ffd /buildbot-view.el
parent519956a4f61debf0d257b3ddd6121f0b1df4f6c8 (diff)
Adding function to go to next / previous header of the same thing
Diffstat (limited to 'buildbot-view.el')
-rw-r--r--buildbot-view.el22
1 files changed, 22 insertions, 0 deletions
diff --git a/buildbot-view.el b/buildbot-view.el
index e1b8e55..dd0d4b0 100644
--- a/buildbot-view.el
+++ b/buildbot-view.el
@@ -37,6 +37,17 @@
(beginning-of-line 1)))
(define-key buildbot-view-mode-map "n" 'buildbot-view-next-header)
+(defun buildbot-view-next-header-same-thing (n)
+ (interactive "p")
+ (when-let
+ ((type (get-text-property (point) 'type)))
+ (dotimes (_ n)
+ (buildbot-view-next-header 1)
+ (while (not (eq (get-text-property (point) 'type) type))
+ (buildbot-view-next-header 1)))))
+(define-key buildbot-view-mode-map (kbd "M-n")
+ 'buildbot-view-next-header-same-thing)
+
(defun buildbot-view-previous-header (n)
(interactive "p")
(beginning-of-line 1)
@@ -46,6 +57,17 @@
(re-search-backward buildbot-view-header-regex)))
(define-key buildbot-view-mode-map "p" 'buildbot-view-previous-header)
+(defun buildbot-view-previous-header-same-thing (n)
+ (interactive "p")
+ (when-let
+ ((type (get-text-property (point) 'type)))
+ (dotimes (_ n)
+ (buildbot-view-previous-header 1)
+ (while (not (eq (get-text-property (point) 'type) type))
+ (buildbot-view-previous-header 1)))))
+(define-key buildbot-view-mode-map (kbd "M-p")
+ 'buildbot-view-previous-header-same-thing)
+
(defun buildbot-view-format-revision-info (revision-info)
(propertize
(format