From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?R=FCdiger?= Sonderfeld Newsgroups: gmane.emacs.devel Subject: [PATCH 1/2] bibtex.el: Fix imenu support. Date: Wed, 12 Jun 2013 00:41:04 +0200 Message-ID: <8168665.uZZAIiq8gV@descartes> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1370990489 9845 80.91.229.3 (11 Jun 2013 22:41:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Jun 2013 22:41:29 +0000 (UTC) Cc: winkler@gnu.org To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 12 00:41:28 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UmXFo-0005FD-7P for ged-emacs-devel@m.gmane.org; Wed, 12 Jun 2013 00:41:28 +0200 Original-Received: from localhost ([::1]:55436 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmXFn-0004Ma-Sv for ged-emacs-devel@m.gmane.org; Tue, 11 Jun 2013 18:41:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44288) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmXFf-0004LR-8c for emacs-devel@gnu.org; Tue, 11 Jun 2013 18:41:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UmXFZ-0005FO-43 for emacs-devel@gnu.org; Tue, 11 Jun 2013 18:41:19 -0400 Original-Received: from ptmx.org ([178.63.28.110]:59336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmXFY-0005FC-T9; Tue, 11 Jun 2013 18:41:13 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by ptmx.org (Postfix) with ESMTP id 25BC021632; Wed, 12 Jun 2013 00:41:11 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at ptmx.org Original-Received: from ptmx.org ([127.0.0.1]) by localhost (ptmx.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Pqb6mUliMQL2; Wed, 12 Jun 2013 00:41:09 +0200 (CEST) Original-Received: from descartes.localnet (chello080108246092.7.14.vie.surfer.at [80.108.246.92]) by ptmx.org (Postfix) with ESMTPSA id 6D471215FF; Wed, 12 Jun 2013 00:41:09 +0200 (CEST) User-Agent: KMail/4.10.3 (Linux/3.8.0-23-generic; KDE/4.10.3; x86_64; ; ) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 178.63.28.110 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:160359 Archived-At: The bug was introduced in revision 104969. * lisp/textmodes/bibtex.el (bibtex-mode, bibtex-set-dialect): Update imenu-support when dialect changes. Signed-off-by: R=C3=BCdiger Sonderfeld --- lisp/textmodes/bibtex.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index 01a126e..6280e19 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -3400,9 +3400,6 @@ (define-derived-mode bibtex-mode nil "BibTeX" (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)) =20 @@ -3479,7 +3476,10 @@ (defun bibtex-set-dialect (&optional dialect loc= al) (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))) =20 ;; Entry commands and menus for BibTeX dialects ;; We do not use `easy-menu-define' here because this gets confused --=20 1.8.3