Mercurial > emacs
comparison src/xdisp.c @ 368:d04df545062f
*** empty log message ***
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Wed, 31 Jul 1991 17:51:28 +0000 |
parents | c1f8ba0ea512 |
children | 54ac13a6f74e |
comparison
equal
deleted
inserted
replaced
367:6c230193acf9 | 368:d04df545062f |
---|---|
209 noninteractive_need_newline = 0; | 209 noninteractive_need_newline = 0; |
210 fprintf (stderr, m, a1, a2, a3); | 210 fprintf (stderr, m, a1, a2, a3); |
211 fprintf (stderr, "\n"); | 211 fprintf (stderr, "\n"); |
212 fflush (stderr); | 212 fflush (stderr); |
213 } | 213 } |
214 else if (INTERACTIVE) | 214 /* A null message buffer means that the screen hasn't really been |
215 initialized yet. Error messages get trapped by the condition-case | |
216 in command-line, so this must be just an informative message; toss it. */ | |
217 else if (INTERACTIVE && SCREEN_MESSAGE_BUF (selected_screen)) | |
215 { | 218 { |
216 #ifdef NO_ARG_ARRAY | 219 #ifdef NO_ARG_ARRAY |
217 int a[3]; | 220 int a[3]; |
218 a[0] = a1; | 221 a[0] = a1; |
219 a[1] = a2; | 222 a[1] = a2; |
222 doprnt (SCREEN_MESSAGE_BUF (selected_screen), | 225 doprnt (SCREEN_MESSAGE_BUF (selected_screen), |
223 SCREEN_WIDTH (selected_screen), m, 0, 3, a); | 226 SCREEN_WIDTH (selected_screen), m, 0, 3, a); |
224 #else | 227 #else |
225 doprnt (SCREEN_MESSAGE_BUF (selected_screen), | 228 doprnt (SCREEN_MESSAGE_BUF (selected_screen), |
226 SCREEN_WIDTH (selected_screen), m, 0, 3, &a1); | 229 SCREEN_WIDTH (selected_screen), m, 0, 3, &a1); |
227 #endif /* NO_ARG_ARRAY */ | 230 #endif /* NO_ARG_ARRAY */ |
228 | 231 |
229 echo_area_glyphs = SCREEN_MESSAGE_BUF (selected_screen); | 232 echo_area_glyphs = SCREEN_MESSAGE_BUF (selected_screen); |
230 | 233 |
231 /* Print should start at the beginning of the message | 234 /* Print should start at the beginning of the message |
232 buffer next time. */ | 235 buffer next time. */ |
242 /* Specify m, a string, as a message in the minibuf. */ | 245 /* Specify m, a string, as a message in the minibuf. */ |
243 void | 246 void |
244 message1 (m) | 247 message1 (m) |
245 char *m; | 248 char *m; |
246 { | 249 { |
250 /* A null message buffer means that the screen hasn't really been | |
251 initialized yet; write the error message on the standard error | |
252 as if we were non-interactive. */ | |
247 if (noninteractive) | 253 if (noninteractive) |
248 { | 254 { |
249 if (noninteractive_need_newline) | 255 if (noninteractive_need_newline) |
250 putc ('\n', stderr); | 256 putc ('\n', stderr); |
251 noninteractive_need_newline = 0; | 257 noninteractive_need_newline = 0; |
252 fprintf (stderr, "%s\n", m); | 258 fprintf (stderr, "%s\n", m); |
253 fflush (stderr); | 259 fflush (stderr); |
254 } | 260 } |
255 else if (INTERACTIVE) | 261 /* A null message buffer means that the screen hasn't really been |
262 initialized yet. Error messages get trapped by the condition-case | |
263 in command-line, so this must be just an informative message; toss it. */ | |
264 else if (INTERACTIVE && SCREEN_MESSAGE_BUF (selected_screen)) | |
256 { | 265 { |
257 echo_area_glyphs = m; | 266 echo_area_glyphs = m; |
258 do_pending_window_change (); | 267 do_pending_window_change (); |
259 echo_area_display (); | 268 echo_area_display (); |
260 update_screen (XSCREEN (XWINDOW (minibuf_window)->screen), 1, 1); | 269 update_screen (XSCREEN (XWINDOW (minibuf_window)->screen), 1, 1); |
339 { | 348 { |
340 Fredraw_display (); | 349 Fredraw_display (); |
341 screen_garbaged = 0; | 350 screen_garbaged = 0; |
342 } | 351 } |
343 | 352 |
353 /* Normally the message* functions will have already displayed and | |
354 updated the echo area, but the screen may have been trashed, or | |
355 the update may have been preempted, so display the echo area | |
356 again here. */ | |
344 if (echo_area_glyphs || previous_echo_glyphs) | 357 if (echo_area_glyphs || previous_echo_glyphs) |
345 { | 358 { |
346 echo_area_display (); | 359 echo_area_display (); |
347 must_finish = 1; | 360 must_finish = 1; |
348 } | 361 } |
360 } | 373 } |
361 | 374 |
362 SCREEN_SCROLL_BOTTOM_VPOS (XSCREEN (w->screen)) = -1; | 375 SCREEN_SCROLL_BOTTOM_VPOS (XSCREEN (w->screen)) = -1; |
363 | 376 |
364 all_windows = update_mode_lines || buffer_shared > 1; | 377 all_windows = update_mode_lines || buffer_shared > 1; |
365 #ifdef MULTI_SCREEN | |
366 all_windows |= (XTYPE (Vglobal_minibuffer_screen) == Lisp_Screen | |
367 && selected_screen != XSCREEN (Vglobal_minibuffer_screen)); | |
368 #endif /* MULTI_SCREEN */ | |
369 | 378 |
370 /* If specs for an arrow have changed, do thorough redisplay | 379 /* If specs for an arrow have changed, do thorough redisplay |
371 to ensure we remove any arrow that should no longer exist. */ | 380 to ensure we remove any arrow that should no longer exist. */ |
372 if (Voverlay_arrow_position != last_arrow_position | 381 if (Voverlay_arrow_position != last_arrow_position |
373 || Voverlay_arrow_string != last_arrow_string) | 382 || Voverlay_arrow_string != last_arrow_string) |
531 } | 540 } |
532 } | 541 } |
533 } | 542 } |
534 else | 543 else |
535 #endif /* MULTI_SCREEN */ | 544 #endif /* MULTI_SCREEN */ |
536 if (SCREEN_VISIBLE_P (selected_screen)) | 545 { |
537 pause = update_screen (selected_screen, 0, 0); | 546 if (SCREEN_VISIBLE_P (selected_screen)) |
547 pause = update_screen (selected_screen, 0, 0); | |
548 #ifdef MULTI_SCREEN | |
549 | |
550 /* We called echo_area_display at the top of this function. If | |
551 the echo area is on another screen, that may have put text on | |
552 a screen other than the selected one, so the above call to | |
553 update_screen would not have caught it. Catch it here. */ | |
554 if (echo_area_glyphs || previous_echo_glyphs) | |
555 { | |
556 SCREEN_PTR mini_screen = | |
557 XSCREEN (WINDOW_SCREEN (XWINDOW (minibuf_window))); | |
558 | |
559 if (mini_screen != selected_screen) | |
560 pause |= update_screen (mini_screen, 0, 0); | |
561 } | |
562 #endif | |
563 } | |
538 | 564 |
539 /* If screen does not match, prevent doing single-line-update next time. | 565 /* If screen does not match, prevent doing single-line-update next time. |
540 Also, don't forget to check every line to update the arrow. */ | 566 Also, don't forget to check every line to update the arrow. */ |
541 if (pause) | 567 if (pause) |
542 { | 568 { |
1011 /* Find position before which nothing is changed. */ | 1037 /* Find position before which nothing is changed. */ |
1012 bp = *compute_motion (start, 0, lmargin, | 1038 bp = *compute_motion (start, 0, lmargin, |
1013 beg_unchanged + 1, 10000, 10000, width, hscroll, | 1039 beg_unchanged + 1, 10000, 10000, width, hscroll, |
1014 pos_tab_offset (w, start)); | 1040 pos_tab_offset (w, start)); |
1015 if (bp.vpos >= height) | 1041 if (bp.vpos >= height) |
1016 return point < bp.bufpos && !bp.contin; | 1042 { |
1043 if (point < bp.bufpos && !bp.contin) | |
1044 { | |
1045 /* All changes are below the screen, and point is on the screen. | |
1046 We don't need to change the screen at all. | |
1047 But we need to update window_end_pos to account for | |
1048 any change in buffer size. */ | |
1049 XFASTINT (w->window_end_vpos) = height; | |
1050 XFASTINT (w->window_end_pos) = Z - bp.bufpos; | |
1051 return 1; | |
1052 } | |
1053 return 0; | |
1054 } | |
1017 | 1055 |
1018 vpos = bp.vpos; | 1056 vpos = bp.vpos; |
1019 | 1057 |
1020 /* Find beginning of that screen line. Must display from there. */ | 1058 /* Find beginning of that screen line. Must display from there. */ |
1021 bp = *vmotion (bp.bufpos, 0, width, hscroll, window); | 1059 bp = *vmotion (bp.bufpos, 0, width, hscroll, window); |
1494 p1++; | 1532 p1++; |
1495 } | 1533 } |
1496 while ((p1 - startp + taboffset + hscroll - (hscroll > 0)) | 1534 while ((p1 - startp + taboffset + hscroll - (hscroll > 0)) |
1497 % tab_width); | 1535 % tab_width); |
1498 } | 1536 } |
1499 else if (c == Ctl('M') && selective == -1) | 1537 else if (c == Ctl ('M') && selective == -1) |
1500 { | 1538 { |
1501 pos = find_next_newline (pos, 1); | 1539 pos = find_next_newline (pos, 1); |
1502 if (FETCH_CHAR (pos - 1) == '\n') | 1540 if (FETCH_CHAR (pos - 1) == '\n') |
1503 pos--; | 1541 pos--; |
1504 if (selective_rlen > 0) | 1542 if (selective_rlen > 0) |
1519 { | 1557 { |
1520 if (p1 >= startp) | 1558 if (p1 >= startp) |
1521 *p1 = (dp && XTYPE (DISP_CTRL_GLYPH (dp)) == Lisp_Int | 1559 *p1 = (dp && XTYPE (DISP_CTRL_GLYPH (dp)) == Lisp_Int |
1522 ? XINT (DISP_CTRL_GLYPH (dp)) : '^'); | 1560 ? XINT (DISP_CTRL_GLYPH (dp)) : '^'); |
1523 p1++; | 1561 p1++; |
1524 if (p1 >= startp) | 1562 if (p1 >= startp && p1 < endp) |
1525 *p1 = c ^ 0100; | 1563 *p1 = c ^ 0100; |
1526 p1++; | 1564 p1++; |
1527 } | 1565 } |
1528 else | 1566 else |
1529 { | 1567 { |
1530 if (p1 >= startp) | 1568 if (p1 >= startp) |
1531 *p1 = (dp && XTYPE (DISP_ESCAPE_GLYPH (dp)) == Lisp_Int | 1569 *p1 = (dp && XTYPE (DISP_ESCAPE_GLYPH (dp)) == Lisp_Int |
1532 ? XINT (DISP_ESCAPE_GLYPH (dp)) : '\\'); | 1570 ? XINT (DISP_ESCAPE_GLYPH (dp)) : '\\'); |
1533 p1++; | 1571 p1++; |
1534 if (p1 >= startp) | 1572 if (p1 >= startp && p1 < endp) |
1535 *p1 = (c >> 6) + '0'; | 1573 *p1 = (c >> 6) + '0'; |
1536 p1++; | 1574 p1++; |
1537 if (p1 >= startp) | 1575 if (p1 >= startp && p1 < endp) |
1538 *p1 = (7 & (c >> 3)) + '0'; | 1576 *p1 = (7 & (c >> 3)) + '0'; |
1539 p1++; | 1577 p1++; |
1540 if (p1 >= startp) | 1578 if (p1 >= startp && p1 < endp) |
1541 *p1 = (7 & c) + '0'; | 1579 *p1 = (7 & c) + '0'; |
1542 p1++; | 1580 p1++; |
1543 } | 1581 } |
1544 pos++; | 1582 pos++; |
1545 } | 1583 } |
2168 { | 2206 { |
2169 if (p1 >= start) | 2207 if (p1 >= start) |
2170 *p1 = (dp && XTYPE (DISP_CTRL_GLYPH (dp)) == Lisp_Int | 2208 *p1 = (dp && XTYPE (DISP_CTRL_GLYPH (dp)) == Lisp_Int |
2171 ? XINT (DISP_CTRL_GLYPH (dp)) : '^'); | 2209 ? XINT (DISP_CTRL_GLYPH (dp)) : '^'); |
2172 p1++; | 2210 p1++; |
2173 if (p1 >= start) | 2211 if (p1 >= start && p1 < end) |
2174 *p1 = c ^ 0100; | 2212 *p1 = c ^ 0100; |
2175 p1++; | 2213 p1++; |
2176 } | 2214 } |
2177 else | 2215 else |
2178 { | 2216 { |
2179 if (p1 >= start) | 2217 if (p1 >= start) |
2180 *p1 = (dp && XTYPE (DISP_ESCAPE_GLYPH (dp)) == Lisp_Int | 2218 *p1 = (dp && XTYPE (DISP_ESCAPE_GLYPH (dp)) == Lisp_Int |
2181 ? XINT (DISP_ESCAPE_GLYPH (dp)) : '\\'); | 2219 ? XINT (DISP_ESCAPE_GLYPH (dp)) : '\\'); |
2182 p1++; | 2220 p1++; |
2183 if (p1 >= start) | 2221 if (p1 >= start && p1 < end) |
2184 *p1 = (c >> 6) + '0'; | 2222 *p1 = (c >> 6) + '0'; |
2185 p1++; | 2223 p1++; |
2186 if (p1 >= start) | 2224 if (p1 >= start && p1 < end) |
2187 *p1 = (7 & (c >> 3)) + '0'; | 2225 *p1 = (7 & (c >> 3)) + '0'; |
2188 p1++; | 2226 p1++; |
2189 if (p1 >= start) | 2227 if (p1 >= start && p1 < end) |
2190 *p1 = (7 & c) + '0'; | 2228 *p1 = (7 & c) + '0'; |
2191 p1++; | 2229 p1++; |
2192 } | 2230 } |
2193 } | 2231 } |
2194 | 2232 |