comparison src/xdisp.c @ 485:8c615e453683

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Mon, 13 Jan 1992 21:48:08 +0000
parents 1c6c6382f1d7
children 5af35411366a
comparison
equal deleted inserted replaced
484:3165b2697c78 485:8c615e453683
219 #ifdef MULTI_SCREEN 219 #ifdef MULTI_SCREEN
220 choose_minibuf_screen (); 220 choose_minibuf_screen ();
221 Fmake_screen_visible (WINDOW_SCREEN (XWINDOW (minibuf_window))); 221 Fmake_screen_visible (WINDOW_SCREEN (XWINDOW (minibuf_window)));
222 #endif 222 #endif
223 223
224 {
224 #ifdef NO_ARG_ARRAY 225 #ifdef NO_ARG_ARRAY
225 int a[3]; 226 int a[3];
226 a[0] = a1; 227 a[0] = a1;
227 a[1] = a2; 228 a[1] = a2;
228 a[2] = a3; 229 a[2] = a3;
229 230
230 doprnt (SCREEN_MESSAGE_BUF (selected_screen), 231 doprnt (SCREEN_MESSAGE_BUF (selected_screen),
231 SCREEN_WIDTH (selected_screen), m, 0, 3, a); 232 SCREEN_WIDTH (selected_screen), m, 0, 3, a);
232 #else 233 #else
233 doprnt (SCREEN_MESSAGE_BUF (selected_screen), 234 doprnt (SCREEN_MESSAGE_BUF (selected_screen),
234 SCREEN_WIDTH (selected_screen), m, 0, 3, &a1); 235 SCREEN_WIDTH (selected_screen), m, 0, 3, &a1);
235 #endif /* NO_ARG_ARRAY */ 236 #endif /* NO_ARG_ARRAY */
237 }
236 238
237 echo_area_glyphs = SCREEN_MESSAGE_BUF (selected_screen); 239 echo_area_glyphs = SCREEN_MESSAGE_BUF (selected_screen);
238 240
239 /* Print should start at the beginning of the message 241 /* Print should start at the beginning of the message
240 buffer next time. */ 242 buffer next time. */
389 || Voverlay_arrow_string != last_arrow_string) 391 || Voverlay_arrow_string != last_arrow_string)
390 all_windows = 1, clip_changed = 1; 392 all_windows = 1, clip_changed = 1;
391 393
392 tlbufpos = this_line_bufpos; 394 tlbufpos = this_line_bufpos;
393 tlendpos = this_line_endpos; 395 tlendpos = this_line_endpos;
394 if (!all_windows && tlbufpos > 0 && NULL (w->update_mode_line) 396 if (!all_windows && tlbufpos > 0 && NILP (w->update_mode_line)
395 && SCREEN_VISIBLE_P (XSCREEN (w->screen)) 397 && SCREEN_VISIBLE_P (XSCREEN (w->screen))
396 /* Make sure recorded data applies to current buffer, etc */ 398 /* Make sure recorded data applies to current buffer, etc */
397 && this_line_buffer == current_buffer 399 && this_line_buffer == current_buffer
398 && current_buffer == XBUFFER (w->buffer) 400 && current_buffer == XBUFFER (w->buffer)
399 && NULL (w->force_start) 401 && NILP (w->force_start)
400 /* Point must be on the line that we have info recorded about */ 402 /* Point must be on the line that we have info recorded about */
401 && point >= tlbufpos 403 && point >= tlbufpos
402 && point <= Z - tlendpos 404 && point <= Z - tlendpos
403 /* All text outside that line, including its final newline, 405 /* All text outside that line, including its final newline,
404 must be unchanged */ 406 must be unchanged */
555 /* If screen does not match, prevent doing single-line-update next time. 557 /* If screen does not match, prevent doing single-line-update next time.
556 Also, don't forget to check every line to update the arrow. */ 558 Also, don't forget to check every line to update the arrow. */
557 if (pause) 559 if (pause)
558 { 560 {
559 this_line_bufpos = 0; 561 this_line_bufpos = 0;
560 if (!NULL (last_arrow_position)) 562 if (!NILP (last_arrow_position))
561 { 563 {
562 last_arrow_position = Qt; 564 last_arrow_position = Qt;
563 last_arrow_string = Qt; 565 last_arrow_string = Qt;
564 } 566 }
565 /* If we pause after scrolling, some lines in current_screen 567 /* If we pause after scrolling, some lines in current_screen
641 Lisp_Object window; 643 Lisp_Object window;
642 int flag; 644 int flag;
643 { 645 {
644 register struct window *w; 646 register struct window *w;
645 647
646 for (;!NULL (window); window = w->next) 648 for (;!NILP (window); window = w->next)
647 { 649 {
648 w = XWINDOW (window); 650 w = XWINDOW (window);
649 651
650 if (!NULL (w->buffer)) 652 if (!NILP (w->buffer))
651 XFASTINT (w->last_modified) 653 XFASTINT (w->last_modified)
652 = !flag ? 0 654 = !flag ? 0
653 : XBUFFER (w->buffer) == current_buffer 655 : XBUFFER (w->buffer) == current_buffer
654 ? MODIFF : BUF_MODIFF (XBUFFER (w->buffer)); 656 ? MODIFF : BUF_MODIFF (XBUFFER (w->buffer));
655 w->window_end_valid = Qt; 657 w->window_end_valid = Qt;
656 w->update_mode_line = Qnil; 658 w->update_mode_line = Qnil;
657 659
658 if (!NULL (w->vchild)) 660 if (!NILP (w->vchild))
659 mark_window_display_accurate (w->vchild, flag); 661 mark_window_display_accurate (w->vchild, flag);
660 if (!NULL (w->hchild)) 662 if (!NILP (w->hchild))
661 mark_window_display_accurate (w->hchild, flag); 663 mark_window_display_accurate (w->hchild, flag);
662 } 664 }
663 665
664 if (flag) 666 if (flag)
665 { 667 {
678 680
679 static void 681 static void
680 redisplay_windows (window) 682 redisplay_windows (window)
681 Lisp_Object window; 683 Lisp_Object window;
682 { 684 {
683 for (; !NULL (window); window = XWINDOW (window)->next) 685 for (; !NILP (window); window = XWINDOW (window)->next)
684 redisplay_window (window, 0); 686 redisplay_window (window, 0);
685 } 687 }
686 688
687 static void 689 static void
688 redisplay_window (window, just_this_one) 690 redisplay_window (window, just_this_one)
706 708
707 if (SCREEN_HEIGHT (s) == 0) abort (); /* Some bug zeros some core */ 709 if (SCREEN_HEIGHT (s) == 0) abort (); /* Some bug zeros some core */
708 710
709 /* If this is a combination window, do its children; that's all. */ 711 /* If this is a combination window, do its children; that's all. */
710 712
711 if (!NULL (w->vchild)) 713 if (!NILP (w->vchild))
712 { 714 {
713 redisplay_windows (w->vchild); 715 redisplay_windows (w->vchild);
714 return; 716 return;
715 } 717 }
716 if (!NULL (w->hchild)) 718 if (!NILP (w->hchild))
717 { 719 {
718 redisplay_windows (w->hchild); 720 redisplay_windows (w->hchild);
719 return; 721 return;
720 } 722 }
721 if (NULL (w->buffer)) 723 if (NILP (w->buffer))
722 abort (); 724 abort ();
723 725
724 height = window_internal_height (w); 726 height = window_internal_height (w);
725 727
726 if (MINI_WINDOW_P (w)) 728 if (MINI_WINDOW_P (w))
768 if (!EQ (window, selected_window)) 770 if (!EQ (window, selected_window))
769 { 771 {
770 SET_PT (marker_position (w->pointm)); 772 SET_PT (marker_position (w->pointm));
771 if (point < BEGV) 773 if (point < BEGV)
772 { 774 {
773 point = BEGV; 775 SET_PT (BEGV);
774 Fset_marker (w->pointm, make_number (point), Qnil); 776 Fset_marker (w->pointm, make_number (point), Qnil);
775 } 777 }
776 else if (point > (ZV - 1)) 778 else if (point > (ZV - 1))
777 { 779 {
778 point = ZV; 780 SET_PT (ZV);
779 Fset_marker (w->pointm, make_number (point), Qnil); 781 Fset_marker (w->pointm, make_number (point), Qnil);
780 } 782 }
781 } 783 }
782 784
783 /* If window-start is screwed up, choose a new one. */ 785 /* If window-start is screwed up, choose a new one. */
786 788
787 startp = marker_position (w->start); 789 startp = marker_position (w->start);
788 790
789 /* Handle case where place to start displaying has been specified, 791 /* Handle case where place to start displaying has been specified,
790 unless the specified location is outside the visible range. */ 792 unless the specified location is outside the visible range. */
791 if (!NULL (w->force_start)) 793 if (!NILP (w->force_start))
792 { 794 {
793 w->update_mode_line = Qt; 795 w->update_mode_line = Qt;
794 w->force_start = Qnil; 796 w->force_start = Qnil;
795 XFASTINT (w->last_modified) = 0; 797 XFASTINT (w->last_modified) = 0;
796 if (startp < BEGV) startp = BEGV; 798 if (startp < BEGV) startp = BEGV;
860 /* Don't bother trying redisplay with same start; 862 /* Don't bother trying redisplay with same start;
861 we already know it will lose */ 863 we already know it will lose */
862 } 864 }
863 /* If current starting point was originally the beginning of a line 865 /* If current starting point was originally the beginning of a line
864 but no longer is, find a new starting point. */ 866 but no longer is, find a new starting point. */
865 else if (!NULL (w->start_at_line_beg) 867 else if (!NILP (w->start_at_line_beg)
866 && !(startp == BEGV 868 && !(startp == BEGV
867 || FETCH_CHAR (startp - 1) == '\n')) 869 || FETCH_CHAR (startp - 1) == '\n'))
868 { 870 {
869 goto recenter; 871 goto recenter;
870 } 872 }
941 (startp == BEGV || FETCH_CHAR (startp - 1) == '\n') ? Qt : Qnil; 943 (startp == BEGV || FETCH_CHAR (startp - 1) == '\n') ? Qt : Qnil;
942 944
943 done: 945 done:
944 /* If window not full width, must redo its mode line 946 /* If window not full width, must redo its mode line
945 if the window to its side is being redone */ 947 if the window to its side is being redone */
946 if ((!NULL (w->update_mode_line) 948 if ((!NILP (w->update_mode_line)
947 || (!just_this_one && width < SCREEN_WIDTH (s) - 1)) 949 || (!just_this_one && width < SCREEN_WIDTH (s) - 1))
948 && height != XFASTINT (w->height)) 950 && height != XFASTINT (w->height))
949 display_mode_line (w); 951 display_mode_line (w);
950 952
951 SET_PT (opoint); 953 SET_PT (opoint);
1430 GLYPH *endp; 1432 GLYPH *endp;
1431 register GLYPH *startp; 1433 register GLYPH *startp;
1432 register GLYPH *p1prev; 1434 register GLYPH *p1prev;
1433 SCREEN_PTR s = XSCREEN (w->screen); 1435 SCREEN_PTR s = XSCREEN (w->screen);
1434 int tab_width = XINT (current_buffer->tab_width); 1436 int tab_width = XINT (current_buffer->tab_width);
1435 int ctl_arrow = !NULL (current_buffer->ctl_arrow); 1437 int ctl_arrow = !NILP (current_buffer->ctl_arrow);
1436 int width = XFASTINT (w->width) - 1 1438 int width = XFASTINT (w->width) - 1
1437 - (XFASTINT (w->width) + XFASTINT (w->left) != SCREEN_WIDTH (s)); 1439 - (XFASTINT (w->width) + XFASTINT (w->left) != SCREEN_WIDTH (s));
1438 struct position val; 1440 struct position val;
1439 int lastpos; 1441 int lastpos;
1440 int invis; 1442 int invis;
1441 int hscroll = XINT (w->hscroll); 1443 int hscroll = XINT (w->hscroll);
1442 int truncate = hscroll 1444 int truncate = hscroll
1443 || (truncate_partial_width_windows 1445 || (truncate_partial_width_windows
1444 && XFASTINT (w->width) < SCREEN_WIDTH (s)) 1446 && XFASTINT (w->width) < SCREEN_WIDTH (s))
1445 || !NULL (current_buffer->truncate_lines); 1447 || !NILP (current_buffer->truncate_lines);
1446 int selective 1448 int selective
1447 = XTYPE (current_buffer->selective_display) == Lisp_Int 1449 = XTYPE (current_buffer->selective_display) == Lisp_Int
1448 ? XINT (current_buffer->selective_display) 1450 ? XINT (current_buffer->selective_display)
1449 : !NULL (current_buffer->selective_display) ? -1 : 0; 1451 : !NILP (current_buffer->selective_display) ? -1 : 0;
1450 #ifndef old 1452 #ifndef old
1451 int selective_e = selective && !NULL (current_buffer->selective_display_ellipses); 1453 int selective_e = selective && !NILP (current_buffer->selective_display_ellipses);
1452 #endif 1454 #endif
1453 register struct screen_glyphs *desired_glyphs = SCREEN_DESIRED_GLYPHS (s); 1455 register struct screen_glyphs *desired_glyphs = SCREEN_DESIRED_GLYPHS (s);
1454 register struct Lisp_Vector *dp = window_display_table (w); 1456 register struct Lisp_Vector *dp = window_display_table (w);
1455 int selective_rlen 1457 int selective_rlen
1456 = (selective && dp && XTYPE (DISP_INVIS_ROPE (dp)) == Lisp_String 1458 = (selective && dp && XTYPE (DISP_INVIS_ROPE (dp)) == Lisp_String
1766 possible that this may mess adversely with some window managers. jla */ 1768 possible that this may mess adversely with some window managers. jla */
1767 1769
1768 if (SCREEN_IS_X (s) 1770 if (SCREEN_IS_X (s)
1769 && ! SCREEN_MINIBUF_ONLY_P (s) 1771 && ! SCREEN_MINIBUF_ONLY_P (s)
1770 && w == XWINDOW (s->selected_window) 1772 && w == XWINDOW (s->selected_window)
1771 && (NULL (Fstring_equal (XBUFFER (w->buffer)->name, s->name)))) 1773 && (NILP (Fstring_equal (XBUFFER (w->buffer)->name, s->name))))
1772 x_set_name (s, XBUFFER (w->buffer)->name, Qnil); 1774 x_set_name (s, XBUFFER (w->buffer)->name, Qnil);
1773 #endif 1775 #endif
1774 } 1776 }
1775 1777
1776 /* Contribute ELT to the mode line for window W. 1778 /* Contribute ELT to the mode line for window W.
1873 Special case: if value of symbol is a string, output the string 1875 Special case: if value of symbol is a string, output the string
1874 literally. */ 1876 literally. */
1875 { 1877 {
1876 register Lisp_Object tem; 1878 register Lisp_Object tem;
1877 tem = Fboundp (elt); 1879 tem = Fboundp (elt);
1878 if (!NULL (tem)) 1880 if (!NILP (tem))
1879 { 1881 {
1880 tem = Fsymbol_value (elt); 1882 tem = Fsymbol_value (elt);
1881 /* If value is a string, output that string literally: 1883 /* If value is a string, output that string literally:
1882 don't check for % within it. */ 1884 don't check for % within it. */
1883 if (XTYPE (tem) == Lisp_String) 1885 if (XTYPE (tem) == Lisp_String)
1909 elt = XCONS (elt)->cdr; 1911 elt = XCONS (elt)->cdr;
1910 if (XTYPE (elt) != Lisp_Cons) 1912 if (XTYPE (elt) != Lisp_Cons)
1911 goto invalid; 1913 goto invalid;
1912 /* elt is now the cdr, and we know it is a cons cell. 1914 /* elt is now the cdr, and we know it is a cons cell.
1913 Use its car if CAR has a non-nil value. */ 1915 Use its car if CAR has a non-nil value. */
1914 if (!NULL (tem)) 1916 if (!NILP (tem))
1915 { 1917 {
1916 tem = Fsymbol_value (car); 1918 tem = Fsymbol_value (car);
1917 if (!NULL (tem)) 1919 if (!NILP (tem))
1918 { elt = XCONS (elt)->car; goto tail_recurse; } 1920 { elt = XCONS (elt)->car; goto tail_recurse; }
1919 } 1921 }
1920 /* Symbol's value is nil (or symbol is unbound) 1922 /* Symbol's value is nil (or symbol is unbound)
1921 Get the cddr of the original list 1923 Get the cddr of the original list
1922 and if possible find the caddr and use that. */ 1924 and if possible find the caddr and use that. */
1923 elt = XCONS (elt)->cdr; 1925 elt = XCONS (elt)->cdr;
1924 if (NULL (elt)) 1926 if (NILP (elt))
1925 break; 1927 break;
1926 else if (XTYPE (elt) != Lisp_Cons) 1928 else if (XTYPE (elt) != Lisp_Cons)
1927 goto invalid; 1929 goto invalid;
1928 elt = XCONS (elt)->car; 1930 elt = XCONS (elt)->car;
1929 goto tail_recurse; 1931 goto tail_recurse;
2013 break; 2015 break;
2014 2016
2015 case 'f': 2017 case 'f':
2016 obj = current_buffer->filename; 2018 obj = current_buffer->filename;
2017 #if 0 2019 #if 0
2018 if (NULL (obj)) 2020 if (NILP (obj))
2019 return "[none]"; 2021 return "[none]";
2020 else if (XTYPE (obj) == Lisp_String && XSTRING (obj)->size > maxwidth) 2022 else if (XTYPE (obj) == Lisp_String && XSTRING (obj)->size > maxwidth)
2021 { 2023 {
2022 bcopy ("...", decode_mode_spec_buf, 3); 2024 bcopy ("...", decode_mode_spec_buf, 3);
2023 bcopy (XSTRING (obj)->data + XSTRING (obj)->size - maxwidth + 3, 2025 bcopy (XSTRING (obj)->data + XSTRING (obj)->size - maxwidth + 3,
2035 if (BEGV > BEG || ZV < Z) 2037 if (BEGV > BEG || ZV < Z)
2036 return " Narrow"; 2038 return " Narrow";
2037 break; 2039 break;
2038 2040
2039 case '*': 2041 case '*':
2040 if (!NULL (current_buffer->read_only)) 2042 if (!NILP (current_buffer->read_only))
2041 return "%"; 2043 return "%";
2042 if (MODIFF > current_buffer->save_modified) 2044 if (MODIFF > current_buffer->save_modified)
2043 return "*"; 2045 return "*";
2044 return "-"; 2046 return "-";
2045 2047
2046 case 's': 2048 case 's':
2047 /* status of process */ 2049 /* status of process */
2048 #ifdef subprocesses 2050 #ifdef subprocesses
2049 obj = Fget_buffer_process (Fcurrent_buffer ()); 2051 obj = Fget_buffer_process (Fcurrent_buffer ());
2050 if (NULL (obj)) 2052 if (NILP (obj))
2051 return "no process"; 2053 return "no process";
2052 obj = Fsymbol_name (Fprocess_status (obj)); 2054 obj = Fsymbol_name (Fprocess_status (obj));
2053 break; 2055 break;
2054 #else 2056 #else
2055 return "no processes"; 2057 return "no processes";