aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1995-08-03 09:05:09 +0000
committerRichard M. Stallman1995-08-03 09:05:09 +0000
commita249de79739540f9a8b16308969eb53dcdab7bde (patch)
tree7008f48c27adfa68466b634ba135abe60878da5c
parenta0f5a25f2c33c02b31965787fc59d92cb40abc8e (diff)
downloademacs-a249de79739540f9a8b16308969eb53dcdab7bde.tar.gz
emacs-a249de79739540f9a8b16308969eb53dcdab7bde.zip
Move various Q... vars to top of file, unconditional.
(Vterminal_frame): Just one definition, at top of file, unconditional. (syms_of_frame_1): New function. (syms_of_frame. both definitions): Call syms_of_frame_1. (set_menu_bar_lines, set_menu_bar_lines_1): New functions. (store_frame_parameter): Call set_menu_bar_lines. [!MULTI_FRAME] (Fmodify_frame_parameters): Call set_menu_bar_lines.
-rw-r--r--src/frame.c179
1 files changed, 113 insertions, 66 deletions
diff --git a/src/frame.c b/src/frame.c
index bc84c38ff6c..05bd637070b 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -28,19 +28,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
28#include "msdos.h" 28#include "msdos.h"
29#endif 29#endif
30 30
31#ifdef MULTI_FRAME
32
33#include "buffer.h"
34
35/* These help us bind and responding to switch-frame events. */
36#include "commands.h"
37#include "keyboard.h"
38
39Lisp_Object Vemacs_iconified;
40Lisp_Object Vframe_list;
41Lisp_Object Vterminal_frame;
42Lisp_Object Vdefault_frame_alist;
43
44/* Evaluate this expression to rebuild the section of syms_of_frame 31/* Evaluate this expression to rebuild the section of syms_of_frame
45 that initializes and staticpros the symbols declared below. Note 32 that initializes and staticpros the symbols declared below. Note
46 that Emacs 18 has a bug that keeps C-x C-e from being able to 33 that Emacs 18 has a bug that keeps C-x C-e from being able to
@@ -74,6 +61,8 @@ Lisp_Object Vdefault_frame_alist;
74 (setq symbol-list (cdr symbol-list))))) 61 (setq symbol-list (cdr symbol-list)))))
75 */ 62 */
76 63
64/* We need most of these symbols even if not MULTI_FRAME;
65 easiest to define them all, all of the time. */
77/*&&& symbols declared here &&&*/ 66/*&&& symbols declared here &&&*/
78Lisp_Object Qframep; 67Lisp_Object Qframep;
79Lisp_Object Qframe_live_p; 68Lisp_Object Qframe_live_p;
@@ -90,6 +79,100 @@ Lisp_Object Qx;
90Lisp_Object Qvisible; 79Lisp_Object Qvisible;
91Lisp_Object Qbuffer_predicate; 80Lisp_Object Qbuffer_predicate;
92 81
82Lisp_Object Vterminal_frame;
83
84static void
85syms_of_frame_1 ()
86{
87 /*&&& init symbols here &&&*/
88 Qframep = intern ("framep");
89 staticpro (&Qframep);
90 Qframe_live_p = intern ("frame-live-p");
91 staticpro (&Qframe_live_p);
92 Qheight = intern ("height");
93 staticpro (&Qheight);
94 Qicon = intern ("icon");
95 staticpro (&Qicon);
96 Qminibuffer = intern ("minibuffer");
97 staticpro (&Qminibuffer);
98 Qmodeline = intern ("modeline");
99 staticpro (&Qmodeline);
100 Qname = intern ("name");
101 staticpro (&Qname);
102 Qonly = intern ("only");
103 staticpro (&Qonly);
104 Qunsplittable = intern ("unsplittable");
105 staticpro (&Qunsplittable);
106 Qmenu_bar_lines = intern ("menu-bar-lines");
107 staticpro (&Qmenu_bar_lines);
108 Qwidth = intern ("width");
109 staticpro (&Qwidth);
110 Qx = intern ("x");
111 staticpro (&Qx);
112 Qvisible = intern ("visible");
113 staticpro (&Qvisible);
114 Qbuffer_predicate = intern ("buffer-predicate");
115 staticpro (&Qbuffer_predicate);
116}
117
118static void
119set_menu_bar_lines_1 (window, n)
120 Lisp_Object window;
121 int n;
122{
123 struct window *w = XWINDOW (window);
124
125 XSETFASTINT (w->top, XFASTINT (w->top) + n);
126 XSETFASTINT (w->height, XFASTINT (w->height) - n);
127
128 /* Handle just the top child in a vertical split. */
129 if (!NILP (w->vchild))
130 set_menu_bar_lines_1 (w->vchild, n);
131
132 /* Adjust all children in a horizontal split. */
133 for (window = w->hchild; !NILP (window); window = w->next)
134 {
135 w = XWINDOW (window);
136 set_menu_bar_lines_1 (window, n);
137 }
138}
139
140static void
141set_menu_bar_lines (f, value, oldval)
142 struct frame *f;
143 Lisp_Object value, oldval;
144{
145 int nlines;
146 int olines = FRAME_MENU_BAR_LINES (f);
147
148 /* Right now, menu bars don't work properly in minibuf-only frames;
149 most of the commands try to apply themselves to the minibuffer
150 frame itslef, and get an error because you can't switch buffers
151 in or split the minibuffer window. */
152 if (FRAME_MINIBUF_ONLY_P (f))
153 return;
154
155 if (INTEGERP (value))
156 nlines = XINT (value);
157 else
158 nlines = 0;
159
160 FRAME_MENU_BAR_LINES (f) = nlines;
161 set_menu_bar_lines_1 (f->root_window, nlines - olines);
162}
163
164#ifdef MULTI_FRAME
165
166#include "buffer.h"
167
168/* These help us bind and responding to switch-frame events. */
169#include "commands.h"
170#include "keyboard.h"
171
172Lisp_Object Vemacs_iconified;
173Lisp_Object Vframe_list;
174Lisp_Object Vdefault_frame_alist;
175
93extern Lisp_Object Vminibuffer_list; 176extern Lisp_Object Vminibuffer_list;
94extern Lisp_Object get_minibuffer (); 177extern Lisp_Object get_minibuffer ();
95extern Lisp_Object Fhandle_switch_frame (); 178extern Lisp_Object Fhandle_switch_frame ();
@@ -1546,6 +1629,9 @@ store_frame_param (f, prop, val)
1546 if (EQ (prop, Qbuffer_predicate)) 1629 if (EQ (prop, Qbuffer_predicate))
1547 f->buffer_predicate = val; 1630 f->buffer_predicate = val;
1548 1631
1632 if (EQ (prop, Qmenu_bar_lines))
1633 set_menu_bar_lines (f, val, make_number (FRAME_MENU_BAR_LINES (f)));
1634
1549 if (EQ (prop, Qminibuffer) && WINDOWP (val)) 1635 if (EQ (prop, Qminibuffer) && WINDOWP (val))
1550 { 1636 {
1551 if (! MINI_WINDOW_P (XWINDOW (val))) 1637 if (! MINI_WINDOW_P (XWINDOW (val)))
@@ -1888,35 +1974,7 @@ choose_minibuf_frame ()
1888 1974
1889syms_of_frame () 1975syms_of_frame ()
1890{ 1976{
1891 /*&&& init symbols here &&&*/ 1977 syms_of_frame_1 ();
1892 Qframep = intern ("framep");
1893 staticpro (&Qframep);
1894 Qframe_live_p = intern ("frame-live-p");
1895 staticpro (&Qframe_live_p);
1896 Qheight = intern ("height");
1897 staticpro (&Qheight);
1898 Qicon = intern ("icon");
1899 staticpro (&Qicon);
1900 Qminibuffer = intern ("minibuffer");
1901 staticpro (&Qminibuffer);
1902 Qmodeline = intern ("modeline");
1903 staticpro (&Qmodeline);
1904 Qname = intern ("name");
1905 staticpro (&Qname);
1906 Qonly = intern ("only");
1907 staticpro (&Qonly);
1908 Qunsplittable = intern ("unsplittable");
1909 staticpro (&Qunsplittable);
1910 Qmenu_bar_lines = intern ("menu-bar-lines");
1911 staticpro (&Qmenu_bar_lines);
1912 Qwidth = intern ("width");
1913 staticpro (&Qwidth);
1914 Qx = intern ("x");
1915 staticpro (&Qx);
1916 Qvisible = intern ("visible");
1917 staticpro (&Qvisible);
1918 Qbuffer_predicate = intern ("buffer-predicate");
1919 staticpro (&Qbuffer_predicate);
1920 1978
1921 staticpro (&Vframe_list); 1979 staticpro (&Vframe_list);
1922 1980
@@ -2012,16 +2070,6 @@ keys_of_frame ()
2012/* If we're not using multi-frame stuff, we still need to provide some 2070/* If we're not using multi-frame stuff, we still need to provide some
2013 support functions. */ 2071 support functions. */
2014 2072
2015Lisp_Object Qheight;
2016Lisp_Object Qminibuffer;
2017Lisp_Object Qmodeline;
2018Lisp_Object Qname;
2019Lisp_Object Qunsplittable;
2020Lisp_Object Qmenu_bar_lines;
2021Lisp_Object Qwidth;
2022
2023Lisp_Object Vterminal_frame;
2024
2025/* Unless this function is defined, providing set-frame-height and 2073/* Unless this function is defined, providing set-frame-height and
2026 set-frame-width doesn't help compatibility any, since they both 2074 set-frame-width doesn't help compatibility any, since they both
2027 want this as their first argument. */ 2075 want this as their first argument. */
@@ -2317,10 +2365,22 @@ DEFUN ("modify-frame-parameters", Fmodify_frame_parameters,
2317 (frame, alist) 2365 (frame, alist)
2318 Lisp_Object frame, alist; 2366 Lisp_Object frame, alist;
2319{ 2367{
2368 Lisp_Object tail, elt, prop, val;
2369
2320#ifdef MSDOS 2370#ifdef MSDOS
2321 if (FRAME_X_P (frame)) 2371 if (FRAME_X_P (frame))
2322 IT_set_frame_parameters (XFRAME (frame), alist); 2372 IT_set_frame_parameters (XFRAME (frame), alist);
2373 else
2323#endif 2374#endif
2375 for (tail = alist; !EQ (tail, Qnil); tail = Fcdr (tail))
2376 {
2377 elt = Fcar (tail);
2378 prop = Fcar (elt);
2379 val = Fcdr (elt);
2380 if (EQ (prop, Qmenu_bar_lines))
2381 set_menu_bar_lines (f, val, make_number (FRAME_MENU_BAR_LINES (f)));
2382 }
2383
2324 return Qnil; 2384 return Qnil;
2325} 2385}
2326 2386
@@ -2345,20 +2405,7 @@ DEFUN ("frame-list", Fframe_list, Sframe_list, 0, 0, 0,
2345 2405
2346syms_of_frame () 2406syms_of_frame ()
2347{ 2407{
2348 Qheight = intern ("height"); 2408 syms_of_frame_1 ();
2349 staticpro (&Qheight);
2350 Qminibuffer = intern ("minibuffer");
2351 staticpro (&Qminibuffer);
2352 Qmodeline = intern ("modeline");
2353 staticpro (&Qmodeline);
2354 Qname = intern ("name");
2355 staticpro (&Qname);
2356 Qunsplittable = intern ("unsplittable");
2357 staticpro (&Qunsplittable);
2358 Qmenu_bar_lines = intern ("menu-bar-lines");
2359 staticpro (&Qmenu_bar_lines);
2360 Qwidth = intern ("width");
2361 staticpro (&Qwidth);
2362 2409
2363 DEFVAR_LISP ("terminal-frame", &Vterminal_frame, 2410 DEFVAR_LISP ("terminal-frame", &Vterminal_frame,
2364 /* Don't confuse make-docfile by having two doc strings for this variable. 2411 /* Don't confuse make-docfile by having two doc strings for this variable.