[Top][All Lists]

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

Re: streams are cool, you could stream virtually anything!

From: Phillip Lord
Subject: Re: streams are cool, you could stream virtually anything!
Date: Fri, 06 Nov 2015 09:54:18 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> From: address@hidden (Phillip Lord)
>> Date: Thu, 05 Nov 2015 12:28:42 +0000
>> Cc: Damien Cassou <address@hidden>, emacs-devel <address@hidden>
>> Emacs is single threaded, so the only thing that can change the buffer
>> during a while loop is the stuff in the while loop.
> Apologies if what I'm saying makes no sense for this particular
> discussion (I didn't track it), but such assumptions are generally
> incorrect, unless you have extremely tight control on the code inside
> that loop (read: you yourself wrote every single function it calls,
> and you know very well what you are doing).  Otherwise, you might be
> in for a surprise.  For example, code that calls sit-for or even
> read-event can invoke timers, which can do all kinds of things to your
> buffer.  Even some primitive that calls QUIT could potentially do
> that, although not with the current code base (QUIT invokes atimers).
> There be dragons.


You are, indeed, correct. Perhaps I could rephrase, and say that during
a while loop there are circumstances when the buffer could change as a
result of something else happening.

With a lazily evaluation of a search through the buffer, though, I think
that those issues might be larger.

Still, you can never tell with these things for sure, till you try them.
A streaming interface to emacs buffers sound like it might be
interesting, and I've thought about it myself before. We shall see!


reply via email to

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