]> code.delx.au - gnu-emacs/blobdiff - src/buffer.h
.
[gnu-emacs] / src / buffer.h
index 14d3aa6d5ee9fe8d320da32c450e3d1de639cfdb..bcb293a2e856780505a74bd88302d39dd7d313ec 100644 (file)
@@ -1,5 +1,5 @@
 /* Header file for the buffer manipulation primitives.
-   Copyright (C) 1985, 86, 93, 94, 95, 97, 1998, 1999, 2000, 01, 2003
+   Copyright (C) 1985,86,93,94,95,97,98,99,2000,01,03,04
    Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -666,6 +666,9 @@ struct buffer
   /* List of symbols naming the file format used for visited file.  */
   Lisp_Object file_format;
 
+  /* List of symbols naming the file format used for auto-save file.  */
+  Lisp_Object auto_save_file_format;
+
   /* True if the newline position cache and width run cache are
      enabled.  See search.c and indent.c.  */
   Lisp_Object cache_long_line_scans;
@@ -733,6 +736,9 @@ struct buffer
      like vi).  */
   Lisp_Object indicate_empty_lines;
 
+  /* Non-nil means indicate buffer boundaries and scrolling.  */
+  Lisp_Object indicate_buffer_boundaries;
+
   /* Time stamp updated each time this buffer is displayed in a window.  */
   Lisp_Object display_time;
 
@@ -820,6 +826,25 @@ extern void buffer_slot_type_mismatch P_ ((int));
 extern void fix_overlays_before P_ ((struct buffer *, EMACS_INT, EMACS_INT));
 extern void mmap_set_vars P_ ((int));
 
+/* Get overlays at POSN into array OVERLAYS with NOVERLAYS elements.
+   If NEXTP is non-NULL, return next overlay there.
+   See overlay_at arg CHANGE_REQ for meaning of CHRQ arg.  */
+
+#define GET_OVERLAYS_AT(posn, overlays, noverlays, nextp, chrq)                \
+  do {                                                                 \
+    int maxlen = 40;                                                   \
+    overlays = (Lisp_Object *) alloca (maxlen * sizeof (Lisp_Object)); \
+    noverlays = overlays_at (posn, 0, &overlays, &maxlen,              \
+                            nextp, NULL, chrq);                                \
+    if (noverlays > maxlen)                                            \
+      {                                                                        \
+       maxlen = noverlays;                                             \
+       overlays = (Lisp_Object *) alloca (maxlen * sizeof (Lisp_Object)); \
+       noverlays = overlays_at (posn, 0, &overlays, &maxlen,           \
+                                nextp, NULL, chrq);                    \
+      }                                                                        \
+  } while (0)
+
 EXFUN (Fbuffer_name, 1);
 EXFUN (Fget_file_buffer, 1);
 EXFUN (Fnext_overlay_change, 1);
@@ -906,8 +931,26 @@ extern int last_per_buffer_idx;
        (B)->local_flags[IDX] = (VAL);                  \
      } while (0)
 
-/* Return the index of the per-buffer variable at offset OFFSET in the
-   buffer structure.  */
+/* Return the index value of the per-buffer variable at offset OFFSET
+   in the buffer structure.
+
+   If the slot OFFSET has a corresponding default value in
+   buffer_defaults, the index value is positive and has only one
+   nonzero bit.  When a buffer has its own local value for a slot, the
+   bit for that slot (found in the same slot in this structure) is
+   turned on in the buffer's local_flags array.
+
+   If the index value is -1, even though there may be a
+   DEFVAR_PER_BUFFER for the slot, there is no default value for it;
+   and the corresponding slot in buffer_defaults is not used.
+
+   If the index value is -2, then there is no DEFVAR_PER_BUFFER for
+   the slot, but there is a default value which is copied into each
+   new buffer.
+
+   If a slot in this structure corresponding to a DEFVAR_PER_BUFFER is
+   zero, that is a bug */
+
 
 #define PER_BUFFER_IDX(OFFSET) \
       XINT (*(Lisp_Object *)((OFFSET) + (char *) &buffer_local_flags))