diff options
Diffstat (limited to 'src/editfns.c')
| -rw-r--r-- | src/editfns.c | 89 |
1 files changed, 26 insertions, 63 deletions
diff --git a/src/editfns.c b/src/editfns.c index ac1d152ccdb..f318705d2cd 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -141,7 +141,7 @@ Lisp_Object Qboundary; | |||
| 141 | 141 | ||
| 142 | 142 | ||
| 143 | void | 143 | void |
| 144 | init_editfns () | 144 | init_editfns (void) |
| 145 | { | 145 | { |
| 146 | char *user_name; | 146 | char *user_name; |
| 147 | register unsigned char *p; | 147 | register unsigned char *p; |
| @@ -253,8 +253,7 @@ A multibyte character is handled correctly. */) | |||
| 253 | } | 253 | } |
| 254 | 254 | ||
| 255 | static Lisp_Object | 255 | static Lisp_Object |
| 256 | buildmark (charpos, bytepos) | 256 | buildmark (int charpos, int bytepos) |
| 257 | int charpos, bytepos; | ||
| 258 | { | 257 | { |
| 259 | register Lisp_Object mark; | 258 | register Lisp_Object mark; |
| 260 | mark = Fmake_marker (); | 259 | mark = Fmake_marker (); |
| @@ -280,8 +279,7 @@ DEFUN ("point-marker", Fpoint_marker, Spoint_marker, 0, 0, 0, | |||
| 280 | } | 279 | } |
| 281 | 280 | ||
| 282 | int | 281 | int |
| 283 | clip_to_bounds (lower, num, upper) | 282 | clip_to_bounds (int lower, int num, int upper) |
| 284 | int lower, num, upper; | ||
| 285 | { | 283 | { |
| 286 | if (num < lower) | 284 | if (num < lower) |
| 287 | return lower; | 285 | return lower; |
| @@ -328,8 +326,7 @@ The return value is POSITION. */) | |||
| 328 | If there is no region active, signal an error. */ | 326 | If there is no region active, signal an error. */ |
| 329 | 327 | ||
| 330 | static Lisp_Object | 328 | static Lisp_Object |
| 331 | region_limit (beginningp) | 329 | region_limit (int beginningp) |
| 332 | int beginningp; | ||
| 333 | { | 330 | { |
| 334 | extern Lisp_Object Vmark_even_if_inactive; /* Defined in callint.c. */ | 331 | extern Lisp_Object Vmark_even_if_inactive; /* Defined in callint.c. */ |
| 335 | Lisp_Object m; | 332 | Lisp_Object m; |
| @@ -377,10 +374,7 @@ If you set the marker not to point anywhere, the buffer will have no mark. */) | |||
| 377 | of length LEN. */ | 374 | of length LEN. */ |
| 378 | 375 | ||
| 379 | static int | 376 | static int |
| 380 | overlays_around (pos, vec, len) | 377 | overlays_around (int pos, Lisp_Object *vec, int len) |
| 381 | int pos; | ||
| 382 | Lisp_Object *vec; | ||
| 383 | int len; | ||
| 384 | { | 378 | { |
| 385 | Lisp_Object overlay, start, end; | 379 | Lisp_Object overlay, start, end; |
| 386 | struct Lisp_Overlay *tail; | 380 | struct Lisp_Overlay *tail; |
| @@ -436,9 +430,7 @@ overlays_around (pos, vec, len) | |||
| 436 | window-specific overlays are considered only if they are associated | 430 | window-specific overlays are considered only if they are associated |
| 437 | with OBJECT. */ | 431 | with OBJECT. */ |
| 438 | Lisp_Object | 432 | Lisp_Object |
| 439 | get_pos_property (position, prop, object) | 433 | get_pos_property (Lisp_Object position, register Lisp_Object prop, Lisp_Object object) |
| 440 | Lisp_Object position, object; | ||
| 441 | register Lisp_Object prop; | ||
| 442 | { | 434 | { |
| 443 | CHECK_NUMBER_COERCE_MARKER (position); | 435 | CHECK_NUMBER_COERCE_MARKER (position); |
| 444 | 436 | ||
| @@ -533,11 +525,7 @@ get_pos_property (position, prop, object) | |||
| 533 | is not stored. */ | 525 | is not stored. */ |
| 534 | 526 | ||
| 535 | static void | 527 | static void |
| 536 | find_field (pos, merge_at_boundary, beg_limit, beg, end_limit, end) | 528 | find_field (Lisp_Object pos, Lisp_Object merge_at_boundary, Lisp_Object beg_limit, int *beg, Lisp_Object end_limit, int *end) |
| 537 | Lisp_Object pos; | ||
| 538 | Lisp_Object merge_at_boundary; | ||
| 539 | Lisp_Object beg_limit, end_limit; | ||
| 540 | int *beg, *end; | ||
| 541 | { | 529 | { |
| 542 | /* Fields right before and after the point. */ | 530 | /* Fields right before and after the point. */ |
| 543 | Lisp_Object before_field, after_field; | 531 | Lisp_Object before_field, after_field; |
| @@ -900,7 +888,7 @@ This function does not move point. */) | |||
| 900 | 888 | ||
| 901 | 889 | ||
| 902 | Lisp_Object | 890 | Lisp_Object |
| 903 | save_excursion_save () | 891 | save_excursion_save (void) |
| 904 | { | 892 | { |
| 905 | int visible = (XBUFFER (XWINDOW (selected_window)->buffer) | 893 | int visible = (XBUFFER (XWINDOW (selected_window)->buffer) |
| 906 | == current_buffer); | 894 | == current_buffer); |
| @@ -913,8 +901,7 @@ save_excursion_save () | |||
| 913 | } | 901 | } |
| 914 | 902 | ||
| 915 | Lisp_Object | 903 | Lisp_Object |
| 916 | save_excursion_restore (info) | 904 | save_excursion_restore (Lisp_Object info) |
| 917 | Lisp_Object info; | ||
| 918 | { | 905 | { |
| 919 | Lisp_Object tem, tem1, omark, nmark; | 906 | Lisp_Object tem, tem1, omark, nmark; |
| 920 | struct gcpro gcpro1, gcpro2, gcpro3; | 907 | struct gcpro gcpro1, gcpro2, gcpro3; |
| @@ -1440,7 +1427,7 @@ DEFUN ("system-name", Fsystem_name, Ssystem_name, 0, 0, 0, | |||
| 1440 | /* For the benefit of callers who don't want to include lisp.h */ | 1427 | /* For the benefit of callers who don't want to include lisp.h */ |
| 1441 | 1428 | ||
| 1442 | char * | 1429 | char * |
| 1443 | get_system_name () | 1430 | get_system_name (void) |
| 1444 | { | 1431 | { |
| 1445 | if (STRINGP (Vsystem_name)) | 1432 | if (STRINGP (Vsystem_name)) |
| 1446 | return (char *) SDATA (Vsystem_name); | 1433 | return (char *) SDATA (Vsystem_name); |
| @@ -1449,7 +1436,7 @@ get_system_name () | |||
| 1449 | } | 1436 | } |
| 1450 | 1437 | ||
| 1451 | char * | 1438 | char * |
| 1452 | get_operating_system_release() | 1439 | get_operating_system_release(void) |
| 1453 | { | 1440 | { |
| 1454 | if (STRINGP (Voperating_system_release)) | 1441 | if (STRINGP (Voperating_system_release)) |
| 1455 | return (char *) SDATA (Voperating_system_release); | 1442 | return (char *) SDATA (Voperating_system_release); |
| @@ -1527,10 +1514,7 @@ on systems that do not provide resolution finer than a second. */) | |||
| 1527 | 1514 | ||
| 1528 | 1515 | ||
| 1529 | int | 1516 | int |
| 1530 | lisp_time_argument (specified_time, result, usec) | 1517 | lisp_time_argument (Lisp_Object specified_time, time_t *result, int *usec) |
| 1531 | Lisp_Object specified_time; | ||
| 1532 | time_t *result; | ||
| 1533 | int *usec; | ||
| 1534 | { | 1518 | { |
| 1535 | if (NILP (specified_time)) | 1519 | if (NILP (specified_time)) |
| 1536 | { | 1520 | { |
| @@ -1611,13 +1595,7 @@ or (if you need time as a string) `format-time-string'. */) | |||
| 1611 | This function behaves like emacs_strftimeu, except it allows null | 1595 | This function behaves like emacs_strftimeu, except it allows null |
| 1612 | bytes in FORMAT. */ | 1596 | bytes in FORMAT. */ |
| 1613 | static size_t | 1597 | static size_t |
| 1614 | emacs_memftimeu (s, maxsize, format, format_len, tp, ut) | 1598 | emacs_memftimeu (char *s, size_t maxsize, const char *format, size_t format_len, const struct tm *tp, int ut) |
| 1615 | char *s; | ||
| 1616 | size_t maxsize; | ||
| 1617 | const char *format; | ||
| 1618 | size_t format_len; | ||
| 1619 | const struct tm *tp; | ||
| 1620 | int ut; | ||
| 1621 | { | 1599 | { |
| 1622 | size_t total = 0; | 1600 | size_t total = 0; |
| 1623 | 1601 | ||
| @@ -1950,8 +1928,7 @@ but this is considered obsolete. */) | |||
| 1950 | /* Yield A - B, measured in seconds. | 1928 | /* Yield A - B, measured in seconds. |
| 1951 | This function is copied from the GNU C Library. */ | 1929 | This function is copied from the GNU C Library. */ |
| 1952 | static int | 1930 | static int |
| 1953 | tm_diff (a, b) | 1931 | tm_diff (struct tm *a, struct tm *b) |
| 1954 | struct tm *a, *b; | ||
| 1955 | { | 1932 | { |
| 1956 | /* Compute intervening leap days correctly even if year is negative. | 1933 | /* Compute intervening leap days correctly even if year is negative. |
| 1957 | Take care to avoid int overflow in leap day calculations, | 1934 | Take care to avoid int overflow in leap day calculations, |
| @@ -2098,8 +2075,7 @@ static char set_time_zone_rule_tz2[] = "TZ=GMT+1"; | |||
| 2098 | responsibility to free. */ | 2075 | responsibility to free. */ |
| 2099 | 2076 | ||
| 2100 | void | 2077 | void |
| 2101 | set_time_zone_rule (tzstring) | 2078 | set_time_zone_rule (char *tzstring) |
| 2102 | char *tzstring; | ||
| 2103 | { | 2079 | { |
| 2104 | int envptrs; | 2080 | int envptrs; |
| 2105 | char **from, **to, **newenv; | 2081 | char **from, **to, **newenv; |
| @@ -2221,8 +2197,7 @@ general_insert_function (void (*insert_func) | |||
| 2221 | } | 2197 | } |
| 2222 | 2198 | ||
| 2223 | void | 2199 | void |
| 2224 | insert1 (arg) | 2200 | insert1 (Lisp_Object arg) |
| 2225 | Lisp_Object arg; | ||
| 2226 | { | 2201 | { |
| 2227 | Finsert (1, &arg); | 2202 | Finsert (1, &arg); |
| 2228 | } | 2203 | } |
| @@ -2408,9 +2383,7 @@ from adjoining text, if those properties are sticky. */) | |||
| 2408 | buffer substrings. */ | 2383 | buffer substrings. */ |
| 2409 | 2384 | ||
| 2410 | Lisp_Object | 2385 | Lisp_Object |
| 2411 | make_buffer_string (start, end, props) | 2386 | make_buffer_string (int start, int end, int props) |
| 2412 | int start, end; | ||
| 2413 | int props; | ||
| 2414 | { | 2387 | { |
| 2415 | int start_byte = CHAR_TO_BYTE (start); | 2388 | int start_byte = CHAR_TO_BYTE (start); |
| 2416 | int end_byte = CHAR_TO_BYTE (end); | 2389 | int end_byte = CHAR_TO_BYTE (end); |
| @@ -2434,9 +2407,7 @@ make_buffer_string (start, end, props) | |||
| 2434 | buffer substrings. */ | 2407 | buffer substrings. */ |
| 2435 | 2408 | ||
| 2436 | Lisp_Object | 2409 | Lisp_Object |
| 2437 | make_buffer_string_both (start, start_byte, end, end_byte, props) | 2410 | make_buffer_string_both (int start, int start_byte, int end, int end_byte, int props) |
| 2438 | int start, start_byte, end, end_byte; | ||
| 2439 | int props; | ||
| 2440 | { | 2411 | { |
| 2441 | Lisp_Object result, tem, tem1; | 2412 | Lisp_Object result, tem, tem1; |
| 2442 | 2413 | ||
| @@ -2470,8 +2441,7 @@ make_buffer_string_both (start, start_byte, end, end_byte, props) | |||
| 2470 | in the current buffer, if necessary. */ | 2441 | in the current buffer, if necessary. */ |
| 2471 | 2442 | ||
| 2472 | static void | 2443 | static void |
| 2473 | update_buffer_properties (start, end) | 2444 | update_buffer_properties (int start, int end) |
| 2474 | int start, end; | ||
| 2475 | { | 2445 | { |
| 2476 | /* If this buffer has some access functions, | 2446 | /* If this buffer has some access functions, |
| 2477 | call them, specifying the range of the buffer being accessed. */ | 2447 | call them, specifying the range of the buffer being accessed. */ |
| @@ -2757,15 +2727,13 @@ determines whether case is significant or ignored. */) | |||
| 2757 | } | 2727 | } |
| 2758 | 2728 | ||
| 2759 | static Lisp_Object | 2729 | static Lisp_Object |
| 2760 | subst_char_in_region_unwind (arg) | 2730 | subst_char_in_region_unwind (Lisp_Object arg) |
| 2761 | Lisp_Object arg; | ||
| 2762 | { | 2731 | { |
| 2763 | return current_buffer->undo_list = arg; | 2732 | return current_buffer->undo_list = arg; |
| 2764 | } | 2733 | } |
| 2765 | 2734 | ||
| 2766 | static Lisp_Object | 2735 | static Lisp_Object |
| 2767 | subst_char_in_region_unwind_1 (arg) | 2736 | subst_char_in_region_unwind_1 (Lisp_Object arg) |
| 2768 | Lisp_Object arg; | ||
| 2769 | { | 2737 | { |
| 2770 | return current_buffer->filename = arg; | 2738 | return current_buffer->filename = arg; |
| 2771 | } | 2739 | } |
| @@ -2962,9 +2930,7 @@ static Lisp_Object check_translation (int, int, int, Lisp_Object); | |||
| 2962 | element is found, return it. Otherwise return Qnil. */ | 2930 | element is found, return it. Otherwise return Qnil. */ |
| 2963 | 2931 | ||
| 2964 | static Lisp_Object | 2932 | static Lisp_Object |
| 2965 | check_translation (pos, pos_byte, end, val) | 2933 | check_translation (int pos, int pos_byte, int end, Lisp_Object val) |
| 2966 | int pos, pos_byte, end; | ||
| 2967 | Lisp_Object val; | ||
| 2968 | { | 2934 | { |
| 2969 | int buf_size = 16, buf_used = 0; | 2935 | int buf_size = 16, buf_used = 0; |
| 2970 | int *buf = alloca (sizeof (int) * buf_size); | 2936 | int *buf = alloca (sizeof (int) * buf_size); |
| @@ -3263,7 +3229,7 @@ or markers) bounding the text that should remain visible. */) | |||
| 3263 | } | 3229 | } |
| 3264 | 3230 | ||
| 3265 | Lisp_Object | 3231 | Lisp_Object |
| 3266 | save_restriction_save () | 3232 | save_restriction_save (void) |
| 3267 | { | 3233 | { |
| 3268 | if (BEGV == BEG && ZV == Z) | 3234 | if (BEGV == BEG && ZV == Z) |
| 3269 | /* The common case that the buffer isn't narrowed. | 3235 | /* The common case that the buffer isn't narrowed. |
| @@ -3287,8 +3253,7 @@ save_restriction_save () | |||
| 3287 | } | 3253 | } |
| 3288 | 3254 | ||
| 3289 | Lisp_Object | 3255 | Lisp_Object |
| 3290 | save_restriction_restore (data) | 3256 | save_restriction_restore (Lisp_Object data) |
| 3291 | Lisp_Object data; | ||
| 3292 | { | 3257 | { |
| 3293 | struct buffer *cur = NULL; | 3258 | struct buffer *cur = NULL; |
| 3294 | struct buffer *buf = (CONSP (data) | 3259 | struct buffer *buf = (CONSP (data) |
| @@ -4209,9 +4174,7 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 4209 | } | 4174 | } |
| 4210 | 4175 | ||
| 4211 | Lisp_Object | 4176 | Lisp_Object |
| 4212 | format2 (string1, arg0, arg1) | 4177 | format2 (char *string1, Lisp_Object arg0, Lisp_Object arg1) |
| 4213 | char *string1; | ||
| 4214 | Lisp_Object arg0, arg1; | ||
| 4215 | { | 4178 | { |
| 4216 | Lisp_Object args[3]; | 4179 | Lisp_Object args[3]; |
| 4217 | args[0] = build_string (string1); | 4180 | args[0] = build_string (string1); |
| @@ -4639,7 +4602,7 @@ Transposing beyond buffer boundaries is an error. */) | |||
| 4639 | 4602 | ||
| 4640 | 4603 | ||
| 4641 | void | 4604 | void |
| 4642 | syms_of_editfns () | 4605 | syms_of_editfns (void) |
| 4643 | { | 4606 | { |
| 4644 | environbuf = 0; | 4607 | environbuf = 0; |
| 4645 | initial_tz = 0; | 4608 | initial_tz = 0; |