From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@newcastle.ac.uk (Phillip Lord) Newsgroups: gmane.emacs.help Subject: Re: indirect-buffers and text-properties Date: Thu, 30 Jan 2014 15:45:21 +0000 Message-ID: <87txclpj72.fsf@newcastle.ac.uk> References: <87fvo5r6uk.fsf@newcastle.ac.uk> <8761p1r214.fsf@newcastle.ac.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1391096748 5029 80.91.229.3 (30 Jan 2014 15:45:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Jan 2014 15:45:48 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 30 16:45:55 2014 Return-path: Envelope-to: geh-help-gnu-emacs@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 1W8toQ-0003NY-16 for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Jan 2014 16:45:54 +0100 Original-Received: from localhost ([::1]:50916 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8toP-0004cF-LH for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Jan 2014 10:45:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8to3-0004c6-Kd for help-gnu-emacs@gnu.org; Thu, 30 Jan 2014 10:45:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8tny-0007nz-6V for help-gnu-emacs@gnu.org; Thu, 30 Jan 2014 10:45:31 -0500 Original-Received: from cheviot22.ncl.ac.uk ([128.240.234.22]:47779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8tnx-0007ks-Eq for help-gnu-emacs@gnu.org; Thu, 30 Jan 2014 10:45:25 -0500 Original-Received: from smtpauth-vm.ncl.ac.uk ([10.8.233.129]) by cheviot22.ncl.ac.uk with esmtp (Exim 4.63) (envelope-from ) id 1W8tnw-0004BC-DV; Thu, 30 Jan 2014 15:45:24 +0000 Original-Received: from localhost (jangai.ncl.ac.uk [10.66.67.223]) (authenticated bits=0) by smtpauth-vm.ncl.ac.uk (8.13.8/8.13.8) with ESMTP id s0UFjN9C020048 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 30 Jan 2014 15:45:23 GMT In-Reply-To: (Stefan Monnier's message of "Thu, 30 Jan 2014 10:03:04 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 128.240.234.22 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:95809 Archived-At: Stefan Monnier writes: >> Really? I've started using them because they enable me to have the point >> in two places at once; for example, in the pre-amble and the body of a > [...] >> visible window). Indirect buffers seem to be a nice solution for this. > > That would be using a definition of "nice" very different from the one > I'm familiar with ;-) > > BTW, you might like to M-x report-emacs-bug and request exactly this > feature for "preserving window-specific point". It can probably be > implemented in a *much* lighter way than by using indirect-buffers. I would, but I am not sure what the correct behavour is. Consider: Window 1 (point at beg) ---- Window 2 (point at end) C-x 1 Window 1 (point at beg) C-x 2 Window 1 (point at beg) ---- Window 2 (point at beg) If one of the two windows is indirect, at least point is preserved somewhere, so I can get back to it. > >> Even as it stands, having the same content in two different modes seems >> very powerful; > > It is very powerful, but as you've seen indirect-buffers only work to > some extent for that purpose and the problems you bump into are largely > unsolvable. So it's not going in the right direction. > > I think they really fit perfectly the definition of attractive-nuisance. Okay, I have to accept your word on this, but I can't see another solution in my head. The best I have come up with is to hook into the change-functions, and link two (otherwise independent buffers) together so that the text in both is identical. AFAICT this is tractable, at least if I only edit one of them. So, I'd have something like `make-indirect-view' which would open an indirect buffer, in a new window, read-only, but in a different mode. Then `swap-modes' which would take the major mode of the editable buffer, and the uneditable buffer and swap the two. Finally, somelike `sync-indirect-view' would display make the two display the same parts. Seems like a reasonable amount of work to do, but could be usuable. Phil