aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-09-24 09:13:57 +0000
committerRichard M. Stallman1994-09-24 09:13:57 +0000
commitd5219de56e8011472e2a09eb86870138990c271f (patch)
tree6a7d38dd5463232fa8e2cbe1435836dec9fc5732 /src
parent33d7d0df7335a043b77c92c73bc81eb20e9769d9 (diff)
downloademacs-d5219de56e8011472e2a09eb86870138990c271f.tar.gz
emacs-d5219de56e8011472e2a09eb86870138990c271f.zip
(set_point): If Vinhibit_point_motion_hooks, ignore intangible properties.
If move backwards into intangible text, move back over it.
Diffstat (limited to 'src')
-rw-r--r--src/intervals.c55
1 files changed, 46 insertions, 9 deletions
diff --git a/src/intervals.c b/src/intervals.c
index 63d76791440..8386eaded5a 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -1651,17 +1651,54 @@ set_point (position, buffer)
1651 return; 1651 return;
1652 } 1652 }
1653 1653
1654 /* If the new position is before an intangible character, 1654 /* If the new position is between two intangible characters,
1655 move forward over all such. */ 1655 move forward or backward across all such characters. */
1656 while (! NULL_INTERVAL_P (to) 1656 if (NILP (Vinhibit_point_motion_hooks) && ! NULL_INTERVAL_P (to)
1657 && ! NILP (textget (to->plist, Qintangible))) 1657 && ! NULL_INTERVAL_P (toprev))
1658 { 1658 {
1659 toprev = to; 1659 if (backwards)
1660 to = next_interval (to); 1660 {
1661 if (NULL_INTERVAL_P (to)) 1661 /* Make sure the following character is intangible
1662 position = BUF_ZV (buffer); 1662 if the previous one is. */
1663 if (toprev == to
1664 || ! NILP (textget (to->plist, Qintangible)))
1665 /* Ok, that is so. Back up across intangible text. */
1666 while (! NULL_INTERVAL_P (toprev)
1667 && ! NILP (textget (toprev->plist, Qintangible)))
1668 {
1669 to = toprev;
1670 toprev = previous_interval (toprev);
1671 if (NULL_INTERVAL_P (toprev))
1672 position = BUF_BEGV (buffer);
1673 else
1674 /* This is the only line that's not
1675 dual to the following loop.
1676 That's because we want the position
1677 at the end of TOPREV. */
1678 position = to->position;
1679 }
1680 }
1663 else 1681 else
1664 position = to->position; 1682 {
1683 /* Make sure the previous character is intangible
1684 if the following one is. */
1685 if (toprev == to
1686 || ! NILP (textget (toprev->plist, Qintangible)))
1687 /* Ok, that is so. Advance across intangible text. */
1688 while (! NULL_INTERVAL_P (to)
1689 && ! NILP (textget (to->plist, Qintangible)))
1690 {
1691 toprev = to;
1692 to = next_interval (to);
1693 if (NULL_INTERVAL_P (to))
1694 position = BUF_ZV (buffer);
1695 else
1696 position = to->position;
1697 }
1698 }
1699 /* Here TO is the interval after the stopping point
1700 and TOPREV is the interval before the stopping point.
1701 One or the other may be null. */
1665 } 1702 }
1666 1703
1667 buffer->text.pt = position; 1704 buffer->text.pt = position;