]> git.eshelyaron.com Git - emacs.git/commitdiff
Unify Fx_focus_frame between all ports.
authorDmitry Antipov <dmantipov@yandex.ru>
Fri, 13 Sep 2013 16:46:18 +0000 (20:46 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Fri, 13 Sep 2013 16:46:18 +0000 (20:46 +0400)
* 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.

lisp/ChangeLog
lisp/frame.el
src/ChangeLog
src/frame.c
src/frame.h
src/gtkutil.c
src/nsfns.m
src/w32fns.c
src/w32term.c
src/w32term.h
src/xfns.c

index 649e3a3b01c368f0dae1126da13ea0c93e538acc..aa17b9328c42fc6396ec0239a62d26cd6bb28f1d 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 3668f24ba01a6464ff763621182d602caa588df4..74149a8dc010008bcbedd2fcec9a9a5f47c2e9ad 100644 (file)
@@ -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.
index 57cb776038a3b01294a6fc9a914446d2ae67cb22..cc8704da2a1c5e9924720eb6eb6e3b740166b373 100644 (file)
@@ -1,3 +1,23 @@
+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.
index 0de3152166e8024bbbb4ba112a8364dba6349cdd..74e57f9b5f2fe636652c760f48757a56f1ba1fb6 100644 (file)
@@ -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;
+}
 
 \f
 /* 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);
index 4184ce24a17bae5cb6b421e062bb6a3564361684..ea550f4a2fa343ada6d4ac6fb635eb7850361fc8 100644 (file)
@@ -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 */
 \f
index 064145282bc3c16da666563c7e9eb4f9d6c16254..95154ef9b52e8d2236040167c496388611238067 100644 (file)
@@ -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
index 2d828991ffeb0c4af8d8714f27c2eb7ae71f3b63..8eaf529ed0476b25629db5550de3530154107d4e 100644 (file)
@@ -1339,13 +1339,9 @@ This function is an internal primitive--use `make-frame' instead.  */)
   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 @@ FRAME nil means use the selected frame.  */)
       [[view window] makeKeyAndOrderFront: view];
       unblock_input ();
     }
-
-  return Qnil;
 }
 
 
@@ -2894,7 +2888,6 @@ be used as the image of the icon representing the frame.  */);
   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);
 
index d2defeed529046b11263c3f5ff8a7347520b5556..0e8b8ab5a5ba4577e69eb0b9fcb9257ce2d31cd1 100644 (file)
@@ -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;
-}
-
-\f
 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 */
 
index f86f7d351aa6c16c81c5a63888bbae4d65710c2d..cb7327b21b7f5637da1ae21b8ecfb28e769d3059 100644 (file)
@@ -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;
 
index 68c0245acb9054c76e5150dca7312f7f077f90a5..5146fa8ef3ad3f26d14b95923eb263daea477313 100644 (file)
@@ -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,
index df5f0a742d9053fb90fc6db42634ba7ffeba09da..ecd1ce7bc951da221da859afa4cc44b9a1aec0db 100644 (file)
@@ -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;
 }
 
 \f
@@ -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);