bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20240: 25.0.50; CC Mode broken fontification and commenting


From: Stefan Monnier
Subject: bug#20240: 25.0.50; CC Mode broken fontification and commenting
Date: Fri, 03 Apr 2015 18:09:12 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> -          (run-hook-with-args 'jit-lock-after-change-extend-region-functions
> -                              start end old-len)
> -          ;; Make sure we change at least one char (in case of deletions).
> -          (setq jit-lock-end (min (max jit-lock-end (1+ start)) (point-max)))
> -          ;; Request refontification.
> -          (put-text-property jit-lock-start jit-lock-end 'fontified nil))
> +          (save-restriction
> +           (widen)
> +           (run-hook-with-args 'jit-lock-after-change-extend-region-functions
> +                               start end old-len)
> +           ;; Make sure we change at least one char (in case of deletions).
> +           (setq jit-lock-end (min (max jit-lock-end (1+ start)) 
> (point-max)))
> +           ;; Request refontification.
> +           (put-text-property jit-lock-start jit-lock-end 'fontified nil)))

Widening during the call to
jit-lock-after-change-extend-region-functions seems wrong.  But I guess
there can be meaningful cases where
jit-lock-after-change-extend-region-functions could return positions
outside of the narrowed region, so I'd be OK with widening during the
subsequent `put-text-property'.


        Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]