Mercurial > emacs
comparison src/xdisp.c @ 8772:c0a21329d9a7
(multiple_frames, Vframe_title_format, Vicon_title_format): New variables.
(store_frame_title): New function.
(x_consider_frame_title): Format title according to template.
(display_mode_element): Handle frame title as well as mode line.
(decode_mode_spec): Use w->buffer, not current_buffer.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Fri, 16 Sep 1994 03:29:33 +0000 |
parents | 020c4d5b685b |
children | 226c214398a6 |
comparison
equal
deleted
inserted
replaced
8771:31b8e48045f3 | 8772:c0a21329d9a7 |
---|---|
83 char *previous_echo_glyphs; | 83 char *previous_echo_glyphs; |
84 | 84 |
85 /* Nonzero means truncate lines in all windows less wide than the frame */ | 85 /* Nonzero means truncate lines in all windows less wide than the frame */ |
86 int truncate_partial_width_windows; | 86 int truncate_partial_width_windows; |
87 | 87 |
88 /* Nonzero means we have more than one non-minibuffer-only frame. | |
89 Not guaranteed to be accurate except while parsing frame-title-format. */ | |
90 int multiple_frames; | |
91 | |
88 Lisp_Object Vglobal_mode_string; | 92 Lisp_Object Vglobal_mode_string; |
89 | 93 |
90 /* Marker for where to display an arrow on top of the buffer text. */ | 94 /* Marker for where to display an arrow on top of the buffer text. */ |
91 Lisp_Object Voverlay_arrow_position; | 95 Lisp_Object Voverlay_arrow_position; |
92 | 96 |
93 /* String to display for the arrow. */ | 97 /* String to display for the arrow. */ |
94 Lisp_Object Voverlay_arrow_string; | 98 Lisp_Object Voverlay_arrow_string; |
99 | |
100 /* Like mode-line-format, but for the titlebar on a visible frame. */ | |
101 Lisp_Object Vframe_title_format; | |
102 | |
103 /* Like mode-line-format, but for the titlebar on an iconified frame. */ | |
104 Lisp_Object Vicon_title_format; | |
95 | 105 |
96 /* Values of those variables at last redisplay. */ | 106 /* Values of those variables at last redisplay. */ |
97 static Lisp_Object last_arrow_position, last_arrow_string; | 107 static Lisp_Object last_arrow_position, last_arrow_string; |
98 | 108 |
99 Lisp_Object Qmenu_bar_update_hook; | 109 Lisp_Object Qmenu_bar_update_hook; |
392 | 402 |
393 previous_echo_glyphs = echo_area_glyphs; | 403 previous_echo_glyphs = echo_area_glyphs; |
394 } | 404 } |
395 | 405 |
396 #ifdef HAVE_X_WINDOWS | 406 #ifdef HAVE_X_WINDOWS |
397 /* I'm trying this out because I saw Unimpress use it, but it's | 407 static char frame_title_buf[512]; |
398 possible that this may mess adversely with some window managers. -jla | 408 static char *frame_title_ptr; |
399 | 409 |
400 Wouldn't it be nice to use something like mode-line-format to | 410 static int |
401 describe frame titles? -JimB */ | 411 store_frame_title (str, mincol, maxcol) |
402 | 412 char *str; |
403 /* Change the title of the frame to the name of the buffer displayed | 413 int mincol, maxcol; |
404 in the currently selected window. Don't do this for minibuffer frames, | 414 { |
405 and don't do it when there's only one non-minibuffer frame. */ | 415 char *limit; |
416 if (maxcol < 0 || maxcol >= sizeof(frame_title_buf)) | |
417 maxcol = sizeof (frame_title_buf); | |
418 limit = &frame_title_buf[maxcol]; | |
419 while (*str != '\0' && frame_title_ptr < limit) | |
420 *frame_title_ptr++ = *str++; | |
421 while (frame_title_ptr < &frame_title_buf[mincol]) | |
422 *frame_title_ptr++ = ' '; | |
423 return frame_title_ptr - frame_title_buf; | |
424 } | |
425 | |
406 static void | 426 static void |
407 x_consider_frame_title (frame) | 427 x_consider_frame_title (frame) |
408 Lisp_Object frame; | 428 Lisp_Object frame; |
409 { | 429 { |
430 Lisp_Object fmt; | |
431 struct buffer *obuf; | |
432 int len; | |
410 FRAME_PTR f = XFRAME (frame); | 433 FRAME_PTR f = XFRAME (frame); |
411 | 434 |
412 if (FRAME_X_P (f) && ! FRAME_MINIBUF_ONLY_P (f)) | 435 if (!FRAME_X_P (f) || FRAME_MINIBUF_ONLY_P (f) || f->explicit_name) |
413 { | 436 return; |
414 Lisp_Object title; | 437 multiple_frames = !EQ (Fnext_frame (frame, Qnil), frame); |
415 | 438 obuf = current_buffer; |
416 title = Qnil; | 439 Fset_buffer (XWINDOW (f->selected_window)->buffer); |
417 if (! EQ (Fnext_frame (frame, Qnil), frame)) | 440 fmt = (FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format); |
418 title = XBUFFER (XWINDOW (f->selected_window)->buffer)->name; | 441 frame_title_ptr = frame_title_buf; |
419 | 442 len = display_mode_element (XWINDOW (f->selected_window), 0, 0, 0, |
420 x_implicitly_set_name (f, title, Qnil); | 443 0, sizeof (frame_title_buf), fmt); |
421 } | 444 frame_title_ptr = 0; |
445 set_buffer_internal (obuf); | |
446 /* Set the name only if it's changed. This avoids consing | |
447 in the common case where it hasn't. (If it turns out that we've | |
448 already wasted too much time by walking through the list with | |
449 display_mode_element, then we might need to optimize at a higher | |
450 level than this.) */ | |
451 if (! STRINGP (f->name) || XSTRING (f->name)->size != len | |
452 || bcmp (frame_title_buf, XSTRING (f->name)->data, len) != 0) | |
453 x_implicitly_set_name (f, make_string (frame_title_buf, len), Qnil); | |
422 } | 454 } |
423 #endif | 455 #endif |
424 | 456 |
425 /* Prepare for redisplay by updating menu-bar item lists when appropriate. | 457 /* Prepare for redisplay by updating menu-bar item lists when appropriate. |
426 This can't be done in `redisplay' itself because it can call eval. */ | 458 This can't be done in `redisplay' itself because it can call eval. */ |
2679 while ((c = *this++) != '\0' && c != '%') | 2711 while ((c = *this++) != '\0' && c != '%') |
2680 ; | 2712 ; |
2681 if (this - 1 != last) | 2713 if (this - 1 != last) |
2682 { | 2714 { |
2683 register int lim = --this - last + hpos; | 2715 register int lim = --this - last + hpos; |
2684 hpos = display_string (w, vpos, last, -1, hpos, 0, 1, | 2716 if (frame_title_ptr) |
2685 hpos, min (lim, maxendcol)); | 2717 hpos = store_frame_title (last, hpos, min (lim, maxendcol)); |
2718 else | |
2719 hpos = display_string (w, vpos, last, -1, hpos, 0, 1, | |
2720 hpos, min (lim, maxendcol)); | |
2686 } | 2721 } |
2687 else /* c == '%' */ | 2722 else /* c == '%' */ |
2688 { | 2723 { |
2689 register int spec_width = 0; | 2724 register int spec_width = 0; |
2690 | 2725 |
2705 if (c == 'M') | 2740 if (c == 'M') |
2706 hpos = display_mode_element (w, vpos, hpos, depth, | 2741 hpos = display_mode_element (w, vpos, hpos, depth, |
2707 spec_width, maxendcol, | 2742 spec_width, maxendcol, |
2708 Vglobal_mode_string); | 2743 Vglobal_mode_string); |
2709 else if (c != 0) | 2744 else if (c != 0) |
2710 hpos = display_string (w, vpos, | 2745 { |
2711 decode_mode_spec (w, c, | 2746 char *spec = decode_mode_spec (w, c, maxendcol - hpos); |
2712 maxendcol - hpos), | 2747 if (frame_title_ptr) |
2713 -1, | 2748 hpos = store_frame_title (spec, spec_width, maxendcol); |
2714 hpos, 0, 1, spec_width, maxendcol); | 2749 else |
2750 hpos = display_string (w, vpos, spec, -1, | |
2751 hpos, 0, 1, | |
2752 spec_width, maxendcol); | |
2753 } | |
2715 } | 2754 } |
2716 } | 2755 } |
2717 } | 2756 } |
2718 break; | 2757 break; |
2719 | 2758 |
2729 { | 2768 { |
2730 tem = Fsymbol_value (elt); | 2769 tem = Fsymbol_value (elt); |
2731 /* If value is a string, output that string literally: | 2770 /* If value is a string, output that string literally: |
2732 don't check for % within it. */ | 2771 don't check for % within it. */ |
2733 if (XTYPE (tem) == Lisp_String) | 2772 if (XTYPE (tem) == Lisp_String) |
2734 hpos = display_string (w, vpos, XSTRING (tem)->data, | 2773 { |
2735 XSTRING (tem)->size, | 2774 if (frame_title_ptr) |
2736 hpos, 0, 1, minendcol, maxendcol); | 2775 hpos = store_frame_title (XSTRING (tem)->data, |
2776 minendcol, maxendcol); | |
2777 else | |
2778 hpos = display_string (w, vpos, XSTRING (tem)->data, | |
2779 XSTRING (tem)->size, | |
2780 hpos, 0, 1, minendcol, maxendcol); | |
2781 } | |
2737 /* Give up right away for nil or t. */ | 2782 /* Give up right away for nil or t. */ |
2738 else if (!EQ (tem, elt)) | 2783 else if (!EQ (tem, elt)) |
2739 { elt = tem; goto tail_recurse; } | 2784 { elt = tem; goto tail_recurse; } |
2740 } | 2785 } |
2741 } | 2786 } |
2820 } | 2865 } |
2821 break; | 2866 break; |
2822 | 2867 |
2823 default: | 2868 default: |
2824 invalid: | 2869 invalid: |
2825 return (display_string (w, vpos, "*invalid*", -1, hpos, 0, 1, | 2870 if (frame_title_ptr) |
2826 minendcol, maxendcol)); | 2871 hpos = store_frame_title ("*invalid*", minendcol, maxendcol); |
2827 } | 2872 else |
2828 | 2873 hpos = display_string (w, vpos, "*invalid*", -1, hpos, 0, 1, |
2829 end: | 2874 minendcol, maxendcol); |
2875 return hpos; | |
2876 } | |
2877 | |
2830 if (minendcol > hpos) | 2878 if (minendcol > hpos) |
2831 hpos = display_string (w, vpos, "", 0, hpos, 0, 1, minendcol, maxendcol); | 2879 if (frame_title_ptr) |
2880 hpos = store_frame_title ("", minendcol, maxendcol); | |
2881 else | |
2882 hpos = display_string (w, vpos, "", 0, hpos, 0, 1, minendcol, maxendcol); | |
2832 return hpos; | 2883 return hpos; |
2833 } | 2884 } |
2834 | 2885 |
2835 /* Return a string for the output of a mode line %-spec for window W, | 2886 /* Return a string for the output of a mode line %-spec for window W, |
2836 generated by character C and width MAXWIDTH. */ | 2887 generated by character C and width MAXWIDTH. */ |
2844 register int maxwidth; | 2895 register int maxwidth; |
2845 { | 2896 { |
2846 Lisp_Object obj; | 2897 Lisp_Object obj; |
2847 FRAME_PTR f = XFRAME (WINDOW_FRAME (w)); | 2898 FRAME_PTR f = XFRAME (WINDOW_FRAME (w)); |
2848 char *decode_mode_spec_buf = (char *) FRAME_TEMP_GLYPHS (f)->total_contents; | 2899 char *decode_mode_spec_buf = (char *) FRAME_TEMP_GLYPHS (f)->total_contents; |
2900 struct buffer *b = XBUFFER (w->buffer); | |
2849 | 2901 |
2850 obj = Qnil; | 2902 obj = Qnil; |
2851 if (maxwidth > FRAME_WIDTH (f)) | 2903 if (maxwidth > FRAME_WIDTH (f)) |
2852 maxwidth = FRAME_WIDTH (f); | 2904 maxwidth = FRAME_WIDTH (f); |
2853 | 2905 |
2854 switch (c) | 2906 switch (c) |
2855 { | 2907 { |
2856 case 'b': | 2908 case 'b': |
2857 obj = current_buffer->name; | 2909 obj = b->name; |
2858 #if 0 | 2910 #if 0 |
2859 if (maxwidth >= 3 && XSTRING (obj)->size > maxwidth) | 2911 if (maxwidth >= 3 && XSTRING (obj)->size > maxwidth) |
2860 { | 2912 { |
2861 bcopy (XSTRING (obj)->data, decode_mode_spec_buf, maxwidth - 1); | 2913 bcopy (XSTRING (obj)->data, decode_mode_spec_buf, maxwidth - 1); |
2862 decode_mode_spec_buf[maxwidth - 1] = '\\'; | 2914 decode_mode_spec_buf[maxwidth - 1] = '\\'; |
2865 } | 2917 } |
2866 #endif | 2918 #endif |
2867 break; | 2919 break; |
2868 | 2920 |
2869 case 'f': | 2921 case 'f': |
2870 obj = current_buffer->filename; | 2922 obj = b->filename; |
2871 #if 0 | 2923 #if 0 |
2872 if (NILP (obj)) | 2924 if (NILP (obj)) |
2873 return "[none]"; | 2925 return "[none]"; |
2874 else if (XTYPE (obj) == Lisp_String && XSTRING (obj)->size > maxwidth) | 2926 else if (XTYPE (obj) == Lisp_String && XSTRING (obj)->size > maxwidth) |
2875 { | 2927 { |
2893 don't forget that too fast. */ | 2945 don't forget that too fast. */ |
2894 if (EQ (w->base_line_pos, w->buffer)) | 2946 if (EQ (w->base_line_pos, w->buffer)) |
2895 return "??"; | 2947 return "??"; |
2896 | 2948 |
2897 /* If the buffer is very big, don't waste time. */ | 2949 /* If the buffer is very big, don't waste time. */ |
2898 if (ZV - BEGV > line_number_display_limit) | 2950 if (BUF_ZV (b) - BUF_BEGV (b) > line_number_display_limit) |
2899 { | 2951 { |
2900 w->base_line_pos = Qnil; | 2952 w->base_line_pos = Qnil; |
2901 w->base_line_number = Qnil; | 2953 w->base_line_number = Qnil; |
2902 return "??"; | 2954 return "??"; |
2903 } | 2955 } |
2910 linepos = XFASTINT (w->base_line_pos); | 2962 linepos = XFASTINT (w->base_line_pos); |
2911 } | 2963 } |
2912 else | 2964 else |
2913 { | 2965 { |
2914 line = 1; | 2966 line = 1; |
2915 linepos = BEGV; | 2967 linepos = BUF_BEGV (b); |
2916 } | 2968 } |
2917 | 2969 |
2918 /* Count lines from base line to window start position. */ | 2970 /* Count lines from base line to window start position. */ |
2919 nlines = display_count_lines (linepos, startpos, startpos, &junk); | 2971 nlines = display_count_lines (linepos, startpos, startpos, &junk); |
2920 | 2972 |
2922 | 2974 |
2923 /* Determine a new base line, if the old one is too close | 2975 /* Determine a new base line, if the old one is too close |
2924 or too far away, or if we did not have one. | 2976 or too far away, or if we did not have one. |
2925 "Too close" means it's plausible a scroll-down would | 2977 "Too close" means it's plausible a scroll-down would |
2926 go back past it. */ | 2978 go back past it. */ |
2927 if (startpos == BEGV) | 2979 if (startpos == BUF_BEGV (b)) |
2928 { | 2980 { |
2929 XFASTINT (w->base_line_number) = topline; | 2981 XFASTINT (w->base_line_number) = topline; |
2930 XFASTINT (w->base_line_pos) = BEGV; | 2982 XFASTINT (w->base_line_pos) = BUF_BEGV (b); |
2931 } | 2983 } |
2932 else if (nlines < height + 25 || nlines > height * 3 + 50 | 2984 else if (nlines < height + 25 || nlines > height * 3 + 50 |
2933 || linepos == BEGV) | 2985 || linepos == BUF_BEGV (b)) |
2934 { | 2986 { |
2935 int limit = BEGV; | 2987 int limit = BUF_BEGV (b); |
2936 int position; | 2988 int position; |
2937 int distance = (height * 2 + 30) * 200; | 2989 int distance = (height * 2 + 30) * 200; |
2938 | 2990 |
2939 if (startpos - distance > limit) | 2991 if (startpos - distance > limit) |
2940 limit = startpos - distance; | 2992 limit = startpos - distance; |
2967 return decode_mode_spec_buf; | 3019 return decode_mode_spec_buf; |
2968 } | 3020 } |
2969 break; | 3021 break; |
2970 | 3022 |
2971 case 'm': | 3023 case 'm': |
2972 obj = current_buffer->mode_name; | 3024 obj = b->mode_name; |
2973 break; | 3025 break; |
2974 | 3026 |
2975 case 'n': | 3027 case 'n': |
2976 if (BEGV > BEG || ZV < Z) | 3028 if (BUF_BEGV (b) > BUF_BEG (b) || BUF_ZV (b) < BUF_Z (b)) |
2977 return " Narrow"; | 3029 return " Narrow"; |
2978 break; | 3030 break; |
2979 | 3031 |
2980 case '*': | 3032 case '*': |
2981 if (!NILP (current_buffer->read_only)) | 3033 if (!NILP (b->read_only)) |
2982 return "%"; | 3034 return "%"; |
2983 if (MODIFF > current_buffer->save_modified) | 3035 if (BUF_MODIFF (b) > b->save_modified) |
2984 return "*"; | 3036 return "*"; |
2985 return "-"; | 3037 return "-"; |
2986 | 3038 |
2987 case '+': | 3039 case '+': |
2988 /* This differs from %* only for a modified read-only buffer. */ | 3040 /* This differs from %* only for a modified read-only buffer. */ |
2989 if (MODIFF > current_buffer->save_modified) | 3041 if (BUF_MODIFF (b) > b->save_modified) |
2990 return "*"; | 3042 return "*"; |
2991 if (!NILP (current_buffer->read_only)) | 3043 if (!NILP (b->read_only)) |
2992 return "%"; | 3044 return "%"; |
2993 return "-"; | 3045 return "-"; |
2994 | 3046 |
2995 case '&': | 3047 case '&': |
2996 /* This differs from %* in ignoring read-only-ness. */ | 3048 /* This differs from %* in ignoring read-only-ness. */ |
2997 if (MODIFF > current_buffer->save_modified) | 3049 if (BUF_MODIFF (b) > b->save_modified) |
2998 return "*"; | 3050 return "*"; |
2999 return "-"; | 3051 return "-"; |
3000 | 3052 |
3001 case 's': | 3053 case 's': |
3002 /* status of process */ | 3054 /* status of process */ |
3003 obj = Fget_buffer_process (Fcurrent_buffer ()); | 3055 obj = Fget_buffer_process (w->buffer); |
3004 if (NILP (obj)) | 3056 if (NILP (obj)) |
3005 return "no process"; | 3057 return "no process"; |
3006 #ifdef subprocesses | 3058 #ifdef subprocesses |
3007 obj = Fsymbol_name (Fprocess_status (obj)); | 3059 obj = Fsymbol_name (Fprocess_status (obj)); |
3008 #endif | 3060 #endif |
3009 break; | 3061 break; |
3010 | 3062 |
3011 case 't': /* indicate TEXT or BINARY */ | 3063 case 't': /* indicate TEXT or BINARY */ |
3012 #ifdef MSDOS | 3064 #ifdef MSDOS |
3013 return NILP (current_buffer->buffer_file_type) ? "T" : "B"; | 3065 return NILP (b->buffer_file_type) ? "T" : "B"; |
3014 #else /* not MSDOS */ | 3066 #else /* not MSDOS */ |
3015 return "T"; | 3067 return "T"; |
3016 #endif /* not MSDOS */ | 3068 #endif /* not MSDOS */ |
3017 | 3069 |
3018 case 'p': | 3070 case 'p': |
3019 { | 3071 { |
3020 int pos = marker_position (w->start); | 3072 int pos = marker_position (w->start); |
3021 int total = ZV - BEGV; | 3073 int total = BUF_ZV (b) - BUF_BEGV (b); |
3022 | 3074 |
3023 if (XFASTINT (w->window_end_pos) <= Z - ZV) | 3075 if (XFASTINT (w->window_end_pos) <= BUF_Z (b) - BUF_ZV (b)) |
3024 { | 3076 { |
3025 if (pos <= BEGV) | 3077 if (pos <= BUF_BEGV (b)) |
3026 return "All"; | 3078 return "All"; |
3027 else | 3079 else |
3028 return "Bottom"; | 3080 return "Bottom"; |
3029 } | 3081 } |
3030 else if (pos <= BEGV) | 3082 else if (pos <= BUF_BEGV (b)) |
3031 return "Top"; | 3083 return "Top"; |
3032 else | 3084 else |
3033 { | 3085 { |
3034 total = ((pos - BEGV) * 100 + total - 1) / total; | 3086 total = ((pos - BUF_BEGV (b)) * 100 + total - 1) / total; |
3035 /* We can't normally display a 3-digit number, | 3087 /* We can't normally display a 3-digit number, |
3036 so get us a 2-digit number that is close. */ | 3088 so get us a 2-digit number that is close. */ |
3037 if (total == 100) | 3089 if (total == 100) |
3038 total = 99; | 3090 total = 99; |
3039 sprintf (decode_mode_spec_buf, "%2d%%", total); | 3091 sprintf (decode_mode_spec_buf, "%2d%%", total); |
3043 | 3095 |
3044 /* Display percentage of size above the bottom of the screen. */ | 3096 /* Display percentage of size above the bottom of the screen. */ |
3045 case 'P': | 3097 case 'P': |
3046 { | 3098 { |
3047 int toppos = marker_position (w->start); | 3099 int toppos = marker_position (w->start); |
3048 int botpos = Z - XFASTINT (w->window_end_pos); | 3100 int botpos = BUF_Z (b) - XFASTINT (w->window_end_pos); |
3049 int total = ZV - BEGV; | 3101 int total = BUF_ZV (b) - BUF_BEGV (b); |
3050 | 3102 |
3051 if (botpos >= ZV) | 3103 if (botpos >= BUF_ZV (b)) |
3052 { | 3104 { |
3053 if (toppos <= BEGV) | 3105 if (toppos <= BUF_BEGV (b)) |
3054 return "All"; | 3106 return "All"; |
3055 else | 3107 else |
3056 return "Bottom"; | 3108 return "Bottom"; |
3057 } | 3109 } |
3058 else | 3110 else |
3059 { | 3111 { |
3060 total = ((botpos - BEGV) * 100 + total - 1) / total; | 3112 total = ((botpos - BUF_BEGV (b)) * 100 + total - 1) / total; |
3061 /* We can't normally display a 3-digit number, | 3113 /* We can't normally display a 3-digit number, |
3062 so get us a 2-digit number that is close. */ | 3114 so get us a 2-digit number that is close. */ |
3063 if (total == 100) | 3115 if (total == 100) |
3064 total = 99; | 3116 total = 99; |
3065 if (toppos <= BEGV) | 3117 if (toppos <= BUF_BEGV (b)) |
3066 sprintf (decode_mode_spec_buf, "Top%2d%%", total); | 3118 sprintf (decode_mode_spec_buf, "Top%2d%%", total); |
3067 else | 3119 else |
3068 sprintf (decode_mode_spec_buf, "%2d%%", total); | 3120 sprintf (decode_mode_spec_buf, "%2d%%", total); |
3069 return decode_mode_spec_buf; | 3121 return decode_mode_spec_buf; |
3070 } | 3122 } |
3098 for (i = 0; i < command_loop_level; i++) | 3150 for (i = 0; i < command_loop_level; i++) |
3099 *p++ = ']'; | 3151 *p++ = ']'; |
3100 *p = 0; | 3152 *p = 0; |
3101 return decode_mode_spec_buf; | 3153 return decode_mode_spec_buf; |
3102 } | 3154 } |
3103 | 3155 |
3104 case '-': | 3156 case '-': |
3105 { | 3157 { |
3106 register char *p; | 3158 register char *p; |
3107 register int i; | 3159 register int i; |
3108 | 3160 |
3115 *p = '\0'; | 3167 *p = '\0'; |
3116 } | 3168 } |
3117 return decode_mode_spec_buf; | 3169 return decode_mode_spec_buf; |
3118 } | 3170 } |
3119 } | 3171 } |
3120 | 3172 |
3121 if (XTYPE (obj) == Lisp_String) | 3173 if (XTYPE (obj) == Lisp_String) |
3122 return (char *) XSTRING (obj)->data; | 3174 return (char *) XSTRING (obj)->data; |
3123 else | 3175 else |
3124 return ""; | 3176 return ""; |
3125 } | 3177 } |
3477 line_number_display_limit = 1000000; | 3529 line_number_display_limit = 1000000; |
3478 | 3530 |
3479 DEFVAR_BOOL ("highlight-nonselected-windows", &highlight_nonselected_windows, | 3531 DEFVAR_BOOL ("highlight-nonselected-windows", &highlight_nonselected_windows, |
3480 "*Non-nil means highlight region even in nonselected windows."); | 3532 "*Non-nil means highlight region even in nonselected windows."); |
3481 highlight_nonselected_windows = 1; | 3533 highlight_nonselected_windows = 1; |
3534 | |
3535 DEFVAR_BOOL ("multiple-frames", &multiple_frames, | |
3536 "Non-nil means more than one frame is in use, not counting minibuffer frames.\n\ | |
3537 Not guaranteed to be accurate except while parsing frame-title-format."); | |
3538 | |
3539 DEFVAR_LISP ("frame-title-format", &Vframe_title_format, | |
3540 "Template for displaying the titlebar of visible frames.\n\ | |
3541 \(Assuming the window manager supports this feature.)\n\ | |
3542 This variable has the same structure as `mode-line-format' (which see),\n\ | |
3543 and is used only on frames for which no explicit name has been set\n\ | |
3544 \(see `modify-frame-parameters')."); | |
3545 DEFVAR_LISP ("icon-title-format", &Vicon_title_format, | |
3546 "Template for displaying the titlebar of an iconified frame.\n\ | |
3547 \(Assuming the window manager supports this feature.)\n\ | |
3548 This variable has the same structure as `mode-line-format' (which see),\n\ | |
3549 and is used only on frames for which no explicit name has been set\n\ | |
3550 \(see `modify-frame-parameters')."); | |
3551 Vicon_title_format | |
3552 = Vframe_title_format | |
3553 = Fcons (intern ("multiple-frames"), | |
3554 Fcons (build_string ("%b"), | |
3555 Fcons (Fcons (build_string (""), | |
3556 Fcons (intern ("invocation-name"), | |
3557 Fcons (build_string ("@"), | |
3558 Fcons (intern ("system-name"), | |
3559 Qnil)))), | |
3560 Qnil))); | |
3482 } | 3561 } |
3483 | 3562 |
3484 /* initialize the window system */ | 3563 /* initialize the window system */ |
3485 init_xdisp () | 3564 init_xdisp () |
3486 { | 3565 { |