emacs-devel
[Top][All Lists]
Advanced

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

Re: master 7362554: Widen around c-font-lock-fontify-region. This fixes


From: Eli Zaretskii
Subject: Re: master 7362554: Widen around c-font-lock-fontify-region. This fixes bug #38049.
Date: Thu, 14 Nov 2019 15:49:07 +0200

> From: Dmitry Gutov <address@hidden>
> Date: Thu, 14 Nov 2019 00:33:33 +0200
> Cc: address@hidden
> 
> Very interesting, thank you. I wonder if the patch below would fix it as 
> well. Though, if course, that can't account for all possible uses of 
> vertical-motion inside a narrowed buffer.
> 
> diff --git a/lisp/reposition.el b/lisp/reposition.el
> index 22f9986efb..131e595858 100644
> --- a/lisp/reposition.el
> +++ b/lisp/reposition.el
> @@ -172,6 +172,8 @@ reposition-window
> 
>   ;; Return number of screen lines between START and END.
>   (defun repos-count-screen-lines (start end)
> +  ;; Make sure jit-lock doesn't have to run in a narrowed context.
> +  (font-lock-ensure start end)

Isn't this a kludge of sorts?  We want CC mode not to fail to fontify
if it's called in a narrowed context, regardless of how that happened,
and you seem to be fixing just this particular situation?  The actual
problem is much more general, AFAIU.



reply via email to

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