aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Blandy1992-10-11 06:40:57 +0000
committerJim Blandy1992-10-11 06:40:57 +0000
commit2f0b07e06c9b2c9bc62f615e471e2dcb04406d38 (patch)
treeb077559ced8dcac3c6436a84b000c4085a7673ed /src
parent5e67fbc2f09c113e473a40b0b72923c9f53e67d8 (diff)
downloademacs-2f0b07e06c9b2c9bc62f615e471e2dcb04406d38.tar.gz
emacs-2f0b07e06c9b2c9bc62f615e471e2dcb04406d38.zip
* frame.c: #include "commands.h" and "keyboard.h".
(Fselect_frame): Make this interactive, and accept switch-frame events as arguments, so we can bind this function to switch-frame events. (keys_of_frame): New function; bind switch-frame to Fselect_frame.
Diffstat (limited to 'src')
-rw-r--r--src/frame.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/frame.c b/src/frame.c
index b36865cc95e..ce1c45779d0 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -28,6 +28,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
28#include "window.h" 28#include "window.h"
29#include "termhooks.h" 29#include "termhooks.h"
30 30
31/* These help us bind and responding to switch-frame events. */
32#include "commands.h"
33#include "keyboard.h"
34
31Lisp_Object Vemacs_iconified; 35Lisp_Object Vemacs_iconified;
32Lisp_Object Vframe_list; 36Lisp_Object Vframe_list;
33Lisp_Object Vterminal_frame; 37Lisp_Object Vterminal_frame;
@@ -313,13 +317,25 @@ make_terminal_frame ()
313 return f; 317 return f;
314} 318}
315 319
316DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 2, 0, 320DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 2, "e",
317 "Select the frame FRAME. FRAME's selected window becomes \"the\"\n\ 321 "Select the frame FRAME. FRAME's selected window becomes \"the\"\n\
318selected window. If the optional parameter NO-ENTER is non-nil, don't\n\ 322selected window. If the optional parameter NO-ENTER is non-nil, don't\n\
319focus on that frame.") 323focus on that frame.\n\
324\n\
325This function is interactive, and may be bound to the ``switch-frame''\n\
326event; when invoked this way, it switches to the frame named in the\n\
327event. When called from lisp, FRAME may be a ``switch-frame'' event;\n\
328if it is, select the frame named in the event.")
320 (frame, no_enter) 329 (frame, no_enter)
321 Lisp_Object frame, no_enter; 330 Lisp_Object frame, no_enter;
322{ 331{
332 /* If FRAME is a switch-frame event, extract the frame we should
333 switch to. */
334 if (CONSP (frame)
335 && EQ (XCONS (frame)->car, Qswitch_frame)
336 && CONSP (XCONS (frame)->cdr))
337 frame = XCONS (XCONS (frame)->cdr)->car;
338
323 CHECK_LIVE_FRAME (frame, 0); 339 CHECK_LIVE_FRAME (frame, 0);
324 340
325 if (selected_frame == XFRAME (frame)) 341 if (selected_frame == XFRAME (frame))
@@ -1364,6 +1380,11 @@ For values specific to the separate minibuffer frame, see\n\
1364#endif /* HAVE_X11 */ 1380#endif /* HAVE_X11 */
1365} 1381}
1366 1382
1383keys_of_frame ()
1384{
1385 initial_define_lispy_key (global_map, "switch-frame", "select-frame");
1386}
1387
1367#else /* not MULTI_FRAME */ 1388#else /* not MULTI_FRAME */
1368 1389
1369/* If we're not using multi-frame stuff, we still need to provide some 1390/* If we're not using multi-frame stuff, we still need to provide some
@@ -1475,6 +1496,10 @@ syms_of_frame ()
1475 Ffset (intern ("screen-width"), intern ("frame-width")); 1496 Ffset (intern ("screen-width"), intern ("frame-width"));
1476} 1497}
1477 1498
1499keys_of_frame ()
1500{
1501}
1502
1478#endif /* not MULTI_FRAME */ 1503#endif /* not MULTI_FRAME */
1479 1504
1480 1505