summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-08-16 02:10:56 +0000
committerRichard M. Stallman <rms@gnu.org>1998-08-16 02:10:56 +0000
commit7ac57cb36ccd467b870c518c1e3365bbff280353 (patch)
tree2f27af630ba9c08c0de527e45bda573689f16742
parentebf8f7e14ac86abf7b946d755238045e8b136c36 (diff)
downloademacs-7ac57cb36ccd467b870c518c1e3365bbff280353.tar.gz
(vmotion): Don't use WINDOW for Fget_char_property
when it is not showing the right buffer.
-rw-r--r--src/indent.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/indent.c b/src/indent.c
index c739da725df..9ac2dd7315f 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1641,6 +1641,8 @@ vmotion (from, vtarget, w)
Lisp_Object window;
int start_hpos = 0;
int did_motion;
+ /* This is the object we use for fetching character properties. */
+ Lisp_Object text_prop_object;
XSETWINDOW (window, w);
@@ -1657,6 +1659,13 @@ vmotion (from, vtarget, w)
start_hpos = minibuf_prompt_width;
}
+ /* If the window contains this buffer, use it for getting text properties.
+ Otherwise use the current buffer as arg for doing that. */
+ if (EQ (w->buffer, Fcurrent_buffer ()))
+ text_prop_object = window;
+ else
+ text_prop_object = Fcurrent_buffer ();
+
if (vpos >= vtarget)
{
/* To move upward, go a line at a time until
@@ -1678,7 +1687,7 @@ vmotion (from, vtarget, w)
/* watch out for newlines with `invisible' property */
|| (propval = Fget_char_property (prevline,
Qinvisible,
- window),
+ text_prop_object),
TEXT_PROP_MEANS_INVISIBLE (propval))
#endif
))
@@ -1740,7 +1749,7 @@ vmotion (from, vtarget, w)
#ifdef USE_TEXT_PROPERTIES
/* watch out for newlines with `invisible' property */
|| (propval = Fget_char_property (prevline, Qinvisible,
- window),
+ text_prop_object),
TEXT_PROP_MEANS_INVISIBLE (propval))
#endif
))