summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-09-23 22:08:09 -0400
committerKyle Meyer <kyle@kyleam.com>2016-09-23 22:08:09 -0400
commit92ce20f13e33d6cae5653c02641f74e60cff583e (patch)
treef05cda2c253c119609f01ec74b4b0506ad91c28e /lisp
parent886fec8a8c5d862b1f33fc794c6b3b6aed3e8b05 (diff)
downloademacs.d-92ce20f13e33d6cae5653c02641f74e60cff583e.tar.gz
latex-imenu-create-index-function: Support short labels
Diffstat (limited to 'lisp')
-rw-r--r--lisp/km-tex.el5
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