diff options
| author | Richard M. Stallman | 1994-06-25 22:34:25 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-06-25 22:34:25 +0000 |
| commit | 790f39e7815fde07bbccc64b67e3d9fa079540aa (patch) | |
| tree | c9b11fbcb80f55a096205b80d76c6a5655ad7234 /src/buffer.h | |
| parent | dcdc526cc3fb50399ee82bc9f1f6cd78fb06b7c5 (diff) | |
| download | emacs-790f39e7815fde07bbccc64b67e3d9fa079540aa.tar.gz emacs-790f39e7815fde07bbccc64b67e3d9fa079540aa.zip | |
(BUF_PTR_CHAR_POS): New macro.
Diffstat (limited to 'src/buffer.h')
| -rw-r--r-- | src/buffer.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h index 499a8629afa..2e2f3fbfe23 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -130,6 +130,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 130 | ((ptr) - (current_buffer)->text.beg \ | 130 | ((ptr) - (current_buffer)->text.beg \ |
| 131 | - (ptr - (current_buffer)->text.beg < (unsigned) GPT ? 0 : GAP_SIZE) \ | 131 | - (ptr - (current_buffer)->text.beg < (unsigned) GPT ? 0 : GAP_SIZE) \ |
| 132 | + 1) | 132 | + 1) |
| 133 | |||
| 134 | /* Convert the address of a char in the buffer into a character position. */ | ||
| 135 | #define BUF_PTR_CHAR_POS(buf, ptr) \ | ||
| 136 | ((ptr) - (buf)->text.beg \ | ||
| 137 | - (ptr - (buf)->text.beg < (unsigned) BUF_GPT ((buf)) \ | ||
| 138 | ? 0 : BUF_GAP_SIZE ((buf))) \ | ||
| 139 | + 1) | ||
| 133 | 140 | ||
| 134 | struct buffer_text | 141 | struct buffer_text |
| 135 | { | 142 | { |