>>>>> "martin" == martin rudalics <[EMAIL PROTECTED]> writes:
>>> (when font-lock-multiline >>> (setq end (or (text-property-any end (point-max) >>> 'font-lock-multiline nil) >>> (point-max))) >>> (goto-char end) >>> (setq end (line-beginning-position 2))) >>> ;; Now do the fontification. >> >> >> I'd rather change jit-lock, since font-lock may be used without jit-lock. > It would be unsafe to change jit-lock. Currently it is not mandatory > for a "font-lock-fontify-region-function" to adjust the end of the > region. delphi-fontify-region, for example, doesn't. It does rely on > jit-lock-fontify-now to provide correct endpoints. Put this the other > way round. If font-lock-default-fontify-region's present approach to > fontify an additional line were indeed mandatory, most current > font-lock-fontify-region-functions would be invalid since they do not > adjust the end of the region. Indeed, you're right. The problem has nothing to do with jit-lock: font-lock does the same double-rounding even when jit-lock is turned off, because font-lock-after-change-function also does the rounding. > Anyway, my first solution should emulate your proposal. It would > suppress fontification of the second line iff jit-lock is turned on. > Using font-lock without jit-lock would not change the current behavior: In light of the above, I think that checking jit-lock-mode is not the right approach. How 'bout the patch below instead? Stefan --- orig/lisp/font-lock.el +++ mod/lisp/font-lock.el @@ -1058,7 +1058,8 @@ 'font-lock-multiline nil) (point-max))) (goto-char end) - (setq end (line-beginning-position 2)) + ;; Round up to a whole line. + (unless (bolp) (setq end (line-beginning-position 2))) ;; Now do the fontification. (font-lock-unfontify-region beg end) (when font-lock-syntactic-keywords _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel