aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.h
diff options
context:
space:
mode:
authorRichard M. Stallman1993-03-27 18:04:02 +0000
committerRichard M. Stallman1993-03-27 18:04:02 +0000
commit440d350c2fda4add5c37ed0dfd9684c9113197ae (patch)
treea2d4e93e0696cdeca3a1fc7c73f95a7b00118970 /src/buffer.h
parent2eec3b4e0cf6001ba675f9e7d329a69184cd04f1 (diff)
downloademacs-440d350c2fda4add5c37ed0dfd9684c9113197ae.tar.gz
emacs-440d350c2fda4add5c37ed0dfd9684c9113197ae.zip
(struct buffer): Field `fieldlist' deleted.
(OVERLAY_START, OVERLAY_END, OVERLAY_VALID): New macros. (OVERLAY_POSITION): Likewise. (searchbuf): Decl deleted--doesn't belong here. Delete include of regex.h for VMS.
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h78
1 files changed, 40 insertions, 38 deletions
diff --git a/src/buffer.h b/src/buffer.h
index 35a7d62685d..5c09f30c40b 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -273,14 +273,24 @@ struct buffer
273 /* t means the mark and region are currently active. */ 273 /* t means the mark and region are currently active. */
274 Lisp_Object mark_active; 274 Lisp_Object mark_active;
275 275
276 /* List of fields in this buffer. */ 276 /* List of overlays that end at or before the current center,
277 Lisp_Object fieldlist; 277 in order of end-position. */
278 Lisp_Object overlays_before;
279
280 /* List of overlays that end after the current center,
281 in order of start-position. */
282 Lisp_Object overlays_after;
283
284 /* Position where the overlay lists are centered. */
285 Lisp_Object overlay_center;
278}; 286};
287
288/* This points to the current buffer. */
279 289
280extern struct buffer *current_buffer; 290extern struct buffer *current_buffer;
281 291
282/* This structure holds the default values of the buffer-local variables 292/* This structure holds the default values of the buffer-local variables
283 defined with DefBufferLispVar, that have special slots in each buffer. 293 that have special slots in each buffer.
284 The default value occupies the same slot in this structure 294 The default value occupies the same slot in this structure
285 as an individual buffer's value occupies in that buffer. 295 as an individual buffer's value occupies in that buffer.
286 Setting the default value also goes through the alist of buffers 296 Setting the default value also goes through the alist of buffers
@@ -298,7 +308,7 @@ extern struct buffer buffer_defaults;
298 is turned on in the buffer's local_var_flags slot. 308 is turned on in the buffer's local_var_flags slot.
299 309
300 If a slot in this structure is zero, then even though there may 310 If a slot in this structure is zero, then even though there may
301 be a DefBufferLispVar for the slot, there is no default valuefeor it; 311 be a Lisp-level local variable for the slot, it has no default value,
302 and the corresponding slot in buffer_defaults is not used. */ 312 and the corresponding slot in buffer_defaults is not used. */
303 313
304extern struct buffer buffer_local_flags; 314extern struct buffer buffer_local_flags;
@@ -317,12 +327,12 @@ extern struct buffer buffer_local_symbols;
317 buffer_slot_type_mismatch will signal an error. The value Qnil may 327 buffer_slot_type_mismatch will signal an error. The value Qnil may
318 always be safely stored in any slot. */ 328 always be safely stored in any slot. */
319extern struct buffer buffer_local_types; 329extern struct buffer buffer_local_types;
320 330
321/* Point in the current buffer. */ 331/* Point in the current buffer. This is an obsolete alias
322 332 and should be eliminated. */
323#define point (current_buffer->text.pt + 0) 333#define point (current_buffer->text.pt + 0)
324 334
325/* Return character at position n. No range checking */ 335/* Return character at position n. No range checking. */
326#define FETCH_CHAR(n) *(((n)>= GPT ? GAP_SIZE : 0) + (n) + BEG_ADDR - 1) 336#define FETCH_CHAR(n) *(((n)>= GPT ? GAP_SIZE : 0) + (n) + BEG_ADDR - 1)
327 337
328/* BUFFER_CEILING_OF (resp. BUFFER_FLOOR_OF), when applied to n, return 338/* BUFFER_CEILING_OF (resp. BUFFER_FLOOR_OF), when applied to n, return
@@ -335,6 +345,9 @@ extern struct buffer buffer_local_types;
335 345
336extern void reset_buffer (); 346extern void reset_buffer ();
337 347
348extern Lisp_Object Fbuffer_name ();
349extern Lisp_Object Fget_file_buffer ();
350
338/* Functions to call before and after each text change. */ 351/* Functions to call before and after each text change. */
339extern Lisp_Object Vbefore_change_function; 352extern Lisp_Object Vbefore_change_function;
340extern Lisp_Object Vafter_change_function; 353extern Lisp_Object Vafter_change_function;
@@ -343,31 +356,32 @@ extern Lisp_Object Qfirst_change_hook;
343 356
344extern Lisp_Object Vdeactivate_mark; 357extern Lisp_Object Vdeactivate_mark;
345extern Lisp_Object Vtransient_mark_mode; 358extern Lisp_Object Vtransient_mark_mode;
359
360/* Overlays */
361
362/* Overlays are ordinary Lisp objects, and users can alter their contents.
363 Therefore, we cannot assume that they remain valid--we must check. */
346 364
347/* Fields. 365/* 1 if the OV is a cons cell whose car is a cons cell. */
366#define OVERLAY_VALID(OV) (CONSP ((OV)) && CONSP (XCONS ((OV))->car))
348 367
349A field is like a marker but it defines a region rather than a 368/* Return the marker that stands for where OV starts in the buffer. */
350point. Like a marker, a field is asocated with a buffer. 369#define OVERLAY_START(OV) (XCONS (XCONS ((OV))->car)->car)
351The field mechanism uses the marker mechanism in the
352sense that its start and end points are maintained as markers
353updated in the usual way as the buffer changes.
354 370
355A field can be protected or unprotected. If it is protected, 371/* Return the marker that stands for where OV ends in the buffer. */
356no modifications can be made that affect the field in its buffer, 372#define OVERLAY_END(OV) (XCONS (XCONS ((OV))->car)->cdr)
357when protected field checking is enabled.
358 373
359Each field also contains an alist, in which you can store 374/* Return the actual buffer position for the marker P,
360whatever you like. */ 375 if it is a marker and points into the current buffer.
376 Otherwise, zero. */
361 377
362/* Slots in a field: */ 378#define OVERLAY_POSITION(P) \
379 ((MARKERP ((P)) && XMARKER ((P))->buffer == current_buffer) \
380 ? marker_position ((P)) : 0)
363 381
364#define FIELD_BUFFER(f) (XVECTOR(f)->contents[1])
365#define FIELD_START_MARKER(f) (XVECTOR(f)->contents[2])
366#define FIELD_END_MARKER(f) (XVECTOR(f)->contents[3])
367#define FIELD_PROTECTED_FLAG(f) (XVECTOR(f)->contents[4])
368#define FIELD_ALIST(f) (XVECTOR(f)->contents[5])
369 382
370/* Allocation of buffer data. */ 383/* Allocation of buffer text. */
384
371#ifdef REL_ALLOC 385#ifdef REL_ALLOC
372#define BUFFER_ALLOC(data,size) ((unsigned char *) r_alloc (&data, (size))) 386#define BUFFER_ALLOC(data,size) ((unsigned char *) r_alloc (&data, (size)))
373#define BUFFER_REALLOC(data,size) ((unsigned char *) r_re_alloc (&data, (size))) 387#define BUFFER_REALLOC(data,size) ((unsigned char *) r_re_alloc (&data, (size)))
@@ -379,15 +393,3 @@ whatever you like. */
379#define BUFFER_FREE(data) (free ((data))) 393#define BUFFER_FREE(data) (free ((data)))
380#define R_ALLOC_DECLARE(var,data) 394#define R_ALLOC_DECLARE(var,data)
381#endif 395#endif
382
383/* VAX C is non-ANSI wrt extern declarations and requires the struct
384 re_pattern_buffer to completely defined for searchbuf's declaration. */
385#ifdef VMS
386#include "regex.h"
387#endif /* VMS */
388
389/* A search buffer, with a fastmap allocated and ready to go. */
390extern struct re_pattern_buffer searchbuf;
391
392extern Lisp_Object Fbuffer_name ();
393extern Lisp_Object Fget_file_buffer ();