aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/buffer.h b/src/buffer.h
index 24c6fc5d6f2..87d646f35fe 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -326,7 +326,6 @@ else
326 326
327/* Variables used locally in FETCH_MULTIBYTE_CHAR. */ 327/* Variables used locally in FETCH_MULTIBYTE_CHAR. */
328extern unsigned char *_fetch_multibyte_char_p; 328extern unsigned char *_fetch_multibyte_char_p;
329extern int _fetch_multibyte_char_len;
330 329
331/* Return character code of multi-byte form at position POS. If POS 330/* Return character code of multi-byte form at position POS. If POS
332 doesn't point the head of valid multi-byte form, only the byte at 331 doesn't point the head of valid multi-byte form, only the byte at
@@ -334,10 +333,18 @@ extern int _fetch_multibyte_char_len;
334 333
335#define FETCH_MULTIBYTE_CHAR(pos) \ 334#define FETCH_MULTIBYTE_CHAR(pos) \
336 (_fetch_multibyte_char_p = (((pos) >= GPT_BYTE ? GAP_SIZE : 0) \ 335 (_fetch_multibyte_char_p = (((pos) >= GPT_BYTE ? GAP_SIZE : 0) \
337 + (pos) + BEG_ADDR - BEG_BYTE), \ 336 + (pos) + BEG_ADDR - BEG_BYTE), \
338 _fetch_multibyte_char_len \ 337 STRING_CHAR (_fetch_multibyte_char_p, 0))
339 = ((pos) >= GPT_BYTE ? ZV_BYTE : GPT_BYTE) - (pos), \ 338
340 STRING_CHAR (_fetch_multibyte_char_p, _fetch_multibyte_char_len)) 339/* Return character at position POS. If the current buffer is unibyte
340 and the character is not ASCII, make the returning character
341 multibyte. */
342
343#define FETCH_CHAR_AS_MULTIBYTE(pos) \
344 (!NILP (current_buffer->enable_multibyte_characters) \
345 ? FETCH_MULTIBYTE_CHAR ((pos)) \
346 : unibyte_char_to_multibyte (FETCH_BYTE ((pos))))
347
341 348
342/* Macros for accessing a character or byte, 349/* Macros for accessing a character or byte,
343 or converting between byte positions and addresses, 350 or converting between byte positions and addresses,
@@ -386,10 +393,7 @@ extern int _fetch_multibyte_char_len;
386 (_fetch_multibyte_char_p \ 393 (_fetch_multibyte_char_p \
387 = (((pos) >= BUF_GPT_BYTE (buf) ? BUF_GAP_SIZE (buf) : 0) \ 394 = (((pos) >= BUF_GPT_BYTE (buf) ? BUF_GAP_SIZE (buf) : 0) \
388 + (pos) + BUF_BEG_ADDR (buf) - BEG_BYTE), \ 395 + (pos) + BUF_BEG_ADDR (buf) - BEG_BYTE), \
389 _fetch_multibyte_char_len \ 396 STRING_CHAR (_fetch_multibyte_char_p, 0))
390 = (((pos) >= BUF_GPT_BYTE (buf) ? BUF_ZV_BYTE (buf) : BUF_GPT_BYTE (buf)) \
391 - (pos)), \
392 STRING_CHAR (_fetch_multibyte_char_p, _fetch_multibyte_char_len))
393 397
394/* Define the actual buffer data structures. */ 398/* Define the actual buffer data structures. */
395 399
@@ -445,6 +449,11 @@ struct buffer_text
445 successive elements in its marker `chain' 449 successive elements in its marker `chain'
446 are the other markers referring to this buffer. */ 450 are the other markers referring to this buffer. */
447 struct Lisp_Marker *markers; 451 struct Lisp_Marker *markers;
452
453 /* Usually 0. Temporarily set to 1 in decode_coding_gap to
454 prevent Fgarbage_collect from shrinking the gap and loosing
455 not-yet-decoded bytes. */
456 int inhibit_shrinking;
448 }; 457 };
449 458
450/* This is the structure that the buffer Lisp object points to. */ 459/* This is the structure that the buffer Lisp object points to. */
@@ -855,6 +864,7 @@ extern void mmap_set_vars P_ ((int));
855 } \ 864 } \
856 } while (0) 865 } while (0)
857 866
867EXFUN (Fbuffer_live_p, 1);
858EXFUN (Fbuffer_name, 1); 868EXFUN (Fbuffer_name, 1);
859EXFUN (Fget_file_buffer, 1); 869EXFUN (Fget_file_buffer, 1);
860EXFUN (Fnext_overlay_change, 1); 870EXFUN (Fnext_overlay_change, 1);
@@ -898,7 +908,7 @@ extern Lisp_Object Vtransient_mark_mode;
898 We assume you know which buffer it's pointing into. */ 908 We assume you know which buffer it's pointing into. */
899 909
900#define OVERLAY_POSITION(P) \ 910#define OVERLAY_POSITION(P) \
901 (GC_MARKERP (P) ? marker_position (P) : (abort (), 0)) 911 (MARKERP (P) ? marker_position (P) : (abort (), 0))
902 912
903 913
904/*********************************************************************** 914/***********************************************************************