aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1995-04-09 09:42:28 +0000
committerRichard M. Stallman1995-04-09 09:42:28 +0000
commit5eabb4e7ee36930c22b209065f8256f817de6061 (patch)
tree0a861ff6f9391d8ae4a4ffc63e69e5b0bc9841eb /src
parent8c7457442dbfacd98146eb30b26cc0a2ab4266e9 (diff)
downloademacs-5eabb4e7ee36930c22b209065f8256f817de6061.tar.gz
emacs-5eabb4e7ee36930c22b209065f8256f817de6061.zip
(set_point): When skipping intangible text,
stop where property value changes.
Diffstat (limited to 'src')
-rw-r--r--src/intervals.c46
1 files changed, 27 insertions, 19 deletions
diff --git a/src/intervals.c b/src/intervals.c
index 80b7333491c..26fcfd9e701 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -1644,20 +1644,24 @@ set_point (position, buffer)
1644 return; 1644 return;
1645 } 1645 }
1646 1646
1647 /* If the new position is between two intangible characters, 1647 /* If the new position is between two intangible characters
1648 move forward or backward across all such characters. */ 1648 with the same intangible property value,
1649 move forward or backward until a change in that property. */
1649 if (NILP (Vinhibit_point_motion_hooks) && ! NULL_INTERVAL_P (to) 1650 if (NILP (Vinhibit_point_motion_hooks) && ! NULL_INTERVAL_P (to)
1650 && ! NULL_INTERVAL_P (toprev)) 1651 && ! NULL_INTERVAL_P (toprev))
1651 { 1652 {
1652 if (backwards) 1653 if (backwards)
1653 { 1654 {
1654 /* Make sure the following character is intangible 1655 Lisp_Object intangible_propval;
1655 if the previous one is. */ 1656 intangible_propval = textget (to->plist, Qintangible);
1656 if (toprev == to 1657
1657 || ! NILP (textget (to->plist, Qintangible))) 1658 /* If following char is intangible,
1658 /* Ok, that is so. Back up across intangible text. */ 1659 skip back over all chars with matching intangible property. */
1659 while (! NULL_INTERVAL_P (toprev) 1660 if (! NILP (intangible_propval))
1660 && ! NILP (textget (toprev->plist, Qintangible))) 1661 while (to == toprev
1662 || ((! NULL_INTERVAL_P (toprev)
1663 && EQ (textget (toprev->plist, Qintangible),
1664 intangible_propval))))
1661 { 1665 {
1662 to = toprev; 1666 to = toprev;
1663 toprev = previous_interval (toprev); 1667 toprev = previous_interval (toprev);
@@ -1673,13 +1677,16 @@ set_point (position, buffer)
1673 } 1677 }
1674 else 1678 else
1675 { 1679 {
1676 /* Make sure the previous character is intangible 1680 Lisp_Object intangible_propval;
1677 if the following one is. */ 1681 intangible_propval = textget (toprev->plist, Qintangible);
1678 if (toprev == to 1682
1679 || ! NILP (textget (toprev->plist, Qintangible))) 1683 /* If previous char is intangible,
1680 /* Ok, that is so. Advance across intangible text. */ 1684 skip fwd over all chars with matching intangible property. */
1681 while (! NULL_INTERVAL_P (to) 1685 if (! NILP (intangible_propval))
1682 && ! NILP (textget (to->plist, Qintangible))) 1686 while (to == toprev
1687 || ((! NULL_INTERVAL_P (to)
1688 && EQ (textget (to->plist, Qintangible),
1689 intangible_propval))))
1683 { 1690 {
1684 toprev = to; 1691 toprev = to;
1685 to = next_interval (to); 1692 to = next_interval (to);
@@ -1689,11 +1696,12 @@ set_point (position, buffer)
1689 position = to->position; 1696 position = to->position;
1690 } 1697 }
1691 } 1698 }
1692 /* Here TO is the interval after the stopping point
1693 and TOPREV is the interval before the stopping point.
1694 One or the other may be null. */
1695 } 1699 }
1696 1700
1701 /* Here TO is the interval after the stopping point
1702 and TOPREV is the interval before the stopping point.
1703 One or the other may be null. */
1704
1697 BUF_PT (buffer) = position; 1705 BUF_PT (buffer) = position;
1698 1706
1699 /* We run point-left and point-entered hooks here, iff the 1707 /* We run point-left and point-entered hooks here, iff the