diff options
author | Vitalie Spinu <spinuvit@gmail.com> | 2016-03-21 05:41:55 +0100 |
---|---|---|
committer | Vitalie Spinu <spinuvit@gmail.com> | 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 |
Implement buffer-widen-limits functionalitywiden-limitsscratch/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 #define Z (current_buffer->text->z) #define Z_BYTE (current_buffer->text->z_byte) +/* Positions that take into account widen limits. */ +#define BEGWL (BUF_BEGWL (current_buffer)) +#define ZWL (BUF_ZWL(current_buffer)) + /* Macros for the addresses of places in the buffer. */ /* Address of beginning of buffer. */ @@ -128,6 +132,15 @@ INLINE_HEADER_BEGIN : NILP (BVAR (buf, begv_marker)) ? buf->begv_byte \ : marker_byte_position (BVAR (buf, begv_marker))) +/* Hard positions in buffer. */ +#define BUF_BEGWL(buf) \ + ((NILP (BVAR (buf, widen_limits))) ? BUF_BEG (buf) \ + : XINT( XCAR (BVAR (buf, widen_limits)))) + +#define BUF_ZWL(buf) \ + ((NILP (BVAR (buf, widen_limits))) ? BUF_Z (buf) \ + : XINT( XCDR (BVAR (buf, widen_limits)))) + /* Position of point in buffer. */ #define BUF_PT(buf) \ (buf == current_buffer ? PT \ @@ -150,6 +163,7 @@ INLINE_HEADER_BEGIN : NILP (BVAR (buf, zv_marker)) ? buf->zv_byte \ : marker_byte_position (BVAR (buf, zv_marker))) + /* Position of gap in buffer. */ #define BUF_GPT(buf) ((buf)->text->gpt) #define BUF_GPT_BYTE(buf) ((buf)->text->gpt_byte) @@ -748,6 +762,9 @@ struct buffer See `cursor-type' for other values. */ Lisp_Object cursor_in_non_selected_windows_; + /* Cons of hard widen limits */ + Lisp_Object widen_limits_; + /* No more Lisp_Object beyond this point. Except undo_list, which is handled specially in Fgarbage_collect. */ |