aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-01-03 14:04:14 +0000
committerGerd Moellmann2000-01-03 14:04:14 +0000
commit13f19968a96a5f9d8f5fb2817c1d7ca9017cd3dd (patch)
treea87cf66296a2dfb9a4834cfbf21a61608676f2d6 /src
parent4598da60885df3ec3dd22c236431def4826ad791 (diff)
downloademacs-13f19968a96a5f9d8f5fb2817c1d7ca9017cd3dd.tar.gz
emacs-13f19968a96a5f9d8f5fb2817c1d7ca9017cd3dd.zip
(reseat_at_next_visible_line_start): Position before
newline only if ending up on a newline. (next_element_from_ellipsis): Return success. Handle case of displaying no ellipsis. Fix case of ellipsis defined in display table. (next_element_from_buffer): Return 0 if next_element_from_ellipsis returns 0.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c55
1 files changed, 31 insertions, 24 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index ddce21eb951..09c9b70f506 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -3132,7 +3132,9 @@ reseat_at_next_visible_line_start (it, on_newline_p)
3132 forward_to_next_line_start (it); 3132 forward_to_next_line_start (it);
3133 3133
3134 /* Position on the newline if we should. */ 3134 /* Position on the newline if we should. */
3135 if (on_newline_p && IT_CHARPOS (*it) > BEGV) 3135 if (on_newline_p
3136 && IT_CHARPOS (*it) > BEGV
3137 && FETCH_BYTE (IT_BYTEPOS (*it) - 1) == '\n')
3136 { 3138 {
3137 --IT_CHARPOS (*it); 3139 --IT_CHARPOS (*it);
3138 IT_BYTEPOS (*it) = CHAR_TO_BYTE (IT_CHARPOS (*it)); 3140 IT_BYTEPOS (*it) = CHAR_TO_BYTE (IT_CHARPOS (*it));
@@ -3831,32 +3833,37 @@ next_element_from_c_string (it)
3831 entry. This function Fills IT with the first glyph from the 3833 entry. This function Fills IT with the first glyph from the
3832 ellipsis if an ellipsis is to be displayed. */ 3834 ellipsis if an ellipsis is to be displayed. */
3833 3835
3834static void 3836static int
3835next_element_from_ellipsis (it) 3837next_element_from_ellipsis (it)
3836 struct it *it; 3838 struct it *it;
3837{ 3839{
3838 if (it->dp && VECTORP (DISP_INVIS_VECTOR (it->dp))) 3840 if (it->selective_display_ellipsis_p)
3839 { 3841 {
3840 /* Use the display table definition for `...'. Invalid glyphs 3842 if (it->dp && VECTORP (DISP_INVIS_VECTOR (it->dp)))
3841 will be handled by the method returning elements from dpvec. */ 3843 {
3842 struct Lisp_Vector *v = XVECTOR (DISP_INVIS_VECTOR (it->dp)); 3844 /* Use the display table definition for `...'. Invalid glyphs
3843 it->dpvec_char_len = it->len; 3845 will be handled by the method returning elements from dpvec. */
3844 it->dpvec = v->contents; 3846 struct Lisp_Vector *v = XVECTOR (DISP_INVIS_VECTOR (it->dp));
3845 it->dpend = v->contents + v->size; 3847 it->dpvec_char_len = it->len;
3846 it->current.dpvec_index = 0; 3848 it->dpvec = v->contents;
3847 it->method = next_element_from_display_vector; 3849 it->dpend = v->contents + v->size;
3848 get_next_display_element (it); 3850 it->current.dpvec_index = 0;
3849 } 3851 it->method = next_element_from_display_vector;
3850 else if (it->selective_display_ellipsis_p) 3852 }
3851 { 3853 else
3852 /* Use default `...' which is stored in default_invis_vector. */ 3854 {
3853 it->dpvec_char_len = it->len; 3855 /* Use default `...' which is stored in default_invis_vector. */
3854 it->dpvec = default_invis_vector; 3856 it->dpvec_char_len = it->len;
3855 it->dpend = default_invis_vector + 3; 3857 it->dpvec = default_invis_vector;
3856 it->current.dpvec_index = 0; 3858 it->dpend = default_invis_vector + 3;
3857 it->method = next_element_from_display_vector; 3859 it->current.dpvec_index = 0;
3858 get_next_display_element (it); 3860 it->method = next_element_from_display_vector;
3861 }
3859 } 3862 }
3863 else
3864 reseat_at_next_visible_line_start (it, 1);
3865
3866 return get_next_display_element (it);
3860} 3867}
3861 3868
3862 3869
@@ -3977,7 +3984,7 @@ next_element_from_buffer (it)
3977 IT_BYTEPOS (*it) + 1, 3984 IT_BYTEPOS (*it) + 1,
3978 it->selective)) 3985 it->selective))
3979 { 3986 {
3980 next_element_from_ellipsis (it); 3987 success_p = next_element_from_ellipsis (it);
3981 it->dpvec_char_len = -1; 3988 it->dpvec_char_len = -1;
3982 } 3989 }
3983 } 3990 }
@@ -3986,7 +3993,7 @@ next_element_from_buffer (it)
3986 /* A value of selective == -1 means that everything from the 3993 /* A value of selective == -1 means that everything from the
3987 CR to the end of the line is invisible, with maybe an 3994 CR to the end of the line is invisible, with maybe an
3988 ellipsis displayed for it. */ 3995 ellipsis displayed for it. */
3989 next_element_from_ellipsis (it); 3996 success_p = next_element_from_ellipsis (it);
3990 it->dpvec_char_len = -1; 3997 it->dpvec_char_len = -1;
3991 } 3998 }
3992 } 3999 }