comparison src/xdisp.c @ 90203:187d6a1f84f7

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-71 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 485-492) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 92-94) - Merge from emacs--cvs-trunk--0 - Update from CVS
author Miles Bader <miles@gnu.org>
date Fri, 22 Jul 2005 08:27:27 +0000
parents fbb2bea03df9 bb9cda6ee0d1
children edf295560b5a
comparison
equal deleted inserted replaced
90202:7597b4a23c3b 90203:187d6a1f84f7
5965 5965
5966 /*********************************************************************** 5966 /***********************************************************************
5967 Moving an iterator without producing glyphs 5967 Moving an iterator without producing glyphs
5968 ***********************************************************************/ 5968 ***********************************************************************/
5969 5969
5970 /* Check if iterator is at a position corresponding to a valid buffer
5971 position after some move_it_ call. */
5972
5973 #define IT_POS_VALID_AFTER_MOVE_P(it) \
5974 ((it)->method == GET_FROM_STRING \
5975 ? IT_STRING_CHARPOS (*it) == 0 \
5976 : 1)
5977
5978
5970 /* Move iterator IT to a specified buffer or X position within one 5979 /* Move iterator IT to a specified buffer or X position within one
5971 line on the display without producing glyphs. 5980 line on the display without producing glyphs.
5972 5981
5973 OP should be a bit mask including some or all of these bits: 5982 OP should be a bit mask including some or all of these bits:
5974 MOVE_TO_X: Stop on reaching x-position TO_X. 5983 MOVE_TO_X: Stop on reaching x-position TO_X.
6488 do 6497 do
6489 { 6498 {
6490 move_it_to (&it2, start_pos, -1, -1, it2.vpos + 1, 6499 move_it_to (&it2, start_pos, -1, -1, it2.vpos + 1,
6491 MOVE_TO_POS | MOVE_TO_VPOS); 6500 MOVE_TO_POS | MOVE_TO_VPOS);
6492 } 6501 }
6493 while (it2.method != GET_FROM_BUFFER); 6502 while (!IT_POS_VALID_AFTER_MOVE_P (&it2));
6494 xassert (IT_CHARPOS (*it) >= BEGV); 6503 xassert (IT_CHARPOS (*it) >= BEGV);
6495 it3 = it2; 6504 it3 = it2;
6496 6505
6497 move_it_to (&it2, start_pos, -1, -1, -1, MOVE_TO_POS); 6506 move_it_to (&it2, start_pos, -1, -1, -1, MOVE_TO_POS);
6498 xassert (IT_CHARPOS (*it) >= BEGV); 6507 xassert (IT_CHARPOS (*it) >= BEGV);
6688 last_height = 0; 6697 last_height = 0;
6689 } 6698 }
6690 else if (dvpos > 0) 6699 else if (dvpos > 0)
6691 { 6700 {
6692 move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS); 6701 move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS);
6693 if (it->method != GET_FROM_BUFFER) 6702 if (!IT_POS_VALID_AFTER_MOVE_P (it))
6694 move_it_to (it, IT_CHARPOS (*it) + 1, -1, -1, -1, MOVE_TO_POS); 6703 move_it_to (it, IT_CHARPOS (*it) + 1, -1, -1, -1, MOVE_TO_POS);
6695 } 6704 }
6696 else 6705 else
6697 { 6706 {
6698 struct it it2; 6707 struct it it2;
6710 for (i = -dvpos; i > 0 && IT_CHARPOS (*it) > BEGV; --i) 6719 for (i = -dvpos; i > 0 && IT_CHARPOS (*it) > BEGV; --i)
6711 back_to_previous_visible_line_start (it); 6720 back_to_previous_visible_line_start (it);
6712 reseat (it, it->current.pos, 1); 6721 reseat (it, it->current.pos, 1);
6713 6722
6714 /* Move further back if we end up in a string or an image. */ 6723 /* Move further back if we end up in a string or an image. */
6715 while (it->method != GET_FROM_BUFFER) 6724 while (!IT_POS_VALID_AFTER_MOVE_P (it))
6716 { 6725 {
6717 /* First try to move to start of display line. */ 6726 /* First try to move to start of display line. */
6718 dvpos += it->vpos; 6727 dvpos += it->vpos;
6719 move_it_vertically_backward (it, 0); 6728 move_it_vertically_backward (it, 0);
6720 dvpos -= it->vpos; 6729 dvpos -= it->vpos;
6721 if (it->method == GET_FROM_BUFFER) 6730 if (IT_POS_VALID_AFTER_MOVE_P (it))
6722 break; 6731 break;
6723 /* If start of line is still in string or image, 6732 /* If start of line is still in string or image,
6724 move further back. */ 6733 move further back. */
6725 back_to_previous_visible_line_start (it); 6734 back_to_previous_visible_line_start (it);
6726 reseat (it, it->current.pos, 1); 6735 reseat (it, it->current.pos, 1);
10180 && (sym = indirect_variable (sym), 10189 && (sym = indirect_variable (sym),
10181 val = SYMBOL_VALUE (sym), 10190 val = SYMBOL_VALUE (sym),
10182 (BUFFER_LOCAL_VALUEP (val) 10191 (BUFFER_LOCAL_VALUEP (val)
10183 || SOME_BUFFER_LOCAL_VALUEP (val))) 10192 || SOME_BUFFER_LOCAL_VALUEP (val)))
10184 && XBUFFER_LOCAL_VALUE (val)->check_frame) 10193 && XBUFFER_LOCAL_VALUE (val)->check_frame)
10185 Fsymbol_value (sym); 10194 /* Use find_symbol_value rather than Fsymbol_value
10195 to avoid an error if it is void. */
10196 find_symbol_value (sym);
10186 10197
10187 for (tail = XFRAME (old)->param_alist; CONSP (tail); tail = XCDR (tail)) 10198 for (tail = XFRAME (old)->param_alist; CONSP (tail); tail = XCDR (tail))
10188 if (CONSP (XCAR (tail)) 10199 if (CONSP (XCAR (tail))
10189 && (sym = XCAR (XCAR (tail)), 10200 && (sym = XCAR (XCAR (tail)),
10190 SYMBOLP (sym)) 10201 SYMBOLP (sym))
10191 && (sym = indirect_variable (sym), 10202 && (sym = indirect_variable (sym),
10192 val = SYMBOL_VALUE (sym), 10203 val = SYMBOL_VALUE (sym),
10193 (BUFFER_LOCAL_VALUEP (val) 10204 (BUFFER_LOCAL_VALUEP (val)
10194 || SOME_BUFFER_LOCAL_VALUEP (val))) 10205 || SOME_BUFFER_LOCAL_VALUEP (val)))
10195 && XBUFFER_LOCAL_VALUE (val)->check_frame) 10206 && XBUFFER_LOCAL_VALUE (val)->check_frame)
10196 Fsymbol_value (sym); 10207 find_symbol_value (sym);
10197 } 10208 }
10198 10209
10199 10210
10200 #define STOP_POLLING \ 10211 #define STOP_POLLING \
10201 do { if (! polling_stopped_here) stop_polling (); \ 10212 do { if (! polling_stopped_here) stop_polling (); \
10264 count = SPECPDL_INDEX (); 10275 count = SPECPDL_INDEX ();
10265 record_unwind_protect (unwind_redisplay, 10276 record_unwind_protect (unwind_redisplay,
10266 Fcons (make_number (redisplaying_p), selected_frame)); 10277 Fcons (make_number (redisplaying_p), selected_frame));
10267 ++redisplaying_p; 10278 ++redisplaying_p;
10268 specbind (Qinhibit_free_realized_faces, Qnil); 10279 specbind (Qinhibit_free_realized_faces, Qnil);
10280
10281 {
10282 Lisp_Object tail, frame;
10283
10284 FOR_EACH_FRAME (tail, frame)
10285 {
10286 struct frame *f = XFRAME (frame);
10287 f->already_hscrolled_p = 0;
10288 }
10289 }
10269 10290
10270 retry: 10291 retry:
10271 pause = 0; 10292 pause = 0;
10272 reconsider_clip_changes (w, current_buffer); 10293 reconsider_clip_changes (w, current_buffer);
10273 10294
10699 goto retry; 10720 goto retry;
10700 10721
10701 if (FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f)) 10722 if (FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f))
10702 { 10723 {
10703 /* See if we have to hscroll. */ 10724 /* See if we have to hscroll. */
10704 if (hscroll_windows (f->root_window)) 10725 if (!f->already_hscrolled_p)
10705 goto retry; 10726 {
10727 f->already_hscrolled_p = 1;
10728 if (hscroll_windows (f->root_window))
10729 goto retry;
10730 }
10706 10731
10707 /* Prevent various kinds of signals during display 10732 /* Prevent various kinds of signals during display
10708 update. stdio is not robust about handling 10733 update. stdio is not robust about handling
10709 signals, which can cause an apparent I/O 10734 signals, which can cause an apparent I/O
10710 error. */ 10735 error. */