Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
4456f964
Commit
4456f964
authored
Oct 26, 2004
by
Daniel Pfeiffer
Browse files
(sgml-mode): Fix imenu-generic-expression and add "Id" and "Name" submenus to it.
parent
8522009e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
lisp/textmodes/sgml-mode.el
lisp/textmodes/sgml-mode.el
+16
-4
No files found.
lisp/textmodes/sgml-mode.el
View file @
4456f964
...
...
@@ -453,10 +453,22 @@ Do \\[describe-key] on the following bindings to discover what they do.
;; recognized.
(set (make-local-variable 'comment-start-skip) "\\(?:<!\\)?--[ \t]*")
(set (make-local-variable 'comment-end-skip) "[ \t]*--\\([ \t\n]*>\\)?")
;; This definition probably is not useful in derived modes.
(set (make-local-variable 'imenu-generic-expression)
(concat "<!\\(element\\|entity\\
)
[
\t\n]+%?[
\t\n]*\\
(
"
sgml-name-re "
\\
)
")))
;; This definition has an HTML leaning but probably fits well for other modes.
(setq imenu-generic-expression
`((nil
,(concat "<!\\(element\\|entity\\
)
[
\t\n]+%?[
\t\n]*\\
(
"
sgml-name-re "
\\
)
")
2)
("
Id
"
,(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 -*-.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment