emacs-devel
[Top][All Lists]
Advanced

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

Re: emacs-tree-sitter and Emacs


From: Eli Zaretskii
Subject: Re: emacs-tree-sitter and Emacs
Date: Fri, 03 Apr 2020 21:19:42 +0300

> From: Stephen Leake <address@hidden>
> Date: Fri, 03 Apr 2020 09:05:34 -0800
> 
> > Regarding the above use case, I don't think I understand what exactly
> > did you mean.  First, you cannot use set-variable to modify the value
> > of font-lock-function-name-face, because it isn't a defcustom.
> > Second, what exactly did you mean to set it to, to cause the effect
> > you were talking about?  IOW, can you present a complete recipe,
> > starting from "emacs -Q", where you make such a change, and then you
> > need to switch buffers to cause function names be displayed
> > differently?  I can tell you that if you replace "M-x set-variable"
> > with "M-x customize-face" and change some attribute of
> > font-lock-function-name-face, the effect on another frame is
> > immediate, which means redisplay takes note of the change and redraws
> > the other frame.  But I'm not sure this is the same use case you had
> > in mind.
> 
> Ok. In this case, customize-face causes the redisplay. So your original
> objection to the ada-mode face design, which was:
> 
> > And they cannot pick up every relevant change; for example, what
> > happens if some face used for font-lock is modified?
> 
> is moot.

My point was about using the modification hooks, not about triggering
redisplay.  That redisplay _is_ triggered by such changes (and by
others), was exactly my point.  Namely, relying on redisplay to redraw
the regions that require it, and as side-effect to refontify those
regions, is better than using modification hooks to decide where to
refontify.  And yes, if something changes that affects the appearance,
but redisplay is not triggered by that change, _is_ a bug.  By
contrast, not every such change is guaranteed to call the modification
hooks, and thus relying on those hooks will miss some changes, and you
will not be able to claim that this is a bug in those hooks, at least
not in all cases.

> If there are other things that can be changed that should force a
> redisplay, but currently don't, I would say that's a bug, either in
> ada-mode or elsewhere. So far there have been no bugs filed against
> ada-mode for this type if issue.

I wasn't claiming that ada-mode has bugs; I never use that mode.  I
was making a general argument against using modification hooks as
basis for deciding where to refontify.  This should be delegated to
redisplay, because it's redisplay's job to know which regions need to
be redrawn (including their fontification).



reply via email to

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