diff options
| author | Simon Marshall | 1998-01-15 16:11:00 +0000 |
|---|---|---|
| committer | Simon Marshall | 1998-01-15 16:11:00 +0000 |
| commit | b9dd672d871cc6c8e4915c368555ff6fd4c5c767 (patch) | |
| tree | 2fe683f96fad1701b1c87ff68611bafaa55a80d6 | |
| parent | 5c79a131c1a16ab378fe63e4f18612b3e027119e (diff) | |
| download | emacs-b9dd672d871cc6c8e4915c368555ff6fd4c5c767.tar.gz emacs-b9dd672d871cc6c8e4915c368555ff6fd4c5c767.zip | |
(c++-font-lock-extra-types): Add some container classes.
(c-font-lock-keywords-1): Use builtin face for preprocessor directives.
| -rw-r--r-- | lisp/font-lock.el | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 4ffee68ae72..820a90499e7 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -442,42 +442,42 @@ Other variables include those for buffer-specialised fontification functions, | |||
| 442 | '((c-font-lock-keywords c-font-lock-keywords-1 | 442 | '((c-font-lock-keywords c-font-lock-keywords-1 |
| 443 | c-font-lock-keywords-2 c-font-lock-keywords-3) | 443 | c-font-lock-keywords-2 c-font-lock-keywords-3) |
| 444 | nil nil ((?_ . "w")) beginning-of-defun | 444 | nil nil ((?_ . "w")) beginning-of-defun |
| 445 | ;; Obsoleted by Emacs 19.35 parse-partial-sexp's COMMENTSTOP. | 445 | ;; Obsoleted by Emacs 20 parse-partial-sexp's COMMENTSTOP. |
| 446 | ;(font-lock-comment-start-regexp . "/[*/]") | 446 | ;(font-lock-comment-start-regexp . "/[*/]") |
| 447 | (font-lock-mark-block-function . mark-defun))) | 447 | (font-lock-mark-block-function . mark-defun))) |
| 448 | (c++-mode-defaults | 448 | (c++-mode-defaults |
| 449 | '((c++-font-lock-keywords c++-font-lock-keywords-1 | 449 | '((c++-font-lock-keywords c++-font-lock-keywords-1 |
| 450 | c++-font-lock-keywords-2 c++-font-lock-keywords-3) | 450 | c++-font-lock-keywords-2 c++-font-lock-keywords-3) |
| 451 | nil nil ((?_ . "w")) beginning-of-defun | 451 | nil nil ((?_ . "w")) beginning-of-defun |
| 452 | ;; Obsoleted by Emacs 19.35 parse-partial-sexp's COMMENTSTOP. | 452 | ;; Obsoleted by Emacs 20 parse-partial-sexp's COMMENTSTOP. |
| 453 | ;(font-lock-comment-start-regexp . "/[*/]") | 453 | ;(font-lock-comment-start-regexp . "/[*/]") |
| 454 | (font-lock-mark-block-function . mark-defun))) | 454 | (font-lock-mark-block-function . mark-defun))) |
| 455 | (objc-mode-defaults | 455 | (objc-mode-defaults |
| 456 | '((objc-font-lock-keywords objc-font-lock-keywords-1 | 456 | '((objc-font-lock-keywords objc-font-lock-keywords-1 |
| 457 | objc-font-lock-keywords-2 objc-font-lock-keywords-3) | 457 | objc-font-lock-keywords-2 objc-font-lock-keywords-3) |
| 458 | nil nil ((?_ . "w") (?$ . "w")) nil | 458 | nil nil ((?_ . "w") (?$ . "w")) nil |
| 459 | ;; Obsoleted by Emacs 19.35 parse-partial-sexp's COMMENTSTOP. | 459 | ;; Obsoleted by Emacs 20 parse-partial-sexp's COMMENTSTOP. |
| 460 | ;(font-lock-comment-start-regexp . "/[*/]") | 460 | ;(font-lock-comment-start-regexp . "/[*/]") |
| 461 | (font-lock-mark-block-function . mark-defun))) | 461 | (font-lock-mark-block-function . mark-defun))) |
| 462 | (java-mode-defaults | 462 | (java-mode-defaults |
| 463 | '((java-font-lock-keywords java-font-lock-keywords-1 | 463 | '((java-font-lock-keywords java-font-lock-keywords-1 |
| 464 | java-font-lock-keywords-2 java-font-lock-keywords-3) | 464 | java-font-lock-keywords-2 java-font-lock-keywords-3) |
| 465 | nil nil ((?_ . "w") (?$ . "w") (?. . "w")) nil | 465 | nil nil ((?_ . "w") (?$ . "w") (?. . "w")) nil |
| 466 | ;; Obsoleted by Emacs 19.35 parse-partial-sexp's COMMENTSTOP. | 466 | ;; Obsoleted by Emacs 20 parse-partial-sexp's COMMENTSTOP. |
| 467 | ;(font-lock-comment-start-regexp . "/[*/]") | 467 | ;(font-lock-comment-start-regexp . "/[*/]") |
| 468 | (font-lock-mark-block-function . mark-defun))) | 468 | (font-lock-mark-block-function . mark-defun))) |
| 469 | (lisp-mode-defaults | 469 | (lisp-mode-defaults |
| 470 | '((lisp-font-lock-keywords | 470 | '((lisp-font-lock-keywords |
| 471 | lisp-font-lock-keywords-1 lisp-font-lock-keywords-2) | 471 | lisp-font-lock-keywords-1 lisp-font-lock-keywords-2) |
| 472 | nil nil (("+-*/.<>=!?$%_&~^:" . "w")) beginning-of-defun | 472 | nil nil (("+-*/.<>=!?$%_&~^:" . "w")) beginning-of-defun |
| 473 | ;; Obsoleted by Emacs 19.35 parse-partial-sexp's COMMENTSTOP. | 473 | ;; Obsoleted by Emacs 20 parse-partial-sexp's COMMENTSTOP. |
| 474 | ;(font-lock-comment-start-regexp . ";") | 474 | ;(font-lock-comment-start-regexp . ";") |
| 475 | (font-lock-mark-block-function . mark-defun))) | 475 | (font-lock-mark-block-function . mark-defun))) |
| 476 | (scheme-mode-defaults | 476 | (scheme-mode-defaults |
| 477 | '((scheme-font-lock-keywords | 477 | '((scheme-font-lock-keywords |
| 478 | scheme-font-lock-keywords-1 scheme-font-lock-keywords-2) | 478 | scheme-font-lock-keywords-1 scheme-font-lock-keywords-2) |
| 479 | nil t (("+-*/.<>=!?$%_&~^:" . "w")) beginning-of-defun | 479 | nil t (("+-*/.<>=!?$%_&~^:" . "w")) beginning-of-defun |
| 480 | ;; Obsoleted by Emacs 19.35 parse-partial-sexp's COMMENTSTOP. | 480 | ;; Obsoleted by Emacs 20 parse-partial-sexp's COMMENTSTOP. |
| 481 | ;(font-lock-comment-start-regexp . ";") | 481 | ;(font-lock-comment-start-regexp . ";") |
| 482 | (font-lock-mark-block-function . mark-defun))) | 482 | (font-lock-mark-block-function . mark-defun))) |
| 483 | ;; For TeX modes we could use `backward-paragraph' for the same reason. | 483 | ;; For TeX modes we could use `backward-paragraph' for the same reason. |
| @@ -489,7 +489,7 @@ Other variables include those for buffer-specialised fontification functions, | |||
| 489 | '((tex-font-lock-keywords | 489 | '((tex-font-lock-keywords |
| 490 | tex-font-lock-keywords-1 tex-font-lock-keywords-2) | 490 | tex-font-lock-keywords-1 tex-font-lock-keywords-2) |
| 491 | nil nil ((?$ . "\"")) nil | 491 | nil nil ((?$ . "\"")) nil |
| 492 | ;; Obsoleted by Emacs 19.35 parse-partial-sexp's COMMENTSTOP. | 492 | ;; Obsoleted by Emacs 20 parse-partial-sexp's COMMENTSTOP. |
| 493 | ;(font-lock-comment-start-regexp . "%") | 493 | ;(font-lock-comment-start-regexp . "%") |
| 494 | (font-lock-mark-block-function . mark-paragraph))) | 494 | (font-lock-mark-block-function . mark-paragraph))) |
| 495 | ) | 495 | ) |
| @@ -562,7 +562,7 @@ When called with no args it should leave point at the beginning of any | |||
| 562 | enclosing textual block and mark at the end. | 562 | enclosing textual block and mark at the end. |
| 563 | This is normally set via `font-lock-defaults'.") | 563 | This is normally set via `font-lock-defaults'.") |
| 564 | 564 | ||
| 565 | ;; Obsoleted by Emacs 19.35 parse-partial-sexp's COMMENTSTOP. | 565 | ;; Obsoleted by Emacs 20 parse-partial-sexp's COMMENTSTOP. |
| 566 | ;(defvar font-lock-comment-start-regexp nil | 566 | ;(defvar font-lock-comment-start-regexp nil |
| 567 | ; "*Regexp to match the start of a comment. | 567 | ; "*Regexp to match the start of a comment. |
| 568 | ;This need not discriminate between genuine comments and quoted comment | 568 | ;This need not discriminate between genuine comments and quoted comment |
| @@ -1894,7 +1894,7 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item." | |||
| 1894 | ;; Function declarations. | 1894 | ;; Function declarations. |
| 1895 | "\\(advice\\|alias\\|" | 1895 | "\\(advice\\|alias\\|" |
| 1896 | "ine-\\(derived-mode\\|function\\|skeleton\\|widget\\)\\|" | 1896 | "ine-\\(derived-mode\\|function\\|skeleton\\|widget\\)\\|" |
| 1897 | "macro\\|subst\\|un\\|method\\)\\|" | 1897 | "macro\\|method\\|subst\\|un\\)\\|" |
| 1898 | ;; Variable declarations. | 1898 | ;; Variable declarations. |
| 1899 | "\\(const\\|custom\\|face\\|var\\)\\|" | 1899 | "\\(const\\|custom\\|face\\|var\\)\\|" |
| 1900 | ;; Structure declarations. | 1900 | ;; Structure declarations. |
| @@ -2220,11 +2220,20 @@ The value of this variable is used when Font Lock mode is turned on." | |||
| 2220 | :type 'font-lock-extra-types-widget | 2220 | :type 'font-lock-extra-types-widget |
| 2221 | :group 'font-lock-extra-types) | 2221 | :group 'font-lock-extra-types) |
| 2222 | 2222 | ||
| 2223 | (defcustom c++-font-lock-extra-types '("string" "wchar_t") | 2223 | (defcustom c++-font-lock-extra-types |
| 2224 | '("[io]?\\(f\\|str\\)?stream\\(buf\\)?" "ios" | ||
| 2225 | "string" "rope" | ||
| 2226 | "list" "slist" | ||
| 2227 | "deque" "vector" "bit_vector" | ||
| 2228 | "set" "multiset" | ||
| 2229 | "map" "multimap" | ||
| 2230 | "hash\\(_\\(m\\(ap\\|ulti\\(map\\|set\\)\\)\\|set\\)\\)?" | ||
| 2231 | "stack" "queue" "priority_queue" | ||
| 2232 | "iterator" "const_iterator" "reverse_iterator" "const_reverse_iterator") | ||
| 2224 | "*List of extra types to fontify in C++ mode. | 2233 | "*List of extra types to fontify in C++ mode. |
| 2225 | Each list item should be a regexp not containing word-delimiters. | 2234 | Each list item should be a regexp not containing word-delimiters. |
| 2226 | For example, a value of (\"string\" \"wchar_t\") means the words string and | 2235 | For example, a value of (\"string\") means the word string is treated as a type |
| 2227 | wchar_t are treated as type names. | 2236 | name. |
| 2228 | 2237 | ||
| 2229 | The value of this variable is used when Font Lock mode is turned on." | 2238 | The value of this variable is used when Font Lock mode is turned on." |
| 2230 | :type 'font-lock-extra-types-widget | 2239 | :type 'font-lock-extra-types-widget |
| @@ -2315,11 +2324,11 @@ See also `c-font-lock-extra-types'.") | |||
| 2315 | ;; Fontify symbol names in #elif or #if ... defined preprocessor directives. | 2324 | ;; Fontify symbol names in #elif or #if ... defined preprocessor directives. |
| 2316 | '("^#[ \t]*\\(elif\\|if\\)\\>" | 2325 | '("^#[ \t]*\\(elif\\|if\\)\\>" |
| 2317 | ("\\<\\(defined\\)\\>[ \t]*(?\\(\\sw+\\)?" nil nil | 2326 | ("\\<\\(defined\\)\\>[ \t]*(?\\(\\sw+\\)?" nil nil |
| 2318 | (1 font-lock-reference-face) (2 font-lock-variable-name-face nil t))) | 2327 | (1 font-lock-builtin-face) (2 font-lock-variable-name-face nil t))) |
| 2319 | ;; | 2328 | ;; |
| 2320 | ;; Fontify otherwise as symbol names, and the preprocessor directive names. | 2329 | ;; Fontify otherwise as symbol names, and the preprocessor directive names. |
| 2321 | '("^#[ \t]*\\(\\sw+\\)\\>[ \t]*\\(\\sw+\\)?" | 2330 | '("^#[ \t]*\\(\\sw+\\)\\>[ \t!]*\\(\\sw+\\)?" |
| 2322 | (1 font-lock-reference-face) (2 font-lock-variable-name-face nil t)) | 2331 | (1 font-lock-builtin-face) (2 font-lock-variable-name-face nil t)) |
| 2323 | )) | 2332 | )) |
| 2324 | 2333 | ||
| 2325 | (setq c-font-lock-keywords-2 | 2334 | (setq c-font-lock-keywords-2 |