comparison src/buffer.h @ 6098:b91e19be1513

(OVERLAY_POSITION): Don't check which buffer it points to.
author Karl Heuer <kwzh@gnu.org>
date Sat, 26 Feb 1994 04:05:17 +0000
parents d3c064f0062e
children ef864f9fd3cc
comparison
equal deleted inserted replaced
6097:adf5b18629c8 6098:b91e19be1513
371 extern Lisp_Object Vdeactivate_mark; 371 extern Lisp_Object Vdeactivate_mark;
372 extern Lisp_Object Vtransient_mark_mode; 372 extern Lisp_Object Vtransient_mark_mode;
373 373
374 /* Overlays */ 374 /* Overlays */
375 375
376 /* Overlays are ordinary Lisp objects, and users can alter their contents. 376 /* 1 if the OV is an overlay object. */
377 Therefore, we cannot assume that they remain valid--we must check. */
378
379 /* 1 if the OV is a cons cell whose car is a cons cell. */
380 #define OVERLAY_VALID(OV) (OVERLAYP (OV)) 377 #define OVERLAY_VALID(OV) (OVERLAYP (OV))
381 378
382 /* Return the marker that stands for where OV starts in the buffer. */ 379 /* Return the marker that stands for where OV starts in the buffer. */
383 #define OVERLAY_START(OV) (XCONS (XCONS ((OV))->car)->car) 380 #define OVERLAY_START(OV) (XCONS (XCONS ((OV))->car)->car)
384 381
385 /* Return the marker that stands for where OV ends in the buffer. */ 382 /* Return the marker that stands for where OV ends in the buffer. */
386 #define OVERLAY_END(OV) (XCONS (XCONS ((OV))->car)->cdr) 383 #define OVERLAY_END(OV) (XCONS (XCONS ((OV))->car)->cdr)
387 384
388 /* Return the actual buffer position for the marker P, 385 /* Return the actual buffer position for the marker P.
389 if it is a marker and points into the current buffer. 386 We assume you know which buffer it's pointing into. */
390 Otherwise, zero. */
391 387
392 #define OVERLAY_POSITION(P) \ 388 #define OVERLAY_POSITION(P) \
393 ((MARKERP ((P)) && XMARKER ((P))->buffer == current_buffer) \ 389 (MARKERP ((P)) ? marker_position ((P)) : (abort (), 0))
394 ? marker_position ((P)) : 0)
395 390
396 /* Allocation of buffer text. */ 391 /* Allocation of buffer text. */
397 392
398 #ifdef REL_ALLOC 393 #ifdef REL_ALLOC
399 #define BUFFER_ALLOC(data,size) ((unsigned char *) r_alloc (&data, (size))) 394 #define BUFFER_ALLOC(data,size) ((unsigned char *) r_alloc (&data, (size)))