diff options
| author | Paul Eggert | 2011-04-13 17:44:47 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-04-13 17:44:47 -0700 |
| commit | 77382fcc33809a84866968ed3f969ea65ea4f1f7 (patch) | |
| tree | 9351a65a22f7e58721843cfcd318c4e99dd2df14 /src | |
| parent | 9306c32edb973b6c85ab32437332c18288528830 (diff) | |
| download | emacs-77382fcc33809a84866968ed3f969ea65ea4f1f7.tar.gz emacs-77382fcc33809a84866968ed3f969ea65ea4f1f7.zip | |
* insdel.c: Make symbols static if they're not exported.
However, leave prepare_to_modify_buffer alone. It's never
called from outside this function, but that appears to be a bug.
(combine_after_change_list, combine_after_change_buffer):
(adjust_after_replace): Now static.
(adjust_after_replace_noundo): Remove; unused.
* lisp.h (adjust_after_replace, adjust_after_replace_noundo):
Remove decls.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 9 | ||||
| -rw-r--r-- | src/insdel.c | 58 | ||||
| -rw-r--r-- | src/lisp.h | 4 |
3 files changed, 12 insertions, 59 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index c11fd18714e..c87dfb5056e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,14 @@ | |||
| 1 | 2011-04-13 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-04-13 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | * insdel.c: Make symbols static if they're not exported. | ||
| 4 | However, leave prepare_to_modify_buffer alone. It's never | ||
| 5 | called from outside this function, but that appears to be a bug. | ||
| 6 | (combine_after_change_list, combine_after_change_buffer): | ||
| 7 | (adjust_after_replace): Now static. | ||
| 8 | (adjust_after_replace_noundo): Remove; unused. | ||
| 9 | * lisp.h (adjust_after_replace, adjust_after_replace_noundo): | ||
| 10 | Remove decls. | ||
| 11 | |||
| 3 | * indent.c (val_compute_motion, val_vmotion): Now static. | 12 | * indent.c (val_compute_motion, val_vmotion): Now static. |
| 4 | 13 | ||
| 5 | * image.c: Make symbols static if they're not exported. | 14 | * image.c: Make symbols static if they're not exported. |
diff --git a/src/insdel.c b/src/insdel.c index dd7e3c14335..4bc25025a2f 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -60,10 +60,10 @@ INFUN (Fcombine_after_change_execute, 0); | |||
| 60 | END-UNCHANGED is the number of chars after the changed range, | 60 | END-UNCHANGED is the number of chars after the changed range, |
| 61 | and CHANGE-AMOUNT is the number of characters inserted by the change | 61 | and CHANGE-AMOUNT is the number of characters inserted by the change |
| 62 | (negative for a deletion). */ | 62 | (negative for a deletion). */ |
| 63 | Lisp_Object combine_after_change_list; | 63 | static Lisp_Object combine_after_change_list; |
| 64 | 64 | ||
| 65 | /* Buffer which combine_after_change_list is about. */ | 65 | /* Buffer which combine_after_change_list is about. */ |
| 66 | Lisp_Object combine_after_change_buffer; | 66 | static Lisp_Object combine_after_change_buffer; |
| 67 | 67 | ||
| 68 | Lisp_Object Qinhibit_modification_hooks; | 68 | Lisp_Object Qinhibit_modification_hooks; |
| 69 | 69 | ||
| @@ -1222,7 +1222,7 @@ insert_from_buffer_1 (struct buffer *buf, | |||
| 1222 | 1222 | ||
| 1223 | PREV_TEXT nil means the new text was just inserted. */ | 1223 | PREV_TEXT nil means the new text was just inserted. */ |
| 1224 | 1224 | ||
| 1225 | void | 1225 | static void |
| 1226 | adjust_after_replace (EMACS_INT from, EMACS_INT from_byte, | 1226 | adjust_after_replace (EMACS_INT from, EMACS_INT from_byte, |
| 1227 | Lisp_Object prev_text, EMACS_INT len, EMACS_INT len_byte) | 1227 | Lisp_Object prev_text, EMACS_INT len, EMACS_INT len_byte) |
| 1228 | { | 1228 | { |
| @@ -1285,58 +1285,6 @@ adjust_after_replace (EMACS_INT from, EMACS_INT from_byte, | |||
| 1285 | CHARS_MODIFF = MODIFF; | 1285 | CHARS_MODIFF = MODIFF; |
| 1286 | } | 1286 | } |
| 1287 | 1287 | ||
| 1288 | /* Like adjust_after_replace, but doesn't require PREV_TEXT. | ||
| 1289 | This is for use when undo is not enabled in the current buffer. */ | ||
| 1290 | |||
| 1291 | void | ||
| 1292 | adjust_after_replace_noundo (EMACS_INT from, EMACS_INT from_byte, | ||
| 1293 | EMACS_INT nchars_del, EMACS_INT nbytes_del, | ||
| 1294 | EMACS_INT len, EMACS_INT len_byte) | ||
| 1295 | { | ||
| 1296 | #ifdef BYTE_COMBINING_DEBUG | ||
| 1297 | if (count_combining_before (GPT_ADDR, len_byte, from, from_byte) | ||
| 1298 | || count_combining_after (GPT_ADDR, len_byte, from, from_byte)) | ||
| 1299 | abort (); | ||
| 1300 | #endif | ||
| 1301 | |||
| 1302 | /* Update various buffer positions for the new text. */ | ||
| 1303 | GAP_SIZE -= len_byte; | ||
| 1304 | ZV += len; Z+= len; | ||
| 1305 | ZV_BYTE += len_byte; Z_BYTE += len_byte; | ||
| 1306 | GPT += len; GPT_BYTE += len_byte; | ||
| 1307 | if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ | ||
| 1308 | |||
| 1309 | if (nchars_del > 0) | ||
| 1310 | adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del, | ||
| 1311 | len, len_byte); | ||
| 1312 | else | ||
| 1313 | adjust_markers_for_insert (from, from_byte, | ||
| 1314 | from + len, from_byte + len_byte, 0); | ||
| 1315 | |||
| 1316 | if (len > nchars_del) | ||
| 1317 | adjust_overlays_for_insert (from, len - nchars_del); | ||
| 1318 | else if (len < nchars_del) | ||
| 1319 | adjust_overlays_for_delete (from, nchars_del - len); | ||
| 1320 | if (BUF_INTERVALS (current_buffer) != 0) | ||
| 1321 | { | ||
| 1322 | offset_intervals (current_buffer, from, len - nchars_del); | ||
| 1323 | } | ||
| 1324 | |||
| 1325 | if (from < PT) | ||
| 1326 | adjust_point (len - nchars_del, len_byte - nbytes_del); | ||
| 1327 | |||
| 1328 | /* As byte combining will decrease Z, we must check this again. */ | ||
| 1329 | if (Z - GPT < END_UNCHANGED) | ||
| 1330 | END_UNCHANGED = Z - GPT; | ||
| 1331 | |||
| 1332 | CHECK_MARKERS (); | ||
| 1333 | |||
| 1334 | if (len == 0) | ||
| 1335 | evaporate_overlays (from); | ||
| 1336 | MODIFF++; | ||
| 1337 | CHARS_MODIFF = MODIFF; | ||
| 1338 | } | ||
| 1339 | |||
| 1340 | /* Record undo information, adjust markers and position keepers for an | 1288 | /* Record undo information, adjust markers and position keepers for an |
| 1341 | insertion of a text from FROM (FROM_BYTE) to TO (TO_BYTE). The | 1289 | insertion of a text from FROM (FROM_BYTE) to TO (TO_BYTE). The |
| 1342 | text already exists in the current buffer but character length (TO | 1290 | text already exists in the current buffer but character length (TO |
diff --git a/src/lisp.h b/src/lisp.h index 4f254002296..e25ae89dfaa 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2570,10 +2570,6 @@ extern void modify_region (struct buffer *, EMACS_INT, EMACS_INT, int); | |||
| 2570 | extern void prepare_to_modify_buffer (EMACS_INT, EMACS_INT, EMACS_INT *); | 2570 | extern void prepare_to_modify_buffer (EMACS_INT, EMACS_INT, EMACS_INT *); |
| 2571 | extern void signal_before_change (EMACS_INT, EMACS_INT, EMACS_INT *); | 2571 | extern void signal_before_change (EMACS_INT, EMACS_INT, EMACS_INT *); |
| 2572 | extern void signal_after_change (EMACS_INT, EMACS_INT, EMACS_INT); | 2572 | extern void signal_after_change (EMACS_INT, EMACS_INT, EMACS_INT); |
| 2573 | extern void adjust_after_replace (EMACS_INT, EMACS_INT, Lisp_Object, | ||
| 2574 | EMACS_INT, EMACS_INT); | ||
| 2575 | extern void adjust_after_replace_noundo (EMACS_INT, EMACS_INT, EMACS_INT, | ||
| 2576 | EMACS_INT, EMACS_INT, EMACS_INT); | ||
| 2577 | extern void adjust_after_insert (EMACS_INT, EMACS_INT, EMACS_INT, | 2573 | extern void adjust_after_insert (EMACS_INT, EMACS_INT, EMACS_INT, |
| 2578 | EMACS_INT, EMACS_INT); | 2574 | EMACS_INT, EMACS_INT); |
| 2579 | extern void adjust_markers_for_delete (EMACS_INT, EMACS_INT, | 2575 | extern void adjust_markers_for_delete (EMACS_INT, EMACS_INT, |