diff options
| author | Vitalie Spinu | 2016-03-21 05:41:55 +0100 |
|---|---|---|
| committer | Vitalie Spinu | 2016-03-22 03:16:17 +0100 |
| commit | c331b6626a427fb89303fea75faebd8c39d343a8 (patch) | |
| tree | f5cf4ee74164ed2b9fe2037d764be441e4b67175 /src/buffer.h | |
| parent | 91e667692ba1362ca1334b8d58fd16c305ad5e2a (diff) | |
| download | emacs-scratch/widen-limits.tar.gz emacs-scratch/widen-limits.zip | |
Implement buffer-widen-limits functionalityscratch/widen-limits
`widen` now respects restrictions imposed by new variable
`hard-widen-limits`
Diffstat (limited to 'src/buffer.h')
| -rw-r--r-- | src/buffer.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h index 87b7cee4413..4075bbf555c 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -59,6 +59,10 @@ INLINE_HEADER_BEGIN | |||
| 59 | #define Z (current_buffer->text->z) | 59 | #define Z (current_buffer->text->z) |
| 60 | #define Z_BYTE (current_buffer->text->z_byte) | 60 | #define Z_BYTE (current_buffer->text->z_byte) |
| 61 | 61 | ||
| 62 | /* Positions that take into account widen limits. */ | ||
| 63 | #define BEGWL (BUF_BEGWL (current_buffer)) | ||
| 64 | #define ZWL (BUF_ZWL(current_buffer)) | ||
| 65 | |||
| 62 | /* Macros for the addresses of places in the buffer. */ | 66 | /* Macros for the addresses of places in the buffer. */ |
| 63 | 67 | ||
| 64 | /* Address of beginning of buffer. */ | 68 | /* Address of beginning of buffer. */ |
| @@ -128,6 +132,15 @@ INLINE_HEADER_BEGIN | |||
| 128 | : NILP (BVAR (buf, begv_marker)) ? buf->begv_byte \ | 132 | : NILP (BVAR (buf, begv_marker)) ? buf->begv_byte \ |
| 129 | : marker_byte_position (BVAR (buf, begv_marker))) | 133 | : marker_byte_position (BVAR (buf, begv_marker))) |
| 130 | 134 | ||
| 135 | /* Hard positions in buffer. */ | ||
| 136 | #define BUF_BEGWL(buf) \ | ||
| 137 | ((NILP (BVAR (buf, widen_limits))) ? BUF_BEG (buf) \ | ||
| 138 | : XINT( XCAR (BVAR (buf, widen_limits)))) | ||
| 139 | |||
| 140 | #define BUF_ZWL(buf) \ | ||
| 141 | ((NILP (BVAR (buf, widen_limits))) ? BUF_Z (buf) \ | ||
| 142 | : XINT( XCDR (BVAR (buf, widen_limits)))) | ||
| 143 | |||
| 131 | /* Position of point in buffer. */ | 144 | /* Position of point in buffer. */ |
| 132 | #define BUF_PT(buf) \ | 145 | #define BUF_PT(buf) \ |
| 133 | (buf == current_buffer ? PT \ | 146 | (buf == current_buffer ? PT \ |
| @@ -150,6 +163,7 @@ INLINE_HEADER_BEGIN | |||
| 150 | : NILP (BVAR (buf, zv_marker)) ? buf->zv_byte \ | 163 | : NILP (BVAR (buf, zv_marker)) ? buf->zv_byte \ |
| 151 | : marker_byte_position (BVAR (buf, zv_marker))) | 164 | : marker_byte_position (BVAR (buf, zv_marker))) |
| 152 | 165 | ||
| 166 | |||
| 153 | /* Position of gap in buffer. */ | 167 | /* Position of gap in buffer. */ |
| 154 | #define BUF_GPT(buf) ((buf)->text->gpt) | 168 | #define BUF_GPT(buf) ((buf)->text->gpt) |
| 155 | #define BUF_GPT_BYTE(buf) ((buf)->text->gpt_byte) | 169 | #define BUF_GPT_BYTE(buf) ((buf)->text->gpt_byte) |
| @@ -748,6 +762,9 @@ struct buffer | |||
| 748 | See `cursor-type' for other values. */ | 762 | See `cursor-type' for other values. */ |
| 749 | Lisp_Object cursor_in_non_selected_windows_; | 763 | Lisp_Object cursor_in_non_selected_windows_; |
| 750 | 764 | ||
| 765 | /* Cons of hard widen limits */ | ||
| 766 | Lisp_Object widen_limits_; | ||
| 767 | |||
| 751 | /* No more Lisp_Object beyond this point. Except undo_list, | 768 | /* No more Lisp_Object beyond this point. Except undo_list, |
| 752 | which is handled specially in Fgarbage_collect. */ | 769 | which is handled specially in Fgarbage_collect. */ |
| 753 | 770 | ||