diff options
| -rw-r--r-- | lisp/progmodes/cc-fonts.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index fd00d65e335..5f3e2eaaf80 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el | |||
| @@ -2733,13 +2733,14 @@ need for `pike-font-lock-extra-types'.") | |||
| 2733 | ;; | 2733 | ;; |
| 2734 | ;; This function might do hidden buffer changes. | 2734 | ;; This function might do hidden buffer changes. |
| 2735 | 2735 | ||
| 2736 | (let (comment-beg region-beg) | 2736 | (let (comment-beg region-beg comment-mid) |
| 2737 | (if (memq (get-text-property (point) 'face) | 2737 | (if (memq (get-text-property (point) 'face) |
| 2738 | '(font-lock-comment-face font-lock-comment-delimiter-face)) | 2738 | '(font-lock-comment-face font-lock-comment-delimiter-face)) |
| 2739 | ;; Handle the case when the fontified region starts inside a | 2739 | ;; Handle the case when the fontified region starts inside a |
| 2740 | ;; comment. | 2740 | ;; comment. |
| 2741 | (let ((start (c-literal-start))) | 2741 | (let ((start (c-literal-start))) |
| 2742 | (setq region-beg (point)) | 2742 | (setq region-beg (point) |
| 2743 | comment-mid (point)) | ||
| 2743 | (when start | 2744 | (when start |
| 2744 | (goto-char start)) | 2745 | (goto-char start)) |
| 2745 | (when (looking-at prefix) | 2746 | (when (looking-at prefix) |
| @@ -2765,7 +2766,8 @@ need for `pike-font-lock-extra-types'.") | |||
| 2765 | (goto-char comment-beg) | 2766 | (goto-char comment-beg) |
| 2766 | (c-in-literal))))) | 2767 | (c-in-literal))))) |
| 2767 | (setq comment-beg nil)) | 2768 | (setq comment-beg nil)) |
| 2768 | (setq region-beg comment-beg)) | 2769 | (setq region-beg comment-beg |
| 2770 | comment-mid comment-beg)) | ||
| 2769 | 2771 | ||
| 2770 | (if (elt (parse-partial-sexp comment-beg (+ comment-beg 2)) 7) | 2772 | (if (elt (parse-partial-sexp comment-beg (+ comment-beg 2)) 7) |
| 2771 | ;; Collect a sequence of doc style line comments. | 2773 | ;; Collect a sequence of doc style line comments. |
| @@ -2773,15 +2775,16 @@ need for `pike-font-lock-extra-types'.") | |||
| 2773 | (goto-char comment-beg) | 2775 | (goto-char comment-beg) |
| 2774 | (while (and (progn | 2776 | (while (and (progn |
| 2775 | (c-forward-single-comment) | 2777 | (c-forward-single-comment) |
| 2776 | (c-put-font-lock-face comment-beg (point) | 2778 | (c-put-font-lock-face comment-mid (point) |
| 2777 | c-doc-face-name) | 2779 | c-doc-face-name) |
| 2778 | (skip-syntax-forward " ") | 2780 | (skip-syntax-forward " ") |
| 2779 | (setq comment-beg (point)) | 2781 | (setq comment-beg (point) |
| 2782 | comment-mid (point)) | ||
| 2780 | (< (point) limit)) | 2783 | (< (point) limit)) |
| 2781 | (looking-at prefix)))) | 2784 | (looking-at prefix)))) |
| 2782 | (goto-char comment-beg) | 2785 | (goto-char comment-beg) |
| 2783 | (c-forward-single-comment) | 2786 | (c-forward-single-comment) |
| 2784 | (c-put-font-lock-face comment-beg (point) c-doc-face-name)) | 2787 | (c-put-font-lock-face region-beg (point) c-doc-face-name)) |
| 2785 | (if (> (point) limit) (goto-char limit)) | 2788 | (if (> (point) limit) (goto-char limit)) |
| 2786 | (setq comment-beg nil) | 2789 | (setq comment-beg nil) |
| 2787 | 2790 | ||