From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Indirect buffers Date: Mon, 09 Jun 2014 17:41:07 +0300 Message-ID: <8361ka2lj0.fsf@gnu.org> References: <61933bd2-7a72-4666-bf23-deb677e1d62f@default> <83egyz2w4q.fsf@gnu.org> <877g4q1hpa.fsf@newcastle.ac.uk> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1402324893 22925 80.91.229.3 (9 Jun 2014 14:41:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 Jun 2014 14:41:33 +0000 (UTC) Cc: spinuvit@gmail.com, monnier@iro.umontreal.ca, drew.adams@oracle.com, emacs-devel@gnu.org To: phillip.lord@newcastle.ac.uk (Phillip Lord) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 09 16:41:25 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wu0lJ-0002ns-F3 for ged-emacs-devel@m.gmane.org; Mon, 09 Jun 2014 16:41:25 +0200 Original-Received: from localhost ([::1]:33470 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wu0lI-0008Hi-WB for ged-emacs-devel@m.gmane.org; Mon, 09 Jun 2014 10:41:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wu0lC-0008H9-N5 for emacs-devel@gnu.org; Mon, 09 Jun 2014 10:41:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wu0l5-0007wt-ES for emacs-devel@gnu.org; Mon, 09 Jun 2014 10:41:18 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:63913) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wu0l5-0007wF-1P for emacs-devel@gnu.org; Mon, 09 Jun 2014 10:41:11 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0N6W00E00OJT7Q00@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Mon, 09 Jun 2014 17:41:08 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N6W00DQKOSKVJ70@a-mtaout21.012.net.il>; Mon, 09 Jun 2014 17:41:08 +0300 (IDT) In-reply-to: <877g4q1hpa.fsf@newcastle.ac.uk> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:172418 Archived-At: > From: phillip.lord@newcastle.ac.uk (Phillip Lord) > Cc: Drew Adams , Vitalie Spinu , Stefan Monnier , > Date: Mon, 09 Jun 2014 11:49:05 +0100 > > 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. Thanks for the pointer. I indeed wondered how was it possible that no one came up with such a simple idea, so now I'm happy I was wrong.