From 790f39e7815fde07bbccc64b67e3d9fa079540aa Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 25 Jun 1994 22:34:25 +0000 Subject: [PATCH] (BUF_PTR_CHAR_POS): New macro. --- src/buffer.h | 7 +++++++ 1 file changed, 7 insertions(+) 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. */ ((ptr) - (current_buffer)->text.beg \ - (ptr - (current_buffer)->text.beg < (unsigned) GPT ? 0 : GAP_SIZE) \ + 1) + +/* Convert the address of a char in the buffer into a character position. */ +#define BUF_PTR_CHAR_POS(buf, ptr) \ +((ptr) - (buf)->text.beg \ + - (ptr - (buf)->text.beg < (unsigned) BUF_GPT ((buf)) \ + ? 0 : BUF_GAP_SIZE ((buf))) \ + + 1) struct buffer_text { -- 2.39.5