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:39:18 +0300

> From: Stephen Leake <address@hidden>
> Date: Fri, 03 Apr 2020 09:24:38 -0800
> 
> > I meant BEG_UNCHANGED and END_UNCHANGED.
> 
> Ah; I was unaware of those. It would be good if these values were
> accessible from modules and elisp.

We can discuss this.  It wasn't needed up until now.

> Hmm. Browsing the emacs C source to see if there is such a function (I
> didn't find one, but I could have missed it), I found this in keyboard.c:
> 
>       /* If the previous command tried to force a specific window-start,
>        forget about that, in case this command moves point far away
>        from that position.  But also throw away beg_unchanged and
>        end_unchanged information in that case, so that redisplay will
>        update the whole window properly.  */
> 
>     BUF_BEG_UNCHANGED (b) = BUF_END_UNCHANGED (b) = 0;
> 
> which means BEG_UNCHANGED can indicate changes when there are actually
> none.

Yes.  This machinery exists for use by redisplay, and redisplay has
its own methods of finding out what changed and where.  These two
values are optimizations that allow redisplay examine only part of the
buffer for possible changes; it is okay to disable optimizations when
unoptimized code produces the correct result.



reply via email to

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