From 92ce20f13e33d6cae5653c02641f74e60cff583e Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Fri, 23 Sep 2016 22:08:09 -0400 Subject: latex-imenu-create-index-function: Support short labels --- lisp/km-tex.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/km-tex.el b/lisp/km-tex.el index aef7e8e..b32ef84 100644 --- a/lisp/km-tex.el +++ b/lisp/km-tex.el @@ -27,6 +27,8 @@ ;; See `LaTeX-imenu-create-index-function'. (TeX-update-style) (let ((sec-re (LaTeX-outline-regexp)) + (short-re (rx (zero-or-one "*") + "[" (group (zero-or-more (not (any "]")))) "]")) (title-re (rx (zero-or-one "*") "{" (group (zero-or-more (not (any "}")))))) entries) @@ -34,7 +36,8 @@ (while (re-search-forward sec-re nil t) (let ((sec (replace-regexp-in-string "\\\\" "" (match-string-no-properties 0))) - (title (and (looking-at title-re) + (title (and (or (looking-at short-re) + (looking-at title-re)) (replace-regexp-in-string "\\s-\\s-+" " " (replace-regexp-in-string -- cgit v1.2.3