diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2014-07-17 14:18:19 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2014-07-17 14:18:19 +0400 |
commit | 5d59504a3198da6173a8cc1d4125a76b657b4538 (patch) | |
tree | b1d028d1e7b7a90c8d56140aff7f6416254507cc /src/xfns.c | |
parent | b1bfebbfc50e3d83a76ec1469b1e4570b1b022bc (diff) | |
download | emacs-5d59504a3198da6173a8cc1d4125a76b657b4538.tar.gz |
* data.c (wrong_choice): Not static any more.
* lisp.h (wrong_choice): Add prototype.
* frame.h (struct frame) [USE_X_TOOLKIT || HAVE_NTGUI]:
Declare namebuf as such. Tweak comment.
[USE_GTK]: Likewise for tool_bar_position.
(fset_tool_bar_position) [USE_GTK]: Ditto.
(FRAME_TOOL_BAR_POSITION): New macro.
* frame.c (x_report_frame_params):
* gtkutil.c (update_frame_tool_bar):
* xfns.c (Fx_create_frame): Use it.
(x_set_tool_bar_position): Add meaningful diagnostic messages.
Diffstat (limited to 'src/xfns.c')
-rw-r--r-- | src/xfns.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/xfns.c b/src/xfns.c index 08de79596a8..cd95ea8ab72 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -457,15 +457,23 @@ x_set_tool_bar_position (struct frame *f, Lisp_Object new_value, Lisp_Object old_value) { - if (! EQ (new_value, Qleft) && ! EQ (new_value, Qright) - && ! EQ (new_value, Qbottom) && ! EQ (new_value, Qtop)) - return; - if (EQ (new_value, old_value)) return; + Lisp_Object choice = list4 (Qleft, Qright, Qtop, Qbottom); + if (!NILP (Fmemq (new_value, choice))) + { #ifdef USE_GTK - xg_change_toolbar_position (f, new_value); - fset_tool_bar_position (f, new_value); + if (!EQ (new_value, old_value)) + { + xg_change_toolbar_position (f, new_value); + fset_tool_bar_position (f, new_value); + } +#else + if (!EQ (new_value, Qtop)) + error ("The only supported tool bar position is top"); #endif + } + else + wrong_choice (choice, new_value); } #ifdef USE_GTK @@ -3182,7 +3190,7 @@ This function is an internal primitive--use `make-frame' instead. */) x_default_parameter (f, parms, Qfullscreen, Qnil, "fullscreen", "Fullscreen", RES_TYPE_SYMBOL); x_default_parameter (f, parms, Qtool_bar_position, - f->tool_bar_position, 0, 0, RES_TYPE_SYMBOL); + FRAME_TOOL_BAR_POSITION (f), 0, 0, RES_TYPE_SYMBOL); /* Compute the size of the X window. */ window_prompting = x_figure_window_size (f, parms, 1); |