Add TAGS-LISP
[bpt/emacs.git] / src / frame.h
index cd17a35..4985911 100644 (file)
@@ -581,19 +581,18 @@ typedef struct frame *FRAME_PTR;
    (f)->visible = (f)->async_visible, \
    (f)->iconified = (f)->async_iconified)
 
-#define CHECK_FRAME(x, i)                      \
-     if (! FRAMEP (x))                         \
-       x = wrong_type_argument (Qframep, (x)); \
-     else                                      \
-       (void) 0
+#define CHECK_FRAME(x, i)                              \
+     do {                                              \
+       if (! FRAMEP (x))                               \
+         x = wrong_type_argument (Qframep, (x));       \
+     } while (0)
 
 #define CHECK_LIVE_FRAME(x, i)                         \
-     if (! FRAMEP (x)                                  \
-        || ! FRAME_LIVE_P (XFRAME (x)))                \
-       x = wrong_type_argument (Qframe_live_p, (x));   \
-     else                                              \
-       (void) 0
-
+     do {                                              \
+       if (! FRAMEP (x)                                        \
+          || ! FRAME_LIVE_P (XFRAME (x)))              \
+         x = wrong_type_argument (Qframe_live_p, (x)); \
+     } while (0)
 
 /* FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a
    `for' loop which iterates over the elements of Vframe_list.  The
@@ -615,7 +614,6 @@ typedef struct frame *FRAME_PTR;
 
 extern Lisp_Object Qframep, Qframe_live_p, Qicon;
 
-extern struct frame *selected_frame;
 extern struct frame *last_nonminibuf_frame;
 
 extern struct frame *make_terminal_frame P_ ((void));
@@ -655,6 +653,18 @@ extern Lisp_Object Vterminal_frame;
      
 #define WINDOW_VERTICAL_SCROLL_BAR_HEIGHT(w) (window_internal_height (w))
 
+/* The currently selected frame.  */
+
+extern Lisp_Object selected_frame;
+
+/* Value is a pointer to the selected frame.  If the selected frame
+   isn't life, abort.  */
+
+#define SELECTED_FRAME()                               \
+     ((FRAMEP (selected_frame)                         \
+       && FRAME_LIVE_P (XFRAME (selected_frame)))      \
+      ? XFRAME (selected_frame)                                \
+      : (struct frame *) (abort (), 0))
 
 \f
 /***********************************************************************