comparison src/xdisp.c @ 83533:02e39decdc84

Merged from emacs@sv.gnu.org Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-351 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-352 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-353 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-354 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-355 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-356 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-357 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-358 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-359 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-360 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-361 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-362 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-363 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-364 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-365 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-366 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-367 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-368 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-369 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-370 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-115 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-116 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-117 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-118 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-119 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-120 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-573
author Karoly Lorentey <lorentey@elte.hu>
date Sat, 29 Jul 2006 09:59:12 +0000
parents b19aaf4ab0ee 40a88e361834
children 694bbb62a75d
comparison
equal deleted inserted replaced
83532:b19aaf4ab0ee 83533:02e39decdc84
3865 struct text_pos *position; 3865 struct text_pos *position;
3866 int display_replaced_before_p; 3866 int display_replaced_before_p;
3867 { 3867 {
3868 Lisp_Object form; 3868 Lisp_Object form;
3869 Lisp_Object location, value; 3869 Lisp_Object location, value;
3870 struct text_pos start_pos; 3870 struct text_pos start_pos, save_pos;
3871 int valid_p; 3871 int valid_p;
3872 3872
3873 /* If SPEC is a list of the form `(when FORM . VALUE)', evaluate FORM. 3873 /* If SPEC is a list of the form `(when FORM . VALUE)', evaluate FORM.
3874 If the result is non-nil, use VALUE instead of SPEC. */ 3874 If the result is non-nil, use VALUE instead of SPEC. */
3875 form = Qt; 3875 form = Qt;
4082 } 4082 }
4083 4083
4084 /* Save current settings of IT so that we can restore them 4084 /* Save current settings of IT so that we can restore them
4085 when we are finished with the glyph property value. */ 4085 when we are finished with the glyph property value. */
4086 4086
4087 save_pos = it->position;
4088 it->position = *position;
4087 push_it (it); 4089 push_it (it);
4090 it->position = save_pos;
4088 4091
4089 it->area = TEXT_AREA; 4092 it->area = TEXT_AREA;
4090 it->what = IT_IMAGE; 4093 it->what = IT_IMAGE;
4091 it->image_id = -1; /* no image */ 4094 it->image_id = -1; /* no image */
4092 it->position = start_pos; 4095 it->position = start_pos;
4156 4159
4157 if (valid_p && !display_replaced_before_p) 4160 if (valid_p && !display_replaced_before_p)
4158 { 4161 {
4159 /* Save current settings of IT so that we can restore them 4162 /* Save current settings of IT so that we can restore them
4160 when we are finished with the glyph property value. */ 4163 when we are finished with the glyph property value. */
4164 save_pos = it->position;
4165 it->position = *position;
4161 push_it (it); 4166 push_it (it);
4167 it->position = save_pos;
4168
4162 if (NILP (location)) 4169 if (NILP (location))
4163 it->area = TEXT_AREA; 4170 it->area = TEXT_AREA;
4164 else if (EQ (location, Qleft_margin)) 4171 else if (EQ (location, Qleft_margin))
4165 it->area = LEFT_MARGIN_AREA; 4172 it->area = LEFT_MARGIN_AREA;
4166 else 4173 else
4967 it->cmp_len = p->u.comp.cmp_len; 4974 it->cmp_len = p->u.comp.cmp_len;
4968 break; 4975 break;
4969 case GET_FROM_STRETCH: 4976 case GET_FROM_STRETCH:
4970 it->object = p->u.comp.object; 4977 it->object = p->u.comp.object;
4971 break; 4978 break;
4979 case GET_FROM_BUFFER:
4980 it->object = it->w->buffer;
4981 break;
4982 case GET_FROM_STRING:
4983 it->object = it->string;
4984 break;
4972 } 4985 }
4973 it->end_charpos = p->end_charpos; 4986 it->end_charpos = p->end_charpos;
4974 it->string_nchars = p->string_nchars; 4987 it->string_nchars = p->string_nchars;
4975 it->area = p->area; 4988 it->area = p->area;
4976 it->multibyte_p = p->multibyte_p; 4989 it->multibyte_p = p->multibyte_p;
5286 5299
5287 /* POS must be a reasonable value. */ 5300 /* POS must be a reasonable value. */
5288 xassert (CHARPOS (pos) >= BEGV && CHARPOS (pos) <= ZV); 5301 xassert (CHARPOS (pos) >= BEGV && CHARPOS (pos) <= ZV);
5289 5302
5290 it->current.pos = it->position = pos; 5303 it->current.pos = it->position = pos;
5291 XSETBUFFER (it->object, current_buffer);
5292 it->end_charpos = ZV; 5304 it->end_charpos = ZV;
5293 it->dpvec = NULL; 5305 it->dpvec = NULL;
5294 it->current.dpvec_index = -1; 5306 it->current.dpvec_index = -1;
5295 it->current.overlay_string_index = -1; 5307 it->current.overlay_string_index = -1;
5296 IT_STRING_CHARPOS (*it) = -1; 5308 IT_STRING_CHARPOS (*it) = -1;
5784 pop_it (it); 5796 pop_it (it);
5785 if (it->method == GET_FROM_STRING) 5797 if (it->method == GET_FROM_STRING)
5786 { 5798 {
5787 IT_STRING_BYTEPOS (*it) += it->len; 5799 IT_STRING_BYTEPOS (*it) += it->len;
5788 IT_STRING_CHARPOS (*it) += it->cmp_len; 5800 IT_STRING_CHARPOS (*it) += it->cmp_len;
5789 it->object = it->string;
5790 goto consider_string_end; 5801 goto consider_string_end;
5791 } 5802 }
5792 else if (it->method == GET_FROM_BUFFER) 5803 else if (it->method == GET_FROM_BUFFER)
5793 { 5804 {
5794 IT_BYTEPOS (*it) += it->len; 5805 IT_BYTEPOS (*it) += it->len;
5795 IT_CHARPOS (*it) += it->cmp_len; 5806 IT_CHARPOS (*it) += it->cmp_len;
5796 it->object = it->w->buffer;
5797 } 5807 }
5798 break; 5808 break;
5799 5809
5800 case GET_FROM_C_STRING: 5810 case GET_FROM_C_STRING:
5801 /* Current display element of IT is from a C string. */ 5811 /* Current display element of IT is from a C string. */
6031 it->c = SREF (it->string, IT_STRING_BYTEPOS (*it)); 6041 it->c = SREF (it->string, IT_STRING_BYTEPOS (*it));
6032 it->len = 1; 6042 it->len = 1;
6033 } 6043 }
6034 } 6044 }
6035 6045
6036 /* Record what we have and where it came from. Note that we store a 6046 /* Record what we have and where it came from. */
6037 buffer position in IT->position although it could arguably be a
6038 string position. */
6039 it->what = IT_CHARACTER; 6047 it->what = IT_CHARACTER;
6040 it->object = it->string; 6048 it->object = it->string;
6041 it->position = position; 6049 it->position = position;
6042 return 1; 6050 return 1;
6043 } 6051 }
6748 } 6756 }
6749 6757
6750 if (reached) 6758 if (reached)
6751 break; 6759 break;
6752 } 6760 }
6761 else if (BUFFERP (it->object)
6762 && it->method == GET_FROM_BUFFER
6763 && IT_CHARPOS (*it) >= to_charpos)
6764 skip = MOVE_POS_MATCH_OR_ZV;
6753 else 6765 else
6754 skip = move_it_in_display_line_to (it, to_charpos, -1, MOVE_TO_POS); 6766 skip = move_it_in_display_line_to (it, to_charpos, -1, MOVE_TO_POS);
6755 6767
6756 switch (skip) 6768 switch (skip)
6757 { 6769 {
16551 16563
16552 /* Temporarily make frame's keyboard the current kboard so that 16564 /* Temporarily make frame's keyboard the current kboard so that
16553 kboard-local variables in the mode_line_format will get the right 16565 kboard-local variables in the mode_line_format will get the right
16554 values. */ 16566 values. */
16555 push_kboard (FRAME_KBOARD (it.f)); 16567 push_kboard (FRAME_KBOARD (it.f));
16568 record_unwind_save_match_data ();
16556 display_mode_element (&it, 0, 0, 0, format, Qnil, 0); 16569 display_mode_element (&it, 0, 0, 0, format, Qnil, 0);
16557 pop_kboard (); 16570 pop_kboard ();
16558 16571
16559 unbind_to (count, Qnil); 16572 unbind_to (count, Qnil);
16560 16573