diff options
| author | Stefan Monnier | 2010-07-23 17:23:09 +0200 |
|---|---|---|
| committer | Stefan Monnier | 2010-07-23 17:23:09 +0200 |
| commit | 0ee81a0ce066375eac701c06cdfbdebefe594fdc (patch) | |
| tree | f0dccd24163316cfe688f927681a3032a9b1fe2f /src/buffer.c | |
| parent | 894e369ddf48e191638b8e66ce732f24ff9abe2a (diff) | |
| parent | 94da839793affa2a270bc26cee9c4d95d4dc4708 (diff) | |
| download | emacs-0ee81a0ce066375eac701c06cdfbdebefe594fdc.tar.gz emacs-0ee81a0ce066375eac701c06cdfbdebefe594fdc.zip | |
Merge from trunk
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 378 |
1 files changed, 130 insertions, 248 deletions
diff --git a/src/buffer.c b/src/buffer.c index e907c295e8d..bfef1c369ef 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -106,13 +106,13 @@ static char buffer_permanent_local_flags[MAX_PER_BUFFER_VARS]; | |||
| 106 | int last_per_buffer_idx; | 106 | int last_per_buffer_idx; |
| 107 | 107 | ||
| 108 | EXFUN (Fset_buffer, 1); | 108 | EXFUN (Fset_buffer, 1); |
| 109 | void set_buffer_internal P_ ((struct buffer *b)); | 109 | void set_buffer_internal (struct buffer *b); |
| 110 | void set_buffer_internal_1 P_ ((struct buffer *b)); | 110 | void set_buffer_internal_1 (struct buffer *b); |
| 111 | static void call_overlay_mod_hooks P_ ((Lisp_Object list, Lisp_Object overlay, | 111 | static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, |
| 112 | int after, Lisp_Object arg1, | 112 | int after, Lisp_Object arg1, |
| 113 | Lisp_Object arg2, Lisp_Object arg3)); | 113 | Lisp_Object arg2, Lisp_Object arg3); |
| 114 | static void swap_out_buffer_local_variables P_ ((struct buffer *b)); | 114 | static void swap_out_buffer_local_variables (struct buffer *b); |
| 115 | static void reset_buffer_local_variables P_ ((struct buffer *b, int permanent_too)); | 115 | static void reset_buffer_local_variables (struct buffer *b, int permanent_too); |
| 116 | 116 | ||
| 117 | /* Alist of all buffer names vs the buffers. */ | 117 | /* Alist of all buffer names vs the buffers. */ |
| 118 | /* This used to be a variable, but is no longer, | 118 | /* This used to be a variable, but is no longer, |
| @@ -168,20 +168,19 @@ Lisp_Object Qmodification_hooks; | |||
| 168 | Lisp_Object Qinsert_in_front_hooks; | 168 | Lisp_Object Qinsert_in_front_hooks; |
| 169 | Lisp_Object Qinsert_behind_hooks; | 169 | Lisp_Object Qinsert_behind_hooks; |
| 170 | 170 | ||
| 171 | static void alloc_buffer_text P_ ((struct buffer *, size_t)); | 171 | static void alloc_buffer_text (struct buffer *, size_t); |
| 172 | static void free_buffer_text P_ ((struct buffer *b)); | 172 | static void free_buffer_text (struct buffer *b); |
| 173 | static struct Lisp_Overlay * copy_overlays P_ ((struct buffer *, struct Lisp_Overlay *)); | 173 | static struct Lisp_Overlay * copy_overlays (struct buffer *, struct Lisp_Overlay *); |
| 174 | static void modify_overlay P_ ((struct buffer *, EMACS_INT, EMACS_INT)); | 174 | static void modify_overlay (struct buffer *, EMACS_INT, EMACS_INT); |
| 175 | static Lisp_Object buffer_lisp_local_variables P_ ((struct buffer *)); | 175 | static Lisp_Object buffer_lisp_local_variables (struct buffer *); |
| 176 | 176 | ||
| 177 | extern char * emacs_strerror P_ ((int)); | 177 | extern char * emacs_strerror (int); |
| 178 | 178 | ||
| 179 | /* For debugging; temporary. See set_buffer_internal. */ | 179 | /* For debugging; temporary. See set_buffer_internal. */ |
| 180 | /* Lisp_Object Qlisp_mode, Vcheck_symbol; */ | 180 | /* Lisp_Object Qlisp_mode, Vcheck_symbol; */ |
| 181 | 181 | ||
| 182 | void | 182 | void |
| 183 | nsberror (spec) | 183 | nsberror (Lisp_Object spec) |
| 184 | Lisp_Object spec; | ||
| 185 | { | 184 | { |
| 186 | if (STRINGP (spec)) | 185 | if (STRINGP (spec)) |
| 187 | error ("No buffer named %s", SDATA (spec)); | 186 | error ("No buffer named %s", SDATA (spec)); |
| @@ -191,8 +190,7 @@ nsberror (spec) | |||
| 191 | DEFUN ("buffer-live-p", Fbuffer_live_p, Sbuffer_live_p, 1, 1, 0, | 190 | DEFUN ("buffer-live-p", Fbuffer_live_p, Sbuffer_live_p, 1, 1, 0, |
| 192 | doc: /* Return non-nil if OBJECT is a buffer which has not been killed. | 191 | doc: /* Return non-nil if OBJECT is a buffer which has not been killed. |
| 193 | Value is nil if OBJECT is not a buffer or if it has been killed. */) | 192 | Value is nil if OBJECT is not a buffer or if it has been killed. */) |
| 194 | (object) | 193 | (Lisp_Object object) |
| 195 | Lisp_Object object; | ||
| 196 | { | 194 | { |
| 197 | return ((BUFFERP (object) && ! NILP (XBUFFER (object)->name)) | 195 | return ((BUFFERP (object) && ! NILP (XBUFFER (object)->name)) |
| 198 | ? Qt : Qnil); | 196 | ? Qt : Qnil); |
| @@ -203,8 +201,7 @@ DEFUN ("buffer-list", Fbuffer_list, Sbuffer_list, 0, 1, 0, | |||
| 203 | If the optional arg FRAME is a frame, we return the buffer list | 201 | If the optional arg FRAME is a frame, we return the buffer list |
| 204 | in the proper order for that frame: the buffers in FRAME's `buffer-list' | 202 | in the proper order for that frame: the buffers in FRAME's `buffer-list' |
| 205 | frame parameter come first, followed by the rest of the buffers. */) | 203 | frame parameter come first, followed by the rest of the buffers. */) |
| 206 | (frame) | 204 | (Lisp_Object frame) |
| 207 | Lisp_Object frame; | ||
| 208 | { | 205 | { |
| 209 | Lisp_Object general; | 206 | Lisp_Object general; |
| 210 | general = Fmapcar (Qcdr, Vbuffer_alist); | 207 | general = Fmapcar (Qcdr, Vbuffer_alist); |
| @@ -248,9 +245,7 @@ frame parameter come first, followed by the rest of the buffers. */) | |||
| 248 | and don't ever QUIT. */ | 245 | and don't ever QUIT. */ |
| 249 | 246 | ||
| 250 | static Lisp_Object | 247 | static Lisp_Object |
| 251 | assoc_ignore_text_properties (key, list) | 248 | assoc_ignore_text_properties (register Lisp_Object key, Lisp_Object list) |
| 252 | register Lisp_Object key; | ||
| 253 | Lisp_Object list; | ||
| 254 | { | 249 | { |
| 255 | register Lisp_Object tail; | 250 | register Lisp_Object tail; |
| 256 | for (tail = list; CONSP (tail); tail = XCDR (tail)) | 251 | for (tail = list; CONSP (tail); tail = XCDR (tail)) |
| @@ -269,8 +264,7 @@ DEFUN ("get-buffer", Fget_buffer, Sget_buffer, 1, 1, 0, | |||
| 269 | BUFFER-OR-NAME must be either a string or a buffer. If BUFFER-OR-NAME | 264 | BUFFER-OR-NAME must be either a string or a buffer. If BUFFER-OR-NAME |
| 270 | is a string and there is no buffer with that name, return nil. If | 265 | is a string and there is no buffer with that name, return nil. If |
| 271 | BUFFER-OR-NAME is a buffer, return it as given. */) | 266 | BUFFER-OR-NAME is a buffer, return it as given. */) |
| 272 | (buffer_or_name) | 267 | (register Lisp_Object buffer_or_name) |
| 273 | register Lisp_Object buffer_or_name; | ||
| 274 | { | 268 | { |
| 275 | if (BUFFERP (buffer_or_name)) | 269 | if (BUFFERP (buffer_or_name)) |
| 276 | return buffer_or_name; | 270 | return buffer_or_name; |
| @@ -284,8 +278,7 @@ DEFUN ("get-file-buffer", Fget_file_buffer, Sget_file_buffer, 1, 1, 0, | |||
| 284 | The buffer's `buffer-file-name' must match exactly the expansion of FILENAME. | 278 | The buffer's `buffer-file-name' must match exactly the expansion of FILENAME. |
| 285 | If there is no such live buffer, return nil. | 279 | If there is no such live buffer, return nil. |
| 286 | See also `find-buffer-visiting'. */) | 280 | See also `find-buffer-visiting'. */) |
| 287 | (filename) | 281 | (register Lisp_Object filename) |
| 288 | register Lisp_Object filename; | ||
| 289 | { | 282 | { |
| 290 | register Lisp_Object tail, buf, tem; | 283 | register Lisp_Object tail, buf, tem; |
| 291 | Lisp_Object handler; | 284 | Lisp_Object handler; |
| @@ -312,8 +305,7 @@ See also `find-buffer-visiting'. */) | |||
| 312 | } | 305 | } |
| 313 | 306 | ||
| 314 | Lisp_Object | 307 | Lisp_Object |
| 315 | get_truename_buffer (filename) | 308 | get_truename_buffer (register Lisp_Object filename) |
| 316 | register Lisp_Object filename; | ||
| 317 | { | 309 | { |
| 318 | register Lisp_Object tail, buf, tem; | 310 | register Lisp_Object tail, buf, tem; |
| 319 | 311 | ||
| @@ -341,8 +333,7 @@ buffer does not keep undo information. | |||
| 341 | 333 | ||
| 342 | If BUFFER-OR-NAME is a buffer instead of a string, return it as given, | 334 | If BUFFER-OR-NAME is a buffer instead of a string, return it as given, |
| 343 | even if it is dead. The return value is never nil. */) | 335 | even if it is dead. The return value is never nil. */) |
| 344 | (buffer_or_name) | 336 | (register Lisp_Object buffer_or_name) |
| 345 | register Lisp_Object buffer_or_name; | ||
| 346 | { | 337 | { |
| 347 | register Lisp_Object buffer, name; | 338 | register Lisp_Object buffer, name; |
| 348 | register struct buffer *b; | 339 | register struct buffer *b; |
| @@ -437,9 +428,7 @@ even if it is dead. The return value is never nil. */) | |||
| 437 | LIST, but for buffer B. */ | 428 | LIST, but for buffer B. */ |
| 438 | 429 | ||
| 439 | static struct Lisp_Overlay * | 430 | static struct Lisp_Overlay * |
| 440 | copy_overlays (b, list) | 431 | copy_overlays (struct buffer *b, struct Lisp_Overlay *list) |
| 441 | struct buffer *b; | ||
| 442 | struct Lisp_Overlay *list; | ||
| 443 | { | 432 | { |
| 444 | Lisp_Object buffer; | 433 | Lisp_Object buffer; |
| 445 | struct Lisp_Overlay *result = NULL, *tail = NULL; | 434 | struct Lisp_Overlay *result = NULL, *tail = NULL; |
| @@ -489,8 +478,7 @@ copy_overlays (b, list) | |||
| 489 | copied. */ | 478 | copied. */ |
| 490 | 479 | ||
| 491 | static void | 480 | static void |
| 492 | clone_per_buffer_values (from, to) | 481 | clone_per_buffer_values (struct buffer *from, struct buffer *to) |
| 493 | struct buffer *from, *to; | ||
| 494 | { | 482 | { |
| 495 | Lisp_Object to_buffer; | 483 | Lisp_Object to_buffer; |
| 496 | int offset; | 484 | int offset; |
| @@ -521,7 +509,7 @@ clone_per_buffer_values (from, to) | |||
| 521 | PER_BUFFER_VALUE (to, offset) = obj; | 509 | PER_BUFFER_VALUE (to, offset) = obj; |
| 522 | } | 510 | } |
| 523 | 511 | ||
| 524 | bcopy (from->local_flags, to->local_flags, sizeof to->local_flags); | 512 | memcpy (to->local_flags, from->local_flags, sizeof to->local_flags); |
| 525 | 513 | ||
| 526 | to->overlays_before = copy_overlays (to, from->overlays_before); | 514 | to->overlays_before = copy_overlays (to, from->overlays_before); |
| 527 | to->overlays_after = copy_overlays (to, from->overlays_after); | 515 | to->overlays_after = copy_overlays (to, from->overlays_after); |
| @@ -540,8 +528,7 @@ NAME should be a string which is not the name of an existing buffer. | |||
| 540 | Optional argument CLONE non-nil means preserve BASE-BUFFER's state, | 528 | Optional argument CLONE non-nil means preserve BASE-BUFFER's state, |
| 541 | such as major and minor modes, in the indirect buffer. | 529 | such as major and minor modes, in the indirect buffer. |
| 542 | CLONE nil means the indirect buffer's state is reset to default values. */) | 530 | CLONE nil means the indirect buffer's state is reset to default values. */) |
| 543 | (base_buffer, name, clone) | 531 | (Lisp_Object base_buffer, Lisp_Object name, Lisp_Object clone) |
| 544 | Lisp_Object base_buffer, name, clone; | ||
| 545 | { | 532 | { |
| 546 | Lisp_Object buf, tem; | 533 | Lisp_Object buf, tem; |
| 547 | struct buffer *b; | 534 | struct buffer *b; |
| @@ -658,8 +645,7 @@ CLONE nil means the indirect buffer's state is reset to default values. */) | |||
| 658 | } | 645 | } |
| 659 | 646 | ||
| 660 | void | 647 | void |
| 661 | delete_all_overlays (b) | 648 | delete_all_overlays (struct buffer *b) |
| 662 | struct buffer *b; | ||
| 663 | { | 649 | { |
| 664 | Lisp_Object overlay; | 650 | Lisp_Object overlay; |
| 665 | 651 | ||
| @@ -689,8 +675,7 @@ delete_all_overlays (b) | |||
| 689 | claims it doesn't belong to it. */ | 675 | claims it doesn't belong to it. */ |
| 690 | 676 | ||
| 691 | void | 677 | void |
| 692 | reset_buffer (b) | 678 | reset_buffer (register struct buffer *b) |
| 693 | register struct buffer *b; | ||
| 694 | { | 679 | { |
| 695 | b->filename = Qnil; | 680 | b->filename = Qnil; |
| 696 | b->file_truename = Qnil; | 681 | b->file_truename = Qnil; |
| @@ -734,9 +719,7 @@ reset_buffer (b) | |||
| 734 | we preserve those. */ | 719 | we preserve those. */ |
| 735 | 720 | ||
| 736 | static void | 721 | static void |
| 737 | reset_buffer_local_variables (b, permanent_too) | 722 | reset_buffer_local_variables (register struct buffer *b, int permanent_too) |
| 738 | register struct buffer *b; | ||
| 739 | int permanent_too; | ||
| 740 | { | 723 | { |
| 741 | register int offset; | 724 | register int offset; |
| 742 | int i; | 725 | int i; |
| @@ -840,8 +823,7 @@ Otherwise modify name by appending `<NUMBER>', incrementing NUMBER | |||
| 840 | \(starting at 2) until an unused name is found, and then return that name. | 823 | \(starting at 2) until an unused name is found, and then return that name. |
| 841 | Optional second argument IGNORE specifies a name that is okay to use (if | 824 | Optional second argument IGNORE specifies a name that is okay to use (if |
| 842 | it is in the sequence to be tried) even if a buffer with that name exists. */) | 825 | it is in the sequence to be tried) even if a buffer with that name exists. */) |
| 843 | (name, ignore) | 826 | (register Lisp_Object name, Lisp_Object ignore) |
| 844 | register Lisp_Object name, ignore; | ||
| 845 | { | 827 | { |
| 846 | register Lisp_Object gentemp, tem; | 828 | register Lisp_Object gentemp, tem; |
| 847 | int count; | 829 | int count; |
| @@ -875,8 +857,7 @@ DEFUN ("buffer-name", Fbuffer_name, Sbuffer_name, 0, 1, 0, | |||
| 875 | doc: /* Return the name of BUFFER, as a string. | 857 | doc: /* Return the name of BUFFER, as a string. |
| 876 | BUFFER defaults to the current buffer. | 858 | BUFFER defaults to the current buffer. |
| 877 | Return nil if BUFFER has been killed. */) | 859 | Return nil if BUFFER has been killed. */) |
| 878 | (buffer) | 860 | (register Lisp_Object buffer) |
| 879 | register Lisp_Object buffer; | ||
| 880 | { | 861 | { |
| 881 | if (NILP (buffer)) | 862 | if (NILP (buffer)) |
| 882 | return current_buffer->name; | 863 | return current_buffer->name; |
| @@ -887,8 +868,7 @@ Return nil if BUFFER has been killed. */) | |||
| 887 | DEFUN ("buffer-file-name", Fbuffer_file_name, Sbuffer_file_name, 0, 1, 0, | 868 | DEFUN ("buffer-file-name", Fbuffer_file_name, Sbuffer_file_name, 0, 1, 0, |
| 888 | doc: /* Return name of file BUFFER is visiting, or nil if none. | 869 | doc: /* Return name of file BUFFER is visiting, or nil if none. |
| 889 | No argument or nil as argument means use the current buffer. */) | 870 | No argument or nil as argument means use the current buffer. */) |
| 890 | (buffer) | 871 | (register Lisp_Object buffer) |
| 891 | register Lisp_Object buffer; | ||
| 892 | { | 872 | { |
| 893 | if (NILP (buffer)) | 873 | if (NILP (buffer)) |
| 894 | return current_buffer->filename; | 874 | return current_buffer->filename; |
| @@ -901,8 +881,7 @@ DEFUN ("buffer-base-buffer", Fbuffer_base_buffer, Sbuffer_base_buffer, | |||
| 901 | doc: /* Return the base buffer of indirect buffer BUFFER. | 881 | doc: /* Return the base buffer of indirect buffer BUFFER. |
| 902 | If BUFFER is not indirect, return nil. | 882 | If BUFFER is not indirect, return nil. |
| 903 | BUFFER defaults to the current buffer. */) | 883 | BUFFER defaults to the current buffer. */) |
| 904 | (buffer) | 884 | (register Lisp_Object buffer) |
| 905 | register Lisp_Object buffer; | ||
| 906 | { | 885 | { |
| 907 | struct buffer *base; | 886 | struct buffer *base; |
| 908 | Lisp_Object base_buffer; | 887 | Lisp_Object base_buffer; |
| @@ -926,9 +905,7 @@ DEFUN ("buffer-local-value", Fbuffer_local_value, | |||
| 926 | doc: /* Return the value of VARIABLE in BUFFER. | 905 | doc: /* Return the value of VARIABLE in BUFFER. |
| 927 | If VARIABLE does not have a buffer-local binding in BUFFER, the value | 906 | If VARIABLE does not have a buffer-local binding in BUFFER, the value |
| 928 | is the default binding of the variable. */) | 907 | is the default binding of the variable. */) |
| 929 | (variable, buffer) | 908 | (register Lisp_Object variable, register Lisp_Object buffer) |
| 930 | register Lisp_Object variable; | ||
| 931 | register Lisp_Object buffer; | ||
| 932 | { | 909 | { |
| 933 | register struct buffer *buf; | 910 | register struct buffer *buf; |
| 934 | register Lisp_Object result; | 911 | register Lisp_Object result; |
| @@ -993,8 +970,7 @@ is the default binding of the variable. */) | |||
| 993 | in special slots in the buffer object. */ | 970 | in special slots in the buffer object. */ |
| 994 | 971 | ||
| 995 | static Lisp_Object | 972 | static Lisp_Object |
| 996 | buffer_lisp_local_variables (buf) | 973 | buffer_lisp_local_variables (struct buffer *buf) |
| 997 | struct buffer *buf; | ||
| 998 | { | 974 | { |
| 999 | Lisp_Object result = Qnil; | 975 | Lisp_Object result = Qnil; |
| 1000 | register Lisp_Object tail; | 976 | register Lisp_Object tail; |
| @@ -1027,8 +1003,7 @@ Most elements look like (SYMBOL . VALUE), describing one variable. | |||
| 1027 | For a symbol that is locally unbound, just the symbol appears in the value. | 1003 | For a symbol that is locally unbound, just the symbol appears in the value. |
| 1028 | Note that storing new VALUEs in these elements doesn't change the variables. | 1004 | Note that storing new VALUEs in these elements doesn't change the variables. |
| 1029 | No argument or nil as argument means use current buffer as BUFFER. */) | 1005 | No argument or nil as argument means use current buffer as BUFFER. */) |
| 1030 | (buffer) | 1006 | (register Lisp_Object buffer) |
| 1031 | register Lisp_Object buffer; | ||
| 1032 | { | 1007 | { |
| 1033 | register struct buffer *buf; | 1008 | register struct buffer *buf; |
| 1034 | register Lisp_Object result; | 1009 | register Lisp_Object result; |
| @@ -1070,8 +1045,7 @@ DEFUN ("buffer-modified-p", Fbuffer_modified_p, Sbuffer_modified_p, | |||
| 1070 | 0, 1, 0, | 1045 | 0, 1, 0, |
| 1071 | doc: /* Return t if BUFFER was modified since its file was last read or saved. | 1046 | doc: /* Return t if BUFFER was modified since its file was last read or saved. |
| 1072 | No argument or nil as argument means use current buffer as BUFFER. */) | 1047 | No argument or nil as argument means use current buffer as BUFFER. */) |
| 1073 | (buffer) | 1048 | (register Lisp_Object buffer) |
| 1074 | register Lisp_Object buffer; | ||
| 1075 | { | 1049 | { |
| 1076 | register struct buffer *buf; | 1050 | register struct buffer *buf; |
| 1077 | if (NILP (buffer)) | 1051 | if (NILP (buffer)) |
| @@ -1089,8 +1063,7 @@ DEFUN ("set-buffer-modified-p", Fset_buffer_modified_p, Sset_buffer_modified_p, | |||
| 1089 | 1, 1, 0, | 1063 | 1, 1, 0, |
| 1090 | doc: /* Mark current buffer as modified or unmodified according to FLAG. | 1064 | doc: /* Mark current buffer as modified or unmodified according to FLAG. |
| 1091 | A non-nil FLAG means mark the buffer modified. */) | 1065 | A non-nil FLAG means mark the buffer modified. */) |
| 1092 | (flag) | 1066 | (register Lisp_Object flag) |
| 1093 | register Lisp_Object flag; | ||
| 1094 | { | 1067 | { |
| 1095 | register int already; | 1068 | register int already; |
| 1096 | register Lisp_Object fn; | 1069 | register Lisp_Object fn; |
| @@ -1159,8 +1132,7 @@ DEFUN ("restore-buffer-modified-p", Frestore_buffer_modified_p, | |||
| 1159 | doc: /* Like `set-buffer-modified-p', with a difference concerning redisplay. | 1132 | doc: /* Like `set-buffer-modified-p', with a difference concerning redisplay. |
| 1160 | It is not ensured that mode lines will be updated to show the modified | 1133 | It is not ensured that mode lines will be updated to show the modified |
| 1161 | state of the current buffer. Use with care. */) | 1134 | state of the current buffer. Use with care. */) |
| 1162 | (flag) | 1135 | (Lisp_Object flag) |
| 1163 | Lisp_Object flag; | ||
| 1164 | { | 1136 | { |
| 1165 | #ifdef CLASH_DETECTION | 1137 | #ifdef CLASH_DETECTION |
| 1166 | Lisp_Object fn; | 1138 | Lisp_Object fn; |
| @@ -1190,8 +1162,7 @@ DEFUN ("buffer-modified-tick", Fbuffer_modified_tick, Sbuffer_modified_tick, | |||
| 1190 | Each buffer has a tick counter which is incremented each time the | 1162 | Each buffer has a tick counter which is incremented each time the |
| 1191 | text in that buffer is changed. It wraps around occasionally. | 1163 | text in that buffer is changed. It wraps around occasionally. |
| 1192 | No argument or nil as argument means use current buffer as BUFFER. */) | 1164 | No argument or nil as argument means use current buffer as BUFFER. */) |
| 1193 | (buffer) | 1165 | (register Lisp_Object buffer) |
| 1194 | register Lisp_Object buffer; | ||
| 1195 | { | 1166 | { |
| 1196 | register struct buffer *buf; | 1167 | register struct buffer *buf; |
| 1197 | if (NILP (buffer)) | 1168 | if (NILP (buffer)) |
| @@ -1215,8 +1186,7 @@ values returned by two individual calls of `buffer-chars-modified-tick', | |||
| 1215 | you can tell whether a character change occurred in that buffer in | 1186 | you can tell whether a character change occurred in that buffer in |
| 1216 | between these calls. No argument or nil as argument means use current | 1187 | between these calls. No argument or nil as argument means use current |
| 1217 | buffer as BUFFER. */) | 1188 | buffer as BUFFER. */) |
| 1218 | (buffer) | 1189 | (register Lisp_Object buffer) |
| 1219 | register Lisp_Object buffer; | ||
| 1220 | { | 1190 | { |
| 1221 | register struct buffer *buf; | 1191 | register struct buffer *buf; |
| 1222 | if (NILP (buffer)) | 1192 | if (NILP (buffer)) |
| @@ -1242,8 +1212,7 @@ If UNIQUE is non-nil, come up with a new name using | |||
| 1242 | Interactively, you can set UNIQUE with a prefix argument. | 1212 | Interactively, you can set UNIQUE with a prefix argument. |
| 1243 | We return the name we actually gave the buffer. | 1213 | We return the name we actually gave the buffer. |
| 1244 | This does not change the name of the visited file (if any). */) | 1214 | This does not change the name of the visited file (if any). */) |
| 1245 | (newname, unique) | 1215 | (register Lisp_Object newname, Lisp_Object unique) |
| 1246 | register Lisp_Object newname, unique; | ||
| 1247 | { | 1216 | { |
| 1248 | register Lisp_Object tem, buf; | 1217 | register Lisp_Object tem, buf; |
| 1249 | 1218 | ||
| @@ -1290,10 +1259,9 @@ If the optional third argument FRAME is non-nil, use that frame's | |||
| 1290 | buffer list instead of the selected frame's buffer list. | 1259 | buffer list instead of the selected frame's buffer list. |
| 1291 | If no other buffer exists, the buffer `*scratch*' is returned. | 1260 | If no other buffer exists, the buffer `*scratch*' is returned. |
| 1292 | If BUFFER is omitted or nil, some interesting buffer is returned. */) | 1261 | If BUFFER is omitted or nil, some interesting buffer is returned. */) |
| 1293 | (buffer, visible_ok, frame) | 1262 | (register Lisp_Object buffer, Lisp_Object visible_ok, Lisp_Object frame) |
| 1294 | register Lisp_Object buffer, visible_ok, frame; | ||
| 1295 | { | 1263 | { |
| 1296 | Lisp_Object Fset_buffer_major_mode (); | 1264 | Lisp_Object Fset_buffer_major_mode (Lisp_Object buffer); |
| 1297 | register Lisp_Object tail, buf, notsogood, tem, pred, add_ons; | 1265 | register Lisp_Object tail, buf, notsogood, tem, pred, add_ons; |
| 1298 | notsogood = Qnil; | 1266 | notsogood = Qnil; |
| 1299 | 1267 | ||
| @@ -1362,8 +1330,7 @@ DEFUN ("buffer-enable-undo", Fbuffer_enable_undo, Sbuffer_enable_undo, | |||
| 1362 | 0, 1, "", | 1330 | 0, 1, "", |
| 1363 | doc: /* Start keeping undo information for buffer BUFFER. | 1331 | doc: /* Start keeping undo information for buffer BUFFER. |
| 1364 | No argument or nil as argument means do this for the current buffer. */) | 1332 | No argument or nil as argument means do this for the current buffer. */) |
| 1365 | (buffer) | 1333 | (register Lisp_Object buffer) |
| 1366 | register Lisp_Object buffer; | ||
| 1367 | { | 1334 | { |
| 1368 | Lisp_Object real_buffer; | 1335 | Lisp_Object real_buffer; |
| 1369 | 1336 | ||
| @@ -1404,8 +1371,7 @@ is running. | |||
| 1404 | 1371 | ||
| 1405 | Any processes that have this buffer as the `process-buffer' are killed | 1372 | Any processes that have this buffer as the `process-buffer' are killed |
| 1406 | with SIGHUP. */) | 1373 | with SIGHUP. */) |
| 1407 | (buffer_or_name) | 1374 | (Lisp_Object buffer_or_name) |
| 1408 | Lisp_Object buffer_or_name; | ||
| 1409 | { | 1375 | { |
| 1410 | Lisp_Object buffer; | 1376 | Lisp_Object buffer; |
| 1411 | register struct buffer *b; | 1377 | register struct buffer *b; |
| @@ -1618,8 +1584,7 @@ with SIGHUP. */) | |||
| 1618 | means that other_buffer is more likely to choose a relevant buffer. */ | 1584 | means that other_buffer is more likely to choose a relevant buffer. */ |
| 1619 | 1585 | ||
| 1620 | void | 1586 | void |
| 1621 | record_buffer (buf) | 1587 | record_buffer (Lisp_Object buf) |
| 1622 | Lisp_Object buf; | ||
| 1623 | { | 1588 | { |
| 1624 | register Lisp_Object link, prev; | 1589 | register Lisp_Object link, prev; |
| 1625 | Lisp_Object frame; | 1590 | Lisp_Object frame; |
| @@ -1695,8 +1660,7 @@ For the *scratch* buffer, use `initial-major-mode', otherwise choose a mode | |||
| 1695 | according to `default-major-mode'. | 1660 | according to `default-major-mode'. |
| 1696 | Use this function before selecting the buffer, since it may need to inspect | 1661 | Use this function before selecting the buffer, since it may need to inspect |
| 1697 | the current buffer's major mode. */) | 1662 | the current buffer's major mode. */) |
| 1698 | (buffer) | 1663 | (Lisp_Object buffer) |
| 1699 | Lisp_Object buffer; | ||
| 1700 | { | 1664 | { |
| 1701 | int count; | 1665 | int count; |
| 1702 | Lisp_Object function; | 1666 | Lisp_Object function; |
| @@ -1734,8 +1698,7 @@ the current buffer's major mode. */) | |||
| 1734 | If NORECORD is non-nil, don't call record_buffer. */ | 1698 | If NORECORD is non-nil, don't call record_buffer. */ |
| 1735 | 1699 | ||
| 1736 | Lisp_Object | 1700 | Lisp_Object |
| 1737 | switch_to_buffer_1 (buffer_or_name, norecord) | 1701 | switch_to_buffer_1 (Lisp_Object buffer_or_name, Lisp_Object norecord) |
| 1738 | Lisp_Object buffer_or_name, norecord; | ||
| 1739 | { | 1702 | { |
| 1740 | register Lisp_Object buffer; | 1703 | register Lisp_Object buffer; |
| 1741 | 1704 | ||
| @@ -1784,8 +1747,7 @@ its buffer, use `pop-to-buffer' for displaying the buffer. | |||
| 1784 | WARNING: This is NOT the way to work on another buffer temporarily | 1747 | WARNING: This is NOT the way to work on another buffer temporarily |
| 1785 | within a Lisp program! Use `set-buffer' instead. That avoids | 1748 | within a Lisp program! Use `set-buffer' instead. That avoids |
| 1786 | messing with the window-buffer correspondences. */) | 1749 | messing with the window-buffer correspondences. */) |
| 1787 | (buffer_or_name, norecord) | 1750 | (Lisp_Object buffer_or_name, Lisp_Object norecord) |
| 1788 | Lisp_Object buffer_or_name, norecord; | ||
| 1789 | { | 1751 | { |
| 1790 | if (EQ (buffer_or_name, Fwindow_buffer (selected_window))) | 1752 | if (EQ (buffer_or_name, Fwindow_buffer (selected_window))) |
| 1791 | { | 1753 | { |
| @@ -1814,7 +1776,7 @@ messing with the window-buffer correspondences. */) | |||
| 1814 | 1776 | ||
| 1815 | DEFUN ("current-buffer", Fcurrent_buffer, Scurrent_buffer, 0, 0, 0, | 1777 | DEFUN ("current-buffer", Fcurrent_buffer, Scurrent_buffer, 0, 0, 0, |
| 1816 | doc: /* Return the current buffer as a Lisp object. */) | 1778 | doc: /* Return the current buffer as a Lisp object. */) |
| 1817 | () | 1779 | (void) |
| 1818 | { | 1780 | { |
| 1819 | register Lisp_Object buf; | 1781 | register Lisp_Object buf; |
| 1820 | XSETBUFFER (buf, current_buffer); | 1782 | XSETBUFFER (buf, current_buffer); |
| @@ -1831,8 +1793,7 @@ DEFUN ("current-buffer", Fcurrent_buffer, Scurrent_buffer, 0, 0, 0, | |||
| 1831 | time, and that increments windows_or_buffers_changed. */ | 1793 | time, and that increments windows_or_buffers_changed. */ |
| 1832 | 1794 | ||
| 1833 | void | 1795 | void |
| 1834 | set_buffer_internal (b) | 1796 | set_buffer_internal (register struct buffer *b) |
| 1835 | register struct buffer *b; | ||
| 1836 | { | 1797 | { |
| 1837 | if (current_buffer != b) | 1798 | if (current_buffer != b) |
| 1838 | set_buffer_internal_1 (b); | 1799 | set_buffer_internal_1 (b); |
| @@ -1842,8 +1803,7 @@ set_buffer_internal (b) | |||
| 1842 | This is used by redisplay. */ | 1803 | This is used by redisplay. */ |
| 1843 | 1804 | ||
| 1844 | void | 1805 | void |
| 1845 | set_buffer_internal_1 (b) | 1806 | set_buffer_internal_1 (register struct buffer *b) |
| 1846 | register struct buffer *b; | ||
| 1847 | { | 1807 | { |
| 1848 | register struct buffer *old_buf; | 1808 | register struct buffer *old_buf; |
| 1849 | register Lisp_Object tail; | 1809 | register Lisp_Object tail; |
| @@ -1939,8 +1899,7 @@ set_buffer_internal_1 (b) | |||
| 1939 | This avoids certain things that don't need to be done within redisplay. */ | 1899 | This avoids certain things that don't need to be done within redisplay. */ |
| 1940 | 1900 | ||
| 1941 | void | 1901 | void |
| 1942 | set_buffer_temp (b) | 1902 | set_buffer_temp (struct buffer *b) |
| 1943 | struct buffer *b; | ||
| 1944 | { | 1903 | { |
| 1945 | register struct buffer *old_buf; | 1904 | register struct buffer *old_buf; |
| 1946 | 1905 | ||
| @@ -2003,8 +1962,7 @@ also `save-excursion' when you want to make a buffer current | |||
| 2003 | temporarily. This function does not display the buffer, so its effect | 1962 | temporarily. This function does not display the buffer, so its effect |
| 2004 | ends when the current command terminates. Use `switch-to-buffer' or | 1963 | ends when the current command terminates. Use `switch-to-buffer' or |
| 2005 | `pop-to-buffer' to switch buffers permanently. */) | 1964 | `pop-to-buffer' to switch buffers permanently. */) |
| 2006 | (buffer_or_name) | 1965 | (register Lisp_Object buffer_or_name) |
| 2007 | register Lisp_Object buffer_or_name; | ||
| 2008 | { | 1966 | { |
| 2009 | register Lisp_Object buffer; | 1967 | register Lisp_Object buffer; |
| 2010 | buffer = Fget_buffer (buffer_or_name); | 1968 | buffer = Fget_buffer (buffer_or_name); |
| @@ -2019,8 +1977,7 @@ ends when the current command terminates. Use `switch-to-buffer' or | |||
| 2019 | /* Set the current buffer to BUFFER provided it is alive. */ | 1977 | /* Set the current buffer to BUFFER provided it is alive. */ |
| 2020 | 1978 | ||
| 2021 | Lisp_Object | 1979 | Lisp_Object |
| 2022 | set_buffer_if_live (buffer) | 1980 | set_buffer_if_live (Lisp_Object buffer) |
| 2023 | Lisp_Object buffer; | ||
| 2024 | { | 1981 | { |
| 2025 | if (! NILP (XBUFFER (buffer)->name)) | 1982 | if (! NILP (XBUFFER (buffer)->name)) |
| 2026 | Fset_buffer (buffer); | 1983 | Fset_buffer (buffer); |
| @@ -2030,7 +1987,7 @@ set_buffer_if_live (buffer) | |||
| 2030 | DEFUN ("barf-if-buffer-read-only", Fbarf_if_buffer_read_only, | 1987 | DEFUN ("barf-if-buffer-read-only", Fbarf_if_buffer_read_only, |
| 2031 | Sbarf_if_buffer_read_only, 0, 0, 0, | 1988 | Sbarf_if_buffer_read_only, 0, 0, 0, |
| 2032 | doc: /* Signal a `buffer-read-only' error if the current buffer is read-only. */) | 1989 | doc: /* Signal a `buffer-read-only' error if the current buffer is read-only. */) |
| 2033 | () | 1990 | (void) |
| 2034 | { | 1991 | { |
| 2035 | if (!NILP (current_buffer->read_only) | 1992 | if (!NILP (current_buffer->read_only) |
| 2036 | && NILP (Vinhibit_read_only)) | 1993 | && NILP (Vinhibit_read_only)) |
| @@ -2050,8 +2007,7 @@ from the selected window if it is displayed there. If the selected | |||
| 2050 | window is dedicated to its buffer, delete that window if there are other | 2007 | window is dedicated to its buffer, delete that window if there are other |
| 2051 | windows on the same frame. If the selected window is the only window on | 2008 | windows on the same frame. If the selected window is the only window on |
| 2052 | its frame, iconify that frame. */) | 2009 | its frame, iconify that frame. */) |
| 2053 | (buffer_or_name) | 2010 | (register Lisp_Object buffer_or_name) |
| 2054 | register Lisp_Object buffer_or_name; | ||
| 2055 | { | 2011 | { |
| 2056 | Lisp_Object buffer; | 2012 | Lisp_Object buffer; |
| 2057 | 2013 | ||
| @@ -2105,7 +2061,7 @@ DEFUN ("erase-buffer", Ferase_buffer, Serase_buffer, 0, 0, "*", | |||
| 2105 | doc: /* Delete the entire contents of the current buffer. | 2061 | doc: /* Delete the entire contents of the current buffer. |
| 2106 | Any narrowing restriction in effect (see `narrow-to-region') is removed, | 2062 | Any narrowing restriction in effect (see `narrow-to-region') is removed, |
| 2107 | so the buffer is truly empty after this. */) | 2063 | so the buffer is truly empty after this. */) |
| 2108 | () | 2064 | (void) |
| 2109 | { | 2065 | { |
| 2110 | Fwiden (); | 2066 | Fwiden (); |
| 2111 | 2067 | ||
| @@ -2120,8 +2076,7 @@ so the buffer is truly empty after this. */) | |||
| 2120 | } | 2076 | } |
| 2121 | 2077 | ||
| 2122 | void | 2078 | void |
| 2123 | validate_region (b, e) | 2079 | validate_region (register Lisp_Object *b, register Lisp_Object *e) |
| 2124 | register Lisp_Object *b, *e; | ||
| 2125 | { | 2080 | { |
| 2126 | CHECK_NUMBER_COERCE_MARKER (*b); | 2081 | CHECK_NUMBER_COERCE_MARKER (*b); |
| 2127 | CHECK_NUMBER_COERCE_MARKER (*e); | 2082 | CHECK_NUMBER_COERCE_MARKER (*e); |
| @@ -2141,8 +2096,7 @@ validate_region (b, e) | |||
| 2141 | and return the adjusted position. */ | 2096 | and return the adjusted position. */ |
| 2142 | 2097 | ||
| 2143 | static int | 2098 | static int |
| 2144 | advance_to_char_boundary (byte_pos) | 2099 | advance_to_char_boundary (int byte_pos) |
| 2145 | int byte_pos; | ||
| 2146 | { | 2100 | { |
| 2147 | int c; | 2101 | int c; |
| 2148 | 2102 | ||
| @@ -2175,14 +2129,13 @@ advance_to_char_boundary (byte_pos) | |||
| 2175 | } | 2129 | } |
| 2176 | 2130 | ||
| 2177 | #ifdef REL_ALLOC | 2131 | #ifdef REL_ALLOC |
| 2178 | extern void r_alloc_reset_variable P_ ((POINTER_TYPE *, POINTER_TYPE *)); | 2132 | extern void r_alloc_reset_variable (POINTER_TYPE *, POINTER_TYPE *); |
| 2179 | #endif /* REL_ALLOC */ | 2133 | #endif /* REL_ALLOC */ |
| 2180 | 2134 | ||
| 2181 | DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text, | 2135 | DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text, |
| 2182 | 1, 1, 0, | 2136 | 1, 1, 0, |
| 2183 | doc: /* Swap the text between current buffer and BUFFER. */) | 2137 | doc: /* Swap the text between current buffer and BUFFER. */) |
| 2184 | (buffer) | 2138 | (Lisp_Object buffer) |
| 2185 | Lisp_Object buffer; | ||
| 2186 | { | 2139 | { |
| 2187 | struct buffer *other_buffer; | 2140 | struct buffer *other_buffer; |
| 2188 | CHECK_BUFFER (buffer); | 2141 | CHECK_BUFFER (buffer); |
| @@ -2320,8 +2273,7 @@ If FLAG is `to', this makes the buffer a multibyte buffer by changing | |||
| 2320 | all eight-bit bytes to eight-bit characters. | 2273 | all eight-bit bytes to eight-bit characters. |
| 2321 | If the multibyte flag was really changed, undo information of the | 2274 | If the multibyte flag was really changed, undo information of the |
| 2322 | current buffer is cleared. */) | 2275 | current buffer is cleared. */) |
| 2323 | (flag) | 2276 | (Lisp_Object flag) |
| 2324 | Lisp_Object flag; | ||
| 2325 | { | 2277 | { |
| 2326 | struct Lisp_Marker *tail, *markers; | 2278 | struct Lisp_Marker *tail, *markers; |
| 2327 | struct buffer *other; | 2279 | struct buffer *other; |
| @@ -2588,7 +2540,6 @@ current buffer is cleared. */) | |||
| 2588 | if (!modified_p && !NILP (Fbuffer_modified_p (Qnil))) | 2540 | if (!modified_p && !NILP (Fbuffer_modified_p (Qnil))) |
| 2589 | Fset_buffer_modified_p (Qnil); | 2541 | Fset_buffer_modified_p (Qnil); |
| 2590 | 2542 | ||
| 2591 | #ifdef subprocesses | ||
| 2592 | /* Update coding systems of this buffer's process (if any). */ | 2543 | /* Update coding systems of this buffer's process (if any). */ |
| 2593 | { | 2544 | { |
| 2594 | Lisp_Object process; | 2545 | Lisp_Object process; |
| @@ -2597,7 +2548,6 @@ current buffer is cleared. */) | |||
| 2597 | if (PROCESSP (process)) | 2548 | if (PROCESSP (process)) |
| 2598 | setup_process_coding_systems (process); | 2549 | setup_process_coding_systems (process); |
| 2599 | } | 2550 | } |
| 2600 | #endif /* subprocesses */ | ||
| 2601 | 2551 | ||
| 2602 | return flag; | 2552 | return flag; |
| 2603 | } | 2553 | } |
| @@ -2619,7 +2569,7 @@ a non-nil `permanent-local' property are not eliminated by this function. | |||
| 2619 | 2569 | ||
| 2620 | The first thing this function does is run | 2570 | The first thing this function does is run |
| 2621 | the normal hook `change-major-mode-hook'. */) | 2571 | the normal hook `change-major-mode-hook'. */) |
| 2622 | () | 2572 | (void) |
| 2623 | { | 2573 | { |
| 2624 | if (!NILP (Vrun_hooks)) | 2574 | if (!NILP (Vrun_hooks)) |
| 2625 | call1 (Vrun_hooks, Qchange_major_mode_hook); | 2575 | call1 (Vrun_hooks, Qchange_major_mode_hook); |
| @@ -2644,8 +2594,7 @@ the normal hook `change-major-mode-hook'. */) | |||
| 2644 | for their current values. */ | 2594 | for their current values. */ |
| 2645 | 2595 | ||
| 2646 | static void | 2596 | static void |
| 2647 | swap_out_buffer_local_variables (b) | 2597 | swap_out_buffer_local_variables (struct buffer *b) |
| 2648 | struct buffer *b; | ||
| 2649 | { | 2598 | { |
| 2650 | Lisp_Object oalist, alist, buffer; | 2599 | Lisp_Object oalist, alist, buffer; |
| 2651 | 2600 | ||
| @@ -2690,14 +2639,8 @@ swap_out_buffer_local_variables (b) | |||
| 2690 | default (BEGV or ZV). */ | 2639 | default (BEGV or ZV). */ |
| 2691 | 2640 | ||
| 2692 | int | 2641 | int |
| 2693 | overlays_at (pos, extend, vec_ptr, len_ptr, next_ptr, prev_ptr, change_req) | 2642 | overlays_at (EMACS_INT pos, int extend, Lisp_Object **vec_ptr, int *len_ptr, |
| 2694 | EMACS_INT pos; | 2643 | EMACS_INT *next_ptr, EMACS_INT *prev_ptr, int change_req) |
| 2695 | int extend; | ||
| 2696 | Lisp_Object **vec_ptr; | ||
| 2697 | int *len_ptr; | ||
| 2698 | EMACS_INT *next_ptr; | ||
| 2699 | EMACS_INT *prev_ptr; | ||
| 2700 | int change_req; | ||
| 2701 | { | 2644 | { |
| 2702 | Lisp_Object overlay, start, end; | 2645 | Lisp_Object overlay, start, end; |
| 2703 | struct Lisp_Overlay *tail; | 2646 | struct Lisp_Overlay *tail; |
| @@ -2835,13 +2778,8 @@ overlays_at (pos, extend, vec_ptr, len_ptr, next_ptr, prev_ptr, change_req) | |||
| 2835 | But we still return the total number of overlays. */ | 2778 | But we still return the total number of overlays. */ |
| 2836 | 2779 | ||
| 2837 | static int | 2780 | static int |
| 2838 | overlays_in (beg, end, extend, vec_ptr, len_ptr, next_ptr, prev_ptr) | 2781 | overlays_in (int beg, int end, int extend, Lisp_Object **vec_ptr, int *len_ptr, |
| 2839 | int beg, end; | 2782 | int *next_ptr, int *prev_ptr) |
| 2840 | int extend; | ||
| 2841 | Lisp_Object **vec_ptr; | ||
| 2842 | int *len_ptr; | ||
| 2843 | int *next_ptr; | ||
| 2844 | int *prev_ptr; | ||
| 2845 | { | 2783 | { |
| 2846 | Lisp_Object overlay, ostart, oend; | 2784 | Lisp_Object overlay, ostart, oend; |
| 2847 | struct Lisp_Overlay *tail; | 2785 | struct Lisp_Overlay *tail; |
| @@ -2962,8 +2900,7 @@ overlays_in (beg, end, extend, vec_ptr, len_ptr, next_ptr, prev_ptr) | |||
| 2962 | `mouse-face' property overlapping OVERLAY. */ | 2900 | `mouse-face' property overlapping OVERLAY. */ |
| 2963 | 2901 | ||
| 2964 | int | 2902 | int |
| 2965 | mouse_face_overlay_overlaps (overlay) | 2903 | mouse_face_overlay_overlaps (Lisp_Object overlay) |
| 2966 | Lisp_Object overlay; | ||
| 2967 | { | 2904 | { |
| 2968 | int start = OVERLAY_POSITION (OVERLAY_START (overlay)); | 2905 | int start = OVERLAY_POSITION (OVERLAY_START (overlay)); |
| 2969 | int end = OVERLAY_POSITION (OVERLAY_END (overlay)); | 2906 | int end = OVERLAY_POSITION (OVERLAY_END (overlay)); |
| @@ -2992,8 +2929,7 @@ mouse_face_overlay_overlaps (overlay) | |||
| 2992 | 2929 | ||
| 2993 | /* Fast function to just test if we're at an overlay boundary. */ | 2930 | /* Fast function to just test if we're at an overlay boundary. */ |
| 2994 | int | 2931 | int |
| 2995 | overlay_touches_p (pos) | 2932 | overlay_touches_p (int pos) |
| 2996 | int pos; | ||
| 2997 | { | 2933 | { |
| 2998 | Lisp_Object overlay; | 2934 | Lisp_Object overlay; |
| 2999 | struct Lisp_Overlay *tail; | 2935 | struct Lisp_Overlay *tail; |
| @@ -3038,8 +2974,7 @@ struct sortvec | |||
| 3038 | }; | 2974 | }; |
| 3039 | 2975 | ||
| 3040 | static int | 2976 | static int |
| 3041 | compare_overlays (v1, v2) | 2977 | compare_overlays (const void *v1, const void *v2) |
| 3042 | const void *v1, *v2; | ||
| 3043 | { | 2978 | { |
| 3044 | const struct sortvec *s1 = (const struct sortvec *) v1; | 2979 | const struct sortvec *s1 = (const struct sortvec *) v1; |
| 3045 | const struct sortvec *s2 = (const struct sortvec *) v2; | 2980 | const struct sortvec *s2 = (const struct sortvec *) v2; |
| @@ -3056,10 +2991,7 @@ compare_overlays (v1, v2) | |||
| 3056 | The return value is the new size; this may be smaller than the original | 2991 | The return value is the new size; this may be smaller than the original |
| 3057 | size if some of the overlays were invalid or were window-specific. */ | 2992 | size if some of the overlays were invalid or were window-specific. */ |
| 3058 | int | 2993 | int |
| 3059 | sort_overlays (overlay_vec, noverlays, w) | 2994 | sort_overlays (Lisp_Object *overlay_vec, int noverlays, struct window *w) |
| 3060 | Lisp_Object *overlay_vec; | ||
| 3061 | int noverlays; | ||
| 3062 | struct window *w; | ||
| 3063 | { | 2995 | { |
| 3064 | int i, j; | 2996 | int i, j; |
| 3065 | struct sortvec *sortvec; | 2997 | struct sortvec *sortvec; |
| @@ -3139,8 +3071,7 @@ static int overlay_str_len; | |||
| 3139 | 3071 | ||
| 3140 | /* A comparison function suitable for passing to qsort. */ | 3072 | /* A comparison function suitable for passing to qsort. */ |
| 3141 | static int | 3073 | static int |
| 3142 | cmp_for_strings (as1, as2) | 3074 | cmp_for_strings (const void *as1, const void *as2) |
| 3143 | char *as1, *as2; | ||
| 3144 | { | 3075 | { |
| 3145 | struct sortstr *s1 = (struct sortstr *)as1; | 3076 | struct sortstr *s1 = (struct sortstr *)as1; |
| 3146 | struct sortstr *s2 = (struct sortstr *)as2; | 3077 | struct sortstr *s2 = (struct sortstr *)as2; |
| @@ -3152,10 +3083,7 @@ cmp_for_strings (as1, as2) | |||
| 3152 | } | 3083 | } |
| 3153 | 3084 | ||
| 3154 | static void | 3085 | static void |
| 3155 | record_overlay_string (ssl, str, str2, pri, size) | 3086 | record_overlay_string (struct sortstrlist *ssl, Lisp_Object str, Lisp_Object str2, Lisp_Object pri, int size) |
| 3156 | struct sortstrlist *ssl; | ||
| 3157 | Lisp_Object str, str2, pri; | ||
| 3158 | int size; | ||
| 3159 | { | 3087 | { |
| 3160 | int nbytes; | 3088 | int nbytes; |
| 3161 | 3089 | ||
| @@ -3211,10 +3139,7 @@ record_overlay_string (ssl, str, str2, pri, size) | |||
| 3211 | subsequent calls. */ | 3139 | subsequent calls. */ |
| 3212 | 3140 | ||
| 3213 | int | 3141 | int |
| 3214 | overlay_strings (pos, w, pstr) | 3142 | overlay_strings (EMACS_INT pos, struct window *w, unsigned char **pstr) |
| 3215 | EMACS_INT pos; | ||
| 3216 | struct window *w; | ||
| 3217 | unsigned char **pstr; | ||
| 3218 | { | 3143 | { |
| 3219 | Lisp_Object overlay, window, str; | 3144 | Lisp_Object overlay, window, str; |
| 3220 | struct Lisp_Overlay *ov; | 3145 | struct Lisp_Overlay *ov; |
| @@ -3337,9 +3262,7 @@ overlay_strings (pos, w, pstr) | |||
| 3337 | /* Shift overlays in BUF's overlay lists, to center the lists at POS. */ | 3262 | /* Shift overlays in BUF's overlay lists, to center the lists at POS. */ |
| 3338 | 3263 | ||
| 3339 | void | 3264 | void |
| 3340 | recenter_overlay_lists (buf, pos) | 3265 | recenter_overlay_lists (struct buffer *buf, EMACS_INT pos) |
| 3341 | struct buffer *buf; | ||
| 3342 | EMACS_INT pos; | ||
| 3343 | { | 3266 | { |
| 3344 | Lisp_Object overlay, beg, end; | 3267 | Lisp_Object overlay, beg, end; |
| 3345 | struct Lisp_Overlay *prev, *tail, *next; | 3268 | struct Lisp_Overlay *prev, *tail, *next; |
| @@ -3488,9 +3411,7 @@ recenter_overlay_lists (buf, pos) | |||
| 3488 | } | 3411 | } |
| 3489 | 3412 | ||
| 3490 | void | 3413 | void |
| 3491 | adjust_overlays_for_insert (pos, length) | 3414 | adjust_overlays_for_insert (EMACS_INT pos, EMACS_INT length) |
| 3492 | EMACS_INT pos; | ||
| 3493 | EMACS_INT length; | ||
| 3494 | { | 3415 | { |
| 3495 | /* After an insertion, the lists are still sorted properly, | 3416 | /* After an insertion, the lists are still sorted properly, |
| 3496 | but we may need to update the value of the overlay center. */ | 3417 | but we may need to update the value of the overlay center. */ |
| @@ -3499,9 +3420,7 @@ adjust_overlays_for_insert (pos, length) | |||
| 3499 | } | 3420 | } |
| 3500 | 3421 | ||
| 3501 | void | 3422 | void |
| 3502 | adjust_overlays_for_delete (pos, length) | 3423 | adjust_overlays_for_delete (EMACS_INT pos, EMACS_INT length) |
| 3503 | EMACS_INT pos; | ||
| 3504 | EMACS_INT length; | ||
| 3505 | { | 3424 | { |
| 3506 | if (current_buffer->overlay_center < pos) | 3425 | if (current_buffer->overlay_center < pos) |
| 3507 | /* The deletion was to our right. No change needed; the before- and | 3426 | /* The deletion was to our right. No change needed; the before- and |
| @@ -3526,8 +3445,7 @@ adjust_overlays_for_delete (pos, length) | |||
| 3526 | Such an overlay might even have negative size at this point. | 3445 | Such an overlay might even have negative size at this point. |
| 3527 | If so, we'll make the overlay empty. */ | 3446 | If so, we'll make the overlay empty. */ |
| 3528 | void | 3447 | void |
| 3529 | fix_start_end_in_overlays (start, end) | 3448 | fix_start_end_in_overlays (register int start, register int end) |
| 3530 | register int start, end; | ||
| 3531 | { | 3449 | { |
| 3532 | Lisp_Object overlay; | 3450 | Lisp_Object overlay; |
| 3533 | struct Lisp_Overlay *before_list, *after_list; | 3451 | struct Lisp_Overlay *before_list, *after_list; |
| @@ -3673,9 +3591,7 @@ fix_start_end_in_overlays (start, end) | |||
| 3673 | was at PREV, and now is at POS. */ | 3591 | was at PREV, and now is at POS. */ |
| 3674 | 3592 | ||
| 3675 | void | 3593 | void |
| 3676 | fix_overlays_before (bp, prev, pos) | 3594 | fix_overlays_before (struct buffer *bp, EMACS_INT prev, EMACS_INT pos) |
| 3677 | struct buffer *bp; | ||
| 3678 | EMACS_INT prev, pos; | ||
| 3679 | { | 3595 | { |
| 3680 | /* If parent is nil, replace overlays_before; otherwise, parent->next. */ | 3596 | /* If parent is nil, replace overlays_before; otherwise, parent->next. */ |
| 3681 | struct Lisp_Overlay *tail = bp->overlays_before, *parent = NULL, *right_pair; | 3597 | struct Lisp_Overlay *tail = bp->overlays_before, *parent = NULL, *right_pair; |
| @@ -3754,8 +3670,7 @@ fix_overlays_before (bp, prev, pos) | |||
| 3754 | 3670 | ||
| 3755 | DEFUN ("overlayp", Foverlayp, Soverlayp, 1, 1, 0, | 3671 | DEFUN ("overlayp", Foverlayp, Soverlayp, 1, 1, 0, |
| 3756 | doc: /* Return t if OBJECT is an overlay. */) | 3672 | doc: /* Return t if OBJECT is an overlay. */) |
| 3757 | (object) | 3673 | (Lisp_Object object) |
| 3758 | Lisp_Object object; | ||
| 3759 | { | 3674 | { |
| 3760 | return (OVERLAYP (object) ? Qt : Qnil); | 3675 | return (OVERLAYP (object) ? Qt : Qnil); |
| 3761 | } | 3676 | } |
| @@ -3770,9 +3685,7 @@ for the front of the overlay advance when text is inserted there | |||
| 3770 | The fifth arg REAR-ADVANCE, if non-nil, makes the marker | 3685 | The fifth arg REAR-ADVANCE, if non-nil, makes the marker |
| 3771 | for the rear of the overlay advance when text is inserted there | 3686 | for the rear of the overlay advance when text is inserted there |
| 3772 | \(which means the text *is* included in the overlay). */) | 3687 | \(which means the text *is* included in the overlay). */) |
| 3773 | (beg, end, buffer, front_advance, rear_advance) | 3688 | (Lisp_Object beg, Lisp_Object end, Lisp_Object buffer, Lisp_Object front_advance, Lisp_Object rear_advance) |
| 3774 | Lisp_Object beg, end, buffer; | ||
| 3775 | Lisp_Object front_advance, rear_advance; | ||
| 3776 | { | 3689 | { |
| 3777 | Lisp_Object overlay; | 3690 | Lisp_Object overlay; |
| 3778 | struct buffer *b; | 3691 | struct buffer *b; |
| @@ -3841,9 +3754,7 @@ for the rear of the overlay advance when text is inserted there | |||
| 3841 | /* Mark a section of BUF as needing redisplay because of overlays changes. */ | 3754 | /* Mark a section of BUF as needing redisplay because of overlays changes. */ |
| 3842 | 3755 | ||
| 3843 | static void | 3756 | static void |
| 3844 | modify_overlay (buf, start, end) | 3757 | modify_overlay (struct buffer *buf, EMACS_INT start, EMACS_INT end) |
| 3845 | struct buffer *buf; | ||
| 3846 | EMACS_INT start, end; | ||
| 3847 | { | 3758 | { |
| 3848 | if (start > end) | 3759 | if (start > end) |
| 3849 | { | 3760 | { |
| @@ -3870,11 +3781,10 @@ modify_overlay (buf, start, end) | |||
| 3870 | } | 3781 | } |
| 3871 | 3782 | ||
| 3872 | 3783 | ||
| 3873 | Lisp_Object Fdelete_overlay (); | 3784 | Lisp_Object Fdelete_overlay (Lisp_Object overlay); |
| 3874 | 3785 | ||
| 3875 | static struct Lisp_Overlay * | 3786 | static struct Lisp_Overlay * |
| 3876 | unchain_overlay (list, overlay) | 3787 | unchain_overlay (struct Lisp_Overlay *list, struct Lisp_Overlay *overlay) |
| 3877 | struct Lisp_Overlay *list, *overlay; | ||
| 3878 | { | 3788 | { |
| 3879 | struct Lisp_Overlay *tmp, *prev; | 3789 | struct Lisp_Overlay *tmp, *prev; |
| 3880 | for (tmp = list, prev = NULL; tmp; prev = tmp, tmp = tmp->next) | 3790 | for (tmp = list, prev = NULL; tmp; prev = tmp, tmp = tmp->next) |
| @@ -3895,8 +3805,7 @@ DEFUN ("move-overlay", Fmove_overlay, Smove_overlay, 3, 4, 0, | |||
| 3895 | If BUFFER is omitted, leave OVERLAY in the same buffer it inhabits now. | 3805 | If BUFFER is omitted, leave OVERLAY in the same buffer it inhabits now. |
| 3896 | If BUFFER is omitted, and OVERLAY is in no buffer, put it in the current | 3806 | If BUFFER is omitted, and OVERLAY is in no buffer, put it in the current |
| 3897 | buffer. */) | 3807 | buffer. */) |
| 3898 | (overlay, beg, end, buffer) | 3808 | (Lisp_Object overlay, Lisp_Object beg, Lisp_Object end, Lisp_Object buffer) |
| 3899 | Lisp_Object overlay, beg, end, buffer; | ||
| 3900 | { | 3809 | { |
| 3901 | struct buffer *b, *ob; | 3810 | struct buffer *b, *ob; |
| 3902 | Lisp_Object obuffer; | 3811 | Lisp_Object obuffer; |
| @@ -4005,8 +3914,7 @@ buffer. */) | |||
| 4005 | 3914 | ||
| 4006 | DEFUN ("delete-overlay", Fdelete_overlay, Sdelete_overlay, 1, 1, 0, | 3915 | DEFUN ("delete-overlay", Fdelete_overlay, Sdelete_overlay, 1, 1, 0, |
| 4007 | doc: /* Delete the overlay OVERLAY from its buffer. */) | 3916 | doc: /* Delete the overlay OVERLAY from its buffer. */) |
| 4008 | (overlay) | 3917 | (Lisp_Object overlay) |
| 4009 | Lisp_Object overlay; | ||
| 4010 | { | 3918 | { |
| 4011 | Lisp_Object buffer; | 3919 | Lisp_Object buffer; |
| 4012 | struct buffer *b; | 3920 | struct buffer *b; |
| @@ -4046,8 +3954,7 @@ DEFUN ("delete-overlay", Fdelete_overlay, Sdelete_overlay, 1, 1, 0, | |||
| 4046 | 3954 | ||
| 4047 | DEFUN ("overlay-start", Foverlay_start, Soverlay_start, 1, 1, 0, | 3955 | DEFUN ("overlay-start", Foverlay_start, Soverlay_start, 1, 1, 0, |
| 4048 | doc: /* Return the position at which OVERLAY starts. */) | 3956 | doc: /* Return the position at which OVERLAY starts. */) |
| 4049 | (overlay) | 3957 | (Lisp_Object overlay) |
| 4050 | Lisp_Object overlay; | ||
| 4051 | { | 3958 | { |
| 4052 | CHECK_OVERLAY (overlay); | 3959 | CHECK_OVERLAY (overlay); |
| 4053 | 3960 | ||
| @@ -4056,8 +3963,7 @@ DEFUN ("overlay-start", Foverlay_start, Soverlay_start, 1, 1, 0, | |||
| 4056 | 3963 | ||
| 4057 | DEFUN ("overlay-end", Foverlay_end, Soverlay_end, 1, 1, 0, | 3964 | DEFUN ("overlay-end", Foverlay_end, Soverlay_end, 1, 1, 0, |
| 4058 | doc: /* Return the position at which OVERLAY ends. */) | 3965 | doc: /* Return the position at which OVERLAY ends. */) |
| 4059 | (overlay) | 3966 | (Lisp_Object overlay) |
| 4060 | Lisp_Object overlay; | ||
| 4061 | { | 3967 | { |
| 4062 | CHECK_OVERLAY (overlay); | 3968 | CHECK_OVERLAY (overlay); |
| 4063 | 3969 | ||
| @@ -4067,8 +3973,7 @@ DEFUN ("overlay-end", Foverlay_end, Soverlay_end, 1, 1, 0, | |||
| 4067 | DEFUN ("overlay-buffer", Foverlay_buffer, Soverlay_buffer, 1, 1, 0, | 3973 | DEFUN ("overlay-buffer", Foverlay_buffer, Soverlay_buffer, 1, 1, 0, |
| 4068 | doc: /* Return the buffer OVERLAY belongs to. | 3974 | doc: /* Return the buffer OVERLAY belongs to. |
| 4069 | Return nil if OVERLAY has been deleted. */) | 3975 | Return nil if OVERLAY has been deleted. */) |
| 4070 | (overlay) | 3976 | (Lisp_Object overlay) |
| 4071 | Lisp_Object overlay; | ||
| 4072 | { | 3977 | { |
| 4073 | CHECK_OVERLAY (overlay); | 3978 | CHECK_OVERLAY (overlay); |
| 4074 | 3979 | ||
| @@ -4079,8 +3984,7 @@ DEFUN ("overlay-properties", Foverlay_properties, Soverlay_properties, 1, 1, 0, | |||
| 4079 | doc: /* Return a list of the properties on OVERLAY. | 3984 | doc: /* Return a list of the properties on OVERLAY. |
| 4080 | This is a copy of OVERLAY's plist; modifying its conses has no effect on | 3985 | This is a copy of OVERLAY's plist; modifying its conses has no effect on |
| 4081 | OVERLAY. */) | 3986 | OVERLAY. */) |
| 4082 | (overlay) | 3987 | (Lisp_Object overlay) |
| 4083 | Lisp_Object overlay; | ||
| 4084 | { | 3988 | { |
| 4085 | CHECK_OVERLAY (overlay); | 3989 | CHECK_OVERLAY (overlay); |
| 4086 | 3990 | ||
| @@ -4090,8 +3994,7 @@ OVERLAY. */) | |||
| 4090 | 3994 | ||
| 4091 | DEFUN ("overlays-at", Foverlays_at, Soverlays_at, 1, 1, 0, | 3995 | DEFUN ("overlays-at", Foverlays_at, Soverlays_at, 1, 1, 0, |
| 4092 | doc: /* Return a list of the overlays that contain the character at POS. */) | 3996 | doc: /* Return a list of the overlays that contain the character at POS. */) |
| 4093 | (pos) | 3997 | (Lisp_Object pos) |
| 4094 | Lisp_Object pos; | ||
| 4095 | { | 3998 | { |
| 4096 | int noverlays; | 3999 | int noverlays; |
| 4097 | Lisp_Object *overlay_vec; | 4000 | Lisp_Object *overlay_vec; |
| @@ -4123,8 +4026,7 @@ and also contained within the specified region. | |||
| 4123 | Empty overlays are included in the result if they are located at BEG, | 4026 | Empty overlays are included in the result if they are located at BEG, |
| 4124 | between BEG and END, or at END provided END denotes the position at the | 4027 | between BEG and END, or at END provided END denotes the position at the |
| 4125 | end of the buffer. */) | 4028 | end of the buffer. */) |
| 4126 | (beg, end) | 4029 | (Lisp_Object beg, Lisp_Object end) |
| 4127 | Lisp_Object beg, end; | ||
| 4128 | { | 4030 | { |
| 4129 | int noverlays; | 4031 | int noverlays; |
| 4130 | Lisp_Object *overlay_vec; | 4032 | Lisp_Object *overlay_vec; |
| @@ -4154,8 +4056,7 @@ DEFUN ("next-overlay-change", Fnext_overlay_change, Snext_overlay_change, | |||
| 4154 | doc: /* Return the next position after POS where an overlay starts or ends. | 4056 | doc: /* Return the next position after POS where an overlay starts or ends. |
| 4155 | If there are no overlay boundaries from POS to (point-max), | 4057 | If there are no overlay boundaries from POS to (point-max), |
| 4156 | the value is (point-max). */) | 4058 | the value is (point-max). */) |
| 4157 | (pos) | 4059 | (Lisp_Object pos) |
| 4158 | Lisp_Object pos; | ||
| 4159 | { | 4060 | { |
| 4160 | int noverlays; | 4061 | int noverlays; |
| 4161 | EMACS_INT endpos; | 4062 | EMACS_INT endpos; |
| @@ -4196,8 +4097,7 @@ DEFUN ("previous-overlay-change", Fprevious_overlay_change, | |||
| 4196 | doc: /* Return the previous position before POS where an overlay starts or ends. | 4097 | doc: /* Return the previous position before POS where an overlay starts or ends. |
| 4197 | If there are no overlay boundaries from (point-min) to POS, | 4098 | If there are no overlay boundaries from (point-min) to POS, |
| 4198 | the value is (point-min). */) | 4099 | the value is (point-min). */) |
| 4199 | (pos) | 4100 | (Lisp_Object pos) |
| 4200 | Lisp_Object pos; | ||
| 4201 | { | 4101 | { |
| 4202 | int noverlays; | 4102 | int noverlays; |
| 4203 | EMACS_INT prevpos; | 4103 | EMACS_INT prevpos; |
| @@ -4233,7 +4133,7 @@ the cdr has all the overlays after the overlay center. | |||
| 4233 | Recentering overlays moves overlays between these lists. | 4133 | Recentering overlays moves overlays between these lists. |
| 4234 | The lists you get are copies, so that changing them has no effect. | 4134 | The lists you get are copies, so that changing them has no effect. |
| 4235 | However, the overlays you get are the real objects that the buffer uses. */) | 4135 | However, the overlays you get are the real objects that the buffer uses. */) |
| 4236 | () | 4136 | (void) |
| 4237 | { | 4137 | { |
| 4238 | struct Lisp_Overlay *ol; | 4138 | struct Lisp_Overlay *ol; |
| 4239 | Lisp_Object before = Qnil, after = Qnil, tmp; | 4139 | Lisp_Object before = Qnil, after = Qnil, tmp; |
| @@ -4254,8 +4154,7 @@ DEFUN ("overlay-recenter", Foverlay_recenter, Soverlay_recenter, 1, 1, 0, | |||
| 4254 | doc: /* Recenter the overlays of the current buffer around position POS. | 4154 | doc: /* Recenter the overlays of the current buffer around position POS. |
| 4255 | That makes overlay lookup faster for positions near POS (but perhaps slower | 4155 | That makes overlay lookup faster for positions near POS (but perhaps slower |
| 4256 | for positions far away from POS). */) | 4156 | for positions far away from POS). */) |
| 4257 | (pos) | 4157 | (Lisp_Object pos) |
| 4258 | Lisp_Object pos; | ||
| 4259 | { | 4158 | { |
| 4260 | CHECK_NUMBER_COERCE_MARKER (pos); | 4159 | CHECK_NUMBER_COERCE_MARKER (pos); |
| 4261 | 4160 | ||
| @@ -4265,8 +4164,7 @@ for positions far away from POS). */) | |||
| 4265 | 4164 | ||
| 4266 | DEFUN ("overlay-get", Foverlay_get, Soverlay_get, 2, 2, 0, | 4165 | DEFUN ("overlay-get", Foverlay_get, Soverlay_get, 2, 2, 0, |
| 4267 | doc: /* Get the property of overlay OVERLAY with property name PROP. */) | 4166 | doc: /* Get the property of overlay OVERLAY with property name PROP. */) |
| 4268 | (overlay, prop) | 4167 | (Lisp_Object overlay, Lisp_Object prop) |
| 4269 | Lisp_Object overlay, prop; | ||
| 4270 | { | 4168 | { |
| 4271 | CHECK_OVERLAY (overlay); | 4169 | CHECK_OVERLAY (overlay); |
| 4272 | return lookup_char_property (XOVERLAY (overlay)->plist, prop, 0); | 4170 | return lookup_char_property (XOVERLAY (overlay)->plist, prop, 0); |
| @@ -4274,8 +4172,7 @@ DEFUN ("overlay-get", Foverlay_get, Soverlay_get, 2, 2, 0, | |||
| 4274 | 4172 | ||
| 4275 | DEFUN ("overlay-put", Foverlay_put, Soverlay_put, 3, 3, 0, | 4173 | DEFUN ("overlay-put", Foverlay_put, Soverlay_put, 3, 3, 0, |
| 4276 | doc: /* Set one property of overlay OVERLAY: give property PROP value VALUE. */) | 4174 | doc: /* Set one property of overlay OVERLAY: give property PROP value VALUE. */) |
| 4277 | (overlay, prop, value) | 4175 | (Lisp_Object overlay, Lisp_Object prop, Lisp_Object value) |
| 4278 | Lisp_Object overlay, prop, value; | ||
| 4279 | { | 4176 | { |
| 4280 | Lisp_Object tail, buffer; | 4177 | Lisp_Object tail, buffer; |
| 4281 | int changed; | 4178 | int changed; |
| @@ -4333,8 +4230,7 @@ static int last_overlay_modification_hooks_used; | |||
| 4333 | to the end of last_overlay_modification_hooks. */ | 4230 | to the end of last_overlay_modification_hooks. */ |
| 4334 | 4231 | ||
| 4335 | static void | 4232 | static void |
| 4336 | add_overlay_mod_hooklist (functionlist, overlay) | 4233 | add_overlay_mod_hooklist (Lisp_Object functionlist, Lisp_Object overlay) |
| 4337 | Lisp_Object functionlist, overlay; | ||
| 4338 | { | 4234 | { |
| 4339 | int oldsize = XVECTOR (last_overlay_modification_hooks)->size; | 4235 | int oldsize = XVECTOR (last_overlay_modification_hooks)->size; |
| 4340 | 4236 | ||
| @@ -4362,10 +4258,8 @@ add_overlay_mod_hooklist (functionlist, overlay) | |||
| 4362 | and the length of deleted or replaced old text. */ | 4258 | and the length of deleted or replaced old text. */ |
| 4363 | 4259 | ||
| 4364 | void | 4260 | void |
| 4365 | report_overlay_modification (start, end, after, arg1, arg2, arg3) | 4261 | report_overlay_modification (Lisp_Object start, Lisp_Object end, int after, |
| 4366 | Lisp_Object start, end; | 4262 | Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) |
| 4367 | int after; | ||
| 4368 | Lisp_Object arg1, arg2, arg3; | ||
| 4369 | { | 4263 | { |
| 4370 | Lisp_Object prop, overlay; | 4264 | Lisp_Object prop, overlay; |
| 4371 | struct Lisp_Overlay *tail; | 4265 | struct Lisp_Overlay *tail; |
| @@ -4473,8 +4367,8 @@ report_overlay_modification (start, end, after, arg1, arg2, arg3) | |||
| 4473 | Lisp_Object *copy = (Lisp_Object *) alloca (size * sizeof (Lisp_Object)); | 4367 | Lisp_Object *copy = (Lisp_Object *) alloca (size * sizeof (Lisp_Object)); |
| 4474 | int i; | 4368 | int i; |
| 4475 | 4369 | ||
| 4476 | bcopy (XVECTOR (last_overlay_modification_hooks)->contents, | 4370 | memcpy (copy, XVECTOR (last_overlay_modification_hooks)->contents, |
| 4477 | copy, size * sizeof (Lisp_Object)); | 4371 | size * sizeof (Lisp_Object)); |
| 4478 | gcpro1.var = copy; | 4372 | gcpro1.var = copy; |
| 4479 | gcpro1.nvars = size; | 4373 | gcpro1.nvars = size; |
| 4480 | 4374 | ||
| @@ -4490,10 +4384,8 @@ report_overlay_modification (start, end, after, arg1, arg2, arg3) | |||
| 4490 | } | 4384 | } |
| 4491 | 4385 | ||
| 4492 | static void | 4386 | static void |
| 4493 | call_overlay_mod_hooks (list, overlay, after, arg1, arg2, arg3) | 4387 | call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, int after, |
| 4494 | Lisp_Object list, overlay; | 4388 | Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) |
| 4495 | int after; | ||
| 4496 | Lisp_Object arg1, arg2, arg3; | ||
| 4497 | { | 4389 | { |
| 4498 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 4390 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| 4499 | 4391 | ||
| @@ -4513,8 +4405,7 @@ call_overlay_mod_hooks (list, overlay, after, arg1, arg2, arg3) | |||
| 4513 | /* Delete any zero-sized overlays at position POS, if the `evaporate' | 4405 | /* Delete any zero-sized overlays at position POS, if the `evaporate' |
| 4514 | property is set. */ | 4406 | property is set. */ |
| 4515 | void | 4407 | void |
| 4516 | evaporate_overlays (pos) | 4408 | evaporate_overlays (EMACS_INT pos) |
| 4517 | EMACS_INT pos; | ||
| 4518 | { | 4409 | { |
| 4519 | Lisp_Object overlay, hit_list; | 4410 | Lisp_Object overlay, hit_list; |
| 4520 | struct Lisp_Overlay *tail; | 4411 | struct Lisp_Overlay *tail; |
| @@ -4552,9 +4443,7 @@ evaporate_overlays (pos) | |||
| 4552 | in the slot with offset OFFSET. */ | 4443 | in the slot with offset OFFSET. */ |
| 4553 | 4444 | ||
| 4554 | void | 4445 | void |
| 4555 | buffer_slot_type_mismatch (newval, type) | 4446 | buffer_slot_type_mismatch (Lisp_Object newval, int type) |
| 4556 | Lisp_Object newval; | ||
| 4557 | int type; | ||
| 4558 | { | 4447 | { |
| 4559 | Lisp_Object predicate; | 4448 | Lisp_Object predicate; |
| 4560 | 4449 | ||
| @@ -4693,13 +4582,13 @@ static int mmap_initialized_p; | |||
| 4693 | 4582 | ||
| 4694 | /* Function prototypes. */ | 4583 | /* Function prototypes. */ |
| 4695 | 4584 | ||
| 4696 | static int mmap_free_1 P_ ((struct mmap_region *)); | 4585 | static int mmap_free_1 (struct mmap_region *); |
| 4697 | static int mmap_enlarge P_ ((struct mmap_region *, int)); | 4586 | static int mmap_enlarge (struct mmap_region *, int); |
| 4698 | static struct mmap_region *mmap_find P_ ((POINTER_TYPE *, POINTER_TYPE *)); | 4587 | static struct mmap_region *mmap_find (POINTER_TYPE *, POINTER_TYPE *); |
| 4699 | static POINTER_TYPE *mmap_alloc P_ ((POINTER_TYPE **, size_t)); | 4588 | static POINTER_TYPE *mmap_alloc (POINTER_TYPE **, size_t); |
| 4700 | static POINTER_TYPE *mmap_realloc P_ ((POINTER_TYPE **, size_t)); | 4589 | static POINTER_TYPE *mmap_realloc (POINTER_TYPE **, size_t); |
| 4701 | static void mmap_free P_ ((POINTER_TYPE **ptr)); | 4590 | static void mmap_free (POINTER_TYPE **ptr); |
| 4702 | static void mmap_init P_ ((void)); | 4591 | static void mmap_init (void); |
| 4703 | 4592 | ||
| 4704 | 4593 | ||
| 4705 | /* Return a region overlapping address range START...END, or null if | 4594 | /* Return a region overlapping address range START...END, or null if |
| @@ -4942,7 +4831,7 @@ mmap_realloc (var, nbytes) | |||
| 4942 | } | 4831 | } |
| 4943 | else if (mmap_alloc (var, nbytes)) | 4832 | else if (mmap_alloc (var, nbytes)) |
| 4944 | { | 4833 | { |
| 4945 | bcopy (old_ptr, *var, r->nbytes_specified); | 4834 | memcpy (*var, old_ptr, r->nbytes_specified); |
| 4946 | mmap_free_1 (MMAP_REGION (old_ptr)); | 4835 | mmap_free_1 (MMAP_REGION (old_ptr)); |
| 4947 | result = *var; | 4836 | result = *var; |
| 4948 | r = MMAP_REGION (result); | 4837 | r = MMAP_REGION (result); |
| @@ -5032,18 +4921,16 @@ mmap_init () | |||
| 5032 | ***********************************************************************/ | 4921 | ***********************************************************************/ |
| 5033 | 4922 | ||
| 5034 | #ifdef REL_ALLOC | 4923 | #ifdef REL_ALLOC |
| 5035 | extern POINTER_TYPE *r_alloc P_ ((POINTER_TYPE **, size_t)); | 4924 | extern POINTER_TYPE *r_alloc (POINTER_TYPE **, size_t); |
| 5036 | extern POINTER_TYPE *r_re_alloc P_ ((POINTER_TYPE **, size_t)); | 4925 | extern POINTER_TYPE *r_re_alloc (POINTER_TYPE **, size_t); |
| 5037 | extern void r_alloc_free P_ ((POINTER_TYPE **ptr)); | 4926 | extern void r_alloc_free (POINTER_TYPE **ptr); |
| 5038 | #endif /* REL_ALLOC */ | 4927 | #endif /* REL_ALLOC */ |
| 5039 | 4928 | ||
| 5040 | 4929 | ||
| 5041 | /* Allocate NBYTES bytes for buffer B's text buffer. */ | 4930 | /* Allocate NBYTES bytes for buffer B's text buffer. */ |
| 5042 | 4931 | ||
| 5043 | static void | 4932 | static void |
| 5044 | alloc_buffer_text (b, nbytes) | 4933 | alloc_buffer_text (struct buffer *b, size_t nbytes) |
| 5045 | struct buffer *b; | ||
| 5046 | size_t nbytes; | ||
| 5047 | { | 4934 | { |
| 5048 | POINTER_TYPE *p; | 4935 | POINTER_TYPE *p; |
| 5049 | 4936 | ||
| @@ -5098,8 +4985,7 @@ enlarge_buffer_text (struct buffer *b, EMACS_INT delta) | |||
| 5098 | /* Free buffer B's text buffer. */ | 4985 | /* Free buffer B's text buffer. */ |
| 5099 | 4986 | ||
| 5100 | static void | 4987 | static void |
| 5101 | free_buffer_text (b) | 4988 | free_buffer_text (struct buffer *b) |
| 5102 | struct buffer *b; | ||
| 5103 | { | 4989 | { |
| 5104 | BLOCK_INPUT; | 4990 | BLOCK_INPUT; |
| 5105 | 4991 | ||
| @@ -5122,11 +5008,11 @@ free_buffer_text (b) | |||
| 5122 | ***********************************************************************/ | 5008 | ***********************************************************************/ |
| 5123 | 5009 | ||
| 5124 | void | 5010 | void |
| 5125 | init_buffer_once () | 5011 | init_buffer_once (void) |
| 5126 | { | 5012 | { |
| 5127 | int idx; | 5013 | int idx; |
| 5128 | 5014 | ||
| 5129 | bzero (buffer_permanent_local_flags, sizeof buffer_permanent_local_flags); | 5015 | memset (buffer_permanent_local_flags, 0, sizeof buffer_permanent_local_flags); |
| 5130 | 5016 | ||
| 5131 | /* Make sure all markable slots in buffer_defaults | 5017 | /* Make sure all markable slots in buffer_defaults |
| 5132 | are initialized reasonably, so mark_buffer won't choke. */ | 5018 | are initialized reasonably, so mark_buffer won't choke. */ |
| @@ -5214,7 +5100,7 @@ init_buffer_once () | |||
| 5214 | if (sizeof (EMACS_INT) != sizeof (Lisp_Object)) abort (); | 5100 | if (sizeof (EMACS_INT) != sizeof (Lisp_Object)) abort (); |
| 5215 | 5101 | ||
| 5216 | /* 0 means not a lisp var, -1 means always local, else mask */ | 5102 | /* 0 means not a lisp var, -1 means always local, else mask */ |
| 5217 | bzero (&buffer_local_flags, sizeof buffer_local_flags); | 5103 | memset (&buffer_local_flags, 0, sizeof buffer_local_flags); |
| 5218 | XSETINT (buffer_local_flags.filename, -1); | 5104 | XSETINT (buffer_local_flags.filename, -1); |
| 5219 | XSETINT (buffer_local_flags.directory, -1); | 5105 | XSETINT (buffer_local_flags.directory, -1); |
| 5220 | XSETINT (buffer_local_flags.backed_up, -1); | 5106 | XSETINT (buffer_local_flags.backed_up, -1); |
| @@ -5318,7 +5204,7 @@ init_buffer_once () | |||
| 5318 | } | 5204 | } |
| 5319 | 5205 | ||
| 5320 | void | 5206 | void |
| 5321 | init_buffer () | 5207 | init_buffer (void) |
| 5322 | { | 5208 | { |
| 5323 | char *pwd; | 5209 | char *pwd; |
| 5324 | Lisp_Object temp; | 5210 | Lisp_Object temp; |
| @@ -5402,12 +5288,8 @@ init_buffer () | |||
| 5402 | } while (0) | 5288 | } while (0) |
| 5403 | 5289 | ||
| 5404 | static void | 5290 | static void |
| 5405 | defvar_per_buffer (bo_fwd, namestring, address, type, doc) | 5291 | defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, char *namestring, |
| 5406 | struct Lisp_Buffer_Objfwd *bo_fwd; | 5292 | Lisp_Object *address, Lisp_Object type, char *doc) |
| 5407 | char *namestring; | ||
| 5408 | Lisp_Object *address; | ||
| 5409 | Lisp_Object type; | ||
| 5410 | char *doc; | ||
| 5411 | { | 5293 | { |
| 5412 | struct Lisp_Symbol *sym; | 5294 | struct Lisp_Symbol *sym; |
| 5413 | int offset; | 5295 | int offset; |
| @@ -5436,7 +5318,7 @@ defvar_per_buffer (bo_fwd, namestring, address, type, doc) | |||
| 5436 | 5318 | ||
| 5437 | /* initialize the buffer routines */ | 5319 | /* initialize the buffer routines */ |
| 5438 | void | 5320 | void |
| 5439 | syms_of_buffer () | 5321 | syms_of_buffer (void) |
| 5440 | { | 5322 | { |
| 5441 | staticpro (&last_overlay_modification_hooks); | 5323 | staticpro (&last_overlay_modification_hooks); |
| 5442 | last_overlay_modification_hooks | 5324 | last_overlay_modification_hooks |
| @@ -6339,7 +6221,7 @@ The function `kill-all-local-variables' runs this before doing anything else. * | |||
| 6339 | } | 6221 | } |
| 6340 | 6222 | ||
| 6341 | void | 6223 | void |
| 6342 | keys_of_buffer () | 6224 | keys_of_buffer (void) |
| 6343 | { | 6225 | { |
| 6344 | initial_define_key (control_x_map, 'b', "switch-to-buffer"); | 6226 | initial_define_key (control_x_map, 'b', "switch-to-buffer"); |
| 6345 | initial_define_key (control_x_map, 'k', "kill-buffer"); | 6227 | initial_define_key (control_x_map, 'k', "kill-buffer"); |