aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1993-07-31 22:00:33 +0000
committerRichard M. Stallman1993-07-31 22:00:33 +0000
commitb0a0fbdac84fd793034515b3647b97f436b264df (patch)
tree8c26b1fc201c2899855e0c6a89765051f978ccc9 /src
parent5a05d3d2974885408f0235c40a98b7fd046cbd7f (diff)
downloademacs-b0a0fbdac84fd793034515b3647b97f436b264df.tar.gz
emacs-b0a0fbdac84fd793034515b3647b97f436b264df.zip
(try_window): Handle invisible newline at end of buffer.
(display_text_line): Don't display invisible text.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c51
1 files changed, 49 insertions, 2 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index a716a25c3e5..b9ef666f869 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -33,6 +33,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
33#include "macros.h" 33#include "macros.h"
34#include "disptab.h" 34#include "disptab.h"
35#include "termhooks.h" 35#include "termhooks.h"
36#include "intervals.h"
36 37
37extern int interrupt_input; 38extern int interrupt_input;
38extern int command_loop_level; 39extern int command_loop_level;
@@ -1131,7 +1132,10 @@ try_window (window, pos)
1131 if (pos != val.bufpos) 1132 if (pos != val.bufpos)
1132 last_text_vpos 1133 last_text_vpos
1133 /* Next line, unless prev line ended in end of buffer with no cr */ 1134 /* Next line, unless prev line ended in end of buffer with no cr */
1134 = vpos - (val.vpos && FETCH_CHAR (val.bufpos - 1) != '\n'); 1135 = vpos - (val.vpos && (FETCH_CHAR (val.bufpos - 1) != '\n'
1136 || ! NILP (Fget_text_property (val.bufpos-1,
1137 Qinvisible,
1138 Fcurrent_buffer ()))));
1135 pos = val.bufpos; 1139 pos = val.bufpos;
1136 } 1140 }
1137 1141
@@ -1723,6 +1727,12 @@ display_text_line (w, start, vpos, hpos, taboffset)
1723 to overlays or text property changes. */ 1727 to overlays or text property changes. */
1724 int next_face_change; 1728 int next_face_change;
1725 1729
1730#ifdef USE_TEXT_PROPERTIES
1731 /* The next location where the `invisible' property changes */
1732 int next_invisible;
1733 Lisp_Object prop, position, endpos;
1734#endif
1735
1726 /* The face we're currently using. */ 1736 /* The face we're currently using. */
1727 int current_face = 0; 1737 int current_face = 0;
1728 1738
@@ -1781,6 +1791,9 @@ display_text_line (w, start, vpos, hpos, taboffset)
1781 or at face change. */ 1791 or at face change. */
1782 pause = pos; 1792 pause = pos;
1783 next_face_change = pos; 1793 next_face_change = pos;
1794#ifdef USE_TEXT_PROPERTIES
1795 next_invisible = pos;
1796#endif
1784 while (p1 < endp) 1797 while (p1 < endp)
1785 { 1798 {
1786 p1prev = p1; 1799 p1prev = p1;
@@ -1798,11 +1811,41 @@ display_text_line (w, start, vpos, hpos, taboffset)
1798 cursor_hpos = p1 - startp; 1811 cursor_hpos = p1 - startp;
1799 } 1812 }
1800 1813
1814#ifdef USE_TEXT_PROPERTIES
1815 /* if the `invisible' property is set to t, we can skip to
1816 the next property change */
1817 while (pos == next_invisible && pos < end)
1818 {
1819 XFASTINT (position) = pos;
1820 prop = Fget_text_property (position,
1821 Qinvisible,
1822 Fcurrent_buffer ());
1823 endpos = Fnext_single_property_change (position,
1824 Qinvisible,
1825 Fcurrent_buffer ());
1826 if (INTEGERP (endpos))
1827 next_invisible = XINT (endpos);
1828 else
1829 next_invisible = end;
1830 if (! NILP (prop))
1831 {
1832 if (pos < point && next_invisible >= point)
1833 {
1834 cursor_vpos = vpos;
1835 cursor_hpos = p1 - startp;
1836 }
1837 pos = next_invisible;
1838 }
1839 }
1840 if (pos >= end)
1841 break;
1842#endif
1843
1801#ifdef HAVE_X_WINDOWS 1844#ifdef HAVE_X_WINDOWS
1802 /* Did we hit a face change? Figure out what face we should 1845 /* Did we hit a face change? Figure out what face we should
1803 use now. We also hit this the first time through the 1846 use now. We also hit this the first time through the
1804 loop, to see what face we should start with. */ 1847 loop, to see what face we should start with. */
1805 if (pos == next_face_change && FRAME_X_P (f)) 1848 if (pos >= next_face_change && FRAME_X_P (f))
1806 current_face = compute_char_face (f, w, pos, 1849 current_face = compute_char_face (f, w, pos,
1807 region_beg, region_end, 1850 region_beg, region_end,
1808 &next_face_change); 1851 &next_face_change);
@@ -1810,6 +1853,10 @@ display_text_line (w, start, vpos, hpos, taboffset)
1810 1853
1811 pause = end; 1854 pause = end;
1812 1855
1856#ifdef USE_TEXT_PROPERTIES
1857 if (pos < next_invisible && next_invisible < pause)
1858 pause = next_invisible;
1859#endif
1813 if (pos < next_face_change && next_face_change < pause) 1860 if (pos < next_face_change && next_face_change < pause)
1814 pause = next_face_change; 1861 pause = next_face_change;
1815 1862