aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1998-08-16 02:10:56 +0000
committerRichard M. Stallman1998-08-16 02:10:56 +0000
commit7ac57cb36ccd467b870c518c1e3365bbff280353 (patch)
tree2f27af630ba9c08c0de527e45bda573689f16742 /src
parentebf8f7e14ac86abf7b946d755238045e8b136c36 (diff)
downloademacs-7ac57cb36ccd467b870c518c1e3365bbff280353.tar.gz
emacs-7ac57cb36ccd467b870c518c1e3365bbff280353.zip
(vmotion): Don't use WINDOW for Fget_char_property
when it is not showing the right buffer.
Diffstat (limited to 'src')
-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)
1641 Lisp_Object window; 1641 Lisp_Object window;
1642 int start_hpos = 0; 1642 int start_hpos = 0;
1643 int did_motion; 1643 int did_motion;
1644 /* This is the object we use for fetching character properties. */
1645 Lisp_Object text_prop_object;
1644 1646
1645 XSETWINDOW (window, w); 1647 XSETWINDOW (window, w);
1646 1648
@@ -1657,6 +1659,13 @@ vmotion (from, vtarget, w)
1657 start_hpos = minibuf_prompt_width; 1659 start_hpos = minibuf_prompt_width;
1658 } 1660 }
1659 1661
1662 /* If the window contains this buffer, use it for getting text properties.
1663 Otherwise use the current buffer as arg for doing that. */
1664 if (EQ (w->buffer, Fcurrent_buffer ()))
1665 text_prop_object = window;
1666 else
1667 text_prop_object = Fcurrent_buffer ();
1668
1660 if (vpos >= vtarget) 1669 if (vpos >= vtarget)
1661 { 1670 {
1662 /* To move upward, go a line at a time until 1671 /* To move upward, go a line at a time until
@@ -1678,7 +1687,7 @@ vmotion (from, vtarget, w)
1678 /* watch out for newlines with `invisible' property */ 1687 /* watch out for newlines with `invisible' property */
1679 || (propval = Fget_char_property (prevline, 1688 || (propval = Fget_char_property (prevline,
1680 Qinvisible, 1689 Qinvisible,
1681 window), 1690 text_prop_object),
1682 TEXT_PROP_MEANS_INVISIBLE (propval)) 1691 TEXT_PROP_MEANS_INVISIBLE (propval))
1683#endif 1692#endif
1684 )) 1693 ))
@@ -1740,7 +1749,7 @@ vmotion (from, vtarget, w)
1740#ifdef USE_TEXT_PROPERTIES 1749#ifdef USE_TEXT_PROPERTIES
1741 /* watch out for newlines with `invisible' property */ 1750 /* watch out for newlines with `invisible' property */
1742 || (propval = Fget_char_property (prevline, Qinvisible, 1751 || (propval = Fget_char_property (prevline, Qinvisible,
1743 window), 1752 text_prop_object),
1744 TEXT_PROP_MEANS_INVISIBLE (propval)) 1753 TEXT_PROP_MEANS_INVISIBLE (propval))
1745#endif 1754#endif
1746 )) 1755 ))