comparison lisp/font-lock.el @ 66291:66e915f36067

(font-lock-default-fontify-region): Check the multiline property independently from the font-lock-multiline variable.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 21 Oct 2005 17:41:54 +0000
parents edfe61dd2874
children 7f93058a1608 732c5740ca8f 0ca0d9181b5e
comparison
equal deleted inserted replaced
66290:a5acfefeb8be 66291:66e915f36067
1046 (set-syntax-table font-lock-syntax-table)) 1046 (set-syntax-table font-lock-syntax-table))
1047 (goto-char beg) 1047 (goto-char beg)
1048 (setq beg (line-beginning-position (- 1 font-lock-lines-before))) 1048 (setq beg (line-beginning-position (- 1 font-lock-lines-before)))
1049 ;; check to see if we should expand the beg/end area for 1049 ;; check to see if we should expand the beg/end area for
1050 ;; proper multiline matches 1050 ;; proper multiline matches
1051 (when (and font-lock-multiline 1051 (when (and (> beg (point-min))
1052 (> beg (point-min))
1053 (get-text-property (1- beg) 'font-lock-multiline)) 1052 (get-text-property (1- beg) 'font-lock-multiline))
1054 ;; We are just after or in a multiline match. 1053 ;; We are just after or in a multiline match.
1055 (setq beg (or (previous-single-property-change 1054 (setq beg (or (previous-single-property-change
1056 beg 'font-lock-multiline) 1055 beg 'font-lock-multiline)
1057 (point-min))) 1056 (point-min)))
1058 (goto-char beg) 1057 (goto-char beg)
1059 (setq beg (line-beginning-position))) 1058 (setq beg (line-beginning-position)))
1060 (when font-lock-multiline 1059 (setq end (or (text-property-any end (point-max)
1061 (setq end (or (text-property-any end (point-max) 1060 'font-lock-multiline nil)
1062 'font-lock-multiline nil) 1061 (point-max)))
1063 (point-max))))
1064 (goto-char end) 1062 (goto-char end)
1065 ;; Round up to a whole line. 1063 ;; Round up to a whole line.
1066 (unless (bolp) (setq end (line-beginning-position 2))) 1064 (unless (bolp) (setq end (line-beginning-position 2)))
1067 ;; Now do the fontification. 1065 ;; Now do the fontification.
1068 (font-lock-unfontify-region beg end) 1066 (font-lock-unfontify-region beg end)