changeset 4386:abd79e187610

(try_window): Handle invisible newline at end of buffer. (display_text_line): Don't display invisible text.
author Richard M. Stallman <rms@gnu.org>
date Sat, 31 Jul 1993 22:00:33 +0000
parents edffa4f0c5d9
children 3e18f6a1915b
files src/xdisp.c
diffstat 1 files changed, 49 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Sat Jul 31 21:59:42 1993 +0000
+++ b/src/xdisp.c	Sat Jul 31 22:00:33 1993 +0000
@@ -33,6 +33,7 @@
 #include "macros.h"
 #include "disptab.h"
 #include "termhooks.h"
+#include "intervals.h"
 
 extern int interrupt_input;
 extern int command_loop_level;
@@ -1131,7 +1132,10 @@
       if (pos != val.bufpos)
 	last_text_vpos
 	  /* Next line, unless prev line ended in end of buffer with no cr */
-	  = vpos - (val.vpos && FETCH_CHAR (val.bufpos - 1) != '\n');
+	  = vpos - (val.vpos && (FETCH_CHAR (val.bufpos - 1) != '\n'
+				 || ! NILP (Fget_text_property (val.bufpos-1,
+								Qinvisible,
+								Fcurrent_buffer ()))));
       pos = val.bufpos;
     }
 
@@ -1723,6 +1727,12 @@
      to overlays or text property changes.  */
   int next_face_change;
 
+#ifdef USE_TEXT_PROPERTIES
+  /* The next location where the `invisible' property changes */
+  int next_invisible;
+  Lisp_Object prop, position, endpos;
+#endif
+  
   /* The face we're currently using.  */
   int current_face = 0;
 
@@ -1781,6 +1791,9 @@
      or at face change.  */
   pause = pos;
   next_face_change = pos;
+#ifdef USE_TEXT_PROPERTIES
+  next_invisible = pos;
+#endif
   while (p1 < endp)
     {
       p1prev = p1;
@@ -1798,11 +1811,41 @@
 	      cursor_hpos = p1 - startp;
 	    }
 
+#ifdef USE_TEXT_PROPERTIES
+	  /* if the `invisible' property is set to t, we can skip to
+	     the next property change */
+	  while (pos == next_invisible && pos < end)
+	  {
+	    XFASTINT (position) = pos;
+	    prop = Fget_text_property (position,
+				       Qinvisible,
+				       Fcurrent_buffer ());
+	    endpos = Fnext_single_property_change (position,
+						   Qinvisible,
+						   Fcurrent_buffer ());
+	    if (INTEGERP (endpos))
+	      next_invisible = XINT (endpos);
+	    else
+	      next_invisible = end;
+	    if (! NILP (prop))
+	    {
+	      if (pos < point && next_invisible >= point)
+	      {
+		cursor_vpos = vpos;
+		cursor_hpos = p1 - startp;
+	      }
+	      pos = next_invisible;
+	    }
+	  }
+	  if (pos >= end)
+	    break;
+#endif
+
 #ifdef HAVE_X_WINDOWS
 	  /* Did we hit a face change?  Figure out what face we should
 	     use now.  We also hit this the first time through the
 	     loop, to see what face we should start with.  */
-	  if (pos == next_face_change && FRAME_X_P (f))
+	  if (pos >= next_face_change && FRAME_X_P (f))
 	    current_face = compute_char_face (f, w, pos,
 					      region_beg, region_end,
 					      &next_face_change);
@@ -1810,6 +1853,10 @@
 
 	  pause = end;
 
+#ifdef USE_TEXT_PROPERTIES	  
+	  if (pos < next_invisible && next_invisible < pause)
+	    pause = next_invisible;
+#endif
 	  if (pos < next_face_change && next_face_change < pause)
 	    pause = next_face_change;