From: phillip.lord@newcastle.ac.uk (Phillip Lord)
To: Eli Zaretskii <eliz@gnu.org>
Cc: Vitalie Spinu <spinuvit@gmail.com>,
Stefan Monnier <monnier@iro.umontreal.ca>,
Drew Adams <drew.adams@oracle.com>,
emacs-devel@gnu.org
Subject: Re: Indirect buffers
Date: Mon, 09 Jun 2014 11:49:05 +0100 [thread overview]
Message-ID: <877g4q1hpa.fsf@newcastle.ac.uk> (raw)
In-Reply-To: <83egyz2w4q.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 8 Jun 2014 19:39:49 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
> 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.
Forgive the plug, but this is exactly how my own linked-buffer works.
https://github.com/phillord/linked-buffer/
It works fine and is performant enough for smallish files; I haven't
tried it for much larger ones yet. This is with a very dumb
implementation (the whole buffer is copied on the after change hook).
The big advantage over indirect buffers is that I control the way in
which text in the two buffers is related; if this is `buffer-string'
you'd get the same as indirect-buffers (although less efficiently). If
you use the no-properties version, then you get something like
indirect-buffers but multi-modes work. If you use an function which
changes the text, then you can support two modes with incompatible
syntaxes. No support at all is needed from the modes.
Phil
next prev parent reply other threads:[~2014-06-09 10:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-08 15:53 bug#17738: 24.4.50; (jit-lock-mode nil) in indirect buffer: wrong message Drew Adams
2014-06-08 16:39 ` Indirect buffers Eli Zaretskii
2014-06-09 10:49 ` Phillip Lord [this message]
2014-06-09 14:41 ` Eli Zaretskii
2016-04-29 20:44 ` bug#17738: 24.4.50; (jit-lock-mode nil) in indirect buffer: wrong message Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877g4q1hpa.fsf@newcastle.ac.uk \
--to=phillip.lord@newcastle.ac.uk \
--cc=drew.adams@oracle.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=spinuvit@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.