diff options
| author | Lars Ingebrigtsen | 2019-10-30 12:32:20 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-10-30 13:16:43 +0100 |
| commit | 40c787ff4e9162d6f1a9a0abac3c83f1d0389810 (patch) | |
| tree | ce9df25a45cc5b93b1f102178e3bd8b3b3f421bf /lisp | |
| parent | fc05708248e1af96d638debc08879008efaca1af (diff) | |
| download | emacs-40c787ff4e9162d6f1a9a0abac3c83f1d0389810.tar.gz emacs-40c787ff4e9162d6f1a9a0abac3c83f1d0389810.zip | |
Indent font-lock-fontify-syntactically-region
* lisp/font-lock.el (font-lock-fontify-syntactically-region):
Indent function.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/font-lock.el | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 3991a4ee8ef..9ae082736cc 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -1590,41 +1590,41 @@ START should be at the beginning of a line." | |||
| 1590 | START should be at the beginning of a line." | 1590 | START should be at the beginning of a line." |
| 1591 | (syntax-propertize end) ; Apply any needed syntax-table properties. | 1591 | (syntax-propertize end) ; Apply any needed syntax-table properties. |
| 1592 | (with-syntax-table (or syntax-ppss-table (syntax-table)) | 1592 | (with-syntax-table (or syntax-ppss-table (syntax-table)) |
| 1593 | (let ((comment-end-regexp | 1593 | (let ((comment-end-regexp |
| 1594 | (or font-lock-comment-end-skip | 1594 | (or font-lock-comment-end-skip |
| 1595 | (regexp-quote | 1595 | (regexp-quote |
| 1596 | (replace-regexp-in-string "^ *" "" comment-end)))) | 1596 | (replace-regexp-in-string "^ *" "" comment-end)))) |
| 1597 | ;; Find the `start' state. | 1597 | ;; Find the `start' state. |
| 1598 | (state (syntax-ppss start)) | 1598 | (state (syntax-ppss start)) |
| 1599 | face beg) | 1599 | face beg) |
| 1600 | (if loudly (message "Fontifying %s... (syntactically...)" (buffer-name))) | 1600 | (if loudly (message "Fontifying %s... (syntactically...)" (buffer-name))) |
| 1601 | ;; | 1601 | ;; |
| 1602 | ;; Find each interesting place between here and `end'. | 1602 | ;; Find each interesting place between here and `end'. |
| 1603 | (while | 1603 | (while |
| 1604 | (progn | 1604 | (progn |
| 1605 | (when (or (nth 3 state) (nth 4 state)) | 1605 | (when (or (nth 3 state) (nth 4 state)) |
| 1606 | (setq face (funcall font-lock-syntactic-face-function state)) | 1606 | (setq face (funcall font-lock-syntactic-face-function state)) |
| 1607 | (setq beg (max (nth 8 state) start)) | 1607 | (setq beg (max (nth 8 state) start)) |
| 1608 | (setq state (parse-partial-sexp (point) end nil nil state | 1608 | (setq state (parse-partial-sexp (point) end nil nil state |
| 1609 | 'syntax-table)) | 1609 | 'syntax-table)) |
| 1610 | (when face (put-text-property beg (point) 'face face)) | 1610 | (when face (put-text-property beg (point) 'face face)) |
| 1611 | (when (and (eq face 'font-lock-comment-face) | 1611 | (when (and (eq face 'font-lock-comment-face) |
| 1612 | (or font-lock-comment-start-skip | 1612 | (or font-lock-comment-start-skip |
| 1613 | comment-start-skip)) | 1613 | comment-start-skip)) |
| 1614 | ;; Find the comment delimiters | 1614 | ;; Find the comment delimiters |
| 1615 | ;; and use font-lock-comment-delimiter-face for them. | 1615 | ;; and use font-lock-comment-delimiter-face for them. |
| 1616 | (save-excursion | 1616 | (save-excursion |
| 1617 | (goto-char beg) | 1617 | (goto-char beg) |
| 1618 | (if (looking-at (or font-lock-comment-start-skip | 1618 | (if (looking-at (or font-lock-comment-start-skip |
| 1619 | comment-start-skip)) | 1619 | comment-start-skip)) |
| 1620 | (put-text-property beg (match-end 0) 'face | 1620 | (put-text-property beg (match-end 0) 'face |
| 1621 | font-lock-comment-delimiter-face))) | 1621 | font-lock-comment-delimiter-face))) |
| 1622 | (if (looking-back comment-end-regexp (point-at-bol) t) | 1622 | (if (looking-back comment-end-regexp (point-at-bol) t) |
| 1623 | (put-text-property (match-beginning 0) (point) 'face | 1623 | (put-text-property (match-beginning 0) (point) 'face |
| 1624 | font-lock-comment-delimiter-face)))) | 1624 | font-lock-comment-delimiter-face)))) |
| 1625 | (< (point) end)) | 1625 | (< (point) end)) |
| 1626 | (setq state (parse-partial-sexp (point) end nil nil state | 1626 | (setq state (parse-partial-sexp (point) end nil nil state |
| 1627 | 'syntax-table)))))) | 1627 | 'syntax-table)))))) |
| 1628 | 1628 | ||
| 1629 | ;;; End of Syntactic fontification functions. | 1629 | ;;; End of Syntactic fontification functions. |
| 1630 | 1630 | ||