From 45f431c60e02c7a290f8a11c9189b735781749b4 Mon Sep 17 00:00:00 2001 From: Roland Winkler Date: Tue, 25 Jun 2013 21:15:44 +1200 Subject: [PATCH] bibtex-mode: Update imenu-support when dialect changes --- lisp/ChangeLog | 5 +++++ lisp/textmodes/bibtex.el | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 41000df890d..9cd341bfccf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-06-25 Rüdiger Sonderfeld + + * lisp/textmodes/bibtex.el (bibtex-mode, bibtex-set-dialect): + Update imenu-support when dialect changes. + 2013-06-25 Leo Liu * ido.el (ido-read-internal): Allow forward slash on windows. diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index 01a126eb381..6280e19b637 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -3400,9 +3400,6 @@ if that value is non-nil. (set (make-local-variable 'syntax-propertize-function) (syntax-propertize-via-font-lock bibtex-font-lock-syntactic-keywords)) - (setq imenu-generic-expression - (list (list nil bibtex-entry-head bibtex-key-in-head)) - imenu-case-fold-search t) ;; Allow `bibtex-dialect' as a file-local variable. (add-hook 'hack-local-variables-hook 'bibtex-set-dialect nil t)) @@ -3479,7 +3476,10 @@ LOCAL is t for interactive calls." (concat "^[ \t]*@[ \t]*\\(?:" (regexp-opt (append '("String" "Preamble") - (mapcar 'car bibtex-entry-alist))) "\\)")))) + (mapcar 'car bibtex-entry-alist))) "\\)")) + (setq imenu-generic-expression + (list (list nil bibtex-entry-head bibtex-key-in-head)) + imenu-case-fold-search t))) ;; Entry commands and menus for BibTeX dialects ;; We do not use `easy-menu-define' here because this gets confused -- 2.39.2