Mercurial > emacs
comparison src/keyboard.c @ 49408:7e6cf4411cd4
(adjust_point_for_property): New second arg MODIFIED.
It it is nonzero, don't pretend that an invisible area doesn't
exist.
(command_loop_1): Call adjust_point_for_property with proper
second arg.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Fri, 24 Jan 2003 02:31:07 +0000 |
parents | 2cbb0b823e83 |
children | 99be3a1e2589 |
comparison
equal
deleted
inserted
replaced
49407:c47a7a3493da | 49408:7e6cf4411cd4 |
---|---|
1333 sans error-handling encapsulation. */ | 1333 sans error-handling encapsulation. */ |
1334 | 1334 |
1335 static int read_key_sequence P_ ((Lisp_Object *, int, Lisp_Object, | 1335 static int read_key_sequence P_ ((Lisp_Object *, int, Lisp_Object, |
1336 int, int, int)); | 1336 int, int, int)); |
1337 void safe_run_hooks P_ ((Lisp_Object)); | 1337 void safe_run_hooks P_ ((Lisp_Object)); |
1338 static void adjust_point_for_property P_ ((int)); | 1338 static void adjust_point_for_property P_ ((int, int)); |
1339 | 1339 |
1340 Lisp_Object | 1340 Lisp_Object |
1341 command_loop_1 () | 1341 command_loop_1 () |
1342 { | 1342 { |
1343 Lisp_Object cmd; | 1343 Lisp_Object cmd; |
1585 SET_PT (PT + 1); | 1585 SET_PT (PT + 1); |
1586 if (! NILP (Vpost_command_hook)) | 1586 if (! NILP (Vpost_command_hook)) |
1587 /* Put this before calling adjust_point_for_property | 1587 /* Put this before calling adjust_point_for_property |
1588 so it will only get called once in any case. */ | 1588 so it will only get called once in any case. */ |
1589 goto directly_done; | 1589 goto directly_done; |
1590 adjust_point_for_property (last_point_position); | 1590 adjust_point_for_property (last_point_position, 0); |
1591 already_adjusted = 1; | 1591 already_adjusted = 1; |
1592 if (PT == last_point_position + 1 | 1592 if (PT == last_point_position + 1 |
1593 && (dp | 1593 && (dp |
1594 ? (VECTORP (DISP_CHAR_VECTOR (dp, lose)) | 1594 ? (VECTORP (DISP_CHAR_VECTOR (dp, lose)) |
1595 ? XVECTOR (DISP_CHAR_VECTOR (dp, lose))->size == 1 | 1595 ? XVECTOR (DISP_CHAR_VECTOR (dp, lose))->size == 1 |
1619 = window_display_table (XWINDOW (selected_window)); | 1619 = window_display_table (XWINDOW (selected_window)); |
1620 SET_PT (PT - 1); | 1620 SET_PT (PT - 1); |
1621 lose = FETCH_CHAR (PT_BYTE); | 1621 lose = FETCH_CHAR (PT_BYTE); |
1622 if (! NILP (Vpost_command_hook)) | 1622 if (! NILP (Vpost_command_hook)) |
1623 goto directly_done; | 1623 goto directly_done; |
1624 adjust_point_for_property (last_point_position); | 1624 adjust_point_for_property (last_point_position, 0); |
1625 already_adjusted = 1; | 1625 already_adjusted = 1; |
1626 if (PT == last_point_position - 1 | 1626 if (PT == last_point_position - 1 |
1627 && (dp | 1627 && (dp |
1628 ? (VECTORP (DISP_CHAR_VECTOR (dp, lose)) | 1628 ? (VECTORP (DISP_CHAR_VECTOR (dp, lose)) |
1629 ? XVECTOR (DISP_CHAR_VECTOR (dp, lose))->size == 1 | 1629 ? XVECTOR (DISP_CHAR_VECTOR (dp, lose))->size == 1 |
1789 if (current_buffer == prev_buffer | 1789 if (current_buffer == prev_buffer |
1790 && last_point_position != PT | 1790 && last_point_position != PT |
1791 && NILP (Vdisable_point_adjustment) | 1791 && NILP (Vdisable_point_adjustment) |
1792 && NILP (Vglobal_disable_point_adjustment) | 1792 && NILP (Vglobal_disable_point_adjustment) |
1793 && !already_adjusted) | 1793 && !already_adjusted) |
1794 adjust_point_for_property (last_point_position); | 1794 adjust_point_for_property (last_point_position, MODIFF != prev_modiff); |
1795 | 1795 |
1796 /* Install chars successfully executed in kbd macro. */ | 1796 /* Install chars successfully executed in kbd macro. */ |
1797 | 1797 |
1798 if (!NILP (current_kboard->defining_kbd_macro) | 1798 if (!NILP (current_kboard->defining_kbd_macro) |
1799 && NILP (current_kboard->Vprefix_arg)) | 1799 && NILP (current_kboard->Vprefix_arg)) |
1815 | 1815 |
1816 extern Lisp_Object Qafter_string, Qbefore_string; | 1816 extern Lisp_Object Qafter_string, Qbefore_string; |
1817 extern Lisp_Object get_pos_property P_ ((Lisp_Object, Lisp_Object, Lisp_Object)); | 1817 extern Lisp_Object get_pos_property P_ ((Lisp_Object, Lisp_Object, Lisp_Object)); |
1818 | 1818 |
1819 static void | 1819 static void |
1820 adjust_point_for_property (last_pt) | 1820 adjust_point_for_property (last_pt, modified) |
1821 int last_pt; | 1821 int last_pt; |
1822 int modified; | |
1822 { | 1823 { |
1823 int beg, end; | 1824 int beg, end; |
1824 Lisp_Object val, overlay, tmp; | 1825 Lisp_Object val, overlay, tmp; |
1825 int check_composition = 1, check_display = 1, check_invisible = 1; | 1826 int check_composition = 1, check_display = 1, check_invisible = 1; |
1826 | 1827 |
1892 { | 1893 { |
1893 SET_PT (PT < last_pt ? beg : end); | 1894 SET_PT (PT < last_pt ? beg : end); |
1894 check_composition = check_display = 1; | 1895 check_composition = check_display = 1; |
1895 } | 1896 } |
1896 xassert (PT == beg || PT == end); | 1897 xassert (PT == beg || PT == end); |
1897 /* Pretend the area doesn't exist. */ | 1898 /* Pretend the area doesn't exist if the buffer is not |
1898 if (!ellipsis && beg < end) | 1899 modified. */ |
1900 if (!modified && !ellipsis && beg < end) | |
1899 { | 1901 { |
1900 if (last_pt == beg && PT == end && end < ZV) | 1902 if (last_pt == beg && PT == end && end < ZV) |
1901 (check_composition = check_display = 1, SET_PT (end + 1)); | 1903 (check_composition = check_display = 1, SET_PT (end + 1)); |
1902 else if (last_pt == end && PT == beg && beg > BEGV) | 1904 else if (last_pt == end && PT == beg && beg > BEGV) |
1903 (check_composition = check_display = 1, SET_PT (beg - 1)); | 1905 (check_composition = check_display = 1, SET_PT (beg - 1)); |