diff options
author | Kyle Meyer <kyle@kyleam.com> | 2016-09-23 22:08:09 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2016-09-23 22:08:09 -0400 |
commit | 92ce20f13e33d6cae5653c02641f74e60cff583e (patch) | |
tree | f05cda2c253c119609f01ec74b4b0506ad91c28e | |
parent | 886fec8a8c5d862b1f33fc794c6b3b6aed3e8b05 (diff) | |
download | emacs.d-92ce20f13e33d6cae5653c02641f74e60cff583e.tar.gz |
latex-imenu-create-index-function: Support short labels
-rw-r--r-- | lisp/km-tex.el | 5 |
1 files changed, 4 insertions, 1 deletions
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 |