comparison src/xdisp.c @ 53045:b150b63563d6

(select_frame_for_redisplay): New function. (redisplay_internal): Record also selected_frame for unwind_redisplay. Call select_frame_for_redisplay before redrawing each frame. (unwind_redisplay): Argument changed to a cons.
author Kenichi Handa <handa@m17n.org>
date Thu, 13 Nov 2003 01:47:25 +0000
parents a15080fc1b51
children 1218a42792ea
comparison
equal deleted inserted replaced
53044:aa36f3c0f66e 53045:b150b63563d6
812 static int trailing_whitespace_p P_ ((int)); 812 static int trailing_whitespace_p P_ ((int));
813 static int message_log_check_duplicate P_ ((int, int, int, int)); 813 static int message_log_check_duplicate P_ ((int, int, int, int));
814 static void push_it P_ ((struct it *)); 814 static void push_it P_ ((struct it *));
815 static void pop_it P_ ((struct it *)); 815 static void pop_it P_ ((struct it *));
816 static void sync_frame_with_window_matrix_rows P_ ((struct window *)); 816 static void sync_frame_with_window_matrix_rows P_ ((struct window *));
817 static void select_frame_for_redisplay P_ ((Lisp_Object));
817 static void redisplay_internal P_ ((int)); 818 static void redisplay_internal P_ ((int));
818 static int echo_area_display P_ ((int)); 819 static int echo_area_display P_ ((int));
819 static void redisplay_windows P_ ((Lisp_Object)); 820 static void redisplay_windows P_ ((Lisp_Object));
820 static void redisplay_window P_ ((Lisp_Object, int)); 821 static void redisplay_window P_ ((Lisp_Object, int));
821 static Lisp_Object redisplay_window_error (); 822 static Lisp_Object redisplay_window_error ();
9540 XBUFFER (w->buffer), pt)) 9541 XBUFFER (w->buffer), pt))
9541 b->clip_changed = 1; 9542 b->clip_changed = 1;
9542 } 9543 }
9543 } 9544 }
9544 9545
9546
9547 /* Select FRAME to forward the values of frame-local variables into C
9548 variables so that the redisplay routines can access those values
9549 directly. */
9550
9551 static void
9552 select_frame_for_redisplay (frame)
9553 Lisp_Object frame;
9554 {
9555 Lisp_Object tail, sym, val;
9556 Lisp_Object old = selected_frame;
9557
9558 selected_frame = frame;
9559
9560 for (tail = XFRAME (frame)->param_alist; CONSP (tail); tail = XCDR (tail))
9561 if (CONSP (XCAR (tail))
9562 && (sym = XCAR (XCAR (tail)),
9563 SYMBOLP (sym))
9564 && (sym = indirect_variable (sym),
9565 val = SYMBOL_VALUE (sym),
9566 (BUFFER_LOCAL_VALUEP (val)
9567 || SOME_BUFFER_LOCAL_VALUEP (val)))
9568 && XBUFFER_LOCAL_VALUE (val)->check_frame)
9569 Fsymbol_value (sym);
9570
9571 for (tail = XFRAME (old)->param_alist; CONSP (tail); tail = XCDR (tail))
9572 if (CONSP (XCAR (tail))
9573 && (sym = XCAR (XCAR (tail)),
9574 SYMBOLP (sym))
9575 && (sym = indirect_variable (sym),
9576 val = SYMBOL_VALUE (sym),
9577 (BUFFER_LOCAL_VALUEP (val)
9578 || SOME_BUFFER_LOCAL_VALUEP (val)))
9579 && XBUFFER_LOCAL_VALUE (val)->check_frame)
9580 Fsymbol_value (sym);
9581 }
9582
9583
9545 #define STOP_POLLING \ 9584 #define STOP_POLLING \
9546 do { if (! polling_stopped_here) stop_polling (); \ 9585 do { if (! polling_stopped_here) stop_polling (); \
9547 polling_stopped_here = 1; } while (0) 9586 polling_stopped_here = 1; } while (0)
9548 9587
9549 #define RESUME_POLLING \ 9588 #define RESUME_POLLING \
9605 return; 9644 return;
9606 9645
9607 /* Record a function that resets redisplaying_p to its old value 9646 /* Record a function that resets redisplaying_p to its old value
9608 when we leave this function. */ 9647 when we leave this function. */
9609 count = SPECPDL_INDEX (); 9648 count = SPECPDL_INDEX ();
9610 record_unwind_protect (unwind_redisplay, make_number (redisplaying_p)); 9649 record_unwind_protect (unwind_redisplay,
9650 Fcons (make_number (redisplaying_p), selected_frame));
9611 ++redisplaying_p; 9651 ++redisplaying_p;
9612 specbind (Qinhibit_free_realized_faces, Qnil); 9652 specbind (Qinhibit_free_realized_faces, Qnil);
9613 9653
9614 retry: 9654 retry:
9615 pause = 0; 9655 pause = 0;
10019 { 10059 {
10020 struct frame *f = XFRAME (frame); 10060 struct frame *f = XFRAME (frame);
10021 10061
10022 if (FRAME_WINDOW_P (f) || f == sf) 10062 if (FRAME_WINDOW_P (f) || f == sf)
10023 { 10063 {
10064 if (! EQ (frame, selected_frame))
10065 /* Select the frame, for the sake of frame-local
10066 variables. */
10067 select_frame_for_redisplay (frame);
10068
10024 #ifdef HAVE_WINDOW_SYSTEM 10069 #ifdef HAVE_WINDOW_SYSTEM
10025 if (clear_face_cache_count % 50 == 0 10070 if (clear_face_cache_count % 50 == 0
10026 && FRAME_WINDOW_P (f)) 10071 && FRAME_WINDOW_P (f))
10027 clear_image_cache (f, 0); 10072 clear_image_cache (f, 0);
10028 #endif /* HAVE_WINDOW_SYSTEM */ 10073 #endif /* HAVE_WINDOW_SYSTEM */
10271 10316
10272 10317
10273 /* Function registered with record_unwind_protect in 10318 /* Function registered with record_unwind_protect in
10274 redisplay_internal. Reset redisplaying_p to the value it had 10319 redisplay_internal. Reset redisplaying_p to the value it had
10275 before redisplay_internal was called, and clear 10320 before redisplay_internal was called, and clear
10276 prevent_freeing_realized_faces_p. */ 10321 prevent_freeing_realized_faces_p. It also selects the previously
10322 selected frame. */
10277 10323
10278 static Lisp_Object 10324 static Lisp_Object
10279 unwind_redisplay (old_redisplaying_p) 10325 unwind_redisplay (val)
10280 Lisp_Object old_redisplaying_p; 10326 Lisp_Object val;
10281 { 10327 {
10328 Lisp_Object old_redisplaying_p, old_frame;
10329
10330 old_redisplaying_p = XCAR (val);
10282 redisplaying_p = XFASTINT (old_redisplaying_p); 10331 redisplaying_p = XFASTINT (old_redisplaying_p);
10332 old_frame = XCDR (val);
10333 if (! EQ (old_frame, selected_frame))
10334 select_frame_for_redisplay (old_frame);
10283 return Qnil; 10335 return Qnil;
10284 } 10336 }
10285 10337
10286 10338
10287 /* Mark the display of window W as accurate or inaccurate. If 10339 /* Mark the display of window W as accurate or inaccurate. If