unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stefan Monnier" <monnier+gnu/emacs@RUM.cs.yale.edu>
Cc: monnier+gnu/emacs@rum.cs.yale.edu, emacs-devel@gnu.org
Subject: Re: Should invisible imply intangible?
Date: Sun, 03 Mar 2002 12:11:18 -0500	[thread overview]
Message-ID: <200203031711.g23HBI623254@rum.cs.yale.edu> (raw)
In-Reply-To: 200203031440.g23EeN200619@aztec.santafe.edu

>     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


  reply	other threads:[~2002-03-03 17:11 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-23 20:19 Should invisible imply intangible? Richard Stallman
2002-02-23 21:24 ` Paul Michael Reilly
2002-02-25  0:09   ` Richard Stallman
2002-02-25  5:10 ` Stefan Monnier
2002-02-26 20:13   ` Richard Stallman
2002-03-01  1:30     ` Stefan Monnier
2002-03-03 14:40       ` Richard Stallman
2002-03-03 17:11         ` Stefan Monnier [this message]
2002-03-04 23:41           ` Richard Stallman
2002-03-04 23:46             ` Stefan Monnier
2002-03-05  1:40             ` Stefan Monnier
2002-03-07  2:30               ` Richard Stallman
2002-03-04 23:41           ` Richard Stallman
2002-03-05 21:58             ` Richard Stallman
2002-03-05 23:04               ` Stefan Monnier
2002-03-05 23:34                 ` Stefan Monnier
2002-03-09 20:03                 ` Richard Stallman
2002-03-09 22:37                   ` Stefan Monnier
2002-03-10 21:32                     ` Richard Stallman
     [not found]                       ` <200203102202.g2AM26q06798@rum.cs.yale.edu>
2002-03-11 19:06                         ` Richard Stallman
2002-03-12 17:56                           ` Stefan Monnier
2002-03-13 10:58                             ` Richard Stallman
2002-03-13 11:19                               ` David Kastrup
2002-03-15  3:41                                 ` Richard Stallman
2002-03-15 11:47                                   ` David Kastrup
2002-03-16  6:39                                     ` Richard Stallman
2002-03-16 11:58                                       ` David Kastrup
2002-03-18  9:06                                         ` Richard Stallman
2002-03-18 23:36                                           ` David Kastrup
2002-03-19  7:24                                             ` Eli Zaretskii
2002-03-19 11:12                                               ` David Kastrup
2002-03-16  0:22                                   ` Stefan Monnier
2002-03-16  0:56                                     ` Miles Bader
2002-03-16  0:59                                       ` Stefan Monnier
2002-03-16  1:25                                         ` David Kastrup
2002-03-17 10:06                                         ` Richard Stallman
2002-03-16  1:18                                     ` David Kastrup
2002-03-16  1:28                                       ` Stefan Monnier
2002-03-16  2:16                                         ` David Kastrup
2002-03-16  3:29                                         ` Miles Bader
2002-03-16  4:05                                           ` David Kastrup
2002-03-23 23:37                                         ` David Kastrup
2002-03-13 13:06                               ` Stefan Monnier
2002-03-13 14:15                                 ` David Kastrup
2002-03-13 16:53                                   ` Stefan Monnier
2002-03-14 12:42                                   ` Richard Stallman

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200203031711.g23HBI623254@rum.cs.yale.edu \
    --to=monnier+gnu/emacs@rum.cs.yale.edu \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).