From 69a087571aa807008ba2f792926a2bda29d524bb Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Sat, 15 Jul 2023 15:06:06 +1000 Subject: Adding imenu support --- buildbot-view.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'buildbot-view.el') diff --git a/buildbot-view.el b/buildbot-view.el index a69b923..323d3bc 100644 --- a/buildbot-view.el +++ b/buildbot-view.el @@ -30,7 +30,8 @@ (require 'buildbot-client) (require 'text-property-search) -(defvar buildbot-view-header-regex "^\\[.*\\]$") +(defvar buildbot-view-header-regex "^\\[.*\\]$" + "The header regex in a Buildbot buffer.") (defvar buildbot-view-branch-change-limit 10) (defvar buildbot-view-builder-build-limit 50) ;; 'revision, 'build, 'step, or 'log @@ -51,7 +52,13 @@ "Keymap for `buildbot-view-mode'.") (define-derived-mode buildbot-view-mode special-mode "Buildbot" - "A Buildbot client for Emacs.") + "A Buildbot client for Emacs." + (setq-local imenu-generic-expression + (list (list nil + (format "^\\(?:%s\\).*$" + buildbot-view-header-regex) + 0)) + imenu-space-replacement nil)) (defun buildbot-view-next-header (n) "Move forward N headers." -- cgit v1.2.3