summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/lisp.h31
-rw-r--r--src/xdisp.c9
3 files changed, 33 insertions, 17 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 134e289681c..3776682c692 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
+2011-01-25 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * xdisp.c (handle_fontified_prop): Be careful with font-lock changing
+ the buffer's point-max (bug#7876).
+
+2011-01-25 Chong Yidong <cyd@stupidchicken.com>
+
+ * lisp.h (XPNTR): Obey DATA_SEG_BITS in all non-USE_LSB_TAG cases.
+ Remove unused case (Bug#6811).
+
2011-01-23 Jan Djärv <jan.h.d@swipnet.se>
* nsterm.m (x_set_offset): Set dont_constrain to 0 so the call to
diff --git a/src/lisp.h b/src/lisp.h
index 64c0b2332e3..c5c047a53cb 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -444,7 +444,13 @@ enum pvec_type
((var) = ((EMACS_INT) ((EMACS_UINT) (type) << VALBITS) \
+ ((EMACS_INT) (ptr) & VALMASK)))
+#ifdef DATA_SEG_BITS
+/* DATA_SEG_BITS forces extra bits to be or'd in with any pointers
+ which were stored in a Lisp_Object */
+#define XPNTR(a) ((EMACS_UINT) (((a) & VALMASK) | DATA_SEG_BITS))
+#else
#define XPNTR(a) ((EMACS_UINT) ((a) & VALMASK))
+#endif
#endif /* not USE_LSB_TAG */
@@ -482,6 +488,14 @@ enum pvec_type
# define XSET(var, vartype, ptr) \
(((var).s.val = ((EMACS_INT) (ptr))), ((var).s.type = ((char) (vartype))))
+#ifdef DATA_SEG_BITS
+/* DATA_SEG_BITS forces extra bits to be or'd in with any pointers
+ which were stored in a Lisp_Object */
+#define XPNTR(a) (XUINT (a) | DATA_SEG_BITS)
+#else
+#define XPNTR(a) ((EMACS_INT) XUINT (a))
+#endif
+
#endif /* !USE_LSB_TAG */
#if __GNUC__ >= 2 && defined (__OPTIMIZE__)
@@ -503,23 +517,6 @@ extern Lisp_Object make_number (EMACS_INT);
#define EQ(x, y) (XHASH (x) == XHASH (y))
-#ifndef XPNTR
-#ifdef DATA_SEG_BITS
-/* This case is used for the rt-pc.
- In the diffs I was given, it checked for ptr = 0
- and did not adjust it in that case.
- But I don't think that zero should ever be found
- in a Lisp object whose data type says it points to something. */
-#define XPNTR(a) (XUINT (a) | DATA_SEG_BITS)
-#else
-/* Some versions of gcc seem to consider the bitfield width when
- issuing the "cast to pointer from integer of different size"
- warning, so the cast is here to widen the value back to its natural
- size. */
-#define XPNTR(a) ((EMACS_INT) XUINT (a))
-#endif
-#endif /* no XPNTR */
-
/* Largest and smallest representable fixnum values. These are the C
values. */
diff --git a/src/xdisp.c b/src/xdisp.c
index 4d0ff88f9a3..09a3cae5754 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -3173,6 +3173,8 @@ handle_fontified_prop (struct it *it)
val = Vfontification_functions;
specbind (Qfontification_functions, Qnil);
+ xassert (it->end_charpos == ZV);
+
if (!CONSP (val) || EQ (XCAR (val), Qlambda))
safe_call1 (val, pos);
else
@@ -3212,6 +3214,13 @@ handle_fontified_prop (struct it *it)
unbind_to (count, Qnil);
+ /* The fontification code may have added/removed text.
+ It could do even a lot worse, but let's at least protect against
+ the most obvious case where only the text past `pos' gets changed',
+ as is/was done in grep.el where some escapes sequences are turned
+ into face properties (bug#7876). */
+ it->end_charpos = ZV;
+
/* Return HANDLED_RECOMPUTE_PROPS only if function fontified
something. This avoids an endless loop if they failed to
fontify the text for which reason ever. */