# HG changeset patch # User Richard M. Stallman # Date 744156033 0 # Node ID abd79e187610acc96f0c4ded570e8e4cf83f50cd # Parent edffa4f0c5d98a5219c8f5be2d8f2650f892d1a8 (try_window): Handle invisible newline at end of buffer. (display_text_line): Don't display invisible text. diff -r edffa4f0c5d9 -r abd79e187610 src/xdisp.c --- 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;