diff options
| author | Stefan Monnier | 2000-09-29 01:53:42 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2000-09-29 01:53:42 +0000 |
| commit | d2251bbf79c3a3c7739f0813ac85c0f99d295d6d (patch) | |
| tree | 0559daba68333c44c5c121c5550b02ab35b5c1a4 /lisp | |
| parent | d6709b80940bb4ed50fe98c6882f4f8d2d6ca299 (diff) | |
| download | emacs-d2251bbf79c3a3c7739f0813ac85c0f99d295d6d.tar.gz emacs-d2251bbf79c3a3c7739f0813ac85c0f99d295d6d.zip | |
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'.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/font-lock.el | 204 |
1 files changed, 79 insertions, 125 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index aa6c0524c51..bb035077f8d 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -630,14 +630,14 @@ Major/minor modes can set this variable if they know which option applies.") | |||
| 630 | ;; We use this to preserve or protect things when modifying text properties. | 630 | ;; We use this to preserve or protect things when modifying text properties. |
| 631 | (defmacro save-buffer-state (varlist &rest body) | 631 | (defmacro save-buffer-state (varlist &rest body) |
| 632 | "Bind variables according to VARLIST and eval BODY restoring buffer state." | 632 | "Bind variables according to VARLIST and eval BODY restoring buffer state." |
| 633 | (` (let* ((,@ (append varlist | 633 | `(let* ,(append varlist |
| 634 | '((modified (buffer-modified-p)) (buffer-undo-list t) | 634 | '((modified (buffer-modified-p)) (buffer-undo-list t) |
| 635 | (inhibit-read-only t) (inhibit-point-motion-hooks t) | 635 | (inhibit-read-only t) (inhibit-point-motion-hooks t) |
| 636 | before-change-functions after-change-functions | 636 | before-change-functions after-change-functions |
| 637 | deactivate-mark buffer-file-name buffer-file-truename)))) | 637 | deactivate-mark buffer-file-name buffer-file-truename)) |
| 638 | (,@ body) | 638 | ,@body |
| 639 | (when (and (not modified) (buffer-modified-p)) | 639 | (when (and (not modified) (buffer-modified-p)) |
| 640 | (set-buffer-modified-p nil))))) | 640 | (set-buffer-modified-p nil)))) |
| 641 | (put 'save-buffer-state 'lisp-indent-function 1) | 641 | (put 'save-buffer-state 'lisp-indent-function 1) |
| 642 | (def-edebug-spec save-buffer-state let) | 642 | (def-edebug-spec save-buffer-state let) |
| 643 | ;; | 643 | ;; |
| @@ -2222,63 +2222,35 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item." | |||
| 2222 | ;; Rewritten with the help of Alexandra Bac <abac@welcome.disi.unige.it>. | 2222 | ;; Rewritten with the help of Alexandra Bac <abac@welcome.disi.unige.it>. |
| 2223 | (defconst tex-font-lock-keywords-1 | 2223 | (defconst tex-font-lock-keywords-1 |
| 2224 | (eval-when-compile | 2224 | (eval-when-compile |
| 2225 | (let* (;; | 2225 | (let* (;; Names of commands whose arg should be fontified as heading, etc. |
| 2226 | ;; Names of commands whose arg should be fontified as heading, etc. | 2226 | (headings (regexp-opt |
| 2227 | (headings (regexp-opt '("title" "begin" "end") t)) | 2227 | '("title" "begin" "end" "chapter" "part" |
| 2228 | ;; These commands have optional args. | 2228 | "section" "subsection" "subsubsection" |
| 2229 | (headings-opt (regexp-opt | 2229 | "paragraph" "subparagraph" "subsubparagraph" |
| 2230 | '("chapter" "part" | 2230 | "newcommand" "renewcommand" "newenvironment" |
| 2231 | "section" "subsection" "subsubsection" | 2231 | "newtheorem") |
| 2232 | "section*" "subsection*" "subsubsection*" | 2232 | t)) |
| 2233 | "paragraph" "subparagraph" "subsubparagraph" | ||
| 2234 | "paragraph*" "subparagraph*" "subsubparagraph*" | ||
| 2235 | "newcommand" "renewcommand" "newenvironment" | ||
| 2236 | "newtheorem" | ||
| 2237 | "newcommand*" "renewcommand*" "newenvironment*" | ||
| 2238 | "newtheorem*") | ||
| 2239 | t)) | ||
| 2240 | (variables (regexp-opt | 2233 | (variables (regexp-opt |
| 2241 | '("newcounter" "newcounter*" "setcounter" "addtocounter" | 2234 | '("newcounter" "newcounter*" "setcounter" "addtocounter" |
| 2242 | "setlength" "addtolength" "settowidth") | 2235 | "setlength" "addtolength" "settowidth") |
| 2243 | t)) | 2236 | t)) |
| 2244 | (includes (regexp-opt | 2237 | (includes (regexp-opt |
| 2245 | '("input" "include" "includeonly" "bibliography" | 2238 | '("input" "include" "includeonly" "bibliography" |
| 2246 | "epsfig" "psfig" "epsf") | 2239 | "epsfig" "psfig" "epsf" "nofiles" "usepackage" |
| 2240 | "includegraphics" "includegraphics*") | ||
| 2247 | t)) | 2241 | t)) |
| 2248 | (includes-opt (regexp-opt | ||
| 2249 | '("nofiles" "usepackage" | ||
| 2250 | "includegraphics" "includegraphics*") | ||
| 2251 | t)) | ||
| 2252 | ;; Miscellany. | 2242 | ;; Miscellany. |
| 2253 | (slash "\\\\") | 2243 | (slash "\\\\") |
| 2254 | (opt "\\(\\[[^]]*\\]\\)?") | 2244 | (opt "\\(\\[[^]]*\\]\\)?") |
| 2255 | (arg "{\\([^}]+\\)") | 2245 | (arg "{\\(\\(?:[^{}]+\\(?:{[^}]*}\\)?\\)+\\)")) |
| 2256 | (opt-depth (regexp-opt-depth opt)) | ||
| 2257 | (arg-depth (regexp-opt-depth arg)) | ||
| 2258 | ) | ||
| 2259 | (list | 2246 | (list |
| 2260 | ;; | ||
| 2261 | ;; Heading args. | 2247 | ;; Heading args. |
| 2262 | (list (concat slash headings arg) | 2248 | (list (concat slash headings "\\*?" opt arg) |
| 2263 | (+ (regexp-opt-depth headings) arg-depth) | 2249 | 3 'font-lock-function-name-face 'prepend) |
| 2264 | 'font-lock-function-name-face) | ||
| 2265 | (list (concat slash headings-opt opt arg) | ||
| 2266 | (+ (regexp-opt-depth headings-opt) opt-depth arg-depth) | ||
| 2267 | 'font-lock-function-name-face) | ||
| 2268 | ;; | ||
| 2269 | ;; Variable args. | 2250 | ;; Variable args. |
| 2270 | (list (concat slash variables arg) | 2251 | (list (concat slash variables arg) 2 'font-lock-variable-name-face) |
| 2271 | (+ (regexp-opt-depth variables) arg-depth) | ||
| 2272 | 'font-lock-variable-name-face) | ||
| 2273 | ;; | ||
| 2274 | ;; Include args. | 2252 | ;; Include args. |
| 2275 | (list (concat slash includes arg) | 2253 | (list (concat slash includes opt arg) 3 'font-lock-builtin-face) |
| 2276 | (+ (regexp-opt-depth includes) arg-depth) | ||
| 2277 | 'font-lock-builtin-face) | ||
| 2278 | (list (concat slash includes-opt opt arg) | ||
| 2279 | (+ (regexp-opt-depth includes-opt) opt-depth arg-depth) | ||
| 2280 | 'font-lock-builtin-face) | ||
| 2281 | ;; | ||
| 2282 | ;; Definitions. I think. | 2254 | ;; Definitions. I think. |
| 2283 | '("^[ \t]*\\\\def\\\\\\(\\(\\w\\|@\\)+\\)" | 2255 | '("^[ \t]*\\\\def\\\\\\(\\(\\w\\|@\\)+\\)" |
| 2284 | 1 font-lock-function-name-face) | 2256 | 1 font-lock-function-name-face) |
| @@ -2297,12 +2269,10 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item." | |||
| 2297 | ;; | 2269 | ;; |
| 2298 | ;; Names of commands whose arg should be fontified as a citation. | 2270 | ;; Names of commands whose arg should be fontified as a citation. |
| 2299 | (citations (regexp-opt | 2271 | (citations (regexp-opt |
| 2300 | '("label" "ref" "pageref" "vref" "eqref") | 2272 | '("label" "ref" "pageref" "vref" "eqref" |
| 2273 | "cite" "nocite" "caption" "index" "glossary" | ||
| 2274 | "footnote" "footnotemark" "footnotetext") | ||
| 2301 | t)) | 2275 | t)) |
| 2302 | (citations-opt (regexp-opt | ||
| 2303 | '("cite" "nocite" "caption" "index" "glossary" | ||
| 2304 | "footnote" "footnotemark" "footnotetext") | ||
| 2305 | t)) | ||
| 2306 | ;; | 2276 | ;; |
| 2307 | ;; Names of commands that should be fontified. | 2277 | ;; Names of commands that should be fontified. |
| 2308 | (specials (regexp-opt | 2278 | (specials (regexp-opt |
| @@ -2316,19 +2286,11 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item." | |||
| 2316 | ;; Miscellany. | 2286 | ;; Miscellany. |
| 2317 | (slash "\\\\") | 2287 | (slash "\\\\") |
| 2318 | (opt "\\(\\[[^]]*\\]\\)?") | 2288 | (opt "\\(\\[[^]]*\\]\\)?") |
| 2319 | (arg "{\\([^}]+\\)") | 2289 | (arg "{\\(\\(?:[^{}]+\\(?:{[^}]*}\\)?\\)+\\)")) |
| 2320 | (opt-depth (regexp-opt-depth opt)) | ||
| 2321 | (arg-depth (regexp-opt-depth arg)) | ||
| 2322 | ) | ||
| 2323 | (list | 2290 | (list |
| 2324 | ;; | 2291 | ;; |
| 2325 | ;; Citation args. | 2292 | ;; Citation args. |
| 2326 | (list (concat slash citations arg) | 2293 | (list (concat slash citations opt arg) 3 'font-lock-constant-face) |
| 2327 | (+ (regexp-opt-depth citations) arg-depth) | ||
| 2328 | 'font-lock-constant-face) | ||
| 2329 | (list (concat slash citations-opt opt arg) | ||
| 2330 | (+ (regexp-opt-depth citations-opt) opt-depth arg-depth) | ||
| 2331 | 'font-lock-constant-face) | ||
| 2332 | ;; | 2294 | ;; |
| 2333 | ;; Command names, special and general. | 2295 | ;; Command names, special and general. |
| 2334 | (cons (concat slash specials) 'font-lock-warning-face) | 2296 | (cons (concat slash specials) 'font-lock-warning-face) |
| @@ -2336,20 +2298,14 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item." | |||
| 2336 | ;; | 2298 | ;; |
| 2337 | ;; Font environments. It seems a bit dubious to use `bold' etc. faces | 2299 | ;; Font environments. It seems a bit dubious to use `bold' etc. faces |
| 2338 | ;; since we might not be able to display those fonts. | 2300 | ;; since we might not be able to display those fonts. |
| 2339 | (list (concat slash bold arg) | 2301 | (list (concat slash bold arg) 2 '(quote bold) 'append) |
| 2340 | (+ (regexp-opt-depth bold) arg-depth) | 2302 | (list (concat slash italic arg) 2 '(quote italic) 'append) |
| 2341 | '(quote bold) 'keep) | 2303 | (list (concat slash type arg) 2 '(quote bold-italic) 'append) |
| 2342 | (list (concat slash italic arg) | ||
| 2343 | (+ (regexp-opt-depth italic) arg-depth) | ||
| 2344 | '(quote italic) 'keep) | ||
| 2345 | (list (concat slash type arg) | ||
| 2346 | (+ (regexp-opt-depth type) arg-depth) | ||
| 2347 | '(quote bold-italic) 'keep) | ||
| 2348 | ;; | 2304 | ;; |
| 2349 | ;; Old-style bf/em/it/sl. Stop at `\\' and un-escaped `&', for tables. | 2305 | ;; Old-style bf/em/it/sl. Stop at `\\' and un-escaped `&', for tables. |
| 2350 | (list (concat "\\\\\\(\\(bf\\)\\|em\\|it\\|sl\\)\\>" | 2306 | (list (concat "\\\\\\(\\(bf\\)\\|em\\|it\\|sl\\)\\>" |
| 2351 | "\\(\\([^}&\\]\\|\\\\[^\\]\\)+\\)") | 2307 | "\\(\\([^}&\\]\\|\\\\[^\\]\\)+\\)") |
| 2352 | 3 '(if (match-beginning 2) 'bold 'italic) 'keep) | 2308 | 3 '(if (match-beginning 2) 'bold 'italic) 'append) |
| 2353 | )))) | 2309 | )))) |
| 2354 | "Gaudy expressions to highlight in TeX modes.") | 2310 | "Gaudy expressions to highlight in TeX modes.") |
| 2355 | 2311 | ||
| @@ -2465,22 +2421,21 @@ See also `c-font-lock-extra-types'.") | |||
| 2465 | (c-type-names | 2421 | (c-type-names |
| 2466 | `(mapconcat 'identity | 2422 | `(mapconcat 'identity |
| 2467 | (cons | 2423 | (cons |
| 2468 | (,@ (eval-when-compile | 2424 | ,(eval-when-compile |
| 2469 | (regexp-opt | 2425 | (regexp-opt |
| 2470 | '("char" "short" "int" "long" "signed" "unsigned" | 2426 | '("char" "short" "int" "long" "signed" "unsigned" |
| 2471 | "float" "double" "void" "complex")))) | 2427 | "float" "double" "void" "complex"))) |
| 2472 | c-font-lock-extra-types) | 2428 | c-font-lock-extra-types) |
| 2473 | "\\|")) | 2429 | "\\|")) |
| 2474 | (c-type-names-depth | 2430 | (c-type-names-depth |
| 2475 | `(regexp-opt-depth (,@ c-type-names))) | 2431 | `(regexp-opt-depth ,c-type-names)) |
| 2476 | (c-preprocessor-directives | 2432 | (c-preprocessor-directives |
| 2477 | (eval-when-compile | 2433 | (eval-when-compile |
| 2478 | (regexp-opt | 2434 | (regexp-opt |
| 2479 | '("define" "elif" "else" "endif" "error" "file" "if" "ifdef" | 2435 | '("define" "elif" "else" "endif" "error" "file" "if" "ifdef" |
| 2480 | "ifndef" "include" "line" "pragma" "undef")))) | 2436 | "ifndef" "include" "line" "pragma" "undef")))) |
| 2481 | (c-preprocessor-directives-depth | 2437 | (c-preprocessor-directives-depth |
| 2482 | (regexp-opt-depth c-preprocessor-directives)) | 2438 | (regexp-opt-depth c-preprocessor-directives))) |
| 2483 | ) | ||
| 2484 | (setq c-font-lock-keywords-1 | 2439 | (setq c-font-lock-keywords-1 |
| 2485 | (list | 2440 | (list |
| 2486 | ;; | 2441 | ;; |
| @@ -2511,8 +2466,7 @@ See also `c-font-lock-extra-types'.") | |||
| 2511 | "\\)\\>[ \t!]*\\(\\sw+\\)?") | 2466 | "\\)\\>[ \t!]*\\(\\sw+\\)?") |
| 2512 | '(1 font-lock-builtin-face) | 2467 | '(1 font-lock-builtin-face) |
| 2513 | (list (+ 2 c-preprocessor-directives-depth) | 2468 | (list (+ 2 c-preprocessor-directives-depth) |
| 2514 | 'font-lock-variable-name-face nil t)) | 2469 | 'font-lock-variable-name-face nil t)))) |
| 2515 | )) | ||
| 2516 | 2470 | ||
| 2517 | (setq c-font-lock-keywords-2 | 2471 | (setq c-font-lock-keywords-2 |
| 2518 | (append c-font-lock-keywords-1 | 2472 | (append c-font-lock-keywords-1 |
| @@ -2522,7 +2476,7 @@ See also `c-font-lock-extra-types'.") | |||
| 2522 | ;; | 2476 | ;; |
| 2523 | ;; Fontify all type names. | 2477 | ;; Fontify all type names. |
| 2524 | `(eval . | 2478 | `(eval . |
| 2525 | (cons (concat "\\<\\(" (,@ c-type-names) "\\)\\>") 'font-lock-type-face)) | 2479 | (cons (concat "\\<\\(" ,c-type-names "\\)\\>") 'font-lock-type-face)) |
| 2526 | ;; | 2480 | ;; |
| 2527 | ;; Fontify all builtin keywords (except case, default and goto; see below). | 2481 | ;; Fontify all builtin keywords (except case, default and goto; see below). |
| 2528 | (concat "\\<\\(" c-keywords "\\|" c-type-specs "\\)\\>") | 2482 | (concat "\\<\\(" c-keywords "\\|" c-type-specs "\\)\\>") |
| @@ -2552,14 +2506,14 @@ See also `c-font-lock-extra-types'.") | |||
| 2552 | ;; | 2506 | ;; |
| 2553 | ;; Fontify all storage types, plus their items. | 2507 | ;; Fontify all storage types, plus their items. |
| 2554 | `(eval . | 2508 | `(eval . |
| 2555 | (list (concat "\\<\\(" (,@ c-type-names) "\\)\\>" | 2509 | (list (concat "\\<\\(" ,c-type-names "\\)\\>" |
| 2556 | "\\([ \t*&]+\\sw+\\>\\)*") | 2510 | "\\([ \t*&]+\\sw+\\>\\)*") |
| 2557 | ;; Fontify each declaration item. | 2511 | ;; Fontify each declaration item. |
| 2558 | (list 'font-lock-match-c-style-declaration-item-and-skip-to-next | 2512 | (list 'font-lock-match-c-style-declaration-item-and-skip-to-next |
| 2559 | ;; Start with point after all type specifiers. | 2513 | ;; Start with point after all type specifiers. |
| 2560 | (list 'goto-char (list 'or | 2514 | (list 'goto-char (list 'or |
| 2561 | (list 'match-beginning | 2515 | (list 'match-beginning |
| 2562 | (+ (,@ c-type-names-depth) 2)) | 2516 | (+ ,c-type-names-depth 2)) |
| 2563 | '(match-end 1))) | 2517 | '(match-end 1))) |
| 2564 | ;; Finish with point after first type specifier. | 2518 | ;; Finish with point after first type specifier. |
| 2565 | '(goto-char (match-end 1)) | 2519 | '(goto-char (match-end 1)) |
| @@ -2570,10 +2524,10 @@ See also `c-font-lock-extra-types'.") | |||
| 2570 | ;; | 2524 | ;; |
| 2571 | ;; Fontify all storage specs and types, plus their items. | 2525 | ;; Fontify all storage specs and types, plus their items. |
| 2572 | `(eval . | 2526 | `(eval . |
| 2573 | (list (concat "\\<\\(" (,@ c-type-specs) "\\)\\>" | 2527 | (list (concat "\\<\\(" ,c-type-specs "\\)\\>" |
| 2574 | "[ \t]*\\(\\sw+\\)?") | 2528 | "[ \t]*\\(\\sw+\\)?") |
| 2575 | (list 1 'font-lock-keyword-face) | 2529 | (list 1 'font-lock-keyword-face) |
| 2576 | (list (+ (,@ c-type-specs-depth) 2) 'font-lock-type-face nil t) | 2530 | (list ,(+ c-type-specs-depth 2) 'font-lock-type-face nil t) |
| 2577 | (list 'font-lock-match-c-style-declaration-item-and-skip-to-next | 2531 | (list 'font-lock-match-c-style-declaration-item-and-skip-to-next |
| 2578 | nil nil | 2532 | nil nil |
| 2579 | ;; Fontify as a variable or function name. | 2533 | ;; Fontify as a variable or function name. |
| @@ -2698,14 +2652,14 @@ See also `c++-font-lock-extra-types'.") | |||
| 2698 | (c++-type-names | 2652 | (c++-type-names |
| 2699 | `(mapconcat 'identity | 2653 | `(mapconcat 'identity |
| 2700 | (cons | 2654 | (cons |
| 2701 | (,@ (eval-when-compile | 2655 | ,(eval-when-compile |
| 2702 | (regexp-opt | 2656 | (regexp-opt |
| 2703 | '("signed" "unsigned" "short" "long" | 2657 | '("signed" "unsigned" "short" "long" |
| 2704 | "int" "char" "float" "double" "void" | 2658 | "int" "char" "float" "double" "void" |
| 2705 | "bool" "complex")))) | 2659 | "bool" "complex"))) |
| 2706 | c++-font-lock-extra-types) | 2660 | c++-font-lock-extra-types) |
| 2707 | "\\|")) | 2661 | "\\|")) |
| 2708 | (c++-type-names-depth `(regexp-opt-depth (,@ c++-type-names))) | 2662 | (c++-type-names-depth `(regexp-opt-depth ,c++-type-names)) |
| 2709 | ;; | 2663 | ;; |
| 2710 | ;; A brave attempt to match templates following a type and/or match | 2664 | ;; A brave attempt to match templates following a type and/or match |
| 2711 | ;; class membership. See and sync the above function | 2665 | ;; class membership. See and sync the above function |
| @@ -2719,7 +2673,7 @@ See also `c++-font-lock-extra-types'.") | |||
| 2719 | ;; | 2673 | ;; |
| 2720 | ;; Parenthesis depth of user-defined types not forgetting their cruft. | 2674 | ;; Parenthesis depth of user-defined types not forgetting their cruft. |
| 2721 | (c++-type-depth `(regexp-opt-depth | 2675 | (c++-type-depth `(regexp-opt-depth |
| 2722 | (concat (,@ c++-type-names) (,@ c++-type-suffix)))) | 2676 | (concat ,c++-type-names ,c++-type-suffix))) |
| 2723 | ) | 2677 | ) |
| 2724 | (setq c++-font-lock-keywords-1 | 2678 | (setq c++-font-lock-keywords-1 |
| 2725 | (append | 2679 | (append |
| @@ -2743,7 +2697,7 @@ See also `c++-font-lock-extra-types'.") | |||
| 2743 | ;; | 2697 | ;; |
| 2744 | ;; The list `c-font-lock-keywords-2' for C++ plus operator overloading. | 2698 | ;; The list `c-font-lock-keywords-2' for C++ plus operator overloading. |
| 2745 | `(eval . | 2699 | `(eval . |
| 2746 | (cons (concat "\\<\\(" (,@ c++-type-names) "\\)\\>") | 2700 | (cons (concat "\\<\\(" ,c++-type-names "\\)\\>") |
| 2747 | 'font-lock-type-face)) | 2701 | 'font-lock-type-face)) |
| 2748 | ;; | 2702 | ;; |
| 2749 | ;; Fontify operator overloading. | 2703 | ;; Fontify operator overloading. |
| @@ -2786,15 +2740,15 @@ See also `c++-font-lock-extra-types'.") | |||
| 2786 | ;; | 2740 | ;; |
| 2787 | ;; Fontify all storage classes and type specifiers, plus their items. | 2741 | ;; Fontify all storage classes and type specifiers, plus their items. |
| 2788 | `(eval . | 2742 | `(eval . |
| 2789 | (list (concat "\\<\\(" (,@ c++-type-names) "\\)\\>" (,@ c++-type-suffix) | 2743 | (list (concat "\\<\\(" ,c++-type-names "\\)\\>" ,c++-type-suffix |
| 2790 | "\\([ \t*&]+" (,@ c++-type-spec) "\\)*") | 2744 | "\\([ \t*&]+" ,c++-type-spec "\\)*") |
| 2791 | ;; The name of any template type. | 2745 | ;; The name of any template type. |
| 2792 | (list (+ (,@ c++-type-names-depth) 3) 'font-lock-type-face nil t) | 2746 | (list (+ ,c++-type-names-depth 3) 'font-lock-type-face nil t) |
| 2793 | ;; Fontify each declaration item. | 2747 | ;; Fontify each declaration item. |
| 2794 | (list 'font-lock-match-c++-style-declaration-item-and-skip-to-next | 2748 | (list 'font-lock-match-c++-style-declaration-item-and-skip-to-next |
| 2795 | ;; Start with point after all type specifiers. | 2749 | ;; Start with point after all type specifiers. |
| 2796 | (list 'goto-char (list 'or (list 'match-beginning | 2750 | (list 'goto-char (list 'or (list 'match-beginning |
| 2797 | (+ (,@ c++-type-depth) 2)) | 2751 | (+ ,c++-type-depth 2)) |
| 2798 | '(match-end 1))) | 2752 | '(match-end 1))) |
| 2799 | ;; Finish with point after first type specifier. | 2753 | ;; Finish with point after first type specifier. |
| 2800 | '(goto-char (match-end 1)) | 2754 | '(goto-char (match-end 1)) |
| @@ -2812,12 +2766,12 @@ See also `c++-font-lock-extra-types'.") | |||
| 2812 | ;; | 2766 | ;; |
| 2813 | ;; Fontify all storage specs and types, plus their items. | 2767 | ;; Fontify all storage specs and types, plus their items. |
| 2814 | `(eval . | 2768 | `(eval . |
| 2815 | (list (concat "\\<" (,@ c++-type-specs) "\\>" (,@ c++-type-suffix) | 2769 | (list (concat "\\<" ,c++-type-specs "\\>" ,c++-type-suffix |
| 2816 | "[ \t]*\\(" (,@ c++-type-spec) "\\)?") | 2770 | "[ \t]*\\(" ,c++-type-spec "\\)?") |
| 2817 | ;; The name of any template type. | 2771 | ;; The name of any template type. |
| 2818 | (list (+ (,@ c++-type-specs-depth) 2) 'font-lock-type-face nil t) | 2772 | (list ,(+ c++-type-specs-depth 2) 'font-lock-type-face nil t) |
| 2819 | ;; The name of any type. | 2773 | ;; The name of any type. |
| 2820 | (list (+ (,@ c++-type-specs-depth) (,@ c++-type-suffix-depth) 2) | 2774 | (list (+ ,c++-type-specs-depth ,c++-type-suffix-depth 2) |
| 2821 | 'font-lock-type-face nil t) | 2775 | 'font-lock-type-face nil t) |
| 2822 | ;; Fontify each declaration item. | 2776 | ;; Fontify each declaration item. |
| 2823 | (list 'font-lock-match-c++-style-declaration-item-and-skip-to-next | 2777 | (list 'font-lock-match-c++-style-declaration-item-and-skip-to-next |
| @@ -2899,15 +2853,15 @@ See also `objc-font-lock-extra-types'.") | |||
| 2899 | (objc-type-names | 2853 | (objc-type-names |
| 2900 | `(mapconcat 'identity | 2854 | `(mapconcat 'identity |
| 2901 | (cons | 2855 | (cons |
| 2902 | (,@ (eval-when-compile | 2856 | ,(eval-when-compile |
| 2903 | (regexp-opt | 2857 | (regexp-opt |
| 2904 | '("signed" "unsigned" "short" "long" | 2858 | '("signed" "unsigned" "short" "long" |
| 2905 | "int" "char" "float" "double" "void" | 2859 | "int" "char" "float" "double" "void" |
| 2906 | "id")))) | 2860 | "id"))) |
| 2907 | objc-font-lock-extra-types) | 2861 | objc-font-lock-extra-types) |
| 2908 | "\\|")) | 2862 | "\\|")) |
| 2909 | (objc-type-names-depth | 2863 | (objc-type-names-depth |
| 2910 | `(regexp-opt-depth (,@ objc-type-names))) | 2864 | `(regexp-opt-depth ,objc-type-names)) |
| 2911 | ) | 2865 | ) |
| 2912 | (setq objc-font-lock-keywords-1 | 2866 | (setq objc-font-lock-keywords-1 |
| 2913 | (append | 2867 | (append |
| @@ -2946,7 +2900,7 @@ See also `objc-font-lock-extra-types'.") | |||
| 2946 | ;; | 2900 | ;; |
| 2947 | ;; Fontify all type specifiers. | 2901 | ;; Fontify all type specifiers. |
| 2948 | `(eval . | 2902 | `(eval . |
| 2949 | (cons (concat "\\<\\(" (,@ objc-type-names) "\\)\\>") | 2903 | (cons (concat "\\<\\(" ,objc-type-names "\\)\\>") |
| 2950 | 'font-lock-type-face)) | 2904 | 'font-lock-type-face)) |
| 2951 | ;; | 2905 | ;; |
| 2952 | ;; Fontify all builtin keywords (except case, default and goto; see below). | 2906 | ;; Fontify all builtin keywords (except case, default and goto; see below). |
| @@ -2974,14 +2928,14 @@ See also `objc-font-lock-extra-types'.") | |||
| 2974 | ;; | 2928 | ;; |
| 2975 | ;; Fontify all storage classes and type specifiers, plus their items. | 2929 | ;; Fontify all storage classes and type specifiers, plus their items. |
| 2976 | `(eval . | 2930 | `(eval . |
| 2977 | (list (concat "\\<\\(" (,@ objc-type-names) "\\)\\>" | 2931 | (list (concat "\\<\\(" ,objc-type-names "\\)\\>" |
| 2978 | "\\([ \t*&]+\\sw+\\>\\)*") | 2932 | "\\([ \t*&]+\\sw+\\>\\)*") |
| 2979 | ;; Fontify each declaration item. | 2933 | ;; Fontify each declaration item. |
| 2980 | (list 'font-lock-match-c-style-declaration-item-and-skip-to-next | 2934 | (list 'font-lock-match-c-style-declaration-item-and-skip-to-next |
| 2981 | ;; Start with point after all type specifiers. | 2935 | ;; Start with point after all type specifiers. |
| 2982 | (list 'goto-char | 2936 | (list 'goto-char |
| 2983 | (list 'or (list 'match-beginning | 2937 | (list 'or (list 'match-beginning |
| 2984 | (+ (,@ objc-type-names-depth) 2)) | 2938 | (+ ,objc-type-names-depth 2)) |
| 2985 | '(match-end 1))) | 2939 | '(match-end 1))) |
| 2986 | ;; Finish with point after first type specifier. | 2940 | ;; Finish with point after first type specifier. |
| 2987 | '(goto-char (match-end 1)) | 2941 | '(goto-char (match-end 1)) |
| @@ -2992,10 +2946,10 @@ See also `objc-font-lock-extra-types'.") | |||
| 2992 | ;; | 2946 | ;; |
| 2993 | ;; Fontify all storage specs and types, plus their items. | 2947 | ;; Fontify all storage specs and types, plus their items. |
| 2994 | `(eval . | 2948 | `(eval . |
| 2995 | (list (concat "\\<\\(" (,@ objc-type-specs) "[ \t]*\\)+\\>" | 2949 | (list (concat "\\<\\(" ,objc-type-specs "[ \t]*\\)+\\>" |
| 2996 | "[ \t]*\\(\\sw+\\)?") | 2950 | "[ \t]*\\(\\sw+\\)?") |
| 2997 | ;; The name of any type. | 2951 | ;; The name of any type. |
| 2998 | (list (+ (,@ objc-type-specs-depth) 2) 'font-lock-type-face nil t) | 2952 | (list ,(+ objc-type-specs-depth 2) 'font-lock-type-face nil t) |
| 2999 | ;; Fontify each declaration item. | 2953 | ;; Fontify each declaration item. |
| 3000 | (list 'font-lock-match-c++-style-declaration-item-and-skip-to-next | 2954 | (list 'font-lock-match-c++-style-declaration-item-and-skip-to-next |
| 3001 | nil nil | 2955 | nil nil |
| @@ -3055,12 +3009,12 @@ See also `java-font-lock-extra-types'.") | |||
| 3055 | (java-type-names | 3009 | (java-type-names |
| 3056 | `(mapconcat 'identity | 3010 | `(mapconcat 'identity |
| 3057 | (cons | 3011 | (cons |
| 3058 | (,@ (eval-when-compile | 3012 | ,(eval-when-compile |
| 3059 | (regexp-opt '("boolean" "char" "byte" "short" "int" "long" | 3013 | (regexp-opt '("boolean" "char" "byte" "short" "int" "long" |
| 3060 | "float" "double" "void")))) | 3014 | "float" "double" "void"))) |
| 3061 | java-font-lock-extra-types) | 3015 | java-font-lock-extra-types) |
| 3062 | "\\|")) | 3016 | "\\|")) |
| 3063 | (java-type-names-depth `(regexp-opt-depth (,@ java-type-names))) | 3017 | (java-type-names-depth `(regexp-opt-depth ,java-type-names)) |
| 3064 | ;; | 3018 | ;; |
| 3065 | ;; These are eventually followed by an object name. | 3019 | ;; These are eventually followed by an object name. |
| 3066 | (java-type-specs | 3020 | (java-type-specs |
| @@ -3094,7 +3048,7 @@ See also `java-font-lock-extra-types'.") | |||
| 3094 | ;; | 3048 | ;; |
| 3095 | ;; Fontify class names. | 3049 | ;; Fontify class names. |
| 3096 | `(eval . | 3050 | `(eval . |
| 3097 | (cons (concat "\\<\\(" (,@ java-type-names) "\\)\\>[^.]") | 3051 | (cons (concat "\\<\\(" ,java-type-names "\\)\\>[^.]") |
| 3098 | '(1 font-lock-type-face))) | 3052 | '(1 font-lock-type-face))) |
| 3099 | ;; | 3053 | ;; |
| 3100 | ;; Fontify all builtin keywords (except below). | 3054 | ;; Fontify all builtin keywords (except below). |
| @@ -3136,16 +3090,16 @@ See also `java-font-lock-extra-types'.") | |||
| 3136 | ;; | 3090 | ;; |
| 3137 | ;; Fontify random types immediately followed by an item or items. | 3091 | ;; Fontify random types immediately followed by an item or items. |
| 3138 | `(eval . | 3092 | `(eval . |
| 3139 | (list (concat "\\<\\(" (,@ java-type-names) "\\)\\>" | 3093 | (list (concat "\\<\\(" ,java-type-names "\\)\\>" |
| 3140 | "\\([ \t]*\\[[ \t]*\\]\\)*" | 3094 | "\\([ \t]*\\[[ \t]*\\]\\)*" |
| 3141 | "\\([ \t]*\\sw\\)") | 3095 | "\\([ \t]*\\sw\\)") |
| 3142 | ;; Fontify each declaration item. | 3096 | ;; Fontify each declaration item. |
| 3143 | (list 'font-lock-match-c-style-declaration-item-and-skip-to-next | 3097 | (list 'font-lock-match-c-style-declaration-item-and-skip-to-next |
| 3144 | ;; Start and finish with point after the type specifier. | 3098 | ;; Start and finish with point after the type specifier. |
| 3145 | (list 'goto-char (list 'match-beginning | 3099 | (list 'goto-char (list 'match-beginning |
| 3146 | (+ (,@ java-type-names-depth) 3))) | 3100 | (+ ,java-type-names-depth 3))) |
| 3147 | (list 'goto-char (list 'match-beginning | 3101 | (list 'goto-char (list 'match-beginning |
| 3148 | (+ (,@ java-type-names-depth) 3))) | 3102 | (+ ,java-type-names-depth 3))) |
| 3149 | ;; Fontify as a variable or function name. | 3103 | ;; Fontify as a variable or function name. |
| 3150 | '(1 (if (match-beginning 2) | 3104 | '(1 (if (match-beginning 2) |
| 3151 | font-lock-function-name-face | 3105 | font-lock-function-name-face |