aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.h
diff options
context:
space:
mode:
authorRichard M. Stallman1994-06-25 22:34:25 +0000
committerRichard M. Stallman1994-06-25 22:34:25 +0000
commit790f39e7815fde07bbccc64b67e3d9fa079540aa (patch)
treec9b11fbcb80f55a096205b80d76c6a5655ad7234 /src/buffer.h
parentdcdc526cc3fb50399ee82bc9f1f6cd78fb06b7c5 (diff)
downloademacs-790f39e7815fde07bbccc64b67e3d9fa079540aa.tar.gz
emacs-790f39e7815fde07bbccc64b67e3d9fa079540aa.zip
(BUF_PTR_CHAR_POS): New macro.
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h7
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
134struct buffer_text 141struct buffer_text
135 { 142 {