[Top][All Lists]

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

Indirect buffers

From: Eli Zaretskii
Subject: Indirect buffers
Date: Sun, 08 Jun 2014 19:39:49 +0300

> Date: Sun, 8 Jun 2014 08:53:54 -0700 (PDT)
> From: Drew Adams <address@hidden>
> [Beyond this, I hope you will revisit the behavior wrt jit-lock and
> indirect buffers, to DTRT following the (unfinished) emacs-devel thread
> "Re: trunk r116426: * lisp/jit-lock.el (jit-lock-mode): Keep it disabled
> in indirect buffers." (2014-05-21 to 2014-05-30).  Like Vitalie, I would
> like to see a solution to the problem of font-locking indirect buffers
> independently of each other and of the base buffer, each according to
> its major mode etc.]

And I wish you and Vitalie just dropped the idea.  It's unworkable.
It's against the very design of the Emacs display engine.  Stefan is
right: indirect buffers are an attractive nuisance.

By the time Vitalie or someone else solves the basic problems whose
discussion has just begun in that thread, we will discover that
problems pop up all over the place.  Just wait until people start
using multi-mode implemented via indirect buffers with all the arsenal
of display-related tricks and hacks that Emacs lets you play with.
IME, you cannot possibly envision most, let alone all, of the
complications that the existing display features impose on something
like that.

And we didn't even start talking about performance, of which this
implementation will surely be a killer, except in very small buffers.

Something that at first sight already looks as going against the
current design of redisplay is simply not worth the time.  For such
fundamental features, "almost works" is really another way of saying
"broken".  If it isn't clear how to make it work "perfectly" now,
before all the complications are known, you can be sure there will be
unsolvable problems once work will have begun in earnest.

So I suggest to step back a notch, and try looking for ideas to
implement these features in a way that doesn't require different
buffers to share text.  E.g., even manually keeping several separate
buffers in sync by updating their text when it changes in one of them,
sounds like an easier way.  Emacs is very good at inserting and
deleting chunks of text into/from a buffer, and from what I've read,
all the major problems Vitalie complained about will be miraculously
solved.  It should be easy to implement a prototype in Lisp, and if it
turns out it is too slow (which I sincerely doubt), we could add some
simple infrastructure in C to speed that up.

reply via email to

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