Commit 52b852c7 authored by Paul Eggert's avatar Paul Eggert

* 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.
parent 8a4e6db8
2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
* 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.
2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca> 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
* alloc.c (Fgarbage_collect): Tweak docstring. * alloc.c (Fgarbage_collect): Tweak docstring.
......
...@@ -5412,7 +5412,7 @@ See Info node `(elisp)Garbage Collection'. */) ...@@ -5412,7 +5412,7 @@ See Info node `(elisp)Garbage Collection'. */)
/* Don't keep undo information around forever. /* Don't keep undo information around forever.
Do this early on, so it is no problem if the user quits. */ Do this early on, so it is no problem if the user quits. */
for_each_buffer (nextb) FOR_EACH_BUFFER (nextb)
compact_buffer (nextb); compact_buffer (nextb);
t1 = current_emacs_time (); t1 = current_emacs_time ();
...@@ -5527,7 +5527,7 @@ See Info node `(elisp)Garbage Collection'. */) ...@@ -5527,7 +5527,7 @@ See Info node `(elisp)Garbage Collection'. */)
Look thru every buffer's undo list Look thru every buffer's undo list
for elements that update markers that were not marked, for elements that update markers that were not marked,
and delete them. */ and delete them. */
for_each_buffer (nextb) FOR_EACH_BUFFER (nextb)
{ {
/* If a buffer's undo list is Qt, that means that undo is /* If a buffer's undo list is Qt, that means that undo is
turned off in that buffer. Calling truncate_undo_list on turned off in that buffer. Calling truncate_undo_list on
...@@ -5955,7 +5955,7 @@ mark_object (Lisp_Object arg) ...@@ -5955,7 +5955,7 @@ mark_object (Lisp_Object arg)
if (po != &buffer_defaults && po != &buffer_local_symbols) if (po != &buffer_defaults && po != &buffer_local_symbols)
{ {
struct buffer *b; struct buffer *b;
for_each_buffer (b) FOR_EACH_BUFFER (b)
if (b == po) if (b == po)
break; break;
if (b == NULL) if (b == NULL)
......
...@@ -460,7 +460,7 @@ clone_per_buffer_values (struct buffer *from, struct buffer *to) ...@@ -460,7 +460,7 @@ clone_per_buffer_values (struct buffer *from, struct buffer *to)
{ {
int offset; int offset;
for_each_per_buffer_object_at (offset) FOR_EACH_PER_BUFFER_OBJECT_AT (offset)
{ {
Lisp_Object obj; Lisp_Object obj;
...@@ -612,7 +612,7 @@ CLONE nil means the indirect buffer's state is reset to default values. */) ...@@ -612,7 +612,7 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
eassert (NILP (BVAR (b->base_buffer, begv_marker))); eassert (NILP (BVAR (b->base_buffer, begv_marker)));
eassert (NILP (BVAR (b->base_buffer, zv_marker))); eassert (NILP (BVAR (b->base_buffer, zv_marker)));
BVAR (b->base_buffer, pt_marker) BVAR (b->base_buffer, pt_marker)
= build_marker (b->base_buffer, b->base_buffer->pt, b->base_buffer->pt_byte); = build_marker (b->base_buffer, b->base_buffer->pt, b->base_buffer->pt_byte);
BVAR (b->base_buffer, begv_marker) BVAR (b->base_buffer, begv_marker)
...@@ -817,7 +817,7 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too) ...@@ -817,7 +817,7 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
SET_PER_BUFFER_VALUE_P (b, i, 0); SET_PER_BUFFER_VALUE_P (b, i, 0);
/* For each slot that has a default value, copy that into the slot. */ /* For each slot that has a default value, copy that into the slot. */
for_each_per_buffer_object_at (offset) FOR_EACH_PER_BUFFER_OBJECT_AT (offset)
{ {
int idx = PER_BUFFER_IDX (offset); int idx = PER_BUFFER_IDX (offset);
if ((idx > 0 if ((idx > 0
...@@ -862,7 +862,7 @@ is first appended to NAME, to speed up finding a non-existent buffer. */) ...@@ -862,7 +862,7 @@ is first appended to NAME, to speed up finding a non-existent buffer. */)
{ {
/* Note fileio.c:make_temp_name does random differently. */ /* Note fileio.c:make_temp_name does random differently. */
tem2 = concat2 (name, make_formatted_string tem2 = concat2 (name, make_formatted_string
(number, "-%"pI"d", (number, "-%"pI"d",
XFASTINT (Frandom (make_number (999999))))); XFASTINT (Frandom (make_number (999999)))));
tem = Fget_buffer (tem2); tem = Fget_buffer (tem2);
if (NILP (tem)) if (NILP (tem))
...@@ -1072,7 +1072,7 @@ No argument or nil as argument means use current buffer as BUFFER. */) ...@@ -1072,7 +1072,7 @@ No argument or nil as argument means use current buffer as BUFFER. */)
{ {
int offset, idx; int offset, idx;
for_each_per_buffer_object_at (offset) FOR_EACH_PER_BUFFER_OBJECT_AT (offset)
{ {
idx = PER_BUFFER_IDX (offset); idx = PER_BUFFER_IDX (offset);
if ((idx == -1 || PER_BUFFER_VALUE_P (buf, idx)) 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,7 +1577,7 @@ cleaning up all windows currently displaying the buffer to be killed. */)
GCPRO1 (buffer); GCPRO1 (buffer);
for_each_buffer (other) FOR_EACH_BUFFER (other)
if (other->base_buffer == b) if (other->base_buffer == b)
{ {
Lisp_Object buf; Lisp_Object buf;
...@@ -2095,7 +2095,7 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text, ...@@ -2095,7 +2095,7 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
{ /* This is probably harder to make work. */ { /* This is probably harder to make work. */
struct buffer *other; struct buffer *other;
for_each_buffer (other) FOR_EACH_BUFFER (other)
if (other->base_buffer == other_buffer if (other->base_buffer == other_buffer
|| other->base_buffer == current_buffer) || other->base_buffer == current_buffer)
error ("One of the buffers to swap has indirect buffers"); error ("One of the buffers to swap has indirect buffers");
...@@ -2472,7 +2472,7 @@ current buffer is cleared. */) ...@@ -2472,7 +2472,7 @@ current buffer is cleared. */)
/* Copy this buffer's new multibyte status /* Copy this buffer's new multibyte status
into all of its indirect buffers. */ into all of its indirect buffers. */
for_each_buffer (other) FOR_EACH_BUFFER (other)
if (other->base_buffer == current_buffer && !NILP (BVAR (other, name))) if (other->base_buffer == current_buffer && !NILP (BVAR (other, name)))
{ {
BVAR (other, enable_multibyte_characters) BVAR (other, enable_multibyte_characters)
...@@ -5078,7 +5078,7 @@ init_buffer (void) ...@@ -5078,7 +5078,7 @@ init_buffer (void)
Map new memory. */ Map new memory. */
struct buffer *b; struct buffer *b;
for_each_buffer (b) FOR_EACH_BUFFER (b)
if (b->text->beg == NULL) if (b->text->beg == NULL)
enlarge_buffer_text (b, 0); enlarge_buffer_text (b, 0);
} }
......
...@@ -866,7 +866,7 @@ extern struct buffer *all_buffers; ...@@ -866,7 +866,7 @@ extern struct buffer *all_buffers;
/* Used to iterate over the chain above. */ /* Used to iterate over the chain above. */
#define for_each_buffer(b) \ #define FOR_EACH_BUFFER(b) \
for ((b) = all_buffers; (b); (b) = (b)->header.next.buffer) for ((b) = all_buffers; (b); (b) = (b)->header.next.buffer)
/* This points to the current buffer. */ /* This points to the current buffer. */
...@@ -1021,7 +1021,7 @@ extern int last_per_buffer_idx; ...@@ -1021,7 +1021,7 @@ extern int last_per_buffer_idx;
Lisp_Objects except undo_list). If you add, remove, or reorder Lisp_Objects except undo_list). If you add, remove, or reorder
Lisp_Objects in a struct buffer, make sure that this is still correct. */ Lisp_Objects in a struct buffer, make sure that this is still correct. */
#define for_each_per_buffer_object_at(offset) \ #define FOR_EACH_PER_BUFFER_OBJECT_AT(offset) \
for (offset = PER_BUFFER_VAR_OFFSET (name); \ for (offset = PER_BUFFER_VAR_OFFSET (name); \
offset <= PER_BUFFER_VAR_OFFSET (cursor_in_non_selected_windows); \ offset <= PER_BUFFER_VAR_OFFSET (cursor_in_non_selected_windows); \
offset += sizeof (Lisp_Object)) offset += sizeof (Lisp_Object))
......
...@@ -1401,7 +1401,7 @@ for this variable. */) ...@@ -1401,7 +1401,7 @@ for this variable. */)
{ {
struct buffer *b; struct buffer *b;
for_each_buffer (b) FOR_EACH_BUFFER (b)
if (!PER_BUFFER_VALUE_P (b, idx)) if (!PER_BUFFER_VALUE_P (b, idx))
PER_BUFFER_VALUE (b, offset) = value; PER_BUFFER_VALUE (b, offset) = value;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment