emacs-devel
[Top][All Lists]
Advanced

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

Re: scratch/tzz/prettify-text-mode f8b4f20 1/3: lisp/progmodes/prog-mode


From: Stefan Monnier
Subject: Re: scratch/tzz/prettify-text-mode f8b4f20 1/3: lisp/progmodes/prog-mode.el: prevent font-lock-flush boundary errors
Date: Sun, 12 Jul 2020 17:32:49 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> --- a/lisp/progmodes/prog-mode.el
> +++ b/lisp/progmodes/prog-mode.el
> @@ -183,6 +183,11 @@ on the symbol."
>                  (> (point) (cadr prettify-symbols--current-symbol-bounds))
>                  (and (not (eq prettify-symbols-unprettify-at-point 
> 'right-edge))
>                       (= (point) (cadr 
> prettify-symbols--current-symbol-bounds)))))
> +      ;; Adjust the bounds in case either end is invalid.
> +      (setf (car prettify-symbols--current-symbol-bounds)
> +            (max (car prettify-symbols--current-symbol-bounds) (point-min))
> +            (cadr prettify-symbols--current-symbol-bounds)
> +            (min (cadr prettify-symbols--current-symbol-bounds) (point-max)))

Could you add in the comment some explanation for why this is needed
(e.g. a known case where this happens)?

Even better if we can fix the origin of the problem rather than
workaround it here (depending on the origin of the problem, it might be
inconvenient/costly to fix it, tho, so maybe this workaround is the
best option).


        Stefan




reply via email to

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