summaryrefslogtreecommitdiff
path: root/src/buffer.h
diff options
context:
space:
mode:
authorEric S. Raymond <esr@snark.thyrsus.com>1993-04-23 03:06:10 +0000
committerEric S. Raymond <esr@snark.thyrsus.com>1993-04-23 03:06:10 +0000
commit3c1771e0ac7f087758ac13414a442a896eeb9a1b (patch)
treee2032337c9a410979fe432ceb4e6570c8f15587e /src/buffer.h
parent2ba73b584b148b48fc275aef851f05bd6087ee39 (diff)
downloademacs-3c1771e0ac7f087758ac13414a442a896eeb9a1b.tar.gz
(BUF_NARROWED, NARROWED): New macros to test whether a region
restriction has narrowed the buffer.
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 5c09f30c40b..34d92fd61c7 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -53,6 +53,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Character position of end of buffer. */
#define Z (current_buffer->text.z)
+/* Is the current buffer narrowed? */
+#define NARROWED ((BEGV != BEG) || (ZV != Z))
+
/* Modification count. */
#define MODIFF (current_buffer->text.modiff)
@@ -98,6 +101,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Character position of end of buffer. */
#define BUF_Z(buf) ((buf)->text.z)
+/* Is this buffer narrowed? */
+#define BUF_NARROWED(buf) ((BUF_BEGV(buf) != BUF_BEG(buf)) \
+ || (BUF_ZV(buf) != BUF_Z(buf)))
+
/* Modification count. */
#define BUF_MODIFF(buf) ((buf)->text.modiff)