diff options
| author | Joakim Verona | 2010-08-17 23:19:11 +0200 |
|---|---|---|
| committer | Joakim Verona | 2010-08-17 23:19:11 +0200 |
| commit | a8101f663e6cbff953b67b8bef33bc0171818477 (patch) | |
| tree | 8f71a16188f75e91670e05379fb4de2d0136cbf4 /src/buffer.c | |
| parent | fe72c5b4651334677326104ec138e7cdd50f2ffe (diff) | |
| parent | 489cd5bd5a0128d6c3bee49fa2c451f2927ddea9 (diff) | |
| download | emacs-a8101f663e6cbff953b67b8bef33bc0171818477.tar.gz emacs-a8101f663e6cbff953b67b8bef33bc0171818477.zip | |
merge from trunk
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 389 |
1 files changed, 132 insertions, 257 deletions
diff --git a/src/buffer.c b/src/buffer.c index 589266f40e5..39fabf581bb 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -106,13 +106,11 @@ 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 | static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, |
| 110 | void set_buffer_internal_1 P_ ((struct buffer *b)); | 110 | int after, Lisp_Object arg1, |
| 111 | static void call_overlay_mod_hooks P_ ((Lisp_Object list, Lisp_Object overlay, | 111 | Lisp_Object arg2, Lisp_Object arg3); |
| 112 | int after, Lisp_Object arg1, | 112 | static void swap_out_buffer_local_variables (struct buffer *b); |
| 113 | Lisp_Object arg2, Lisp_Object arg3)); | 113 | static void reset_buffer_local_variables (struct buffer *b, int permanent_too); |
| 114 | static void swap_out_buffer_local_variables P_ ((struct buffer *b)); | ||
| 115 | static void reset_buffer_local_variables P_ ((struct buffer *b, int permanent_too)); | ||
| 116 | 114 | ||
| 117 | /* Alist of all buffer names vs the buffers. */ | 115 | /* Alist of all buffer names vs the buffers. */ |
| 118 | /* This used to be a variable, but is no longer, | 116 | /* This used to be a variable, but is no longer, |
| @@ -162,26 +160,23 @@ Lisp_Object Qget_file_buffer; | |||
| 162 | 160 | ||
| 163 | Lisp_Object Qoverlayp; | 161 | Lisp_Object Qoverlayp; |
| 164 | 162 | ||
| 165 | Lisp_Object Qpriority, Qwindow, Qevaporate, Qbefore_string, Qafter_string; | 163 | Lisp_Object Qpriority, Qevaporate, Qbefore_string, Qafter_string; |
| 166 | 164 | ||
| 167 | Lisp_Object Qmodification_hooks; | 165 | Lisp_Object Qmodification_hooks; |
| 168 | Lisp_Object Qinsert_in_front_hooks; | 166 | Lisp_Object Qinsert_in_front_hooks; |
| 169 | Lisp_Object Qinsert_behind_hooks; | 167 | Lisp_Object Qinsert_behind_hooks; |
| 170 | 168 | ||
| 171 | static void alloc_buffer_text P_ ((struct buffer *, size_t)); | 169 | static void alloc_buffer_text (struct buffer *, size_t); |
| 172 | static void free_buffer_text P_ ((struct buffer *b)); | 170 | static void free_buffer_text (struct buffer *b); |
| 173 | static struct Lisp_Overlay * copy_overlays P_ ((struct buffer *, struct Lisp_Overlay *)); | 171 | static struct Lisp_Overlay * copy_overlays (struct buffer *, struct Lisp_Overlay *); |
| 174 | static void modify_overlay P_ ((struct buffer *, EMACS_INT, EMACS_INT)); | 172 | static void modify_overlay (struct buffer *, EMACS_INT, EMACS_INT); |
| 175 | static Lisp_Object buffer_lisp_local_variables P_ ((struct buffer *)); | 173 | static Lisp_Object buffer_lisp_local_variables (struct buffer *); |
| 176 | |||
| 177 | extern char * emacs_strerror P_ ((int)); | ||
| 178 | 174 | ||
| 179 | /* For debugging; temporary. See set_buffer_internal. */ | 175 | /* For debugging; temporary. See set_buffer_internal. */ |
| 180 | /* Lisp_Object Qlisp_mode, Vcheck_symbol; */ | 176 | /* Lisp_Object Qlisp_mode, Vcheck_symbol; */ |
| 181 | 177 | ||
| 182 | void | 178 | void |
| 183 | nsberror (spec) | 179 | nsberror (Lisp_Object spec) |
| 184 | Lisp_Object spec; | ||
| 185 | { | 180 | { |
| 186 | if (STRINGP (spec)) | 181 | if (STRINGP (spec)) |
| 187 | error ("No buffer named %s", SDATA (spec)); | 182 | error ("No buffer named %s", SDATA (spec)); |
| @@ -191,8 +186,7 @@ nsberror (spec) | |||
| 191 | DEFUN ("buffer-live-p", Fbuffer_live_p, Sbuffer_live_p, 1, 1, 0, | 186 | 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. | 187 | 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. */) | 188 | Value is nil if OBJECT is not a buffer or if it has been killed. */) |
| 194 | (object) | 189 | (Lisp_Object object) |
| 195 | Lisp_Object object; | ||
| 196 | { | 190 | { |
| 197 | return ((BUFFERP (object) && ! NILP (XBUFFER (object)->name)) | 191 | return ((BUFFERP (object) && ! NILP (XBUFFER (object)->name)) |
| 198 | ? Qt : Qnil); | 192 | ? Qt : Qnil); |
| @@ -203,8 +197,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 | 197 | 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' | 198 | 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. */) | 199 | frame parameter come first, followed by the rest of the buffers. */) |
| 206 | (frame) | 200 | (Lisp_Object frame) |
| 207 | Lisp_Object frame; | ||
| 208 | { | 201 | { |
| 209 | Lisp_Object general; | 202 | Lisp_Object general; |
| 210 | general = Fmapcar (Qcdr, Vbuffer_alist); | 203 | general = Fmapcar (Qcdr, Vbuffer_alist); |
| @@ -248,9 +241,7 @@ frame parameter come first, followed by the rest of the buffers. */) | |||
| 248 | and don't ever QUIT. */ | 241 | and don't ever QUIT. */ |
| 249 | 242 | ||
| 250 | static Lisp_Object | 243 | static Lisp_Object |
| 251 | assoc_ignore_text_properties (key, list) | 244 | assoc_ignore_text_properties (register Lisp_Object key, Lisp_Object list) |
| 252 | register Lisp_Object key; | ||
| 253 | Lisp_Object list; | ||
| 254 | { | 245 | { |
| 255 | register Lisp_Object tail; | 246 | register Lisp_Object tail; |
| 256 | for (tail = list; CONSP (tail); tail = XCDR (tail)) | 247 | for (tail = list; CONSP (tail); tail = XCDR (tail)) |
| @@ -269,8 +260,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 | 260 | 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 | 261 | 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. */) | 262 | BUFFER-OR-NAME is a buffer, return it as given. */) |
| 272 | (buffer_or_name) | 263 | (register Lisp_Object buffer_or_name) |
| 273 | register Lisp_Object buffer_or_name; | ||
| 274 | { | 264 | { |
| 275 | if (BUFFERP (buffer_or_name)) | 265 | if (BUFFERP (buffer_or_name)) |
| 276 | return buffer_or_name; | 266 | return buffer_or_name; |
| @@ -284,8 +274,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. | 274 | The buffer's `buffer-file-name' must match exactly the expansion of FILENAME. |
| 285 | If there is no such live buffer, return nil. | 275 | If there is no such live buffer, return nil. |
| 286 | See also `find-buffer-visiting'. */) | 276 | See also `find-buffer-visiting'. */) |
| 287 | (filename) | 277 | (register Lisp_Object filename) |
| 288 | register Lisp_Object filename; | ||
| 289 | { | 278 | { |
| 290 | register Lisp_Object tail, buf, tem; | 279 | register Lisp_Object tail, buf, tem; |
| 291 | Lisp_Object handler; | 280 | Lisp_Object handler; |
| @@ -312,8 +301,7 @@ See also `find-buffer-visiting'. */) | |||
| 312 | } | 301 | } |
| 313 | 302 | ||
| 314 | Lisp_Object | 303 | Lisp_Object |
| 315 | get_truename_buffer (filename) | 304 | get_truename_buffer (register Lisp_Object filename) |
| 316 | register Lisp_Object filename; | ||
| 317 | { | 305 | { |
| 318 | register Lisp_Object tail, buf, tem; | 306 | register Lisp_Object tail, buf, tem; |
| 319 | 307 | ||
| @@ -341,8 +329,7 @@ buffer does not keep undo information. | |||
| 341 | 329 | ||
| 342 | If BUFFER-OR-NAME is a buffer instead of a string, return it as given, | 330 | 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. */) | 331 | even if it is dead. The return value is never nil. */) |
| 344 | (buffer_or_name) | 332 | (register Lisp_Object buffer_or_name) |
| 345 | register Lisp_Object buffer_or_name; | ||
| 346 | { | 333 | { |
| 347 | register Lisp_Object buffer, name; | 334 | register Lisp_Object buffer, name; |
| 348 | register struct buffer *b; | 335 | register struct buffer *b; |
| @@ -437,9 +424,7 @@ even if it is dead. The return value is never nil. */) | |||
| 437 | LIST, but for buffer B. */ | 424 | LIST, but for buffer B. */ |
| 438 | 425 | ||
| 439 | static struct Lisp_Overlay * | 426 | static struct Lisp_Overlay * |
| 440 | copy_overlays (b, list) | 427 | copy_overlays (struct buffer *b, struct Lisp_Overlay *list) |
| 441 | struct buffer *b; | ||
| 442 | struct Lisp_Overlay *list; | ||
| 443 | { | 428 | { |
| 444 | Lisp_Object buffer; | 429 | Lisp_Object buffer; |
| 445 | struct Lisp_Overlay *result = NULL, *tail = NULL; | 430 | struct Lisp_Overlay *result = NULL, *tail = NULL; |
| @@ -489,8 +474,7 @@ copy_overlays (b, list) | |||
| 489 | copied. */ | 474 | copied. */ |
| 490 | 475 | ||
| 491 | static void | 476 | static void |
| 492 | clone_per_buffer_values (from, to) | 477 | clone_per_buffer_values (struct buffer *from, struct buffer *to) |
| 493 | struct buffer *from, *to; | ||
| 494 | { | 478 | { |
| 495 | Lisp_Object to_buffer; | 479 | Lisp_Object to_buffer; |
| 496 | int offset; | 480 | int offset; |
| @@ -521,7 +505,7 @@ clone_per_buffer_values (from, to) | |||
| 521 | PER_BUFFER_VALUE (to, offset) = obj; | 505 | PER_BUFFER_VALUE (to, offset) = obj; |
| 522 | } | 506 | } |
| 523 | 507 | ||
| 524 | bcopy (from->local_flags, to->local_flags, sizeof to->local_flags); | 508 | memcpy (to->local_flags, from->local_flags, sizeof to->local_flags); |
| 525 | 509 | ||
| 526 | to->overlays_before = copy_overlays (to, from->overlays_before); | 510 | to->overlays_before = copy_overlays (to, from->overlays_before); |
| 527 | to->overlays_after = copy_overlays (to, from->overlays_after); | 511 | to->overlays_after = copy_overlays (to, from->overlays_after); |
| @@ -540,8 +524,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, | 524 | Optional argument CLONE non-nil means preserve BASE-BUFFER's state, |
| 541 | such as major and minor modes, in the indirect buffer. | 525 | such as major and minor modes, in the indirect buffer. |
| 542 | CLONE nil means the indirect buffer's state is reset to default values. */) | 526 | CLONE nil means the indirect buffer's state is reset to default values. */) |
| 543 | (base_buffer, name, clone) | 527 | (Lisp_Object base_buffer, Lisp_Object name, Lisp_Object clone) |
| 544 | Lisp_Object base_buffer, name, clone; | ||
| 545 | { | 528 | { |
| 546 | Lisp_Object buf, tem; | 529 | Lisp_Object buf, tem; |
| 547 | struct buffer *b; | 530 | struct buffer *b; |
| @@ -658,8 +641,7 @@ CLONE nil means the indirect buffer's state is reset to default values. */) | |||
| 658 | } | 641 | } |
| 659 | 642 | ||
| 660 | void | 643 | void |
| 661 | delete_all_overlays (b) | 644 | delete_all_overlays (struct buffer *b) |
| 662 | struct buffer *b; | ||
| 663 | { | 645 | { |
| 664 | Lisp_Object overlay; | 646 | Lisp_Object overlay; |
| 665 | 647 | ||
| @@ -689,8 +671,7 @@ delete_all_overlays (b) | |||
| 689 | claims it doesn't belong to it. */ | 671 | claims it doesn't belong to it. */ |
| 690 | 672 | ||
| 691 | void | 673 | void |
| 692 | reset_buffer (b) | 674 | reset_buffer (register struct buffer *b) |
| 693 | register struct buffer *b; | ||
| 694 | { | 675 | { |
| 695 | b->filename = Qnil; | 676 | b->filename = Qnil; |
| 696 | b->file_truename = Qnil; | 677 | b->file_truename = Qnil; |
| @@ -734,9 +715,7 @@ reset_buffer (b) | |||
| 734 | we preserve those. */ | 715 | we preserve those. */ |
| 735 | 716 | ||
| 736 | static void | 717 | static void |
| 737 | reset_buffer_local_variables (b, permanent_too) | 718 | reset_buffer_local_variables (register struct buffer *b, int permanent_too) |
| 738 | register struct buffer *b; | ||
| 739 | int permanent_too; | ||
| 740 | { | 719 | { |
| 741 | register int offset; | 720 | register int offset; |
| 742 | int i; | 721 | int i; |
| @@ -840,8 +819,7 @@ Otherwise modify name by appending `<NUMBER>', incrementing NUMBER | |||
| 840 | \(starting at 2) until an unused name is found, and then return that name. | 819 | \(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 | 820 | 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. */) | 821 | it is in the sequence to be tried) even if a buffer with that name exists. */) |
| 843 | (name, ignore) | 822 | (register Lisp_Object name, Lisp_Object ignore) |
| 844 | register Lisp_Object name, ignore; | ||
| 845 | { | 823 | { |
| 846 | register Lisp_Object gentemp, tem; | 824 | register Lisp_Object gentemp, tem; |
| 847 | int count; | 825 | int count; |
| @@ -875,8 +853,7 @@ DEFUN ("buffer-name", Fbuffer_name, Sbuffer_name, 0, 1, 0, | |||
| 875 | doc: /* Return the name of BUFFER, as a string. | 853 | doc: /* Return the name of BUFFER, as a string. |
| 876 | BUFFER defaults to the current buffer. | 854 | BUFFER defaults to the current buffer. |
| 877 | Return nil if BUFFER has been killed. */) | 855 | Return nil if BUFFER has been killed. */) |
| 878 | (buffer) | 856 | (register Lisp_Object buffer) |
| 879 | register Lisp_Object buffer; | ||
| 880 | { | 857 | { |
| 881 | if (NILP (buffer)) | 858 | if (NILP (buffer)) |
| 882 | return current_buffer->name; | 859 | return current_buffer->name; |
| @@ -887,8 +864,7 @@ Return nil if BUFFER has been killed. */) | |||
| 887 | DEFUN ("buffer-file-name", Fbuffer_file_name, Sbuffer_file_name, 0, 1, 0, | 864 | 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. | 865 | doc: /* Return name of file BUFFER is visiting, or nil if none. |
| 889 | No argument or nil as argument means use the current buffer. */) | 866 | No argument or nil as argument means use the current buffer. */) |
| 890 | (buffer) | 867 | (register Lisp_Object buffer) |
| 891 | register Lisp_Object buffer; | ||
| 892 | { | 868 | { |
| 893 | if (NILP (buffer)) | 869 | if (NILP (buffer)) |
| 894 | return current_buffer->filename; | 870 | return current_buffer->filename; |
| @@ -901,8 +877,7 @@ DEFUN ("buffer-base-buffer", Fbuffer_base_buffer, Sbuffer_base_buffer, | |||
| 901 | doc: /* Return the base buffer of indirect buffer BUFFER. | 877 | doc: /* Return the base buffer of indirect buffer BUFFER. |
| 902 | If BUFFER is not indirect, return nil. | 878 | If BUFFER is not indirect, return nil. |
| 903 | BUFFER defaults to the current buffer. */) | 879 | BUFFER defaults to the current buffer. */) |
| 904 | (buffer) | 880 | (register Lisp_Object buffer) |
| 905 | register Lisp_Object buffer; | ||
| 906 | { | 881 | { |
| 907 | struct buffer *base; | 882 | struct buffer *base; |
| 908 | Lisp_Object base_buffer; | 883 | Lisp_Object base_buffer; |
| @@ -926,9 +901,7 @@ DEFUN ("buffer-local-value", Fbuffer_local_value, | |||
| 926 | doc: /* Return the value of VARIABLE in BUFFER. | 901 | doc: /* Return the value of VARIABLE in BUFFER. |
| 927 | If VARIABLE does not have a buffer-local binding in BUFFER, the value | 902 | If VARIABLE does not have a buffer-local binding in BUFFER, the value |
| 928 | is the default binding of the variable. */) | 903 | is the default binding of the variable. */) |
| 929 | (variable, buffer) | 904 | (register Lisp_Object variable, register Lisp_Object buffer) |
| 930 | register Lisp_Object variable; | ||
| 931 | register Lisp_Object buffer; | ||
| 932 | { | 905 | { |
| 933 | register struct buffer *buf; | 906 | register struct buffer *buf; |
| 934 | register Lisp_Object result; | 907 | register Lisp_Object result; |
| @@ -993,8 +966,7 @@ is the default binding of the variable. */) | |||
| 993 | in special slots in the buffer object. */ | 966 | in special slots in the buffer object. */ |
| 994 | 967 | ||
| 995 | static Lisp_Object | 968 | static Lisp_Object |
| 996 | buffer_lisp_local_variables (buf) | 969 | buffer_lisp_local_variables (struct buffer *buf) |
| 997 | struct buffer *buf; | ||
| 998 | { | 970 | { |
| 999 | Lisp_Object result = Qnil; | 971 | Lisp_Object result = Qnil; |
| 1000 | register Lisp_Object tail; | 972 | register Lisp_Object tail; |
| @@ -1027,8 +999,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. | 999 | 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. | 1000 | 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. */) | 1001 | No argument or nil as argument means use current buffer as BUFFER. */) |
| 1030 | (buffer) | 1002 | (register Lisp_Object buffer) |
| 1031 | register Lisp_Object buffer; | ||
| 1032 | { | 1003 | { |
| 1033 | register struct buffer *buf; | 1004 | register struct buffer *buf; |
| 1034 | register Lisp_Object result; | 1005 | register Lisp_Object result; |
| @@ -1070,8 +1041,7 @@ DEFUN ("buffer-modified-p", Fbuffer_modified_p, Sbuffer_modified_p, | |||
| 1070 | 0, 1, 0, | 1041 | 0, 1, 0, |
| 1071 | doc: /* Return t if BUFFER was modified since its file was last read or saved. | 1042 | 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. */) | 1043 | No argument or nil as argument means use current buffer as BUFFER. */) |
| 1073 | (buffer) | 1044 | (register Lisp_Object buffer) |
| 1074 | register Lisp_Object buffer; | ||
| 1075 | { | 1045 | { |
| 1076 | register struct buffer *buf; | 1046 | register struct buffer *buf; |
| 1077 | if (NILP (buffer)) | 1047 | if (NILP (buffer)) |
| @@ -1089,8 +1059,7 @@ DEFUN ("set-buffer-modified-p", Fset_buffer_modified_p, Sset_buffer_modified_p, | |||
| 1089 | 1, 1, 0, | 1059 | 1, 1, 0, |
| 1090 | doc: /* Mark current buffer as modified or unmodified according to FLAG. | 1060 | doc: /* Mark current buffer as modified or unmodified according to FLAG. |
| 1091 | A non-nil FLAG means mark the buffer modified. */) | 1061 | A non-nil FLAG means mark the buffer modified. */) |
| 1092 | (flag) | 1062 | (register Lisp_Object flag) |
| 1093 | register Lisp_Object flag; | ||
| 1094 | { | 1063 | { |
| 1095 | register int already; | 1064 | register int already; |
| 1096 | register Lisp_Object fn; | 1065 | register Lisp_Object fn; |
| @@ -1159,8 +1128,7 @@ DEFUN ("restore-buffer-modified-p", Frestore_buffer_modified_p, | |||
| 1159 | doc: /* Like `set-buffer-modified-p', with a difference concerning redisplay. | 1128 | 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 | 1129 | It is not ensured that mode lines will be updated to show the modified |
| 1161 | state of the current buffer. Use with care. */) | 1130 | state of the current buffer. Use with care. */) |
| 1162 | (flag) | 1131 | (Lisp_Object flag) |
| 1163 | Lisp_Object flag; | ||
| 1164 | { | 1132 | { |
| 1165 | #ifdef CLASH_DETECTION | 1133 | #ifdef CLASH_DETECTION |
| 1166 | Lisp_Object fn; | 1134 | Lisp_Object fn; |
| @@ -1190,8 +1158,7 @@ DEFUN ("buffer-modified-tick", Fbuffer_modified_tick, Sbuffer_modified_tick, | |||
| 1190 | Each buffer has a tick counter which is incremented each time the | 1158 | Each buffer has a tick counter which is incremented each time the |
| 1191 | text in that buffer is changed. It wraps around occasionally. | 1159 | text in that buffer is changed. It wraps around occasionally. |
| 1192 | No argument or nil as argument means use current buffer as BUFFER. */) | 1160 | No argument or nil as argument means use current buffer as BUFFER. */) |
| 1193 | (buffer) | 1161 | (register Lisp_Object buffer) |
| 1194 | register Lisp_Object buffer; | ||
| 1195 | { | 1162 | { |
| 1196 | register struct buffer *buf; | 1163 | register struct buffer *buf; |
| 1197 | if (NILP (buffer)) | 1164 | if (NILP (buffer)) |
| @@ -1215,8 +1182,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 | 1182 | 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 | 1183 | between these calls. No argument or nil as argument means use current |
| 1217 | buffer as BUFFER. */) | 1184 | buffer as BUFFER. */) |
| 1218 | (buffer) | 1185 | (register Lisp_Object buffer) |
| 1219 | register Lisp_Object buffer; | ||
| 1220 | { | 1186 | { |
| 1221 | register struct buffer *buf; | 1187 | register struct buffer *buf; |
| 1222 | if (NILP (buffer)) | 1188 | if (NILP (buffer)) |
| @@ -1242,8 +1208,7 @@ If UNIQUE is non-nil, come up with a new name using | |||
| 1242 | Interactively, you can set UNIQUE with a prefix argument. | 1208 | Interactively, you can set UNIQUE with a prefix argument. |
| 1243 | We return the name we actually gave the buffer. | 1209 | We return the name we actually gave the buffer. |
| 1244 | This does not change the name of the visited file (if any). */) | 1210 | This does not change the name of the visited file (if any). */) |
| 1245 | (newname, unique) | 1211 | (register Lisp_Object newname, Lisp_Object unique) |
| 1246 | register Lisp_Object newname, unique; | ||
| 1247 | { | 1212 | { |
| 1248 | register Lisp_Object tem, buf; | 1213 | register Lisp_Object tem, buf; |
| 1249 | 1214 | ||
| @@ -1290,10 +1255,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. | 1255 | buffer list instead of the selected frame's buffer list. |
| 1291 | If no other buffer exists, the buffer `*scratch*' is returned. | 1256 | If no other buffer exists, the buffer `*scratch*' is returned. |
| 1292 | If BUFFER is omitted or nil, some interesting buffer is returned. */) | 1257 | If BUFFER is omitted or nil, some interesting buffer is returned. */) |
| 1293 | (buffer, visible_ok, frame) | 1258 | (register Lisp_Object buffer, Lisp_Object visible_ok, Lisp_Object frame) |
| 1294 | register Lisp_Object buffer, visible_ok, frame; | ||
| 1295 | { | 1259 | { |
| 1296 | Lisp_Object Fset_buffer_major_mode (); | 1260 | Lisp_Object Fset_buffer_major_mode (Lisp_Object buffer); |
| 1297 | register Lisp_Object tail, buf, notsogood, tem, pred, add_ons; | 1261 | register Lisp_Object tail, buf, notsogood, tem, pred, add_ons; |
| 1298 | notsogood = Qnil; | 1262 | notsogood = Qnil; |
| 1299 | 1263 | ||
| @@ -1362,8 +1326,7 @@ DEFUN ("buffer-enable-undo", Fbuffer_enable_undo, Sbuffer_enable_undo, | |||
| 1362 | 0, 1, "", | 1326 | 0, 1, "", |
| 1363 | doc: /* Start keeping undo information for buffer BUFFER. | 1327 | doc: /* Start keeping undo information for buffer BUFFER. |
| 1364 | No argument or nil as argument means do this for the current buffer. */) | 1328 | No argument or nil as argument means do this for the current buffer. */) |
| 1365 | (buffer) | 1329 | (register Lisp_Object buffer) |
| 1366 | register Lisp_Object buffer; | ||
| 1367 | { | 1330 | { |
| 1368 | Lisp_Object real_buffer; | 1331 | Lisp_Object real_buffer; |
| 1369 | 1332 | ||
| @@ -1404,8 +1367,7 @@ is running. | |||
| 1404 | 1367 | ||
| 1405 | Any processes that have this buffer as the `process-buffer' are killed | 1368 | Any processes that have this buffer as the `process-buffer' are killed |
| 1406 | with SIGHUP. */) | 1369 | with SIGHUP. */) |
| 1407 | (buffer_or_name) | 1370 | (Lisp_Object buffer_or_name) |
| 1408 | Lisp_Object buffer_or_name; | ||
| 1409 | { | 1371 | { |
| 1410 | Lisp_Object buffer; | 1372 | Lisp_Object buffer; |
| 1411 | register struct buffer *b; | 1373 | register struct buffer *b; |
| @@ -1618,8 +1580,7 @@ with SIGHUP. */) | |||
| 1618 | means that other_buffer is more likely to choose a relevant buffer. */ | 1580 | means that other_buffer is more likely to choose a relevant buffer. */ |
| 1619 | 1581 | ||
| 1620 | void | 1582 | void |
| 1621 | record_buffer (buf) | 1583 | record_buffer (Lisp_Object buf) |
| 1622 | Lisp_Object buf; | ||
| 1623 | { | 1584 | { |
| 1624 | register Lisp_Object link, prev; | 1585 | register Lisp_Object link, prev; |
| 1625 | Lisp_Object frame; | 1586 | Lisp_Object frame; |
| @@ -1695,8 +1656,7 @@ For the *scratch* buffer, use `initial-major-mode', otherwise choose a mode | |||
| 1695 | according to `default-major-mode'. | 1656 | according to `default-major-mode'. |
| 1696 | Use this function before selecting the buffer, since it may need to inspect | 1657 | Use this function before selecting the buffer, since it may need to inspect |
| 1697 | the current buffer's major mode. */) | 1658 | the current buffer's major mode. */) |
| 1698 | (buffer) | 1659 | (Lisp_Object buffer) |
| 1699 | Lisp_Object buffer; | ||
| 1700 | { | 1660 | { |
| 1701 | int count; | 1661 | int count; |
| 1702 | Lisp_Object function; | 1662 | Lisp_Object function; |
| @@ -1734,8 +1694,7 @@ the current buffer's major mode. */) | |||
| 1734 | If NORECORD is non-nil, don't call record_buffer. */ | 1694 | If NORECORD is non-nil, don't call record_buffer. */ |
| 1735 | 1695 | ||
| 1736 | Lisp_Object | 1696 | Lisp_Object |
| 1737 | switch_to_buffer_1 (buffer_or_name, norecord) | 1697 | switch_to_buffer_1 (Lisp_Object buffer_or_name, Lisp_Object norecord) |
| 1738 | Lisp_Object buffer_or_name, norecord; | ||
| 1739 | { | 1698 | { |
| 1740 | register Lisp_Object buffer; | 1699 | register Lisp_Object buffer; |
| 1741 | 1700 | ||
| @@ -1784,8 +1743,7 @@ its buffer, use `pop-to-buffer' for displaying the buffer. | |||
| 1784 | WARNING: This is NOT the way to work on another buffer temporarily | 1743 | WARNING: This is NOT the way to work on another buffer temporarily |
| 1785 | within a Lisp program! Use `set-buffer' instead. That avoids | 1744 | within a Lisp program! Use `set-buffer' instead. That avoids |
| 1786 | messing with the window-buffer correspondences. */) | 1745 | messing with the window-buffer correspondences. */) |
| 1787 | (buffer_or_name, norecord) | 1746 | (Lisp_Object buffer_or_name, Lisp_Object norecord) |
| 1788 | Lisp_Object buffer_or_name, norecord; | ||
| 1789 | { | 1747 | { |
| 1790 | if (EQ (buffer_or_name, Fwindow_buffer (selected_window))) | 1748 | if (EQ (buffer_or_name, Fwindow_buffer (selected_window))) |
| 1791 | { | 1749 | { |
| @@ -1814,7 +1772,7 @@ messing with the window-buffer correspondences. */) | |||
| 1814 | 1772 | ||
| 1815 | DEFUN ("current-buffer", Fcurrent_buffer, Scurrent_buffer, 0, 0, 0, | 1773 | DEFUN ("current-buffer", Fcurrent_buffer, Scurrent_buffer, 0, 0, 0, |
| 1816 | doc: /* Return the current buffer as a Lisp object. */) | 1774 | doc: /* Return the current buffer as a Lisp object. */) |
| 1817 | () | 1775 | (void) |
| 1818 | { | 1776 | { |
| 1819 | register Lisp_Object buf; | 1777 | register Lisp_Object buf; |
| 1820 | XSETBUFFER (buf, current_buffer); | 1778 | XSETBUFFER (buf, current_buffer); |
| @@ -1831,8 +1789,7 @@ DEFUN ("current-buffer", Fcurrent_buffer, Scurrent_buffer, 0, 0, 0, | |||
| 1831 | time, and that increments windows_or_buffers_changed. */ | 1789 | time, and that increments windows_or_buffers_changed. */ |
| 1832 | 1790 | ||
| 1833 | void | 1791 | void |
| 1834 | set_buffer_internal (b) | 1792 | set_buffer_internal (register struct buffer *b) |
| 1835 | register struct buffer *b; | ||
| 1836 | { | 1793 | { |
| 1837 | if (current_buffer != b) | 1794 | if (current_buffer != b) |
| 1838 | set_buffer_internal_1 (b); | 1795 | set_buffer_internal_1 (b); |
| @@ -1842,8 +1799,7 @@ set_buffer_internal (b) | |||
| 1842 | This is used by redisplay. */ | 1799 | This is used by redisplay. */ |
| 1843 | 1800 | ||
| 1844 | void | 1801 | void |
| 1845 | set_buffer_internal_1 (b) | 1802 | set_buffer_internal_1 (register struct buffer *b) |
| 1846 | register struct buffer *b; | ||
| 1847 | { | 1803 | { |
| 1848 | register struct buffer *old_buf; | 1804 | register struct buffer *old_buf; |
| 1849 | register Lisp_Object tail; | 1805 | register Lisp_Object tail; |
| @@ -1939,8 +1895,7 @@ set_buffer_internal_1 (b) | |||
| 1939 | This avoids certain things that don't need to be done within redisplay. */ | 1895 | This avoids certain things that don't need to be done within redisplay. */ |
| 1940 | 1896 | ||
| 1941 | void | 1897 | void |
| 1942 | set_buffer_temp (b) | 1898 | set_buffer_temp (struct buffer *b) |
| 1943 | struct buffer *b; | ||
| 1944 | { | 1899 | { |
| 1945 | register struct buffer *old_buf; | 1900 | register struct buffer *old_buf; |
| 1946 | 1901 | ||
| @@ -2003,8 +1958,7 @@ also `save-excursion' when you want to make a buffer current | |||
| 2003 | temporarily. This function does not display the buffer, so its effect | 1958 | temporarily. This function does not display the buffer, so its effect |
| 2004 | ends when the current command terminates. Use `switch-to-buffer' or | 1959 | ends when the current command terminates. Use `switch-to-buffer' or |
| 2005 | `pop-to-buffer' to switch buffers permanently. */) | 1960 | `pop-to-buffer' to switch buffers permanently. */) |
| 2006 | (buffer_or_name) | 1961 | (register Lisp_Object buffer_or_name) |
| 2007 | register Lisp_Object buffer_or_name; | ||
| 2008 | { | 1962 | { |
| 2009 | register Lisp_Object buffer; | 1963 | register Lisp_Object buffer; |
| 2010 | buffer = Fget_buffer (buffer_or_name); | 1964 | buffer = Fget_buffer (buffer_or_name); |
| @@ -2019,8 +1973,7 @@ ends when the current command terminates. Use `switch-to-buffer' or | |||
| 2019 | /* Set the current buffer to BUFFER provided it is alive. */ | 1973 | /* Set the current buffer to BUFFER provided it is alive. */ |
| 2020 | 1974 | ||
| 2021 | Lisp_Object | 1975 | Lisp_Object |
| 2022 | set_buffer_if_live (buffer) | 1976 | set_buffer_if_live (Lisp_Object buffer) |
| 2023 | Lisp_Object buffer; | ||
| 2024 | { | 1977 | { |
| 2025 | if (! NILP (XBUFFER (buffer)->name)) | 1978 | if (! NILP (XBUFFER (buffer)->name)) |
| 2026 | Fset_buffer (buffer); | 1979 | Fset_buffer (buffer); |
| @@ -2030,7 +1983,7 @@ set_buffer_if_live (buffer) | |||
| 2030 | DEFUN ("barf-if-buffer-read-only", Fbarf_if_buffer_read_only, | 1983 | DEFUN ("barf-if-buffer-read-only", Fbarf_if_buffer_read_only, |
| 2031 | Sbarf_if_buffer_read_only, 0, 0, 0, | 1984 | Sbarf_if_buffer_read_only, 0, 0, 0, |
| 2032 | doc: /* Signal a `buffer-read-only' error if the current buffer is read-only. */) | 1985 | doc: /* Signal a `buffer-read-only' error if the current buffer is read-only. */) |
| 2033 | () | 1986 | (void) |
| 2034 | { | 1987 | { |
| 2035 | if (!NILP (current_buffer->read_only) | 1988 | if (!NILP (current_buffer->read_only) |
| 2036 | && NILP (Vinhibit_read_only)) | 1989 | && NILP (Vinhibit_read_only)) |
| @@ -2050,8 +2003,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 | 2003 | 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 | 2004 | windows on the same frame. If the selected window is the only window on |
| 2052 | its frame, iconify that frame. */) | 2005 | its frame, iconify that frame. */) |
| 2053 | (buffer_or_name) | 2006 | (register Lisp_Object buffer_or_name) |
| 2054 | register Lisp_Object buffer_or_name; | ||
| 2055 | { | 2007 | { |
| 2056 | Lisp_Object buffer; | 2008 | Lisp_Object buffer; |
| 2057 | 2009 | ||
| @@ -2105,7 +2057,7 @@ DEFUN ("erase-buffer", Ferase_buffer, Serase_buffer, 0, 0, "*", | |||
| 2105 | doc: /* Delete the entire contents of the current buffer. | 2057 | doc: /* Delete the entire contents of the current buffer. |
| 2106 | Any narrowing restriction in effect (see `narrow-to-region') is removed, | 2058 | Any narrowing restriction in effect (see `narrow-to-region') is removed, |
| 2107 | so the buffer is truly empty after this. */) | 2059 | so the buffer is truly empty after this. */) |
| 2108 | () | 2060 | (void) |
| 2109 | { | 2061 | { |
| 2110 | Fwiden (); | 2062 | Fwiden (); |
| 2111 | 2063 | ||
| @@ -2120,8 +2072,7 @@ so the buffer is truly empty after this. */) | |||
| 2120 | } | 2072 | } |
| 2121 | 2073 | ||
| 2122 | void | 2074 | void |
| 2123 | validate_region (b, e) | 2075 | validate_region (register Lisp_Object *b, register Lisp_Object *e) |
| 2124 | register Lisp_Object *b, *e; | ||
| 2125 | { | 2076 | { |
| 2126 | CHECK_NUMBER_COERCE_MARKER (*b); | 2077 | CHECK_NUMBER_COERCE_MARKER (*b); |
| 2127 | CHECK_NUMBER_COERCE_MARKER (*e); | 2078 | CHECK_NUMBER_COERCE_MARKER (*e); |
| @@ -2141,8 +2092,7 @@ validate_region (b, e) | |||
| 2141 | and return the adjusted position. */ | 2092 | and return the adjusted position. */ |
| 2142 | 2093 | ||
| 2143 | static int | 2094 | static int |
| 2144 | advance_to_char_boundary (byte_pos) | 2095 | advance_to_char_boundary (int byte_pos) |
| 2145 | int byte_pos; | ||
| 2146 | { | 2096 | { |
| 2147 | int c; | 2097 | int c; |
| 2148 | 2098 | ||
| @@ -2175,14 +2125,13 @@ advance_to_char_boundary (byte_pos) | |||
| 2175 | } | 2125 | } |
| 2176 | 2126 | ||
| 2177 | #ifdef REL_ALLOC | 2127 | #ifdef REL_ALLOC |
| 2178 | extern void r_alloc_reset_variable P_ ((POINTER_TYPE *, POINTER_TYPE *)); | 2128 | extern void r_alloc_reset_variable (POINTER_TYPE *, POINTER_TYPE *); |
| 2179 | #endif /* REL_ALLOC */ | 2129 | #endif /* REL_ALLOC */ |
| 2180 | 2130 | ||
| 2181 | DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text, | 2131 | DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text, |
| 2182 | 1, 1, 0, | 2132 | 1, 1, 0, |
| 2183 | doc: /* Swap the text between current buffer and BUFFER. */) | 2133 | doc: /* Swap the text between current buffer and BUFFER. */) |
| 2184 | (buffer) | 2134 | (Lisp_Object buffer) |
| 2185 | Lisp_Object buffer; | ||
| 2186 | { | 2135 | { |
| 2187 | struct buffer *other_buffer; | 2136 | struct buffer *other_buffer; |
| 2188 | CHECK_BUFFER (buffer); | 2137 | CHECK_BUFFER (buffer); |
| @@ -2320,8 +2269,7 @@ If FLAG is `to', this makes the buffer a multibyte buffer by changing | |||
| 2320 | all eight-bit bytes to eight-bit characters. | 2269 | all eight-bit bytes to eight-bit characters. |
| 2321 | If the multibyte flag was really changed, undo information of the | 2270 | If the multibyte flag was really changed, undo information of the |
| 2322 | current buffer is cleared. */) | 2271 | current buffer is cleared. */) |
| 2323 | (flag) | 2272 | (Lisp_Object flag) |
| 2324 | Lisp_Object flag; | ||
| 2325 | { | 2273 | { |
| 2326 | struct Lisp_Marker *tail, *markers; | 2274 | struct Lisp_Marker *tail, *markers; |
| 2327 | struct buffer *other; | 2275 | struct buffer *other; |
| @@ -2560,7 +2508,6 @@ current buffer is cleared. */) | |||
| 2560 | if (!EQ (old_undo, Qt)) | 2508 | if (!EQ (old_undo, Qt)) |
| 2561 | { | 2509 | { |
| 2562 | /* Represent all the above changes by a special undo entry. */ | 2510 | /* Represent all the above changes by a special undo entry. */ |
| 2563 | extern Lisp_Object Qapply; | ||
| 2564 | current_buffer->undo_list = Fcons (list3 (Qapply, | 2511 | current_buffer->undo_list = Fcons (list3 (Qapply, |
| 2565 | intern ("set-buffer-multibyte"), | 2512 | intern ("set-buffer-multibyte"), |
| 2566 | NILP (flag) ? Qt : Qnil), | 2513 | NILP (flag) ? Qt : Qnil), |
| @@ -2588,7 +2535,6 @@ current buffer is cleared. */) | |||
| 2588 | if (!modified_p && !NILP (Fbuffer_modified_p (Qnil))) | 2535 | if (!modified_p && !NILP (Fbuffer_modified_p (Qnil))) |
| 2589 | Fset_buffer_modified_p (Qnil); | 2536 | Fset_buffer_modified_p (Qnil); |
| 2590 | 2537 | ||
| 2591 | #ifdef subprocesses | ||
| 2592 | /* Update coding systems of this buffer's process (if any). */ | 2538 | /* Update coding systems of this buffer's process (if any). */ |
| 2593 | { | 2539 | { |
| 2594 | Lisp_Object process; | 2540 | Lisp_Object process; |
| @@ -2597,7 +2543,6 @@ current buffer is cleared. */) | |||
| 2597 | if (PROCESSP (process)) | 2543 | if (PROCESSP (process)) |
| 2598 | setup_process_coding_systems (process); | 2544 | setup_process_coding_systems (process); |
| 2599 | } | 2545 | } |
| 2600 | #endif /* subprocesses */ | ||
| 2601 | 2546 | ||
| 2602 | return flag; | 2547 | return flag; |
| 2603 | } | 2548 | } |
| @@ -2619,7 +2564,7 @@ a non-nil `permanent-local' property are not eliminated by this function. | |||
| 2619 | 2564 | ||
| 2620 | The first thing this function does is run | 2565 | The first thing this function does is run |
| 2621 | the normal hook `change-major-mode-hook'. */) | 2566 | the normal hook `change-major-mode-hook'. */) |
| 2622 | () | 2567 | (void) |
| 2623 | { | 2568 | { |
| 2624 | if (!NILP (Vrun_hooks)) | 2569 | if (!NILP (Vrun_hooks)) |
| 2625 | call1 (Vrun_hooks, Qchange_major_mode_hook); | 2570 | call1 (Vrun_hooks, Qchange_major_mode_hook); |
| @@ -2644,8 +2589,7 @@ the normal hook `change-major-mode-hook'. */) | |||
| 2644 | for their current values. */ | 2589 | for their current values. */ |
| 2645 | 2590 | ||
| 2646 | static void | 2591 | static void |
| 2647 | swap_out_buffer_local_variables (b) | 2592 | swap_out_buffer_local_variables (struct buffer *b) |
| 2648 | struct buffer *b; | ||
| 2649 | { | 2593 | { |
| 2650 | Lisp_Object oalist, alist, buffer; | 2594 | Lisp_Object oalist, alist, buffer; |
| 2651 | 2595 | ||
| @@ -2690,14 +2634,8 @@ swap_out_buffer_local_variables (b) | |||
| 2690 | default (BEGV or ZV). */ | 2634 | default (BEGV or ZV). */ |
| 2691 | 2635 | ||
| 2692 | int | 2636 | int |
| 2693 | overlays_at (pos, extend, vec_ptr, len_ptr, next_ptr, prev_ptr, change_req) | 2637 | overlays_at (EMACS_INT pos, int extend, Lisp_Object **vec_ptr, int *len_ptr, |
| 2694 | EMACS_INT pos; | 2638 | 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 | { | 2639 | { |
| 2702 | Lisp_Object overlay, start, end; | 2640 | Lisp_Object overlay, start, end; |
| 2703 | struct Lisp_Overlay *tail; | 2641 | struct Lisp_Overlay *tail; |
| @@ -2835,13 +2773,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. */ | 2773 | But we still return the total number of overlays. */ |
| 2836 | 2774 | ||
| 2837 | static int | 2775 | static int |
| 2838 | overlays_in (beg, end, extend, vec_ptr, len_ptr, next_ptr, prev_ptr) | 2776 | overlays_in (int beg, int end, int extend, Lisp_Object **vec_ptr, int *len_ptr, |
| 2839 | int beg, end; | 2777 | 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 | { | 2778 | { |
| 2846 | Lisp_Object overlay, ostart, oend; | 2779 | Lisp_Object overlay, ostart, oend; |
| 2847 | struct Lisp_Overlay *tail; | 2780 | struct Lisp_Overlay *tail; |
| @@ -2962,8 +2895,7 @@ overlays_in (beg, end, extend, vec_ptr, len_ptr, next_ptr, prev_ptr) | |||
| 2962 | `mouse-face' property overlapping OVERLAY. */ | 2895 | `mouse-face' property overlapping OVERLAY. */ |
| 2963 | 2896 | ||
| 2964 | int | 2897 | int |
| 2965 | mouse_face_overlay_overlaps (overlay) | 2898 | mouse_face_overlay_overlaps (Lisp_Object overlay) |
| 2966 | Lisp_Object overlay; | ||
| 2967 | { | 2899 | { |
| 2968 | int start = OVERLAY_POSITION (OVERLAY_START (overlay)); | 2900 | int start = OVERLAY_POSITION (OVERLAY_START (overlay)); |
| 2969 | int end = OVERLAY_POSITION (OVERLAY_END (overlay)); | 2901 | int end = OVERLAY_POSITION (OVERLAY_END (overlay)); |
| @@ -2992,8 +2924,7 @@ mouse_face_overlay_overlaps (overlay) | |||
| 2992 | 2924 | ||
| 2993 | /* Fast function to just test if we're at an overlay boundary. */ | 2925 | /* Fast function to just test if we're at an overlay boundary. */ |
| 2994 | int | 2926 | int |
| 2995 | overlay_touches_p (pos) | 2927 | overlay_touches_p (int pos) |
| 2996 | int pos; | ||
| 2997 | { | 2928 | { |
| 2998 | Lisp_Object overlay; | 2929 | Lisp_Object overlay; |
| 2999 | struct Lisp_Overlay *tail; | 2930 | struct Lisp_Overlay *tail; |
| @@ -3038,8 +2969,7 @@ struct sortvec | |||
| 3038 | }; | 2969 | }; |
| 3039 | 2970 | ||
| 3040 | static int | 2971 | static int |
| 3041 | compare_overlays (v1, v2) | 2972 | compare_overlays (const void *v1, const void *v2) |
| 3042 | const void *v1, *v2; | ||
| 3043 | { | 2973 | { |
| 3044 | const struct sortvec *s1 = (const struct sortvec *) v1; | 2974 | const struct sortvec *s1 = (const struct sortvec *) v1; |
| 3045 | const struct sortvec *s2 = (const struct sortvec *) v2; | 2975 | const struct sortvec *s2 = (const struct sortvec *) v2; |
| @@ -3056,10 +2986,7 @@ compare_overlays (v1, v2) | |||
| 3056 | The return value is the new size; this may be smaller than the original | 2986 | 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. */ | 2987 | size if some of the overlays were invalid or were window-specific. */ |
| 3058 | int | 2988 | int |
| 3059 | sort_overlays (overlay_vec, noverlays, w) | 2989 | sort_overlays (Lisp_Object *overlay_vec, int noverlays, struct window *w) |
| 3060 | Lisp_Object *overlay_vec; | ||
| 3061 | int noverlays; | ||
| 3062 | struct window *w; | ||
| 3063 | { | 2990 | { |
| 3064 | int i, j; | 2991 | int i, j; |
| 3065 | struct sortvec *sortvec; | 2992 | struct sortvec *sortvec; |
| @@ -3139,8 +3066,7 @@ static int overlay_str_len; | |||
| 3139 | 3066 | ||
| 3140 | /* A comparison function suitable for passing to qsort. */ | 3067 | /* A comparison function suitable for passing to qsort. */ |
| 3141 | static int | 3068 | static int |
| 3142 | cmp_for_strings (as1, as2) | 3069 | cmp_for_strings (const void *as1, const void *as2) |
| 3143 | char *as1, *as2; | ||
| 3144 | { | 3070 | { |
| 3145 | struct sortstr *s1 = (struct sortstr *)as1; | 3071 | struct sortstr *s1 = (struct sortstr *)as1; |
| 3146 | struct sortstr *s2 = (struct sortstr *)as2; | 3072 | struct sortstr *s2 = (struct sortstr *)as2; |
| @@ -3152,10 +3078,7 @@ cmp_for_strings (as1, as2) | |||
| 3152 | } | 3078 | } |
| 3153 | 3079 | ||
| 3154 | static void | 3080 | static void |
| 3155 | record_overlay_string (ssl, str, str2, pri, size) | 3081 | 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 | { | 3082 | { |
| 3160 | int nbytes; | 3083 | int nbytes; |
| 3161 | 3084 | ||
| @@ -3211,10 +3134,7 @@ record_overlay_string (ssl, str, str2, pri, size) | |||
| 3211 | subsequent calls. */ | 3134 | subsequent calls. */ |
| 3212 | 3135 | ||
| 3213 | int | 3136 | int |
| 3214 | overlay_strings (pos, w, pstr) | 3137 | overlay_strings (EMACS_INT pos, struct window *w, unsigned char **pstr) |
| 3215 | EMACS_INT pos; | ||
| 3216 | struct window *w; | ||
| 3217 | unsigned char **pstr; | ||
| 3218 | { | 3138 | { |
| 3219 | Lisp_Object overlay, window, str; | 3139 | Lisp_Object overlay, window, str; |
| 3220 | struct Lisp_Overlay *ov; | 3140 | struct Lisp_Overlay *ov; |
| @@ -3337,9 +3257,7 @@ overlay_strings (pos, w, pstr) | |||
| 3337 | /* Shift overlays in BUF's overlay lists, to center the lists at POS. */ | 3257 | /* Shift overlays in BUF's overlay lists, to center the lists at POS. */ |
| 3338 | 3258 | ||
| 3339 | void | 3259 | void |
| 3340 | recenter_overlay_lists (buf, pos) | 3260 | recenter_overlay_lists (struct buffer *buf, EMACS_INT pos) |
| 3341 | struct buffer *buf; | ||
| 3342 | EMACS_INT pos; | ||
| 3343 | { | 3261 | { |
| 3344 | Lisp_Object overlay, beg, end; | 3262 | Lisp_Object overlay, beg, end; |
| 3345 | struct Lisp_Overlay *prev, *tail, *next; | 3263 | struct Lisp_Overlay *prev, *tail, *next; |
| @@ -3488,9 +3406,7 @@ recenter_overlay_lists (buf, pos) | |||
| 3488 | } | 3406 | } |
| 3489 | 3407 | ||
| 3490 | void | 3408 | void |
| 3491 | adjust_overlays_for_insert (pos, length) | 3409 | adjust_overlays_for_insert (EMACS_INT pos, EMACS_INT length) |
| 3492 | EMACS_INT pos; | ||
| 3493 | EMACS_INT length; | ||
| 3494 | { | 3410 | { |
| 3495 | /* After an insertion, the lists are still sorted properly, | 3411 | /* After an insertion, the lists are still sorted properly, |
| 3496 | but we may need to update the value of the overlay center. */ | 3412 | but we may need to update the value of the overlay center. */ |
| @@ -3499,9 +3415,7 @@ adjust_overlays_for_insert (pos, length) | |||
| 3499 | } | 3415 | } |
| 3500 | 3416 | ||
| 3501 | void | 3417 | void |
| 3502 | adjust_overlays_for_delete (pos, length) | 3418 | adjust_overlays_for_delete (EMACS_INT pos, EMACS_INT length) |
| 3503 | EMACS_INT pos; | ||
| 3504 | EMACS_INT length; | ||
| 3505 | { | 3419 | { |
| 3506 | if (current_buffer->overlay_center < pos) | 3420 | if (current_buffer->overlay_center < pos) |
| 3507 | /* The deletion was to our right. No change needed; the before- and | 3421 | /* The deletion was to our right. No change needed; the before- and |
| @@ -3526,8 +3440,7 @@ adjust_overlays_for_delete (pos, length) | |||
| 3526 | Such an overlay might even have negative size at this point. | 3440 | Such an overlay might even have negative size at this point. |
| 3527 | If so, we'll make the overlay empty. */ | 3441 | If so, we'll make the overlay empty. */ |
| 3528 | void | 3442 | void |
| 3529 | fix_start_end_in_overlays (start, end) | 3443 | fix_start_end_in_overlays (register int start, register int end) |
| 3530 | register int start, end; | ||
| 3531 | { | 3444 | { |
| 3532 | Lisp_Object overlay; | 3445 | Lisp_Object overlay; |
| 3533 | struct Lisp_Overlay *before_list, *after_list; | 3446 | struct Lisp_Overlay *before_list, *after_list; |
| @@ -3673,9 +3586,7 @@ fix_start_end_in_overlays (start, end) | |||
| 3673 | was at PREV, and now is at POS. */ | 3586 | was at PREV, and now is at POS. */ |
| 3674 | 3587 | ||
| 3675 | void | 3588 | void |
| 3676 | fix_overlays_before (bp, prev, pos) | 3589 | fix_overlays_before (struct buffer *bp, EMACS_INT prev, EMACS_INT pos) |
| 3677 | struct buffer *bp; | ||
| 3678 | EMACS_INT prev, pos; | ||
| 3679 | { | 3590 | { |
| 3680 | /* If parent is nil, replace overlays_before; otherwise, parent->next. */ | 3591 | /* If parent is nil, replace overlays_before; otherwise, parent->next. */ |
| 3681 | struct Lisp_Overlay *tail = bp->overlays_before, *parent = NULL, *right_pair; | 3592 | struct Lisp_Overlay *tail = bp->overlays_before, *parent = NULL, *right_pair; |
| @@ -3754,8 +3665,7 @@ fix_overlays_before (bp, prev, pos) | |||
| 3754 | 3665 | ||
| 3755 | DEFUN ("overlayp", Foverlayp, Soverlayp, 1, 1, 0, | 3666 | DEFUN ("overlayp", Foverlayp, Soverlayp, 1, 1, 0, |
| 3756 | doc: /* Return t if OBJECT is an overlay. */) | 3667 | doc: /* Return t if OBJECT is an overlay. */) |
| 3757 | (object) | 3668 | (Lisp_Object object) |
| 3758 | Lisp_Object object; | ||
| 3759 | { | 3669 | { |
| 3760 | return (OVERLAYP (object) ? Qt : Qnil); | 3670 | return (OVERLAYP (object) ? Qt : Qnil); |
| 3761 | } | 3671 | } |
| @@ -3770,9 +3680,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 | 3680 | The fifth arg REAR-ADVANCE, if non-nil, makes the marker |
| 3771 | for the rear of the overlay advance when text is inserted there | 3681 | for the rear of the overlay advance when text is inserted there |
| 3772 | \(which means the text *is* included in the overlay). */) | 3682 | \(which means the text *is* included in the overlay). */) |
| 3773 | (beg, end, buffer, front_advance, rear_advance) | 3683 | (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 | { | 3684 | { |
| 3777 | Lisp_Object overlay; | 3685 | Lisp_Object overlay; |
| 3778 | struct buffer *b; | 3686 | struct buffer *b; |
| @@ -3841,9 +3749,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. */ | 3749 | /* Mark a section of BUF as needing redisplay because of overlays changes. */ |
| 3842 | 3750 | ||
| 3843 | static void | 3751 | static void |
| 3844 | modify_overlay (buf, start, end) | 3752 | modify_overlay (struct buffer *buf, EMACS_INT start, EMACS_INT end) |
| 3845 | struct buffer *buf; | ||
| 3846 | EMACS_INT start, end; | ||
| 3847 | { | 3753 | { |
| 3848 | if (start > end) | 3754 | if (start > end) |
| 3849 | { | 3755 | { |
| @@ -3870,11 +3776,10 @@ modify_overlay (buf, start, end) | |||
| 3870 | } | 3776 | } |
| 3871 | 3777 | ||
| 3872 | 3778 | ||
| 3873 | Lisp_Object Fdelete_overlay (); | 3779 | Lisp_Object Fdelete_overlay (Lisp_Object overlay); |
| 3874 | 3780 | ||
| 3875 | static struct Lisp_Overlay * | 3781 | static struct Lisp_Overlay * |
| 3876 | unchain_overlay (list, overlay) | 3782 | unchain_overlay (struct Lisp_Overlay *list, struct Lisp_Overlay *overlay) |
| 3877 | struct Lisp_Overlay *list, *overlay; | ||
| 3878 | { | 3783 | { |
| 3879 | struct Lisp_Overlay *tmp, *prev; | 3784 | struct Lisp_Overlay *tmp, *prev; |
| 3880 | for (tmp = list, prev = NULL; tmp; prev = tmp, tmp = tmp->next) | 3785 | for (tmp = list, prev = NULL; tmp; prev = tmp, tmp = tmp->next) |
| @@ -3895,8 +3800,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. | 3800 | 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 | 3801 | If BUFFER is omitted, and OVERLAY is in no buffer, put it in the current |
| 3897 | buffer. */) | 3802 | buffer. */) |
| 3898 | (overlay, beg, end, buffer) | 3803 | (Lisp_Object overlay, Lisp_Object beg, Lisp_Object end, Lisp_Object buffer) |
| 3899 | Lisp_Object overlay, beg, end, buffer; | ||
| 3900 | { | 3804 | { |
| 3901 | struct buffer *b, *ob; | 3805 | struct buffer *b, *ob; |
| 3902 | Lisp_Object obuffer; | 3806 | Lisp_Object obuffer; |
| @@ -4005,8 +3909,7 @@ buffer. */) | |||
| 4005 | 3909 | ||
| 4006 | DEFUN ("delete-overlay", Fdelete_overlay, Sdelete_overlay, 1, 1, 0, | 3910 | DEFUN ("delete-overlay", Fdelete_overlay, Sdelete_overlay, 1, 1, 0, |
| 4007 | doc: /* Delete the overlay OVERLAY from its buffer. */) | 3911 | doc: /* Delete the overlay OVERLAY from its buffer. */) |
| 4008 | (overlay) | 3912 | (Lisp_Object overlay) |
| 4009 | Lisp_Object overlay; | ||
| 4010 | { | 3913 | { |
| 4011 | Lisp_Object buffer; | 3914 | Lisp_Object buffer; |
| 4012 | struct buffer *b; | 3915 | struct buffer *b; |
| @@ -4046,8 +3949,7 @@ DEFUN ("delete-overlay", Fdelete_overlay, Sdelete_overlay, 1, 1, 0, | |||
| 4046 | 3949 | ||
| 4047 | DEFUN ("overlay-start", Foverlay_start, Soverlay_start, 1, 1, 0, | 3950 | DEFUN ("overlay-start", Foverlay_start, Soverlay_start, 1, 1, 0, |
| 4048 | doc: /* Return the position at which OVERLAY starts. */) | 3951 | doc: /* Return the position at which OVERLAY starts. */) |
| 4049 | (overlay) | 3952 | (Lisp_Object overlay) |
| 4050 | Lisp_Object overlay; | ||
| 4051 | { | 3953 | { |
| 4052 | CHECK_OVERLAY (overlay); | 3954 | CHECK_OVERLAY (overlay); |
| 4053 | 3955 | ||
| @@ -4056,8 +3958,7 @@ DEFUN ("overlay-start", Foverlay_start, Soverlay_start, 1, 1, 0, | |||
| 4056 | 3958 | ||
| 4057 | DEFUN ("overlay-end", Foverlay_end, Soverlay_end, 1, 1, 0, | 3959 | DEFUN ("overlay-end", Foverlay_end, Soverlay_end, 1, 1, 0, |
| 4058 | doc: /* Return the position at which OVERLAY ends. */) | 3960 | doc: /* Return the position at which OVERLAY ends. */) |
| 4059 | (overlay) | 3961 | (Lisp_Object overlay) |
| 4060 | Lisp_Object overlay; | ||
| 4061 | { | 3962 | { |
| 4062 | CHECK_OVERLAY (overlay); | 3963 | CHECK_OVERLAY (overlay); |
| 4063 | 3964 | ||
| @@ -4067,8 +3968,7 @@ DEFUN ("overlay-end", Foverlay_end, Soverlay_end, 1, 1, 0, | |||
| 4067 | DEFUN ("overlay-buffer", Foverlay_buffer, Soverlay_buffer, 1, 1, 0, | 3968 | DEFUN ("overlay-buffer", Foverlay_buffer, Soverlay_buffer, 1, 1, 0, |
| 4068 | doc: /* Return the buffer OVERLAY belongs to. | 3969 | doc: /* Return the buffer OVERLAY belongs to. |
| 4069 | Return nil if OVERLAY has been deleted. */) | 3970 | Return nil if OVERLAY has been deleted. */) |
| 4070 | (overlay) | 3971 | (Lisp_Object overlay) |
| 4071 | Lisp_Object overlay; | ||
| 4072 | { | 3972 | { |
| 4073 | CHECK_OVERLAY (overlay); | 3973 | CHECK_OVERLAY (overlay); |
| 4074 | 3974 | ||
| @@ -4079,8 +3979,7 @@ DEFUN ("overlay-properties", Foverlay_properties, Soverlay_properties, 1, 1, 0, | |||
| 4079 | doc: /* Return a list of the properties on OVERLAY. | 3979 | 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 | 3980 | This is a copy of OVERLAY's plist; modifying its conses has no effect on |
| 4081 | OVERLAY. */) | 3981 | OVERLAY. */) |
| 4082 | (overlay) | 3982 | (Lisp_Object overlay) |
| 4083 | Lisp_Object overlay; | ||
| 4084 | { | 3983 | { |
| 4085 | CHECK_OVERLAY (overlay); | 3984 | CHECK_OVERLAY (overlay); |
| 4086 | 3985 | ||
| @@ -4090,8 +3989,7 @@ OVERLAY. */) | |||
| 4090 | 3989 | ||
| 4091 | DEFUN ("overlays-at", Foverlays_at, Soverlays_at, 1, 1, 0, | 3990 | DEFUN ("overlays-at", Foverlays_at, Soverlays_at, 1, 1, 0, |
| 4092 | doc: /* Return a list of the overlays that contain the character at POS. */) | 3991 | doc: /* Return a list of the overlays that contain the character at POS. */) |
| 4093 | (pos) | 3992 | (Lisp_Object pos) |
| 4094 | Lisp_Object pos; | ||
| 4095 | { | 3993 | { |
| 4096 | int noverlays; | 3994 | int noverlays; |
| 4097 | Lisp_Object *overlay_vec; | 3995 | Lisp_Object *overlay_vec; |
| @@ -4123,8 +4021,7 @@ and also contained within the specified region. | |||
| 4123 | Empty overlays are included in the result if they are located at BEG, | 4021 | 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 | 4022 | between BEG and END, or at END provided END denotes the position at the |
| 4125 | end of the buffer. */) | 4023 | end of the buffer. */) |
| 4126 | (beg, end) | 4024 | (Lisp_Object beg, Lisp_Object end) |
| 4127 | Lisp_Object beg, end; | ||
| 4128 | { | 4025 | { |
| 4129 | int noverlays; | 4026 | int noverlays; |
| 4130 | Lisp_Object *overlay_vec; | 4027 | Lisp_Object *overlay_vec; |
| @@ -4154,8 +4051,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. | 4051 | 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), | 4052 | If there are no overlay boundaries from POS to (point-max), |
| 4156 | the value is (point-max). */) | 4053 | the value is (point-max). */) |
| 4157 | (pos) | 4054 | (Lisp_Object pos) |
| 4158 | Lisp_Object pos; | ||
| 4159 | { | 4055 | { |
| 4160 | int noverlays; | 4056 | int noverlays; |
| 4161 | EMACS_INT endpos; | 4057 | EMACS_INT endpos; |
| @@ -4196,8 +4092,7 @@ DEFUN ("previous-overlay-change", Fprevious_overlay_change, | |||
| 4196 | doc: /* Return the previous position before POS where an overlay starts or ends. | 4092 | 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, | 4093 | If there are no overlay boundaries from (point-min) to POS, |
| 4198 | the value is (point-min). */) | 4094 | the value is (point-min). */) |
| 4199 | (pos) | 4095 | (Lisp_Object pos) |
| 4200 | Lisp_Object pos; | ||
| 4201 | { | 4096 | { |
| 4202 | int noverlays; | 4097 | int noverlays; |
| 4203 | EMACS_INT prevpos; | 4098 | EMACS_INT prevpos; |
| @@ -4233,7 +4128,7 @@ the cdr has all the overlays after the overlay center. | |||
| 4233 | Recentering overlays moves overlays between these lists. | 4128 | Recentering overlays moves overlays between these lists. |
| 4234 | The lists you get are copies, so that changing them has no effect. | 4129 | 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. */) | 4130 | However, the overlays you get are the real objects that the buffer uses. */) |
| 4236 | () | 4131 | (void) |
| 4237 | { | 4132 | { |
| 4238 | struct Lisp_Overlay *ol; | 4133 | struct Lisp_Overlay *ol; |
| 4239 | Lisp_Object before = Qnil, after = Qnil, tmp; | 4134 | Lisp_Object before = Qnil, after = Qnil, tmp; |
| @@ -4254,8 +4149,7 @@ DEFUN ("overlay-recenter", Foverlay_recenter, Soverlay_recenter, 1, 1, 0, | |||
| 4254 | doc: /* Recenter the overlays of the current buffer around position POS. | 4149 | doc: /* Recenter the overlays of the current buffer around position POS. |
| 4255 | That makes overlay lookup faster for positions near POS (but perhaps slower | 4150 | That makes overlay lookup faster for positions near POS (but perhaps slower |
| 4256 | for positions far away from POS). */) | 4151 | for positions far away from POS). */) |
| 4257 | (pos) | 4152 | (Lisp_Object pos) |
| 4258 | Lisp_Object pos; | ||
| 4259 | { | 4153 | { |
| 4260 | CHECK_NUMBER_COERCE_MARKER (pos); | 4154 | CHECK_NUMBER_COERCE_MARKER (pos); |
| 4261 | 4155 | ||
| @@ -4265,8 +4159,7 @@ for positions far away from POS). */) | |||
| 4265 | 4159 | ||
| 4266 | DEFUN ("overlay-get", Foverlay_get, Soverlay_get, 2, 2, 0, | 4160 | DEFUN ("overlay-get", Foverlay_get, Soverlay_get, 2, 2, 0, |
| 4267 | doc: /* Get the property of overlay OVERLAY with property name PROP. */) | 4161 | doc: /* Get the property of overlay OVERLAY with property name PROP. */) |
| 4268 | (overlay, prop) | 4162 | (Lisp_Object overlay, Lisp_Object prop) |
| 4269 | Lisp_Object overlay, prop; | ||
| 4270 | { | 4163 | { |
| 4271 | CHECK_OVERLAY (overlay); | 4164 | CHECK_OVERLAY (overlay); |
| 4272 | return lookup_char_property (XOVERLAY (overlay)->plist, prop, 0); | 4165 | return lookup_char_property (XOVERLAY (overlay)->plist, prop, 0); |
| @@ -4274,8 +4167,7 @@ DEFUN ("overlay-get", Foverlay_get, Soverlay_get, 2, 2, 0, | |||
| 4274 | 4167 | ||
| 4275 | DEFUN ("overlay-put", Foverlay_put, Soverlay_put, 3, 3, 0, | 4168 | DEFUN ("overlay-put", Foverlay_put, Soverlay_put, 3, 3, 0, |
| 4276 | doc: /* Set one property of overlay OVERLAY: give property PROP value VALUE. */) | 4169 | doc: /* Set one property of overlay OVERLAY: give property PROP value VALUE. */) |
| 4277 | (overlay, prop, value) | 4170 | (Lisp_Object overlay, Lisp_Object prop, Lisp_Object value) |
| 4278 | Lisp_Object overlay, prop, value; | ||
| 4279 | { | 4171 | { |
| 4280 | Lisp_Object tail, buffer; | 4172 | Lisp_Object tail, buffer; |
| 4281 | int changed; | 4173 | int changed; |
| @@ -4333,8 +4225,7 @@ static int last_overlay_modification_hooks_used; | |||
| 4333 | to the end of last_overlay_modification_hooks. */ | 4225 | to the end of last_overlay_modification_hooks. */ |
| 4334 | 4226 | ||
| 4335 | static void | 4227 | static void |
| 4336 | add_overlay_mod_hooklist (functionlist, overlay) | 4228 | add_overlay_mod_hooklist (Lisp_Object functionlist, Lisp_Object overlay) |
| 4337 | Lisp_Object functionlist, overlay; | ||
| 4338 | { | 4229 | { |
| 4339 | int oldsize = XVECTOR (last_overlay_modification_hooks)->size; | 4230 | int oldsize = XVECTOR (last_overlay_modification_hooks)->size; |
| 4340 | 4231 | ||
| @@ -4362,10 +4253,8 @@ add_overlay_mod_hooklist (functionlist, overlay) | |||
| 4362 | and the length of deleted or replaced old text. */ | 4253 | and the length of deleted or replaced old text. */ |
| 4363 | 4254 | ||
| 4364 | void | 4255 | void |
| 4365 | report_overlay_modification (start, end, after, arg1, arg2, arg3) | 4256 | report_overlay_modification (Lisp_Object start, Lisp_Object end, int after, |
| 4366 | Lisp_Object start, end; | 4257 | Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) |
| 4367 | int after; | ||
| 4368 | Lisp_Object arg1, arg2, arg3; | ||
| 4369 | { | 4258 | { |
| 4370 | Lisp_Object prop, overlay; | 4259 | Lisp_Object prop, overlay; |
| 4371 | struct Lisp_Overlay *tail; | 4260 | struct Lisp_Overlay *tail; |
| @@ -4473,8 +4362,8 @@ report_overlay_modification (start, end, after, arg1, arg2, arg3) | |||
| 4473 | Lisp_Object *copy = (Lisp_Object *) alloca (size * sizeof (Lisp_Object)); | 4362 | Lisp_Object *copy = (Lisp_Object *) alloca (size * sizeof (Lisp_Object)); |
| 4474 | int i; | 4363 | int i; |
| 4475 | 4364 | ||
| 4476 | bcopy (XVECTOR (last_overlay_modification_hooks)->contents, | 4365 | memcpy (copy, XVECTOR (last_overlay_modification_hooks)->contents, |
| 4477 | copy, size * sizeof (Lisp_Object)); | 4366 | size * sizeof (Lisp_Object)); |
| 4478 | gcpro1.var = copy; | 4367 | gcpro1.var = copy; |
| 4479 | gcpro1.nvars = size; | 4368 | gcpro1.nvars = size; |
| 4480 | 4369 | ||
| @@ -4490,10 +4379,8 @@ report_overlay_modification (start, end, after, arg1, arg2, arg3) | |||
| 4490 | } | 4379 | } |
| 4491 | 4380 | ||
| 4492 | static void | 4381 | static void |
| 4493 | call_overlay_mod_hooks (list, overlay, after, arg1, arg2, arg3) | 4382 | call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, int after, |
| 4494 | Lisp_Object list, overlay; | 4383 | Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) |
| 4495 | int after; | ||
| 4496 | Lisp_Object arg1, arg2, arg3; | ||
| 4497 | { | 4384 | { |
| 4498 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 4385 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| 4499 | 4386 | ||
| @@ -4513,8 +4400,7 @@ call_overlay_mod_hooks (list, overlay, after, arg1, arg2, arg3) | |||
| 4513 | /* Delete any zero-sized overlays at position POS, if the `evaporate' | 4400 | /* Delete any zero-sized overlays at position POS, if the `evaporate' |
| 4514 | property is set. */ | 4401 | property is set. */ |
| 4515 | void | 4402 | void |
| 4516 | evaporate_overlays (pos) | 4403 | evaporate_overlays (EMACS_INT pos) |
| 4517 | EMACS_INT pos; | ||
| 4518 | { | 4404 | { |
| 4519 | Lisp_Object overlay, hit_list; | 4405 | Lisp_Object overlay, hit_list; |
| 4520 | struct Lisp_Overlay *tail; | 4406 | struct Lisp_Overlay *tail; |
| @@ -4552,9 +4438,7 @@ evaporate_overlays (pos) | |||
| 4552 | in the slot with offset OFFSET. */ | 4438 | in the slot with offset OFFSET. */ |
| 4553 | 4439 | ||
| 4554 | void | 4440 | void |
| 4555 | buffer_slot_type_mismatch (newval, type) | 4441 | buffer_slot_type_mismatch (Lisp_Object newval, int type) |
| 4556 | Lisp_Object newval; | ||
| 4557 | int type; | ||
| 4558 | { | 4442 | { |
| 4559 | Lisp_Object predicate; | 4443 | Lisp_Object predicate; |
| 4560 | 4444 | ||
| @@ -4693,13 +4577,13 @@ static int mmap_initialized_p; | |||
| 4693 | 4577 | ||
| 4694 | /* Function prototypes. */ | 4578 | /* Function prototypes. */ |
| 4695 | 4579 | ||
| 4696 | static int mmap_free_1 P_ ((struct mmap_region *)); | 4580 | static int mmap_free_1 (struct mmap_region *); |
| 4697 | static int mmap_enlarge P_ ((struct mmap_region *, int)); | 4581 | static int mmap_enlarge (struct mmap_region *, int); |
| 4698 | static struct mmap_region *mmap_find P_ ((POINTER_TYPE *, POINTER_TYPE *)); | 4582 | static struct mmap_region *mmap_find (POINTER_TYPE *, POINTER_TYPE *); |
| 4699 | static POINTER_TYPE *mmap_alloc P_ ((POINTER_TYPE **, size_t)); | 4583 | static POINTER_TYPE *mmap_alloc (POINTER_TYPE **, size_t); |
| 4700 | static POINTER_TYPE *mmap_realloc P_ ((POINTER_TYPE **, size_t)); | 4584 | static POINTER_TYPE *mmap_realloc (POINTER_TYPE **, size_t); |
| 4701 | static void mmap_free P_ ((POINTER_TYPE **ptr)); | 4585 | static void mmap_free (POINTER_TYPE **ptr); |
| 4702 | static void mmap_init P_ ((void)); | 4586 | static void mmap_init (void); |
| 4703 | 4587 | ||
| 4704 | 4588 | ||
| 4705 | /* Return a region overlapping address range START...END, or null if | 4589 | /* Return a region overlapping address range START...END, or null if |
| @@ -4942,7 +4826,7 @@ mmap_realloc (var, nbytes) | |||
| 4942 | } | 4826 | } |
| 4943 | else if (mmap_alloc (var, nbytes)) | 4827 | else if (mmap_alloc (var, nbytes)) |
| 4944 | { | 4828 | { |
| 4945 | bcopy (old_ptr, *var, r->nbytes_specified); | 4829 | memcpy (*var, old_ptr, r->nbytes_specified); |
| 4946 | mmap_free_1 (MMAP_REGION (old_ptr)); | 4830 | mmap_free_1 (MMAP_REGION (old_ptr)); |
| 4947 | result = *var; | 4831 | result = *var; |
| 4948 | r = MMAP_REGION (result); | 4832 | r = MMAP_REGION (result); |
| @@ -5032,18 +4916,16 @@ mmap_init () | |||
| 5032 | ***********************************************************************/ | 4916 | ***********************************************************************/ |
| 5033 | 4917 | ||
| 5034 | #ifdef REL_ALLOC | 4918 | #ifdef REL_ALLOC |
| 5035 | extern POINTER_TYPE *r_alloc P_ ((POINTER_TYPE **, size_t)); | 4919 | extern POINTER_TYPE *r_alloc (POINTER_TYPE **, size_t); |
| 5036 | extern POINTER_TYPE *r_re_alloc P_ ((POINTER_TYPE **, size_t)); | 4920 | extern POINTER_TYPE *r_re_alloc (POINTER_TYPE **, size_t); |
| 5037 | extern void r_alloc_free P_ ((POINTER_TYPE **ptr)); | 4921 | extern void r_alloc_free (POINTER_TYPE **ptr); |
| 5038 | #endif /* REL_ALLOC */ | 4922 | #endif /* REL_ALLOC */ |
| 5039 | 4923 | ||
| 5040 | 4924 | ||
| 5041 | /* Allocate NBYTES bytes for buffer B's text buffer. */ | 4925 | /* Allocate NBYTES bytes for buffer B's text buffer. */ |
| 5042 | 4926 | ||
| 5043 | static void | 4927 | static void |
| 5044 | alloc_buffer_text (b, nbytes) | 4928 | alloc_buffer_text (struct buffer *b, size_t nbytes) |
| 5045 | struct buffer *b; | ||
| 5046 | size_t nbytes; | ||
| 5047 | { | 4929 | { |
| 5048 | POINTER_TYPE *p; | 4930 | POINTER_TYPE *p; |
| 5049 | 4931 | ||
| @@ -5098,8 +4980,7 @@ enlarge_buffer_text (struct buffer *b, EMACS_INT delta) | |||
| 5098 | /* Free buffer B's text buffer. */ | 4980 | /* Free buffer B's text buffer. */ |
| 5099 | 4981 | ||
| 5100 | static void | 4982 | static void |
| 5101 | free_buffer_text (b) | 4983 | free_buffer_text (struct buffer *b) |
| 5102 | struct buffer *b; | ||
| 5103 | { | 4984 | { |
| 5104 | BLOCK_INPUT; | 4985 | BLOCK_INPUT; |
| 5105 | 4986 | ||
| @@ -5122,11 +5003,11 @@ free_buffer_text (b) | |||
| 5122 | ***********************************************************************/ | 5003 | ***********************************************************************/ |
| 5123 | 5004 | ||
| 5124 | void | 5005 | void |
| 5125 | init_buffer_once () | 5006 | init_buffer_once (void) |
| 5126 | { | 5007 | { |
| 5127 | int idx; | 5008 | int idx; |
| 5128 | 5009 | ||
| 5129 | bzero (buffer_permanent_local_flags, sizeof buffer_permanent_local_flags); | 5010 | memset (buffer_permanent_local_flags, 0, sizeof buffer_permanent_local_flags); |
| 5130 | 5011 | ||
| 5131 | /* Make sure all markable slots in buffer_defaults | 5012 | /* Make sure all markable slots in buffer_defaults |
| 5132 | are initialized reasonably, so mark_buffer won't choke. */ | 5013 | are initialized reasonably, so mark_buffer won't choke. */ |
| @@ -5214,7 +5095,7 @@ init_buffer_once () | |||
| 5214 | if (sizeof (EMACS_INT) != sizeof (Lisp_Object)) abort (); | 5095 | if (sizeof (EMACS_INT) != sizeof (Lisp_Object)) abort (); |
| 5215 | 5096 | ||
| 5216 | /* 0 means not a lisp var, -1 means always local, else mask */ | 5097 | /* 0 means not a lisp var, -1 means always local, else mask */ |
| 5217 | bzero (&buffer_local_flags, sizeof buffer_local_flags); | 5098 | memset (&buffer_local_flags, 0, sizeof buffer_local_flags); |
| 5218 | XSETINT (buffer_local_flags.filename, -1); | 5099 | XSETINT (buffer_local_flags.filename, -1); |
| 5219 | XSETINT (buffer_local_flags.directory, -1); | 5100 | XSETINT (buffer_local_flags.directory, -1); |
| 5220 | XSETINT (buffer_local_flags.backed_up, -1); | 5101 | XSETINT (buffer_local_flags.backed_up, -1); |
| @@ -5318,7 +5199,7 @@ init_buffer_once () | |||
| 5318 | } | 5199 | } |
| 5319 | 5200 | ||
| 5320 | void | 5201 | void |
| 5321 | init_buffer () | 5202 | init_buffer (void) |
| 5322 | { | 5203 | { |
| 5323 | char *pwd; | 5204 | char *pwd; |
| 5324 | Lisp_Object temp; | 5205 | Lisp_Object temp; |
| @@ -5402,12 +5283,8 @@ init_buffer () | |||
| 5402 | } while (0) | 5283 | } while (0) |
| 5403 | 5284 | ||
| 5404 | static void | 5285 | static void |
| 5405 | defvar_per_buffer (bo_fwd, namestring, address, type, doc) | 5286 | defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, const char *namestring, |
| 5406 | struct Lisp_Buffer_Objfwd *bo_fwd; | 5287 | Lisp_Object *address, Lisp_Object type, char *doc) |
| 5407 | char *namestring; | ||
| 5408 | Lisp_Object *address; | ||
| 5409 | Lisp_Object type; | ||
| 5410 | char *doc; | ||
| 5411 | { | 5288 | { |
| 5412 | struct Lisp_Symbol *sym; | 5289 | struct Lisp_Symbol *sym; |
| 5413 | int offset; | 5290 | int offset; |
| @@ -5435,7 +5312,7 @@ defvar_per_buffer (bo_fwd, namestring, address, type, doc) | |||
| 5435 | 5312 | ||
| 5436 | /* initialize the buffer routines */ | 5313 | /* initialize the buffer routines */ |
| 5437 | void | 5314 | void |
| 5438 | syms_of_buffer () | 5315 | syms_of_buffer (void) |
| 5439 | { | 5316 | { |
| 5440 | staticpro (&last_overlay_modification_hooks); | 5317 | staticpro (&last_overlay_modification_hooks); |
| 5441 | last_overlay_modification_hooks | 5318 | last_overlay_modification_hooks |
| @@ -5466,8 +5343,6 @@ syms_of_buffer () | |||
| 5466 | staticpro (&Qget_file_buffer); | 5343 | staticpro (&Qget_file_buffer); |
| 5467 | Qpriority = intern_c_string ("priority"); | 5344 | Qpriority = intern_c_string ("priority"); |
| 5468 | staticpro (&Qpriority); | 5345 | staticpro (&Qpriority); |
| 5469 | Qwindow = intern_c_string ("window"); | ||
| 5470 | staticpro (&Qwindow); | ||
| 5471 | Qbefore_string = intern_c_string ("before-string"); | 5346 | Qbefore_string = intern_c_string ("before-string"); |
| 5472 | staticpro (&Qbefore_string); | 5347 | staticpro (&Qbefore_string); |
| 5473 | Qafter_string = intern_c_string ("after-string"); | 5348 | Qafter_string = intern_c_string ("after-string"); |
| @@ -6017,14 +5892,14 @@ fringe indicator. | |||
| 6017 | 5892 | ||
| 6018 | INDICATOR specifies the logical indicator type which is one of the | 5893 | INDICATOR specifies the logical indicator type which is one of the |
| 6019 | following symbols: `truncation' , `continuation', `overlay-arrow', | 5894 | following symbols: `truncation' , `continuation', `overlay-arrow', |
| 6020 | `top', `bottom', `up', `down', `one-line', `empty-line', or `unknown'. | 5895 | `top', `bottom', `top-bottom', `up', `down', empty-line', or `unknown'. |
| 6021 | 5896 | ||
| 6022 | BITMAPS is list of symbols (LEFT RIGHT [LEFT1 RIGHT1]) which specifies | 5897 | BITMAPS is a list of symbols (LEFT RIGHT [LEFT1 RIGHT1]) which specifies |
| 6023 | the actual bitmap shown in the left or right fringe for the logical | 5898 | the actual bitmap shown in the left or right fringe for the logical |
| 6024 | indicator. LEFT and RIGHT are the bitmaps shown in the left and/or | 5899 | indicator. LEFT and RIGHT are the bitmaps shown in the left and/or |
| 6025 | right fringe for the specific indicator. The LEFT1 or RIGHT1 bitmaps | 5900 | right fringe for the specific indicator. The LEFT1 or RIGHT1 bitmaps |
| 6026 | are used only for the `bottom' and `one-line' indicators when the last | 5901 | are used only for the `bottom' and `top-bottom' indicators when the |
| 6027 | \(only) line in has no final newline. BITMAPS may also be a single | 5902 | last (only) line has no final newline. BITMAPS may also be a single |
| 6028 | symbol which is used in both left and right fringes. */); | 5903 | symbol which is used in both left and right fringes. */); |
| 6029 | 5904 | ||
| 6030 | DEFVAR_PER_BUFFER ("fringe-cursor-alist", | 5905 | DEFVAR_PER_BUFFER ("fringe-cursor-alist", |
| @@ -6338,7 +6213,7 @@ The function `kill-all-local-variables' runs this before doing anything else. * | |||
| 6338 | } | 6213 | } |
| 6339 | 6214 | ||
| 6340 | void | 6215 | void |
| 6341 | keys_of_buffer () | 6216 | keys_of_buffer (void) |
| 6342 | { | 6217 | { |
| 6343 | initial_define_key (control_x_map, 'b', "switch-to-buffer"); | 6218 | initial_define_key (control_x_map, 'b', "switch-to-buffer"); |
| 6344 | initial_define_key (control_x_map, 'k', "kill-buffer"); | 6219 | initial_define_key (control_x_map, 'k', "kill-buffer"); |