diff options
Diffstat (limited to 'src/buffer.h')
| -rw-r--r-- | src/buffer.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h index 87b7cee4413..5eeb3ce26e7 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -416,6 +416,26 @@ extern void enlarge_buffer_text (struct buffer *, ptrdiff_t); | |||
| 416 | 416 | ||
| 417 | #define BUF_FETCH_BYTE(buf, n) \ | 417 | #define BUF_FETCH_BYTE(buf, n) \ |
| 418 | *(BUF_BYTE_ADDRESS ((buf), (n))) | 418 | *(BUF_BYTE_ADDRESS ((buf), (n))) |
| 419 | |||
| 420 | |||
| 421 | /* Macros for setting and accessing hard-narrow markers */ | ||
| 422 | |||
| 423 | /* Position of beginning of hard-narrowed range of buffer. */ | ||
| 424 | #define BEGH (BUF_BEGH (current_buffer)) | ||
| 425 | #define BUF_BEGH(buf) \ | ||
| 426 | ((NILP (BVAR (buf, begh_marker))) ? BUF_BEG (buf) \ | ||
| 427 | : marker_position (BVAR (buf, begh_marker))) | ||
| 428 | #define SET_BUF_BEGH(buf, charpos) \ | ||
| 429 | (bset_begh_marker (buf, build_marker(buf, charpos, buf_charpos_to_bytepos(buf, charpos)))) | ||
| 430 | |||
| 431 | /* Position of end of hard-narrowed range of buffer. */ | ||
| 432 | #define ZH (BUF_ZH(current_buffer)) | ||
| 433 | #define BUF_ZH(buf) \ | ||
| 434 | ((NILP (BVAR (buf, zh_marker))) ? BUF_Z (buf) \ | ||
| 435 | : marker_position (BVAR (buf, zh_marker))) | ||
| 436 | #define SET_BUF_ZH(buf, charpos) \ | ||
| 437 | (bset_zh_marker (buf, build_marker(buf, charpos, buf_charpos_to_bytepos(buf, charpos)))) | ||
| 438 | |||
| 419 | 439 | ||
| 420 | /* Define the actual buffer data structures. */ | 440 | /* Define the actual buffer data structures. */ |
| 421 | 441 | ||
| @@ -666,6 +686,12 @@ struct buffer | |||
| 666 | ZV for this buffer when the buffer is not current. */ | 686 | ZV for this buffer when the buffer is not current. */ |
| 667 | Lisp_Object zv_marker_; | 687 | Lisp_Object zv_marker_; |
| 668 | 688 | ||
| 689 | /* Lower hard limit of the buffer.*/ | ||
| 690 | Lisp_Object begh_marker_; | ||
| 691 | |||
| 692 | /* Upper hard limit of the buffer.*/ | ||
| 693 | Lisp_Object zh_marker_; | ||
| 694 | |||
| 669 | /* This holds the point value before the last scroll operation. | 695 | /* This holds the point value before the last scroll operation. |
| 670 | Explicitly setting point sets this to nil. */ | 696 | Explicitly setting point sets this to nil. */ |
| 671 | Lisp_Object point_before_scroll_; | 697 | Lisp_Object point_before_scroll_; |
| @@ -984,6 +1010,16 @@ bset_width_table (struct buffer *b, Lisp_Object val) | |||
| 984 | { | 1010 | { |
| 985 | b->width_table_ = val; | 1011 | b->width_table_ = val; |
| 986 | } | 1012 | } |
| 1013 | INLINE void | ||
| 1014 | bset_begh_marker (struct buffer *b, Lisp_Object val) | ||
| 1015 | { | ||
| 1016 | b->begh_marker_ = val; | ||
| 1017 | } | ||
| 1018 | INLINE void | ||
| 1019 | bset_zh_marker (struct buffer *b, Lisp_Object val) | ||
| 1020 | { | ||
| 1021 | b->zh_marker_ = val; | ||
| 1022 | } | ||
| 987 | 1023 | ||
| 988 | /* Number of Lisp_Objects at the beginning of struct buffer. | 1024 | /* Number of Lisp_Objects at the beginning of struct buffer. |
| 989 | If you add, remove, or reorder Lisp_Objects within buffer | 1025 | If you add, remove, or reorder Lisp_Objects within buffer |