aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2008-02-12 21:25:45 +0000
committerStefan Monnier2008-02-12 21:25:45 +0000
commit7927d8e343943980361be2914d4dafd1be98a87c (patch)
tree98a8f3cf04dba2af0ba59edeb90bc2920491506f /src
parent9e5e233a2f9825aaf0055db72bcf900bc282d032 (diff)
downloademacs-7927d8e343943980361be2914d4dafd1be98a87c.tar.gz
emacs-7927d8e343943980361be2914d4dafd1be98a87c.zip
(casify_region): Only call after-change and composition
functions on the part of the region that was changed.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/casefiddle.c22
2 files changed, 15 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 0f47ead5f1f..85bbcbbdf87 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12008-02-12 Stefan Monnier <monnier@iro.umontreal.ca> 12008-02-12 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * casefiddle.c (casify_region): Only call after-change and composition
4 functions on the part of the region that was changed.
5
3 * keyboard.c (read_avail_input): 6 * keyboard.c (read_avail_input):
4 * frame.c (Fdelete_frame): Call Fdelete_terminal. 7 * frame.c (Fdelete_frame): Call Fdelete_terminal.
5 8
diff --git a/src/casefiddle.c b/src/casefiddle.c
index daaa7a228ba..650e046a266 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -179,11 +179,11 @@ casify_region (flag, b, e)
179 register int c; 179 register int c;
180 register int inword = flag == CASE_DOWN; 180 register int inword = flag == CASE_DOWN;
181 register int multibyte = !NILP (current_buffer->enable_multibyte_characters); 181 register int multibyte = !NILP (current_buffer->enable_multibyte_characters);
182 int start, end; 182 EMACS_INT start, end;
183 int start_byte, end_byte; 183 EMACS_INT start_byte, end_byte;
184 int changed = 0; 184 EMACS_INT first = -1, last; /* Position of first and last changes. */
185 int opoint = PT; 185 EMACS_INT opoint = PT;
186 int opoint_byte = PT_BYTE; 186 EMACS_INT opoint_byte = PT_BYTE;
187 187
188 if (EQ (b, e)) 188 if (EQ (b, e))
189 /* Not modifying because nothing marked */ 189 /* Not modifying because nothing marked */
@@ -226,7 +226,10 @@ casify_region (flag, b, e)
226 inword = ((SYNTAX (c) == Sword) && (inword || !SYNTAX_PREFIX (c))); 226 inword = ((SYNTAX (c) == Sword) && (inword || !SYNTAX_PREFIX (c)));
227 if (c != c2) 227 if (c != c2)
228 { 228 {
229 changed = 1; 229 last = start;
230 if (first < 0)
231 first = start;
232
230 if (! multibyte) 233 if (! multibyte)
231 { 234 {
232 MAKE_CHAR_UNIBYTE (c); 235 MAKE_CHAR_UNIBYTE (c);
@@ -266,11 +269,10 @@ casify_region (flag, b, e)
266 if (PT != opoint) 269 if (PT != opoint)
267 TEMP_SET_PT_BOTH (opoint, opoint_byte); 270 TEMP_SET_PT_BOTH (opoint, opoint_byte);
268 271
269 if (changed) 272 if (first >= 0)
270 { 273 {
271 start = XFASTINT (b); 274 signal_after_change (first, last + 1 - first, last + 1 - first);
272 signal_after_change (start, end - start, end - start); 275 update_compositions (first, last + 1, CHECK_ALL);
273 update_compositions (start, end, CHECK_ALL);
274 } 276 }
275} 277}
276 278