Commit fcd42c11 authored by Dmitry Antipov's avatar Dmitry Antipov

Unify Fx_focus_frame between all ports.

* src/frame.h (x_focus_frame): New prototype.
* src/xfns.c (Fx_focus_frame): Remove.
(syms_of_xfns): Do not defsubr it.
(x_focus_frame): X implementation.
* src/nsfns.m (Fx_focus_frame): Remove.
(syms_of_nsfns): Do not defsubr it.
(x_focus_frame): NS implementation.
* src/w32term.c (Fx_focus_frame): Remove.
(x_focus_on_frame): Rename to...
(x_focus_frame): W32 implementation.
* src/w32term.h (x_focus_on_frame): Remove prototype.
* src/w32fns.c (Fx_focus_frame): Remove.
(syms_of_w32fns): Do not defsubr it.
* src/frame.c (Fx_focus_frame): Define here.
(syms_of_frame): Defsubr here.
* src/gtkutil.c (xg_tool_bar_callback): Use x_focus_frame.
* lisp/frame.el (x-focus-frame): Mark as declared in frame.c.
parent bc2c0769
2013-09-13 Dmitry Antipov <dmantipov@yandex.ru>
* frame.el (x-focus-frame): Mark as declared in frame.c.
2013-09-13 Stefan Monnier <monnier@iro.umontreal.ca>
* ls-lisp.el: Use advice-add.
......
......@@ -759,7 +759,7 @@ the user during startup."
(nreverse frame-initial-geometry-arguments))
(cdr param-list))
(declare-function x-focus-frame "xfns.c" (frame))
(declare-function x-focus-frame "frame.c" (frame))
(defun select-frame-set-input-focus (frame &optional norecord)
"Select FRAME, raise it, and set input focus, if possible.
......
2013-09-13 Dmitry Antipov <dmantipov@yandex.ru>
Unify Fx_focus_frame between all ports.
* frame.h (x_focus_frame): New prototype.
* xfns.c (Fx_focus_frame): Remove.
(syms_of_xfns): Do not defsubr it.
(x_focus_frame): X implementation.
* nsfns.m (Fx_focus_frame): Remove.
(syms_of_nsfns): Do not defsubr it.
(x_focus_frame): NS implementation.
* w32term.c (Fx_focus_frame): Remove.
(x_focus_on_frame): Rename to...
(x_focus_frame): W32 implementation.
* w32term.h (x_focus_on_frame): Remove prototype.
* w32fns.c (Fx_focus_frame): Remove.
(syms_of_w32fns): Do not defsubr it.
* frame.c (Fx_focus_frame): Define here.
(syms_of_frame): Defsubr here.
* gtkutil.c (xg_tool_bar_callback): Use x_focus_frame.
2013-09-13 Dmitry Antipov <dmantipov@yandex.ru>
Unify FRAME_window_system_DISPLAY_INFO macros between all ports.
......
......@@ -1901,6 +1901,14 @@ See `redirect-frame-focus'. */)
return FRAME_FOCUS_FRAME (decode_live_frame (frame));
}
DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0,
doc: /* Set the input focus to FRAME.
FRAME nil means use the selected frame. */)
(Lisp_Object frame)
{
x_focus_frame (decode_window_system_frame (frame));
return Qnil;
}
/* Return the value of frame parameter PROP in frame FRAME. */
......@@ -4524,6 +4532,7 @@ automatically. See also `mouse-autoselect-window'. */);
defsubr (&Svisible_frame_list);
defsubr (&Sraise_frame);
defsubr (&Slower_frame);
defsubr (&Sx_focus_frame);
defsubr (&Sredirect_frame_focus);
defsubr (&Sframe_focus);
defsubr (&Sframe_parameters);
......
......@@ -1263,6 +1263,7 @@ extern void x_sync (struct frame *);
extern void x_query_colors (struct frame *f, XColor *, int);
extern void x_query_color (struct frame *f, XColor *);
extern void x_focus_frame (struct frame *);
#endif /* HAVE_WINDOW_SYSTEM */
......
......@@ -3975,9 +3975,9 @@ xg_tool_bar_callback (GtkWidget *w, gpointer client_data)
event.modifiers = x_x_to_emacs_modifiers (FRAME_DISPLAY_INFO (f), mod);
kbd_buffer_store_event (&event);
/* Return focus to the frame after we have clicked on a detached
tool bar button. */
Fx_focus_frame (frame);
/* Return focus to the frame after we have clicked on a detached
tool bar button. */
x_focus_frame (f);
}
/* Callback function invoked when a tool bar item is pressed in a detached
......
......@@ -1339,13 +1339,9 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
return unbind_to (count, frame);
}
DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0,
doc: /* Set the input focus to FRAME.
FRAME nil means use the selected frame. */)
(Lisp_Object frame)
void
x_focus_frame (struct frame *f)
{
struct frame *f = decode_window_system_frame (frame);
struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
if (dpyinfo->x_focus_frame != f)
......@@ -1356,8 +1352,6 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
[[view window] makeKeyAndOrderFront: view];
unblock_input ();
}
return Qnil;
}
......@@ -2894,7 +2888,6 @@ - (NSString *)panel: (id)sender userEnteredFilename: (NSString *)filename
defsubr (&Sns_list_services);
defsubr (&Sns_perform_service);
defsubr (&Sns_convert_utf8_nfd_to_nfc);
defsubr (&Sx_focus_frame);
defsubr (&Sns_popup_font_panel);
defsubr (&Sns_popup_color_panel);
......
......@@ -4622,15 +4622,6 @@ x_get_focus_frame (struct frame *frame)
return xfocus;
}
DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0,
doc: /* Give FRAME input focus, raising to foreground if necessary. */)
(Lisp_Object frame)
{
x_focus_on_frame (decode_window_system_frame (frame));
return Qnil;
}
DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
doc: /* Internal function called by `color-defined-p', which see.
\(Note that the Nextstep version of this function ignores FRAME.) */)
......@@ -7857,7 +7848,6 @@ only be necessary if the default setting causes problems. */);
defsubr (&Sx_close_connection);
defsubr (&Sx_display_list);
defsubr (&Sx_synchronize);
defsubr (&Sx_focus_frame);
/* W32 specific functions */
......
......@@ -5806,7 +5806,7 @@ x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
/* focus shifting, raising and lowering. */
void
x_focus_on_frame (struct frame *f)
x_focus_frame (struct frame *f)
{
struct w32_display_info *dpyinfo = &one_w32_display_info;
......
......@@ -199,8 +199,6 @@ Lisp_Object display_x_get_resource (struct w32_display_info *,
Lisp_Object, Lisp_Object,
Lisp_Object, Lisp_Object);
extern void x_focus_on_frame (struct frame *f);
/* also defined in xterm.h XXX: factor out to common header */
extern struct w32_display_info *w32_term_init (Lisp_Object,
......
......@@ -3252,12 +3252,9 @@ x_get_focus_frame (struct frame *frame)
policy. But I think it's okay to use when it's clearly done
following a user-command. */
DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0,
doc: /* Set the input focus to FRAME.
FRAME nil means use the selected frame. */)
(Lisp_Object frame)
void
x_focus_frame (struct frame *f)
{
struct frame *f = decode_window_system_frame (frame);
Display *dpy = FRAME_X_DISPLAY (f);
block_input ();
......@@ -3279,8 +3276,6 @@ FRAME nil means use the selected frame. */)
x_uncatch_errors ();
unblock_input ();
return Qnil;
}
......@@ -6170,7 +6165,6 @@ When using Gtk+ tooltips, the tooltip face is not used. */);
defsubr (&Sx_close_connection);
defsubr (&Sx_display_list);
defsubr (&Sx_synchronize);
defsubr (&Sx_focus_frame);
defsubr (&Sx_backspace_delete_keys_p);
defsubr (&Sx_show_tip);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment