comparison src/redisplay.c @ 282:c42ec1d1cded r21-0b39

Import from CVS: tag r21-0b39
author cvs
date Mon, 13 Aug 2007 10:33:18 +0200
parents 7df0dd720c89
children 558f606b08ae
comparison
equal deleted inserted replaced
281:090b52736db2 282:c42ec1d1cded
5925 /* Before we put a hold on frame size changes, attempt to process 5925 /* Before we put a hold on frame size changes, attempt to process
5926 any which are already pending. */ 5926 any which are already pending. */
5927 if (f->size_change_pending) 5927 if (f->size_change_pending)
5928 change_frame_size (f, f->new_height, f->new_width, 0); 5928 change_frame_size (f, f->new_height, f->new_width, 0);
5929 5929
5930 /* If frame size might need to be changed, due to changed size
5931 of toolbars, scroolabrs etc, change it now */
5932 if (f->size_slipped)
5933 {
5934 adjust_frame_size (f);
5935 assert (!f->size_slipped);
5936 }
5937
5930 /* The menubar, toolbar, and icon updates must be done before 5938 /* The menubar, toolbar, and icon updates must be done before
5931 hold_frame_size_changes is called and we are officially 5939 hold_frame_size_changes is called and we are officially
5932 'in_display'. They may eval lisp code which may call Fsignal. 5940 'in_display'. They may eval lisp code which may call Fsignal.
5933 If in_display is set Fsignal will abort. */ 5941 If in_display is set Fsignal will abort. */
5934 5942
6059 if (FRAME_REPAINT_P (f)) 6067 if (FRAME_REPAINT_P (f))
6060 { 6068 {
6061 if (f->buffers_changed || f->clip_changed || f->extents_changed || 6069 if (f->buffers_changed || f->clip_changed || f->extents_changed ||
6062 f->faces_changed || f->frame_changed || f->menubar_changed || 6070 f->faces_changed || f->frame_changed || f->menubar_changed ||
6063 f->modeline_changed || f->point_changed || f->size_changed || 6071 f->modeline_changed || f->point_changed || f->size_changed ||
6064 f->toolbar_changed || f->windows_changed || 6072 f->toolbar_changed || f->windows_changed || f->size_slipped ||
6065 f->windows_structure_changed || 6073 f->windows_structure_changed || f->glyphs_changed)
6066 f->glyphs_changed)
6067 { 6074 {
6068 preempted = redisplay_frame (f, 0); 6075 preempted = redisplay_frame (f, 0);
6069 } 6076 }
6070 6077
6071 if (preempted) 6078 if (preempted)
6268 static char * 6275 static char *
6269 window_line_number (struct window *w, int type) 6276 window_line_number (struct window *w, int type)
6270 { 6277 {
6271 struct device *d = XDEVICE (XFRAME (w->frame)->device); 6278 struct device *d = XDEVICE (XFRAME (w->frame)->device);
6272 struct buffer *b = XBUFFER (w->buffer); 6279 struct buffer *b = XBUFFER (w->buffer);
6280 /* Be careful in the order of these tests. The first clasue will
6281 fail if DEVICE_SELECTED_FRAME == Qnil (since w->frame cannot be).
6282 This can occur when the frame title is computed really early */
6273 Bufpos pos = 6283 Bufpos pos =
6274 (((w == XWINDOW (FRAME_SELECTED_WINDOW (device_selected_frame (d)))) && 6284 ((EQ(DEVICE_SELECTED_FRAME(d), w->frame) &&
6285 (w == XWINDOW (FRAME_SELECTED_WINDOW (device_selected_frame(d)))) &&
6275 EQ(DEVICE_CONSOLE(d), Vselected_console) && 6286 EQ(DEVICE_CONSOLE(d), Vselected_console) &&
6276 XDEVICE(CONSOLE_SELECTED_DEVICE(XCONSOLE(DEVICE_CONSOLE(d)))) == d && 6287 XDEVICE(CONSOLE_SELECTED_DEVICE(XCONSOLE(DEVICE_CONSOLE(d)))) == d )
6277 EQ(DEVICE_SELECTED_FRAME(d), w->frame))
6278 ? BUF_PT (b) 6288 ? BUF_PT (b)
6279 : marker_position (w->pointm[type])); 6289 : marker_position (w->pointm[type]));
6280 EMACS_INT line; 6290 EMACS_INT line;
6281 6291
6282 line = buffer_line_number (b, pos, 1); 6292 line = buffer_line_number (b, pos, 1);
6291 specification, return a string (stored into the global array 6301 specification, return a string (stored into the global array
6292 `mode_spec_bufbyte_string') with the information that object 6302 `mode_spec_bufbyte_string') with the information that object
6293 represents. 6303 represents.
6294 6304
6295 This function is largely unchanged from previous versions of the 6305 This function is largely unchanged from previous versions of the
6296 redisplay engine. */ 6306 redisplay engine.
6307
6308 Warning! This code is also used for frame titles and can be called
6309 very early in the device/frame update process! JV
6310 */
6297 6311
6298 static void 6312 static void
6299 decode_mode_spec (struct window *w, Emchar spec, int type) 6313 decode_mode_spec (struct window *w, Emchar spec, int type)
6300 { 6314 {
6301 Lisp_Object obj = Qnil; 6315 Lisp_Object obj = Qnil;
6360 /* print hyphen and frame number, if != 1 */ 6374 /* print hyphen and frame number, if != 1 */
6361 case 'N': 6375 case 'N':
6362 #ifdef HAVE_TTY 6376 #ifdef HAVE_TTY
6363 { 6377 {
6364 struct frame *f = XFRAME (w->frame); 6378 struct frame *f = XFRAME (w->frame);
6365 if (FRAME_TTY_P (f) && f->order_count > 1) 6379 if (FRAME_TTY_P (f) && f->order_count > 1 && f->order_count <= 99999999)
6366 { 6380 {
6381 /* Naughty, naughty */
6367 char * writable_str = alloca_array (char, 10); 6382 char * writable_str = alloca_array (char, 10);
6368 sprintf (writable_str, "-%d", f->order_count); 6383 sprintf (writable_str, "-%d", f->order_count);
6369 str = writable_str; 6384 str = writable_str;
6370 } 6385 }
6371 } 6386 }