diff options
| author | Richard M. Stallman | 2005-05-11 16:27:25 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-05-11 16:27:25 +0000 |
| commit | a4479657966929ec8b38cb90ed9beb9cb2c8162e (patch) | |
| tree | 84acb689075f1779930a413fa3e4d4402733fdb7 | |
| parent | c3f6aa2088306361718a65f26f767f333393ea8c (diff) | |
| download | emacs-a4479657966929ec8b38cb90ed9beb9cb2c8162e.tar.gz emacs-a4479657966929ec8b38cb90ed9beb9cb2c8162e.zip | |
(font-lock-fontify-syntactically-region):
Use font-lock-comment-delimiter-face for comment delimiters.
| -rw-r--r-- | lisp/font-lock.el | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index bd0af57059f..f2a6d244a79 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -1314,7 +1314,10 @@ START should be at the beginning of a line." | |||
| 1314 | (defun font-lock-fontify-syntactically-region (start end &optional loudly ppss) | 1314 | (defun font-lock-fontify-syntactically-region (start end &optional loudly ppss) |
| 1315 | "Put proper face on each string and comment between START and END. | 1315 | "Put proper face on each string and comment between START and END. |
| 1316 | START should be at the beginning of a line." | 1316 | START should be at the beginning of a line." |
| 1317 | (let (state face beg) | 1317 | (let (state face beg |
| 1318 | (comment-end-regexp | ||
| 1319 | (regexp-quote | ||
| 1320 | (replace-regexp-in-string "^ *" "" comment-end)))) | ||
| 1318 | (if loudly (message "Fontifying %s... (syntactically...)" (buffer-name))) | 1321 | (if loudly (message "Fontifying %s... (syntactically...)" (buffer-name))) |
| 1319 | (goto-char start) | 1322 | (goto-char start) |
| 1320 | ;; | 1323 | ;; |
| @@ -1329,7 +1332,19 @@ START should be at the beginning of a line." | |||
| 1329 | (setq beg (max (nth 8 state) start)) | 1332 | (setq beg (max (nth 8 state) start)) |
| 1330 | (setq state (parse-partial-sexp (point) end nil nil state | 1333 | (setq state (parse-partial-sexp (point) end nil nil state |
| 1331 | 'syntax-table)) | 1334 | 'syntax-table)) |
| 1332 | (when face (put-text-property beg (point) 'face face))) | 1335 | (when face (put-text-property beg (point) 'face face)) |
| 1336 | (when (eq face 'font-lock-comment-face) | ||
| 1337 | ;; Find the comment delimiters | ||
| 1338 | ;; and use font-lock-comment-delimiter-face for them. | ||
| 1339 | (save-excursion | ||
| 1340 | (goto-char beg) | ||
| 1341 | (if (and comment-start-skip (looking-at comment-start-skip)) | ||
| 1342 | (put-text-property beg (match-end 0) 'face | ||
| 1343 | 'font-lock-comment-delimiter-face))) | ||
| 1344 | (if (and comment-end | ||
| 1345 | (looking-back comment-end-regexp (point-at-bol))) | ||
| 1346 | (put-text-property (match-beginning 0) (point) 'face | ||
| 1347 | 'font-lock-comment-delimiter-face)))) | ||
| 1333 | (< (point) end)) | 1348 | (< (point) end)) |
| 1334 | (setq state (parse-partial-sexp (point) end nil nil state | 1349 | (setq state (parse-partial-sexp (point) end nil nil state |
| 1335 | 'syntax-table))))) | 1350 | 'syntax-table))))) |