From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Islands and streams Date: Tue, 23 Nov 2010 22:23:25 +0000 Message-ID: <20101123222325.GA3315@muc.de> References: <201011201200.06827.bruno@clisp.org> <20101122193824.GA2745@muc.de> <87fwus4cpv.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1290551783 25538 80.91.229.12 (23 Nov 2010 22:36:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 23 Nov 2010 22:36:23 +0000 (UTC) Cc: emacs-devel@gnu.org To: David Kastrup Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 23 23:36:19 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PL1TG-00028Y-VX for ged-emacs-devel@m.gmane.org; Tue, 23 Nov 2010 23:36:19 +0100 Original-Received: from localhost ([127.0.0.1]:52286 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PL1TG-0005dZ-Dn for ged-emacs-devel@m.gmane.org; Tue, 23 Nov 2010 17:36:18 -0500 Original-Received: from [140.186.70.92] (port=55582 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PL1TA-0005dC-QT for emacs-devel@gnu.org; Tue, 23 Nov 2010 17:36:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PL1T9-0001Pf-MI for emacs-devel@gnu.org; Tue, 23 Nov 2010 17:36:12 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:2728 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PL1T9-0001PK-CY for emacs-devel@gnu.org; Tue, 23 Nov 2010 17:36:11 -0500 Original-Received: (qmail 40447 invoked by uid 3782); 23 Nov 2010 22:09:28 -0000 Original-Received: from acm.muc.de (pD9E22538.dip.t-dialin.net [217.226.37.56]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Tue, 23 Nov 2010 23:09:27 +0100 Original-Received: (qmail 3410 invoked by uid 1000); 23 Nov 2010 22:23:25 -0000 Content-Disposition: inline In-Reply-To: <87fwus4cpv.fsf@lola.goethe.zz> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:133096 Archived-At: Evening, David! On Tue, Nov 23, 2010 at 10:21:32AM +0100, David Kastrup wrote: > Alan Mackenzie writes: > > Emacs's syntax and movement routines should be enhanced to handle > > "islands". An @dfn{island} is a contiguous region of text where a > > major mode different from the surrounding text's is in force. It might > > be feasible to mark an island with syntax-table text props, it might not. > > Islands can be nested. > > Movement commands normally don't recognise islands as anything unusual, > > and just move into/out of them. By binding variable "respect-islands" to > > non-nil, any movement command would skip over any islands it encountered, > > and such commands could not move point out of an island. > > Several islands with the same major mode can by chained together as a > > @dfn{stream}. When respect-islands is non-nil, movement commands can > > jump over the "ocean" to the next/previous island in the chain. > > Some other Emacs features, such as font locking, would need enhancement. > [...] > > What do people think (other than the obvious, that I should implement it > > myself ;-)? > That it is an excessively bad idea. Lots of Elisp code relies on > (= (1+ (point)) (save-excursion (forward-char) (point))) > and similar equivalences. For this reason, "intangible" regions have > never worked reliably, and only in very limited contexts. Also for this > reason, multibyte support was quite unreliable and unpredictable until > buffer positions were made to correspond to character positions instead > of byte counts. That's a good point. But by default, the new feature would not be enabled. Only when a major mode binds `respect-islands' would it come into effect, and presumably the major mode would know what it was doing. > If you want something like this to work at all, all "wrong" parts of the > buffer must disappear completely from character counts and similar. > Then you need not worry about fixing syntax highlighting and similar. > It will just work. You mean, throw out the absolutely standard buffer position integer? > Other than that, it will never work reliably. Thanks for the optimism! ;-) > -- > David Kastrup -- Alan Mackenzie (Nuremberg, Germany).