diff options
| author | Richard M. Stallman | 1993-07-31 21:58:45 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-07-31 21:58:45 +0000 |
| commit | d169fe39daaaba7d8e433404a75075384a3f44f8 (patch) | |
| tree | 06124ed02ffde20b43dc2ed8f7249a5b86e2c6ae | |
| parent | 7ce503fdda34ee029bb1862c71cb756db5cac791 (diff) | |
| download | emacs-d169fe39daaaba7d8e433404a75075384a3f44f8.tar.gz emacs-d169fe39daaaba7d8e433404a75075384a3f44f8.zip | |
(direct_output_for_insert): Fail if character
just inserted has text properties.
(direct_ouput_forward_char): Fail if moving near invisible chars.
| -rw-r--r-- | src/dispnew.c | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index 42f5e6edde0..db909505f05 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -36,6 +36,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 36 | #include "commands.h" | 36 | #include "commands.h" |
| 37 | #include "disptab.h" | 37 | #include "disptab.h" |
| 38 | #include "indent.h" | 38 | #include "indent.h" |
| 39 | #include "intervals.h" | ||
| 39 | 40 | ||
| 40 | #include "systty.h" | 41 | #include "systty.h" |
| 41 | #include "systime.h" | 42 | #include "systime.h" |
| @@ -872,6 +873,17 @@ direct_output_for_insert (g) | |||
| 872 | /* Give up if buffer appears in two places. */ | 873 | /* Give up if buffer appears in two places. */ |
| 873 | || buffer_shared > 1 | 874 | || buffer_shared > 1 |
| 874 | 875 | ||
| 876 | #ifdef USE_TEXT_PROPERTIES | ||
| 877 | /* Intervals have already been adjusted, point is after the | ||
| 878 | character that was just inserted. */ | ||
| 879 | /* Give up if character has is invisible. */ | ||
| 880 | /* Give up if character has a face property. | ||
| 881 | At the moment we only lose at end of line or end of buffer | ||
| 882 | and only with faces that have some background */ | ||
| 883 | /* Instead of wasting time, give up if character has any text properties */ | ||
| 884 | || ! NILP (Ftext_properties_at (XFASTINT (point - 1), Qnil)) | ||
| 885 | #endif | ||
| 886 | |||
| 875 | /* Give up if w is minibuffer and a message is being displayed there */ | 887 | /* Give up if w is minibuffer and a message is being displayed there */ |
| 876 | || (MINI_WINDOW_P (w) && echo_area_glyphs)) | 888 | || (MINI_WINDOW_P (w) && echo_area_glyphs)) |
| 877 | return 0; | 889 | return 0; |
| @@ -911,7 +923,8 @@ direct_output_forward_char (n) | |||
| 911 | { | 923 | { |
| 912 | register FRAME_PTR frame = selected_frame; | 924 | register FRAME_PTR frame = selected_frame; |
| 913 | register struct window *w = XWINDOW (selected_window); | 925 | register struct window *w = XWINDOW (selected_window); |
| 914 | 926 | int position; | |
| 927 | |||
| 915 | /* Avoid losing if cursor is in invisible text off left margin | 928 | /* Avoid losing if cursor is in invisible text off left margin |
| 916 | or about to go off either side of window. */ | 929 | or about to go off either side of window. */ |
| 917 | if ((FRAME_CURSOR_X (frame) == XFASTINT (w->left) | 930 | if ((FRAME_CURSOR_X (frame) == XFASTINT (w->left) |
| @@ -920,16 +933,34 @@ direct_output_forward_char (n) | |||
| 920 | && (FRAME_CURSOR_X (frame) + 1 >= window_internal_width (w) - 1)) | 933 | && (FRAME_CURSOR_X (frame) + 1 >= window_internal_width (w) - 1)) |
| 921 | || cursor_in_echo_area) | 934 | || cursor_in_echo_area) |
| 922 | return 0; | 935 | return 0; |
| 923 | 936 | ||
| 924 | /* Can't use direct output if highlighting a region. */ | 937 | /* Can't use direct output if highlighting a region. */ |
| 925 | if (!NILP (Vtransient_mark_mode) && !NILP (current_buffer->mark_active)) | 938 | if (!NILP (Vtransient_mark_mode) && !NILP (current_buffer->mark_active)) |
| 926 | return 0; | 939 | return 0; |
| 927 | 940 | ||
| 941 | #ifdef USE_TEXT_PROPERTIES | ||
| 942 | /* Don't use direct output next to an invisible character | ||
| 943 | since we might need to do something special. */ | ||
| 944 | |||
| 945 | XFASTINT (position) = point + n; | ||
| 946 | if (! NILP (Fget_text_property (position, | ||
| 947 | Qinvisible, | ||
| 948 | Fcurrent_buffer ()))) | ||
| 949 | return; | ||
| 950 | |||
| 951 | XFASTINT (position) = point + n - 1; | ||
| 952 | if (! NILP (Fget_text_property (position, | ||
| 953 | Qinvisible, | ||
| 954 | Fcurrent_buffer ()))) | ||
| 955 | return; | ||
| 956 | #endif | ||
| 957 | |||
| 928 | FRAME_CURSOR_X (frame) += n; | 958 | FRAME_CURSOR_X (frame) += n; |
| 929 | XFASTINT (w->last_point_x) = FRAME_CURSOR_X (frame); | 959 | XFASTINT (w->last_point_x) = FRAME_CURSOR_X (frame); |
| 930 | XFASTINT (w->last_point) = point; | 960 | XFASTINT (w->last_point) = point; |
| 931 | cursor_to (FRAME_CURSOR_Y (frame), FRAME_CURSOR_X (frame)); | 961 | cursor_to (FRAME_CURSOR_Y (frame), FRAME_CURSOR_X (frame)); |
| 932 | fflush (stdout); | 962 | fflush (stdout); |
| 963 | |||
| 933 | return 1; | 964 | return 1; |
| 934 | } | 965 | } |
| 935 | 966 | ||