From 4456f9649b1b92d39f50b1512900c6c57171785e Mon Sep 17 00:00:00 2001 From: Daniel Pfeiffer Date: Tue, 26 Oct 2004 21:38:57 +0000 Subject: [PATCH] (sgml-mode): Fix imenu-generic-expression and add "Id" and "Name" submenus to it. --- lisp/textmodes/sgml-mode.el | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 6e7b2a9a51c..4ac96b2e4b0 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -453,10 +453,22 @@ Do \\[describe-key] on the following bindings to discover what they do. ;; recognized. (set (make-local-variable 'comment-start-skip) "\\(?:\\)?") - ;; This definition probably is not useful in derived modes. - (set (make-local-variable 'imenu-generic-expression) - (concat "]+[ \t\n]+[Ii][Dd]=\\(['\"]" + (if sgml-xml-mode "" "?") + "\\)\\(" sgml-name-re "\\)\\1") + 2) + ("Name" + ,(concat "<[^>]+[ \t\n]+[Nn][Aa][Mm][Ee]=\\(['\"]" + (if sgml-xml-mode "" "?") + "\\)\\(" sgml-name-re "\\)\\1") + 2)))) ;; Some programs (such as Glade 2) generate XML which has ;; -*- mode: xml -*-. -- 2.39.5