diff options
| -rw-r--r-- | lisp/ChangeLog | 23 | ||||
| -rw-r--r-- | lisp/progmodes/cc-defs.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/cc-engine.el | 68 | ||||
| -rw-r--r-- | lisp/progmodes/cc-fonts.el | 77 |
4 files changed, 100 insertions, 70 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bb19968983b..a9e1731a11b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,26 @@ | |||
| 1 | 2003-07-08 Martin Stjernholm <bug-cc-mode@gnu.org> | ||
| 2 | |||
| 3 | * progmodes/cc-engine.el (c-guess-basic-syntax): Do not do hidden | ||
| 4 | buffer changes; there's third party code that calls this function | ||
| 5 | directly. | ||
| 6 | |||
| 7 | 2003-07-08 Martin Stjernholm <bug-cc-mode@gnu.org> | ||
| 8 | |||
| 9 | * progmodes/cc-fonts.el (javadoc-font-lock-keywords, | ||
| 10 | autodoc-font-lock-keywords): Don't byte compile on font lock | ||
| 11 | initialization when running from byte compiled files. | ||
| 12 | |||
| 13 | 2003-07-08 Alan Mackenzie <bug-cc-mode@gnu.org> | ||
| 14 | |||
| 15 | * progmodes/cc-engine.el: Fix AWK mode indentation when previous | ||
| 16 | statement ends with auto-increment "++". | ||
| 17 | |||
| 18 | 2003-07-08 Martin Stjernholm <bug-cc-mode@gnu.org> | ||
| 19 | |||
| 20 | * progmodes/cc-langs.el, progmodes/cc-styles.el (c-style-alist, | ||
| 21 | c-lang-variable-inits, c-lang-variable-inits-tail): The values of | ||
| 22 | these are changed, so declare them as variables and not constants. | ||
| 23 | |||
| 1 | 2003-07-08 Markus Rost <rost@math.ohio-state.edu> | 24 | 2003-07-08 Markus Rost <rost@math.ohio-state.edu> |
| 2 | 25 | ||
| 3 | * subr.el (dolist, dotimes): Doc fix. | 26 | * subr.el (dolist, dotimes): Doc fix. |
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index 4fcf122bffe..9ea96358619 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el | |||
| @@ -105,7 +105,7 @@ | |||
| 105 | 105 | ||
| 106 | ;;; Variables also used at compile time. | 106 | ;;; Variables also used at compile time. |
| 107 | 107 | ||
| 108 | (defconst c-version "5.30.2" | 108 | (defconst c-version "5.30.3" |
| 109 | "CC Mode version number.") | 109 | "CC Mode version number.") |
| 110 | 110 | ||
| 111 | (defconst c-version-sym (intern c-version)) | 111 | (defconst c-version-sym (intern c-version)) |
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 274e085f8ca..7d0d146a744 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -66,6 +66,9 @@ | |||
| 66 | ;; positions, e.g. to improve speed and to eliminate glitches in | 66 | ;; positions, e.g. to improve speed and to eliminate glitches in |
| 67 | ;; interactive refontification. | 67 | ;; interactive refontification. |
| 68 | ;; | 68 | ;; |
| 69 | ;; Note: This doc is for internal use only. Other packages should not | ||
| 70 | ;; assume that these text properties are used as described here. | ||
| 71 | ;; | ||
| 69 | ;; 'syntax-table | 72 | ;; 'syntax-table |
| 70 | ;; Used to modify the syntax of some characters. Currently used to | 73 | ;; Used to modify the syntax of some characters. Currently used to |
| 71 | ;; mark the "<" and ">" of angle bracket parens with paren syntax. | 74 | ;; mark the "<" and ">" of angle bracket parens with paren syntax. |
| @@ -509,10 +512,9 @@ COMMA-DELIM is non-nil then ',' is treated likewise." | |||
| 509 | ;; that we've moved. | 512 | ;; that we've moved. |
| 510 | (while (progn | 513 | (while (progn |
| 511 | (setq pos (point)) | 514 | (setq pos (point)) |
| 512 | (c-backward-syntactic-ws) ; might go back an awk-mode virtual semicolon, here. | 515 | (if (c-mode-is-new-awk-p) |
| 513 | ; How about using c-awk-NL-prop for AWK Mode, here. | 516 | (c-awk-backward-syntactic-ws) |
| 514 | ; Something like c-awk-backward-syntactic-ws. | 517 | (c-backward-syntactic-ws)) |
| 515 | ; 2002/6/22. Doesn't matter! Leave it as it is. | ||
| 516 | (/= (skip-chars-backward "-+!*&~@`#") 0))) ; ACM, 2002/5/31; | 518 | (/= (skip-chars-backward "-+!*&~@`#") 0))) ; ACM, 2002/5/31; |
| 517 | ; Make a variable in | 519 | ; Make a variable in |
| 518 | ; cc-langs.el, maybe | 520 | ; cc-langs.el, maybe |
| @@ -820,7 +822,9 @@ COMMA-DELIM is non-nil then ',' is treated likewise." | |||
| 820 | ;; Skip over the unary operators that can start the statement. | 822 | ;; Skip over the unary operators that can start the statement. |
| 821 | (goto-char pos) | 823 | (goto-char pos) |
| 822 | (while (progn | 824 | (while (progn |
| 823 | (c-backward-syntactic-ws) | 825 | (if (c-mode-is-new-awk-p) |
| 826 | (c-awk-backward-syntactic-ws) | ||
| 827 | (c-backward-syntactic-ws)) | ||
| 824 | (/= (skip-chars-backward "-+!*&~@`#") 0)) ; Hopefully the # won't hurt awk. | 828 | (/= (skip-chars-backward "-+!*&~@`#") 0)) ; Hopefully the # won't hurt awk. |
| 825 | (setq pos (point))) | 829 | (setq pos (point))) |
| 826 | (goto-char pos) | 830 | (goto-char pos) |
| @@ -2663,7 +2667,7 @@ This function does not do any hidden buffer changes." | |||
| 2663 | 2667 | ||
| 2664 | (defalias 'c-in-literal | 2668 | (defalias 'c-in-literal |
| 2665 | (if (fboundp 'buffer-syntactic-context) | 2669 | (if (fboundp 'buffer-syntactic-context) |
| 2666 | 'c-fast-in-literal ; Xemacs | 2670 | 'c-fast-in-literal ; XEmacs |
| 2667 | 'c-slow-in-literal)) ; GNU Emacs | 2671 | 'c-slow-in-literal)) ; GNU Emacs |
| 2668 | 2672 | ||
| 2669 | ;; The defalias above isn't enough to shut up the byte compiler. | 2673 | ;; The defalias above isn't enough to shut up the byte compiler. |
| @@ -5422,34 +5426,36 @@ brace." | |||
| 5422 | ))) | 5426 | ))) |
| 5423 | 5427 | ||
| 5424 | (defun c-guess-basic-syntax () | 5428 | (defun c-guess-basic-syntax () |
| 5425 | "Return the syntactic context of the current line." | 5429 | "Return the syntactic context of the current line. |
| 5430 | This function does not do any hidden buffer changes." | ||
| 5426 | (save-excursion | 5431 | (save-excursion |
| 5427 | (save-restriction | 5432 | (save-restriction |
| 5428 | (beginning-of-line) | 5433 | (beginning-of-line) |
| 5429 | (let* ((indent-point (point)) | 5434 | (c-save-buffer-state |
| 5430 | (case-fold-search nil) | 5435 | ((indent-point (point)) |
| 5431 | (paren-state (c-parse-state)) | 5436 | (case-fold-search nil) |
| 5432 | literal containing-sexp char-before-ip char-after-ip lim | 5437 | (paren-state (c-parse-state)) |
| 5433 | c-syntactic-context placeholder c-in-literal-cache step-type | 5438 | literal containing-sexp char-before-ip char-after-ip lim |
| 5434 | tmpsymbol keyword injava-inher special-brace-list | 5439 | c-syntactic-context placeholder c-in-literal-cache step-type |
| 5435 | ;; narrow out any enclosing class or extern "C" block | 5440 | tmpsymbol keyword injava-inher special-brace-list |
| 5436 | (inclass-p (c-narrow-out-enclosing-class paren-state | 5441 | ;; narrow out any enclosing class or extern "C" block |
| 5437 | indent-point)) | 5442 | (inclass-p (c-narrow-out-enclosing-class paren-state |
| 5438 | ;; `c-state-cache' is shadowed here so that we don't | 5443 | indent-point)) |
| 5439 | ;; throw it away due to the narrowing that might be done | 5444 | ;; `c-state-cache' is shadowed here so that we don't |
| 5440 | ;; by the function above. That means we must not do any | 5445 | ;; throw it away due to the narrowing that might be done |
| 5441 | ;; changes during the execution of this function, since | 5446 | ;; by the function above. That means we must not do any |
| 5442 | ;; `c-invalidate-state-cache' then would change this local | 5447 | ;; changes during the execution of this function, since |
| 5443 | ;; variable and leave a bogus value in the global one. | 5448 | ;; `c-invalidate-state-cache' then would change this local |
| 5444 | (c-state-cache (if inclass-p | 5449 | ;; variable and leave a bogus value in the global one. |
| 5445 | (c-whack-state-before (point-min) paren-state) | 5450 | (c-state-cache (if inclass-p |
| 5446 | paren-state)) | 5451 | (c-whack-state-before (point-min) paren-state) |
| 5447 | (c-state-cache-start (point-min)) | 5452 | paren-state)) |
| 5448 | inenclosing-p macro-start in-macro-expr | 5453 | (c-state-cache-start (point-min)) |
| 5449 | ;; There's always at most one syntactic element which got | 5454 | inenclosing-p macro-start in-macro-expr |
| 5450 | ;; a relpos. It's stored in syntactic-relpos. | 5455 | ;; There's always at most one syntactic element which got |
| 5451 | syntactic-relpos | 5456 | ;; a relpos. It's stored in syntactic-relpos. |
| 5452 | (c-stmt-delim-chars c-stmt-delim-chars)) | 5457 | syntactic-relpos |
| 5458 | (c-stmt-delim-chars c-stmt-delim-chars)) | ||
| 5453 | ;; Check for meta top-level enclosing constructs such as | 5459 | ;; Check for meta top-level enclosing constructs such as |
| 5454 | ;; extern language definitions. | 5460 | ;; extern language definitions. |
| 5455 | (save-excursion | 5461 | (save-excursion |
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index 8a0ba6d1920..bab838a22d1 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el | |||
| @@ -2064,7 +2064,7 @@ higher." | |||
| 2064 | 2064 | ||
| 2065 | ;; Kludge: If `c-font-lock-complex-decl-prepare' is on the list we | 2065 | ;; Kludge: If `c-font-lock-complex-decl-prepare' is on the list we |
| 2066 | ;; move it first since the doc comment font lockers might add | 2066 | ;; move it first since the doc comment font lockers might add |
| 2067 | ;; `c-type' text properties so they have to be cleared before that. | 2067 | ;; `c-type' text properties, so they have to be cleared before that. |
| 2068 | (when (memq 'c-font-lock-complex-decl-prepare list) | 2068 | (when (memq 'c-font-lock-complex-decl-prepare list) |
| 2069 | (setq list (cons 'c-font-lock-complex-decl-prepare | 2069 | (setq list (cons 'c-font-lock-complex-decl-prepare |
| 2070 | (delq 'c-font-lock-complex-decl-prepare | 2070 | (delq 'c-font-lock-complex-decl-prepare |
| @@ -2642,30 +2642,30 @@ need for `pike-font-lock-extra-types'.") | |||
| 2642 | (copy-marker (1+ start)))) | 2642 | (copy-marker (1+ start)))) |
| 2643 | t))) | 2643 | t))) |
| 2644 | 2644 | ||
| 2645 | (defun javadoc-font-lock-keywords () | 2645 | (defconst javadoc-font-lock-doc-comments |
| 2646 | (list | 2646 | `(("{@[a-z]+[^}\n\r]*}" ; "{@foo ...}" markup. |
| 2647 | (byte-compile | 2647 | 0 ,c-doc-markup-face-name prepend nil) |
| 2648 | `(lambda (limit) | 2648 | ("^\\(/\\*\\)?[ \t*]*\\(@[a-z]+\\)" ; "@foo ..." markup. |
| 2649 | (c-font-lock-doc-comments "/\\*\\*" limit | 2649 | 2 ,c-doc-markup-face-name prepend nil) |
| 2650 | '(("{@[a-z]+[^}\n\r]*}" ; "{@foo ...}" markup. | 2650 | (,(concat "</?\\sw" ; HTML tags. |
| 2651 | 0 ,c-doc-markup-face-name prepend nil) | 2651 | "\\(" |
| 2652 | ("^\\(/\\*\\)?[ \t*]*\\(@[a-z]+\\)" ; "@foo ..." markup. | 2652 | (concat "\\sw\\|\\s \\|[=\n\r*.:]\\|" |
| 2653 | 2 ,c-doc-markup-face-name prepend nil) | 2653 | "\"[^\"]*\"\\|'[^']*'") |
| 2654 | (,(concat "</?\\sw" ; HTML tags. | 2654 | "\\)*>") |
| 2655 | "\\(" | 2655 | 0 ,c-doc-markup-face-name prepend nil) |
| 2656 | (concat "\\sw\\|\\s \\|[=\n\r*.:]\\|" | 2656 | ("&\\(\\sw\\|[.:]\\)+;" ; HTML entities. |
| 2657 | "\"[^\"]*\"\\|'[^']*'") | 2657 | 0 ,c-doc-markup-face-name prepend nil) |
| 2658 | "\\)*>") | 2658 | ;; Fontify remaining markup characters as invalid. Note |
| 2659 | 0 ,c-doc-markup-face-name prepend nil) | 2659 | ;; that the Javadoc spec is hazy about when "@" is |
| 2660 | ("&\\(\\sw\\|[.:]\\)+;" ; HTML entities. | 2660 | ;; allowed in non-markup use. |
| 2661 | 0 ,c-doc-markup-face-name prepend nil) | 2661 | (,(lambda (limit) |
| 2662 | ;; Fontify remaining markup characters as invalid. Note | 2662 | (c-find-invalid-doc-markup "[<>&]\\|{@" limit)) |
| 2663 | ;; that the Javadoc spec is hazy about when "@" is allowed | 2663 | 0 ,c-invalid-face-name prepend nil))) |
| 2664 | ;; in non-markup use. | 2664 | |
| 2665 | (,(lambda (limit) | 2665 | (defconst javadoc-font-lock-keywords |
| 2666 | (c-find-invalid-doc-markup "[<>&]\\|{@" limit)) | 2666 | `((,(lambda (limit) |
| 2667 | 0 ,c-invalid-face-name prepend nil) | 2667 | (c-font-lock-doc-comments "/\\*\\*" limit |
| 2668 | )))))) | 2668 | javadoc-font-lock-doc-comments))))) |
| 2669 | 2669 | ||
| 2670 | (defconst autodoc-decl-keywords | 2670 | (defconst autodoc-decl-keywords |
| 2671 | ;; Adorned regexp matching the keywords that introduce declarations | 2671 | ;; Adorned regexp matching the keywords that introduce declarations |
| @@ -2755,6 +2755,17 @@ need for `pike-font-lock-extra-types'.") | |||
| 2755 | 2755 | ||
| 2756 | nil) | 2756 | nil) |
| 2757 | 2757 | ||
| 2758 | (defconst autodoc-font-lock-doc-comments | ||
| 2759 | `(("@\\(\\w+{\\|\\[\\([^\]@\n\r]\\|@@\\)*\\]\\|[@}]\\|$\\)" | ||
| 2760 | ;; In-text markup. | ||
| 2761 | 0 ,c-doc-markup-face-name prepend nil) | ||
| 2762 | (autodoc-font-lock-line-markup) | ||
| 2763 | ;; Fontify remaining markup characters as invalid. | ||
| 2764 | (,(lambda (limit) | ||
| 2765 | (c-find-invalid-doc-markup "@" limit)) | ||
| 2766 | 0 ,c-invalid-face-name prepend nil) | ||
| 2767 | )) | ||
| 2768 | |||
| 2758 | (defun autodoc-font-lock-keywords () | 2769 | (defun autodoc-font-lock-keywords () |
| 2759 | ;; Note that we depend on that `c-current-comment-prefix' has got | 2770 | ;; Note that we depend on that `c-current-comment-prefix' has got |
| 2760 | ;; its proper value here. | 2771 | ;; its proper value here. |
| @@ -2764,19 +2775,9 @@ need for `pike-font-lock-extra-types'.") | |||
| 2764 | ;; following declarations. | 2775 | ;; following declarations. |
| 2765 | (setq c-type-decl-end-used t) | 2776 | (setq c-type-decl-end-used t) |
| 2766 | 2777 | ||
| 2767 | (list | 2778 | `((,(lambda (limit) |
| 2768 | (byte-compile | 2779 | (c-font-lock-doc-comments "/[*/]!" limit |
| 2769 | `(lambda (limit) | 2780 | autodoc-font-lock-doc-comments))))) |
| 2770 | (c-font-lock-doc-comments "/[*/]!" limit | ||
| 2771 | '(("@\\(\\w+{\\|\\[\\([^\]@\n\r]\\|@@\\)*\\]\\|[@}]\\|$\\)" | ||
| 2772 | ;; In-text markup. | ||
| 2773 | 0 ,c-doc-markup-face-name prepend nil) | ||
| 2774 | (autodoc-font-lock-line-markup) | ||
| 2775 | ;; Fontify remaining markup characters as invalid. | ||
| 2776 | (,(lambda (limit) | ||
| 2777 | (c-find-invalid-doc-markup "@" limit)) | ||
| 2778 | 0 ,c-invalid-face-name prepend nil) | ||
| 2779 | )))))) | ||
| 2780 | 2781 | ||
| 2781 | 2782 | ||
| 2782 | ;; AWK. | 2783 | ;; AWK. |