Mercurial > emacs
comparison src/indent.c @ 23039:f4262c9a21dd
(vmotion): Don't use WINDOW for Fget_char_property
when it is not showing the right buffer.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 16 Aug 1998 02:10:56 +0000 |
parents | ce6e85fd8036 |
children | dcd6688d67be |
comparison
equal
deleted
inserted
replaced
23038:10ad03c5d326 | 23039:f4262c9a21dd |
---|---|
1639 ? XINT (current_buffer->selective_display) | 1639 ? XINT (current_buffer->selective_display) |
1640 : !NILP (current_buffer->selective_display) ? -1 : 0); | 1640 : !NILP (current_buffer->selective_display) ? -1 : 0); |
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 |
1647 /* The omission of the clause | 1649 /* The omission of the clause |
1648 && marker_position (w->start) == BEG | 1650 && marker_position (w->start) == BEG |
1654 minibuf_prompt_width | 1656 minibuf_prompt_width |
1655 = string_display_width (minibuf_prompt, Qnil, Qnil); | 1657 = string_display_width (minibuf_prompt, Qnil, Qnil); |
1656 | 1658 |
1657 start_hpos = minibuf_prompt_width; | 1659 start_hpos = minibuf_prompt_width; |
1658 } | 1660 } |
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 (); | |
1659 | 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 |
1663 we have gone at least far enough. */ | 1672 we have gone at least far enough. */ |
1676 selective)) | 1685 selective)) |
1677 #ifdef USE_TEXT_PROPERTIES | 1686 #ifdef USE_TEXT_PROPERTIES |
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 )) |
1685 XSETFASTINT (prevline, | 1694 XSETFASTINT (prevline, |
1686 find_next_newline_no_quit (XFASTINT (prevline) - 1, | 1695 find_next_newline_no_quit (XFASTINT (prevline) - 1, |
1738 CHAR_TO_BYTE (XFASTINT (prevline)), | 1747 CHAR_TO_BYTE (XFASTINT (prevline)), |
1739 selective)) | 1748 selective)) |
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 )) |
1747 XSETFASTINT (prevline, | 1756 XSETFASTINT (prevline, |
1748 find_next_newline_no_quit (XFASTINT (prevline) - 1, | 1757 find_next_newline_no_quit (XFASTINT (prevline) - 1, |