From mboxrd@z Thu Jan 1 00:00:00 1970 Path: quimby.gnus.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: Should invisible imply intangible? Date: Sun, 03 Mar 2002 12:11:18 -0500 Message-ID: <200203031711.g23HBI623254@rum.cs.yale.edu> References: <200202232019.g1NKJoG14638@aztec.santafe.edu> <200202250510.g1P5A3714156@rum.cs.yale.edu> <200202262013.g1QKDef16683@aztec.santafe.edu> <200203010130.g211UDG05790@rum.cs.yale.edu> <200203031440.g23EeN200619@aztec.santafe.edu> NNTP-Posting-Host: quimby2.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: quimby2.netfonds.no 1015175880 15555 195.204.10.66 (3 Mar 2002 17:18:00 GMT) X-Complaints-To: usenet@quimby2.netfonds.no NNTP-Posting-Date: 3 Mar 2002 17:18:00 GMT Cc: monnier+gnu/emacs@rum.cs.yale.edu, emacs-devel@gnu.org Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby2.netfonds.no with esmtp (Exim 3.12 #1 (Debian)) id 16hZcV-00042n-00 for ; Sun, 03 Mar 2002 18:18:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.33 #1 (Debian)) id 16hZWo-0001zJ-00; Sun, 03 Mar 2002 12:12:06 -0500 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by fencepost.gnu.org with esmtp (Exim 3.33 #1 (Debian)) id 16hZW6-0001vg-00; Sun, 03 Mar 2002 12:11:22 -0500 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id g23HBI623254; Sun, 3 Mar 2002 12:11:18 -0500 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Richard Stallman Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.5 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: quimby.gnus.org gmane.emacs.devel:1707 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:1707 > Also, as David Kastrup has mentioned repeatedly, intangible text tends > to break lots of things... > > I don't think so. Please, Richard, try to remember the lengthy discussion we've had about that. The problem is that the vast majority of elisp code does not expect to bump into a piece of intangible text and misbehaves when it happens. In practice, it's generally a non-issue because most uses of intangible text are restricted to a particular context so that this intangible text is only accessed by a small body of elisp code. > For example: automatically move point to a visible area after each command > (and after post-command-hook, of course) or during redisplay (I believe > there is already such a feature for text with a `display' property). > > If we can find some better way to move point out of certain text than > what `intangible' does now, perhaps we should redefine the meaning of > `intangible'. But I think it breaks only a few things, occasionally. > I think it is pretty good. I think the current semantics of `intangible' is not useless and until we can come up with something clearly superior, we shouldn't change it. I.e. what I suggest is more like the patch below (100% untested), which extends the treatment of the `composition' and `display' properties to `invisible'. Stefan Index: keyboard.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/keyboard.c,v retrieving revision 1.659 diff -u -u -b -r1.659 keyboard.c --- keyboard.c 23 Feb 2002 22:02:18 -0000 1.659 +++ keyboard.c 3 Mar 2002 17:08:25 -0000 @@ -1750,7 +1750,7 @@ { int start, end; Lisp_Object val; - int check_composition = 1, check_display = 1; + int check_composition = 1, check_display = 1, check_invisible = 1; while (check_composition || check_display) { @@ -1766,8 +1766,24 @@ else SET_PT (end); check_display = 1; + check_invisible = 1; } check_composition = 0; + if (check_invisible + && PT > BEGV && PT < ZV + && get_property_and_range (PT, Qinvisible, &val, &start, &end, Qnil) + && TEXT_PROP_MEANS_INVISIBLE (val) + && start < PT && end > PT + && (last_pt <= start || last_pt >= end)) + { + if (PT < last_pt) + SET_PT (start); + else + SET_PT (end); + check_composition = 1; + check_display = 1; + } + check_invisible = 0; if (check_display && PT > BEGV && PT < ZV && get_property_and_range (PT, Qdisplay, &val, &start, &end, Qnil) @@ -1780,6 +1796,7 @@ else SET_PT (end); check_composition = 1; + check_invisible = 1; } check_display = 0; } _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel