diff options
| author | Paul Eggert | 2012-07-19 15:35:58 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-07-19 15:35:58 -0700 |
| commit | 52b852c77d74800aaa1338dc72f786f7e261bfee (patch) | |
| tree | f2d4a83567f37b1fa9a70d719565c2dc7afc9d06 | |
| parent | 8a4e6db81ae0c04a73693718cb8aaa59e160663f (diff) | |
| download | emacs-52b852c77d74800aaa1338dc72f786f7e261bfee.tar.gz emacs-52b852c77d74800aaa1338dc72f786f7e261bfee.zip | |
* buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
(FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
'for_each_per_buffer_object_at'.
All uses changed. It's better to use upper-case for macros that
cannot be implemented as functions, to give the reader a clue
that they're special.
| -rw-r--r-- | src/ChangeLog | 9 | ||||
| -rw-r--r-- | src/alloc.c | 6 | ||||
| -rw-r--r-- | src/buffer.c | 18 | ||||
| -rw-r--r-- | src/buffer.h | 4 | ||||
| -rw-r--r-- | src/data.c | 2 |
5 files changed, 24 insertions, 15 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 8a60e0bdabe..bed8e25ab77 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2012-07-19 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'. | ||
| 4 | (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from | ||
| 5 | 'for_each_per_buffer_object_at'. | ||
| 6 | All uses changed. It's better to use upper-case for macros that | ||
| 7 | cannot be implemented as functions, to give the reader a clue | ||
| 8 | that they're special. | ||
| 9 | |||
| 1 | 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca> | 10 | 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 11 | ||
| 3 | * alloc.c (Fgarbage_collect): Tweak docstring. | 12 | * alloc.c (Fgarbage_collect): Tweak docstring. |
diff --git a/src/alloc.c b/src/alloc.c index d24787576e9..7158b45a340 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -5412,7 +5412,7 @@ See Info node `(elisp)Garbage Collection'. */) | |||
| 5412 | 5412 | ||
| 5413 | /* Don't keep undo information around forever. | 5413 | /* Don't keep undo information around forever. |
| 5414 | Do this early on, so it is no problem if the user quits. */ | 5414 | Do this early on, so it is no problem if the user quits. */ |
| 5415 | for_each_buffer (nextb) | 5415 | FOR_EACH_BUFFER (nextb) |
| 5416 | compact_buffer (nextb); | 5416 | compact_buffer (nextb); |
| 5417 | 5417 | ||
| 5418 | t1 = current_emacs_time (); | 5418 | t1 = current_emacs_time (); |
| @@ -5527,7 +5527,7 @@ See Info node `(elisp)Garbage Collection'. */) | |||
| 5527 | Look thru every buffer's undo list | 5527 | Look thru every buffer's undo list |
| 5528 | for elements that update markers that were not marked, | 5528 | for elements that update markers that were not marked, |
| 5529 | and delete them. */ | 5529 | and delete them. */ |
| 5530 | for_each_buffer (nextb) | 5530 | FOR_EACH_BUFFER (nextb) |
| 5531 | { | 5531 | { |
| 5532 | /* If a buffer's undo list is Qt, that means that undo is | 5532 | /* If a buffer's undo list is Qt, that means that undo is |
| 5533 | turned off in that buffer. Calling truncate_undo_list on | 5533 | turned off in that buffer. Calling truncate_undo_list on |
| @@ -5955,7 +5955,7 @@ mark_object (Lisp_Object arg) | |||
| 5955 | if (po != &buffer_defaults && po != &buffer_local_symbols) | 5955 | if (po != &buffer_defaults && po != &buffer_local_symbols) |
| 5956 | { | 5956 | { |
| 5957 | struct buffer *b; | 5957 | struct buffer *b; |
| 5958 | for_each_buffer (b) | 5958 | FOR_EACH_BUFFER (b) |
| 5959 | if (b == po) | 5959 | if (b == po) |
| 5960 | break; | 5960 | break; |
| 5961 | if (b == NULL) | 5961 | if (b == NULL) |
diff --git a/src/buffer.c b/src/buffer.c index 0fc5dd0b9c3..04d83d76945 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -460,7 +460,7 @@ clone_per_buffer_values (struct buffer *from, struct buffer *to) | |||
| 460 | { | 460 | { |
| 461 | int offset; | 461 | int offset; |
| 462 | 462 | ||
| 463 | for_each_per_buffer_object_at (offset) | 463 | FOR_EACH_PER_BUFFER_OBJECT_AT (offset) |
| 464 | { | 464 | { |
| 465 | Lisp_Object obj; | 465 | Lisp_Object obj; |
| 466 | 466 | ||
| @@ -612,7 +612,7 @@ CLONE nil means the indirect buffer's state is reset to default values. */) | |||
| 612 | eassert (NILP (BVAR (b->base_buffer, begv_marker))); | 612 | eassert (NILP (BVAR (b->base_buffer, begv_marker))); |
| 613 | eassert (NILP (BVAR (b->base_buffer, zv_marker))); | 613 | eassert (NILP (BVAR (b->base_buffer, zv_marker))); |
| 614 | 614 | ||
| 615 | BVAR (b->base_buffer, pt_marker) | 615 | BVAR (b->base_buffer, pt_marker) |
| 616 | = build_marker (b->base_buffer, b->base_buffer->pt, b->base_buffer->pt_byte); | 616 | = build_marker (b->base_buffer, b->base_buffer->pt, b->base_buffer->pt_byte); |
| 617 | 617 | ||
| 618 | BVAR (b->base_buffer, begv_marker) | 618 | BVAR (b->base_buffer, begv_marker) |
| @@ -817,7 +817,7 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too) | |||
| 817 | SET_PER_BUFFER_VALUE_P (b, i, 0); | 817 | SET_PER_BUFFER_VALUE_P (b, i, 0); |
| 818 | 818 | ||
| 819 | /* For each slot that has a default value, copy that into the slot. */ | 819 | /* For each slot that has a default value, copy that into the slot. */ |
| 820 | for_each_per_buffer_object_at (offset) | 820 | FOR_EACH_PER_BUFFER_OBJECT_AT (offset) |
| 821 | { | 821 | { |
| 822 | int idx = PER_BUFFER_IDX (offset); | 822 | int idx = PER_BUFFER_IDX (offset); |
| 823 | if ((idx > 0 | 823 | if ((idx > 0 |
| @@ -862,7 +862,7 @@ is first appended to NAME, to speed up finding a non-existent buffer. */) | |||
| 862 | { | 862 | { |
| 863 | /* Note fileio.c:make_temp_name does random differently. */ | 863 | /* Note fileio.c:make_temp_name does random differently. */ |
| 864 | tem2 = concat2 (name, make_formatted_string | 864 | tem2 = concat2 (name, make_formatted_string |
| 865 | (number, "-%"pI"d", | 865 | (number, "-%"pI"d", |
| 866 | XFASTINT (Frandom (make_number (999999))))); | 866 | XFASTINT (Frandom (make_number (999999))))); |
| 867 | tem = Fget_buffer (tem2); | 867 | tem = Fget_buffer (tem2); |
| 868 | if (NILP (tem)) | 868 | if (NILP (tem)) |
| @@ -1072,7 +1072,7 @@ No argument or nil as argument means use current buffer as BUFFER. */) | |||
| 1072 | { | 1072 | { |
| 1073 | int offset, idx; | 1073 | int offset, idx; |
| 1074 | 1074 | ||
| 1075 | for_each_per_buffer_object_at (offset) | 1075 | FOR_EACH_PER_BUFFER_OBJECT_AT (offset) |
| 1076 | { | 1076 | { |
| 1077 | idx = PER_BUFFER_IDX (offset); | 1077 | idx = PER_BUFFER_IDX (offset); |
| 1078 | if ((idx == -1 || PER_BUFFER_VALUE_P (buf, idx)) | 1078 | if ((idx == -1 || PER_BUFFER_VALUE_P (buf, idx)) |
| @@ -1577,7 +1577,7 @@ cleaning up all windows currently displaying the buffer to be killed. */) | |||
| 1577 | 1577 | ||
| 1578 | GCPRO1 (buffer); | 1578 | GCPRO1 (buffer); |
| 1579 | 1579 | ||
| 1580 | for_each_buffer (other) | 1580 | FOR_EACH_BUFFER (other) |
| 1581 | if (other->base_buffer == b) | 1581 | if (other->base_buffer == b) |
| 1582 | { | 1582 | { |
| 1583 | Lisp_Object buf; | 1583 | Lisp_Object buf; |
| @@ -2095,7 +2095,7 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text, | |||
| 2095 | 2095 | ||
| 2096 | { /* This is probably harder to make work. */ | 2096 | { /* This is probably harder to make work. */ |
| 2097 | struct buffer *other; | 2097 | struct buffer *other; |
| 2098 | for_each_buffer (other) | 2098 | FOR_EACH_BUFFER (other) |
| 2099 | if (other->base_buffer == other_buffer | 2099 | if (other->base_buffer == other_buffer |
| 2100 | || other->base_buffer == current_buffer) | 2100 | || other->base_buffer == current_buffer) |
| 2101 | error ("One of the buffers to swap has indirect buffers"); | 2101 | error ("One of the buffers to swap has indirect buffers"); |
| @@ -2472,7 +2472,7 @@ current buffer is cleared. */) | |||
| 2472 | 2472 | ||
| 2473 | /* Copy this buffer's new multibyte status | 2473 | /* Copy this buffer's new multibyte status |
| 2474 | into all of its indirect buffers. */ | 2474 | into all of its indirect buffers. */ |
| 2475 | for_each_buffer (other) | 2475 | FOR_EACH_BUFFER (other) |
| 2476 | if (other->base_buffer == current_buffer && !NILP (BVAR (other, name))) | 2476 | if (other->base_buffer == current_buffer && !NILP (BVAR (other, name))) |
| 2477 | { | 2477 | { |
| 2478 | BVAR (other, enable_multibyte_characters) | 2478 | BVAR (other, enable_multibyte_characters) |
| @@ -5078,7 +5078,7 @@ init_buffer (void) | |||
| 5078 | Map new memory. */ | 5078 | Map new memory. */ |
| 5079 | struct buffer *b; | 5079 | struct buffer *b; |
| 5080 | 5080 | ||
| 5081 | for_each_buffer (b) | 5081 | FOR_EACH_BUFFER (b) |
| 5082 | if (b->text->beg == NULL) | 5082 | if (b->text->beg == NULL) |
| 5083 | enlarge_buffer_text (b, 0); | 5083 | enlarge_buffer_text (b, 0); |
| 5084 | } | 5084 | } |
diff --git a/src/buffer.h b/src/buffer.h index 6f090479a24..a97cc13705b 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -866,7 +866,7 @@ extern struct buffer *all_buffers; | |||
| 866 | 866 | ||
| 867 | /* Used to iterate over the chain above. */ | 867 | /* Used to iterate over the chain above. */ |
| 868 | 868 | ||
| 869 | #define for_each_buffer(b) \ | 869 | #define FOR_EACH_BUFFER(b) \ |
| 870 | for ((b) = all_buffers; (b); (b) = (b)->header.next.buffer) | 870 | for ((b) = all_buffers; (b); (b) = (b)->header.next.buffer) |
| 871 | 871 | ||
| 872 | /* This points to the current buffer. */ | 872 | /* This points to the current buffer. */ |
| @@ -1021,7 +1021,7 @@ extern int last_per_buffer_idx; | |||
| 1021 | Lisp_Objects except undo_list). If you add, remove, or reorder | 1021 | Lisp_Objects except undo_list). If you add, remove, or reorder |
| 1022 | Lisp_Objects in a struct buffer, make sure that this is still correct. */ | 1022 | Lisp_Objects in a struct buffer, make sure that this is still correct. */ |
| 1023 | 1023 | ||
| 1024 | #define for_each_per_buffer_object_at(offset) \ | 1024 | #define FOR_EACH_PER_BUFFER_OBJECT_AT(offset) \ |
| 1025 | for (offset = PER_BUFFER_VAR_OFFSET (name); \ | 1025 | for (offset = PER_BUFFER_VAR_OFFSET (name); \ |
| 1026 | offset <= PER_BUFFER_VAR_OFFSET (cursor_in_non_selected_windows); \ | 1026 | offset <= PER_BUFFER_VAR_OFFSET (cursor_in_non_selected_windows); \ |
| 1027 | offset += sizeof (Lisp_Object)) | 1027 | offset += sizeof (Lisp_Object)) |
diff --git a/src/data.c b/src/data.c index 84bd347b136..110e8ae41ab 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -1401,7 +1401,7 @@ for this variable. */) | |||
| 1401 | { | 1401 | { |
| 1402 | struct buffer *b; | 1402 | struct buffer *b; |
| 1403 | 1403 | ||
| 1404 | for_each_buffer (b) | 1404 | FOR_EACH_BUFFER (b) |
| 1405 | if (!PER_BUFFER_VALUE_P (b, idx)) | 1405 | if (!PER_BUFFER_VALUE_P (b, idx)) |
| 1406 | PER_BUFFER_VALUE (b, offset) = value; | 1406 | PER_BUFFER_VALUE (b, offset) = value; |
| 1407 | } | 1407 | } |