New macro to iterate over all buffers, miscellaneous cleanups.
[bpt/emacs.git] / src / buffer.h
index b48791f..8c59683 100644 (file)
@@ -857,6 +857,15 @@ struct buffer
 };
 
 \f
+/* Chain of all buffers, including killed ones.  */
+
+extern struct buffer *all_buffers;
+
+/* Used to iterate over the chain above.  */
+
+#define for_each_buffer(b) \
+  for ((b) = all_buffers; (b); (b) = (b)->header.next.buffer)
+
 /* This points to the current buffer.  */
 
 extern struct buffer *current_buffer;
@@ -918,23 +927,18 @@ extern void mmap_set_vars (int);
 #define GET_OVERLAYS_AT(posn, overlays, noverlays, nextp, chrq)                \
   do {                                                                 \
     ptrdiff_t maxlen = 40;                                             \
-    overlays = (Lisp_Object *) alloca (maxlen * sizeof (Lisp_Object)); \
+    overlays = alloca (maxlen * sizeof *overlays);                     \
     noverlays = overlays_at (posn, 0, &overlays, &maxlen,              \
                             nextp, NULL, chrq);                        \
     if (noverlays > maxlen)                                            \
       {                                                                        \
        maxlen = noverlays;                                             \
-       overlays = (Lisp_Object *) alloca (maxlen * sizeof (Lisp_Object)); \
+       overlays = alloca (maxlen * sizeof *overlays);                  \
        noverlays = overlays_at (posn, 0, &overlays, &maxlen,           \
                                 nextp, NULL, chrq);                    \
       }                                                                        \
   } while (0)
 
-EXFUN (Fbuffer_live_p, 1);
-EXFUN (Fbuffer_name, 1);
-EXFUN (Fnext_overlay_change, 1);
-EXFUN (Fbuffer_local_value, 2);
-
 extern Lisp_Object Qbefore_change_functions;
 extern Lisp_Object Qafter_change_functions;
 extern Lisp_Object Qfirst_change_hook;
@@ -976,10 +980,6 @@ BUF_FETCH_MULTIBYTE_CHAR (struct buffer *buf, ptrdiff_t pos)
 \f
 /* Overlays */
 
-/* 1 if the OV is an overlay object.  */
-
-#define OVERLAY_VALID(OV) (OVERLAYP (OV))
-
 /* Return the marker that stands for where OV starts in the buffer.  */
 
 #define OVERLAY_START(OV) (XOVERLAY (OV)->start)