diff options
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/keyboard.c | 62 |
2 files changed, 51 insertions, 21 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 4feabdd5d7b..7f5015125d6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2002-11-03 Stefan Monnier <monnier@cs.yale.edu> | ||
| 2 | |||
| 3 | * keyboard.c (adjust_point_for_property): Handle `display' prop on | ||
| 4 | overlays. Also handle `invisible' prop. | ||
| 5 | |||
| 6 | 2002-11-02 Stefan Monnier <monnier@cs.yale.edu> | ||
| 7 | |||
| 8 | * coding.c (decode_coding_emacs_mule, decode_coding_iso2022) | ||
| 9 | (decode_coding_sjis_big5, decode_eol): Allow lone \r in DOS EOL. | ||
| 10 | |||
| 1 | 2002-11-01 Andreas Schwab <schwab@suse.de> | 11 | 2002-11-01 Andreas Schwab <schwab@suse.de> |
| 2 | 12 | ||
| 3 | * editfns.c (Fmessage): Revert last change to properly handle %% | 13 | * editfns.c (Fmessage): Revert last change to properly handle %% |
diff --git a/src/keyboard.c b/src/keyboard.c index 726f8354156..c0afb84c3c4 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1785,47 +1785,67 @@ extern Lisp_Object Qcomposition, Qdisplay; | |||
| 1785 | 1785 | ||
| 1786 | /* Adjust point to a boundary of a region that has such a property | 1786 | /* Adjust point to a boundary of a region that has such a property |
| 1787 | that should be treated intangible. For the moment, we check | 1787 | that should be treated intangible. For the moment, we check |
| 1788 | `composition' and `display' property. LAST_PT is the last position | 1788 | `composition', `display' and `invisible' properties. |
| 1789 | of point. */ | 1789 | LAST_PT is the last position of point. */ |
| 1790 | 1790 | ||
| 1791 | static void | 1791 | static void |
| 1792 | adjust_point_for_property (last_pt) | 1792 | adjust_point_for_property (last_pt) |
| 1793 | int last_pt; | 1793 | int last_pt; |
| 1794 | { | 1794 | { |
| 1795 | int start, end; | 1795 | int beg, end; |
| 1796 | Lisp_Object val; | 1796 | Lisp_Object val, overlay, tmp; |
| 1797 | int check_composition = 1, check_display = 1; | 1797 | int check_composition = 1, check_display = 1, check_invisible = 1; |
| 1798 | 1798 | ||
| 1799 | while (check_composition || check_display) | 1799 | while (check_composition || check_display || check_invisible) |
| 1800 | { | 1800 | { |
| 1801 | if (check_composition | 1801 | if (check_composition |
| 1802 | && PT > BEGV && PT < ZV | 1802 | && PT > BEGV && PT < ZV |
| 1803 | && get_property_and_range (PT, Qcomposition, &val, &start, &end, Qnil) | 1803 | && get_property_and_range (PT, Qcomposition, &val, &beg, &end, Qnil) |
| 1804 | && COMPOSITION_VALID_P (start, end, val) | 1804 | && COMPOSITION_VALID_P (beg, end, val) |
| 1805 | && start < PT && end > PT | 1805 | && beg < PT /* && end > PT <- It's always the case. */ |
| 1806 | && (last_pt <= start || last_pt >= end)) | 1806 | && (last_pt <= beg || last_pt >= end)) |
| 1807 | { | 1807 | { |
| 1808 | if (PT < last_pt) | 1808 | SET_PT (PT < last_pt ? beg : end); |
| 1809 | SET_PT (start); | ||
| 1810 | else | ||
| 1811 | SET_PT (end); | ||
| 1812 | check_display = 1; | 1809 | check_display = 1; |
| 1810 | check_invisible = 1; | ||
| 1813 | } | 1811 | } |
| 1814 | check_composition = 0; | 1812 | check_composition = 0; |
| 1815 | if (check_display | 1813 | if (check_display |
| 1816 | && PT > BEGV && PT < ZV | 1814 | && PT > BEGV && PT < ZV |
| 1817 | && get_property_and_range (PT, Qdisplay, &val, &start, &end, Qnil) | 1815 | && !NILP (val = get_char_property_and_overlay |
| 1816 | (make_number (PT), Qdisplay, Qnil, &overlay)) | ||
| 1818 | && display_prop_intangible_p (val) | 1817 | && display_prop_intangible_p (val) |
| 1819 | && start < PT && end > PT | 1818 | && (!OVERLAYP (overlay) |
| 1820 | && (last_pt <= start || last_pt >= end)) | 1819 | ? get_property_and_range (PT, Qdisplay, &val, &beg, &end, Qnil) |
| 1820 | : (beg = OVERLAY_POSITION (OVERLAY_START (overlay)), | ||
| 1821 | end = OVERLAY_POSITION (OVERLAY_END (overlay)))) | ||
| 1822 | && beg < PT /* && end > PT <- It's always the case. */ | ||
| 1823 | && (last_pt <= beg || last_pt >= end)) | ||
| 1821 | { | 1824 | { |
| 1822 | if (PT < last_pt) | 1825 | SET_PT (PT < last_pt ? beg : end); |
| 1823 | SET_PT (start); | ||
| 1824 | else | ||
| 1825 | SET_PT (end); | ||
| 1826 | check_composition = 1; | 1826 | check_composition = 1; |
| 1827 | check_invisible = 1; | ||
| 1827 | } | 1828 | } |
| 1828 | check_display = 0; | 1829 | check_display = 0; |
| 1830 | if (check_invisible | ||
| 1831 | && PT > BEGV && PT < ZV | ||
| 1832 | && !NILP (val = get_char_property_and_overlay | ||
| 1833 | (make_number (PT), Qinvisible, Qnil, &overlay)) | ||
| 1834 | && TEXT_PROP_MEANS_INVISIBLE (val) | ||
| 1835 | && (tmp = Fprevious_single_char_property_change | ||
| 1836 | (make_number (PT + 1), Qinvisible, Qnil, Qnil), | ||
| 1837 | beg = NILP (tmp) ? BEGV : XFASTINT (tmp), | ||
| 1838 | beg < PT) | ||
| 1839 | && (tmp = Fnext_single_char_property_change | ||
| 1840 | (make_number (PT), Qinvisible, Qnil, Qnil), | ||
| 1841 | end = NILP (tmp) ? BEGV : XFASTINT (tmp), | ||
| 1842 | (last_pt <= beg || last_pt >= end))) | ||
| 1843 | { | ||
| 1844 | SET_PT (PT < last_pt ? beg : end); | ||
| 1845 | check_composition = 1; | ||
| 1846 | check_display = 1; | ||
| 1847 | } | ||
| 1848 | check_invisible = 0; | ||
| 1829 | } | 1849 | } |
| 1830 | } | 1850 | } |
| 1831 | 1851 | ||