Commit graph

188 commits

Author SHA1 Message Date
Richard M. Stallman
0cccb49d7a (initializing from font-lock-face-attributes):
Use :weight and :slant, not :bold and :italic.
(various face definitions): Likewise.
2001-12-31 20:16:46 +00:00
Richard M. Stallman
9dd481237a (font-lock-mode): Put our function at the end of after-change-functions. 2001-12-11 06:05:12 +00:00
Stefan Monnier
47fc2db3eb (font-lock-cache-state, font-lock-cache-position)
(font-lock-ppss-stats, font-lock-ppss): Remove.
(font-lock-fontify-syntactically-region): Remove tuning code.
(font-lock-compile-keywords): Fix off-by-one bug.
(font-lock-set-defaults): Don't set removed vars.
(c-keywords): Add `inline'.
(c-type-names): Add `_Complex', `_Imaginary' and `_Bool'.
2001-11-25 22:01:15 +00:00
Stefan Monnier
2d5eba0eb7 (font-lock-compile-keywords): New arg `regexp'.
If set and if applicable, add a regexp to highlight defun-like
text inside comments and strings.
(font-lock-fontify-keywords-region): Pass that new arg.
(font-lock-set-defaults): Move the code to set `font-lock-keywords'
to the end and pass that new arg.
(c-font-lock-keywords-2): Fix regex for labels.
(font-lock-match-c++-style-declaration-item-and-skip-to-next):
Make it work when LIMIT is several lines further.
(c-font-lock-keywords-3, c++-font-lock-keywords-3)
(objc-font-lock-keywords-3, java-font-lock-keywords-3):
Use backquote and make the regexes for `int a, b, c;' work on
multiple lines.
2001-11-18 02:10:01 +00:00
Stefan Monnier
c1966bb444 (font-lock-match-c-style-declaration-item-and-skip-to-next):
Also work when LIMIT is further than the end of line.
2001-11-06 17:01:58 +00:00
Stefan Monnier
9aa4040191 (java-font-lock-syntactic-face-function): New fun.
(font-lock-defaults-alist): Use it.  From David Ponce <david.ponce@wanadoo.fr>
2001-10-31 02:54:06 +00:00
Stefan Monnier
8259bf101d Require `syntax'.
(font-lock-defaults-alist): Don't define keywords for lisp languages.
Use `c-font-lock-syntactic-face-function' for c languages.
(font-lock-mode): Don't unset vars when turning the mode off.
(font-lock-default-fontify-buffer): Don't unset vars at the end.
(font-lock-extra-managed-props): New var.
(font-lock-default-unfontify-region): Use it.
(font-lock-apply-syntactic-highlight): Flush the syntax cache.
Don't eval the value when there's no match.
(font-lock-ppss-stats): New var.
(font-lock-ppss): New fun.
(font-lock-fontify-syntactically-region): Use it and syntax.ppss.
(font-lock-apply-highlight): Allow `highlight' to set several props.
(font-lock-set-defaults): Use dolist.
(font-lock-unset-defaults): Remove.
(font-lock-match-c-style-declaration-item-and-skip-to-next):
Try to recognize prototypes using `foo P_ ((args))'.
({c,c++,java,objc}-font-lock-keywords-{1,2,3}): Don't setq a defconst.
(c-font-lock-keywords-2): Fix last change to still use Anders' trick.
(c-font-lock-syntactic-face-function): New function.
(font-lock-match-c++-style-declaration-item-and-skip-to-next)
(c++-keywords): Use a more sophisticated regexp to handle
shallowly nested templates.
2001-10-28 04:48:16 +00:00
Sam Steingold
07fedaed79 (c-font-lock-keywords-2): Do not require labels to be alone on the line. 2001-10-26 15:04:58 +00:00
Gerd Moellmann
54f73af324 (toplevel): Require `jit-lock' only if
font-lock-support-mode is set to jit-lock-mode.
2001-09-05 13:38:49 +00:00
Gerd Moellmann
7e5d8879fc (c++-keywords): Add Standard C++ operator names. 2001-07-19 13:25:34 +00:00
Gerd Moellmann
b5e2c7a755 (c-font-lock-keywords-3): When matching something
like `struct X Y', finish with point after Y.
2001-07-04 09:17:34 +00:00
Eli Zaretskii
ce6b198260 (font-lock-comment-face): For tty's with dark
background, use "red1", since "lightred" is not one of the colors
recognized by tty-colors.el.
2001-06-15 10:16:29 +00:00
Gerd Moellmann
7c5312b237 (lisp-font-lock-keywords-1): Add `defvaralias'. 2001-05-20 08:53:44 +00:00
Stefan Monnier
558371ba97 Docstring fixes. 2001-05-11 20:33:15 +00:00
Eli Zaretskii
22cd6fd3c0 (font-lock-mode): Doc fix. 2001-04-30 14:03:07 +00:00
Sam Steingold
1087f19878 made font-lock-keywords-case-fold-search buffer-local 2001-04-05 18:49:46 +00:00
Stefan Monnier
15d1caef82 (save-buffer-state): Use inhibit-modification-hooks
rather than (before|after)-change-functions.
2001-03-01 17:49:04 +00:00
Eli Zaretskii
dcc70c380e (font-lock-mode): Doc fix. 2001-01-23 11:23:07 +00:00
Gerd Moellmann
111c181ec1 (font-lock-default-fontify-region): Fix last
change.
2001-01-19 13:51:25 +00:00
Gerd Moellmann
f926102066 (font-lock-multiline): Default to nil.
(font-lock-default-fontify-region): If font-lock-multiline is
nil, don't check the property `font-lock-multiline'.
2001-01-19 13:32:08 +00:00
Kenichi Handa
31b482ee84 (c-font-lock-extra-types): Add "Lisp_Object". 2001-01-10 12:28:06 +00:00
Stefan Monnier
724a330fe4 (font-lock-default-fontify-region):
Include the terminating \n (off-by-one error).
(font-lock-set-defaults): Use dolist.
2000-12-07 11:59:38 +00:00
Gerd Moellmann
1bc7654adc (java-keywords): Add MATCH-HIGHLIGHT part for
javadoc tags.
2000-11-20 16:17:34 +00:00
Stefan Monnier
1c172af45c (font-lock-*-face) <defvar>: Move.
(font-lock-defaults-alist): Mark obsolete.
(font-lock-mode, font-lock-mode-hook) <defvar>: Remove.
(font-lock-mode): Use define-minor-mode.
(font-lock-support-mode): Tweak type to default to jit-lock-mode.
(font-lock-turn-off-thing-lock): Be more explicit.
(font-lock-apply-syntactic-highlight): Use string-to-syntax after eval.
(font-lock-syntactic-face-function): New var.
(font-lock-fontify-syntactically-region): Use it.
(font-lock-doc-face): New.
2000-11-10 00:57:45 +00:00
Stefan Monnier
ba22aeff64 (font-lock-buffers): Remove.
(font-lock-global-modes): Define with easy-mmode-define-global-mode.
(font-lock-change-major-mode): Remove.
(turn-on-font-lock-if-enabled): Only apply to the current buffer.
(font-lock-default-fontify-region): Extend the multiline
fontification to whole lines.
(font-lock-fontify-anchored-keywords)
(font-lock-fontify-keywords-region): If matching just one
line (with \n) only mark the \n as multiline.
2000-11-03 04:32:33 +00:00
Eli Zaretskii
8379c86876 (font-lock-comment-face): Define a separate default
for dark-background tty's.
2000-10-17 12:00:37 +00:00
Stefan Monnier
5299cb8e97 (font-lock-syntactic-keywords): Fix docstring. 2000-10-15 22:13:01 +00:00
Stefan Monnier
c0a6a9fe28 (font-lock-syntactically-fontified): New var.
(font-lock-fontify-syntactic-keywords-region): Use it.
(font-lock-mode): Fix docstring.  Don't need make-local-hook anymore.
2000-10-15 04:51:57 +00:00
Miles Bader
86b7fcbb0c (font-lock-comment-face): Change dark-background,
color, non-tty, default to `chocolate1'.
2000-10-15 02:31:42 +00:00
Stefan Monnier
fd612dd946 (font-lock-defaults): Make buffer-local.
(font-lock-turn-on-thing-lock): Use jit-lock-refontify.
(font-lock-choose-keywords):
Ignore LEVEL unless KEYWORDS is a list of syms.
(c-keywords, c++-keywords, objc-keywords, java-keywords):
Don't wrap regexp-opt things in \(...\) unnecessarily.
2000-10-08 19:07:14 +00:00
Eli Zaretskii
3b967bedc7 (font-lock-mode, global-font-lock-mode): Mention in
the doc strings how to customize Font Lock faces.
2000-10-08 06:50:22 +00:00
Stefan Monnier
28a53bc103 (font-lock-defaults-alist): Remove the TeX entries.
(tex-font-lock-keywords, tex-font-lock-keywords-2)
(tex-font-lock-keywords-1): Remove.
(font-lock-turn-on-thing-lock): Use jit-lock-register.
(font-lock-turn-off-thing-lock): Use jit-lock-unregister.
(font-lock-default-fontify-region): Expand beg..end correctly
when just following a multiline region.
(font-lock-fontify-anchored-keywords):
Include the anchor text as part of the multiline.
2000-10-06 16:02:27 +00:00
Stefan Monnier
d2251bbf79 Replace confusing (,@ with ,
(tex-font-lock-keywords-1, tex-font-lock-keywords-2):
Don't use regexp-opt-depth.  Spice up the regexp for args.
Don't distinguish between cmds that can take an opt arg or not.
Use `append' and `prepend' rather than `keep'.
2000-09-29 01:53:42 +00:00
Gerd Moellmann
afd3c8cd42 (font-lock-mode): Change message telling the user
that ``the buffer is too big''.
2000-09-19 11:03:14 +00:00
Gerd Moellmann
8e5b2bfe48 Require jit-lock to prevent a late message `Loading jit-lock' message. 2000-08-15 14:10:04 +00:00
Sam Steingold
5e9e032a38 * emacs-lisp/cl-indent.el (toplevel): Indent `defclass',
`defconst', `define-condition', `with-slots'.
* font-lock.el (lisp-font-lock-keywords-2): Added `with-' and `do-'.
2000-08-07 16:51:57 +00:00
Dave Love
c69e5fcdae (font-lock-fontify-anchored-keywords): Use line-beginning-position.
(font-lock-support-mode) <defgroup>: Add :version.
(global-font-lock-mode): Use mapc.
2000-06-23 19:37:14 +00:00
Stefan Monnier
13f0d185ef (font-lock-after-fontify-buffer)
(font-lock-after-unfontify-buffer): No need to call back to jit-lock.
2000-06-17 17:22:41 +00:00
Stefan Monnier
1a5c5f2e4f (lisp-font-lock-keywords-1): Add define-minor-mode. 2000-05-12 18:11:37 +00:00
Gerd Moellmann
0279f991f7 Update copyright. Remove Simon Marshall's email
address on request from him.
2000-05-11 14:44:17 +00:00
Gerd Moellmann
bdb25c9734 (font-lock-apply-syntactic-highlight): if VALUE
is a string, convert it to a syntax cell using string-to-syntax.
2000-03-18 01:33:13 +00:00
Stefan Monnier
afa18a4e5d (font-lock-keywords): Fix the doc now that regexp-opt-depth is unnecessary.
(save-buffer-state): Set an edebug spec.
(font-lock-fontify-anchored-keywords): Properly handle the case where the
matcher goes past the limit.
2000-03-11 03:50:50 +00:00
Gerd Moellmann
11b42ef4cd (lisp-font-lock-keywords-1): Highlight
`(defun (setf foo)' differently.
2000-03-09 13:28:42 +00:00
Gerd Moellmann
32038c7ac0 (java-keywords): Added missing java 1.2.2 Javadoc tags. 2000-02-29 09:37:22 +00:00
Stefan Monnier
6e1d0d151d (font-lock-keywords): Fix doc for multiline matches.
(font-lock-add-keywords): Make it work even if font-lock-mode is nil,
so that it can be used more easily in <foo>-mode-hook.  Also make sure
to avoid duplicate entries.
(font-lock-update-removed-keyword-alist): Renamed `major-mode'->`mode'.
(font-lock-remove-keywords): Just as was done for `add', allow it to
work even if font-lock-mode is nil.  Also make sure we don't modify
any pre-existing list by forcing a copy-sequence.  Finally rename
`major-mode' to `mode'.
(font-lock-fontify-syntactic-anchored-keywords)
(font-lock-fontify-anchored-keywords)
(font-lock-fontify-keywords-region): Use line-end-position.
Don't make `font-lock-multiline' local (it's now done in
font-lock-set-defaults).
(font-lock-set-defaults): Make `font-lock-multiline' local.  Also
move the `font-lock-fontified' creation to inside the `unless'.
2000-02-07 01:49:33 +00:00
Dave Love
01b691481a (turn-on-font-lock): Don't depend on window-system &c. 2000-01-24 22:16:14 +00:00
Gerd Moellmann
76f5e2afd4 System for adding and removing keywords.
Both local (previously added keyword) and global keywords
can be removed.
(font-lock-remove-keywords): New user-level function.
(font-lock-update-removed-keyword-alist): New internal function.
(font-lock-removed-keywords-alist): New variable.
(font-lock-add-keywords): Updates `font-lock-removed-keywords-alist'.
Empty `font-lock-keywords-alist' when `append' is `set' to avoid
growing datastructures.
(font-lock-set-defaults): Removes keywords stored in
`font-lock-removed-keywords-alist' after local keywords added.
(c-keywords, c++-keywords): Better "case" support for
complex constant expressions, e.g. "case 1<<A_BIT_NO:".
(c-keywords): Only highlight preprocessor
directives when spelled correctly.
(font-lock-match-c++-structor-declaration,
c++-keywords): Fontify constructors and destructors with function
face inside C++ class declarations.
1999-12-16 15:05:06 +00:00
Gerd Moellmann
340fe50f3b (java-keywords): Add Javadoc tags as of JDK 1.2.1. 1999-12-16 12:11:18 +00:00
Stefan Monnier
041470d2d9 (font-lock-multiline): New variable.
(font-lock-add-keywords): Rename `major-mode' into `mode'.
(font-lock-remove-keywords): Added a dummy `mode' argument for
potential future support.
(font-lock-fontify-anchored-keywords,
(font-lock-fontify-keywords-region): Only handle multiline strings
if necessary (avoids a pathological behavior in (f.ex) diff-mode).
1999-12-09 12:52:34 +00:00
Stefan Monnier
3708dfe933 (font-lock-default-fontify-region): Fix subtle
off-by-one problem that could force re-fontifying the whole buffer.
(font-lock-remove-keywords): New function.
(font-lock-add-keywords): Use the new function to ensure idempotence.
1999-12-07 06:31:57 +00:00