Mercurial > emacs
comparison src/buffer.h @ 8061:ce94573db44d
(BUF_PTR_CHAR_POS): New macro.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 25 Jun 1994 22:34:25 +0000 |
parents | cd81dba38a49 |
children | ccc781ef6e3a |
comparison
equal
deleted
inserted
replaced
8060:5b9bbe66631c | 8061:ce94573db44d |
---|---|
127 | 127 |
128 /* Convert the address of a char in the buffer into a character position. */ | 128 /* Convert the address of a char in the buffer into a character position. */ |
129 #define PTR_CHAR_POS(ptr) \ | 129 #define PTR_CHAR_POS(ptr) \ |
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) | |
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))) \ | |
132 + 1) | 139 + 1) |
133 | 140 |
134 struct buffer_text | 141 struct buffer_text |
135 { | 142 { |
136 unsigned char *beg; /* Actual address of buffer contents. */ | 143 unsigned char *beg; /* Actual address of buffer contents. */ |