emacs-devel
[Top][All Lists]
Advanced

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

Re: Mark for refontification


From: Lennart Borgman
Subject: Re: Mark for refontification
Date: Sat, 10 Apr 2010 03:12:49 +0200

On Sat, Apr 10, 2010 at 2:57 AM, Stefan Monnier
<address@hidden> wrote:
>
> >>> (defun mumamo-mark-for-refontification (min max)
> >>>   "Mark region between MIN and MAX for refontification."
> >>>     (save-restriction
> >>>       (widen)
> >>>       ;;(mumamo-with-buffer-prepared-for-jit-lock
> >>>       (mumamo-save-buffer-state nil
> >>>         (put-text-property min max 'fontified nil)
> >>>         )))
> >>
> >> Why widen?
>
> > You mean it is not necessary for put-text-property?
>
> No, my question doesn't have anything to do with put-text-property.
> It's just that usually Elisp functions don't take buffer positions
> outside of point-min...point-max and I see no reason why this one should
> be an exception.


I can't remember why I did it this way, but it is probably due to that
any change in the chunk dividing can result in that the rest of the
buffer should be refontified.

That can of course be optimized since it really may not need
refontification. I am trying to do that and reuse old chunk
fontification, but I don't remember how far I get with this at the
moment. (I have finally rewritten the chunk dividing routines so that
chunks always is part of a chain starting from the top of the buffer.
As usual the code can be improved.)

Still, when I find that an old chunk really is invalid I must mark (at
least part of) it for refontification.




reply via email to

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