>> (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. 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: (cond (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))) ;; don't modify end in jit-lock-mode ((and (boundp 'jit-lock-mode) jit-lock-mode)) (t (goto-char end) (setq end (line-beginning-position 2)))) ;; Now do the fontification. _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel