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
b9998c33
Commit
b9998c33
authored
Oct 07, 1994
by
Richard M. Stallman
Browse files
(outline-font-lock-keywords): New variable.
(outline-mode): Set font-lock-keywords locally.
parent
5f562719
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
lisp/textmodes/ooutline.el
lisp/textmodes/ooutline.el
+16
-0
No files found.
lisp/textmodes/ooutline.el
View file @
b9998c33
...
...
@@ -134,6 +134,20 @@ in the file it applies to.")
(
setq
minor-mode-alist
(
append
minor-mode-alist
(
list
'
(
outline-minor-mode
" Outl"
)))))
(
defvar
outline-font-lock-keywords
'
(
;; Highlight headings according to the level.
(
"^\\(\\*+\\)[ \t]*\\(.+\\)?[ \t]*$"
(
1
font-lock-string-face
)
(
2
(
let
((
len
(
-
(
match-end
1
)
(
match-beginning
1
))))
(
or
(
cdr
(
assq
len
'
((
1
.
font-lock-function-name-face
)
(
2
.
font-lock-keyword-face
)
(
3
.
font-lock-comment-face
))))
font-lock-variable-name-face
))
nil
t
))
;; Highight citations of the form [1] and [Mar94].
(
"\\[\\([A-Z][A-Za-z]+\\)*[0-9]+\\]"
.
font-lock-type-face
))
"Additional expressions to highlight in Outline mode."
)
;;;###autoload
(
defun
outline-mode
()
"Set major mode for editing outlines with selective display.
...
...
@@ -192,6 +206,8 @@ Turning on outline mode calls the value of `text-mode-hook' and then of
(
make-local-variable
'paragraph-separate
)
(
setq
paragraph-separate
(
concat
paragraph-separate
"\\|^\\("
outline-regexp
"\\)"
))
(
make-local-variable
'font-lock-keywords
)
(
setq
font-lock-keywords
outline-font-lock-keywords
)
(
make-local-variable
'change-major-mode-hook
)
(
add-hook
'change-major-mode-hook
'show-all
)
(
run-hooks
'text-mode-hook
'outline-mode-hook
))
...
...
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