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

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

Re: relative line numbers and folding: how to make they play along?


From: Eli Zaretskii
Subject: Re: relative line numbers and folding: how to make they play along?
Date: Fri, 15 Jul 2016 17:22:07 +0300

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Fri, 15 Jul 2016 09:53:44 -0400
> 
> I was more thinking of the situation I mentioned in some other
> discussion: rewrite the top-level of the redisplay code in Elisp,

Conditioning the minor feature discussed in this thread on such a
thorough rewrite of the display code sounds like overkill to me.

> basically a function which:
> - asks the C code which windows need to be redisplayed.
> - call a C function on each of those windows to recompute the matrices.
> - detect the case where point is out of the window, and either move
>   point and call the recompute-matrices function, or call another
>   C function to do the scrolling.
> - then call a C function on each window/frame to update the display.
> 
> >From there we can hope to provide a more efficient/robust follow-mode
> (while still implementing it in Elisp).  And in that context, we should
> also be able to provide a more efficient relative-visual-linum-mode, tho
> it might require yet more access, such as subrs to scan/read the
> matrices, and maybe other subrs to modify the matrices (to update the
> margin).
> 
> Some of those primitives would probably also be useful in order to write
> tests of the redisplay code.
> 
> I think such a change should be doable without a complete rewrite of
> the redisplay.  But it would undoubtedly take a fair bit of work.

Frankly, I don't see any significant gains in your suggestion.
Basically, you suggest to leave the bulk of the display code
unchanged, and introduce a Lisp-level driver that calls its parts one
after the other.  Moreover, that Lisp will be called from C, since
that's where we currently invoke redisplay.  I don't see why we would
want that, and disagree with you that this will make the job of
follow-mode easier (because what follow-mode wants is intervene in the
middle of some of those parts you want to leave in C).

I think a much better plan is to expose some of the C data structures
to Lisp, and provide focused hooks at strategic places for Lisp to be
able to affect what redisplay does, by accessing those data structures
and making decisions based on that.



reply via email to

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