Now on revision 109504. ------------------------------------------------------------ revno: 109504 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2012-08-08 10:11:29 +0400 message: Cleanup intervals. * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove. (NULL_INTERVAL_P): Likewise. Adjust users. (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P): Adjust comment. Move under #if 0. * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c: * print.c, syntax.c, textprop.c, xdisp.c: Adjust users. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-08 05:23:02 +0000 +++ src/ChangeLog 2012-08-08 06:11:29 +0000 @@ -1,5 +1,15 @@ 2012-08-08 Dmitry Antipov + Cleanup intervals. + * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove. + (NULL_INTERVAL_P): Likewise. Adjust users. + (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P): Adjust + comment. Move under #if 0. + * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c: + * print.c, syntax.c, textprop.c, xdisp.c: Adjust users. + +2012-08-08 Dmitry Antipov + Check total length of intervals with eassert. * intervals.h (CHECK_TOTAL_LENGTH): Remove. * intervals.c: Change all users to eassert. === modified file 'src/alloc.c' --- src/alloc.c 2012-08-07 13:37:21 +0000 +++ src/alloc.c 2012-08-08 06:11:29 +0000 @@ -1559,19 +1559,20 @@ /* Mark the interval tree rooted in I. */ -#define MARK_INTERVAL_TREE(i) \ - do { \ - if (!NULL_INTERVAL_P (i) && !i->gcmarkbit) \ - mark_interval_tree (i); \ - } while (0) - - -#define UNMARK_BALANCE_INTERVALS(i) \ - do { \ - if (! NULL_INTERVAL_P (i)) \ - (i) = balance_intervals (i); \ - } while (0) - +#define MARK_INTERVAL_TREE(i) \ + do { \ + if (i && !i->gcmarkbit) \ + mark_interval_tree (i); \ + } while (0) + +/* Unmark and rebalance interval tree rooted in I. */ + +#define UNMARK_BALANCE_INTERVALS(i) \ + do { \ + if (i) \ + (i) = balance_intervals (i); \ + } while (0) + /*********************************************************************** String Allocation ***********************************************************************/ @@ -2100,7 +2101,7 @@ /* String is live; unmark it and its intervals. */ UNMARK_STRING (s); - if (!NULL_INTERVAL_P (s->intervals)) + if (s->intervals) UNMARK_BALANCE_INTERVALS (s->intervals); ++total_strings; @@ -2502,7 +2503,7 @@ return empty_multibyte_string; s = allocate_string (); - s->intervals = NULL_INTERVAL; + s->intervals = NULL; allocate_string_data (s, nchars, nbytes); XSETSTRING (string, s); string_chars_consed += nbytes; @@ -5221,7 +5222,7 @@ } s->size = nchars; s->size_byte = multibyte ? nbytes : -1; - s->intervals = NULL_INTERVAL; + s->intervals = NULL; XSETSTRING (string, s); return string; } @@ -5237,7 +5238,7 @@ s->size = nchars; s->size_byte = -1; s->data = (unsigned char *) data; - s->intervals = NULL_INTERVAL; + s->intervals = NULL; XSETSTRING (string, s); return string; } === modified file 'src/buffer.c' --- src/buffer.c 2012-08-07 13:37:21 +0000 +++ src/buffer.c 2012-08-08 06:11:29 +0000 @@ -360,7 +360,7 @@ BUF_CHARS_MODIFF (b) = 1; BUF_OVERLAY_MODIFF (b) = 1; BUF_SAVE_MODIFF (b) = 1; - BUF_INTERVALS (b) = 0; + BUF_INTERVALS (b) = NULL; BUF_UNCHANGED_MODIFIED (b) = 1; BUF_OVERLAY_UNCHANGED_MODIFIED (b) = 1; BUF_END_UNCHANGED (b) = 0; @@ -384,7 +384,7 @@ BVAR (b, zv_marker) = Qnil; name = Fcopy_sequence (buffer_or_name); - STRING_SET_INTERVALS (name, NULL_INTERVAL); + STRING_SET_INTERVALS (name, NULL); BVAR (b, name) = name; BVAR (b, undo_list) = (SREF (name, 0) != ' ') ? Qnil : Qt; @@ -589,7 +589,7 @@ all_buffers = b; name = Fcopy_sequence (name); - STRING_SET_INTERVALS (name, NULL_INTERVAL); + STRING_SET_INTERVALS (name, NULL); BVAR (b, name) = name; reset_buffer (b); @@ -1688,7 +1688,7 @@ m = next; } BUF_MARKERS (b) = NULL; - BUF_INTERVALS (b) = NULL_INTERVAL; + BUF_INTERVALS (b) = NULL; /* Perhaps we should explicitly free the interval tree here... */ } @@ -4904,8 +4904,8 @@ /* No one will share the text with these buffers, but let's play it safe. */ buffer_defaults.indirections = 0; buffer_local_symbols.indirections = 0; - BUF_INTERVALS (&buffer_defaults) = 0; - BUF_INTERVALS (&buffer_local_symbols) = 0; + BUF_INTERVALS (&buffer_defaults) = NULL; + BUF_INTERVALS (&buffer_local_symbols) = NULL; XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, pvecsize); XSETBUFFER (Vbuffer_defaults, &buffer_defaults); XSETPVECTYPESIZE (&buffer_local_symbols, PVEC_BUFFER, pvecsize); === modified file 'src/editfns.c' --- src/editfns.c 2012-08-07 07:33:18 +0000 +++ src/editfns.c 2012-08-08 06:11:29 +0000 @@ -4637,7 +4637,7 @@ /* Don't use Fset_text_properties: that can cause GC, which can clobber objects stored in the tmp_intervals. */ tmp_interval3 = validate_interval_range (buf, &startr1, &endr2, 0); - if (!NULL_INTERVAL_P (tmp_interval3)) + if (tmp_interval3) set_text_properties_1 (startr1, endr2, Qnil, buf, tmp_interval3); /* First region smaller than second. */ @@ -4696,11 +4696,11 @@ tmp_interval2 = copy_intervals (cur_intv, start2, len2); tmp_interval3 = validate_interval_range (buf, &startr1, &endr1, 0); - if (!NULL_INTERVAL_P (tmp_interval3)) + if (tmp_interval3) set_text_properties_1 (startr1, endr1, Qnil, buf, tmp_interval3); tmp_interval3 = validate_interval_range (buf, &startr2, &endr2, 0); - if (!NULL_INTERVAL_P (tmp_interval3)) + if (tmp_interval3) set_text_properties_1 (startr2, endr2, Qnil, buf, tmp_interval3); temp = SAFE_ALLOCA (len1_byte); @@ -4729,7 +4729,7 @@ tmp_interval2 = copy_intervals (cur_intv, start2, len2); tmp_interval3 = validate_interval_range (buf, &startr1, &endr2, 0); - if (!NULL_INTERVAL_P (tmp_interval3)) + if (tmp_interval3) set_text_properties_1 (startr1, endr2, Qnil, buf, tmp_interval3); /* holds region 2 */ @@ -4762,7 +4762,7 @@ tmp_interval2 = copy_intervals (cur_intv, start2, len2); tmp_interval3 = validate_interval_range (buf, &startr1, &endr2, 0); - if (!NULL_INTERVAL_P (tmp_interval3)) + if (tmp_interval3) set_text_properties_1 (startr1, endr2, Qnil, buf, tmp_interval3); /* holds region 1 */ === modified file 'src/fileio.c' --- src/fileio.c 2012-08-07 07:33:18 +0000 +++ src/fileio.c 2012-08-08 06:11:29 +0000 @@ -3145,7 +3145,7 @@ set_buffer_internal (XBUFFER (buffer)); adjust_markers_for_delete (BEG, BEG_BYTE, Z, Z_BYTE); adjust_overlays_for_delete (BEG, Z - BEG); - BUF_INTERVALS (current_buffer) = 0; + BUF_INTERVALS (current_buffer) = NULL; TEMP_SET_PT_BOTH (BEG, BEG_BYTE); /* Now we are safe to change the buffer's multibyteness directly. */ === modified file 'src/fns.c' --- src/fns.c 2012-08-07 13:37:21 +0000 +++ src/fns.c 2012-08-08 06:11:29 +0000 @@ -628,7 +628,7 @@ ptrdiff_t thislen_byte = SBYTES (this); memcpy (SDATA (val) + toindex_byte, SDATA (this), SBYTES (this)); - if (! NULL_INTERVAL_P (STRING_INTERVALS (this))) + if (STRING_INTERVALS (this)) { textprops[num_textprops].argnum = argnum; textprops[num_textprops].from = 0; @@ -640,7 +640,7 @@ /* Copy a single-byte string to a multibyte string. */ else if (STRINGP (this) && STRINGP (val)) { - if (! NULL_INTERVAL_P (STRING_INTERVALS (this))) + if (STRING_INTERVALS (this)) { textprops[num_textprops].argnum = argnum; textprops[num_textprops].from = 0; @@ -1060,7 +1060,7 @@ str_as_multibyte (SDATA (new_string), nbytes, SBYTES (string), NULL); string = new_string; - STRING_SET_INTERVALS (string, NULL_INTERVAL); + STRING_SET_INTERVALS (string, NULL); } return string; } === modified file 'src/insdel.c' --- src/insdel.c 2012-08-07 07:33:18 +0000 +++ src/insdel.c 2012-08-08 06:11:29 +0000 @@ -844,10 +844,10 @@ PT + nchars, PT_BYTE + nbytes, before_markers); - if (BUF_INTERVALS (current_buffer) != 0) + if (BUF_INTERVALS (current_buffer)) offset_intervals (current_buffer, PT, nchars); - if (!inherit && BUF_INTERVALS (current_buffer) != 0) + if (!inherit && BUF_INTERVALS (current_buffer)) set_text_properties (make_number (PT), make_number (PT + nchars), Qnil, Qnil, Qnil); @@ -1017,10 +1017,10 @@ adjust_markers_for_insert (GPT - nchars, GPT_BYTE - nbytes, GPT, GPT_BYTE, 0); - if (BUF_INTERVALS (current_buffer) != 0) + if (BUF_INTERVALS (current_buffer)) { offset_intervals (current_buffer, GPT - nchars, nchars); - graft_intervals_into_buffer (NULL_INTERVAL, GPT - nchars, nchars, + graft_intervals_into_buffer (NULL, GPT - nchars, nchars, current_buffer, 0); } @@ -1157,7 +1157,7 @@ PT_BYTE + outgoing_nbytes, 0); - if (BUF_INTERVALS (current_buffer) != 0) + if (BUF_INTERVALS (current_buffer)) offset_intervals (current_buffer, PT, nchars); /* Get the intervals for the part of the string we are inserting. */ @@ -1225,7 +1225,7 @@ adjust_overlays_for_insert (from, len - nchars_del); else if (len < nchars_del) adjust_overlays_for_delete (from, nchars_del - len); - if (BUF_INTERVALS (current_buffer) != 0) + if (BUF_INTERVALS (current_buffer)) { offset_intervals (current_buffer, from, len - nchars_del); } @@ -1823,7 +1823,7 @@ if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer) ++windows_or_buffers_changed; - if (BUF_INTERVALS (current_buffer) != 0) + if (BUF_INTERVALS (current_buffer)) { if (preserve_ptr) { === modified file 'src/intervals.c' --- src/intervals.c 2012-08-08 05:23:02 +0000 +++ src/intervals.c 2012-08-08 06:11:29 +0000 @@ -207,10 +207,10 @@ traverse_intervals_noorder (INTERVAL tree, void (*function) (INTERVAL, Lisp_Object), Lisp_Object arg) { /* Minimize stack usage. */ - while (!NULL_INTERVAL_P (tree)) + while (tree) { (*function) (tree, arg); - if (NULL_INTERVAL_P (tree->right)) + if (!tree->right) tree = tree->left; else { @@ -227,7 +227,7 @@ traverse_intervals (INTERVAL tree, ptrdiff_t position, void (*function) (INTERVAL, Lisp_Object), Lisp_Object arg) { - while (!NULL_INTERVAL_P (tree)) + while (tree) { traverse_intervals (tree->left, position, function, arg); position += LEFT_TOTAL_LENGTH (tree); @@ -262,7 +262,7 @@ { icount = 0; search_interval = i; - found_interval = NULL_INTERVAL; + found_interval = NULL; traverse_intervals_noorder (tree, &check_for_interval, Qnil); return found_interval; } @@ -333,7 +333,7 @@ /* Make A point to c */ interval_set_left (interval, i); - if (! NULL_INTERVAL_P (i)) + if (i) interval_set_parent (i, interval); /* A's total length is decreased by the length of B and its left child. */ @@ -380,7 +380,7 @@ /* Make A point to c */ interval_set_right (interval, i); - if (! NULL_INTERVAL_P (i)) + if (i) interval_set_parent (i, interval); /* A's total length is decreased by the length of B and its right child. */ @@ -480,12 +480,9 @@ INTERVAL balance_intervals (INTERVAL tree) { - if (tree == NULL_INTERVAL) - return NULL_INTERVAL; + return tree ? balance_intervals_internal (tree) : NULL; +} - return balance_intervals_internal (tree); -} - /* Split INTERVAL into two pieces, starting the second piece at character position OFFSET (counting from 0), relative to INTERVAL. INTERVAL becomes the left-hand piece, and the right-hand piece @@ -589,7 +586,7 @@ { Lisp_Object parent; - if (NULL_INTERVAL_P (source)) + if (!source) return 0; if (! INTERVAL_HAS_OBJECT (source)) @@ -617,8 +614,8 @@ to POSITION. */ register ptrdiff_t relative_position; - if (NULL_INTERVAL_P (tree)) - return NULL_INTERVAL; + if (!tree) + return NULL; relative_position = position; if (INTERVAL_HAS_OBJECT (tree)) @@ -669,8 +666,8 @@ register INTERVAL i = interval; register ptrdiff_t next_position; - if (NULL_INTERVAL_P (i)) - return NULL_INTERVAL; + if (!i) + return NULL; next_position = interval->position + LENGTH (interval); if (! NULL_RIGHT_CHILD (i)) @@ -695,7 +692,7 @@ i = INTERVAL_PARENT (i); } - return NULL_INTERVAL; + return NULL; } /* Find the preceding interval (lexicographically) to INTERVAL. @@ -707,8 +704,8 @@ { register INTERVAL i; - if (NULL_INTERVAL_P (interval)) - return NULL_INTERVAL; + if (!interval) + return NULL; if (! NULL_LEFT_CHILD (interval)) { @@ -733,7 +730,7 @@ i = INTERVAL_PARENT (i); } - return NULL_INTERVAL; + return NULL; } /* Find the interval containing POS given some non-NULL INTERVAL @@ -744,8 +741,8 @@ INTERVAL update_interval (register INTERVAL i, ptrdiff_t pos) { - if (NULL_INTERVAL_P (i)) - return NULL_INTERVAL; + if (!i) + return NULL; while (1) { @@ -938,8 +935,8 @@ struct interval newi; RESET_INTERVAL (&newi); - pleft = NULL_INTERVAL_P (prev) ? Qnil : prev->plist; - pright = NULL_INTERVAL_P (i) ? Qnil : i->plist; + pleft = prev ? prev->plist : Qnil; + pright = i ? i->plist : Qnil; interval_set_plist (&newi, merge_properties_sticky (pleft, pright)); if (! prev) /* i.e. position == BEG */ @@ -954,8 +951,7 @@ { prev = split_interval_right (prev, position - prev->position); interval_set_plist (prev, newi.plist); - if (! NULL_INTERVAL_P (i) - && intervals_equal (prev, i)) + if (i && intervals_equal (prev, i)) merge_interval_right (prev); } @@ -1164,16 +1160,16 @@ register INTERVAL migrate, this; register ptrdiff_t migrate_amt; - if (NULL_INTERVAL_P (i->left)) + if (!i->left) return i->right; - if (NULL_INTERVAL_P (i->right)) + if (!i->right) return i->left; migrate = i->left; migrate_amt = i->left->total_length; this = i->right; this->total_length += migrate_amt; - while (! NULL_INTERVAL_P (this->left)) + while (this->left) { this = this->left; this->total_length += migrate_amt; @@ -1204,7 +1200,7 @@ Lisp_Object owner; GET_INTERVAL_OBJECT (owner, i); parent = delete_node (i); - if (! NULL_INTERVAL_P (parent)) + if (parent) interval_set_object (parent, owner); if (BUFFERP (owner)) @@ -1221,13 +1217,13 @@ if (AM_LEFT_CHILD (i)) { interval_set_left (parent, delete_node (i)); - if (! NULL_INTERVAL_P (parent->left)) + if (parent->left) interval_set_parent (parent->left, parent); } else { interval_set_right (parent, delete_node (i)); - if (! NULL_INTERVAL_P (parent->right)) + if (parent->right) interval_set_parent (parent->right, parent); } } @@ -1250,7 +1246,7 @@ { register ptrdiff_t relative_position = from; - if (NULL_INTERVAL_P (tree)) + if (!tree) return 0; /* Left branch. */ @@ -1317,7 +1313,7 @@ GET_INTERVAL_OBJECT (parent, tree); offset = (BUFFERP (parent) ? BUF_BEG (XBUFFER (parent)) : 0); - if (NULL_INTERVAL_P (tree)) + if (!tree) return; eassert (start <= offset + TOTAL_LENGTH (tree) @@ -1325,7 +1321,7 @@ if (length == TOTAL_LENGTH (tree)) { - BUF_INTERVALS (buffer) = NULL_INTERVAL; + BUF_INTERVALS (buffer) = NULL; return; } @@ -1345,7 +1341,7 @@ tree = BUF_INTERVALS (buffer); if (left_to_delete == tree->total_length) { - BUF_INTERVALS (buffer) = NULL_INTERVAL; + BUF_INTERVALS (buffer) = NULL; return; } } @@ -1363,7 +1359,7 @@ void offset_intervals (struct buffer *buffer, ptrdiff_t start, ptrdiff_t length) { - if (NULL_INTERVAL_P (BUF_INTERVALS (buffer)) || length == 0) + if (!BUF_INTERVALS (buffer) || length == 0) return; if (length > 0) @@ -1580,17 +1576,17 @@ becomes part of whatever interval it was inserted into. To prevent inheritance, we must clear out the properties of the newly inserted text. */ - if (NULL_INTERVAL_P (source)) + if (!source) { Lisp_Object buf; - if (!inherit && !NULL_INTERVAL_P (tree) && length > 0) + if (!inherit && tree && length > 0) { XSETBUFFER (buf, buffer); set_text_properties_1 (make_number (position), make_number (position + length), Qnil, buf, 0); } - if (! NULL_INTERVAL_P (BUF_INTERVALS (buffer))) + if (BUF_INTERVALS (buffer)) /* Shouldn't be necessary. --Stef */ BUF_INTERVALS (buffer) = balance_an_interval (BUF_INTERVALS (buffer)); return; @@ -1608,7 +1604,7 @@ eassert (BUF_INTERVALS (buffer)->up_obj == 1); return; } - else if (NULL_INTERVAL_P (tree)) + else if (!tree) { /* Create an interval tree in which to place a copy of the intervals of the inserted string. */ Lisp_Object buf; @@ -1620,7 +1616,7 @@ eassert (TOTAL_LENGTH (tree) > 0); this = under = find_interval (tree, position); - eassert (!NULL_INTERVAL_P (under)); + eassert (under); over = find_interval (source, interval_start_pos (source)); /* Here for insertion in the middle of an interval. @@ -1662,7 +1658,7 @@ have already been copied into target intervals. UNDER is the next interval in the target. */ over_used = 0; - while (! NULL_INTERVAL_P (over)) + while (over) { /* If UNDER is longer than OVER, split it. */ if (LENGTH (over) - over_used < LENGTH (under)) @@ -1695,7 +1691,7 @@ under = next_interval (this); } - if (! NULL_INTERVAL_P (BUF_INTERVALS (buffer))) + if (BUF_INTERVALS (buffer)) BUF_INTERVALS (buffer) = balance_an_interval (BUF_INTERVALS (buffer)); return; } @@ -1864,7 +1860,7 @@ /* If we have no text properties and overlays, then we can do it quickly. */ - if (NULL_INTERVAL_P (BUF_INTERVALS (current_buffer)) && ! have_overlays) + if (!BUF_INTERVALS (current_buffer) && ! have_overlays) { temp_set_point_both (current_buffer, charpos, bytepos); return; @@ -1911,7 +1907,7 @@ with the same intangible property value, move forward or backward until a change in that property. */ if (NILP (Vinhibit_point_motion_hooks) - && ((! NULL_INTERVAL_P (to) && ! NULL_INTERVAL_P (toprev)) + && ((to && toprev) || have_overlays) /* Intangibility never stops us from positioning at the beginning or end of the buffer, so don't bother checking in that case. */ @@ -2134,7 +2130,7 @@ else abort (); - if (NULL_INTERVAL_P (i) || (i->position + LENGTH (i) <= pos)) + if (!i || (i->position + LENGTH (i) <= pos)) return 0; *val = textget (i->plist, prop); if (NILP (*val)) @@ -2142,14 +2138,13 @@ next = i; /* remember it in advance */ prev = previous_interval (i); - while (! NULL_INTERVAL_P (prev) + while (prev && EQ (*val, textget (prev->plist, prop))) i = prev, prev = previous_interval (prev); *start = i->position; next = next_interval (i); - while (! NULL_INTERVAL_P (next) - && EQ (*val, textget (next->plist, prop))) + while (next && EQ (*val, textget (next->plist, prop))) i = next, next = next_interval (next); *end = i->position + LENGTH (i); @@ -2220,16 +2215,16 @@ register INTERVAL i, new, t; register ptrdiff_t got, prevlen; - if (NULL_INTERVAL_P (tree) || length <= 0) - return NULL_INTERVAL; + if (!tree || length <= 0) + return NULL; i = find_interval (tree, start); - eassert (!NULL_INTERVAL_P (i) && LENGTH (i) > 0); + eassert (i && LENGTH (i) > 0); /* If there is only one interval and it's the default, return nil. */ if ((start - i->position + 1 + length) < LENGTH (i) && DEFAULT_INTERVAL_P (i)) - return NULL_INTERVAL; + return NULL; new = make_interval (); new->position = 0; @@ -2260,7 +2255,7 @@ { INTERVAL interval_copy = copy_intervals (BUF_INTERVALS (buffer), position, length); - if (NULL_INTERVAL_P (interval_copy)) + if (!interval_copy) return; interval_set_object (interval_copy, string); === modified file 'src/intervals.h' --- src/intervals.h 2012-08-08 05:23:02 +0000 +++ src/intervals.h 2012-08-08 06:11:29 +0000 @@ -20,9 +20,6 @@ INLINE_HEADER_BEGIN -#define NULL_INTERVAL ((INTERVAL)0) -#define INTERVAL_DEFAULT NULL_INTERVAL - /* Basic data type for use of intervals. */ struct interval @@ -63,28 +60,25 @@ /* These are macros for dealing with the interval tree. */ -#define NULL_INTERVAL_P(i) ((i) == NULL_INTERVAL) - /* True if this interval has no right child. */ -#define NULL_RIGHT_CHILD(i) ((i)->right == NULL_INTERVAL) +#define NULL_RIGHT_CHILD(i) ((i)->right == NULL) /* True if this interval has no left child. */ -#define NULL_LEFT_CHILD(i) ((i)->left == NULL_INTERVAL) +#define NULL_LEFT_CHILD(i) ((i)->left == NULL) /* True if this interval has no parent. */ #define NULL_PARENT(i) ((i)->up_obj || (i)->up.interval == 0) /* True if this interval is the left child of some other interval. */ -#define AM_LEFT_CHILD(i) (! NULL_PARENT (i) \ - && INTERVAL_PARENT (i)->left == (i)) +#define AM_LEFT_CHILD(i) \ + (! NULL_PARENT (i) && INTERVAL_PARENT (i)->left == (i)) /* True if this interval is the right child of some other interval. */ -#define AM_RIGHT_CHILD(i) (! NULL_PARENT (i) \ - && INTERVAL_PARENT (i)->right == (i)) +#define AM_RIGHT_CHILD(i) \ + (! NULL_PARENT (i) && INTERVAL_PARENT (i)->right == (i)) /* True if this interval has no children. */ -#define LEAF_INTERVAL_P(i) ((i)->left == NULL_INTERVAL \ - && (i)->right == NULL_INTERVAL) +#define LEAF_INTERVAL_P(i) ((i)->left == NULL && (i)->right == NULL) /* True if this interval has no parent and is therefore the root. */ #define ROOT_INTERVAL_P(i) (NULL_PARENT (i)) @@ -93,17 +87,16 @@ #define ONLY_INTERVAL_P(i) (ROOT_INTERVAL_P ((i)) && LEAF_INTERVAL_P ((i))) /* True if this interval has both left and right children. */ -#define BOTH_KIDS_P(i) ((i)->left != NULL_INTERVAL \ - && (i)->right != NULL_INTERVAL) +#define BOTH_KIDS_P(i) ((i)->left != NULL && (i)->right != NULL) /* The total size of all text represented by this interval and all its children in the tree. This is zero if the interval is null. */ -#define TOTAL_LENGTH(i) ((i) == NULL_INTERVAL ? 0 : (i)->total_length) +#define TOTAL_LENGTH(i) ((i) == NULL ? 0 : (i)->total_length) /* The size of text represented by this interval alone. */ -#define LENGTH(i) ((i) == NULL_INTERVAL ? 0 : (TOTAL_LENGTH ((i)) \ - - TOTAL_LENGTH ((i)->right) \ - - TOTAL_LENGTH ((i)->left))) +#define LENGTH(i) ((i) == NULL ? 0 : (TOTAL_LENGTH ((i)) \ + - TOTAL_LENGTH ((i)->right) \ + - TOTAL_LENGTH ((i)->left))) /* The position of the character just past the end of I. Note that the position cache i->position must be valid for this to work. */ @@ -115,15 +108,14 @@ /* The total size of the right subtree of this interval. */ #define RIGHT_TOTAL_LENGTH(i) ((i)->right ? (i)->right->total_length : 0) - /* These macros are for dealing with the interval properties. */ /* True if this is a default interval, which is the same as being null or having no properties. */ -#define DEFAULT_INTERVAL_P(i) (NULL_INTERVAL_P (i) || EQ ((i)->plist, Qnil)) +#define DEFAULT_INTERVAL_P(i) (!i || EQ ((i)->plist, Qnil)) /* Test what type of parent we have. Three possibilities: another - interval, a buffer or string object, or NULL_INTERVAL. */ + interval, a buffer or string object, or NULL. */ #define INTERVAL_HAS_PARENT(i) ((i)->up_obj == 0 && (i)->up.interval != 0) #define INTERVAL_HAS_OBJECT(i) ((i)->up_obj) @@ -187,7 +179,7 @@ /* Get the parent interval, if any, otherwise a null pointer. Useful for walking up to the root in a "for" loop; use this to get the - "next" value, and test the result to see if it's NULL_INTERVAL. */ + "next" value, and test the result to see if it's NULL. */ #define INTERVAL_PARENT_OR_NULL(i) \ (INTERVAL_HAS_PARENT (i) ? INTERVAL_PARENT (i) : 0) @@ -195,8 +187,8 @@ #define RESET_INTERVAL(i) \ { \ (i)->total_length = (i)->position = 0; \ - (i)->left = (i)->right = NULL_INTERVAL; \ - interval_set_parent (i, NULL_INTERVAL); \ + (i)->left = (i)->right = NULL; \ + interval_set_parent (i, NULL); \ (i)->write_protect = 0; \ (i)->visible = 0; \ (i)->front_sticky = (i)->rear_sticky = 0; \ @@ -232,39 +224,36 @@ /* Is this interval visible? Replace later with cache access. */ #define INTERVAL_VISIBLE_P(i) \ - (! NULL_INTERVAL_P (i) && NILP (textget ((i)->plist, Qinvisible))) + (i && NILP (textget ((i)->plist, Qinvisible))) /* Is this interval writable? Replace later with cache access. */ #define INTERVAL_WRITABLE_P(i) \ - (! NULL_INTERVAL_P (i) \ - && (NILP (textget ((i)->plist, Qread_only)) \ - || ((CONSP (Vinhibit_read_only) \ - ? !NILP (Fmemq (textget ((i)->plist, Qread_only), \ - Vinhibit_read_only)) \ - : !NILP (Vinhibit_read_only))))) \ + (i && (NILP (textget ((i)->plist, Qread_only)) \ + || ((CONSP (Vinhibit_read_only) \ + ? !NILP (Fmemq (textget ((i)->plist, Qread_only), \ + Vinhibit_read_only)) \ + : !NILP (Vinhibit_read_only))))) \ /* Macros to tell whether insertions before or after this interval - should stick to it. */ -/* Replace later with cache access */ -/*#define FRONT_STICKY_P(i) ((i)->front_sticky != 0) - #define END_STICKY_P(i) ((i)->rear_sticky != 0)*/ -/* As we now have Vtext_property_default_nonsticky, these macros are - unreliable now. Currently, they are never used. */ -#define FRONT_STICKY_P(i) \ - (! NULL_INTERVAL_P (i) && ! NILP (textget ((i)->plist, Qfront_sticky))) -#define END_NONSTICKY_P(i) \ - (! NULL_INTERVAL_P (i) && ! NILP (textget ((i)->plist, Qrear_nonsticky))) -#define FRONT_NONSTICKY_P(i) \ - (! NULL_INTERVAL_P (i) && ! EQ (Qt, textget ((i)->plist, Qfront_sticky))) + should stick to it. Now we have Vtext_property_default_nonsticky, + so these macros are unreliable now and never used. */ +#if 0 +#define FRONT_STICKY_P(i) \ + (i && ! NILP (textget ((i)->plist, Qfront_sticky))) +#define END_NONSTICKY_P(i) \ + (i && ! NILP (textget ((i)->plist, Qrear_nonsticky))) +#define FRONT_NONSTICKY_P(i) \ + (i && ! EQ (Qt, textget ((i)->plist, Qfront_sticky))) +#endif /* If PROP is the `invisible' property of a character, this is 1 if the character should be treated as invisible, and 2 if it is invisible but with an ellipsis. */ -#define TEXT_PROP_MEANS_INVISIBLE(prop) \ +#define TEXT_PROP_MEANS_INVISIBLE(prop) \ (EQ (BVAR (current_buffer, invisibility_spec), Qt) \ - ? !NILP (prop) \ + ? !NILP (prop) \ : invisible_p (prop, BVAR (current_buffer, invisibility_spec))) /* Declared in alloc.c. */ === modified file 'src/print.c' --- src/print.c 2012-08-07 07:42:34 +0000 +++ src/print.c 2012-08-08 06:11:29 +0000 @@ -1408,7 +1408,7 @@ if (! EQ (Vprint_charset_text_property, Qt)) obj = print_prune_string_charset (obj); - if (!NULL_INTERVAL_P (STRING_INTERVALS (obj))) + if (STRING_INTERVALS (obj)) { PRINTCHAR ('#'); PRINTCHAR ('('); @@ -1499,7 +1499,7 @@ } PRINTCHAR ('\"'); - if (!NULL_INTERVAL_P (STRING_INTERVALS (obj))) + if (STRING_INTERVALS (obj)) { traverse_intervals (STRING_INTERVALS (obj), 0, print_interval, printcharfun); === modified file 'src/syntax.c' --- src/syntax.c 2012-08-04 14:33:00 +0000 +++ src/syntax.c 2012-08-08 06:11:29 +0000 @@ -171,7 +171,7 @@ direction than the intervals - or in an interval. We update the current syntax-table basing on the property of this interval, and update the interval to start further than CHARPOS - or be - NULL_INTERVAL. We also update lim_property to be the next value of + NULL. We also update lim_property to be the next value of charpos to call this subroutine again - or be before/after the start/end of OBJECT. */ @@ -192,7 +192,7 @@ i = interval_of (charpos, object); gl_state.backward_i = gl_state.forward_i = i; invalidate = 0; - if (NULL_INTERVAL_P (i)) + if (!i) return; /* interval_of updates only ->position of the return value, so update the parents manually to speed up update_interval. */ @@ -217,7 +217,7 @@ /* We are guaranteed to be called with CHARPOS either in i, or further off. */ - if (NULL_INTERVAL_P (i)) + if (!i) error ("Error in syntax_table logic for to-the-end intervals"); else if (charpos < i->position) /* Move left. */ { @@ -287,7 +287,7 @@ } } - while (!NULL_INTERVAL_P (i)) + while (i) { if (cnt && !EQ (tmp_table, textget (i->plist, Qsyntax_table))) { @@ -313,7 +313,7 @@ /* e_property at EOB is not set to ZV but to ZV+1, so that we can do INC(from);UPDATE_SYNTAX_TABLE_FORWARD without having to check eob between the two. */ - + (NULL_INTERVAL_P (next_interval (i)) ? 1 : 0); + + (next_interval (i) ? 0 : 1); gl_state.forward_i = i; } else @@ -326,7 +326,7 @@ cnt++; i = count > 0 ? next_interval (i) : previous_interval (i); } - eassert (NULL_INTERVAL_P (i)); /* This property goes to the end. */ + eassert (i == NULL); /* This property goes to the end. */ if (count > 0) gl_state.e_property = gl_state.stop; else === modified file 'src/textprop.c' --- src/textprop.c 2012-08-07 11:28:41 +0000 +++ src/textprop.c 2012-08-08 06:11:29 +0000 @@ -105,7 +105,7 @@ Fprevious_property_change which call this function with BEGIN == END. Handle this case specially. - If FORCE is soft (0), it's OK to return NULL_INTERVAL. Otherwise, + If FORCE is soft (0), it's OK to return NULL. Otherwise, create an interval tree for OBJECT if one doesn't exist, provided the object actually contains text. In the current design, if there is no text, there can be no text properties. */ @@ -126,7 +126,7 @@ /* If we are asked for a point, but from a subr which operates on a range, then return nothing. */ if (EQ (*begin, *end) && begin != end) - return NULL_INTERVAL; + return NULL; if (XINT (*begin) > XINT (*end)) { @@ -147,7 +147,7 @@ /* If there's no text, there are no properties. */ if (BUF_BEGV (b) == BUF_ZV (b)) - return NULL_INTERVAL; + return NULL; searchpos = XINT (*begin); } @@ -164,12 +164,12 @@ i = STRING_INTERVALS (object); if (len == 0) - return NULL_INTERVAL; + return NULL; searchpos = XINT (*begin); } - if (NULL_INTERVAL_P (i)) + if (!i) return (force ? create_root_interval (object) : i); return find_interval (i, searchpos); @@ -500,7 +500,7 @@ if (NILP (object)) XSETBUFFER (object, current_buffer); else if (EQ (object, Qt)) - return NULL_INTERVAL; + return NULL; CHECK_STRING_OR_BUFFER (object); @@ -521,8 +521,8 @@ if (!(beg <= position && position <= end)) args_out_of_range (make_number (position), make_number (position)); - if (beg == end || NULL_INTERVAL_P (i)) - return NULL_INTERVAL; + if (beg == end || !i) + return NULL; return find_interval (i, position); } @@ -542,7 +542,7 @@ XSETBUFFER (object, current_buffer); i = validate_interval_range (object, &position, &position, soft); - if (NULL_INTERVAL_P (i)) + if (!i) return Qnil; /* If POSITION is at the end of the interval, it means it's the end of OBJECT. @@ -922,12 +922,12 @@ bother checking further intervals. */ if (EQ (limit, Qt)) { - if (NULL_INTERVAL_P (i)) + if (!i) next = i; else next = next_interval (i); - if (NULL_INTERVAL_P (next)) + if (!next) XSETFASTINT (position, (STRINGP (object) ? SCHARS (object) : BUF_ZV (XBUFFER (object)))); @@ -936,16 +936,16 @@ return position; } - if (NULL_INTERVAL_P (i)) + if (!i) return limit; next = next_interval (i); - while (!NULL_INTERVAL_P (next) && intervals_equal (i, next) + while (next && intervals_equal (i, next) && (NILP (limit) || next->position < XFASTINT (limit))) next = next_interval (next); - if (NULL_INTERVAL_P (next) + if (!next || (next->position >= (INTEGERP (limit) ? XFASTINT (limit) @@ -983,17 +983,17 @@ CHECK_NUMBER_COERCE_MARKER (limit); i = validate_interval_range (object, &position, &position, soft); - if (NULL_INTERVAL_P (i)) + if (!i) return limit; here_val = textget (i->plist, prop); next = next_interval (i); - while (! NULL_INTERVAL_P (next) + while (next && EQ (here_val, textget (next->plist, prop)) && (NILP (limit) || next->position < XFASTINT (limit))) next = next_interval (next); - if (NULL_INTERVAL_P (next) + if (!next || (next->position >= (INTEGERP (limit) ? XFASTINT (limit) @@ -1029,7 +1029,7 @@ CHECK_NUMBER_COERCE_MARKER (limit); i = validate_interval_range (object, &position, &position, soft); - if (NULL_INTERVAL_P (i)) + if (!i) return limit; /* Start with the interval containing the char before point. */ @@ -1037,12 +1037,12 @@ i = previous_interval (i); previous = previous_interval (i); - while (!NULL_INTERVAL_P (previous) && intervals_equal (previous, i) + while (previous && intervals_equal (previous, i) && (NILP (limit) || (previous->position + LENGTH (previous) > XFASTINT (limit)))) previous = previous_interval (previous); - if (NULL_INTERVAL_P (previous) + if (!previous || (previous->position + LENGTH (previous) <= (INTEGERP (limit) ? XFASTINT (limit) @@ -1080,21 +1080,21 @@ i = validate_interval_range (object, &position, &position, soft); /* Start with the interval containing the char before point. */ - if (!NULL_INTERVAL_P (i) && i->position == XFASTINT (position)) + if (i && i->position == XFASTINT (position)) i = previous_interval (i); - if (NULL_INTERVAL_P (i)) + if (!i) return limit; here_val = textget (i->plist, prop); previous = previous_interval (i); - while (!NULL_INTERVAL_P (previous) + while (previous && EQ (here_val, textget (previous->plist, prop)) && (NILP (limit) || (previous->position + LENGTH (previous) > XFASTINT (limit)))) previous = previous_interval (previous); - if (NULL_INTERVAL_P (previous) + if (!previous || (previous->position + LENGTH (previous) <= (INTEGERP (limit) ? XFASTINT (limit) @@ -1130,7 +1130,7 @@ XSETBUFFER (object, current_buffer); i = validate_interval_range (object, &start, &end, hard); - if (NULL_INTERVAL_P (i)) + if (!i) return Qnil; s = XINT (start); @@ -1277,13 +1277,13 @@ if (! STRING_INTERVALS (object)) return Qnil; - STRING_SET_INTERVALS (object, NULL_INTERVAL); + STRING_SET_INTERVALS (object, NULL); return Qt; } i = validate_interval_range (object, &start, &end, soft); - if (NULL_INTERVAL_P (i)) + if (!i) { /* If buffer has no properties, and we want none, return now. */ if (NILP (properties)) @@ -1296,7 +1296,7 @@ i = validate_interval_range (object, &start, &end, hard); /* This can return if start == end. */ - if (NULL_INTERVAL_P (i)) + if (!i) return Qnil; } @@ -1321,7 +1321,7 @@ void set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object buffer, INTERVAL i) { - register INTERVAL prev_changed = NULL_INTERVAL; + register INTERVAL prev_changed = NULL; register ptrdiff_t s, len; INTERVAL unchanged; @@ -1378,7 +1378,7 @@ merge the intervals, so as to make the undo records and cause redisplay to happen. */ set_properties (properties, i, buffer); - if (!NULL_INTERVAL_P (prev_changed)) + if (prev_changed) merge_interval_left (i); return; } @@ -1389,7 +1389,7 @@ merge the intervals, so as to make the undo records and cause redisplay to happen. */ set_properties (properties, i, buffer); - if (NULL_INTERVAL_P (prev_changed)) + if (!prev_changed) prev_changed = i; else prev_changed = i = merge_interval_left (i); @@ -1421,7 +1421,7 @@ XSETBUFFER (object, current_buffer); i = validate_interval_range (object, &start, &end, soft); - if (NULL_INTERVAL_P (i)) + if (!i) return Qnil; s = XINT (start); @@ -1508,7 +1508,7 @@ XSETBUFFER (object, current_buffer); i = validate_interval_range (object, &start, &end, soft); - if (NULL_INTERVAL_P (i)) + if (!i) return Qnil; s = XINT (start); @@ -1613,11 +1613,11 @@ if (NILP (object)) XSETBUFFER (object, current_buffer); i = validate_interval_range (object, &start, &end, soft); - if (NULL_INTERVAL_P (i)) + if (!i) return (!NILP (value) || EQ (start, end) ? Qnil : start); e = XINT (end); - while (! NULL_INTERVAL_P (i)) + while (i) { if (i->position >= e) break; @@ -1649,12 +1649,12 @@ if (NILP (object)) XSETBUFFER (object, current_buffer); i = validate_interval_range (object, &start, &end, soft); - if (NULL_INTERVAL_P (i)) + if (!i) return (NILP (value) || EQ (start, end)) ? Qnil : start; s = XINT (start); e = XINT (end); - while (! NULL_INTERVAL_P (i)) + while (i) { if (i->position >= e) break; @@ -1759,7 +1759,7 @@ struct gcpro gcpro1, gcpro2; i = validate_interval_range (src, &start, &end, soft); - if (NULL_INTERVAL_P (i)) + if (!i) return Qnil; CHECK_NUMBER_COERCE_MARKER (pos); @@ -1811,7 +1811,7 @@ } i = next_interval (i); - if (NULL_INTERVAL_P (i)) + if (!i) break; p += len; @@ -1852,7 +1852,7 @@ result = Qnil; i = validate_interval_range (object, &start, &end, soft); - if (!NULL_INTERVAL_P (i)) + if (i) { ptrdiff_t s = XINT (start); ptrdiff_t e = XINT (end); @@ -1884,7 +1884,7 @@ result); i = next_interval (i); - if (NULL_INTERVAL_P (i)) + if (!i) break; s = i->position; } @@ -2007,7 +2007,7 @@ interval_insert_behind_hooks = Qnil; interval_insert_in_front_hooks = Qnil; - if (NULL_INTERVAL_P (intervals)) + if (!intervals) return; if (start > end) @@ -2048,7 +2048,7 @@ indirectly defined via the category property. */ if (i != prev) { - if (! NULL_INTERVAL_P (i)) + if (i) { after = textget (i->plist, Qread_only); @@ -2068,7 +2068,7 @@ } } - if (! NULL_INTERVAL_P (prev)) + if (prev) { before = textget (prev->plist, Qread_only); @@ -2088,7 +2088,7 @@ } } } - else if (! NULL_INTERVAL_P (i)) + else if (i) { after = textget (i->plist, Qread_only); @@ -2115,10 +2115,10 @@ } /* Run both insert hooks (just once if they're the same). */ - if (!NULL_INTERVAL_P (prev)) + if (prev) interval_insert_behind_hooks = textget (prev->plist, Qinsert_behind_hooks); - if (!NULL_INTERVAL_P (i)) + if (i) interval_insert_in_front_hooks = textget (i->plist, Qinsert_in_front_hooks); } @@ -2146,7 +2146,7 @@ i = next_interval (i); } /* Keep going thru the interval containing the char before END. */ - while (! NULL_INTERVAL_P (i) && i->position < end); + while (i && i->position < end); if (!inhibit_modification_hooks) { === modified file 'src/xdisp.c' --- src/xdisp.c 2012-08-07 07:42:34 +0000 +++ src/xdisp.c 2012-08-08 06:11:29 +0000 @@ -3321,7 +3321,7 @@ interval if there isn't such an interval. */ position = make_number (charpos); iv = validate_interval_range (object, &position, &position, 0); - if (!NULL_INTERVAL_P (iv)) + if (iv) { Lisp_Object values_here[LAST_PROP_IDX]; struct props *p; @@ -3333,7 +3333,7 @@ /* Look for an interval following iv that has different properties. */ for (next_iv = next_interval (iv); - (!NULL_INTERVAL_P (next_iv) + (next_iv && (NILP (limit) || XFASTINT (limit) > next_iv->position)); next_iv = next_interval (next_iv)) @@ -3351,7 +3351,7 @@ break; } - if (!NULL_INTERVAL_P (next_iv)) + if (next_iv) { if (INTEGERP (limit) && next_iv->position >= XFASTINT (limit)) ------------------------------------------------------------ revno: 109503 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2012-08-08 09:23:02 +0400 message: Check total length of intervals with eassert. * intervals.h (CHECK_TOTAL_LENGTH): Remove. * intervals.c: Change all users to eassert. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-07 16:53:38 +0000 +++ src/ChangeLog 2012-08-08 05:23:02 +0000 @@ -1,3 +1,9 @@ +2012-08-08 Dmitry Antipov + + Check total length of intervals with eassert. + * intervals.h (CHECK_TOTAL_LENGTH): Remove. + * intervals.c: Change all users to eassert. + 2012-08-07 Eli Zaretskii * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist): Rename === modified file 'src/intervals.c' --- src/intervals.c 2012-08-07 11:28:41 +0000 +++ src/intervals.c 2012-08-08 05:23:02 +0000 @@ -76,14 +76,14 @@ { new->total_length = (BUF_Z (XBUFFER (parent)) - BUF_BEG (XBUFFER (parent))); - CHECK_TOTAL_LENGTH (new); + eassert (0 <= TOTAL_LENGTH (new)); BUF_INTERVALS (XBUFFER (parent)) = new; new->position = BEG; } else if (STRINGP (parent)) { new->total_length = SCHARS (parent); - CHECK_TOTAL_LENGTH (new); + eassert (0 <= TOTAL_LENGTH (new)); STRING_SET_INTERVALS (parent, new); new->position = 0; } @@ -338,11 +338,11 @@ /* A's total length is decreased by the length of B and its left child. */ interval->total_length -= B->total_length - LEFT_TOTAL_LENGTH (interval); - CHECK_TOTAL_LENGTH (interval); + eassert (0 <= TOTAL_LENGTH (interval)); /* B must have the same total length of A. */ B->total_length = old_total; - CHECK_TOTAL_LENGTH (B); + eassert (0 <= TOTAL_LENGTH (B)); return B; } @@ -385,11 +385,11 @@ /* A's total length is decreased by the length of B and its right child. */ interval->total_length -= B->total_length - RIGHT_TOTAL_LENGTH (interval); - CHECK_TOTAL_LENGTH (interval); + eassert (0 <= TOTAL_LENGTH (interval)); /* B must have the same total length of A. */ B->total_length = old_total; - CHECK_TOTAL_LENGTH (B); + eassert (0 <= TOTAL_LENGTH (B)); return B; } @@ -513,7 +513,7 @@ { interval_set_right (interval, new); new->total_length = new_length; - CHECK_TOTAL_LENGTH (new); + eassert (0 <= TOTAL_LENGTH (new)); } else { @@ -522,7 +522,7 @@ interval_set_parent (interval->right, new); interval_set_right (interval, new); new->total_length = new_length + new->right->total_length; - CHECK_TOTAL_LENGTH (new); + eassert (0 <= TOTAL_LENGTH (new)); balance_an_interval (new); } @@ -558,7 +558,7 @@ { interval_set_left (interval, new); new->total_length = new_length; - CHECK_TOTAL_LENGTH (new); + eassert (0 <= TOTAL_LENGTH (new)); } else { @@ -567,7 +567,7 @@ interval_set_parent (new->left, new); interval_set_left (interval, new); new->total_length = new_length + new->left->total_length; - CHECK_TOTAL_LENGTH (new); + eassert (0 <= TOTAL_LENGTH (new)); balance_an_interval (new); } @@ -918,7 +918,7 @@ for (temp = prev ? prev : i; temp; temp = INTERVAL_PARENT_OR_NULL (temp)) { temp->total_length += length; - CHECK_TOTAL_LENGTH (temp); + eassert (0 <= TOTAL_LENGTH (temp)); temp = balance_possible_root_interval (temp); } @@ -975,7 +975,7 @@ for (temp = i; temp; temp = INTERVAL_PARENT_OR_NULL (temp)) { temp->total_length += length; - CHECK_TOTAL_LENGTH (temp); + eassert (0 <= TOTAL_LENGTH (temp)); temp = balance_possible_root_interval (temp); } } @@ -1178,7 +1178,7 @@ this = this->left; this->total_length += migrate_amt; } - CHECK_TOTAL_LENGTH (this); + eassert (0 <= TOTAL_LENGTH (this)); interval_set_left (this, migrate); interval_set_parent (migrate, this); @@ -1260,7 +1260,7 @@ relative_position, amount); tree->total_length -= subtract; - CHECK_TOTAL_LENGTH (tree); + eassert (0 <= TOTAL_LENGTH (tree)); return subtract; } /* Right branch. */ @@ -1275,7 +1275,7 @@ relative_position, amount); tree->total_length -= subtract; - CHECK_TOTAL_LENGTH (tree); + eassert (0 <= TOTAL_LENGTH (tree)); return subtract; } /* Here -- this node. */ @@ -1290,7 +1290,7 @@ amount = my_amount; tree->total_length -= amount; - CHECK_TOTAL_LENGTH (tree); + eassert (0 <= TOTAL_LENGTH (tree)); if (LENGTH (tree) == 0) delete_interval (tree); @@ -1332,7 +1332,7 @@ if (ONLY_INTERVAL_P (tree)) { tree->total_length -= length; - CHECK_TOTAL_LENGTH (tree); + eassert (0 <= TOTAL_LENGTH (tree)); return; } @@ -1398,19 +1398,19 @@ while (! NULL_LEFT_CHILD (successor)) { successor->total_length += absorb; - CHECK_TOTAL_LENGTH (successor); + eassert (0 <= TOTAL_LENGTH (successor)); successor = successor->left; } successor->total_length += absorb; - CHECK_TOTAL_LENGTH (successor); + eassert (0 <= TOTAL_LENGTH (successor)); delete_interval (i); return successor; } /* Zero out this interval. */ i->total_length -= absorb; - CHECK_TOTAL_LENGTH (i); + eassert (0 <= TOTAL_LENGTH (i)); successor = i; while (! NULL_PARENT (successor)) /* It's above us. Subtract as @@ -1425,7 +1425,7 @@ successor = INTERVAL_PARENT (successor); successor->total_length -= absorb; - CHECK_TOTAL_LENGTH (successor); + eassert (0 <= TOTAL_LENGTH (successor)); } /* This must be the rightmost or last interval and cannot @@ -1454,19 +1454,19 @@ while (! NULL_RIGHT_CHILD (predecessor)) { predecessor->total_length += absorb; - CHECK_TOTAL_LENGTH (predecessor); + eassert (0 <= TOTAL_LENGTH (predecessor)); predecessor = predecessor->right; } predecessor->total_length += absorb; - CHECK_TOTAL_LENGTH (predecessor); + eassert (0 <= TOTAL_LENGTH (predecessor)); delete_interval (i); return predecessor; } /* Zero out this interval. */ i->total_length -= absorb; - CHECK_TOTAL_LENGTH (i); + eassert (0 <= TOTAL_LENGTH (i)); predecessor = i; while (! NULL_PARENT (predecessor)) /* It's above us. Go up, @@ -1481,7 +1481,7 @@ predecessor = INTERVAL_PARENT (predecessor); predecessor->total_length -= absorb; - CHECK_TOTAL_LENGTH (predecessor); + eassert (0 <= TOTAL_LENGTH (predecessor)); } /* This must be the leftmost or first interval and cannot @@ -2235,7 +2235,7 @@ new->position = 0; got = (LENGTH (i) - (start - i->position)); new->total_length = length; - CHECK_TOTAL_LENGTH (new); + eassert (0 <= TOTAL_LENGTH (new)); copy_properties (i, new); t = new; @@ -2318,7 +2318,7 @@ i->total_length = end - start; else i->total_length = end_byte - start_byte; - CHECK_TOTAL_LENGTH (i); + eassert (0 <= TOTAL_LENGTH (i)); if (TOTAL_LENGTH (i) == 0) { === modified file 'src/intervals.h' --- src/intervals.h 2012-08-07 11:28:41 +0000 +++ src/intervals.h 2012-08-08 05:23:02 +0000 @@ -191,15 +191,6 @@ #define INTERVAL_PARENT_OR_NULL(i) \ (INTERVAL_HAS_PARENT (i) ? INTERVAL_PARENT (i) : 0) -/* Abort if interval I's size is negative. */ -#define CHECK_TOTAL_LENGTH(i) \ - do \ - { \ - if ((i)->total_length < 0) \ - abort (); \ - } \ - while (0) - /* Reset this interval to its vanilla, or no-property state. */ #define RESET_INTERVAL(i) \ { \ ------------------------------------------------------------ revno: 109502 author: Oscar Fuentes committer: Dan Nicolaescu branch nick: trunk timestamp: Wed 2012-08-08 00:41:35 -0400 message: * vc/diff-mode.el (diff-remove-trailing-whitespace): New function. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-08 02:30:08 +0000 +++ lisp/ChangeLog 2012-08-08 04:41:35 +0000 @@ -1,3 +1,7 @@ +2012-08-08 Óscar Fuentes + + * vc/diff-mode.el (diff-remove-trailing-whitespace): New function. + 2012-08-08 Fabián Ezequiel Gallina * progmodes/python.el Fixed defsubst warning. === modified file 'lisp/vc/diff-mode.el' --- lisp/vc/diff-mode.el 2012-07-10 11:51:54 +0000 +++ lisp/vc/diff-mode.el 2012-08-08 04:41:35 +0000 @@ -2016,6 +2016,47 @@ ;; When there's no more hunks, diff-hunk-next signals an error. (error nil)))) +(defun diff-remove-trailing-whitespace () + "When on a buffer that contains a diff, inspects the +differences and removes trailing whitespace (spaces, tabs) from +the lines modified or introduced by this diff. Shows a message +with the name of the altered buffers, which are unsaved. If a +file referenced on the diff has no buffer and needs to be fixed, +a buffer visiting that file is created." + (interactive) + (goto-char (point-min)) + (let + ;; We assume that the diff header has no trailing whitespace. + ((modified-buffers nil) + (white-positions nil)) + (while (re-search-forward "^[+!>].*[ \t]+$" (point-max) t) + (save-excursion + (cl-destructuring-bind (buf line-offset pos src _dst &optional _switched) + (diff-find-source-location t t) + (when line-offset + (set-buffer buf) + (save-excursion + (goto-char (+ (car pos) (cdr src))) + (beginning-of-line) + (when (re-search-forward "\\([ \t]+\\)$" (line-end-position) t) + (when (not (member buf modified-buffers)) + (push buf modified-buffers)) + (goto-char (match-end 0)) + (push (point-marker) white-positions) + (goto-char (match-beginning 0)) + (push (point-marker) white-positions) + (push buf white-positions))))))) + (while white-positions + (save-excursion + (set-buffer (pop white-positions)) + (delete-region (pop white-positions) (pop white-positions)))) + (if modified-buffers + (let ((msg "Deleted new trailing whitespace from:")) + (dolist (f modified-buffers) + (setq msg (concat msg " `" (buffer-name f) "'"))) + (message "%s" msg)) + (message "No trailing whitespace fixes needed.")))) + ;; provide the package (provide 'diff-mode) ------------------------------------------------------------ revno: 109501 committer: Fabián Ezequiel Gallina branch nick: trunk timestamp: Tue 2012-08-07 23:30:08 -0300 message: * progmodes/python.el Fixed defsubst warning. (python-syntax-context) Rename from python-info-ppss-context. (python-syntax-context-type): Rename from python-info-ppss-context-type. (python-syntax-comment-or-string-p): Rename from python-info-ppss-comment-or-string-p. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-08 01:30:58 +0000 +++ lisp/ChangeLog 2012-08-08 02:30:08 +0000 @@ -1,3 +1,12 @@ +2012-08-08 Fabián Ezequiel Gallina + + * progmodes/python.el Fixed defsubst warning. + (python-syntax-context) Rename from python-info-ppss-context. + (python-syntax-context-type): Rename from + python-info-ppss-context-type. + (python-syntax-comment-or-string-p): Rename from + python-info-ppss-comment-or-string-p. + 2012-08-08 Jay Belanger * calc/calc-misc.el (calc-record-why): Don't record a message twice. === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2012-08-06 03:27:43 +0000 +++ lisp/progmodes/python.el 2012-08-08 02:30:08 +0000 @@ -353,6 +353,40 @@ ;;; Font-lock and syntax + +(defun python-syntax-context (type &optional syntax-ppss) + "Return non-nil if point is on TYPE using SYNTAX-PPSS. +TYPE can be `comment', `string' or `paren'. It returns the start +character address of the specified TYPE." + (let ((ppss (or syntax-ppss (syntax-ppss)))) + (case type + (comment (and (nth 4 ppss) (nth 8 ppss))) + (string (and (not (nth 4 ppss)) (nth 8 ppss))) + (paren (nth 1 ppss)) + (t nil)))) + +(defun python-syntax-context-type (&optional syntax-ppss) + "Return the context type using SYNTAX-PPSS. +The type returned can be `comment', `string' or `paren'." + (let ((ppss (or syntax-ppss (syntax-ppss)))) + (cond + ((nth 8 ppss) (if (nth 4 ppss) 'comment 'string)) + ((nth 1 ppss) 'paren)))) + +(defsubst python-syntax-comment-or-string-p () + "Return non-nil if point is inside 'comment or 'string." + (nth 8 (syntax-ppss))) + +(define-obsolete-function-alias + 'python-info-ppss-context #'python-syntax-context "24.2") + +(define-obsolete-function-alias + 'python-info-ppss-context-type #'python-syntax-context-type "24.2") + +(define-obsolete-function-alias + 'python-info-ppss-comment-or-string-p + #'python-syntax-comment-or-string-p "24.2") + (defvar python-font-lock-keywords ;; Keywords `(,(rx symbol-start @@ -439,9 +473,9 @@ (? ?\[ (+ (not (any ?\]))) ?\]) (* space) assignment-operator))) (when (re-search-forward re limit t) - (while (and (python-info-ppss-context 'paren) + (while (and (python-syntax-context 'paren) (re-search-forward re limit t))) - (if (and (not (python-info-ppss-context 'paren)) + (if (and (not (python-syntax-context 'paren)) (not (equal (char-after (point-marker)) ?=))) t (set-match-data nil))))) @@ -454,10 +488,10 @@ assignment-operator))) (when (and (re-search-forward re limit t) (goto-char (nth 3 (match-data)))) - (while (and (python-info-ppss-context 'paren) + (while (and (python-syntax-context 'paren) (re-search-forward re limit t)) (goto-char (nth 3 (match-data)))) - (if (not (python-info-ppss-context 'paren)) + (if (not (python-syntax-context 'paren)) t (set-match-data nil))))) (1 font-lock-variable-name-face nil nil)))) @@ -582,7 +616,7 @@ (re-search-forward (python-rx line-start block-start) nil t)) (when (and - (not (python-info-ppss-context-type)) + (not (python-syntax-context-type)) (progn (goto-char (line-end-position)) (python-util-forward-comment -1) @@ -632,14 +666,14 @@ (bobp)) 'no-indent) ;; Inside a paren - ((setq start (python-info-ppss-context 'paren ppss)) + ((setq start (python-syntax-context 'paren ppss)) 'inside-paren) ;; Inside string - ((setq start (python-info-ppss-context 'string ppss)) + ((setq start (python-syntax-context 'string ppss)) 'inside-string) ;; After backslash - ((setq start (when (not (or (python-info-ppss-context 'string ppss) - (python-info-ppss-context 'comment ppss))) + ((setq start (when (not (or (python-syntax-context 'string ppss) + (python-syntax-context 'comment ppss))) (let ((line-beg-pos (line-beginning-position))) (when (python-info-line-ends-backslash-p (1- line-beg-pos)) @@ -657,7 +691,7 @@ (while (and (re-search-backward (python-rx block-start) nil t) (or - (python-info-ppss-context-type) + (python-syntax-context-type) (python-info-continuation-line-p)))) (when (looking-at (python-rx block-start)) (point-marker))))) @@ -721,13 +755,13 @@ (while (prog2 (forward-line -1) (and (not (bobp)) - (python-info-ppss-context 'paren)))) + (python-syntax-context 'paren)))) (goto-char (line-end-position)) (while (and (re-search-backward "\\." (line-beginning-position) t) - (python-info-ppss-context-type))) + (python-syntax-context-type))) (if (and (looking-at "\\.") - (not (python-info-ppss-context-type))) + (not (python-syntax-context-type))) ;; The indentation is the same column of the ;; first matching dot that's not inside a ;; comment, a string or a paren @@ -783,7 +817,7 @@ (when (and (looking-at (regexp-opt '(")" "]" "}"))) (progn (forward-char 1) - (not (python-info-ppss-context 'paren)))) + (not (python-syntax-context 'paren)))) (goto-char context-start) (current-indentation)))) ;; If open paren is contained on a line by itself add another @@ -883,7 +917,7 @@ (defun python-indent-dedent-line () "De-indent current line." (interactive "*") - (when (and (not (python-info-ppss-comment-or-string-p)) + (when (and (not (python-syntax-comment-or-string-p)) (<= (point-marker) (save-excursion (back-to-indentation) (point-marker))) @@ -974,7 +1008,7 @@ (when (and (not arg) (eolp) (not (equal ?: (char-after (- (point-marker) 2)))) - (not (python-info-ppss-comment-or-string-p))) + (not (python-syntax-comment-or-string-p))) (let ((indentation (current-indentation)) (calculated-indentation (python-indent-calculate-indentation))) (python-info-closing-block-message) @@ -998,7 +1032,7 @@ (goto-char (line-beginning-position)) ;; If after going to the beginning of line the point ;; is still inside a paren it's ok to do the trick - (when (python-info-ppss-context 'paren) + (when (python-syntax-context 'paren) (let ((indentation (python-indent-calculate-indentation))) (when (< (current-indentation) indentation) (indent-line-to indentation))))))) @@ -1032,7 +1066,7 @@ (end-of-line 1)) (while (and (funcall re-search-fn python-nav-beginning-of-defun-regexp nil t) - (python-info-ppss-context-type))) + (python-syntax-context-type))) (and (python-info-looking-at-beginning-of-defun) (or (not (= (line-number-at-pos pos) (line-number-at-pos))) @@ -1082,15 +1116,15 @@ (equal (char-after (+ (point) (current-indentation))) ?#) (<= (current-indentation) beg-defun-indent) (looking-at (python-rx decorator)) - (python-info-ppss-context-type)))) + (python-syntax-context-type)))) (forward-line 1) ;; If point falls inside a paren or string context the point is ;; forwarded at the end of it (or end of buffer if its not closed) - (let ((context-type (python-info-ppss-context-type))) + (let ((context-type (python-syntax-context-type))) (when (memq context-type '(paren string)) ;; Slow but safe. (while (and (not (eobp)) - (python-info-ppss-context-type)) + (python-syntax-context-type)) (forward-line 1))))))) (defun python-nav-beginning-of-statement () @@ -1102,8 +1136,8 @@ (save-excursion (forward-line -1) (python-info-line-ends-backslash-p)) - (python-info-ppss-context 'string) - (python-info-ppss-context 'paren)) + (python-syntax-context 'string) + (python-syntax-context 'paren)) (forward-line -1))))) (defun python-nav-end-of-statement () @@ -1113,8 +1147,8 @@ (not (eobp)) (when (or (python-info-line-ends-backslash-p) - (python-info-ppss-context 'string) - (python-info-ppss-context 'paren)) + (python-syntax-context 'string) + (python-syntax-context 'paren)) (forward-line 1))))) (defun python-nav-backward-statement (&optional arg) @@ -1202,13 +1236,13 @@ (python-nav-end-of-statement) (while (and (re-search-forward block-start-regexp nil t) - (python-info-ppss-context-type))) + (python-syntax-context-type))) (setq arg (1- arg))) (while (< arg 0) (python-nav-beginning-of-statement) (while (and (re-search-backward block-start-regexp nil t) - (python-info-ppss-context-type))) + (python-syntax-context-type))) (setq arg (1+ arg))) (python-nav-beginning-of-statement) (if (not (looking-at (python-rx block-start))) @@ -1920,7 +1954,7 @@ (while (or ;; honor initial paren depth (> (car (syntax-ppss)) paren-depth) - (python-info-ppss-context 'string)) + (python-syntax-context 'string)) (forward-char -1)))) (point))) (end (point)) @@ -2140,7 +2174,7 @@ ((funcall python-fill-comment-function justify)) ;; Strings/Docstrings ((save-excursion (skip-chars-forward "\"'uUrR") - (python-info-ppss-context 'string)) + (python-syntax-context 'string)) (funcall python-fill-string-function justify)) ;; Decorators ((equal (char-after (save-excursion @@ -2148,7 +2182,7 @@ (point-marker))) ?@) (funcall python-fill-decorator-function justify)) ;; Parens - ((or (python-info-ppss-context 'paren) + ((or (python-syntax-context 'paren) (looking-at (python-rx open-paren)) (save-excursion (skip-syntax-forward "^(" (line-end-position)) @@ -2168,13 +2202,13 @@ (string-start-marker (progn (skip-chars-forward "\"'uUrR") - (goto-char (python-info-ppss-context 'string)) + (goto-char (python-syntax-context 'string)) (skip-chars-forward "\"'uUrR") (point-marker))) (reg-start (line-beginning-position)) (string-end-marker (progn - (while (python-info-ppss-context 'string) + (while (python-syntax-context 'string) (goto-char (1+ (point-marker)))) (skip-chars-backward "\"'") (point-marker))) @@ -2212,16 +2246,16 @@ JUSTIFY should be used (if applicable) as in `fill-paragraph'." (save-restriction (narrow-to-region (progn - (while (python-info-ppss-context 'paren) + (while (python-syntax-context 'paren) (goto-char (1- (point-marker)))) (point-marker) (line-beginning-position)) (progn - (when (not (python-info-ppss-context 'paren)) + (when (not (python-syntax-context 'paren)) (end-of-line) - (when (not (python-info-ppss-context 'paren)) + (when (not (python-syntax-context 'paren)) (skip-syntax-backward "^)"))) - (while (python-info-ppss-context 'paren) + (while (python-syntax-context 'paren) (goto-char (1+ (point-marker)))) (point-marker))) (let ((paragraph-start "\f\\|[ \t]*$") @@ -2259,7 +2293,7 @@ ;; Only expand in code. :enable-function (lambda () (and - (not (python-info-ppss-comment-or-string-p)) + (not (python-syntax-comment-or-string-p)) python-skeleton-autoinsert))) (defmacro python-skeleton-define (name doc &rest skel) @@ -2579,7 +2613,7 @@ With optional argument REPLACE-SELF convert \"self\" to current parent defun name." (let ((name - (and (not (python-info-ppss-comment-or-string-p)) + (and (not (python-syntax-comment-or-string-p)) (with-syntax-table python-dotty-syntax-table (let ((sym (symbol-at-point))) (and sym @@ -2657,7 +2691,7 @@ (goto-char line-number)) (while (and (not (eobp)) (goto-char (line-end-position)) - (python-info-ppss-context 'paren) + (python-syntax-context 'paren) (not (equal (char-before (point)) ?\\))) (forward-line 1)) (when (equal (char-before) ?\\) @@ -2674,7 +2708,7 @@ (when (python-info-line-ends-backslash-p) (while (save-excursion (goto-char (line-beginning-position)) - (python-info-ppss-context 'paren)) + (python-syntax-context 'paren)) (forward-line -1)) (back-to-indentation) (point-marker))))) @@ -2688,10 +2722,10 @@ (widen) (let* ((context-type (progn (back-to-indentation) - (python-info-ppss-context-type))) + (python-syntax-context-type))) (line-start (line-number-at-pos)) (context-start (when context-type - (python-info-ppss-context context-type)))) + (python-syntax-context context-type)))) (cond ((equal context-type 'paren) ;; Lines inside a paren are always a continuation line ;; (except the first one). @@ -2736,41 +2770,13 @@ assignment-operator not-simple-operator) (line-end-position) t) - (not (python-info-ppss-context-type)))) + (not (python-syntax-context-type)))) (skip-syntax-forward "\s") (point-marker))))) -(defun python-info-ppss-context (type &optional syntax-ppss) - "Return non-nil if point is on TYPE using SYNTAX-PPSS. -TYPE can be `comment', `string' or `paren'. It returns the start -character address of the specified TYPE." - (let ((ppss (or syntax-ppss (syntax-ppss)))) - (case type - (comment - (and (nth 4 ppss) - (nth 8 ppss))) - (string - (and (not (nth 4 ppss)) - (nth 8 ppss))) - (paren - (nth 1 ppss)) - (t nil)))) - -(defun python-info-ppss-context-type (&optional syntax-ppss) - "Return the context type using SYNTAX-PPSS. -The type returned can be `comment', `string' or `paren'." - (let ((ppss (or syntax-ppss (syntax-ppss)))) - (cond - ((nth 8 ppss) (if (nth 4 ppss) 'comment 'string)) - ((nth 1 ppss) 'paren)))) - -(defsubst python-info-ppss-comment-or-string-p () - "Return non-nil if point is inside 'comment or 'string." - (nth 8 (syntax-ppss))) - (defun python-info-looking-at-beginning-of-defun (&optional syntax-ppss) "Check if point is at `beginning-of-defun' using SYNTAX-PPSS." - (and (not (python-info-ppss-context-type (or syntax-ppss (syntax-ppss)))) + (and (not (python-syntax-context-type (or syntax-ppss (syntax-ppss)))) (save-excursion (beginning-of-line 1) (looking-at python-nav-beginning-of-defun-regexp)))) @@ -2816,7 +2822,7 @@ (defun python-util-forward-comment (&optional direction) "Python mode specific version of `forward-comment'. Optional argument DIRECTION defines the direction to move to." - (let ((comment-start (python-info-ppss-context 'comment)) + (let ((comment-start (python-syntax-context 'comment)) (factor (if (< (or direction 0) 0) -99999 99999))) ------------------------------------------------------------ revno: 109500 committer: Jay Belanger branch nick: trunk timestamp: Tue 2012-08-07 20:30:58 -0500 message: calc-misc.el (calc-record-why): Don't record a message twice. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-07 21:52:54 +0000 +++ lisp/ChangeLog 2012-08-08 01:30:58 +0000 @@ -1,3 +1,7 @@ +2012-08-08 Jay Belanger + + * calc/calc-misc.el (calc-record-why): Don't record a message twice. + 2012-08-07 Andreas Schwab * emacs-lisp/lisp-mode.el (eval-defun-1): Handle standard value of === modified file 'lisp/calc/calc-misc.el' --- lisp/calc/calc-misc.el 2012-01-19 07:21:25 +0000 +++ lisp/calc/calc-misc.el 2012-08-08 01:30:58 +0000 @@ -305,7 +305,8 @@ (string-match "\\`\\*" (car stuff))) (setq stuff (cons '* (cons (substring (car stuff) 1) (cdr stuff))))))) - (setq calc-next-why (cons stuff calc-next-why)) + (unless (member stuff calc-next-why) + (setq calc-next-why (cons stuff calc-next-why))) nil) ;; True if A is a constant or vector of constants. [P x] [Public] ------------------------------------------------------------ revno: 109499 committer: Andreas Schwab branch nick: emacs timestamp: Tue 2012-08-07 23:52:54 +0200 message: * emacs-lisp/lisp-mode.el (eval-defun-1): Handle standard value of a defcustom that is quoted with backquote. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-07 16:12:20 +0000 +++ lisp/ChangeLog 2012-08-07 21:52:54 +0000 @@ -1,5 +1,8 @@ 2012-08-07 Andreas Schwab + * emacs-lisp/lisp-mode.el (eval-defun-1): Handle standard value of + a defcustom that is quoted with backquote. + * calc/calc-prog.el (math-do-defmath): Use backquote forms. Fix handling of interactive spec when the body uses return. (math-do-arg-check, math-define-function-body): Use backquote forms. === modified file 'lisp/emacs-lisp/lisp-mode.el' --- lisp/emacs-lisp/lisp-mode.el 2012-08-05 14:14:54 +0000 +++ lisp/emacs-lisp/lisp-mode.el 2012-08-07 21:52:54 +0000 @@ -776,7 +776,9 @@ (default-boundp (eval (nth 1 form) lexical-binding))) ;; Force variable to be bound. (set-default (eval (nth 1 form) lexical-binding) - (eval (nth 1 (nth 2 form)) lexical-binding)) + ;; The value may be quoted with quote or backquote. + (eval (eval (nth 2 form) lexical-binding) + lexical-binding)) form) ;; `defface' is macroexpanded to `custom-declare-face'. ((eq (car form) 'custom-declare-face) ------------------------------------------------------------ revno: 109498 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-08-07 13:02:30 -0400 message: Defer to configure.ac for required automake version diff: === modified file 'INSTALL.BZR' --- INSTALL.BZR 2012-07-09 04:52:49 +0000 +++ INSTALL.BZR 2012-08-07 17:02:30 +0000 @@ -9,7 +9,8 @@ autoconf - at least the version specified near the start of configure.ac (in the AC_PREREQ command). -automake - we recommend at least version 1.11. +automake - at least the version specified near the start of + configure.ac (in the AM_INIT_AUTOMAKE command). makeinfo - not strictly necessary, but highly recommended, so that you can build the manuals. ------------------------------------------------------------ revno: 109497 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2012-08-07 19:53:38 +0300 message: Fix .gdbinit to match changes with INTERNAL_FIELD. src/.gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist): Rename fields to match removal of FGET and WGET and disuse of INTERNAL_FIELD in Lisp_Cons. diff: === modified file 'src/.gdbinit' --- src/.gdbinit 2012-08-07 13:37:21 +0000 +++ src/.gdbinit 2012-08-07 16:53:38 +0000 @@ -765,7 +765,7 @@ define xframe xgetptr $ print (struct frame *) $ptr - xgetptr $->name_ + xgetptr $->name set $ptr = (struct Lisp_String *) $ptr xprintstr $ptr echo \n @@ -789,13 +789,13 @@ xgetptr $ print (struct window *) $ptr set $window = (struct window *) $ptr - xgetint $window->total_cols_ + xgetint $window->total_cols set $width=$int - xgetint $window->total_lines_ + xgetint $window->total_lines set $height=$int - xgetint $window->left_col_ + xgetint $window->left_col set $left=$int - xgetint $window->top_line_ + xgetint $window->top_line set $top=$int printf "%dx%d+%d+%d\n", $width, $height, $left, $top end @@ -892,7 +892,7 @@ end define nextcons - p $.u.cdr_ + p $.u.cdr xcons end document nextcons @@ -903,7 +903,7 @@ define xcar xgetptr $ xgettype $ - print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->car_ : 0) + print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->car : 0) end document xcar Assume that $ is an Emacs Lisp pair and print its car. @@ -912,7 +912,7 @@ define xcdr xgetptr $ xgettype $ - print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->u.cdr_ : 0) + print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->u.cdr : 0) end document xcdr Assume that $ is an Emacs Lisp pair and print its cdr. @@ -925,9 +925,9 @@ set $nil = $ptr set $i = 0 while $cons != $nil && $i < 10 - p/x $cons->car_ + p/x $cons->car xpr - xgetptr $cons->u.cdr_ + xgetptr $cons->u.cdr set $cons = (struct Lisp_Cons *) $ptr set $i = $i + 1 printf "---\n" === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-07 13:37:21 +0000 +++ src/ChangeLog 2012-08-07 16:53:38 +0000 @@ -1,3 +1,9 @@ +2012-08-07 Eli Zaretskii + + * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist): Rename + fields to match removal of FGET and WGET and disuse of + INTERNAL_FIELD in Lisp_Cons. + 2012-08-07 Dmitry Antipov Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things. ------------------------------------------------------------ revno: 109496 committer: Andreas Schwab branch nick: emacs timestamp: Tue 2012-08-07 18:12:20 +0200 message: * calc/calc-prog.el (math-do-defmath): Use backquote forms. Fix handling of interactive spec when the body uses return. (math-do-arg-check, math-define-function-body): Use backquote forms. * calc/calc-ext.el (math-defcache): Likewise. * calc/calc-rewr.el (math-rwfail, math-rweval): Likewise. * allout.el (allout-new-exposure): Likewise. * calc/calcalg2.el (math-tracing-integral): Likewise. * info.el (Info-last-menu-item): Likewise. * emulation/vip.el (vip-loop): Likewise. * textmodes/artist.el (artist-funcall): Likewise. * menu-bar.el (menu-bar-make-mm-toggle, menu-bar-make-toggle): Construct menu-item directly. * cedet/ede/base.el (ede-with-projectfile): Use backquote forms. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-07 11:13:23 +0000 +++ lisp/ChangeLog 2012-08-07 16:12:20 +0000 @@ -1,5 +1,18 @@ 2012-08-07 Andreas Schwab + * calc/calc-prog.el (math-do-defmath): Use backquote forms. Fix + handling of interactive spec when the body uses return. + (math-do-arg-check, math-define-function-body): Use backquote forms. + * calc/calc-ext.el (math-defcache): Likewise. + * calc/calc-rewr.el (math-rwfail, math-rweval): Likewise. + * allout.el (allout-new-exposure): Likewise. + * calc/calcalg2.el (math-tracing-integral): Likewise. + * info.el (Info-last-menu-item): Likewise. + * emulation/vip.el (vip-loop): Likewise. + * textmodes/artist.el (artist-funcall): Likewise. + * menu-bar.el (menu-bar-make-mm-toggle, menu-bar-make-toggle): + Construct menu-item directly. + * progmodes/autoconf.el (font-lock-syntactic-keywords): Don't declare. === modified file 'lisp/allout.el' --- lisp/allout.el 2012-05-13 03:05:06 +0000 +++ lisp/allout.el 2012-08-07 16:12:20 +0000 @@ -5312,11 +5312,11 @@ Expose children and grandchildren of first topic at current level, and expose children of subsequent topics at current level *except* for the last, which should be opened completely." - (list 'save-excursion - '(if (not (or (allout-goto-prefix-doublechecked) - (allout-next-heading))) - (error "allout-new-exposure: Can't find any outline topics")) - (list 'allout-expose-topic (list 'quote spec)))) + `(save-excursion + (if (not (or (allout-goto-prefix-doublechecked) + (allout-next-heading))) + (error "allout-new-exposure: Can't find any outline topics")) + (allout-expose-topic ',spec))) ;;;_ #7 Systematic outline presentation -- copying, printing, flattening === modified file 'lisp/calc/calc-ext.el' --- lisp/calc/calc-ext.el 2012-07-31 21:32:28 +0000 +++ lisp/calc/calc-ext.el 2012-08-07 16:12:20 +0000 @@ -1997,51 +1997,36 @@ (cache-val (intern (concat (symbol-name name) "-cache"))) (last-prec (intern (concat (symbol-name name) "-last-prec"))) (last-val (intern (concat (symbol-name name) "-last")))) - (list 'progn -; (list 'defvar cache-prec (if init (math-numdigs (nth 1 init)) -100)) - (list 'defvar cache-prec - `(cond - ((consp ,init) (math-numdigs (nth 1 ,init))) - (,init - (nth 1 (math-numdigs (eval ,init)))) - (t - -100))) - (list 'defvar cache-val - `(cond - ((consp ,init) ,init) - (,init (eval ,init)) - (t ,init))) - (list 'defvar last-prec -100) - (list 'defvar last-val nil) - (list 'setq 'math-cache-list - (list 'cons - (list 'quote cache-prec) - (list 'cons - (list 'quote last-prec) - 'math-cache-list))) - (list 'defun - name () - (list 'or - (list '= last-prec 'calc-internal-prec) - (list 'setq - last-val - (list 'math-normalize - (list 'progn - (list 'or - (list '>= cache-prec - 'calc-internal-prec) - (list 'setq - cache-val - (list 'let - '((calc-internal-prec - (+ calc-internal-prec - 4))) - form) - cache-prec - '(+ calc-internal-prec 2))) - cache-val)) - last-prec 'calc-internal-prec)) - last-val)))) + `(progn +; (defvar ,cache-prec ,(if init (math-numdigs (nth 1 init)) -100)) + (defvar ,cache-prec (cond + ((consp ,init) (math-numdigs (nth 1 ,init))) + (,init + (nth 1 (math-numdigs (eval ,init)))) + (t + -100))) + (defvar ,cache-val (cond ((consp ,init) ,init) + (,init (eval ,init)) + (t ,init))) + (defvar ,last-prec -100) + (defvar ,last-val nil) + (setq math-cache-list + (cons ',cache-prec + (cons ',last-prec + math-cache-list))) + (defun ,name () + (or (= ,last-prec calc-internal-prec) + (setq ,last-val + (math-normalize + (progn (or (>= ,cache-prec calc-internal-prec) + (setq ,cache-val + (let ((calc-internal-prec + (+ calc-internal-prec 4))) + ,form) + ,cache-prec (+ calc-internal-prec 2))) + ,cache-val)) + ,last-prec calc-internal-prec)) + ,last-val)))) (put 'math-defcache 'lisp-indent-hook 2) ;;; Betcha didn't know that pi = 16 atan(1/5) - 4 atan(1/239). [F] [Public] === modified file 'lisp/calc/calc-prog.el' --- lisp/calc/calc-prog.el 2012-01-19 07:21:25 +0000 +++ lisp/calc/calc-prog.el 2012-08-07 16:12:20 +0000 @@ -1792,89 +1792,63 @@ (defun math-do-defmath (func args body) (require 'calc-macs) (let* ((fname (intern (concat "calcFunc-" (symbol-name func)))) - (doc (if (stringp (car body)) (list (car body)))) + (doc (if (stringp (car body)) + (prog1 (list (car body)) + (setq body (cdr body))))) (clargs (mapcar 'math-clean-arg args)) - (body (math-define-function-body - (if (stringp (car body)) (cdr body) body) - clargs))) - (list 'progn - (if (and (consp (car body)) - (eq (car (car body)) 'interactive)) - (let ((inter (car body))) - (setq body (cdr body)) - (if (or (> (length inter) 2) - (integerp (nth 1 inter))) - (let ((hasprefix nil) (hasmulti nil)) - (if (stringp (nth 1 inter)) - (progn - (cond ((equal (nth 1 inter) "p") - (setq hasprefix t)) - ((equal (nth 1 inter) "m") - (setq hasmulti t)) - (t (error - "Can't handle interactive code string \"%s\"" - (nth 1 inter)))) - (setq inter (cdr inter)))) - (if (not (integerp (nth 1 inter))) - (error - "Expected an integer in interactive specification")) - (append (list 'defun - (intern (concat "calc-" - (symbol-name func))) - (if (or hasprefix hasmulti) - '(&optional n) - ())) - doc - (if (or hasprefix hasmulti) - '((interactive "P")) - '((interactive))) - (list - (append - '(calc-slow-wrapper) - (and hasmulti - (list - (list 'setq - 'n - (list 'if - 'n - (list 'prefix-numeric-value - 'n) - (nth 1 inter))))) - (list - (list 'calc-enter-result - (if hasmulti 'n (nth 1 inter)) - (nth 2 inter) - (if hasprefix - (list 'append - (list 'quote (list fname)) - (list 'calc-top-list-n - (nth 1 inter)) - (list 'and - 'n - (list - 'list - (list - 'math-normalize - (list - 'prefix-numeric-value - 'n))))) - (list 'cons - (list 'quote fname) - (list 'calc-top-list-n - (if hasmulti - 'n - (nth 1 inter))))))))))) - (append (list 'defun - (intern (concat "calc-" (symbol-name func))) - args) - doc - (list - inter - (cons 'calc-wrapper body)))))) - (append (list 'defun fname clargs) - doc - (math-do-arg-list-check args nil nil) - body)))) + (inter (if (and (consp (car body)) + (eq (car (car body)) 'interactive)) + (prog1 (car body) + (setq body (cdr body)))))) + (setq body (math-define-function-body body clargs)) + `(progn + ,(if inter + (if (or (> (length inter) 2) + (integerp (nth 1 inter))) + (let ((hasprefix nil) (hasmulti nil)) + (when (stringp (nth 1 inter)) + (cond ((equal (nth 1 inter) "p") + (setq hasprefix t)) + ((equal (nth 1 inter) "m") + (setq hasmulti t)) + (t (error + "Can't handle interactive code string \"%s\"" + (nth 1 inter)))) + (setq inter (cdr inter))) + (unless (integerp (nth 1 inter)) + (error "Expected an integer in interactive specification")) + `(defun ,(intern (concat "calc-" (symbol-name func))) + ,(if (or hasprefix hasmulti) '(&optional n) ()) + ,@doc + (interactive ,@(if (or hasprefix hasmulti) '("P"))) + (calc-slow-wrapper + ,@(if hasmulti + `((setq n (if n + (prefix-numeric-value n) + ,(nth 1 inter))))) + (calc-enter-result + ,(if hasmulti 'n (nth 1 inter)) + ,(nth 2 inter) + ,(if hasprefix + `(append '(,fname) + (calc-top-list-n ,(nth 1 inter)) + (and n + (list + (math-normalize + (prefix-numeric-value n))))) + `(cons ',fname + (calc-top-list-n + ,(if hasmulti + 'n + (nth 1 inter))))))))) + `(defun ,(intern (concat "calc-" (symbol-name func))) ,clargs + ,@doc + ,inter + (calc-wrapper ,@body)))) + (defun ,fname ,clargs + ,@doc + ,@(math-do-arg-list-check args nil nil) + ,@body)))) (defun math-clean-arg (arg) (if (consp arg) @@ -1887,56 +1861,42 @@ (list (cons 'and (cons var (if (cdr chk) - (setq chk (list (cons 'progn chk))) + `((progn ,@chk)) chk))))) - (and (consp arg) - (let* ((rest (math-do-arg-check (nth 1 arg) var is-opt is-rest)) - (qual (car arg)) - (qqual (list 'quote qual)) - (qual-name (symbol-name qual)) - (chk (intern (concat "math-check-" qual-name)))) - (if (fboundp chk) - (append rest - (list + (when (consp arg) + (let* ((rest (math-do-arg-check (nth 1 arg) var is-opt is-rest)) + (qual (car arg)) + (qual-name (symbol-name qual)) + (chk (intern (concat "math-check-" qual-name)))) + (if (fboundp chk) + (append rest + (if is-rest + `((setq ,var (mapcar ',chk ,var))) + `((setq ,var (,chk ,var))))) + (if (fboundp (setq chk (intern (concat "math-" qual-name)))) + (append rest + (if is-rest + `((mapcar #'(lambda (x) + (or (,chk x) + (math-reject-arg x ',qual))) + ,var)) + `((or (,chk ,var) + (math-reject-arg ,var ',qual))))) + (if (and (string-match "\\`not-\\(.*\\)\\'" qual-name) + (fboundp (setq chk (intern + (concat "math-" + (math-match-substring + qual-name 1)))))) + (append rest (if is-rest - (list 'setq var - (list 'mapcar (list 'quote chk) var)) - (list 'setq var (list chk var))))) - (if (fboundp (setq chk (intern (concat "math-" qual-name)))) - (append rest - (list - (if is-rest - (list 'mapcar - (list 'function - (list 'lambda '(x) - (list 'or - (list chk 'x) - (list 'math-reject-arg - 'x qqual)))) - var) - (list 'or - (list chk var) - (list 'math-reject-arg var qqual))))) - (if (and (string-match "\\`not-\\(.*\\)\\'" qual-name) - (fboundp (setq chk (intern - (concat "math-" - (math-match-substring - qual-name 1)))))) - (append rest - (list - (if is-rest - (list 'mapcar - (list 'function - (list 'lambda '(x) - (list 'and - (list chk 'x) - (list 'math-reject-arg - 'x qqual)))) - var) - (list 'and - (list chk var) - (list 'math-reject-arg var qqual))))) - (error "Unknown qualifier `%s'" qual-name)))))))) + `((mapcar #'(lambda (x) + (and (,chk x) + (math-reject-arg x ',qual))) + ,var)) + `((and + (,chk ,var) + (math-reject-arg ,var ',qual))))) + (error "Unknown qualifier `%s'" qual-name)))))))) (defun math-do-arg-list-check (args is-opt is-rest) (cond ((null args) nil) @@ -1980,7 +1940,7 @@ (defun math-define-function-body (body env) (let ((body (math-define-body body env))) (if (math-body-refers-to body 'math-return) - (list (cons 'catch (cons '(quote math-return) body))) + `((catch 'math-return ,@body)) body))) ;; The variable math-exp-env is local to math-define-body, but is === modified file 'lisp/calc/calc-rewr.el' --- lisp/calc/calc-rewr.el 2012-01-19 07:21:25 +0000 +++ lisp/calc/calc-rewr.el 2012-08-07 16:12:20 +0000 @@ -1439,21 +1439,19 @@ (put 'calcFunc-vxor 'math-rewrite-default '(vec)) (defmacro math-rwfail (&optional back) - (list 'setq 'pc - (list 'and - (if back - '(setq btrack (cdr btrack)) - 'btrack) - ''((backtrack))))) + `(setq pc (and ,(if back + '(setq btrack (cdr btrack)) + 'btrack) + '((backtrack))))) ;; This monstrosity is necessary because the use of static vectors of ;; registers makes rewrite rules non-reentrant. Yucko! (defmacro math-rweval (form) - (list 'let '((orig (car rules))) - '(setcar rules (quote (nil nil nil no-phase))) - (list 'unwind-protect - form - '(setcar rules orig)))) + `(let ((orig (car rules))) + (setcar rules '(nil nil nil no-phase)) + (unwind-protect + ,form + (setcar rules orig)))) (defvar math-rewrite-phase 1) === modified file 'lisp/calc/calcalg2.el' --- lisp/calc/calcalg2.el 2012-01-19 07:21:25 +0000 +++ lisp/calc/calcalg2.el 2012-08-07 16:12:20 +0000 @@ -667,21 +667,18 @@ (defvar math-integral-limit) (defmacro math-tracing-integral (&rest parts) - (list 'and - 'trace-buffer - (list 'with-current-buffer - 'trace-buffer - '(goto-char (point-max)) - (list 'and - '(bolp) - '(insert (make-string (- math-integral-limit - math-integ-level) 32) - (format "%2d " math-integ-depth) - (make-string math-integ-level 32))) - ;;(list 'condition-case 'err - (cons 'insert parts) - ;; '(error (insert (prin1-to-string err)))) - '(sit-for 0)))) + `(and trace-buffer + (with-current-buffer trace-buffer + (goto-char (point-max)) + (and (bolp) + (insert (make-string (- math-integral-limit + math-integ-level) 32) + (format "%2d " math-integ-depth) + (make-string math-integ-level 32))) + ;;(condition-case err + (insert ,@parts) + ;; (error (insert (prin1-to-string err)))) + (sit-for 0)))) ;;; The following wrapper caches results and avoids infinite recursion. ;;; Each cache entry is: ( A B ) Integral of A is B; === modified file 'lisp/cedet/ChangeLog' --- lisp/cedet/ChangeLog 2012-07-29 09:57:40 +0000 +++ lisp/cedet/ChangeLog 2012-08-07 16:12:20 +0000 @@ -1,3 +1,7 @@ +2012-08-07 Andreas Schwab + + * ede/base.el (ede-with-projectfile): Use backquote forms. + 2012-07-29 Paul Eggert inaccessable -> inaccessible spelling fix (Bug#10052) === modified file 'lisp/cedet/ede/base.el' --- lisp/cedet/ede/base.el 2012-01-19 07:21:25 +0000 +++ lisp/cedet/ede/base.el 2012-08-07 16:12:20 +0000 @@ -285,22 +285,18 @@ ;; (defmacro ede-with-projectfile (obj &rest forms) "For the project in which OBJ resides, execute FORMS." - (list 'save-window-excursion - (list 'let* (list - (list 'pf - (list 'if (list 'obj-of-class-p - obj 'ede-target) - ;; @todo -I think I can change - ;; this to not need ede-load-project-file - ;; but I'm not sure how to test well. - (list 'ede-load-project-file - (list 'oref obj 'path)) - obj)) - '(dbka (get-file-buffer (oref pf file)))) - '(if (not dbka) (find-file (oref pf file)) - (switch-to-buffer dbka)) - (cons 'progn forms) - '(if (not dbka) (kill-buffer (current-buffer)))))) + `(save-window-excursion + (let* ((pf (if (obj-of-class-p ,obj ede-target) + ;; @todo -I think I can change + ;; this to not need ede-load-project-file + ;; but I'm not sure how to test well. + (ede-load-project-file (oref ,obj path)) + ,obj)) + (dbka (get-file-buffer (oref pf file)))) + (if (not dbka) (find-file (oref pf file)) + (switch-to-buffer dbka)) + ,@forms + (if (not dbka) (kill-buffer (current-buffer)))))) (put 'ede-with-projectfile 'lisp-indent-function 1) ;;; The EDE persistent cache. === modified file 'lisp/emulation/vip.el' --- lisp/emulation/vip.el 2012-01-19 07:21:25 +0000 +++ lisp/emulation/vip.el 2012-08-07 16:12:20 +0000 @@ -307,10 +307,10 @@ (defmacro vip-loop (count body) "(COUNT BODY) Execute BODY COUNT times." - (list 'let (list (list 'count count)) - (list 'while (list '> 'count 0) - body - (list 'setq 'count (list '1- 'count))))) + `(let ((count ,count)) + (while (> count 0) + ,body + (setq count (1- count))))) (defun vip-push-mark-silent (&optional location) "Set mark at LOCATION (point, by default) and push old mark on mark ring. === modified file 'lisp/info.el' --- lisp/info.el 2012-07-10 11:51:54 +0000 +++ lisp/info.el 2012-08-07 16:12:20 +0000 @@ -2854,7 +2854,7 @@ (Info-extract-menu-node-name))))) (defmacro Info-no-error (&rest body) - (list 'condition-case nil (cons 'progn (append body '(t))) '(error nil))) + `(condition-case nil (progn ,@body t) (error nil))) (defun Info-next-preorder () "Go to the next subnode or the next node, or go up a level." === modified file 'lisp/menu-bar.el' --- lisp/menu-bar.el 2012-08-03 08:25:42 +0000 +++ lisp/menu-bar.el 2012-08-07 16:12:20 +0000 @@ -637,11 +637,11 @@ DOC is the text to use for the menu entry. HELP is the text to use for the tooltip. PROPS are additional properties." - `(list 'menu-item ,doc ',fname - ,@(mapcar (lambda (p) (list 'quote p)) props) - :help ,help - :button '(:toggle . (and (default-boundp ',fname) - (default-value ',fname))))) + `'(menu-item ,doc ,fname + ,@props + :help ,help + :button (:toggle . (and (default-boundp ',fname) + (default-value ',fname))))) (defmacro menu-bar-make-toggle (name variable doc message help &rest body) `(progn @@ -664,10 +664,10 @@ ;; a candidate for "Save Options", and we do not want to save options ;; the user have already set explicitly in his init file. (if interactively (customize-mark-as-set ',variable))) - (list 'menu-item ,doc ',name - :help ,help - :button '(:toggle . (and (default-boundp ',variable) - (default-value ',variable)))))) + '(menu-item ,doc ,name + :help ,help + :button (:toggle . (and (default-boundp ',variable) + (default-value ',variable)))))) ;; Function for setting/saving default font. === modified file 'lisp/textmodes/artist.el' --- lisp/textmodes/artist.el 2012-04-11 11:57:21 +0000 +++ lisp/textmodes/artist.el 2012-08-07 16:12:20 +0000 @@ -1790,7 +1790,7 @@ ;; (defmacro artist-funcall (fn &rest args) "Call function FN with ARGS, if FN is not nil." - (list 'if fn (cons 'funcall (cons fn args)))) + `(if ,fn (funcall ,fn ,@args))) (defun artist-uniq (l) "Remove consecutive duplicates in list L. Comparison is done with `equal'." @@ -2384,8 +2384,8 @@ ;; (defmacro artist-put-pixel (point-list x y) "In POINT-LIST, store a ``pixel'' at coord X,Y." - (list 'setq point-list - (list 'append point-list (list 'list (list 'artist-new-coord x y))))) + `(setq ,point-list + (append ,point-list (list (artist-new-coord ,x ,y))))) ;; Calculate list of points using eight point algorithm ;; return a list of coords ------------------------------------------------------------ revno: 109495 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-08-07 17:37:21 +0400 message: Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things. * src/lisp.h (struct Lisp_Symbol): Change xname to meaningful name since all xname users are fixed long time ago. Do not use INTERNAL_FIELD. (set_symbol_name, set_symbol_function, set_symbol_plist): (set_symbol_next, set_overlay_plist): New function. (struct Lisp_Cons): Do not use INTERNAL_FIELD. (struct Lisp_Overlay): Likewise. (CVAR, MVAR, SVAR): Remove. * src/alloc.c, src/buffer.c, src/buffer.h, src/bytecode.c: * src/cmds.c, src/data.c, src/doc.c, src/eval.c, src/fns.c: * src/keyboard.c, src/lread.c, src/nsselect.m, src/xterm.c: Adjust users. * src/.gdbinit: Change to use name field of struct Lisp_Symbol where appropriate. * admin/coccinelle/overlay.cocci, admin/coccinelle/symbol.cocci: Remove. diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2012-08-02 04:14:48 +0000 +++ admin/ChangeLog 2012-08-07 13:37:21 +0000 @@ -1,3 +1,7 @@ +2012-08-07 Dmitry Antipov + + * coccinelle/overlay.cocci, coccinelle/symbol.cocci: Remove. + 2012-08-02 Paul Eggert Port to Solaris 8. === removed file 'admin/coccinelle/overlay.cocci' --- admin/coccinelle/overlay.cocci 2012-08-01 08:49:28 +0000 +++ admin/coccinelle/overlay.cocci 1970-01-01 00:00:00 +0000 @@ -1,28 +0,0 @@ -// Change direct access to Lisp_Object fields of struct -// Lisp_Overlay to MVAR. Beginning M denotes "misc", and -// MVAR is likely to be used for other second-class objects. -@@ -struct Lisp_Overlay *V; -Lisp_Object O; -@@ -( -- V->start -+ MVAR (V, start) -| -- V->end -+ MVAR (V, end) -| -- V->plist -+ MVAR (V, plist) - -| - -- XOVERLAY (O)->start -+ MVAR (XOVERLAY (O), start) -| -- XOVERLAY (O)->end -+ MVAR (XOVERLAY (O), end) -| -- XOVERLAY (O)->plist -+ MVAR (XOVERLAY (O), plist) -) === removed file 'admin/coccinelle/symbol.cocci' --- admin/coccinelle/symbol.cocci 2012-08-01 08:18:22 +0000 +++ admin/coccinelle/symbol.cocci 1970-01-01 00:00:00 +0000 @@ -1,32 +0,0 @@ -// Change direct access to Lisp_Object fields of struct Lisp_Symbol to SVAR. -@@ -struct Lisp_Symbol *S; -Lisp_Object O; -@@ -( -- S->xname -+ SVAR (S, xname) -| -- S->val.value -+ SVAR (S, val.value) -| -- S->function -+ SVAR (S, function) -| -- S->plist -+ SVAR (S, plist) - -| - -- XSYMBOL (O)->xname -+ SVAR (XSYMBOL (O), xname) -| -- XSYMBOL (O)->val.value -+ SVAR (XSYMBOL (O), val.value) -| -- XSYMBOL (O)->function -+ SVAR (XSYMBOL (O), function) -| -- XSYMBOL (O)->plist -+ SVAR (XSYMBOL (O), plist) -) === modified file 'src/.gdbinit' --- src/.gdbinit 2012-08-01 16:31:59 +0000 +++ src/.gdbinit 2012-08-07 13:37:21 +0000 @@ -1047,7 +1047,7 @@ define xprintsym xgetptr $arg0 set $sym = (struct Lisp_Symbol *) $ptr - xgetptr $sym->xname_ + xgetptr $sym->name set $sym_name = (struct Lisp_String *) $ptr xprintstr $sym_name end @@ -1218,7 +1218,7 @@ # $ptr is NULL in temacs if ($ptr != 0) set $tem = (struct Lisp_Symbol *) $ptr - xgetptr $tem->xname_ + xgetptr $tem->name set $tem = (struct Lisp_String *) $ptr set $tem = (char *) $tem->data @@ -1241,7 +1241,7 @@ silent xgetptr globals.f_Vinitial_window_system set $tem = (struct Lisp_Symbol *) $ptr - xgetptr $tem->xname_ + xgetptr $tem->name set $tem = (struct Lisp_String *) $ptr set $tem = (char *) $tem->data # If we are running in synchronous mode, we want a chance to look === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-07 11:28:41 +0000 +++ src/ChangeLog 2012-08-07 13:37:21 +0000 @@ -1,5 +1,22 @@ 2012-08-07 Dmitry Antipov + Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things. + * lisp.h (struct Lisp_Symbol): Change xname to meaningful + name since all xname users are fixed long time ago. Do not + use INTERNAL_FIELD. + (set_symbol_name, set_symbol_function, set_symbol_plist): + (set_symbol_next, set_overlay_plist): New function. + (struct Lisp_Cons): Do not use INTERNAL_FIELD. + (struct Lisp_Overlay): Likewise. + (CVAR, MVAR, SVAR): Remove. + * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c: + * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m: + * xterm.c: Adjust users. + * .gdbinit: Change to use name field of struct Lisp_Symbol + where appropriate. + +2012-08-07 Dmitry Antipov + Basic functions to set Lisp_Object and pointer slots of intervals. * intervals.h (interval_set_parent, interval_set_object): (interval_set_left, interval_set_right, interval_set_plist): === modified file 'src/alloc.c' --- src/alloc.c 2012-08-07 11:28:41 +0000 +++ src/alloc.c 2012-08-07 13:37:21 +0000 @@ -2691,7 +2691,7 @@ { ptr->u.chain = cons_free_list; #if GC_MARK_STACK - CVAR (ptr, car) = Vdead; + ptr->car = Vdead; #endif cons_free_list = ptr; consing_since_gc -= sizeof *ptr; @@ -3522,12 +3522,12 @@ MALLOC_UNBLOCK_INPUT; p = XSYMBOL (val); - SVAR (p, xname) = name; - SVAR (p, plist) = Qnil; + set_symbol_name (val, name); + set_symbol_plist (val, Qnil); p->redirect = SYMBOL_PLAINVAL; SET_SYMBOL_VAL (p, Qunbound); - SVAR (p, function) = Qunbound; - p->next = NULL; + set_symbol_function (val, Qunbound); + set_symbol_next (val, NULL); p->gcmarkbit = 0; p->interned = SYMBOL_UNINTERNED; p->constant = 0; @@ -3654,7 +3654,7 @@ overlay = allocate_misc (Lisp_Misc_Overlay); OVERLAY_START (overlay) = start; OVERLAY_END (overlay) = end; - OVERLAY_PLIST (overlay) = plist; + set_overlay_plist (overlay, plist); XOVERLAY (overlay)->next = NULL; return overlay; } @@ -4299,7 +4299,7 @@ && offset < (CONS_BLOCK_SIZE * sizeof b->conses[0]) && (b != cons_block || offset / sizeof b->conses[0] < cons_block_index) - && !EQ (CVAR ((struct Lisp_Cons *) p, car), Vdead)); + && !EQ (((struct Lisp_Cons *) p)->car, Vdead)); } else return 0; @@ -4325,7 +4325,7 @@ && offset < (SYMBOL_BLOCK_SIZE * sizeof b->symbols[0]) && (b != symbol_block || offset / sizeof b->symbols[0] < symbol_block_index) - && !EQ (SVAR (((struct Lisp_Symbol *)p), function), Vdead)); + && !EQ (((struct Lisp_Symbol *)p)->function, Vdead)); } else return 0; @@ -5831,9 +5831,9 @@ for (; ptr && !ptr->gcmarkbit; ptr = ptr->next) { ptr->gcmarkbit = 1; - mark_object (MVAR (ptr, start)); - mark_object (MVAR (ptr, end)); - mark_object (MVAR (ptr, plist)); + mark_object (ptr->start); + mark_object (ptr->end); + mark_object (ptr->plist); } } @@ -6067,8 +6067,8 @@ break; CHECK_ALLOCATED_AND_LIVE (live_symbol_p); ptr->gcmarkbit = 1; - mark_object (SVAR (ptr, function)); - mark_object (SVAR (ptr, plist)); + mark_object (ptr->function); + mark_object (ptr->plist); switch (ptr->redirect) { case SYMBOL_PLAINVAL: mark_object (SYMBOL_VAL (ptr)); break; @@ -6099,9 +6099,9 @@ break; default: abort (); } - if (!PURE_POINTER_P (XSTRING (SVAR (ptr, xname)))) - MARK_STRING (XSTRING (SVAR (ptr, xname))); - MARK_INTERVAL_TREE (STRING_INTERVALS (SVAR (ptr, xname))); + if (!PURE_POINTER_P (XSTRING (ptr->name))) + MARK_STRING (XSTRING (ptr->name)); + MARK_INTERVAL_TREE (STRING_INTERVALS (ptr->name)); ptr = ptr->next; if (ptr) @@ -6163,14 +6163,14 @@ CHECK_ALLOCATED_AND_LIVE (live_cons_p); CONS_MARK (ptr); /* If the cdr is nil, avoid recursion for the car. */ - if (EQ (CVAR (ptr, u.cdr), Qnil)) + if (EQ (ptr->u.cdr, Qnil)) { - obj = CVAR (ptr, car); + obj = ptr->car; cdr_count = 0; goto loop; } - mark_object (CVAR (ptr, car)); - obj = CVAR (ptr, u.cdr); + mark_object (ptr->car); + obj = ptr->u.cdr; cdr_count++; if (cdr_count == mark_object_loop_halt) abort (); @@ -6319,7 +6319,7 @@ cblk->conses[pos].u.chain = cons_free_list; cons_free_list = &cblk->conses[pos]; #if GC_MARK_STACK - CVAR (cons_free_list, car) = Vdead; + cons_free_list->car = Vdead; #endif } else @@ -6467,7 +6467,7 @@ /* Check if the symbol was created during loadup. In such a case it might be pointed to by pure bytecode which we don't trace, so we conservatively assume that it is live. */ - int pure_p = PURE_POINTER_P (XSTRING (sym->s.INTERNAL_FIELD (xname))); + int pure_p = PURE_POINTER_P (XSTRING (sym->s.name)); if (!sym->s.gcmarkbit && !pure_p) { @@ -6476,7 +6476,7 @@ sym->s.next = symbol_free_list; symbol_free_list = &sym->s; #if GC_MARK_STACK - SVAR (symbol_free_list, function) = Vdead; + symbol_free_list->function = Vdead; #endif ++this_free; } @@ -6484,7 +6484,7 @@ { ++num_used; if (!pure_p) - UNMARK_STRING (XSTRING (sym->s.INTERNAL_FIELD (xname))); + UNMARK_STRING (XSTRING (sym->s.name)); sym->s.gcmarkbit = 0; } } @@ -6669,10 +6669,10 @@ XSETSYMBOL (tem, sym); val = find_symbol_value (tem); if (EQ (val, obj) - || EQ (SVAR (sym, function), obj) - || (!NILP (SVAR (sym, function)) - && COMPILEDP (SVAR (sym, function)) - && EQ (AREF (SVAR (sym, function), COMPILED_BYTECODE), obj)) + || EQ (sym->function, obj) + || (!NILP (sym->function) + && COMPILEDP (sym->function) + && EQ (AREF (sym->function, COMPILED_BYTECODE), obj)) || (!NILP (val) && COMPILEDP (val) && EQ (AREF (val, COMPILED_BYTECODE), obj))) === modified file 'src/buffer.c' --- src/buffer.c 2012-08-07 07:33:18 +0000 +++ src/buffer.c 2012-08-07 13:37:21 +0000 @@ -419,17 +419,17 @@ Lisp_Object overlay, start, end; struct Lisp_Marker *m; - eassert (MARKERP (MVAR (list, start))); - m = XMARKER (MVAR (list, start)); + eassert (MARKERP (list->start)); + m = XMARKER (list->start); start = build_marker (b, m->charpos, m->bytepos); XMARKER (start)->insertion_type = m->insertion_type; - eassert (MARKERP (MVAR (list, end))); - m = XMARKER (MVAR (list, end)); + eassert (MARKERP (list->end)); + m = XMARKER (list->end); end = build_marker (b, m->charpos, m->bytepos); XMARKER (end)->insertion_type = m->insertion_type; - overlay = build_overlay (start, end, Fcopy_sequence (MVAR (list, plist))); + overlay = build_overlay (start, end, Fcopy_sequence (list->plist)); if (tail) tail = tail->next = XOVERLAY (overlay); else @@ -659,11 +659,11 @@ static void drop_overlay (struct buffer *b, struct Lisp_Overlay *ov) { - eassert (b == XBUFFER (Fmarker_buffer (MVAR (ov, start)))); - modify_overlay (b, marker_position (MVAR (ov, start)), - marker_position (MVAR (ov, end))); - Fset_marker (MVAR (ov, start), Qnil, Qnil); - Fset_marker (MVAR (ov, end), Qnil, Qnil); + eassert (b == XBUFFER (Fmarker_buffer (ov->start))); + modify_overlay (b, marker_position (ov->start), + marker_position (ov->end)); + Fset_marker (ov->start, Qnil, Qnil); + Fset_marker (ov->end, Qnil, Qnil); } @@ -3889,7 +3889,7 @@ { CHECK_OVERLAY (overlay); - return Fcopy_sequence (MVAR (XOVERLAY (overlay), plist)); + return Fcopy_sequence (XOVERLAY (overlay)->plist); } @@ -4065,7 +4065,7 @@ (Lisp_Object overlay, Lisp_Object prop) { CHECK_OVERLAY (overlay); - return lookup_char_property (MVAR (XOVERLAY (overlay), plist), prop, 0); + return lookup_char_property (XOVERLAY (overlay)->plist, prop, 0); } DEFUN ("overlay-put", Foverlay_put, Soverlay_put, 3, 3, 0, @@ -4080,7 +4080,7 @@ buffer = Fmarker_buffer (OVERLAY_START (overlay)); - for (tail = MVAR (XOVERLAY (overlay), plist); + for (tail = XOVERLAY (overlay)->plist; CONSP (tail) && CONSP (XCDR (tail)); tail = XCDR (XCDR (tail))) if (EQ (XCAR (tail), prop)) @@ -4091,8 +4091,8 @@ } /* It wasn't in the list, so add it to the front. */ changed = !NILP (value); - MVAR (XOVERLAY (overlay), plist) - = Fcons (prop, Fcons (value, MVAR (XOVERLAY (overlay), plist))); + set_overlay_plist + (overlay, Fcons (prop, Fcons (value, XOVERLAY (overlay)->plist))); found: if (! NILP (buffer)) { === modified file 'src/buffer.h' --- src/buffer.h 2012-08-06 16:22:43 +0000 +++ src/buffer.h 2012-08-07 13:37:21 +0000 @@ -991,15 +991,15 @@ /* Return the marker that stands for where OV starts in the buffer. */ -#define OVERLAY_START(OV) MVAR (XOVERLAY (OV), start) +#define OVERLAY_START(OV) XOVERLAY (OV)->start /* Return the marker that stands for where OV ends in the buffer. */ -#define OVERLAY_END(OV) MVAR (XOVERLAY (OV), end) +#define OVERLAY_END(OV) XOVERLAY (OV)->end /* Return the plist of overlay OV. */ -#define OVERLAY_PLIST(OV) MVAR (XOVERLAY (OV), plist) +#define OVERLAY_PLIST(OV) XOVERLAY (OV)->plist /* Return the actual buffer position for the marker P. We assume you know which buffer it's pointing into. */ === modified file 'src/bytecode.c' --- src/bytecode.c 2012-08-05 15:47:28 +0000 +++ src/bytecode.c 2012-08-07 13:37:21 +0000 @@ -818,7 +818,7 @@ && !EQ (val, Qunbound) && !XSYMBOL (sym)->redirect && !SYMBOL_CONSTANT_P (sym)) - SVAR (XSYMBOL (sym), val.value) = val; + SET_SYMBOL_VAL (XSYMBOL (sym), val); else { BEFORE_POTENTIAL_GC (); === modified file 'src/cmds.c' --- src/cmds.c 2012-08-01 07:57:09 +0000 +++ src/cmds.c 2012-08-07 13:37:21 +0000 @@ -447,12 +447,11 @@ and the hook has a non-nil `no-self-insert' property, return right away--don't really self-insert. */ if (SYMBOLP (sym) && ! NILP (sym) - && ! NILP (SVAR (XSYMBOL (sym), function)) - && SYMBOLP (SVAR (XSYMBOL (sym), function))) + && ! NILP (XSYMBOL (sym)->function) + && SYMBOLP (XSYMBOL (sym)->function)) { Lisp_Object prop; - prop = Fget (SVAR (XSYMBOL (sym), function), - intern ("no-self-insert")); + prop = Fget (XSYMBOL (sym)->function, intern ("no-self-insert")); if (! NILP (prop)) return 1; } === modified file 'src/data.c' --- src/data.c 2012-08-07 05:29:25 +0000 +++ src/data.c 2012-08-07 13:37:21 +0000 @@ -562,7 +562,7 @@ (register Lisp_Object symbol) { CHECK_SYMBOL (symbol); - return (EQ (SVAR (XSYMBOL (symbol), function), Qunbound) ? Qnil : Qt); + return EQ (XSYMBOL (symbol)->function, Qunbound) ? Qnil : Qt; } DEFUN ("makunbound", Fmakunbound, Smakunbound, 1, 1, 0, @@ -585,7 +585,7 @@ CHECK_SYMBOL (symbol); if (NILP (symbol) || EQ (symbol, Qt)) xsignal1 (Qsetting_constant, symbol); - SVAR (XSYMBOL (symbol), function) = Qunbound; + set_symbol_function (symbol, Qunbound); return symbol; } @@ -594,8 +594,8 @@ (register Lisp_Object symbol) { CHECK_SYMBOL (symbol); - if (!EQ (SVAR (XSYMBOL (symbol), function), Qunbound)) - return SVAR (XSYMBOL (symbol), function); + if (!EQ (XSYMBOL (symbol)->function, Qunbound)) + return XSYMBOL (symbol)->function; xsignal1 (Qvoid_function, symbol); } @@ -604,7 +604,7 @@ (register Lisp_Object symbol) { CHECK_SYMBOL (symbol); - return SVAR (XSYMBOL (symbol), plist); + return XSYMBOL (symbol)->plist; } DEFUN ("symbol-name", Fsymbol_name, Ssymbol_name, 1, 1, 0, @@ -628,7 +628,7 @@ if (NILP (symbol) || EQ (symbol, Qt)) xsignal1 (Qsetting_constant, symbol); - function = SVAR (XSYMBOL (symbol), function); + function = XSYMBOL (symbol)->function; if (!NILP (Vautoload_queue) && !EQ (function, Qunbound)) Vautoload_queue = Fcons (Fcons (symbol, function), Vautoload_queue); @@ -636,13 +636,13 @@ if (CONSP (function) && EQ (XCAR (function), Qautoload)) Fput (symbol, Qautoload, XCDR (function)); - SVAR (XSYMBOL (symbol), function) = definition; + set_symbol_function (symbol, definition); /* Handle automatic advice activation. */ - if (CONSP (SVAR (XSYMBOL (symbol), plist)) + if (CONSP (XSYMBOL (symbol)->plist) && !NILP (Fget (symbol, Qad_advice_info))) { call2 (Qad_activate_internal, symbol, Qnil); - definition = SVAR (XSYMBOL (symbol), function); + definition = XSYMBOL (symbol)->function; } return definition; } @@ -657,8 +657,8 @@ (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring) { CHECK_SYMBOL (symbol); - if (CONSP (SVAR (XSYMBOL (symbol), function)) - && EQ (XCAR (SVAR (XSYMBOL (symbol), function)), Qautoload)) + if (CONSP (XSYMBOL (symbol)->function) + && EQ (XCAR (XSYMBOL (symbol)->function), Qautoload)) LOADHIST_ATTACH (Fcons (Qt, symbol)); if (!NILP (Vpurify_flag) /* If `definition' is a keymap, immutable (and copying) is wrong. */ @@ -679,7 +679,7 @@ (register Lisp_Object symbol, Lisp_Object newplist) { CHECK_SYMBOL (symbol); - SVAR (XSYMBOL (symbol), plist) = newplist; + set_symbol_plist (symbol, newplist); return newplist; } @@ -2019,12 +2019,12 @@ { if (!SYMBOLP (hare) || EQ (hare, Qunbound)) break; - hare = SVAR (XSYMBOL (hare), function); + hare = XSYMBOL (hare)->function; if (!SYMBOLP (hare) || EQ (hare, Qunbound)) break; - hare = SVAR (XSYMBOL (hare), function); + hare = XSYMBOL (hare)->function; - tortoise = SVAR (XSYMBOL (tortoise), function); + tortoise = XSYMBOL (tortoise)->function; if (EQ (hare, tortoise)) xsignal1 (Qcyclic_function_indirection, object); @@ -2048,7 +2048,7 @@ /* Optimize for no indirection. */ result = object; if (SYMBOLP (result) && !EQ (result, Qunbound) - && (result = SVAR (XSYMBOL (result), function), SYMBOLP (result))) + && (result = XSYMBOL (result)->function, SYMBOLP (result))) result = indirect_function (result); if (!EQ (result, Qunbound)) return result; @@ -3196,7 +3196,7 @@ defsubr (&Ssubr_arity); defsubr (&Ssubr_name); - SVAR (XSYMBOL (Qwholenump), function) = SVAR (XSYMBOL (Qnatnump), function); + set_symbol_function (Qwholenump, XSYMBOL (Qnatnump)->function); DEFVAR_LISP ("most-positive-fixnum", Vmost_positive_fixnum, doc: /* The largest value that is representable in a Lisp integer. */); === modified file 'src/doc.c' --- src/doc.c 2012-08-03 23:36:11 +0000 +++ src/doc.c 2012-08-07 13:37:21 +0000 @@ -508,7 +508,7 @@ { /* Don't use indirect_function here, or defaliases will apply their docstrings to the base functions (Bug#2603). */ - Lisp_Object fun = SYMBOLP (obj) ? SVAR (XSYMBOL (obj), function) : obj; + Lisp_Object fun = SYMBOLP (obj) ? XSYMBOL (obj)->function : obj; /* The type determines where the docstring is stored. */ === modified file 'src/eval.c' --- src/eval.c 2012-08-07 05:29:25 +0000 +++ src/eval.c 2012-08-07 13:37:21 +0000 @@ -976,7 +976,7 @@ tem = Fassq (sym, environment); if (NILP (tem)) { - def = SVAR (XSYMBOL (sym), function); + def = XSYMBOL (sym)->function; if (!EQ (def, Qunbound)) continue; } @@ -1893,9 +1893,9 @@ CHECK_STRING (file); /* If function is defined and not as an autoload, don't override. */ - if (!EQ (SVAR (XSYMBOL (function), function), Qunbound) - && !(CONSP (SVAR (XSYMBOL (function), function)) - && EQ (XCAR (SVAR (XSYMBOL (function), function)), Qautoload))) + if (!EQ (XSYMBOL (function)->function, Qunbound) + && !(CONSP (XSYMBOL (function)->function) + && EQ (XCAR (XSYMBOL (function)->function), Qautoload))) return Qnil; if (NILP (Vpurify_flag)) @@ -2081,7 +2081,7 @@ /* Optimize for no indirection. */ fun = original_fun; if (SYMBOLP (fun) && !EQ (fun, Qunbound) - && (fun = SVAR (XSYMBOL (fun), function), SYMBOLP (fun))) + && (fun = XSYMBOL (fun)->function, SYMBOLP (fun))) fun = indirect_function (fun); if (SUBRP (fun)) @@ -2266,7 +2266,7 @@ /* Optimize for no indirection. */ if (SYMBOLP (fun) && !EQ (fun, Qunbound) - && (fun = SVAR (XSYMBOL (fun), function), SYMBOLP (fun))) + && (fun = XSYMBOL (fun)->function, SYMBOLP (fun))) fun = indirect_function (fun); if (EQ (fun, Qunbound)) { @@ -2771,7 +2771,7 @@ /* Optimize for no indirection. */ fun = original_fun; if (SYMBOLP (fun) && !EQ (fun, Qunbound) - && (fun = SVAR (XSYMBOL (fun), function), SYMBOLP (fun))) + && (fun = XSYMBOL (fun)->function, SYMBOLP (fun))) fun = indirect_function (fun); if (SUBRP (fun)) === modified file 'src/fns.c' --- src/fns.c 2012-08-05 15:47:28 +0000 +++ src/fns.c 2012-08-07 13:37:21 +0000 @@ -1868,7 +1868,7 @@ (Lisp_Object symbol, Lisp_Object propname) { CHECK_SYMBOL (symbol); - return Fplist_get (SVAR (XSYMBOL (symbol), plist), propname); + return Fplist_get (XSYMBOL (symbol)->plist, propname); } DEFUN ("plist-put", Fplist_put, Splist_put, 3, 3, 0, @@ -1910,8 +1910,8 @@ (Lisp_Object symbol, Lisp_Object propname, Lisp_Object value) { CHECK_SYMBOL (symbol); - SVAR (XSYMBOL (symbol), plist) - = Fplist_put (SVAR (XSYMBOL (symbol), plist), propname, value); + set_symbol_plist + (symbol, Fplist_put (XSYMBOL (symbol)->plist, propname, value)); return value; } @@ -2053,8 +2053,8 @@ || !internal_equal (OVERLAY_END (o1), OVERLAY_END (o2), depth + 1, props)) return 0; - o1 = MVAR (XOVERLAY (o1), plist); - o2 = MVAR (XOVERLAY (o2), plist); + o1 = XOVERLAY (o1)->plist; + o2 = XOVERLAY (o2)->plist; goto tail_recurse; } if (MARKERP (o1)) === modified file 'src/keyboard.c' --- src/keyboard.c 2012-08-07 07:33:18 +0000 +++ src/keyboard.c 2012-08-07 13:37:21 +0000 @@ -7896,7 +7896,7 @@ (such as lmenu.el set it up), check if the original command matches the cached command. */ && !(SYMBOLP (def) - && EQ (tem, SVAR (XSYMBOL (def), function))))) + && EQ (tem, XSYMBOL (def)->function)))) keys = Qnil; } @@ -8830,9 +8830,9 @@ /* Handle a symbol whose function definition is a keymap or an array. */ if (SYMBOLP (next) && !NILP (Ffboundp (next)) - && (ARRAYP (SVAR (XSYMBOL (next), function)) - || KEYMAPP (SVAR (XSYMBOL (next), function)))) - next = Fautoload_do_load (SVAR (XSYMBOL (next), function), next, Qnil); + && (ARRAYP (XSYMBOL (next)->function) + || KEYMAPP (XSYMBOL (next)->function))) + next = Fautoload_do_load (XSYMBOL (next)->function, next, Qnil); /* If the keymap gives a function, not an array, then call the function with one arg and use === modified file 'src/lisp.h' --- src/lisp.h 2012-08-07 07:33:18 +0000 +++ src/lisp.h 2012-08-07 13:37:21 +0000 @@ -633,10 +633,7 @@ #define CHECK_TYPE(ok, Qxxxp, x) \ do { if (!(ok)) wrong_type_argument (Qxxxp, (x)); } while (0) -/* Lisp fields are usually hidden from most code and accessed - via special macros. Only select pieces of code, like the GC, - are allowed to use INTERNAL_FIELD directly. Objects which - aren't using this convention should be fixed. */ +/* Deprecated and will be removed soon. */ #define INTERNAL_FIELD(field) field ## _ @@ -648,20 +645,15 @@ #define CHECK_STRING_OR_BUFFER(x) \ CHECK_TYPE (STRINGP (x) || BUFFERP (x), Qbuffer_or_string_p, x) -/* Most code should use this macro to - access Lisp fields in struct Lisp_Cons. */ - -#define CVAR(cons, field) ((cons)->INTERNAL_FIELD (field)) - struct Lisp_Cons { /* Car of this cons cell. */ - Lisp_Object INTERNAL_FIELD (car); + Lisp_Object car; union { /* Cdr of this cons cell. */ - Lisp_Object INTERNAL_FIELD (cdr); + Lisp_Object cdr; /* Used to chain conses on a free list. */ struct Lisp_Cons *chain; @@ -675,8 +667,8 @@ fields are not accessible as lvalues. (What if we want to switch to a copying collector someday? Cached cons cell field addresses may be invalidated at arbitrary points.) */ -#define XCAR_AS_LVALUE(c) (CVAR (XCONS (c), car)) -#define XCDR_AS_LVALUE(c) (CVAR (XCONS (c), u.cdr)) +#define XCAR_AS_LVALUE(c) (XCONS (c)->car) +#define XCDR_AS_LVALUE(c) (XCONS (c)->u.cdr) /* Use these from normal code. */ #define XCAR(c) LISP_MAKE_RVALUE (XCAR_AS_LVALUE (c)) @@ -1067,11 +1059,6 @@ SYMBOL_FORWARDED = 3 }; -/* Most code should use this macro to access - Lisp fields in struct Lisp_Symbol. */ - -#define SVAR(sym, field) ((sym)->INTERNAL_FIELD (field)) - struct Lisp_Symbol { unsigned gcmarkbit : 1; @@ -1096,25 +1083,23 @@ special (with `defvar' etc), and shouldn't be lexically bound. */ unsigned declared_special : 1; - /* The symbol's name, as a Lisp string. - The name "xname" is used to intentionally break code referring to - the old field "name" of type pointer to struct Lisp_String. */ - Lisp_Object INTERNAL_FIELD (xname); + /* The symbol's name, as a Lisp string. */ + Lisp_Object name; /* Value of the symbol or Qunbound if unbound. Which alternative of the union is used depends on the `redirect' field above. */ union { - Lisp_Object INTERNAL_FIELD (value); + Lisp_Object value; struct Lisp_Symbol *alias; struct Lisp_Buffer_Local_Value *blv; union Lisp_Fwd *fwd; } val; /* Function value of the symbol or Qunbound if not fboundp. */ - Lisp_Object INTERNAL_FIELD (function); + Lisp_Object function; /* The symbol's property list. */ - Lisp_Object INTERNAL_FIELD (plist); + Lisp_Object plist; /* Next symbol in obarray bucket, if the symbol is interned. */ struct Lisp_Symbol *next; @@ -1122,43 +1107,42 @@ /* Value is name of symbol. */ -#define SYMBOL_VAL(sym) \ - (eassert ((sym)->redirect == SYMBOL_PLAINVAL), SVAR (sym, val.value)) -#define SYMBOL_ALIAS(sym) \ +#define SYMBOL_VAL(sym) \ + (eassert ((sym)->redirect == SYMBOL_PLAINVAL), sym->val.value) +#define SYMBOL_ALIAS(sym) \ (eassert ((sym)->redirect == SYMBOL_VARALIAS), (sym)->val.alias) -#define SYMBOL_BLV(sym) \ +#define SYMBOL_BLV(sym) \ (eassert ((sym)->redirect == SYMBOL_LOCALIZED), (sym)->val.blv) -#define SYMBOL_FWD(sym) \ +#define SYMBOL_FWD(sym) \ (eassert ((sym)->redirect == SYMBOL_FORWARDED), (sym)->val.fwd) -#define SET_SYMBOL_VAL(sym, v) \ - (eassert ((sym)->redirect == SYMBOL_PLAINVAL), SVAR (sym, val.value) = (v)) -#define SET_SYMBOL_ALIAS(sym, v) \ +#define SET_SYMBOL_VAL(sym, v) \ + (eassert ((sym)->redirect == SYMBOL_PLAINVAL), (sym)->val.value = (v)) +#define SET_SYMBOL_ALIAS(sym, v) \ (eassert ((sym)->redirect == SYMBOL_VARALIAS), (sym)->val.alias = (v)) -#define SET_SYMBOL_BLV(sym, v) \ +#define SET_SYMBOL_BLV(sym, v) \ (eassert ((sym)->redirect == SYMBOL_LOCALIZED), (sym)->val.blv = (v)) -#define SET_SYMBOL_FWD(sym, v) \ +#define SET_SYMBOL_FWD(sym, v) \ (eassert ((sym)->redirect == SYMBOL_FORWARDED), (sym)->val.fwd = (v)) -#define SYMBOL_NAME(sym) \ - LISP_MAKE_RVALUE (SVAR (XSYMBOL (sym), xname)) +#define SYMBOL_NAME(sym) XSYMBOL (sym)->name /* Value is non-zero if SYM is an interned symbol. */ -#define SYMBOL_INTERNED_P(sym) \ - (XSYMBOL (sym)->interned != SYMBOL_UNINTERNED) +#define SYMBOL_INTERNED_P(sym) \ + (XSYMBOL (sym)->interned != SYMBOL_UNINTERNED) /* Value is non-zero if SYM is interned in initial_obarray. */ -#define SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P(sym) \ - (XSYMBOL (sym)->interned == SYMBOL_INTERNED_IN_INITIAL_OBARRAY) +#define SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P(sym) \ + (XSYMBOL (sym)->interned == SYMBOL_INTERNED_IN_INITIAL_OBARRAY) /* Value is non-zero if symbol is considered a constant, i.e. its value cannot be changed (there is an exception for keyword symbols, whose value can be set to the keyword symbol itself). */ -#define SYMBOL_CONSTANT_P(sym) XSYMBOL (sym)->constant +#define SYMBOL_CONSTANT_P(sym) XSYMBOL (sym)->constant -#define DEFSYM(sym, name) \ +#define DEFSYM(sym, name) \ do { (sym) = intern_c_string ((name)); staticpro (&(sym)); } while (0) @@ -1289,11 +1273,6 @@ static double const DEFAULT_REHASH_SIZE = 1.5; -/* Most code should use this macro to access - Lisp fields in a different misc objects. */ - -#define MVAR(misc, field) ((misc)->INTERNAL_FIELD (field)) - /* These structures are used for various misc types. */ struct Lisp_Misc_Any /* Supertype of all Misc types. */ @@ -1363,9 +1342,9 @@ unsigned gcmarkbit : 1; int spacer : 15; struct Lisp_Overlay *next; - Lisp_Object INTERNAL_FIELD (start); - Lisp_Object INTERNAL_FIELD (end); - Lisp_Object INTERNAL_FIELD (plist); + Lisp_Object start; + Lisp_Object end; + Lisp_Object plist; }; /* Hold a C pointer for later use. @@ -2406,6 +2385,41 @@ gc_aset (h->index, idx, val); } +/* Use these functions to set Lisp_Object + or pointer slots of struct Lisp_Symbol. */ + +LISP_INLINE void +set_symbol_name (Lisp_Object sym, Lisp_Object name) +{ + XSYMBOL (sym)->name = name; +} + +LISP_INLINE void +set_symbol_function (Lisp_Object sym, Lisp_Object function) +{ + XSYMBOL (sym)->function = function; +} + +LISP_INLINE void +set_symbol_plist (Lisp_Object sym, Lisp_Object plist) +{ + XSYMBOL (sym)->plist = plist; +} + +LISP_INLINE void +set_symbol_next (Lisp_Object sym, struct Lisp_Symbol *next) +{ + XSYMBOL (sym)->next = next; +} + +/* Set overlay's property list. */ + +LISP_INLINE void +set_overlay_plist (Lisp_Object overlay, Lisp_Object plist) +{ + XOVERLAY (overlay)->plist = plist; +} + /* Defined in data.c. */ extern Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound; extern Lisp_Object Qerror_conditions, Qerror_message, Qtop_level; === modified file 'src/lread.c' --- src/lread.c 2012-08-07 11:28:41 +0000 +++ src/lread.c 2012-08-07 13:37:21 +0000 @@ -3717,9 +3717,9 @@ ptr = aref_addr (obarray, XINT(tem)); if (SYMBOLP (*ptr)) - XSYMBOL (sym)->next = XSYMBOL (*ptr); + set_symbol_next (sym, XSYMBOL (*ptr)); else - XSYMBOL (sym)->next = 0; + set_symbol_next (sym, NULL); *ptr = sym; return sym; } @@ -3816,7 +3816,7 @@ XSETSYMBOL (following, XSYMBOL (tail)->next); if (EQ (following, tem)) { - XSYMBOL (tail)->next = XSYMBOL (following)->next; + set_symbol_next (tail, XSYMBOL (following)->next); break; } } @@ -3926,13 +3926,12 @@ /* Fmake_symbol inits fields of new symbols with Qunbound and Qnil, so those two need to be fixed manually. */ SET_SYMBOL_VAL (XSYMBOL (Qunbound), Qunbound); - SVAR (XSYMBOL (Qunbound), function) = Qunbound; - SVAR (XSYMBOL (Qunbound), plist) = Qnil; - /* XSYMBOL (Qnil)->function = Qunbound; */ + set_symbol_function (Qunbound, Qunbound); + set_symbol_plist (Qunbound, Qnil); SET_SYMBOL_VAL (XSYMBOL (Qnil), Qnil); XSYMBOL (Qnil)->constant = 1; XSYMBOL (Qnil)->declared_special = 1; - SVAR (XSYMBOL (Qnil), plist) = Qnil; + set_symbol_plist (Qnil, Qnil); Qt = intern_c_string ("t"); SET_SYMBOL_VAL (XSYMBOL (Qt), Qt); @@ -3951,10 +3950,11 @@ void defsubr (struct Lisp_Subr *sname) { - Lisp_Object sym; + Lisp_Object sym, tem; sym = intern_c_string (sname->symbol_name); XSETTYPED_PVECTYPE (sname, size, PVEC_SUBR); - XSETSUBR (SVAR (XSYMBOL (sym), function), sname); + XSETSUBR (tem, sname); + set_symbol_function (sym, tem); } #ifdef NOTDEF /* Use fset in subr.el now! */ === modified file 'src/nsselect.m' --- src/nsselect.m 2012-08-01 20:15:30 +0000 +++ src/nsselect.m 2012-08-07 13:37:21 +0000 @@ -62,7 +62,7 @@ if (EQ (sym, QPRIMARY)) return NXPrimaryPboard; if (EQ (sym, QSECONDARY)) return NXSecondaryPboard; if (EQ (sym, QTEXT)) return NSStringPboardType; - return [NSString stringWithUTF8String: SSDATA (SVAR (XSYMBOL (sym), xname))]; + return [NSString stringWithUTF8String: SSDATA (SYMBOL_NAME (sym))]; } static NSPasteboard * === modified file 'src/xterm.c' --- src/xterm.c 2012-08-07 07:33:18 +0000 +++ src/xterm.c 2012-08-07 13:37:21 +0000 @@ -10123,7 +10123,7 @@ terminal->kboard->next_kboard = all_kboards; all_kboards = terminal->kboard; - if (!EQ (SVAR (XSYMBOL (Qvendor_specific_keysyms), function), Qunbound)) + if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound)) { char *vendor = ServerVendor (dpy); ------------------------------------------------------------ revno: 109494 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-08-07 15:28:41 +0400 message: Basic functions to set Lisp_Object and pointer slots of intervals. * intervals.h (interval_set_parent, interval_set_object): (interval_set_left, interval_set_right, interval_set_plist): (interval_copy_parent): New function. (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove. (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE): Adjust indentation. (INTERVAL_SIZE): Remove. Adjust users. * alloc.c, intervals.c, lread.c, textprop.c: Use new functions. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-07 07:42:34 +0000 +++ src/ChangeLog 2012-08-07 11:28:41 +0000 @@ -1,5 +1,17 @@ 2012-08-07 Dmitry Antipov + Basic functions to set Lisp_Object and pointer slots of intervals. + * intervals.h (interval_set_parent, interval_set_object): + (interval_set_left, interval_set_right, interval_set_plist): + (interval_copy_parent): New function. + (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove. + (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE): Adjust + indentation. + (INTERVAL_SIZE): Remove. Adjust users. + * alloc.c, intervals.c, lread.c, textprop.c: Use new functions. + +2012-08-07 Dmitry Antipov + Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process. * process.h (PGET): Remove. (struct Lisp_Process): Do not use INTERNAL_FIELD. === modified file 'src/alloc.c' --- src/alloc.c 2012-08-07 07:33:18 +0000 +++ src/alloc.c 2012-08-07 11:28:41 +0000 @@ -6416,7 +6416,7 @@ { if (!iblk->intervals[i].gcmarkbit) { - SET_INTERVAL_PARENT (&iblk->intervals[i], interval_free_list); + interval_set_parent (&iblk->intervals[i], interval_free_list); interval_free_list = &iblk->intervals[i]; this_free++; } === modified file 'src/intervals.c' --- src/intervals.c 2012-07-18 21:33:37 +0000 +++ src/intervals.c 2012-08-07 11:28:41 +0000 @@ -88,7 +88,7 @@ new->position = 0; } - SET_INTERVAL_OBJECT (new, parent); + interval_set_object (new, parent); return new; } @@ -102,7 +102,7 @@ return; COPY_INTERVAL_CACHE (source, target); - target->plist = Fcopy_sequence (source->plist); + interval_set_plist (target, Fcopy_sequence (source->plist)); } /* Merge the properties of interval SOURCE into the properties @@ -138,7 +138,7 @@ if (NILP (val)) { val = XCAR (o); - target->plist = Fcons (sym, Fcons (val, target->plist)); + interval_set_plist (target, Fcons (sym, Fcons (val, target->plist))); } o = XCDR (o); } @@ -320,21 +320,21 @@ if (! ROOT_INTERVAL_P (interval)) { if (AM_LEFT_CHILD (interval)) - INTERVAL_PARENT (interval)->left = B; + interval_set_left (INTERVAL_PARENT (interval), B); else - INTERVAL_PARENT (interval)->right = B; + interval_set_right (INTERVAL_PARENT (interval), B); } - COPY_INTERVAL_PARENT (B, interval); + interval_copy_parent (B, interval); /* Make B the parent of A */ i = B->right; - B->right = interval; - SET_INTERVAL_PARENT (interval, B); + interval_set_right (B, interval); + interval_set_parent (interval, B); /* Make A point to c */ - interval->left = i; + interval_set_left (interval, i); if (! NULL_INTERVAL_P (i)) - SET_INTERVAL_PARENT (i, interval); + interval_set_parent (i, interval); /* A's total length is decreased by the length of B and its left child. */ interval->total_length -= B->total_length - LEFT_TOTAL_LENGTH (interval); @@ -367,21 +367,21 @@ if (! ROOT_INTERVAL_P (interval)) { if (AM_LEFT_CHILD (interval)) - INTERVAL_PARENT (interval)->left = B; + interval_set_left (INTERVAL_PARENT (interval), B); else - INTERVAL_PARENT (interval)->right = B; + interval_set_right (INTERVAL_PARENT (interval), B); } - COPY_INTERVAL_PARENT (B, interval); + interval_copy_parent (B, interval); /* Make B the parent of A */ i = B->left; - B->left = interval; - SET_INTERVAL_PARENT (interval, B); + interval_set_left (B, interval); + interval_set_parent (interval, B); /* Make A point to c */ - interval->right = i; + interval_set_right (interval, i); if (! NULL_INTERVAL_P (i)) - SET_INTERVAL_PARENT (i, interval); + interval_set_parent (i, interval); /* A's total length is decreased by the length of B and its right child. */ interval->total_length -= B->total_length - RIGHT_TOTAL_LENGTH (interval); @@ -507,20 +507,20 @@ ptrdiff_t new_length = LENGTH (interval) - offset; new->position = position + offset; - SET_INTERVAL_PARENT (new, interval); + interval_set_parent (new, interval); if (NULL_RIGHT_CHILD (interval)) { - interval->right = new; + interval_set_right (interval, new); new->total_length = new_length; CHECK_TOTAL_LENGTH (new); } else { /* Insert the new node between INTERVAL and its right child. */ - new->right = interval->right; - SET_INTERVAL_PARENT (interval->right, new); - interval->right = new; + interval_set_right (new, interval->right); + interval_set_parent (interval->right, new); + interval_set_right (interval, new); new->total_length = new_length + new->right->total_length; CHECK_TOTAL_LENGTH (new); balance_an_interval (new); @@ -552,20 +552,20 @@ new->position = interval->position; interval->position = interval->position + offset; - SET_INTERVAL_PARENT (new, interval); + interval_set_parent (new, interval); if (NULL_LEFT_CHILD (interval)) { - interval->left = new; + interval_set_left (interval, new); new->total_length = new_length; CHECK_TOTAL_LENGTH (new); } else { /* Insert the new node between INTERVAL and its left child. */ - new->left = interval->left; - SET_INTERVAL_PARENT (new->left, new); - interval->left = new; + interval_set_left (new, interval->left); + interval_set_parent (new->left, new); + interval_set_left (interval, new); new->total_length = new_length + new->left->total_length; CHECK_TOTAL_LENGTH (new); balance_an_interval (new); @@ -940,21 +940,20 @@ RESET_INTERVAL (&newi); pleft = NULL_INTERVAL_P (prev) ? Qnil : prev->plist; pright = NULL_INTERVAL_P (i) ? Qnil : i->plist; - newi.plist = merge_properties_sticky (pleft, pright); + interval_set_plist (&newi, merge_properties_sticky (pleft, pright)); if (! prev) /* i.e. position == BEG */ { if (! intervals_equal (i, &newi)) { i = split_interval_left (i, length); - i->plist = newi.plist; + interval_set_plist (i, newi.plist); } } else if (! intervals_equal (prev, &newi)) { - prev = split_interval_right (prev, - position - prev->position); - prev->plist = newi.plist; + prev = split_interval_right (prev, position - prev->position); + interval_set_plist (prev, newi.plist); if (! NULL_INTERVAL_P (i) && intervals_equal (prev, i)) merge_interval_right (prev); @@ -1180,8 +1179,8 @@ this->total_length += migrate_amt; } CHECK_TOTAL_LENGTH (this); - this->left = migrate; - SET_INTERVAL_PARENT (migrate, this); + interval_set_left (this, migrate); + interval_set_parent (migrate, this); return i->right; } @@ -1206,7 +1205,7 @@ GET_INTERVAL_OBJECT (owner, i); parent = delete_node (i); if (! NULL_INTERVAL_P (parent)) - SET_INTERVAL_OBJECT (parent, owner); + interval_set_object (parent, owner); if (BUFFERP (owner)) BUF_INTERVALS (XBUFFER (owner)) = parent; @@ -1221,15 +1220,15 @@ parent = INTERVAL_PARENT (i); if (AM_LEFT_CHILD (i)) { - parent->left = delete_node (i); + interval_set_left (parent, delete_node (i)); if (! NULL_INTERVAL_P (parent->left)) - SET_INTERVAL_PARENT (parent->left, parent); + interval_set_parent (parent->left, parent); } else { - parent->right = delete_node (i); + interval_set_right (parent, delete_node (i)); if (! NULL_INTERVAL_P (parent->right)) - SET_INTERVAL_PARENT (parent->right, parent); + interval_set_parent (parent->right, parent); } } @@ -1500,13 +1499,13 @@ { register INTERVAL t = make_interval (); - memcpy (t, source, INTERVAL_SIZE); + memcpy (t, source, sizeof *t); copy_properties (source, t); - SET_INTERVAL_PARENT (t, parent); + interval_set_parent (t, parent); if (! NULL_LEFT_CHILD (source)) - t->left = reproduce_tree (source->left, t); + interval_set_left (t, reproduce_tree (source->left, t)); if (! NULL_RIGHT_CHILD (source)) - t->right = reproduce_tree (source->right, t); + interval_set_right (t, reproduce_tree (source->right, t)); return t; } @@ -1516,13 +1515,13 @@ { register INTERVAL t = make_interval (); - memcpy (t, source, INTERVAL_SIZE); + memcpy (t, source, sizeof *t); copy_properties (source, t); - SET_INTERVAL_OBJECT (t, parent); + interval_set_object (t, parent); if (! NULL_LEFT_CHILD (source)) - t->left = reproduce_tree (source->left, t); + interval_set_left (t, reproduce_tree (source->left, t)); if (! NULL_RIGHT_CHILD (source)) - t->right = reproduce_tree (source->right, t); + interval_set_right (t, reproduce_tree (source->right, t)); return t; } @@ -2264,7 +2263,7 @@ if (NULL_INTERVAL_P (interval_copy)) return; - SET_INTERVAL_OBJECT (interval_copy, string); + interval_set_object (interval_copy, string); STRING_SET_INTERVALS (string, interval_copy); } @@ -2404,13 +2403,13 @@ { if ((i)->left) { - (i)->plist = (i)->left->plist; + interval_set_plist (i, i->left->plist); (i)->left->total_length = 0; delete_interval ((i)->left); } else { - (i)->plist = (i)->right->plist; + interval_set_plist (i, i->right->plist); (i)->right->total_length = 0; delete_interval ((i)->right); } === modified file 'src/intervals.h' --- src/intervals.h 2012-07-17 09:12:24 +0000 +++ src/intervals.h 2012-08-07 11:28:41 +0000 @@ -18,6 +18,8 @@ #include "dispextern.h" +INLINE_HEADER_BEGIN + #define NULL_INTERVAL ((INTERVAL)0) #define INTERVAL_DEFAULT NULL_INTERVAL @@ -61,12 +63,6 @@ /* These are macros for dealing with the interval tree. */ -/* Size of the structure used to represent an interval. */ -#define INTERVAL_SIZE (sizeof (struct interval)) - -/* Size of a pointer to an interval structure. */ -#define INTERVAL_PTR_SIZE (sizeof (struct interval *)) - #define NULL_INTERVAL_P(i) ((i) == NULL_INTERVAL) /* True if this interval has no right child. */ @@ -131,23 +127,63 @@ #define INTERVAL_HAS_PARENT(i) ((i)->up_obj == 0 && (i)->up.interval != 0) #define INTERVAL_HAS_OBJECT(i) ((i)->up_obj) -/* Set/get parent of an interval. +/* Use these macros to get parent of an interval. The choice of macros is dependent on the type needed. Don't add casts to get around this, it will break some development work in progress. */ -#define SET_INTERVAL_PARENT(i,p) \ - ((i)->up_obj = 0, (i)->up.interval = (p)) -#define SET_INTERVAL_OBJECT(i,o) \ - (eassert (BUFFERP (o) || STRINGP (o)), (i)->up_obj = 1, (i)->up.obj = (o)) -#define INTERVAL_PARENT(i) \ - (eassert ((i) != 0 && (i)->up_obj == 0),(i)->up.interval) -#define GET_INTERVAL_OBJECT(d,s) (eassert((s)->up_obj == 1), (d) = (s)->up.obj) - -/* Make the parent of D be whatever the parent of S is, regardless of - type. This is used when balancing an interval tree. */ -#define COPY_INTERVAL_PARENT(d,s) \ - ((d)->up = (s)->up, (d)->up_obj = (s)->up_obj) + +#define INTERVAL_PARENT(i) \ + (eassert ((i) != 0 && (i)->up_obj == 0), (i)->up.interval) + +#define GET_INTERVAL_OBJECT(d,s) (eassert ((s)->up_obj == 1), (d) = (s)->up.obj) + +/* Use these functions to set Lisp_Object + or pointer slots of struct interval. */ + +LISP_INLINE void +interval_set_parent (INTERVAL i, INTERVAL parent) +{ + i->up_obj = 0; + i->up.interval = parent; +} + +LISP_INLINE void +interval_set_object (INTERVAL i, Lisp_Object obj) +{ + eassert (BUFFERP (obj) || STRINGP (obj)); + i->up_obj = 1; + i->up.obj = obj; +} + +LISP_INLINE void +interval_set_left (INTERVAL i, INTERVAL left) +{ + i->left = left; +} + +LISP_INLINE void +interval_set_right (INTERVAL i, INTERVAL right) +{ + i->right = right; +} + +LISP_INLINE Lisp_Object +interval_set_plist (INTERVAL i, Lisp_Object plist) +{ + i->plist = plist; + return plist; +} + +/* Make the parent of D be whatever the parent of S is, regardless + of the type. This is used when balancing an interval tree. */ + +LISP_INLINE void +interval_copy_parent (INTERVAL d, INTERVAL s) +{ + d->up = s->up; + d->up_obj = s->up_obj; +} /* Get the parent interval, if any, otherwise a null pointer. Useful for walking up to the root in a "for" loop; use this to get the @@ -165,31 +201,31 @@ while (0) /* Reset this interval to its vanilla, or no-property state. */ -#define RESET_INTERVAL(i) \ -{ \ - (i)->total_length = (i)->position = 0; \ - (i)->left = (i)->right = NULL_INTERVAL; \ - SET_INTERVAL_PARENT (i, NULL_INTERVAL); \ - (i)->write_protect = 0; \ - (i)->visible = 0; \ - (i)->front_sticky = (i)->rear_sticky = 0; \ - (i)->plist = Qnil; \ +#define RESET_INTERVAL(i) \ +{ \ + (i)->total_length = (i)->position = 0; \ + (i)->left = (i)->right = NULL_INTERVAL; \ + interval_set_parent (i, NULL_INTERVAL); \ + (i)->write_protect = 0; \ + (i)->visible = 0; \ + (i)->front_sticky = (i)->rear_sticky = 0; \ + interval_set_plist (i, Qnil); \ } /* Copy the cached property values of interval FROM to interval TO. */ -#define COPY_INTERVAL_CACHE(from,to) \ -{ \ - (to)->write_protect = (from)->write_protect; \ - (to)->visible = (from)->visible; \ - (to)->front_sticky = (from)->front_sticky; \ - (to)->rear_sticky = (from)->rear_sticky; \ +#define COPY_INTERVAL_CACHE(from,to) \ +{ \ + (to)->write_protect = (from)->write_protect; \ + (to)->visible = (from)->visible; \ + (to)->front_sticky = (from)->front_sticky; \ + (to)->rear_sticky = (from)->rear_sticky; \ } /* Copy only the set bits of FROM's cache. */ -#define MERGE_INTERVAL_CACHE(from,to) \ -{ \ +#define MERGE_INTERVAL_CACHE(from,to) \ +{ \ if ((from)->write_protect) (to)->write_protect = 1; \ - if ((from)->visible) (to)->visible = 1; \ + if ((from)->visible) (to)->visible = 1; \ if ((from)->front_sticky) (to)->front_sticky = 1; \ if ((from)->rear_sticky) (to)->rear_sticky = 1; \ } @@ -326,3 +362,5 @@ extern void syms_of_textprop (void); #include "composite.h" + +INLINE_HEADER_END === modified file 'src/lread.c' --- src/lread.c 2012-08-04 14:17:10 +0000 +++ src/lread.c 2012-08-07 11:28:41 +0000 @@ -3211,7 +3211,7 @@ Lisp_Object object = Fcar (arg); Lisp_Object placeholder = Fcdr (arg); - SUBSTITUTE (interval->plist, interval->plist = true_value); + SUBSTITUTE (interval->plist, interval_set_plist (interval, true_value)); } === modified file 'src/textprop.c' --- src/textprop.c 2012-08-07 07:33:18 +0000 +++ src/textprop.c 2012-08-07 11:28:41 +0000 @@ -338,7 +338,7 @@ } /* Store new properties. */ - interval->plist = Fcopy_sequence (properties); + interval_set_plist (interval, Fcopy_sequence (properties)); } /* Add the properties of PLIST to the interval I, or set @@ -411,7 +411,7 @@ record_property_change (i->position, LENGTH (i), sym1, Qnil, object); } - i->plist = Fcons (sym1, Fcons (val1, i->plist)); + interval_set_plist (i, Fcons (sym1, Fcons (val1, i->plist))); changed++; } } @@ -484,7 +484,7 @@ } if (changed) - i->plist = current_plist; + interval_set_plist (i, current_plist); return changed; } ------------------------------------------------------------ revno: 109493 committer: Andreas Schwab branch nick: emacs timestamp: Tue 2012-08-07 13:13:23 +0200 message: * progmodes/autoconf.el (font-lock-syntactic-keywords): Don't declare. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-07 04:52:15 +0000 +++ lisp/ChangeLog 2012-08-07 11:13:23 +0000 @@ -1,3 +1,8 @@ +2012-08-07 Andreas Schwab + + * progmodes/autoconf.el (font-lock-syntactic-keywords): Don't + declare. + 2012-08-07 Chong Yidong * simple.el (deactivate-mark): Preserve text properties when === modified file 'lisp/progmodes/autoconf.el' --- lisp/progmodes/autoconf.el 2012-08-01 07:34:28 +0000 +++ lisp/progmodes/autoconf.el 2012-08-07 11:13:23 +0000 @@ -35,8 +35,6 @@ ;;; Code: -(defvar font-lock-syntactic-keywords) - (defvar autoconf-mode-map (make-sparse-keymap)) (defvar autoconf-mode-hook nil ------------------------------------------------------------ revno: 109492 committer: Juanma Barranquero branch nick: trunk timestamp: Tue 2012-08-07 13:03:48 +0200 message: * nt/config.nt: Sync with autogen/config.nt. (BROKEN_GETWD, DISPNEW_NEEDS_STDIO_EXT): New macros. (PENDING_OUTPUT_COUNT): Move definition to inc/ms-w32.h. * nt/inc/ms-w32.h (PENDING_OUTPUT_COUNT): Define. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-08-06 20:22:22 +0000 +++ nt/ChangeLog 2012-08-07 11:03:48 +0000 @@ -1,3 +1,11 @@ +2012-08-07 Juanma Barranquero + + * config.nt: Sync with autogen/config.nt. + (BROKEN_GETWD, DISPNEW_NEEDS_STDIO_EXT): New macros. + (PENDING_OUTPUT_COUNT): Move definition to inc/ms-w32.h. + + * inc/ms-w32.h (PENDING_OUTPUT_COUNT): Define. + 2012-08-06 Glenn Morris * config.nt (GNU_LIBRARY_PENDING_OUTPUT_COUNT): Remove. === modified file 'nt/config.nt' --- nt/config.nt 2012-08-06 20:22:22 +0000 +++ nt/config.nt 2012-08-07 11:03:48 +0000 @@ -58,6 +58,9 @@ /* Define if FIONREAD should not be used. */ #undef BROKEN_FIONREAD +/* Define if getwd should not be used. */ +#undef BROKEN_GETWD + /* Define if get_current_dir_name should not be used. */ #undef BROKEN_GET_CURRENT_DIR_NAME @@ -128,6 +131,9 @@ /* Define to 1 for DGUX with . */ #undef DGUX +/* Define if dispnew.c should include stdio_ext.h. */ +#undef DISPNEW_NEEDS_STDIO_EXT + /* Define if process.c does not need to close a pty to make it a controlling terminal (it is already a controlling terminal of the subprocess, because we did ioctl TIOCSCTTY). */ @@ -1226,11 +1232,7 @@ #undef PACKAGE_VERSION /* Number of chars of output in the buffer of a stdio stream. */ -#ifdef __GNU_LIBRARY__ -#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->__bufp - (FILE)->__buffer) -#else -#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_ptr - (FILE)->_base) -#endif +#undef PENDING_OUTPUT_COUNT /* Define to empty to suppress deprecation warnings when building with --enable-gcc-warnings and with libpng versions before 1.5, which lack === modified file 'nt/inc/ms-w32.h' --- nt/inc/ms-w32.h 2012-08-03 12:16:40 +0000 +++ nt/inc/ms-w32.h 2012-08-07 11:03:48 +0000 @@ -26,6 +26,13 @@ /* #undef const */ +/* Number of chars of output in the buffer of a stdio stream. */ +#ifdef __GNU_LIBRARY__ +#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->__bufp - (FILE)->__buffer) +#else +#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_ptr - (FILE)->_base) +#endif + /* If you are compiling with a non-C calling convention but need to declare vararg routines differently, put it here. */ #define _VARARGS_ __cdecl ------------------------------------------------------------ revno: 109491 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-08-07 06:17:30 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/config.in' --- autogen/config.in 2012-08-02 10:17:32 +0000 +++ autogen/config.in 2012-08-07 10:17:30 +0000 @@ -53,6 +53,9 @@ /* Define if FIONREAD should not be used. */ #undef BROKEN_FIONREAD +/* Define if getwd should not be used. */ +#undef BROKEN_GETWD + /* Define if get_current_dir_name should not be used. */ #undef BROKEN_GET_CURRENT_DIR_NAME @@ -123,6 +126,9 @@ /* Define to 1 for DGUX with . */ #undef DGUX +/* Define if dispnew.c should include stdio_ext.h. */ +#undef DISPNEW_NEEDS_STDIO_EXT + /* Define if process.c does not need to close a pty to make it a controlling terminal (it is already a controlling terminal of the subprocess, because we did ioctl TIOCSCTTY). */ @@ -204,9 +210,6 @@ whether the gnulib module scanf shall be considered present. */ #undef GNULIB_SCANF -/* Value of PENDING_OUTPUT_COUNT if using the GNU C library. */ -#undef GNU_LIBRARY_PENDING_OUTPUT_COUNT - /* Define if ths system is compatible with GNU/Linux. */ #undef GNU_LINUX === modified file 'autogen/configure' --- autogen/configure 2012-08-05 10:19:01 +0000 +++ autogen/configure 2012-08-07 10:17:30 +0000 @@ -1326,6 +1326,7 @@ ns_frag' ac_user_opts=' enable_option_checking +enable_features with_pop with_kerberos with_kerberos5 @@ -2009,6 +2010,8 @@ --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-features omit almost all features and build small executable + with minimal dependencies --disable-ns-self-contained disable self contained build under NeXTstep --enable-locallisppath=PATH @@ -3802,6 +3805,14 @@ docdir='${datadir}/emacs/${version}/etc' gamedir='${localstatedir}/games/emacs' +# Check whether --enable-features was given. +if test "${enable_features+set}" = set; then : + enableval=$enable_features; enable_features=$enableval +else + enable_features=yes +fi + + @@ -3809,7 +3820,7 @@ if test "${with_pop+set}" = set; then : withval=$with_pop; else - with_pop=yes + with_pop=$enable_features fi if test "$with_pop" = yes; then @@ -3907,7 +3918,7 @@ if test "${with_sound+set}" = set; then : withval=$with_sound; else - with_sound=yes + with_sound=$enable_features fi @@ -3916,7 +3927,7 @@ if test "${with_sync_input+set}" = set; then : withval=$with_sync_input; else - with_sync_input=yes + with_sync_input=$enable_features fi if test "$with_sync_input" = yes; then @@ -3966,7 +3977,7 @@ if test "${with_xpm+set}" = set; then : withval=$with_xpm; else - with_xpm=yes + with_xpm=$enable_features fi @@ -3974,7 +3985,7 @@ if test "${with_jpeg+set}" = set; then : withval=$with_jpeg; else - with_jpeg=yes + with_jpeg=$enable_features fi @@ -3982,7 +3993,7 @@ if test "${with_tiff+set}" = set; then : withval=$with_tiff; else - with_tiff=yes + with_tiff=$enable_features fi @@ -3990,7 +4001,7 @@ if test "${with_gif+set}" = set; then : withval=$with_gif; else - with_gif=yes + with_gif=$enable_features fi @@ -3998,7 +4009,7 @@ if test "${with_png+set}" = set; then : withval=$with_png; else - with_png=yes + with_png=$enable_features fi @@ -4006,7 +4017,7 @@ if test "${with_rsvg+set}" = set; then : withval=$with_rsvg; else - with_rsvg=yes + with_rsvg=$enable_features fi @@ -4014,7 +4025,7 @@ if test "${with_xml2+set}" = set; then : withval=$with_xml2; else - with_xml2=yes + with_xml2=$enable_features fi @@ -4022,7 +4033,7 @@ if test "${with_imagemagick+set}" = set; then : withval=$with_imagemagick; else - with_imagemagick=yes + with_imagemagick=$enable_features fi @@ -4031,7 +4042,7 @@ if test "${with_xft+set}" = set; then : withval=$with_xft; else - with_xft=yes + with_xft=$enable_features fi @@ -4039,7 +4050,7 @@ if test "${with_libotf+set}" = set; then : withval=$with_libotf; else - with_libotf=yes + with_libotf=$enable_features fi @@ -4047,7 +4058,7 @@ if test "${with_m17n_flt+set}" = set; then : withval=$with_m17n_flt; else - with_m17n_flt=yes + with_m17n_flt=$enable_features fi @@ -4056,7 +4067,7 @@ if test "${with_toolkit_scroll_bars+set}" = set; then : withval=$with_toolkit_scroll_bars; else - with_toolkit_scroll_bars=yes + with_toolkit_scroll_bars=$enable_features fi @@ -4064,7 +4075,7 @@ if test "${with_xaw3d+set}" = set; then : withval=$with_xaw3d; else - with_xaw3d=yes + with_xaw3d=$enable_features fi @@ -4072,7 +4083,7 @@ if test "${with_xim+set}" = set; then : withval=$with_xim; else - with_xim=yes + with_xim=$enable_features fi @@ -4089,7 +4100,7 @@ if test "${with_gpm+set}" = set; then : withval=$with_gpm; else - with_gpm=yes + with_gpm=$enable_features fi @@ -4097,7 +4108,7 @@ if test "${with_dbus+set}" = set; then : withval=$with_dbus; else - with_dbus=yes + with_dbus=$enable_features fi @@ -4105,7 +4116,7 @@ if test "${with_gconf+set}" = set; then : withval=$with_gconf; else - with_gconf=yes + with_gconf=$enable_features fi @@ -4113,7 +4124,7 @@ if test "${with_gsettings+set}" = set; then : withval=$with_gsettings; else - with_gsettings=yes + with_gsettings=$enable_features fi @@ -4121,7 +4132,7 @@ if test "${with_selinux+set}" = set; then : withval=$with_selinux; else - with_selinux=yes + with_selinux=$enable_features fi @@ -4129,7 +4140,7 @@ if test "${with_gnutls+set}" = set; then : withval=$with_gnutls; else - with_gnutls=yes + with_gnutls=$enable_features fi @@ -4140,7 +4151,7 @@ if test "${with_makeinfo+set}" = set; then : withval=$with_makeinfo; else - with_makeinfo=yes + with_makeinfo=$enable_features fi @@ -4154,7 +4165,7 @@ if test "${with_compress_info+set}" = set; then : withval=$with_compress_info; else - with_compress_info=yes + with_compress_info=$enable_features fi if test $with_compress_info = yes; then @@ -13052,7 +13063,11 @@ done -if test $opsys != unixware; then +if test $opsys = unixware; then + +$as_echo "#define BROKEN_GETWD 1" >>confdefs.h + +else for ac_func in getwd do : ac_fn_c_check_func "$LINENO" "getwd" "ac_cv_func_getwd" @@ -14997,23 +15012,42 @@ - - -case $opsys in - cygwin | darwin | freebsd | netbsd | openbsd ) - $as_echo "#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)" >>confdefs.h - - ;; - - unixware) - $as_echo "#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->__ptr - (FILE)->__base)" >>confdefs.h - - ;; - - gnu | gnu-linux | gnu-kfreebsd ) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of pending output formalism" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C library" >&5 +$as_echo_n "checking whether we are using the GNU C library... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifndef __GNU_LIBRARY__ +# error "this is not the GNU C library" +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + emacs_glibc=yes +else + emacs_glibc=no +fi +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_glibc" >&5 +$as_echo "$emacs_glibc" >&6; } + +if test $emacs_glibc = yes; then + + emacs_pending_output=unknown + + case $opsys in + gnu | gnu-linux | gnu-kfreebsd ) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of pending output formalism" >&5 $as_echo_n "checking for style of pending output formalism... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -15031,8 +15065,6 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : emacs_pending_output=new -else - emacs_pending_output=unknown fi rm -f conftest.err conftest.$ac_ext @@ -15070,21 +15102,52 @@ case $emacs_pending_output in new) - $as_echo "#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)" >>confdefs.h + $as_echo "#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)" >>confdefs.h ;; uclibc) - $as_echo "#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) ((FILE)->__bufpos - (FILE)->__bufstart)" >>confdefs.h + $as_echo "#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->__bufpos - (FILE)->__bufstart)" >>confdefs.h ;; old) - $as_echo "#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) ((FILE)->_pptr - (FILE)->_pbase)" >>confdefs.h + $as_echo "#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_pptr - (FILE)->_pbase)" >>confdefs.h ;; esac ;; -esac - + esac + if test $emacs_pending_output = unknown; then + $as_echo "#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->__bufp - (FILE)->__buffer)" >>confdefs.h + + fi + +else + case $opsys in + cygwin | darwin | freebsd | netbsd | openbsd ) + $as_echo "#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)" >>confdefs.h + + ;; + + unixware) + $as_echo "#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->__ptr - (FILE)->__base)" >>confdefs.h + + ;; + + *) + if test x$ac_cv_header_stdio_ext_h = xyes && \ + test x$ac_cv_func___fpending = xyes; then + $as_echo "#define PENDING_OUTPUT_COUNT(FILE) __fpending (FILE)" >>confdefs.h + + +$as_echo "#define DISPNEW_NEEDS_STDIO_EXT 1" >>confdefs.h + + else + $as_echo "#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_ptr - (FILE)->_base)" >>confdefs.h + + fi + ;; + esac +fi ------------------------------------------------------------ revno: 109490 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-08-07 11:42:34 +0400 message: Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process. * process.h (PGET): Remove. (struct Lisp_Process): Do not use INTERNAL_FIELD. * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-07 07:33:18 +0000 +++ src/ChangeLog 2012-08-07 07:42:34 +0000 @@ -1,5 +1,12 @@ 2012-08-07 Dmitry Antipov + Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process. + * process.h (PGET): Remove. + (struct Lisp_Process): Do not use INTERNAL_FIELD. + * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users. + +2012-08-07 Dmitry Antipov + Drop WGET and revert read access to Lisp_Objects slots of struct window. * window.h (WGET): Remove. (struct window): Do not use INTERNAL_FIELD. === modified file 'src/print.c' --- src/print.c 2012-08-07 07:33:18 +0000 +++ src/print.c 2012-08-07 07:42:34 +0000 @@ -1697,11 +1697,11 @@ if (escapeflag) { strout ("#name, printcharfun); PRINTCHAR ('>'); } else - print_string (PGET (XPROCESS (obj), name), printcharfun); + print_string (XPROCESS (obj)->name, printcharfun); } else if (BOOL_VECTOR_P (obj)) { === modified file 'src/process.c' --- src/process.c 2012-08-06 11:16:07 +0000 +++ src/process.c 2012-08-07 07:42:34 +0000 @@ -172,10 +172,10 @@ /* QCfilter is defined in keyboard.c. */ extern Lisp_Object QCfilter; -#define NETCONN_P(p) (EQ (PGET (XPROCESS (p), type), Qnetwork)) -#define NETCONN1_P(p) (EQ (PGET (p, type), Qnetwork)) -#define SERIALCONN_P(p) (EQ (PGET (XPROCESS (p), type), Qserial)) -#define SERIALCONN1_P(p) (EQ (PGET (p, type), Qserial)) +#define NETCONN_P(p) (EQ (XPROCESS (p)->type, Qnetwork)) +#define NETCONN1_P(p) (EQ (p->type, Qnetwork)) +#define SERIALCONN_P(p) (EQ (XPROCESS (p)->type, Qserial)) +#define SERIALCONN1_P(p) (EQ (p->type, Qserial)) #ifndef HAVE_H_ERRNO extern int h_errno; @@ -479,7 +479,7 @@ static Lisp_Object status_message (struct Lisp_Process *p) { - Lisp_Object status = PGET (p, status); + Lisp_Object status = p->status; Lisp_Object symbol; int code, coredump; Lisp_Object string, string2; @@ -763,9 +763,9 @@ /* If the process has already signaled, remove it from the list. */ if (p->raw_status_new) update_status (p); - symbol = PGET (p, status); - if (CONSP (PGET (p, status))) - symbol = XCAR (PGET (p, status)); + symbol = p->status; + if (CONSP (p->status)) + symbol = XCAR (p->status); if (EQ (symbol, Qsignal) || EQ (symbol, Qexit)) deleted_pid_list = Fdelete (make_fixnum_or_float (pid), deleted_pid_list); @@ -815,14 +815,14 @@ p = XPROCESS (process); if (p->raw_status_new) update_status (p); - status = PGET (p, status); + status = p->status; if (CONSP (status)) status = XCAR (status); if (NETCONN1_P (p) || SERIALCONN1_P (p)) { if (EQ (status, Qexit)) status = Qclosed; - else if (EQ (PGET (p, command), Qt)) + else if (EQ (p->command, Qt)) status = Qstop; else if (EQ (status, Qrun)) status = Qopen; @@ -839,8 +839,8 @@ CHECK_PROCESS (process); if (XPROCESS (process)->raw_status_new) update_status (XPROCESS (process)); - if (CONSP (PGET (XPROCESS (process), status))) - return XCAR (XCDR (PGET (XPROCESS (process), status))); + if (CONSP (XPROCESS (process)->status)) + return XCAR (XCDR (XPROCESS (process)->status)); return make_number (0); } @@ -864,7 +864,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return PGET (XPROCESS (process), name); + return XPROCESS (process)->name; } DEFUN ("process-command", Fprocess_command, Sprocess_command, 1, 1, 0, @@ -876,7 +876,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return PGET (XPROCESS (process), command); + return XPROCESS (process)->command; } DEFUN ("process-tty-name", Fprocess_tty_name, Sprocess_tty_name, 1, 1, 0, @@ -886,7 +886,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return PGET (XPROCESS (process), tty_name); + return XPROCESS (process)->tty_name; } DEFUN ("set-process-buffer", Fset_process_buffer, Sset_process_buffer, @@ -903,7 +903,7 @@ p = XPROCESS (process); PSET (p, buffer, buffer); if (NETCONN1_P (p) || SERIALCONN1_P (p)) - PSET (p, childp, Fplist_put (PGET (p, childp), QCbuffer, buffer)); + PSET (p, childp, Fplist_put (p->childp, QCbuffer, buffer)); setup_process_coding_systems (process); return buffer; } @@ -915,7 +915,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return PGET (XPROCESS (process), buffer); + return XPROCESS (process)->buffer; } DEFUN ("process-mark", Fprocess_mark, Sprocess_mark, @@ -924,7 +924,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return PGET (XPROCESS (process), mark); + return XPROCESS (process)->mark; } DEFUN ("set-process-filter", Fset_process_filter, Sset_process_filter, @@ -960,14 +960,14 @@ if (p->infd >= 0) { - if (EQ (filter, Qt) && !EQ (PGET (p, status), Qlisten)) + if (EQ (filter, Qt) && !EQ (p->status, Qlisten)) { FD_CLR (p->infd, &input_wait_mask); FD_CLR (p->infd, &non_keyboard_wait_mask); } - else if (EQ (PGET (p, filter), Qt) + else if (EQ (p->filter, Qt) /* Network or serial process not stopped: */ - && !EQ (PGET (p, command), Qt)) + && !EQ (p->command, Qt)) { FD_SET (p->infd, &input_wait_mask); FD_SET (p->infd, &non_keyboard_wait_mask); @@ -976,7 +976,7 @@ PSET (p, filter, filter); if (NETCONN1_P (p) || SERIALCONN1_P (p)) - PSET (p, childp, Fplist_put (PGET (p, childp), QCfilter, filter)); + PSET (p, childp, Fplist_put (p->childp, QCfilter, filter)); setup_process_coding_systems (process); return filter; } @@ -988,7 +988,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return PGET (XPROCESS (process), filter); + return XPROCESS (process)->filter; } DEFUN ("set-process-sentinel", Fset_process_sentinel, Sset_process_sentinel, @@ -1005,7 +1005,7 @@ PSET (p, sentinel, sentinel); if (NETCONN1_P (p) || SERIALCONN1_P (p)) - PSET (p, childp, Fplist_put (PGET (p, childp), QCsentinel, sentinel)); + PSET (p, childp, Fplist_put (p->childp, QCsentinel, sentinel)); return sentinel; } @@ -1016,7 +1016,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return PGET (XPROCESS (process), sentinel); + return XPROCESS (process)->sentinel; } DEFUN ("set-process-window-size", Fset_process_window_size, @@ -1101,7 +1101,7 @@ Lisp_Object contact; CHECK_PROCESS (process); - contact = PGET (XPROCESS (process), childp); + contact = XPROCESS (process)->childp; #ifdef DATAGRAM_SOCKETS if (DATAGRAM_CONN_P (process) @@ -1127,7 +1127,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return PGET (XPROCESS (process), plist); + return XPROCESS (process)->plist; } DEFUN ("set-process-plist", Fset_process_plist, Sset_process_plist, @@ -1150,7 +1150,7 @@ a socket connection. */) (Lisp_Object process) { - return PGET (XPROCESS (process), type); + return XPROCESS (process)->type; } #endif @@ -1163,7 +1163,7 @@ { Lisp_Object proc; proc = get_process (process); - return PGET (XPROCESS (proc), type); + return XPROCESS (proc)->type; } DEFUN ("format-network-address", Fformat_network_address, Sformat_network_address, @@ -1346,7 +1346,7 @@ /* Make the process marker point into the process buffer (if any). */ if (BUFFERP (buffer)) - set_marker_both (PGET (XPROCESS (proc), mark), buffer, + set_marker_both (XPROCESS (proc)->mark, buffer, BUF_ZV (XBUFFER (buffer)), BUF_ZV_BYTE (XBUFFER (buffer))); @@ -1464,7 +1464,7 @@ { if (NILP (arg_encoding)) arg_encoding = (complement_process_encoding_system - (PGET (XPROCESS (proc), encode_coding_system))); + (XPROCESS (proc)->encode_coding_system)); XSETCAR (tem, code_convert_string_norecord (XCAR (tem), arg_encoding, 1)); @@ -2368,7 +2368,7 @@ if (set_socket_option (s, option, value)) { - PSET (p, childp, Fplist_put (PGET (p, childp), option, value)); + PSET (p, childp, Fplist_put (p->childp, option, value)); return Qt; } @@ -2457,10 +2457,10 @@ proc = Fplist_get (contact, QCport); proc = get_process (proc); p = XPROCESS (proc); - if (!EQ (PGET (p, type), Qserial)) + if (!EQ (p->type, Qserial)) error ("Not a serial process"); - if (NILP (Fplist_get (PGET (p, childp), QCspeed))) + if (NILP (Fplist_get (p->childp, QCspeed))) { UNGCPRO; return Qnil; @@ -2615,7 +2615,7 @@ PSET (p, command, Qt); p->pty_flag = 0; - if (!EQ (PGET (p, command), Qt)) + if (!EQ (p->command, Qt)) { FD_SET (fd, &input_wait_mask); FD_SET (fd, &non_keyboard_wait_mask); @@ -2623,7 +2623,7 @@ if (BUFFERP (buffer)) { - set_marker_both (PGET (p, mark), buffer, + set_marker_both (p->mark, buffer, BUF_ZV (XBUFFER (buffer)), BUF_ZV_BYTE (XBUFFER (buffer))); } @@ -3420,7 +3420,7 @@ /* Make the process marker point into the process buffer (if any). */ if (BUFFERP (buffer)) - set_marker_both (PGET (p, mark), buffer, + set_marker_both (p->mark, buffer, BUF_ZV (XBUFFER (buffer)), BUF_ZV_BYTE (XBUFFER (buffer))); @@ -3442,8 +3442,8 @@ #endif /* A server may have a client filter setting of Qt, but it must still listen for incoming connects unless it is stopped. */ - if ((!EQ (PGET (p, filter), Qt) && !EQ (PGET (p, command), Qt)) - || (EQ (PGET (p, status), Qlisten) && NILP (PGET (p, command)))) + if ((!EQ (p->filter, Qt) && !EQ (p->command, Qt)) + || (EQ (p->status, Qlisten) && NILP (p->command))) { FD_SET (inch, &input_wait_mask); FD_SET (inch, &non_keyboard_wait_mask); @@ -4030,8 +4030,8 @@ return; #endif - if (!NILP (PGET (ps, log))) - call3 (PGET (ps, log), server, Qnil, + if (!NILP (ps->log)) + call3 (ps->log, server, Qnil, concat3 (build_string ("accept failed with code"), Fnumber_to_string (make_number (code)), build_string ("\n"))); @@ -4101,15 +4101,15 @@ process name of the server process concatenated with the caller identification. */ - if (!NILP (PGET (ps, filter)) && !EQ (PGET (ps, filter), Qt)) + if (!NILP (ps->filter) && !EQ (ps->filter, Qt)) buffer = Qnil; else { - buffer = PGET (ps, buffer); + buffer = ps->buffer; if (!NILP (buffer)) buffer = Fbuffer_name (buffer); else - buffer = PGET (ps, name); + buffer = ps->name; if (!NILP (buffer)) { buffer = concat2 (buffer, caller); @@ -4120,7 +4120,7 @@ /* Generate a unique name for the new server process. Combine the server process name with the caller identification. */ - name = concat2 (PGET (ps, name), caller); + name = concat2 (ps->name, caller); proc = make_process (name); chan_process[s] = proc; @@ -4136,7 +4136,7 @@ p = XPROCESS (proc); /* Build new contact information for this setup. */ - contact = Fcopy_sequence (PGET (ps, childp)); + contact = Fcopy_sequence (ps->childp); contact = Fplist_put (contact, QCserver, Qnil); contact = Fplist_put (contact, QChost, host); if (!NILP (service)) @@ -4151,12 +4151,12 @@ #endif PSET (p, childp, contact); - PSET (p, plist, Fcopy_sequence (PGET (ps, plist))); + PSET (p, plist, Fcopy_sequence (ps->plist)); PSET (p, type, Qnetwork); PSET (p, buffer, buffer); - PSET (p, sentinel, PGET (ps, sentinel)); - PSET (p, filter, PGET (ps, filter)); + PSET (p, sentinel, ps->sentinel); + PSET (p, filter, ps->filter); PSET (p, command, Qnil); p->pid = 0; p->infd = s; @@ -4164,7 +4164,7 @@ PSET (p, status, Qrun); /* Client processes for accepted connections are not stopped initially. */ - if (!EQ (PGET (p, filter), Qt)) + if (!EQ (p->filter, Qt)) { FD_SET (s, &input_wait_mask); FD_SET (s, &non_keyboard_wait_mask); @@ -4178,8 +4178,8 @@ of the new process should reflect the settings at the time the server socket was opened; not the current settings. */ - PSET (p, decode_coding_system, PGET (ps, decode_coding_system)); - PSET (p, encode_coding_system, PGET (ps, encode_coding_system)); + PSET (p, decode_coding_system, ps->decode_coding_system); + PSET (p, encode_coding_system, ps->encode_coding_system); setup_process_coding_systems (proc); PSET (p, decoding_buf, empty_unibyte_string); @@ -4189,13 +4189,13 @@ p->inherit_coding_system_flag = (NILP (buffer) ? 0 : ps->inherit_coding_system_flag); - if (!NILP (PGET (ps, log))) - call3 (PGET (ps, log), server, proc, + if (!NILP (ps->log)) + call3 (ps->log, server, proc, concat3 (build_string ("accept from "), (STRINGP (host) ? host : build_string ("-")), build_string ("\n"))); - if (!NILP (PGET (p, sentinel))) + if (!NILP (p->sentinel)) exec_sentinel (proc, concat3 (build_string ("open from "), (STRINGP (host) ? host : build_string ("-")), @@ -4286,8 +4286,8 @@ FD_ZERO (&Writeok); if (time_limit == 0 && nsecs == 0 && wait_proc && !NILP (Vinhibit_quit) - && !(CONSP (PGET (wait_proc, status)) - && EQ (XCAR (PGET (wait_proc, status)), Qexit))) + && !(CONSP (wait_proc->status) + && EQ (XCAR (wait_proc->status), Qexit))) message ("Blocking call to accept-process-output with quit inhibited!!"); /* If wait_proc is a process to watch, set wait_channel accordingly. */ @@ -4460,8 +4460,8 @@ if (wait_proc && wait_proc->raw_status_new) update_status (wait_proc); if (wait_proc - && ! EQ (PGET (wait_proc, status), Qrun) - && ! EQ (PGET (wait_proc, status), Qconnect)) + && ! EQ (wait_proc->status, Qrun) + && ! EQ (wait_proc->status, Qconnect)) { int nread, total_nread = 0; @@ -4820,7 +4820,7 @@ continue; /* If this is a server stream socket, accept connection. */ - if (EQ (PGET (XPROCESS (proc), status), Qlisten)) + if (EQ (XPROCESS (proc)->status, Qlisten)) { server_accept_connection (proc, channel); continue; @@ -4908,7 +4908,7 @@ deactivate_process (proc); if (XPROCESS (proc)->raw_status_new) update_status (XPROCESS (proc)); - if (EQ (PGET (XPROCESS (proc), status), Qrun)) + if (EQ (XPROCESS (proc)->status, Qrun)) PSET (XPROCESS (proc), status, Fcons (Qexit, Fcons (make_number (256), Qnil))); } @@ -4969,7 +4969,7 @@ status_notify to do it later, it will read input from the process before calling the sentinel. */ exec_sentinel (proc, build_string ("open\n")); - if (!EQ (PGET (p, filter), Qt) && !EQ (PGET (p, command), Qt)) + if (!EQ (p->filter, Qt) && !EQ (p->command, Qt)) { FD_SET (p->infd, &input_wait_mask); FD_SET (p->infd, &non_keyboard_wait_mask); @@ -5041,7 +5041,7 @@ chars = alloca (carryover + readmax); if (carryover) /* See the comment above. */ - memcpy (chars, SDATA (PGET (p, decoding_buf)), carryover); + memcpy (chars, SDATA (p->decoding_buf), carryover); #ifdef DATAGRAM_SOCKETS /* We have a working select, so proc_buffered_char is always -1. */ @@ -5120,7 +5120,7 @@ record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); /* Read and dispose of the process output. */ - outstream = PGET (p, filter); + outstream = p->filter; if (!NILP (outstream)) { Lisp_Object text; @@ -5162,7 +5162,7 @@ text = coding->dst_object; Vlast_coding_system_used = CODING_ID_NAME (coding->id); /* A new coding system might be found. */ - if (!EQ (PGET (p, decode_coding_system), Vlast_coding_system_used)) + if (!EQ (p->decode_coding_system, Vlast_coding_system_used)) { PSET (p, decode_coding_system, Vlast_coding_system_used); @@ -5177,21 +5177,21 @@ proc_encode_coding_system[p->outfd] surely points to a valid memory because p->outfd will be changed once EOF is sent to the process. */ - if (NILP (PGET (p, encode_coding_system)) + if (NILP (p->encode_coding_system) && proc_encode_coding_system[p->outfd]) { PSET (p, encode_coding_system, - coding_inherit_eol_type (Vlast_coding_system_used, Qnil)); - setup_coding_system (PGET (p, encode_coding_system), + coding_inherit_eol_type (Vlast_coding_system_used, Qnil)); + setup_coding_system (p->encode_coding_system, proc_encode_coding_system[p->outfd]); } } if (coding->carryover_bytes > 0) { - if (SCHARS (PGET (p, decoding_buf)) < coding->carryover_bytes) + if (SCHARS (p->decoding_buf) < coding->carryover_bytes) PSET (p, decoding_buf, make_uninit_string (coding->carryover_bytes)); - memcpy (SDATA (PGET (p, decoding_buf)), coding->carryover, + memcpy (SDATA (p->decoding_buf), coding->carryover, coding->carryover_bytes); p->decoding_carryover = coding->carryover_bytes; } @@ -5227,7 +5227,7 @@ } /* If no filter, write into buffer if it isn't dead. */ - else if (!NILP (PGET (p, buffer)) && !NILP (BVAR (XBUFFER (PGET (p, buffer)), name))) + else if (!NILP (p->buffer) && !NILP (BVAR (XBUFFER (p->buffer), name))) { Lisp_Object old_read_only; ptrdiff_t old_begv, old_zv; @@ -5237,7 +5237,7 @@ Lisp_Object text; struct buffer *b; - Fset_buffer (PGET (p, buffer)); + Fset_buffer (p->buffer); opoint = PT; opoint_byte = PT_BYTE; old_read_only = BVAR (current_buffer, read_only); @@ -5251,11 +5251,11 @@ /* Insert new output into buffer at the current end-of-output marker, thus preserving logical ordering of input and output. */ - if (XMARKER (PGET (p, mark))->buffer) + if (XMARKER (p->mark)->buffer) SET_PT_BOTH (clip_to_bounds (BEGV, - marker_position (PGET (p, mark)), ZV), + marker_position (p->mark), ZV), clip_to_bounds (BEGV_BYTE, - marker_byte_position (PGET (p, mark)), + marker_byte_position (p->mark), ZV_BYTE)); else SET_PT_BOTH (ZV, ZV_BYTE); @@ -5272,23 +5272,23 @@ Vlast_coding_system_used = CODING_ID_NAME (coding->id); /* A new coding system might be found. See the comment in the similar code in the previous `if' block. */ - if (!EQ (PGET (p, decode_coding_system), Vlast_coding_system_used)) + if (!EQ (p->decode_coding_system, Vlast_coding_system_used)) { PSET (p, decode_coding_system, Vlast_coding_system_used); - if (NILP (PGET (p, encode_coding_system)) + if (NILP (p->encode_coding_system) && proc_encode_coding_system[p->outfd]) { PSET (p, encode_coding_system, - coding_inherit_eol_type (Vlast_coding_system_used, Qnil)); - setup_coding_system (PGET (p, encode_coding_system), + coding_inherit_eol_type (Vlast_coding_system_used, Qnil)); + setup_coding_system (p->encode_coding_system, proc_encode_coding_system[p->outfd]); } } if (coding->carryover_bytes > 0) { - if (SCHARS (PGET (p, decoding_buf)) < coding->carryover_bytes) + if (SCHARS (p->decoding_buf) < coding->carryover_bytes) PSET (p, decoding_buf, make_uninit_string (coding->carryover_bytes)); - memcpy (SDATA (PGET (p, decoding_buf)), coding->carryover, + memcpy (SDATA (p->decoding_buf), coding->carryover, coding->carryover_bytes); p->decoding_carryover = coding->carryover_bytes; } @@ -5306,11 +5306,11 @@ /* Make sure the process marker's position is valid when the process buffer is changed in the signal_after_change above. W3 is known to do that. */ - if (BUFFERP (PGET (p, buffer)) - && (b = XBUFFER (PGET (p, buffer)), b != current_buffer)) - set_marker_both (PGET (p, mark), PGET (p, buffer), BUF_PT (b), BUF_PT_BYTE (b)); + if (BUFFERP (p->buffer) + && (b = XBUFFER (p->buffer), b != current_buffer)) + set_marker_both (p->mark, p->buffer, BUF_PT (b), BUF_PT_BYTE (b)); else - set_marker_both (PGET (p, mark), PGET (p, buffer), PT, PT_BYTE); + set_marker_both (p->mark, p->buffer, PT, PT_BYTE); update_mode_lines++; @@ -5404,9 +5404,9 @@ entry = Fcons (obj, Fcons (make_number (offset), make_number (len))); if (front) - PSET (p, write_queue, Fcons (entry, PGET (p, write_queue))); + PSET (p, write_queue, Fcons (entry, p->write_queue)); else - PSET (p, write_queue, nconc2 (PGET (p, write_queue), Fcons (entry, Qnil))); + PSET (p, write_queue, nconc2 (p->write_queue, Fcons (entry, Qnil))); } /* Remove the first element in the write_queue of process P, put its @@ -5420,11 +5420,11 @@ Lisp_Object entry, offset_length; ptrdiff_t offset; - if (NILP (PGET (p, write_queue))) + if (NILP (p->write_queue)) return 0; - entry = XCAR (PGET (p, write_queue)); - PSET (p, write_queue, XCDR (PGET (p, write_queue))); + entry = XCAR (p->write_queue); + PSET (p, write_queue, XCDR (p->write_queue)); *obj = XCAR (entry); offset_length = XCDR (entry); @@ -5458,10 +5458,10 @@ if (p->raw_status_new) update_status (p); - if (! EQ (PGET (p, status), Qrun)) - error ("Process %s not running", SDATA (PGET (p, name))); + if (! EQ (p->status, Qrun)) + error ("Process %s not running", SDATA (p->name)); if (p->outfd < 0) - error ("Output file descriptor of %s is closed", SDATA (PGET (p, name))); + error ("Output file descriptor of %s is closed", SDATA (p->name)); coding = proc_encode_coding_system[p->outfd]; Vlast_coding_system_used = CODING_ID_NAME (coding->id); @@ -5472,8 +5472,8 @@ || EQ (object, Qt)) { PSET (p, encode_coding_system, - complement_process_encoding_system (PGET (p, encode_coding_system))); - if (!EQ (Vlast_coding_system_used, PGET (p, encode_coding_system))) + complement_process_encoding_system (p->encode_coding_system)); + if (!EQ (Vlast_coding_system_used, p->encode_coding_system)) { /* The coding system for encoding was changed to raw-text because we sent a unibyte text previously. Now we are @@ -5483,8 +5483,8 @@ Another reason we come here is that the coding system was just complemented and a new one was returned by complement_process_encoding_system. */ - setup_coding_system (PGET (p, encode_coding_system), coding); - Vlast_coding_system_used = PGET (p, encode_coding_system); + setup_coding_system (p->encode_coding_system, coding); + Vlast_coding_system_used = p->encode_coding_system; } coding->src_multibyte = 1; } @@ -5571,7 +5571,7 @@ /* If there is already data in the write_queue, put the new data in the back of queue. Otherwise, ignore it. */ - if (!NILP (PGET (p, write_queue))) + if (!NILP (p->write_queue)) write_queue_push (p, object, buf, len, 0); do /* while !NILP (p->write_queue) */ @@ -5685,7 +5685,7 @@ cur_len -= written; } } - while (!NILP (PGET (p, write_queue))); + while (!NILP (p->write_queue)); } else { @@ -5696,7 +5696,7 @@ PSET (p, status, Fcons (Qexit, Fcons (make_number (256), Qnil))); p->tick = ++process_tick; deactivate_process (proc); - error ("SIGPIPE raised on process %s; closed it", SDATA (PGET (p, name))); + error ("SIGPIPE raised on process %s; closed it", SDATA (p->name)); } } @@ -5754,12 +5754,12 @@ pid_t gid = -1; #ifdef TIOCGPGRP - if (ioctl (p->infd, TIOCGPGRP, &gid) == -1 && ! NILP (PGET (p, tty_name))) + if (ioctl (p->infd, TIOCGPGRP, &gid) == -1 && ! NILP (p->tty_name)) { int fd; /* Some OS:es (Solaris 8/9) does not allow TIOCGPGRP from the master side. Try the slave side. */ - fd = emacs_open (SSDATA (PGET (p, tty_name)), O_RDONLY, 0); + fd = emacs_open (SSDATA (p->tty_name), O_RDONLY, 0); if (fd != -1) { @@ -5788,12 +5788,12 @@ proc = get_process (process); p = XPROCESS (proc); - if (!EQ (PGET (p, type), Qreal)) + if (!EQ (p->type, Qreal)) error ("Process %s is not a subprocess", - SDATA (PGET (p, name))); + SDATA (p->name)); if (p->infd < 0) error ("Process %s is not active", - SDATA (PGET (p, name))); + SDATA (p->name)); gid = emacs_get_tty_pgrp (p); @@ -5828,12 +5828,12 @@ proc = get_process (process); p = XPROCESS (proc); - if (!EQ (PGET (p, type), Qreal)) + if (!EQ (p->type, Qreal)) error ("Process %s is not a subprocess", - SDATA (PGET (p, name))); + SDATA (p->name)); if (p->infd < 0) error ("Process %s is not active", - SDATA (PGET (p, name))); + SDATA (p->name)); if (!p->pty_flag) current_group = Qnil; @@ -6012,7 +6012,7 @@ struct Lisp_Process *p; p = XPROCESS (process); - if (NILP (PGET (p, command)) + if (NILP (p->command) && p->infd >= 0) { FD_CLR (p->infd, &input_wait_mask); @@ -6041,9 +6041,9 @@ struct Lisp_Process *p; p = XPROCESS (process); - if (EQ (PGET (p, command), Qt) + if (EQ (p->command, Qt) && p->infd >= 0 - && (!EQ (PGET (p, filter), Qt) || EQ (PGET (p, status), Qlisten))) + && (!EQ (p->filter, Qt) || EQ (p->status, Qlisten))) { FD_SET (p->infd, &input_wait_mask); FD_SET (p->infd, &non_keyboard_wait_mask); @@ -6101,8 +6101,7 @@ CHECK_PROCESS (process); pid = XPROCESS (process)->pid; if (pid <= 0) - error ("Cannot signal process %s", - SDATA (PGET (XPROCESS (process), name))); + error ("Cannot signal process %s", SDATA (XPROCESS (process)->name)); } #define parse_signal(NAME, VALUE) \ @@ -6246,8 +6245,8 @@ /* Make sure the process is really alive. */ if (XPROCESS (proc)->raw_status_new) update_status (XPROCESS (proc)); - if (! EQ (PGET (XPROCESS (proc), status), Qrun)) - error ("Process %s not running", SDATA (PGET (XPROCESS (proc), name))); + if (! EQ (XPROCESS (proc)->status, Qrun)) + error ("Process %s not running", SDATA (XPROCESS (proc)->name)); if (CODING_REQUIRE_FLUSHING (coding)) { @@ -6257,7 +6256,7 @@ if (XPROCESS (proc)->pty_flag) send_process (proc, "\004", 1, Qnil); - else if (EQ (PGET (XPROCESS (proc), type), Qserial)) + else if (EQ (XPROCESS (proc)->type, Qserial)) { #ifndef WINDOWSNT if (tcdrain (XPROCESS (proc)->outfd) != 0) @@ -6274,7 +6273,7 @@ for communication with the subprocess, call shutdown to cause EOF. (In some old system, shutdown to socketpair doesn't work. Then we just can't win.) */ - if (EQ (PGET (XPROCESS (proc), type), Qnetwork) + if (EQ (XPROCESS (proc)->type, Qnetwork) || XPROCESS (proc)->outfd == XPROCESS (proc)->infd) shutdown (XPROCESS (proc)->outfd, 1); /* In case of socketpair, outfd == infd, so don't close it. */ @@ -6387,7 +6386,7 @@ { proc = XCDR (XCAR (tail)); p = XPROCESS (proc); - if (EQ (PGET (p, type), Qreal) && p->pid == pid) + if (EQ (p->type, Qreal) && p->pid == pid) break; p = 0; } @@ -6511,7 +6510,7 @@ friends don't expect current-buffer to be changed from under them. */ record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); - sentinel = PGET (p, sentinel); + sentinel = p->sentinel; if (NILP (sentinel)) return; @@ -6605,16 +6604,16 @@ p->update_tick = p->tick; /* If process is still active, read any output that remains. */ - while (! EQ (PGET (p, filter), Qt) - && ! EQ (PGET (p, status), Qconnect) - && ! EQ (PGET (p, status), Qlisten) + while (! EQ (p->filter, Qt) + && ! EQ (p->status, Qconnect) + && ! EQ (p->status, Qlisten) /* Network or serial process not stopped: */ - && ! EQ (PGET (p, command), Qt) + && ! EQ (p->command, Qt) && p->infd >= 0 && p != deleting_process && read_process_output (proc, p->infd) > 0); - buffer = PGET (p, buffer); + buffer = p->buffer; /* Get the text to use for the message. */ if (p->raw_status_new) @@ -6622,9 +6621,9 @@ msg = status_message (p); /* If process is terminated, deactivate it or delete it. */ - symbol = PGET (p, status); - if (CONSP (PGET (p, status))) - symbol = XCAR (PGET (p, status)); + symbol = p->status; + if (CONSP (p->status)) + symbol = XCAR (p->status); if (EQ (symbol, Qsignal) || EQ (symbol, Qexit) || EQ (symbol, Qclosed)) @@ -6641,7 +6640,7 @@ this code to be run again. */ p->update_tick = p->tick; /* Now output the message suitably. */ - if (!NILP (PGET (p, sentinel))) + if (!NILP (p->sentinel)) exec_sentinel (proc, msg); /* Don't bother with a message in the buffer when a process becomes runnable. */ @@ -6663,8 +6662,8 @@ /* Insert new output into buffer at the current end-of-output marker, thus preserving logical ordering of input and output. */ - if (XMARKER (PGET (p, mark))->buffer) - Fgoto_char (PGET (p, mark)); + if (XMARKER (p->mark)->buffer) + Fgoto_char (p->mark); else SET_PT_BOTH (ZV, ZV_BYTE); @@ -6675,11 +6674,11 @@ BVAR (current_buffer, read_only) = Qnil; insert_string ("\nProcess "); { /* FIXME: temporary kludge */ - Lisp_Object tem2 = PGET (p, name); Finsert (1, &tem2); } + Lisp_Object tem2 = p->name; Finsert (1, &tem2); } insert_string (" "); Finsert (1, &msg); BVAR (current_buffer, read_only) = tem; - set_marker_both (PGET (p, mark), PGET (p, buffer), PT, PT_BYTE); + set_marker_both (p->mark, p->buffer, PT, PT_BYTE); if (opoint >= before) SET_PT_BOTH (opoint + (PT - before), @@ -6709,9 +6708,9 @@ CHECK_PROCESS (process); p = XPROCESS (process); if (p->infd < 0) - error ("Input file descriptor of %s closed", SDATA (PGET (p, name))); + error ("Input file descriptor of %s closed", SDATA (p->name)); if (p->outfd < 0) - error ("Output file descriptor of %s closed", SDATA (PGET (p, name))); + error ("Output file descriptor of %s closed", SDATA (p->name)); Fcheck_coding_system (decoding); Fcheck_coding_system (encoding); encoding = coding_inherit_eol_type (encoding, Qnil); @@ -6728,8 +6727,8 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return Fcons (PGET (XPROCESS (process), decode_coding_system), - PGET (XPROCESS (process), encode_coding_system)); + return Fcons (XPROCESS (process)->decode_coding_system, + XPROCESS (process)->encode_coding_system); } DEFUN ("set-process-filter-multibyte", Fset_process_filter_multibyte, @@ -6747,7 +6746,7 @@ p = XPROCESS (process); if (NILP (flag)) PSET (p, decode_coding_system, - raw_text_coding_system (PGET (p, decode_coding_system))); + raw_text_coding_system (p->decode_coding_system)); setup_process_coding_systems (process); return Qnil; @@ -7085,19 +7084,19 @@ if (!proc_decode_coding_system[inch]) proc_decode_coding_system[inch] = xmalloc (sizeof (struct coding_system)); - coding_system = PGET (p, decode_coding_system); - if (! NILP (PGET (p, filter))) + coding_system = p->decode_coding_system; + if (! NILP (p->filter)) ; - else if (BUFFERP (PGET (p, buffer))) + else if (BUFFERP (p->buffer)) { - if (NILP (BVAR (XBUFFER (PGET (p, buffer)), enable_multibyte_characters))) + if (NILP (BVAR (XBUFFER (p->buffer), enable_multibyte_characters))) coding_system = raw_text_coding_system (coding_system); } setup_coding_system (coding_system, proc_decode_coding_system[inch]); if (!proc_encode_coding_system[outch]) proc_encode_coding_system[outch] = xmalloc (sizeof (struct coding_system)); - setup_coding_system (PGET (p, encode_coding_system), + setup_coding_system (p->encode_coding_system, proc_encode_coding_system[outch]); #endif } @@ -7143,7 +7142,7 @@ for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail)) { proc = Fcdr (XCAR (tail)); - if (PROCESSP (proc) && EQ (PGET (XPROCESS (proc), buffer), buf)) + if (PROCESSP (proc) && EQ (XPROCESS (proc)->buffer, buf)) return proc; } #endif /* subprocesses */ @@ -7182,7 +7181,7 @@ { proc = XCDR (XCAR (tail)); if (PROCESSP (proc) - && (NILP (buffer) || EQ (PGET (XPROCESS (proc), buffer), buffer))) + && (NILP (buffer) || EQ (XPROCESS (proc)->buffer, buffer))) { if (NETCONN_P (proc) || SERIALCONN_P (proc)) Fdelete_process (proc); === modified file 'src/process.h' --- src/process.h 2012-08-06 11:16:07 +0000 +++ src/process.h 2012-08-07 07:42:34 +0000 @@ -26,15 +26,10 @@ #include "gnutls.h" #endif -/* Most code should use these macros to access Lisp fields in - struct Lisp_Process. PGET should not be used as lvalue. */ - -#define PGET(p, field) \ - (eassert (offsetof (struct Lisp_Process, field ## _) \ - < offsetof (struct Lisp_Process, pid)), \ - ((p)->INTERNAL_FIELD (field))) - -#define PSET(p, field, value) ((p)->INTERNAL_FIELD (field) = (value)) +/* Most code should use these macros to set + Lisp fields in struct Lisp_Process. */ + +#define PSET(p, field, value) ((p)->field = (value)) /* This structure records information about a subprocess or network connection. */ @@ -44,68 +39,68 @@ struct vectorlike_header header; /* Name of subprocess terminal. */ - Lisp_Object INTERNAL_FIELD (tty_name); + Lisp_Object tty_name; /* Name of this process */ - Lisp_Object INTERNAL_FIELD (name); + Lisp_Object name; /* List of command arguments that this process was run with. Is set to t for a stopped network process; nil otherwise. */ - Lisp_Object INTERNAL_FIELD (command); + Lisp_Object command; /* (funcall FILTER PROC STRING) (if FILTER is non-nil) to dispose of a bunch of chars from the process all at once */ - Lisp_Object INTERNAL_FIELD (filter); + Lisp_Object filter; /* (funcall SENTINEL PROCESS) when process state changes */ - Lisp_Object INTERNAL_FIELD (sentinel); + Lisp_Object sentinel; /* (funcall LOG SERVER CLIENT MESSAGE) when a server process accepts a connection from a client. */ - Lisp_Object INTERNAL_FIELD (log); + Lisp_Object log; /* Buffer that output is going to */ - Lisp_Object INTERNAL_FIELD (buffer); + Lisp_Object buffer; /* t if this is a real child process. For a network or serial connection, it is a plist based on the arguments to make-network-process or make-serial-process. */ - Lisp_Object INTERNAL_FIELD (childp); + Lisp_Object childp; /* Plist for programs to keep per-process state information, parameters, etc. */ - Lisp_Object INTERNAL_FIELD (plist); + Lisp_Object plist; /* Symbol indicating the type of process: real, network, serial */ - Lisp_Object INTERNAL_FIELD (type); + Lisp_Object type; /* Marker set to end of last buffer-inserted output from this process */ - Lisp_Object INTERNAL_FIELD (mark); + Lisp_Object mark; /* Symbol indicating status of process. This may be a symbol: run, open, or closed. Or it may be a list, whose car is stop, exit or signal and whose cdr is a pair (EXIT_CODE . COREDUMP_FLAG) or (SIGNAL_NUMBER . COREDUMP_FLAG). */ - Lisp_Object INTERNAL_FIELD (status); + Lisp_Object status; /* Coding-system for decoding the input from this process. */ - Lisp_Object INTERNAL_FIELD (decode_coding_system); + Lisp_Object decode_coding_system; /* Working buffer for decoding. */ - Lisp_Object INTERNAL_FIELD (decoding_buf); + Lisp_Object decoding_buf; /* Coding-system for encoding the output to this process. */ - Lisp_Object INTERNAL_FIELD (encode_coding_system); + Lisp_Object encode_coding_system; /* Working buffer for encoding. */ - Lisp_Object INTERNAL_FIELD (encoding_buf); + Lisp_Object encoding_buf; /* Queue for storing waiting writes */ - Lisp_Object INTERNAL_FIELD (write_queue); + Lisp_Object write_queue; #ifdef HAVE_GNUTLS - Lisp_Object INTERNAL_FIELD (gnutls_cred_type); + Lisp_Object gnutls_cred_type; #endif /* After this point, there are no Lisp_Objects any more. */ === modified file 'src/sysdep.c' --- src/sysdep.c 2012-08-06 20:29:45 +0000 +++ src/sysdep.c 2012-08-07 07:42:34 +0000 @@ -2159,7 +2159,7 @@ int err = -1; char summary[4] = "???"; /* This usually becomes "8N1". */ - childp2 = Fcopy_sequence (PGET (p, childp)); + childp2 = Fcopy_sequence (p->childp); /* Read port attributes and prepare default configuration. */ err = tcgetattr (p->outfd, &attr); @@ -2177,7 +2177,7 @@ if (!NILP (Fplist_member (contact, QCspeed))) tem = Fplist_get (contact, QCspeed); else - tem = Fplist_get (PGET (p, childp), QCspeed); + tem = Fplist_get (p->childp, QCspeed); CHECK_NUMBER (tem); err = cfsetspeed (&attr, XINT (tem)); if (err != 0) @@ -2189,7 +2189,7 @@ if (!NILP (Fplist_member (contact, QCbytesize))) tem = Fplist_get (contact, QCbytesize); else - tem = Fplist_get (PGET (p, childp), QCbytesize); + tem = Fplist_get (p->childp, QCbytesize); if (NILP (tem)) tem = make_number (8); CHECK_NUMBER (tem); @@ -2210,7 +2210,7 @@ if (!NILP (Fplist_member (contact, QCparity))) tem = Fplist_get (contact, QCparity); else - tem = Fplist_get (PGET (p, childp), QCparity); + tem = Fplist_get (p->childp, QCparity); if (!NILP (tem) && !EQ (tem, Qeven) && !EQ (tem, Qodd)) error (":parity must be nil (no parity), `even', or `odd'"); #if defined (PARENB) && defined (PARODD) && defined (IGNPAR) && defined (INPCK) @@ -2243,7 +2243,7 @@ if (!NILP (Fplist_member (contact, QCstopbits))) tem = Fplist_get (contact, QCstopbits); else - tem = Fplist_get (PGET (p, childp), QCstopbits); + tem = Fplist_get (p->childp, QCstopbits); if (NILP (tem)) tem = make_number (1); CHECK_NUMBER (tem); @@ -2265,7 +2265,7 @@ if (!NILP (Fplist_member (contact, QCflowcontrol))) tem = Fplist_get (contact, QCflowcontrol); else - tem = Fplist_get (PGET (p, childp), QCflowcontrol); + tem = Fplist_get (p->childp, QCflowcontrol); if (!NILP (tem) && !EQ (tem, Qhw) && !EQ (tem, Qsw)) error (":flowcontrol must be nil (no flowcontrol), `hw', or `sw'"); #if defined (CRTSCTS) === modified file 'src/w32.c' --- src/w32.c 2012-08-06 22:07:01 +0000 +++ src/w32.c 2012-08-07 07:42:34 +0000 @@ -6890,7 +6890,7 @@ error ("Not a serial process"); hnd = fd_info[ p->outfd ].hnd; - childp2 = Fcopy_sequence (PGET (p, childp)); + childp2 = Fcopy_sequence (p->childp); /* Initialize timeouts for blocking read and blocking write. */ if (!GetCommTimeouts (hnd, &ct)) @@ -6919,7 +6919,7 @@ if (!NILP (Fplist_member (contact, QCspeed))) tem = Fplist_get (contact, QCspeed); else - tem = Fplist_get (PGET (p, childp), QCspeed); + tem = Fplist_get (p->childp, QCspeed); CHECK_NUMBER (tem); dcb.BaudRate = XINT (tem); childp2 = Fplist_put (childp2, QCspeed, tem); @@ -6928,7 +6928,7 @@ if (!NILP (Fplist_member (contact, QCbytesize))) tem = Fplist_get (contact, QCbytesize); else - tem = Fplist_get (PGET (p, childp), QCbytesize); + tem = Fplist_get (p->childp, QCbytesize); if (NILP (tem)) tem = make_number (8); CHECK_NUMBER (tem); @@ -6942,7 +6942,7 @@ if (!NILP (Fplist_member (contact, QCparity))) tem = Fplist_get (contact, QCparity); else - tem = Fplist_get (PGET (p, childp), QCparity); + tem = Fplist_get (p->childp, QCparity); if (!NILP (tem) && !EQ (tem, Qeven) && !EQ (tem, Qodd)) error (":parity must be nil (no parity), `even', or `odd'"); dcb.fParity = FALSE; @@ -6972,7 +6972,7 @@ if (!NILP (Fplist_member (contact, QCstopbits))) tem = Fplist_get (contact, QCstopbits); else - tem = Fplist_get (PGET (p, childp), QCstopbits); + tem = Fplist_get (p->childp, QCstopbits); if (NILP (tem)) tem = make_number (1); CHECK_NUMBER (tem); @@ -6989,7 +6989,7 @@ if (!NILP (Fplist_member (contact, QCflowcontrol))) tem = Fplist_get (contact, QCflowcontrol); else - tem = Fplist_get (PGET (p, childp), QCflowcontrol); + tem = Fplist_get (p->childp, QCflowcontrol); if (!NILP (tem) && !EQ (tem, Qhw) && !EQ (tem, Qsw)) error (":flowcontrol must be nil (no flowcontrol), `hw', or `sw'"); dcb.fOutxCtsFlow = FALSE; === modified file 'src/xdisp.c' --- src/xdisp.c 2012-08-07 07:33:18 +0000 +++ src/xdisp.c 2012-08-07 07:42:34 +0000 @@ -21676,9 +21676,9 @@ if (PROCESSP (obj)) { p = decode_mode_spec_coding - (PGET (XPROCESS (obj), decode_coding_system), p, eol_flag); + (XPROCESS (obj)->decode_coding_system, p, eol_flag); p = decode_mode_spec_coding - (PGET (XPROCESS (obj), encode_coding_system), p, eol_flag); + (XPROCESS (obj)->encode_coding_system, p, eol_flag); } #endif /* subprocesses */ #endif /* 0 */ ------------------------------------------------------------ revno: 109489 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-08-07 11:33:18 +0400 message: Drop WGET and revert read access to Lisp_Objects slots of struct window. * window.h (WGET): Remove. (struct window): Do not use INTERNAL_FIELD. * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c: * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c: * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m: * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c: * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-07 07:02:04 +0000 +++ src/ChangeLog 2012-08-07 07:33:18 +0000 @@ -1,3 +1,15 @@ +2012-08-07 Dmitry Antipov + + Drop WGET and revert read access to Lisp_Objects slots of struct window. + * window.h (WGET): Remove. + (struct window): Do not use INTERNAL_FIELD. + * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c: + * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c: + * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m: + * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c: + * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: + Adjust users. + 2012-08-07 Chong Yidong * window.c (Fwindow_edges, Fwindow_pixel_edges) === modified file 'src/alloc.c' --- src/alloc.c 2012-08-06 16:55:46 +0000 +++ src/alloc.c 2012-08-07 07:33:18 +0000 @@ -6014,7 +6014,7 @@ /* Mark glyphs for leaf windows. Marking window matrices is sufficient because frame matrices use the same glyph memory. */ - if (NILP (WGET (w, hchild)) && NILP (WGET (w, vchild)) + if (NILP (w->hchild) && NILP (w->vchild) && w->current_matrix) { mark_glyph_matrix (w->current_matrix); === modified file 'src/buffer.c' --- src/buffer.c 2012-08-07 05:29:25 +0000 +++ src/buffer.c 2012-08-07 07:33:18 +0000 @@ -1560,7 +1560,7 @@ since anything can happen within do_yes_or_no_p. */ /* Don't kill the minibuffer now current. */ - if (EQ (buffer, WGET (XWINDOW (minibuf_window), buffer))) + if (EQ (buffer, XWINDOW (minibuf_window)->buffer)) return Qnil; /* When we kill an ordinary buffer which shares it's buffer text @@ -1611,7 +1611,7 @@ /* If the buffer now current is shown in the minibuffer and our buffer is the sole other buffer give up. */ XSETBUFFER (tem, current_buffer); - if (EQ (tem, WGET (XWINDOW (minibuf_window), buffer)) + if (EQ (tem, XWINDOW (minibuf_window)->buffer) && EQ (buffer, Fother_buffer (buffer, Qnil, Qnil))) return Qnil; @@ -2193,13 +2193,13 @@ while (NILP (Fmemq (w, ws))) { ws = Fcons (w, ws); - if (MARKERP (WGET (XWINDOW (w), pointm)) - && (EQ (WGET (XWINDOW (w), buffer), buf1) - || EQ (WGET (XWINDOW (w), buffer), buf2))) - Fset_marker (WGET (XWINDOW (w), pointm), + if (MARKERP (XWINDOW (w)->pointm) + && (EQ (XWINDOW (w)->buffer, buf1) + || EQ (XWINDOW (w)->buffer, buf2))) + Fset_marker (XWINDOW (w)->pointm, make_number - (BUF_BEGV (XBUFFER (WGET (XWINDOW (w), buffer)))), - WGET (XWINDOW (w), buffer)); + (BUF_BEGV (XBUFFER (XWINDOW (w)->buffer))), + XWINDOW (w)->buffer); w = Fnext_window (w, Qt, Qt); } } @@ -3675,7 +3675,7 @@ /* If this is a buffer not in the selected window, we must do other windows. */ - if (buf != XBUFFER (WGET (XWINDOW (selected_window), buffer))) + if (buf != XBUFFER (XWINDOW (selected_window)->buffer)) windows_or_buffers_changed = 1; /* If multiple windows show this buffer, we must do other windows. */ else if (buffer_shared > 1) === modified file 'src/composite.c' --- src/composite.c 2012-08-06 10:24:26 +0000 +++ src/composite.c 2012-08-07 07:33:18 +0000 @@ -909,7 +909,7 @@ autocmp_chars (Lisp_Object rule, ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t limit, struct window *win, struct face *face, Lisp_Object string) { ptrdiff_t count = SPECPDL_INDEX (); - FRAME_PTR f = XFRAME (WGET (win, frame)); + FRAME_PTR f = XFRAME (win->frame); Lisp_Object pos = make_number (charpos); ptrdiff_t to; ptrdiff_t pt = PT, pt_byte = PT_BYTE; @@ -945,7 +945,7 @@ } else #endif /* not HAVE_WINDOW_SYSTEM */ - font_object = WGET (win, frame); + font_object = win->frame; lgstring = Fcomposition_get_gstring (pos, make_number (to), font_object, string); if (NILP (LGSTRING_ID (lgstring))) === modified file 'src/dispextern.h' --- src/dispextern.h 2012-08-06 10:24:26 +0000 +++ src/dispextern.h 2012-08-07 07:33:18 +0000 @@ -1379,7 +1379,7 @@ ? current_mode_line_height \ : (MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \ ? MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \ - : estimate_mode_line_height (XFRAME (WGET (W, frame)), \ + : estimate_mode_line_height (XFRAME (W->frame), \ CURRENT_MODE_LINE_FACE_ID (W)))) /* Return the current height of the header line of window W. If not @@ -1392,7 +1392,7 @@ ? current_header_line_height \ : (MATRIX_HEADER_LINE_HEIGHT ((W)->current_matrix) \ ? MATRIX_HEADER_LINE_HEIGHT ((W)->current_matrix) \ - : estimate_mode_line_height (XFRAME (WGET (W, frame)),\ + : estimate_mode_line_height (XFRAME (W->frame),\ HEADER_LINE_FACE_ID))) /* Return the height of the desired mode line of window W. */ @@ -1411,8 +1411,8 @@ (!MINI_WINDOW_P ((W)) \ && !(W)->pseudo_window_p \ && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \ - && BUFFERP (WGET (W, buffer)) \ - && !NILP (BVAR (XBUFFER (WGET (W, buffer)), mode_line_format)) \ + && BUFFERP (W->buffer) \ + && !NILP (BVAR (XBUFFER (W->buffer), mode_line_format)) \ && WINDOW_TOTAL_LINES (W) > 1) /* Value is non-zero if window W wants a header line. */ @@ -1421,10 +1421,10 @@ (!MINI_WINDOW_P ((W)) \ && !(W)->pseudo_window_p \ && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \ - && BUFFERP (WGET (W, buffer)) \ - && !NILP (BVAR (XBUFFER (WGET (W, buffer)), header_line_format)) \ + && BUFFERP (W->buffer) \ + && !NILP (BVAR (XBUFFER (W->buffer), header_line_format)) \ && WINDOW_TOTAL_LINES (W) > 1 \ - + !NILP (BVAR (XBUFFER (WGET (W, buffer)), mode_line_format))) + + !NILP (BVAR (XBUFFER (W->buffer), mode_line_format))) /* Return proper value to be used as baseline offset of font that has === modified file 'src/dispnew.c' --- src/dispnew.c 2012-08-07 05:29:25 +0000 +++ src/dispnew.c 2012-08-07 07:33:18 +0000 @@ -245,9 +245,9 @@ "%"pMu": window %p (`%s')%s\n%s", history_tick++, w, - ((BUFFERP (WGET (w, buffer)) - && STRINGP (BVAR (XBUFFER (WGET (w, buffer)), name))) - ? SSDATA (BVAR (XBUFFER (WGET (w, buffer)), name)) + ((BUFFERP (w->buffer) + && STRINGP (BVAR (XBUFFER (w->buffer), name))) + ? SSDATA (BVAR (XBUFFER (w->buffer), name)) : "???"), paused_p ? " ***paused***" : "", msg); @@ -385,7 +385,7 @@ if (NUMBERP (margin)) { - int width = XFASTINT (WGET (w, total_cols)); + int width = XFASTINT (w->total_cols); double d = max (0, XFLOATINT (margin)); d = min (width / 2 - 1, d); n = (int) ((double) total_glyphs / width * d); @@ -455,8 +455,8 @@ the matrix means preventing redisplay. */ if (matrix->pool == NULL) { - left = margin_glyphs_to_reserve (w, dim.width, WGET (w, left_margin_cols)); - right = margin_glyphs_to_reserve (w, dim.width, WGET (w, right_margin_cols)); + left = margin_glyphs_to_reserve (w, dim.width, w->left_margin_cols); + right = margin_glyphs_to_reserve (w, dim.width, w->right_margin_cols); eassert (left >= 0 && right >= 0); marginal_areas_changed_p = (left != matrix->left_margin_glyphs || right != matrix->right_margin_glyphs); @@ -495,9 +495,9 @@ if (w) { left = margin_glyphs_to_reserve (w, dim.width, - WGET (w, left_margin_cols)); + w->left_margin_cols); right = margin_glyphs_to_reserve (w, dim.width, - WGET (w, right_margin_cols)); + w->right_margin_cols); } else left = right = 0; @@ -620,8 +620,8 @@ /* Window end is invalid, if inside of the rows that are invalidated below. */ - if (INTEGERP (WGET (w, window_end_vpos)) - && XFASTINT (WGET (w, window_end_vpos)) >= i) + if (INTEGERP (w->window_end_vpos) + && XFASTINT (w->window_end_vpos) >= i) WSET (w, window_end_valid, Qnil); while (i < matrix->nrows) @@ -862,15 +862,15 @@ { while (w) { - if (!NILP (WGET (w, hchild))) + if (!NILP (w->hchild)) { - eassert (WINDOWP (WGET (w, hchild))); - clear_window_matrices (XWINDOW (WGET (w, hchild)), desired_p); + eassert (WINDOWP (w->hchild)); + clear_window_matrices (XWINDOW (w->hchild), desired_p); } - else if (!NILP (WGET (w, vchild))) + else if (!NILP (w->vchild)) { - eassert (WINDOWP (WGET (w, vchild))); - clear_window_matrices (XWINDOW (WGET (w, vchild)), desired_p); + eassert (WINDOWP (w->vchild)); + clear_window_matrices (XWINDOW (w->vchild), desired_p); } else { @@ -883,7 +883,7 @@ } } - w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); + w = NILP (w->next) ? 0 : XWINDOW (w->next); } } @@ -947,7 +947,7 @@ clear_glyph_row (row); row->y = y; row->ascent = row->phys_ascent = 0; - row->height = row->phys_height = FRAME_LINE_HEIGHT (XFRAME (WGET (w, frame))); + row->height = row->phys_height = FRAME_LINE_HEIGHT (XFRAME (w->frame)); row->visible_height = row->height; if (row->y < min_y) @@ -1493,7 +1493,7 @@ struct glyph_row *row = matrix->rows; struct glyph_row *last_text_row = NULL; struct buffer *saved = current_buffer; - struct buffer *buffer = XBUFFER (WGET (w, buffer)); + struct buffer *buffer = XBUFFER (w->buffer); int c; /* This can sometimes happen for a fresh window. */ @@ -1656,8 +1656,8 @@ points to the mini-buffer window, if any, which is arranged vertically below other windows. */ in_horz_combination_p - = (!NILP (WGET (XWINDOW (window), parent)) - && !NILP (WGET (XWINDOW (WGET (XWINDOW (window), parent)), hchild))); + = (!NILP (XWINDOW (window)->parent) + && !NILP (XWINDOW (XWINDOW (window)->parent)->hchild)); /* For WINDOW and all windows on the same level. */ do @@ -1666,12 +1666,12 @@ /* Get the dimension of the window sub-matrix for W, depending on whether this is a combination or a leaf window. */ - if (!NILP (WGET (w, hchild))) - dim = allocate_matrices_for_frame_redisplay (WGET (w, hchild), x, y, + if (!NILP (w->hchild)) + dim = allocate_matrices_for_frame_redisplay (w->hchild, x, y, dim_only_p, window_change_flags); - else if (!NILP (WGET (w, vchild))) - dim = allocate_matrices_for_frame_redisplay (WGET (w, vchild), x, y, + else if (!NILP (w->vchild)) + dim = allocate_matrices_for_frame_redisplay (w->vchild, x, y, dim_only_p, window_change_flags); else @@ -1695,10 +1695,10 @@ || dim.width != w->desired_matrix->matrix_w || dim.height != w->desired_matrix->matrix_h || (margin_glyphs_to_reserve (w, dim.width, - WGET (w, left_margin_cols)) + w->left_margin_cols) != w->desired_matrix->left_margin_glyphs) || (margin_glyphs_to_reserve (w, dim.width, - WGET (w, right_margin_cols)) + w->right_margin_cols) != w->desired_matrix->right_margin_glyphs)) *window_change_flags |= CHANGED_LEAF_MATRIX; @@ -1727,7 +1727,7 @@ hmax = max (hmax, dim.height); /* Next window on same level. */ - window = WGET (w, next); + window = w->next; } while (!NILP (window)); @@ -1758,7 +1758,7 @@ required_matrix_height (struct window *w) { #ifdef HAVE_WINDOW_SYSTEM - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); if (FRAME_WINDOW_P (f)) { @@ -1784,7 +1784,7 @@ required_matrix_width (struct window *w) { #ifdef HAVE_WINDOW_SYSTEM - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); if (FRAME_WINDOW_P (f)) { int ch_width = FRAME_SMALLEST_CHAR_WIDTH (f); @@ -1801,7 +1801,7 @@ } #endif /* HAVE_WINDOW_SYSTEM */ - return XINT (WGET (w, total_cols)); + return XINT (w->total_cols); } @@ -1813,10 +1813,10 @@ { while (w) { - if (!NILP (WGET (w, vchild))) - allocate_matrices_for_window_redisplay (XWINDOW (WGET (w, vchild))); - else if (!NILP (WGET (w, hchild))) - allocate_matrices_for_window_redisplay (XWINDOW (WGET (w, hchild))); + if (!NILP (w->vchild)) + allocate_matrices_for_window_redisplay (XWINDOW (w->vchild)); + else if (!NILP (w->hchild)) + allocate_matrices_for_window_redisplay (XWINDOW (w->hchild)); else { /* W is a leaf window. */ @@ -1835,7 +1835,7 @@ adjust_glyph_matrix (w, w->current_matrix, 0, 0, dim); } - w = NILP (WGET (w, next)) ? NULL : XWINDOW (WGET (w, next)); + w = NILP (w->next) ? NULL : XWINDOW (w->next); } } @@ -1882,7 +1882,7 @@ { struct frame *sf = SELECTED_FRAME (); struct window *root = XWINDOW (sf->root_window); - struct window *mini = XWINDOW (WGET (root, next)); + struct window *mini = XWINDOW (root->next); int frame_lines = FRAME_LINES (sf); int frame_cols = FRAME_COLS (sf); int top_margin = FRAME_TOP_MARGIN (sf); @@ -1927,21 +1927,21 @@ { while (w) { - if (!NILP (WGET (w, hchild))) - { - if (showing_window_margins_p (XWINDOW (WGET (w, hchild)))) - return 1; - } - else if (!NILP (WGET (w, vchild))) - { - if (showing_window_margins_p (XWINDOW (WGET (w, vchild)))) - return 1; - } - else if (!NILP (WGET (w, left_margin_cols)) - || !NILP (WGET (w, right_margin_cols))) + if (!NILP (w->hchild)) + { + if (showing_window_margins_p (XWINDOW (w->hchild))) + return 1; + } + else if (!NILP (w->vchild)) + { + if (showing_window_margins_p (XWINDOW (w->vchild))) + return 1; + } + else if (!NILP (w->left_margin_cols) + || !NILP (w->right_margin_cols)) return 1; - w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); + w = NILP (w->next) ? 0 : XWINDOW (w->next); } return 0; } @@ -1955,18 +1955,18 @@ { struct window *w; - for (; !NILP (window); window = WGET (w, next)) + for (; !NILP (window); window = w->next) { w = XWINDOW (window); - if (!NILP (WGET (w, hchild))) - fake_current_matrices (WGET (w, hchild)); - else if (!NILP (WGET (w, vchild))) - fake_current_matrices (WGET (w, vchild)); + if (!NILP (w->hchild)) + fake_current_matrices (w->hchild); + else if (!NILP (w->vchild)) + fake_current_matrices (w->vchild); else { int i; - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); struct glyph_matrix *m = w->current_matrix; struct glyph_matrix *fm = f->current_matrix; @@ -2317,10 +2317,10 @@ { while (w) { - if (!NILP (WGET (w, hchild))) - free_window_matrices (XWINDOW (WGET (w, hchild))); - else if (!NILP (WGET (w, vchild))) - free_window_matrices (XWINDOW (WGET (w, vchild))); + if (!NILP (w->hchild)) + free_window_matrices (XWINDOW (w->hchild)); + else if (!NILP (w->vchild)) + free_window_matrices (XWINDOW (w->vchild)); else { /* This is a leaf window. Free its memory and reset fields @@ -2332,7 +2332,7 @@ } /* Next window on same level. */ - w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); + w = NILP (w->next) ? 0 : XWINDOW (w->next); } } @@ -2453,14 +2453,14 @@ { while (w) { - if (!NILP (WGET (w, hchild))) - build_frame_matrix_from_window_tree (matrix, XWINDOW (WGET (w, hchild))); - else if (!NILP (WGET (w, vchild))) - build_frame_matrix_from_window_tree (matrix, XWINDOW (WGET (w, vchild))); + if (!NILP (w->hchild)) + build_frame_matrix_from_window_tree (matrix, XWINDOW (w->hchild)); + else if (!NILP (w->vchild)) + build_frame_matrix_from_window_tree (matrix, XWINDOW (w->vchild)); else build_frame_matrix_from_leaf_window (matrix, w); - w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); + w = NILP (w->next) ? 0 : XWINDOW (w->next); } } @@ -2599,7 +2599,7 @@ /* Convert the glyph's specified face to a realized (cache) face. */ if (lface_id > 0) { - int face_id = merge_faces (XFRAME (WGET (w, frame)), + int face_id = merge_faces (XFRAME (w->frame), Qt, lface_id, DEFAULT_FACE_ID); SET_GLYPH_FACE (*glyph, face_id); } @@ -2720,10 +2720,10 @@ { while (w) { - if (!NILP (WGET (w, hchild))) - mirror_make_current (XWINDOW (WGET (w, hchild)), frame_row); - else if (!NILP (WGET (w, vchild))) - mirror_make_current (XWINDOW (WGET (w, vchild)), frame_row); + if (!NILP (w->hchild)) + mirror_make_current (XWINDOW (w->hchild), frame_row); + else if (!NILP (w->vchild)) + mirror_make_current (XWINDOW (w->vchild), frame_row); else { /* Row relative to window W. Don't use FRAME_TO_WINDOW_VPOS @@ -2756,7 +2756,7 @@ } } - w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); + w = NILP (w->next) ? 0 : XWINDOW (w->next); } } @@ -2815,16 +2815,16 @@ static void sync_window_with_frame_matrix_rows (struct window *w) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); struct glyph_row *window_row, *window_row_end, *frame_row; int left, right, x, width; /* Preconditions: W must be a leaf window on a tty frame. */ - eassert (NILP (WGET (w, hchild)) && NILP (WGET (w, vchild))); + eassert (NILP (w->hchild) && NILP (w->vchild)); eassert (!FRAME_WINDOW_P (f)); - left = margin_glyphs_to_reserve (w, 1, WGET (w, left_margin_cols)); - right = margin_glyphs_to_reserve (w, 1, WGET (w, right_margin_cols)); + left = margin_glyphs_to_reserve (w, 1, w->left_margin_cols); + right = margin_glyphs_to_reserve (w, 1, w->right_margin_cols); x = w->current_matrix->matrix_x; width = w->current_matrix->matrix_w; @@ -2856,15 +2856,15 @@ while (w && !found) { - if (!NILP (WGET (w, hchild))) - found = frame_row_to_window (XWINDOW (WGET (w, hchild)), row); - else if (!NILP (WGET (w, vchild))) - found = frame_row_to_window (XWINDOW (WGET (w, vchild)), row); + if (!NILP (w->hchild)) + found = frame_row_to_window (XWINDOW (w->hchild), row); + else if (!NILP (w->vchild)) + found = frame_row_to_window (XWINDOW (w->vchild), row); else if (row >= WINDOW_TOP_EDGE_LINE (w) && row < WINDOW_BOTTOM_EDGE_LINE (w)) found = w; - w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); + w = NILP (w->next) ? 0 : XWINDOW (w->next); } return found; @@ -2887,11 +2887,11 @@ { while (w) { - if (!NILP (WGET (w, hchild))) - mirror_line_dance (XWINDOW (WGET (w, hchild)), unchanged_at_top, + if (!NILP (w->hchild)) + mirror_line_dance (XWINDOW (w->hchild), unchanged_at_top, nlines, copy_from, retained_p); - else if (!NILP (WGET (w, vchild))) - mirror_line_dance (XWINDOW (WGET (w, vchild)), unchanged_at_top, + else if (!NILP (w->vchild)) + mirror_line_dance (XWINDOW (w->vchild), unchanged_at_top, nlines, copy_from, retained_p); else { @@ -2947,7 +2947,7 @@ { /* A copy between windows. This is an infrequent case not worth optimizing. */ - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); struct window *root = XWINDOW (FRAME_ROOT_WINDOW (f)); struct window *w2; struct glyph_matrix *m2; @@ -2984,7 +2984,7 @@ } /* Next window on same level. */ - w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); + w = NILP (w->next) ? 0 : XWINDOW (w->next); } } @@ -3002,18 +3002,18 @@ { while (w) { - if (!NILP (WGET (w, hchild))) - check_window_matrix_pointers (XWINDOW (WGET (w, hchild))); - else if (!NILP (WGET (w, vchild))) - check_window_matrix_pointers (XWINDOW (WGET (w, vchild))); + if (!NILP (w->hchild)) + check_window_matrix_pointers (XWINDOW (w->hchild)); + else if (!NILP (w->vchild)) + check_window_matrix_pointers (XWINDOW (w->vchild)); else { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); check_matrix_pointers (w->desired_matrix, f->desired_matrix); check_matrix_pointers (w->current_matrix, f->current_matrix); } - w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); + w = NILP (w->next) ? 0 : XWINDOW (w->next); } } @@ -3061,10 +3061,10 @@ static int window_to_frame_vpos (struct window *w, int vpos) { - eassert (!FRAME_WINDOW_P (XFRAME (WGET (w, frame)))); + eassert (!FRAME_WINDOW_P (XFRAME (w->frame))); eassert (vpos >= 0 && vpos <= w->desired_matrix->nrows); vpos += WINDOW_TOP_EDGE_LINE (w); - eassert (vpos >= 0 && vpos <= FRAME_LINES (XFRAME (WGET (w, frame)))); + eassert (vpos >= 0 && vpos <= FRAME_LINES (XFRAME (w->frame))); return vpos; } @@ -3075,7 +3075,7 @@ static int window_to_frame_hpos (struct window *w, int hpos) { - eassert (!FRAME_WINDOW_P (XFRAME (WGET (w, frame)))); + eassert (!FRAME_WINDOW_P (XFRAME (w->frame))); hpos += WINDOW_LEFT_EDGE_COL (w); return hpos; } @@ -3294,14 +3294,14 @@ while (w && !paused_p) { - if (!NILP (WGET (w, hchild))) - paused_p |= update_window_tree (XWINDOW (WGET (w, hchild)), force_p); - else if (!NILP (WGET (w, vchild))) - paused_p |= update_window_tree (XWINDOW (WGET (w, vchild)), force_p); + if (!NILP (w->hchild)) + paused_p |= update_window_tree (XWINDOW (w->hchild), force_p); + else if (!NILP (w->vchild)) + paused_p |= update_window_tree (XWINDOW (w->vchild), force_p); else if (w->must_be_updated_p) paused_p |= update_window (w, force_p); - w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); + w = NILP (w->next) ? 0 : XWINDOW (w->next); } return paused_p; @@ -3789,7 +3789,7 @@ struct glyph *glyph = ¤t_row->glyphs[TEXT_AREA][i - 1]; int left, right; - rif->get_glyph_overhangs (glyph, XFRAME (WGET (w, frame)), + rif->get_glyph_overhangs (glyph, XFRAME (w->frame), &left, &right); can_skip_p = (right == 0 && !abort_skipping); } @@ -3822,7 +3822,7 @@ int left, right; rif->get_glyph_overhangs (current_glyph, - XFRAME (WGET (w, frame)), + XFRAME (w->frame), &left, &right); while (left > 0 && i > 0) { @@ -3965,7 +3965,7 @@ /* Update display of the left margin area, if there is one. */ if (!desired_row->full_width_p - && !NILP (WGET (w, left_margin_cols))) + && !NILP (w->left_margin_cols)) { changed_p = 1; update_marginal_area (w, LEFT_MARGIN_AREA, vpos); @@ -3981,7 +3981,7 @@ /* Update display of the right margin area, if there is one. */ if (!desired_row->full_width_p - && !NILP (WGET (w, right_margin_cols))) + && !NILP (w->right_margin_cols)) { changed_p = 1; update_marginal_area (w, RIGHT_MARGIN_AREA, vpos); @@ -4014,7 +4014,7 @@ static void set_window_cursor_after_update (struct window *w) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); struct redisplay_interface *rif = FRAME_RIF (f); int cx, cy, vpos, hpos; @@ -4100,14 +4100,14 @@ { while (w) { - if (!NILP (WGET (w, hchild))) - set_window_update_flags (XWINDOW (WGET (w, hchild)), on_p); - else if (!NILP (WGET (w, vchild))) - set_window_update_flags (XWINDOW (WGET (w, vchild)), on_p); + if (!NILP (w->hchild)) + set_window_update_flags (XWINDOW (w->hchild), on_p); + else if (!NILP (w->vchild)) + set_window_update_flags (XWINDOW (w->vchild), on_p); else w->must_be_updated_p = on_p; - w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); + w = NILP (w->next) ? 0 : XWINDOW (w->next); } } @@ -4790,8 +4790,8 @@ int x = WINDOW_TO_FRAME_HPOS (w, w->cursor.hpos); int y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos); - if (INTEGERP (WGET (w, left_margin_cols))) - x += XFASTINT (WGET (w, left_margin_cols)); + if (INTEGERP (w->left_margin_cols)) + x += XFASTINT (w->left_margin_cols); /* x = max (min (x, FRAME_TOTAL_COLS (f) - 1), 0); */ cursor_to (f, y, x); @@ -5281,9 +5281,9 @@ /* We used to set current_buffer directly here, but that does the wrong thing with `face-remapping-alist' (bug#2044). */ - Fset_buffer (WGET (w, buffer)); + Fset_buffer (w->buffer); itdata = bidi_shelve_cache (); - SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start)); + SET_TEXT_POS_FROM_MARKER (startp, w->start); CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp))); BYTEPOS (startp) = min (ZV_BYTE, max (BEGV_BYTE, BYTEPOS (startp))); start_display (&it, w, startp); @@ -5327,7 +5327,7 @@ *dx = x0 + it.first_visible_x - it.current_x; *dy = *y - it.current_y; - string = WGET (w, buffer); + string = w->buffer; if (STRINGP (it.string)) string = it.string; *pos = it.current; @@ -5345,7 +5345,7 @@ if (STRINGP (it.string)) BYTEPOS (pos->pos) = string_char_to_byte (string, CHARPOS (pos->pos)); else - BYTEPOS (pos->pos) = buf_charpos_to_bytepos (XBUFFER (WGET (w, buffer)), + BYTEPOS (pos->pos) = buf_charpos_to_bytepos (XBUFFER (w->buffer), CHARPOS (pos->pos)); } @@ -5745,8 +5745,7 @@ FrameCols (FRAME_TTY (f)) = newwidth; if (WINDOWP (f->tool_bar_window)) - WSET (XWINDOW (f->tool_bar_window), - total_cols, make_number (newwidth)); + WSET (XWINDOW (f->tool_bar_window), total_cols, make_number (newwidth)); } FRAME_LINES (f) = newheight; === modified file 'src/editfns.c' --- src/editfns.c 2012-08-06 10:24:26 +0000 +++ src/editfns.c 2012-08-07 07:33:18 +0000 @@ -366,7 +366,7 @@ if (NILP (object)) XSETBUFFER (object, current_buffer); else if (WINDOWP (object)) - object = WGET (XWINDOW (object), buffer); + object = XWINDOW (object)->buffer; if (!BUFFERP (object)) /* pos-property only makes sense in buffers right now, since strings @@ -821,7 +821,7 @@ Lisp_Object save_excursion_save (void) { - int visible = (XBUFFER (WGET (XWINDOW (selected_window), buffer)) + int visible = (XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer); return Fcons (Fpoint_marker (), @@ -874,7 +874,7 @@ and cleaner never to alter the window/buffer connections. */ tem1 = Fcar (tem); if (!NILP (tem1) - && current_buffer != XBUFFER (WGET (XWINDOW (selected_window), buffer))) + && current_buffer != XBUFFER (XWINDOW (selected_window)->buffer)) Fswitch_to_buffer (Fcurrent_buffer (), Qnil); #endif /* 0 */ @@ -907,7 +907,7 @@ tem = XCDR (info); if (visible_p && !EQ (tem, selected_window) - && (tem1 = WGET (XWINDOW (tem), buffer), + && (tem1 = XWINDOW (tem)->buffer, (/* Window is live... */ BUFFERP (tem1) /* ...and it shows the current buffer. */ === modified file 'src/fileio.c' --- src/fileio.c 2012-08-06 10:24:26 +0000 +++ src/fileio.c 2012-08-07 07:33:18 +0000 @@ -3731,7 +3731,7 @@ /* If display currently starts at beginning of line, keep it that way. */ - if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) == current_buffer) + if (XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer) XWINDOW (selected_window)->start_at_line_beg = !NILP (Fbolp ()); replace_handled = 1; @@ -3888,7 +3888,7 @@ /* If display currently starts at beginning of line, keep it that way. */ - if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) == current_buffer) + if (XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer) XWINDOW (selected_window)->start_at_line_beg = !NILP (Fbolp ()); /* Replace the chars that we need to replace, === modified file 'src/font.c' --- src/font.c 2012-08-06 10:24:26 +0000 +++ src/font.c 2012-08-07 07:33:18 +0000 @@ -3665,7 +3665,7 @@ } } - f = XFRAME (WGET (w, frame)); + f = XFRAME (w->frame); if (! FRAME_WINDOW_P (f)) return Qnil; if (! face) @@ -3723,7 +3723,7 @@ face_id = face_at_buffer_position (w, pos, 0, 0, &ignore, *limit, 0, -1); - face = FACE_FROM_ID (XFRAME (WGET (w, frame)), face_id); + face = FACE_FROM_ID (XFRAME (w->frame), face_id); } } else === modified file 'src/fontset.c' --- src/fontset.c 2012-08-07 05:29:25 +0000 +++ src/fontset.c 2012-08-07 07:33:18 +0000 @@ -1841,7 +1841,7 @@ if (NILP (window)) return Qnil; w = XWINDOW (window); - f = XFRAME (WGET (w, frame)); + f = XFRAME (w->frame); face_id = face_at_buffer_position (w, pos, -1, -1, &dummy, pos + 100, 0, -1); } === modified file 'src/frame.c' --- src/frame.c 2012-08-07 05:29:25 +0000 +++ src/frame.c 2012-08-07 07:33:18 +0000 @@ -132,15 +132,15 @@ struct window *w = XWINDOW (window); w->last_modified = 0; - WSET (w, top_line, make_number (XFASTINT (WGET (w, top_line)) + n)); - WSET (w, total_lines, make_number (XFASTINT (WGET (w, total_lines)) - n)); + WSET (w, top_line, make_number (XFASTINT (w->top_line) + n)); + WSET (w, total_lines, make_number (XFASTINT (w->total_lines) - n)); /* Handle just the top child in a vertical split. */ - if (!NILP (WGET (w, vchild))) - set_menu_bar_lines_1 (WGET (w, vchild), n); + if (!NILP (w->vchild)) + set_menu_bar_lines_1 (w->vchild, n); /* Adjust all children in a horizontal split. */ - for (window = WGET (w, hchild); !NILP (window); window = WGET (w, next)) + for (window = w->hchild; !NILP (window); window = w->next) { w = XWINDOW (window); set_menu_bar_lines_1 (window, n); @@ -376,7 +376,7 @@ CHECK_LIVE_WINDOW (mini_window); if (!NILP (mini_window) - && FRAME_KBOARD (XFRAME (WGET (XWINDOW (mini_window), frame))) != kb) + && FRAME_KBOARD (XFRAME (XWINDOW (mini_window)->frame)) != kb) error ("Frame and minibuffer must be on the same terminal"); /* Make a frame containing just a root window. */ @@ -406,7 +406,7 @@ /* Make the chosen minibuffer window display the proper minibuffer, unless it is already showing a minibuffer. */ - if (NILP (Fmemq (WGET (XWINDOW (mini_window), buffer), Vminibuffer_list))) + if (NILP (Fmemq (XWINDOW (mini_window)->buffer, Vminibuffer_list))) Fset_window_buffer (mini_window, (NILP (Vminibuffer_list) ? get_minibuffer (0) @@ -1241,7 +1241,7 @@ if (EQ (f->minibuffer_window, minibuf_window)) { Fset_window_buffer (sf->minibuffer_window, - WGET (XWINDOW (minibuf_window), buffer), Qnil); + XWINDOW (minibuf_window)->buffer, Qnil); minibuf_window = sf->minibuffer_window; /* If the dying minibuffer window was selected, @@ -1672,17 +1672,17 @@ { struct window *w; - for (;!NILP (window); window = WGET (w, next)) + for (;!NILP (window); window = w->next) { w = XWINDOW (window); - if (!NILP (WGET (w, buffer))) - BVAR (XBUFFER (WGET (w, buffer)), display_time) = Fcurrent_time (); + if (!NILP (w->buffer)) + BVAR (XBUFFER (w->buffer), display_time) = Fcurrent_time (); - if (!NILP (WGET (w, vchild))) - make_frame_visible_1 (WGET (w, vchild)); - if (!NILP (WGET (w, hchild))) - make_frame_visible_1 (WGET (w, hchild)); + if (!NILP (w->vchild)) + make_frame_visible_1 (w->vchild); + if (!NILP (w->hchild)) + make_frame_visible_1 (w->hchild); } } @@ -1714,7 +1714,7 @@ { struct frame *sf = XFRAME (selected_frame); Fset_window_buffer (sf->minibuffer_window, - WGET (XWINDOW (minibuf_window), buffer), Qnil); + XWINDOW (minibuf_window)->buffer, Qnil); minibuf_window = sf->minibuffer_window; } @@ -1752,7 +1752,7 @@ { struct frame *sf = XFRAME (selected_frame); Fset_window_buffer (sf->minibuffer_window, - WGET (XWINDOW (minibuf_window), buffer), Qnil); + XWINDOW (minibuf_window)->buffer, Qnil); minibuf_window = sf->minibuffer_window; } === modified file 'src/frame.h' --- src/frame.h 2012-08-07 05:29:25 +0000 +++ src/frame.h 2012-08-07 07:33:18 +0000 @@ -511,7 +511,7 @@ #define XSETFRAME(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FRAME)) /* Given a window, return its frame as a Lisp_Object. */ -#define WINDOW_FRAME(w) WGET (w, frame) +#define WINDOW_FRAME(w) w->frame /* Test a frame for particular kinds of display methods. */ #define FRAME_INITIAL_P(f) ((f)->output_method == output_initial) === modified file 'src/fringe.c' --- src/fringe.c 2012-08-07 05:29:25 +0000 +++ src/fringe.c 2012-08-07 07:33:18 +0000 @@ -692,7 +692,7 @@ { Lisp_Object cmap, bm = Qnil; - if ((cmap = BVAR (XBUFFER (WGET (w, buffer)), fringe_cursor_alist)), !NILP (cmap)) + if ((cmap = BVAR (XBUFFER (w->buffer), fringe_cursor_alist)), !NILP (cmap)) { bm = Fassq (cursor, cmap); if (CONSP (bm)) @@ -729,7 +729,7 @@ If partial, lookup partial bitmap in default value if not found here. If not partial, or no partial spec is present, use non-partial bitmap. */ - if ((cmap = BVAR (XBUFFER (WGET (w, buffer)), fringe_indicator_alist)), !NILP (cmap)) + if ((cmap = BVAR (XBUFFER (w->buffer), fringe_indicator_alist)), !NILP (cmap)) { bm1 = Fassq (bitmap, cmap); if (CONSP (bm1)) @@ -956,7 +956,7 @@ return 0; if (!MINI_WINDOW_P (w) - && (ind = BVAR (XBUFFER (WGET (w, buffer)), indicate_buffer_boundaries), !NILP (ind))) + && (ind = BVAR (XBUFFER (w->buffer), indicate_buffer_boundaries), !NILP (ind))) { if (EQ (ind, Qleft) || EQ (ind, Qright)) boundary_top = boundary_bot = arrow_top = arrow_bot = ind; @@ -997,7 +997,7 @@ { if (top_ind_rn < 0 && row->visible_height > 0) { - if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (WGET (w, buffer))) + if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer)) && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row)) row->indicate_bob_p = !NILP (boundary_top); else @@ -1007,7 +1007,7 @@ if (bot_ind_rn < 0) { - if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (WGET (w, buffer))) + if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer)) && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row)) row->indicate_eob_p = !NILP (boundary_bot), bot_ind_rn = rn; else if (y + row->height >= yb) @@ -1017,7 +1017,7 @@ } } - empty_pos = BVAR (XBUFFER (WGET (w, buffer)), indicate_empty_lines); + empty_pos = BVAR (XBUFFER (w->buffer), indicate_empty_lines); if (!NILP (empty_pos) && !EQ (empty_pos, Qright)) empty_pos = WINDOW_LEFT_FRINGE_WIDTH (w) == 0 ? Qright : Qleft; @@ -1740,7 +1740,7 @@ else if (w == XWINDOW (selected_window)) textpos = PT; else - textpos = XMARKER (WGET (w, pointm))->charpos; + textpos = XMARKER (w->pointm)->charpos; row = MATRIX_FIRST_TEXT_ROW (w->current_matrix); row = row_containing_pos (w, textpos, row, NULL, 0); === modified file 'src/indent.c' --- src/indent.c 2012-08-06 10:24:26 +0000 +++ src/indent.c 2012-08-07 07:33:18 +0000 @@ -258,7 +258,7 @@ the next property change */ prop = Fget_char_property (position, Qinvisible, (!NILP (window) - && EQ (WGET (XWINDOW (window), buffer), buffer)) + && EQ (XWINDOW (window)->buffer, buffer)) ? window : buffer); inv_p = TEXT_PROP_MEANS_INVISIBLE (prop); /* When counting columns (window == nil), don't skip over ellipsis text. */ @@ -1173,14 +1173,14 @@ width = window_body_cols (win); /* We must make room for continuation marks if we don't have fringes. */ #ifdef HAVE_WINDOW_SYSTEM - if (!FRAME_WINDOW_P (XFRAME (WGET (win, frame)))) + if (!FRAME_WINDOW_P (XFRAME (win->frame))) #endif width -= 1; } continuation_glyph_width = 1; #ifdef HAVE_WINDOW_SYSTEM - if (FRAME_WINDOW_P (XFRAME (WGET (win, frame)))) + if (FRAME_WINDOW_P (XFRAME (win->frame))) continuation_glyph_width = 0; /* In the fringe. */ #endif @@ -1787,7 +1787,7 @@ ? (window_body_cols (w) - ( #ifdef HAVE_WINDOW_SYSTEM - FRAME_WINDOW_P (XFRAME (WGET (w, frame))) ? 0 : + FRAME_WINDOW_P (XFRAME (w->frame)) ? 0 : #endif 1)) : XINT (XCAR (topos))), @@ -1837,7 +1837,7 @@ /* If the window contains this buffer, use it for getting text properties. Otherwise use the current buffer as arg for doing that. */ - if (EQ (WGET (w, buffer), Fcurrent_buffer ())) + if (EQ (w->buffer, Fcurrent_buffer ())) text_prop_object = window; else text_prop_object = Fcurrent_buffer (); @@ -1998,14 +1998,14 @@ old_buffer = Qnil; GCPRO3 (old_buffer, old_charpos, old_bytepos); - if (XBUFFER (WGET (w, buffer)) != current_buffer) + if (XBUFFER (w->buffer) != current_buffer) { /* Set the window's buffer temporarily to the current buffer. */ - old_buffer = WGET (w, buffer); - old_charpos = XMARKER (WGET (w, pointm))->charpos; - old_bytepos = XMARKER (WGET (w, pointm))->bytepos; + old_buffer = w->buffer; + old_charpos = XMARKER (w->pointm)->charpos; + old_bytepos = XMARKER (w->pointm)->bytepos; WSET (w, buffer, Fcurrent_buffer ()); - set_marker_both (WGET (w, pointm), WGET (w, buffer), + set_marker_both (w->pointm, w->buffer, BUF_PT (current_buffer), BUF_PT_BYTE (current_buffer)); } @@ -2137,7 +2137,7 @@ } move_it_in_display_line (&it, ZV, - (int)(cols * FRAME_COLUMN_WIDTH (XFRAME (WGET (w, frame))) + 0.5), + (int)(cols * FRAME_COLUMN_WIDTH (XFRAME (w->frame)) + 0.5), MOVE_TO_X); } @@ -2148,7 +2148,7 @@ if (BUFFERP (old_buffer)) { WSET (w, buffer, old_buffer); - set_marker_both (WGET (w, pointm), WGET (w, buffer), + set_marker_both (w->pointm, w->buffer, old_charpos, old_bytepos); } === modified file 'src/insdel.c' --- src/insdel.c 2012-08-06 10:24:26 +0000 +++ src/insdel.c 2012-08-07 07:33:18 +0000 @@ -1820,7 +1820,7 @@ /* Let redisplay consider other windows than selected_window if modifying another buffer. */ - if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) != current_buffer) + if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer) ++windows_or_buffers_changed; if (BUF_INTERVALS (current_buffer) != 0) === modified file 'src/keyboard.c' --- src/keyboard.c 2012-08-06 16:09:02 +0000 +++ src/keyboard.c 2012-08-07 07:33:18 +0000 @@ -800,7 +800,7 @@ update_mode_lines = 1; if (command_loop_level - && current_buffer != XBUFFER (WGET (XWINDOW (selected_window), buffer))) + && current_buffer != XBUFFER (XWINDOW (selected_window)->buffer)) buffer = Fcurrent_buffer (); else buffer = Qnil; @@ -1382,8 +1382,8 @@ Fkill_emacs (Qnil); /* Make sure the current window's buffer is selected. */ - if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) != current_buffer) - set_buffer_internal (XBUFFER (WGET (XWINDOW (selected_window), buffer))); + if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer) + set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer)); /* Display any malloc warning that just came out. Use while because displaying one warning can cause another. */ @@ -1452,8 +1452,8 @@ /* A filter may have run while we were reading the input. */ if (! FRAME_LIVE_P (XFRAME (selected_frame))) Fkill_emacs (Qnil); - if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) != current_buffer) - set_buffer_internal (XBUFFER (WGET (XWINDOW (selected_window), buffer))); + if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer) + set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer)); ++num_input_keys; @@ -1484,7 +1484,7 @@ { struct buffer *b; XWINDOW (selected_window)->force_start = 0; - b = XBUFFER (WGET (XWINDOW (selected_window), buffer)); + b = XBUFFER (XWINDOW (selected_window)->buffer); BUF_BEG_UNCHANGED (b) = BUF_END_UNCHANGED (b) = 0; } @@ -5175,8 +5175,8 @@ if (STRINGP (string)) string_info = Fcons (string, make_number (charpos)); textpos = (w == XWINDOW (selected_window) - && current_buffer == XBUFFER (WGET (w, buffer))) - ? PT : XMARKER (WGET (w, pointm))->charpos; + && current_buffer == XBUFFER (w->buffer)) + ? PT : XMARKER (w->pointm)->charpos; xret = wx; yret = wy; @@ -5564,7 +5564,7 @@ int fuzz; if (WINDOWP (event->frame_or_window)) - f = XFRAME (WGET (XWINDOW (event->frame_or_window), frame)); + f = XFRAME (XWINDOW (event->frame_or_window)->frame); else if (FRAMEP (event->frame_or_window)) f = XFRAME (event->frame_or_window); else @@ -5732,7 +5732,7 @@ int is_double; if (WINDOWP (event->frame_or_window)) - fr = XFRAME (WGET (XWINDOW (event->frame_or_window), frame)); + fr = XFRAME (XWINDOW (event->frame_or_window)->frame); else if (FRAMEP (event->frame_or_window)) fr = XFRAME (event->frame_or_window); else @@ -9402,8 +9402,8 @@ { if (! FRAME_LIVE_P (XFRAME (selected_frame))) Fkill_emacs (Qnil); - if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) != current_buffer) - Fset_buffer (WGET (XWINDOW (selected_window), buffer)); + if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer) + Fset_buffer (XWINDOW (selected_window)->buffer); } orig_local_map = get_local_map (PT, current_buffer, Qlocal_map); @@ -9495,8 +9495,8 @@ not the current buffer. If we're at the beginning of a key sequence, switch buffers. */ if (WINDOWP (window) - && BUFFERP (WGET (XWINDOW (window), buffer)) - && XBUFFER (WGET (XWINDOW (window), buffer)) != current_buffer) + && BUFFERP (XWINDOW (window)->buffer) + && XBUFFER (XWINDOW (window)->buffer) != current_buffer) { ASET (raw_keybuf, raw_keybuf_count, key); raw_keybuf_count++; @@ -9517,7 +9517,7 @@ if (! FRAME_LIVE_P (XFRAME (selected_frame))) Fkill_emacs (Qnil); - set_buffer_internal (XBUFFER (WGET (XWINDOW (window), buffer))); + set_buffer_internal (XBUFFER (XWINDOW (window)->buffer)); orig_local_map = get_local_map (PT, current_buffer, Qlocal_map); orig_keymap = get_local_map (PT, current_buffer, @@ -11201,7 +11201,7 @@ ? window_box_left_offset (w, TEXT_AREA) : 0))); XSETINT (y, WINDOW_TO_FRAME_PIXEL_Y (w, XINT (y))); - frame_or_window = WGET (w, frame); + frame_or_window = w->frame; } CHECK_LIVE_FRAME (frame_or_window); === modified file 'src/keymap.c' --- src/keymap.c 2012-08-06 10:24:26 +0000 +++ src/keymap.c 2012-08-07 07:33:18 +0000 @@ -1560,8 +1560,8 @@ window = POSN_WINDOW (position); if (WINDOWP (window) - && BUFFERP (WGET (XWINDOW (window), buffer)) - && XBUFFER (WGET (XWINDOW (window), buffer)) != current_buffer) + && BUFFERP (XWINDOW (window)->buffer) + && XBUFFER (XWINDOW (window)->buffer) != current_buffer) { /* Arrange to go back to the original buffer once we're done processing the key sequence. We don't use @@ -1573,7 +1573,7 @@ record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); - set_buffer_internal (XBUFFER (WGET (XWINDOW (window), buffer))); + set_buffer_internal (XBUFFER (XWINDOW (window)->buffer)); } } === modified file 'src/lisp.h' --- src/lisp.h 2012-08-06 10:24:26 +0000 +++ src/lisp.h 2012-08-07 07:33:18 +0000 @@ -1787,7 +1787,7 @@ vchild, and hchild members are all nil. */ #define CHECK_LIVE_WINDOW(x) \ - CHECK_TYPE (WINDOWP (x) && !NILP (WGET (XWINDOW (x), buffer)), \ + CHECK_TYPE (WINDOWP (x) && !NILP (XWINDOW (x)->buffer), \ Qwindow_live_p, x) #define CHECK_PROCESS(x) \ === modified file 'src/minibuf.c' --- src/minibuf.c 2012-08-07 05:29:25 +0000 +++ src/minibuf.c 2012-08-07 07:33:18 +0000 @@ -115,7 +115,7 @@ /* Under X, we come here with minibuf_window being the minibuffer window of the unused termcap window created in init_window_once. That window doesn't have a buffer. */ - buffer = WGET (XWINDOW (minibuf_window), buffer); + buffer = XWINDOW (minibuf_window)->buffer; if (BUFFERP (buffer)) Fset_window_buffer (sf->minibuffer_window, buffer, Qnil); minibuf_window = sf->minibuffer_window; @@ -612,7 +612,7 @@ FOR_EACH_FRAME (dummy, frame) { Lisp_Object root_window = Fframe_root_window (frame); - Lisp_Object mini_window = WGET (XWINDOW (root_window), next); + Lisp_Object mini_window = XWINDOW (root_window)->next; if (! NILP (mini_window) && ! EQ (mini_window, minibuf_window) && !NILP (Fwindow_minibuffer_p (mini_window))) @@ -687,7 +687,7 @@ XWINDOW (minibuf_window)->must_be_updated_p = 1; update_frame (XFRAME (selected_frame), 1, 1); { - struct frame *f = XFRAME (WGET (XWINDOW (minibuf_window), frame)); + struct frame *f = XFRAME (XWINDOW (minibuf_window)->frame); struct redisplay_interface *rif = FRAME_RIF (f); if (rif && rif->flush_display) rif->flush_display (f); @@ -844,7 +844,7 @@ window = minibuf_window; /* To keep things predictable, in case it matters, let's be in the minibuffer when we reset the relevant variables. */ - Fset_buffer (WGET (XWINDOW (window), buffer)); + Fset_buffer (XWINDOW (window)->buffer); /* Restore prompt, etc, from outer minibuffer level. */ minibuf_prompt = Fcar (minibuf_save_list); === modified file 'src/msdos.c' --- src/msdos.c 2012-08-07 05:29:25 +0000 +++ src/msdos.c 2012-08-07 07:33:18 +0000 @@ -594,7 +594,7 @@ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); Lisp_Object window = hlinfo->mouse_face_window; - if (! NILP (window) && XFRAME (WGET (XWINDOW (window), frame)) == f) + if (! NILP (window) && XFRAME (XWINDOW (window)->frame) == f) { hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; @@ -1255,7 +1255,7 @@ /* If the mouse highlight is in the window that was deleted (e.g., if it was popped by completion), clear highlight unconditionally. */ - if (NILP (WGET (w, buffer))) + if (NILP (w->buffer)) hlinfo->mouse_face_window = Qnil; else { @@ -1265,7 +1265,7 @@ break; } - if (NILP (WGET (w, buffer)) || i < w->desired_matrix->nrows) + if (NILP (w->buffer) || i < w->desired_matrix->nrows) clear_mouse_face (hlinfo); } } @@ -1327,7 +1327,7 @@ new_cursor = frame_desired_cursor; else { - struct buffer *b = XBUFFER (WGET (sw, buffer)); + struct buffer *b = XBUFFER (sw->buffer); if (EQ (BVAR (b,cursor_type), Qt)) new_cursor = frame_desired_cursor; === modified file 'src/nsfns.m' --- src/nsfns.m 2012-08-07 05:29:25 +0000 +++ src/nsfns.m 2012-08-07 07:33:18 +0000 @@ -607,7 +607,7 @@ { NSView *view; Lisp_Object name, filename; - Lisp_Object buf = WGET (XWINDOW (f->selected_window), buffer); + Lisp_Object buf = XWINDOW (f->selected_window)->buffer; const char *title; NSAutoreleasePool *pool; struct gcpro gcpro1; === modified file 'src/nsmenu.m' --- src/nsmenu.m 2012-08-07 05:29:25 +0000 +++ src/nsmenu.m 2012-08-07 07:33:18 +0000 @@ -193,7 +193,7 @@ = alloca (previous_menu_items_used * sizeof *previous_items); /* lisp preliminaries */ - buffer = WGET (XWINDOW (FRAME_SELECTED_WINDOW (f)), buffer); + buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer; specbind (Qinhibit_quit, Qt); specbind (Qdebug_on_next_call, Qnil); record_unwind_save_match_data (); === modified file 'src/nsterm.m' --- src/nsterm.m 2012-08-07 05:29:25 +0000 +++ src/nsterm.m 2012-08-07 07:33:18 +0000 @@ -667,7 +667,7 @@ external (RIF) call; for one window called before update_end -------------------------------------------------------------------------- */ { - Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WGET (w, frame))); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); /* note: this fn is nearly identical in all terms */ if (!w->pseudo_window_p) @@ -2035,7 +2035,7 @@ External (RIF): Insert or delete n lines at line vpos -------------------------------------------------------------------------- */ { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); int x, y, width, height, from_y, to_y, bottom_y; NSTRACE (ns_scroll_run); @@ -2114,7 +2114,7 @@ full-width rows stays visible in the internal border. Under NS this is drawn inside the fringes. */ if (windows_or_buffers_changed - && (f = XFRAME (WGET (w, frame)), + && (f = XFRAME (w->frame), width = FRAME_INTERNAL_BORDER_WIDTH (f), width != 0) && (height = desired_row->visible_height, @@ -3622,9 +3622,9 @@ EmacsScroller *bar; /* optimization; display engine sends WAY too many of these.. */ - if (!NILP (WGET (window, vertical_scroll_bar))) + if (!NILP (window->vertical_scroll_bar)) { - bar = XNS_SCROLL_BAR (WGET (window, vertical_scroll_bar)); + bar = XNS_SCROLL_BAR (window->vertical_scroll_bar); if ([bar checkSamePosition: position portion: portion whole: whole]) { if (view->scrollbarsNeedingUpdate == 0) @@ -3672,9 +3672,9 @@ /* we want at least 5 lines to display a scrollbar */ if (WINDOW_TOTAL_LINES (window) < 5) { - if (!NILP (WGET (window, vertical_scroll_bar))) + if (!NILP (window->vertical_scroll_bar)) { - bar = XNS_SCROLL_BAR (WGET (window, vertical_scroll_bar)); + bar = XNS_SCROLL_BAR (window->vertical_scroll_bar); [bar removeFromSuperview]; WSET (window, vertical_scroll_bar, Qnil); } @@ -3683,7 +3683,7 @@ return; } - if (NILP (WGET (window, vertical_scroll_bar))) + if (NILP (window->vertical_scroll_bar)) { ns_clear_frame_area (f, sb_left, top, width, height); bar = [[EmacsScroller alloc] initFrame: r window: win]; @@ -3692,7 +3692,7 @@ else { NSRect oldRect; - bar = XNS_SCROLL_BAR (WGET (window, vertical_scroll_bar)); + bar = XNS_SCROLL_BAR (window->vertical_scroll_bar); oldRect = [bar frame]; r.size.width = oldRect.size.width; if (FRAME_LIVE_P (f) && !NSEqualRects (oldRect, r)) @@ -3739,9 +3739,9 @@ { id bar; NSTRACE (ns_redeem_scroll_bar); - if (!NILP (WGET (window, vertical_scroll_bar))) + if (!NILP (window->vertical_scroll_bar)) { - bar = XNS_SCROLL_BAR (WGET (window, vertical_scroll_bar)); + bar = XNS_SCROLL_BAR (window->vertical_scroll_bar); [bar reprieve]; } } @@ -6061,8 +6061,7 @@ { Lisp_Object str = Qnil; struct frame *f = SELECTED_FRAME (); - struct buffer *curbuf - = XBUFFER (WGET (XWINDOW (f->selected_window), buffer)); + struct buffer *curbuf = XBUFFER (XWINDOW (f->selected_window)->buffer); if ([attribute isEqualToString:NSAccessibilityRoleAttribute]) return NSAccessibilityTextFieldRole; @@ -6237,7 +6236,7 @@ if (pixel_height == 0) pixel_height = 1; min_portion = 20 / pixel_height; - frame = XFRAME (WGET (XWINDOW (win), frame)); + frame = XFRAME (XWINDOW (win)->frame); if (FRAME_LIVE_P (frame)) { int i; === modified file 'src/print.c' --- src/print.c 2012-08-07 05:29:25 +0000 +++ src/print.c 2012-08-07 07:33:18 +0000 @@ -1773,10 +1773,10 @@ strout ("#sequence_number); strout (buf, len, len, printcharfun); - if (!NILP (WGET (XWINDOW (obj), buffer))) + if (!NILP (XWINDOW (obj)->buffer)) { strout (" on ", -1, -1, printcharfun); - print_string (BVAR (XBUFFER (WGET (XWINDOW (obj), buffer)), name), + print_string (BVAR (XBUFFER (XWINDOW (obj)->buffer), name), printcharfun); } PRINTCHAR ('>'); === modified file 'src/textprop.c' --- src/textprop.c 2012-08-06 10:24:26 +0000 +++ src/textprop.c 2012-08-07 07:33:18 +0000 @@ -587,7 +587,7 @@ if (WINDOWP (object)) { w = XWINDOW (object); - object = WGET (w, buffer); + object = w->buffer; } if (BUFFERP (object)) { === modified file 'src/w32fns.c' --- src/w32fns.c 2012-08-07 05:29:25 +0000 +++ src/w32fns.c 2012-08-07 07:33:18 +0000 @@ -5635,13 +5635,13 @@ WSET (w, total_lines, make_number (40)); } - FRAME_TOTAL_COLS (f) = XINT (WGET (w, total_cols)); + FRAME_TOTAL_COLS (f) = XINT (w->total_cols); adjust_glyphs (f); w->pseudo_window_p = 1; /* Display the tooltip text in a temporary buffer. */ old_buffer = current_buffer; - set_buffer_internal_1 (XBUFFER (WGET (XWINDOW (FRAME_ROOT_WINDOW (f)), buffer))); + set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer)); BVAR (current_buffer, truncate_lines) = Qnil; clear_glyph_matrix (w->desired_matrix); clear_glyph_matrix (w->current_matrix); === modified file 'src/w32menu.c' --- src/w32menu.c 2012-08-07 05:29:25 +0000 +++ src/w32menu.c 2012-08-07 07:33:18 +0000 @@ -394,7 +394,7 @@ if (! menubar_widget) previous_menu_items_used = 0; - buffer = WGET (XWINDOW (FRAME_SELECTED_WINDOW (f)), buffer); + buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer; specbind (Qinhibit_quit, Qt); /* Don't let the debugger step into this code because it is not reentrant. */ === modified file 'src/w32term.c' --- src/w32term.c 2012-08-07 05:29:25 +0000 +++ src/w32term.c 2012-08-07 07:33:18 +0000 @@ -649,7 +649,7 @@ x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritten_p) { - Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WGET (w, frame))); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); if (!w->pseudo_window_p) { @@ -754,7 +754,7 @@ overhead is very small. */ if (windows_or_buffers_changed && desired_row->full_width_p - && (f = XFRAME (WGET (w, frame)), + && (f = XFRAME (w->frame), width = FRAME_INTERNAL_BORDER_WIDTH (f), width != 0) && (height = desired_row->visible_height, @@ -2718,7 +2718,7 @@ static void x_scroll_run (struct window *w, struct run *run) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); int x, y, width, height, from_y, to_y, bottom_y; HWND hwnd = FRAME_W32_WINDOW (f); HRGN expect_dirty; @@ -3683,7 +3683,7 @@ w32_set_vertical_scroll_bar (struct window *w, int portion, int whole, int position) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); Lisp_Object barobj; struct scroll_bar *bar; int top, height, left, sb_left, width, sb_width; @@ -3724,7 +3724,7 @@ || WINDOW_RIGHT_MARGIN_COLS (w) == 0)); /* Does the scroll bar exist yet? */ - if (NILP (WGET (w, vertical_scroll_bar))) + if (NILP (w->vertical_scroll_bar)) { HDC hdc; BLOCK_INPUT; @@ -3746,7 +3746,7 @@ /* It may just need to be moved and resized. */ HWND hwnd; - bar = XSCROLL_BAR (WGET (w, vertical_scroll_bar)); + bar = XSCROLL_BAR (w->vertical_scroll_bar); hwnd = SCROLL_BAR_W32_WINDOW (bar); /* If already correctly positioned, do nothing. */ @@ -3853,10 +3853,10 @@ struct frame *f; /* We can't redeem this window's scroll bar if it doesn't have one. */ - if (NILP (WGET (window, vertical_scroll_bar))) + if (NILP (window->vertical_scroll_bar)) abort (); - bar = XSCROLL_BAR (WGET (window, vertical_scroll_bar)); + bar = XSCROLL_BAR (window->vertical_scroll_bar); /* Unlink it from the condemned list. */ f = XFRAME (WINDOW_FRAME (window)); @@ -3864,11 +3864,11 @@ { /* If the prev pointer is nil, it must be the first in one of the lists. */ - if (EQ (FRAME_SCROLL_BARS (f), WGET (window, vertical_scroll_bar))) + if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar)) /* It's not condemned. Everything's fine. */ return; else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), - WGET (window, vertical_scroll_bar))) + window->vertical_scroll_bar)) FSET (f, condemned_scroll_bars, bar->next); else /* If its prev pointer is nil, it must be at the front of @@ -4427,8 +4427,8 @@ create event iff we don't leave the selected frame. */ && (focus_follows_mouse - || (EQ (WGET (XWINDOW (window), frame), - WGET (XWINDOW (selected_window), frame))))) + || (EQ (XWINDOW (window)->frame, + XWINDOW (selected_window)->frame)))) { inev.kind = SELECT_WINDOW_EVENT; inev.frame_or_window = window; @@ -5043,7 +5043,7 @@ x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text_cursor_kinds kind) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); struct glyph *cursor_glyph; /* If cursor is out of bounds, don't draw garbage. This can happen === modified file 'src/window.c' --- src/window.c 2012-08-07 07:02:04 +0000 +++ src/window.c 2012-08-07 07:33:18 +0000 @@ -176,7 +176,7 @@ If WINDOW is omitted or nil, it defaults to the selected window. */) (Lisp_Object window) { - return WGET (decode_any_window (window), frame); + return decode_any_window (window)->frame; } DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0, @@ -242,12 +242,12 @@ window = XFRAME (frame_or_window)->root_window; } - while (NILP (WGET (XWINDOW (window), buffer))) + while (NILP (XWINDOW (window)->buffer)) { - if (! NILP (WGET (XWINDOW (window), hchild))) - window = WGET (XWINDOW (window), hchild); - else if (! NILP (WGET (XWINDOW (window), vchild))) - window = WGET (XWINDOW (window), vchild); + if (! NILP (XWINDOW (window)->hchild)) + window = XWINDOW (window)->hchild; + else if (! NILP (XWINDOW (window)->vchild)) + window = XWINDOW (window)->vchild; else abort (); } @@ -335,7 +335,7 @@ if (NILP (norecord)) { w->use_time = ++window_select_count; - record_buffer (WGET (w, buffer)); + record_buffer (w->buffer); } if (EQ (window, selected_window) && !inhibit_point_swap) @@ -363,17 +363,17 @@ if (!inhibit_point_swap) { ow = XWINDOW (selected_window); - if (! NILP (WGET (ow, buffer))) - set_marker_both (WGET (ow, pointm), WGET (ow, buffer), - BUF_PT (XBUFFER (WGET (ow, buffer))), - BUF_PT_BYTE (XBUFFER (WGET (ow, buffer)))); + if (! NILP (ow->buffer)) + set_marker_both (ow->pointm, ow->buffer, + BUF_PT (XBUFFER (ow->buffer)), + BUF_PT_BYTE (XBUFFER (ow->buffer))); } selected_window = window; - Fset_buffer (WGET (w, buffer)); + Fset_buffer (w->buffer); - BVAR (XBUFFER (WGET (w, buffer)), last_selected_window) = window; + BVAR (XBUFFER (w->buffer), last_selected_window) = window; /* Go to the point recorded in the window. This is important when the buffer is in more @@ -381,7 +381,7 @@ redisplay_window has altered point after scrolling, because it makes the change only in the window. */ { - register ptrdiff_t new_point = marker_position (WGET (w, pointm)); + register ptrdiff_t new_point = marker_position (w->pointm); if (new_point < BEGV) SET_PT (BEGV); else if (new_point > ZV) @@ -416,7 +416,7 @@ Return nil for an internal window or a deleted window. */) (Lisp_Object window) { - return WGET (decode_any_window (window), buffer); + return decode_any_window (window)->buffer; } DEFUN ("window-parent", Fwindow_parent, Swindow_parent, 0, 1, 0, @@ -425,7 +425,7 @@ Return nil for a window with no parent (e.g. a root window). */) (Lisp_Object window) { - return WGET (decode_any_window (window), parent); + return decode_any_window (window)->parent; } DEFUN ("window-top-child", Fwindow_top_child, Swindow_top_child, 1, 1, 0, @@ -436,7 +436,7 @@ (Lisp_Object window) { CHECK_WINDOW (window); - return WGET (decode_any_window (window), vchild); + return decode_any_window (window)->vchild; } DEFUN ("window-left-child", Fwindow_left_child, Swindow_left_child, 1, 1, 0, @@ -447,7 +447,7 @@ (Lisp_Object window) { CHECK_WINDOW (window); - return WGET (decode_any_window (window), hchild); + return decode_any_window (window)->hchild; } DEFUN ("window-next-sibling", Fwindow_next_sibling, Swindow_next_sibling, 0, 1, 0, @@ -456,7 +456,7 @@ Return nil if WINDOW has no next sibling. */) (Lisp_Object window) { - return WGET (decode_any_window (window), next); + return decode_any_window (window)->next; } DEFUN ("window-prev-sibling", Fwindow_prev_sibling, Swindow_prev_sibling, 0, 1, 0, @@ -465,7 +465,7 @@ Return nil if WINDOW has no previous sibling. */) (Lisp_Object window) { - return WGET (decode_any_window (window), prev); + return decode_any_window (window)->prev; } DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 1, 1, 0, @@ -475,7 +475,7 @@ WINDOW are never \(re-)combined with WINDOW's siblings. */) (Lisp_Object window) { - return WGET (decode_any_window (window), combination_limit); + return decode_any_window (window)->combination_limit; } DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0, @@ -512,7 +512,7 @@ integer multiple of the default character height. */) (Lisp_Object window) { - return WGET (decode_any_window (window), total_lines); + return decode_any_window (window)->total_lines; } DEFUN ("window-total-width", Fwindow_total_width, Swindow_total_width, 0, 1, 0, @@ -527,7 +527,7 @@ integer multiple of the default character width. */) (Lisp_Object window) { - return WGET (decode_any_window (window), total_cols); + return decode_any_window (window)->total_cols; } DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0, @@ -535,7 +535,7 @@ If WINDOW is omitted or nil, it defaults to the selected window. */) (Lisp_Object window) { - return WGET (decode_any_window (window), new_total); + return decode_any_window (window)->new_total; } DEFUN ("window-normal-size", Fwindow_normal_size, Swindow_normal_size, 0, 2, 0, @@ -544,10 +544,9 @@ If HORIZONTAL is non-nil, return the normal width of WINDOW. */) (Lisp_Object window, Lisp_Object horizontal) { - if (NILP (horizontal)) - return WGET (decode_any_window (window), normal_lines); - else - return WGET (decode_any_window (window), normal_cols); + struct window *w = decode_any_window (window); + + return NILP (horizontal) ? w->normal_lines : w->normal_cols; } DEFUN ("window-new-normal", Fwindow_new_normal, Swindow_new_normal, 0, 1, 0, @@ -555,7 +554,7 @@ If WINDOW is omitted or nil, it defaults to the selected window. */) (Lisp_Object window) { - return WGET (decode_any_window (window), new_normal); + return decode_any_window (window)->new_normal; } DEFUN ("window-left-column", Fwindow_left_column, Swindow_left_column, 0, 1, 0, @@ -567,7 +566,7 @@ If WINDOW is omitted or nil, it defaults to the selected window. */) (Lisp_Object window) { - return WGET (decode_any_window (window), left_col); + return decode_any_window (window)->left_col; } DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0, @@ -579,7 +578,7 @@ If WINDOW is omitted or nil, it defaults to the selected window. */) (Lisp_Object window) { - return WGET (decode_any_window (window), top_line); + return decode_any_window (window)->top_line; } /* Return the number of lines of W's body. Don't count any mode or @@ -588,7 +587,7 @@ static int window_body_lines (struct window *w) { - int height = XFASTINT (WGET (w, total_lines)); + int height = XFASTINT (w->total_lines); if (!MINI_WINDOW_P (w)) { @@ -610,7 +609,7 @@ window_body_cols (struct window *w) { struct frame *f = XFRAME (WINDOW_FRAME (w)); - int width = XINT (WGET (w, total_cols)); + int width = XINT (w->total_cols); if (WINDOW_HAS_VERTICAL_SCROLL_BAR (w)) /* Scroll bars occupy a few columns. */ @@ -685,7 +684,7 @@ /* Prevent redisplay shortcuts when changing the hscroll. */ if (w->hscroll != new_hscroll) - XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1; + XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; w->hscroll = new_hscroll; return make_number (new_hscroll); @@ -714,7 +713,7 @@ See `set-window-redisplay-end-trigger' for more information. */) (Lisp_Object window) { - return WGET (decode_window (window), redisplay_end_trigger); + return decode_window (window)->redisplay_end_trigger; } DEFUN ("set-window-redisplay-end-trigger", Fset_window_redisplay_end_trigger, @@ -744,7 +743,7 @@ (Lisp_Object window) { register struct window *w = decode_any_window (window); - CHECK_LIVE_FRAME (WGET (w, frame)); + CHECK_LIVE_FRAME (w->frame); return Fcons (make_number (WINDOW_LEFT_EDGE_COL (w)), Fcons (make_number (WINDOW_TOP_EDGE_LINE (w)), @@ -766,7 +765,7 @@ (Lisp_Object window) { register struct window *w = decode_any_window (window); - CHECK_LIVE_FRAME (WGET (w, frame)); + CHECK_LIVE_FRAME (w->frame); return Fcons (make_number (WINDOW_LEFT_EDGE_X (w)), Fcons (make_number (WINDOW_TOP_EDGE_Y (w)), @@ -778,7 +777,7 @@ static void calc_absolute_offset (struct window *w, int *add_x, int *add_y) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); *add_y = f->top_pos; #ifdef FRAME_MENUBAR_HEIGHT *add_y += FRAME_MENUBAR_HEIGHT (f); @@ -813,7 +812,7 @@ register struct window *w = decode_any_window (window); int add_x, add_y; - CHECK_LIVE_FRAME (WGET (w, frame)); + CHECK_LIVE_FRAME (w->frame); calc_absolute_offset (w, &add_x, &add_y); return Fcons (make_number (WINDOW_LEFT_EDGE_X (w) + add_x), @@ -1090,7 +1089,7 @@ CHECK_LIVE_WINDOW (window); w = XWINDOW (window); - f = XFRAME (WGET (w, frame)); + f = XFRAME (w->frame); CHECK_CONS (coordinates); lx = Fcar (coordinates); ly = Fcdr (coordinates); @@ -1270,9 +1269,9 @@ register struct window *w = decode_window (window); if (w == XWINDOW (selected_window) - && current_buffer == XBUFFER (WGET (w, buffer))) + && current_buffer == XBUFFER (w->buffer)) return Fpoint (); - return Fmarker_position (WGET (w, pointm)); + return Fmarker_position (w->pointm); } DEFUN ("window-start", Fwindow_start, Swindow_start, 0, 1, 0, @@ -1281,7 +1280,7 @@ This is updated by redisplay or by calling `set-window-start'. */) (Lisp_Object window) { - return Fmarker_position (WGET (decode_window (window), start)); + return Fmarker_position (decode_window (window)->start); } /* This is text temporarily removed from the doc string below. @@ -1312,7 +1311,7 @@ Lisp_Object buf; struct buffer *b; - buf = WGET (w, buffer); + buf = w->buffer; CHECK_BUFFER (buf); b = XBUFFER (buf); @@ -1321,12 +1320,12 @@ The user can compute it with vertical-motion if he wants to. It would be nicer to do it automatically, but that's so slow that it would probably bother people. */ - if (NILP (WGET (w, window_end_valid))) + if (NILP (w->window_end_valid)) return Qnil; #endif if (! NILP (update) - && ! (! NILP (WGET (w, window_end_valid)) + && ! (! NILP (w->window_end_valid) && w->last_modified >= BUF_MODIFF (b) && w->last_overlay_modified >= BUF_OVERLAY_MODIFF (b)) && !noninteractive) @@ -1349,12 +1348,12 @@ `-l' containing a call to `rmail' with subsequent other commands. At the end, W->start happened to be BEG, while rmail had already narrowed the buffer. */ - if (XMARKER (WGET (w, start))->charpos < BEGV) + if (XMARKER (w->start)->charpos < BEGV) SET_TEXT_POS (startp, BEGV, BEGV_BYTE); - else if (XMARKER (WGET (w, start))->charpos > ZV) + else if (XMARKER (w->start)->charpos > ZV) SET_TEXT_POS (startp, ZV, ZV_BYTE); else - SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start)); + SET_TEXT_POS_FROM_MARKER (startp, w->start); itdata = bidi_shelve_cache (); start_display (&it, w, startp); @@ -1368,7 +1367,7 @@ set_buffer_internal (old_buffer); } else - XSETINT (value, BUF_Z (b) - XFASTINT (WGET (w, window_end_pos))); + XSETINT (value, BUF_Z (b) - XFASTINT (w->window_end_pos)); return value; } @@ -1382,10 +1381,10 @@ CHECK_NUMBER_COERCE_MARKER (pos); if (w == XWINDOW (selected_window) - && XBUFFER (WGET (w, buffer)) == current_buffer) + && XBUFFER (w->buffer) == current_buffer) Fgoto_char (pos); else - set_marker_restricted (WGET (w, pointm), pos, WGET (w, buffer)); + set_marker_restricted (w->pointm, pos, w->buffer); /* We have to make sure that redisplay updates the window to show the new value of point. */ @@ -1405,7 +1404,7 @@ register struct window *w = decode_window (window); CHECK_NUMBER_COERCE_MARKER (pos); - set_marker_restricted (WGET (w, start), pos, WGET (w, buffer)); + set_marker_restricted (w->start, pos, w->buffer); /* this is not right, but much easier than doing what is right. */ w->start_at_line_beg = 0; if (NILP (noforce)) @@ -1447,8 +1446,8 @@ int x, y; w = decode_window (window); - buf = XBUFFER (WGET (w, buffer)); - SET_TEXT_POS_FROM_MARKER (top, WGET (w, start)); + buf = XBUFFER (w->buffer); + SET_TEXT_POS_FROM_MARKER (top, w->start); if (EQ (pos, Qt)) posint = -1; @@ -1460,7 +1459,7 @@ else if (w == XWINDOW (selected_window)) posint = PT; else - posint = XMARKER (WGET (w, pointm))->charpos; + posint = XMARKER (w->pointm)->charpos; /* If position is above window start or outside buffer boundaries, or if window start is out of range, position is not visible. */ @@ -1517,11 +1516,11 @@ if (noninteractive || w->pseudo_window_p) return Qnil; - CHECK_BUFFER (WGET (w, buffer)); - b = XBUFFER (WGET (w, buffer)); + CHECK_BUFFER (w->buffer); + b = XBUFFER (w->buffer); /* Fail if current matrix is not up-to-date. */ - if (NILP (WGET (w, window_end_valid)) + if (NILP (w->window_end_valid) || current_buffer->clip_changed || current_buffer->prevent_redisplay_optimizations_p || w->last_modified < BUF_MODIFF (b) @@ -1614,7 +1613,7 @@ is the value returned by `window-dedicated-p' is t. */) (Lisp_Object window) { - return WGET (decode_window (window), dedicated); + return decode_window (window)->dedicated; } DEFUN ("set-window-dedicated-p", Fset_window_dedicated_p, @@ -1651,7 +1650,7 @@ window for that buffer, and POS is a window-specific point value. */) (Lisp_Object window) { - return WGET (decode_window (window), prev_buffers); + return decode_window (window)->prev_buffers; } DEFUN ("set-window-prev-buffers", Fset_window_prev_buffers, @@ -1673,7 +1672,7 @@ WINDOW must be a live window and defaults to the selected one. */) (Lisp_Object window) { - return WGET (decode_window (window), next_buffers); + return decode_window (window)->next_buffers; } DEFUN ("set-window-next-buffers", Fset_window_next_buffers, @@ -1693,7 +1692,7 @@ elements of the form (PARAMETER . VALUE). */) (Lisp_Object window) { - return Fcopy_alist (WGET (decode_any_window (window), window_parameters)); + return Fcopy_alist (decode_any_window (window)->window_parameters); } DEFUN ("window-parameter", Fwindow_parameter, Swindow_parameter, @@ -1704,8 +1703,7 @@ { Lisp_Object result; - result = Fassq (parameter, WGET (decode_any_window (window), - window_parameters)); + result = Fassq (parameter, decode_any_window (window)->window_parameters); return CDR_SAFE (result); } @@ -1718,10 +1716,10 @@ register struct window *w = decode_any_window (window); Lisp_Object old_alist_elt; - old_alist_elt = Fassq (parameter, WGET (w, window_parameters)); + old_alist_elt = Fassq (parameter, w->window_parameters); if (NILP (old_alist_elt)) WSET (w, window_parameters, - Fcons (Fcons (parameter, value), WGET (w, window_parameters))); + Fcons (Fcons (parameter, value), w->window_parameters)); else Fsetcdr (old_alist_elt, value); return value; @@ -1733,7 +1731,7 @@ WINDOW defaults to the selected window. */) (Lisp_Object window) { - return WGET (decode_window (window), display_table); + return decode_window (window)->display_table; } /* Get the display table for use on window W. This is either W's @@ -1746,11 +1744,11 @@ { struct Lisp_Char_Table *dp = NULL; - if (DISP_TABLE_P (WGET (w, display_table))) - dp = XCHAR_TABLE (WGET (w, display_table)); - else if (BUFFERP (WGET (w, buffer))) + if (DISP_TABLE_P (w->display_table)) + dp = XCHAR_TABLE (w->display_table); + else if (BUFFERP (w->buffer)) { - struct buffer *b = XBUFFER (WGET (w, buffer)); + struct buffer *b = XBUFFER (w->buffer); if (DISP_TABLE_P (BVAR (b, display_table))) dp = XCHAR_TABLE (BVAR (b, display_table)); @@ -1776,14 +1774,14 @@ Lisp_Object buf; struct buffer *b; - buf = WGET (w, buffer); + buf = w->buffer; b = XBUFFER (buf); - if (b != XMARKER (WGET (w, pointm))->buffer) + if (b != XMARKER (w->pointm)->buffer) abort (); #if 0 if (w == XWINDOW (selected_window) - || ! EQ (buf, WGET (XWINDOW (selected_window), buffer))) + || ! EQ (buf, XWINDOW (selected_window)->buffer)) /* Do this except when the selected window's buffer is being removed from some other window. */ #endif @@ -1794,22 +1792,22 @@ selected window, while last_window_start reflects another window which was recently showing the same buffer. Some people might say that might be a good thing. Let's see. */ - b->last_window_start = marker_position (WGET (w, start)); + b->last_window_start = marker_position (w->start); /* Point in the selected window's buffer is actually stored in that buffer, and the window's pointm isn't used. So don't clobber point in that buffer. */ - if (! EQ (buf, WGET (XWINDOW (selected_window), buffer)) + if (! EQ (buf, XWINDOW (selected_window)->buffer) /* This line helps to fix Horsley's testbug.el bug. */ && !(WINDOWP (BVAR (b, last_selected_window)) && w != XWINDOW (BVAR (b, last_selected_window)) - && EQ (buf, WGET (XWINDOW (BVAR (b, last_selected_window)), buffer)))) + && EQ (buf, XWINDOW (BVAR (b, last_selected_window))->buffer))) temp_set_point_both (b, clip_to_bounds (BUF_BEGV (b), - XMARKER (WGET (w, pointm))->charpos, + XMARKER (w->pointm)->charpos, BUF_ZV (b)), clip_to_bounds (BUF_BEGV_BYTE (b), - marker_byte_position (WGET (w, pointm)), + marker_byte_position (w->pointm), BUF_ZV_BYTE (b))); if (WINDOWP (BVAR (b, last_selected_window)) @@ -1828,18 +1826,18 @@ /* If OLD is its frame's root window, then NEW is the new root window for that frame. */ - if (EQ (old, FRAME_ROOT_WINDOW (XFRAME (WGET (o, frame))))) - FSET (XFRAME (WGET (o, frame)), root_window, new); + if (EQ (old, FRAME_ROOT_WINDOW (XFRAME (o->frame)))) + FSET (XFRAME (o->frame), root_window, new); if (setflag) { - WSET (n, left_col, WGET (o, left_col)); - WSET (n, top_line, WGET (o, top_line)); - WSET (n, total_cols, WGET (o, total_cols)); - WSET (n, total_lines, WGET (o, total_lines)); - WSET (n, normal_cols, WGET (o, normal_cols)); + WSET (n, left_col, o->left_col); + WSET (n, top_line, o->top_line); + WSET (n, total_cols, o->total_cols); + WSET (n, total_lines, o->total_lines); + WSET (n, normal_cols, o->normal_cols); WSET (o, normal_cols, make_float (1.0)); - WSET (n, normal_lines, WGET (o, normal_lines)); + WSET (n, normal_lines, o->normal_lines); WSET (o, normal_lines, make_float (1.0)); n->desired_matrix = n->current_matrix = 0; n->vscroll = 0; @@ -1856,23 +1854,23 @@ n->frozen_window_start_p = 0; } - tem = WGET (o, next); + tem = o->next; WSET (n, next, tem); if (!NILP (tem)) WSET (XWINDOW (tem), prev, new); - tem = WGET (o, prev); + tem = o->prev; WSET (n, prev, tem); if (!NILP (tem)) WSET (XWINDOW (tem), next, new); - tem = WGET (o, parent); + tem = o->parent; WSET (n, parent, tem); if (!NILP (tem)) { - if (EQ (WGET (XWINDOW (tem), vchild), old)) + if (EQ (XWINDOW (tem)->vchild, old)) WSET (XWINDOW (tem), vchild, new); - if (EQ (WGET (XWINDOW (tem), hchild), old)) + if (EQ (XWINDOW (tem)->hchild, old)) WSET (XWINDOW (tem), hchild, new); } } @@ -1889,30 +1887,30 @@ int horflag; w = XWINDOW (window); - parent = WGET (w, parent); - if (!NILP (parent) && NILP (WGET (w, combination_limit))) + parent = w->parent; + if (!NILP (parent) && NILP (w->combination_limit)) { p = XWINDOW (parent); - if (((!NILP (WGET (p, vchild)) && !NILP (WGET (w, vchild))) - || (!NILP (WGET (p, hchild)) && !NILP (WGET (w, hchild))))) + if (((!NILP (p->vchild) && !NILP (w->vchild)) + || (!NILP (p->hchild) && !NILP (w->hchild)))) /* WINDOW and PARENT are both either a vertical or a horizontal combination. */ { - horflag = NILP (WGET (w, vchild)); - child = horflag ? WGET (w, hchild) : WGET (w, vchild); + horflag = NILP (w->vchild); + child = horflag ? w->hchild : w->vchild; c = XWINDOW (child); /* Splice WINDOW's children into its parent's children and assign new normal sizes. */ - if (NILP (WGET (w, prev))) + if (NILP (w->prev)) if (horflag) WSET (p, hchild, child); else WSET (p, vchild, child); else { - WSET (c, prev, WGET (w, prev)); - WSET (XWINDOW (WGET (w, prev)), next, child); + WSET (c, prev, w->prev); + WSET (XWINDOW (w->prev), next, child); } while (c) @@ -1921,26 +1919,26 @@ if (horflag) WSET (c, normal_cols, - make_float (XFLOATINT (WGET (c, total_cols)) - / XFLOATINT (WGET (p, total_cols)))); + make_float (XFLOATINT (c->total_cols) + / XFLOATINT (p->total_cols))); else WSET (c, normal_lines, - make_float (XFLOATINT (WGET (c, total_lines)) - / XFLOATINT (WGET (p, total_lines)))); + make_float (XFLOATINT (c->total_lines) + / XFLOATINT (p->total_lines))); - if (NILP (WGET (c, next))) + if (NILP (c->next)) { - if (!NILP (WGET (w, next))) + if (!NILP (w->next)) { - WSET (c, next, WGET (w, next)); - WSET (XWINDOW (WGET (c, next)), prev, child); + WSET (c, next, w->next); + WSET (XWINDOW (c->next), prev, child); } c = 0; } else { - child = WGET (c, next); + child = c->next; c = XWINDOW (child); } } @@ -2030,10 +2028,10 @@ candidate_window_p (Lisp_Object window, Lisp_Object owindow, Lisp_Object minibuf, Lisp_Object all_frames) { struct window *w = XWINDOW (window); - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); int candidate_p = 1; - if (!BUFFERP (WGET (w, buffer))) + if (!BUFFERP (w->buffer)) candidate_p = 0; else if (MINI_WINDOW_P (w) && (EQ (minibuf, Qlambda) @@ -2048,13 +2046,13 @@ else if (NILP (all_frames)) { eassert (WINDOWP (owindow)); - candidate_p = EQ (WGET (w, frame), WGET (XWINDOW (owindow), frame)); + candidate_p = EQ (w->frame, XWINDOW (owindow)->frame); } else if (EQ (all_frames, Qvisible)) { FRAME_SAMPLE_VISIBILITY (f); candidate_p = FRAME_VISIBLE_P (f) - && (FRAME_TERMINAL (XFRAME (WGET (w, frame))) + && (FRAME_TERMINAL (XFRAME (w->frame)) == FRAME_TERMINAL (XFRAME (selected_frame))); } @@ -2073,15 +2071,15 @@ && !f->output_data.x->has_been_visible) #endif ) - && (FRAME_TERMINAL (XFRAME (WGET (w, frame))) + && (FRAME_TERMINAL (XFRAME (w->frame)) == FRAME_TERMINAL (XFRAME (selected_frame))); } else if (WINDOWP (all_frames)) candidate_p = (EQ (FRAME_MINIBUF_WINDOW (f), all_frames) - || EQ (WGET (XWINDOW (all_frames), frame), WGET (w, frame)) - || EQ (WGET (XWINDOW (all_frames), frame), FRAME_FOCUS_FRAME (f))); + || EQ (XWINDOW (all_frames)->frame, w->frame) + || EQ (XWINDOW (all_frames)->frame, FRAME_FOCUS_FRAME (f))); else if (FRAMEP (all_frames)) - candidate_p = EQ (all_frames, WGET (w, frame)); + candidate_p = EQ (all_frames, w->frame); return candidate_p; } @@ -2114,7 +2112,7 @@ if (NILP (*all_frames)) *all_frames = (!EQ (*minibuf, Qlambda) - ? FRAME_MINIBUF_WINDOW (XFRAME (WGET (XWINDOW (*window), frame))) + ? FRAME_MINIBUF_WINDOW (XFRAME (XWINDOW (*window)->frame)) : Qnil); else if (EQ (*all_frames, Qvisible)) ; @@ -2140,7 +2138,7 @@ /* If ALL_FRAMES is a frame, and WINDOW isn't on that frame, just return the first window on the frame. */ if (FRAMEP (all_frames) - && !EQ (all_frames, WGET (XWINDOW (window), frame))) + && !EQ (all_frames, XWINDOW (window)->frame)) return Fframe_first_window (all_frames); if (next_p) @@ -2320,7 +2318,7 @@ if (NILP (frame)) frame = selected_frame; - if (!EQ (frame, WGET (XWINDOW (window), frame))) + if (!EQ (frame, XWINDOW (window)->frame)) error ("Window is on a different frame"); return window_list_1 (window, minibuf, frame); @@ -2441,7 +2439,7 @@ switch (type) { case GET_BUFFER_WINDOW: - if (EQ (WGET (w, buffer), obj) + if (EQ (w->buffer, obj) /* Don't find any minibuffer window except the one that is currently in use. */ && (MINI_WINDOW_P (w) ? EQ (window, minibuf_window) : 1)) @@ -2449,7 +2447,7 @@ if (EQ (window, selected_window)) /* Preferably return the selected window. */ RETURN_UNGCPRO (window); - else if (EQ (WGET (XWINDOW (window), frame), selected_frame) + else if (EQ (XWINDOW (window)->frame, selected_frame) && !frame_best_window_flag) /* Prefer windows on the current frame (but don't choose another one if we have one already). */ @@ -2465,25 +2463,25 @@ case REPLACE_BUFFER_IN_WINDOWS_SAFELY: /* We could simply check whether the buffer shown by window is live, and show another buffer in case it isn't. */ - if (EQ (WGET (w, buffer), obj)) + if (EQ (w->buffer, obj)) { /* Undedicate WINDOW. */ WSET (w, dedicated, Qnil); /* Make WINDOW show the buffer returned by other_buffer_safely, don't run any hooks. */ set_window_buffer - (window, other_buffer_safely (WGET (w, buffer)), 0, 0); + (window, other_buffer_safely (w->buffer), 0, 0); /* If WINDOW is the selected window, make its buffer current. But do so only if the window shows the current buffer (Bug#6454). */ if (EQ (window, selected_window) - && XBUFFER (WGET (w, buffer)) == current_buffer) - Fset_buffer (WGET (w, buffer)); + && XBUFFER (w->buffer) == current_buffer) + Fset_buffer (w->buffer); } break; case REDISPLAY_BUFFER_WINDOWS: - if (EQ (WGET (w, buffer), obj)) + if (EQ (w->buffer, obj)) { mark_window_display_accurate (window, 0); w->update_mode_line = 1; @@ -2495,8 +2493,8 @@ /* Check for a window that has a killed buffer. */ case CHECK_ALL_WINDOWS: - if (! NILP (WGET (w, buffer)) - && NILP (BVAR (XBUFFER (WGET (w, buffer)), name))) + if (! NILP (w->buffer) + && NILP (BVAR (XBUFFER (w->buffer), name))) abort (); break; @@ -2582,9 +2580,9 @@ int top IF_LINT (= 0), new_top, resize_failed; w = decode_any_window (window); - CHECK_LIVE_FRAME (WGET (w, frame)); + CHECK_LIVE_FRAME (w->frame); XSETWINDOW (window, w); - f = XFRAME (WGET (w, frame)); + f = XFRAME (w->frame); if (NILP (root)) /* ROOT is the frame's root window. */ @@ -2596,13 +2594,13 @@ /* ROOT must be an ancestor of WINDOW. */ { r = decode_any_window (root); - CHECK_LIVE_FRAME (WGET (r, frame)); - pwindow = WGET (XWINDOW (window), parent); + CHECK_LIVE_FRAME (r->frame); + pwindow = XWINDOW (window)->parent; while (!NILP (pwindow)) if (EQ (pwindow, root)) break; else - pwindow = WGET (XWINDOW (pwindow), parent); + pwindow = XWINDOW (pwindow)->parent; if (!EQ (pwindow, root)) error ("Specified root is not an ancestor of specified window"); } @@ -2616,15 +2614,15 @@ else if (MINI_WINDOW_P (w)) /* && top > 0) */ error ("Can't expand minibuffer to full frame"); - if (!NILP (WGET (w, buffer))) + if (!NILP (w->buffer)) { - startpos = marker_position (WGET (w, start)); + startpos = marker_position (w->start); top = WINDOW_TOP_EDGE_LINE (w) - FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w))); /* Make sure WINDOW is the frame's selected window. */ if (!EQ (window, FRAME_SELECTED_WINDOW (f))) { - if (EQ (selected_frame, WGET (w, frame))) + if (EQ (selected_frame, w->frame)) Fselect_window (window, Qnil); else FSET (f, selected_window, window); @@ -2641,7 +2639,7 @@ { pwindow = swindow; while (!NILP (pwindow) && !EQ (window, pwindow)) - pwindow = WGET (XWINDOW (pwindow), parent); + pwindow = XWINDOW (pwindow)->parent; if (EQ (window, pwindow)) /* If WINDOW is an ancestor of SWINDOW, then SWINDOW is ok @@ -2654,7 +2652,7 @@ if (!EQ (swindow, FRAME_SELECTED_WINDOW (f))) { - if (EQ (selected_frame, WGET (w, frame))) + if (EQ (selected_frame, w->frame)) Fselect_window (swindow, Qnil); else FSET (f, selected_window, swindow); @@ -2687,12 +2685,12 @@ FRAME_WINDOW_SIZES_CHANGED (f) = 1; resize_failed = 0; - if (NILP (WGET (w, buffer))) + if (NILP (w->buffer)) { /* Resize child windows vertically. */ - XSETINT (delta, XINT (WGET (r, total_lines)) - - XINT (WGET (w, total_lines))); - WSET (w, top_line, WGET (r, top_line)); + XSETINT (delta, XINT (r->total_lines) + - XINT (w->total_lines)); + WSET (w, top_line, r->top_line); resize_root_window (window, delta, Qnil, Qnil); if (window_resize_check (w, 0)) window_resize_apply (w, 0); @@ -2708,10 +2706,10 @@ /* Resize child windows horizontally. */ if (!resize_failed) { - WSET (w, left_col, WGET (r, left_col)); - XSETINT (delta, XINT (WGET (r, total_cols)) - - XINT (WGET (w, total_cols))); - WSET (w, left_col, WGET (r, left_col)); + WSET (w, left_col, r->left_col); + XSETINT (delta, XINT (r->total_cols) + - XINT (w->total_cols)); + WSET (w, left_col, r->left_col); resize_root_window (window, delta, Qt, Qnil); if (window_resize_check (w, 1)) window_resize_apply (w, 1); @@ -2734,43 +2732,43 @@ } /* Cleanly unlink WINDOW from window-tree. */ - if (!NILP (WGET (w, prev))) + if (!NILP (w->prev)) /* Get SIBLING above (on the left of) WINDOW. */ { - sibling = WGET (w, prev); + sibling = w->prev; s = XWINDOW (sibling); - WSET (s, next, WGET (w, next)); - if (!NILP (WGET (s, next))) - WSET (XWINDOW (WGET (s, next)), prev, sibling); + WSET (s, next, w->next); + if (!NILP (s->next)) + WSET (XWINDOW (s->next), prev, sibling); } else /* Get SIBLING below (on the right of) WINDOW. */ { - sibling = WGET (w, next); + sibling = w->next; s = XWINDOW (sibling); WSET (s, prev, Qnil); - if (!NILP (WGET (XWINDOW (WGET (w, parent)), vchild))) - WSET (XWINDOW (WGET (w, parent)), vchild, sibling); + if (!NILP (XWINDOW (w->parent)->vchild)) + WSET (XWINDOW (w->parent), vchild, sibling); else - WSET (XWINDOW (WGET (w, parent)), hchild, sibling); + WSET (XWINDOW (w->parent), hchild, sibling); } /* Delete ROOT and all child windows of ROOT. */ - if (!NILP (WGET (r, vchild))) + if (!NILP (r->vchild)) { - delete_all_child_windows (WGET (r, vchild)); + delete_all_child_windows (r->vchild); WSET (r, vchild, Qnil); } - else if (!NILP (WGET (r, hchild))) + else if (!NILP (r->hchild)) { - delete_all_child_windows (WGET (r, hchild)); + delete_all_child_windows (r->hchild); WSET (r, hchild, Qnil); } replace_window (root, window, 1); /* This must become SWINDOW anyway ....... */ - if (!NILP (WGET (w, buffer)) && !resize_failed) + if (!NILP (w->buffer) && !resize_failed) { /* Try to minimize scrolling, by setting the window start to the point will cause the text at the old window start to be at the @@ -2779,18 +2777,18 @@ when the display is not current, due to typeahead). */ new_top = WINDOW_TOP_EDGE_LINE (w) - FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w))); if (new_top != top - && startpos >= BUF_BEGV (XBUFFER (WGET (w, buffer))) - && startpos <= BUF_ZV (XBUFFER (WGET (w, buffer)))) + && startpos >= BUF_BEGV (XBUFFER (w->buffer)) + && startpos <= BUF_ZV (XBUFFER (w->buffer))) { struct position pos; struct buffer *obuf = current_buffer; - Fset_buffer (WGET (w, buffer)); + Fset_buffer (w->buffer); /* This computation used to temporarily move point, but that can have unwanted side effects due to text properties. */ pos = *vmotion (startpos, -top, w); - set_marker_both (WGET (w, start), WGET (w, buffer), pos.bufpos, pos.bytepos); + set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos); WSET (w, window_end_valid, Qnil); w->start_at_line_beg = (pos.bytepos == BEGV_BYTE || FETCH_BYTE (pos.bytepos - 1) == '\n'); @@ -2987,7 +2985,7 @@ struct window *w = XWINDOW (window); struct buffer *b = XBUFFER (buffer); ptrdiff_t count = SPECPDL_INDEX (); - int samebuf = EQ (buffer, WGET (w, buffer)); + int samebuf = EQ (buffer, w->buffer); WSET (w, buffer, buffer); @@ -3017,8 +3015,8 @@ whenever we resize the frame. */ w->hscroll = w->min_hscroll = 0; w->vscroll = 0; - set_marker_both (WGET (w, pointm), buffer, BUF_PT (b), BUF_PT_BYTE (b)); - set_marker_restricted (WGET (w, start), + set_marker_both (w->pointm, buffer, BUF_PT (b), BUF_PT_BYTE (b)); + set_marker_restricted (w->start, make_number (b->last_window_start), buffer); w->start_at_line_beg = 0; @@ -3039,7 +3037,7 @@ Fset_buffer (buffer); } - XMARKER (WGET (w, pointm))->insertion_type = !NILP (Vwindow_point_insertion_type); + XMARKER (w->pointm)->insertion_type = !NILP (Vwindow_point_insertion_type); if (!keep_margins_p) { @@ -3047,8 +3045,8 @@ /* This may call adjust_window_margins three times, so temporarily disable window margins. */ - Lisp_Object save_left = WGET (w, left_margin_cols); - Lisp_Object save_right = WGET (w, right_margin_cols); + Lisp_Object save_left = w->left_margin_cols; + Lisp_Object save_right = w->right_margin_cols; WSET (w, left_margin_cols, Qnil); WSET (w, right_margin_cols, Qnil); @@ -3072,7 +3070,7 @@ { if (! NILP (Vwindow_scroll_functions)) run_hook_with_args_2 (Qwindow_scroll_functions, window, - Fmarker_position (WGET (w, start))); + Fmarker_position (w->start)); run_window_configuration_change_hook (XFRAME (WINDOW_FRAME (w))); } @@ -3106,7 +3104,7 @@ if (NILP (BVAR (XBUFFER (buffer), name))) error ("Attempt to display deleted buffer"); - tem = WGET (w, buffer); + tem = w->buffer; if (NILP (tem)) error ("Window is deleted"); else if (!EQ (tem, Qt)) @@ -3114,7 +3112,7 @@ { if (!EQ (tem, buffer)) { - if (EQ (WGET (w, dedicated), Qt)) + if (EQ (w->dedicated, Qt)) /* WINDOW is strongly dedicated to its buffer, signal an error. */ error ("Window is dedicated to `%s'", SDATA (BVAR (XBUFFER (tem), name))); @@ -3160,8 +3158,8 @@ struct window *w = XWINDOW (object); mark_window_display_accurate (object, 0); w->update_mode_line = 1; - if (BUFFERP (WGET (w, buffer))) - XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1; + if (BUFFERP (w->buffer)) + XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; ++update_mode_lines; return Qt; } @@ -3206,14 +3204,14 @@ { window = display_buffer (buf, Qnil, Qnil); - if (!EQ (WGET (XWINDOW (window), frame), selected_frame)) + if (!EQ (XWINDOW (window)->frame, selected_frame)) Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window))); Vminibuf_scroll_window = window; w = XWINDOW (window); w->hscroll = 0; w->min_hscroll = 0; - set_marker_restricted_both (WGET (w, start), buf, BEG, BEG); - set_marker_restricted_both (WGET (w, pointm), buf, BEG, BEG); + set_marker_restricted_both (w->start, buf, BEG, BEG); + set_marker_restricted_both (w->pointm, buf, BEG, BEG); /* Run temp-buffer-show-hook, with the chosen window selected and its buffer current. */ @@ -3230,7 +3228,7 @@ record_unwind_protect (Fset_buffer, prev_buffer); record_unwind_protect (select_window_norecord, prev_window); Fselect_window (window, Qt); - Fset_buffer (WGET (w, buffer)); + Fset_buffer (w->buffer); Frun_hooks (1, &Qtemp_buffer_show_hook); unbind_to (count, Qnil); } @@ -3334,9 +3332,9 @@ if (NILP (add)) WSET (w, new_total, size); else - WSET (w, new_total, make_number (XINT (WGET (w, new_total)) + XINT (size))); + WSET (w, new_total, make_number (XINT (w->new_total) + XINT (size))); - return WGET (w, new_total); + return w->new_total; } DEFUN ("set-window-new-normal", Fset_window_new_normal, Sset_window_new_normal, 1, 2, 0, @@ -3361,19 +3359,19 @@ { struct window *c; - if (!NILP (WGET (w, vchild))) + if (!NILP (w->vchild)) /* W is a vertical combination. */ { - c = XWINDOW (WGET (w, vchild)); + c = XWINDOW (w->vchild); if (horflag) /* All child windows of W must have the same width as W. */ { while (c) { - if ((XINT (WGET (c, new_total)) != XINT (WGET (w, new_total))) + if ((XINT (c->new_total) != XINT (w->new_total)) || !window_resize_check (c, horflag)) return 0; - c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next)); + c = NILP (c->next) ? 0 : XWINDOW (c->next); } return 1; } @@ -3386,16 +3384,16 @@ { if (!window_resize_check (c, horflag)) return 0; - sum_of_sizes = sum_of_sizes + XINT (WGET (c, new_total)); - c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next)); + sum_of_sizes = sum_of_sizes + XINT (c->new_total); + c = NILP (c->next) ? 0 : XWINDOW (c->next); } - return (sum_of_sizes == XINT (WGET (w, new_total))); + return (sum_of_sizes == XINT (w->new_total)); } } - else if (!NILP (WGET (w, hchild))) + else if (!NILP (w->hchild)) /* W is a horizontal combination. */ { - c = XWINDOW (WGET (w, hchild)); + c = XWINDOW (w->hchild); if (horflag) /* The sum of the widths of the child windows of W must equal W's width. */ @@ -3405,20 +3403,20 @@ { if (!window_resize_check (c, horflag)) return 0; - sum_of_sizes = sum_of_sizes + XINT (WGET (c, new_total)); - c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next)); + sum_of_sizes = sum_of_sizes + XINT (c->new_total); + c = NILP (c->next) ? 0 : XWINDOW (c->next); } - return (sum_of_sizes == XINT (WGET (w, new_total))); + return (sum_of_sizes == XINT (w->new_total)); } else /* All child windows of W must have the same height as W. */ { while (c) { - if ((XINT (WGET (c, new_total)) != XINT (WGET (w, new_total))) + if ((XINT (c->new_total) != XINT (w->new_total)) || !window_resize_check (c, horflag)) return 0; - c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next)); + c = NILP (c->next) ? 0 : XWINDOW (c->next); } return 1; } @@ -3427,7 +3425,7 @@ /* A leaf window. Make sure it's not too small. The following hardcodes the values of `window-safe-min-width' (2) and `window-safe-min-height' (1) which are defined in window.el. */ - return XINT (WGET (w, new_total)) >= (horflag ? 2 : 1); + return XINT (w->new_total) >= (horflag ? 2 : 1); } /* Set w->total_lines (w->total_cols if HORIZONTAL is non-zero) to @@ -3447,25 +3445,25 @@ parent window has been set *before*. */ if (horflag) { - WSET (w, total_cols, WGET (w, new_total)); - if (NUMBERP (WGET (w, new_normal))) - WSET (w, normal_cols, WGET (w, new_normal)); + WSET (w, total_cols, w->new_total); + if (NUMBERP (w->new_normal)) + WSET (w, normal_cols, w->new_normal); - pos = XINT (WGET (w, left_col)); + pos = XINT (w->left_col); } else { - WSET (w, total_lines, WGET (w, new_total)); - if (NUMBERP (WGET (w, new_normal))) - WSET (w, normal_lines, WGET (w, new_normal)); + WSET (w, total_lines, w->new_total); + if (NUMBERP (w->new_normal)) + WSET (w, normal_lines, w->new_normal); - pos = XINT (WGET (w, top_line)); + pos = XINT (w->top_line); } - if (!NILP (WGET (w, vchild))) + if (!NILP (w->vchild)) /* W is a vertical combination. */ { - c = XWINDOW (WGET (w, vchild)); + c = XWINDOW (w->vchild); while (c) { if (horflag) @@ -3474,14 +3472,14 @@ WSET (c, top_line, make_number (pos)); window_resize_apply (c, horflag); if (!horflag) - pos = pos + XINT (WGET (c, total_lines)); - c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next)); + pos = pos + XINT (c->total_lines); + c = NILP (c->next) ? 0 : XWINDOW (c->next); } } - else if (!NILP (WGET (w, hchild))) + else if (!NILP (w->hchild)) /* W is a horizontal combination. */ { - c = XWINDOW (WGET (w, hchild)); + c = XWINDOW (w->hchild); while (c) { if (horflag) @@ -3490,8 +3488,8 @@ WSET (c, top_line, make_number (pos)); window_resize_apply (c, horflag); if (horflag) - pos = pos + XINT (WGET (c, total_cols)); - c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next)); + pos = pos + XINT (c->total_cols); + c = NILP (c->next) ? 0 : XWINDOW (c->next); } } @@ -3527,8 +3525,8 @@ r = XWINDOW (FRAME_ROOT_WINDOW (f)); if (!window_resize_check (r, horflag) - || ! EQ (WGET (r, new_total), - (horflag ? WGET (r, total_cols) : WGET (r, total_lines)))) + || ! EQ (r->new_total, + (horflag ? r->total_cols : r->total_lines))) return Qnil; BLOCK_INPUT; @@ -3569,7 +3567,7 @@ ? 1 : 0))); WSET (r, top_line, make_number (FRAME_TOP_MARGIN (f))); - if (NILP (WGET (r, vchild)) && NILP (WGET (r, hchild))) + if (NILP (r->vchild) && NILP (r->hchild)) /* For a leaf root window just set the size. */ if (horflag) WSET (r, total_cols, make_number (new_size)); @@ -3578,29 +3576,29 @@ else { /* old_size is the old size of the frame's root window. */ - int old_size = XFASTINT (horflag ? WGET (r, total_cols) - : WGET (r, total_lines)); + int old_size = XFASTINT (horflag ? r->total_cols + : r->total_lines); Lisp_Object delta; XSETINT (delta, new_size - old_size); /* Try a "normal" resize first. */ resize_root_window (root, delta, horflag ? Qt : Qnil, Qnil); if (window_resize_check (r, horflag) - && new_size == XINT (WGET (r, new_total))) + && new_size == XINT (r->new_total)) window_resize_apply (r, horflag); else { /* Try with "reasonable" minimum sizes next. */ resize_root_window (root, delta, horflag ? Qt : Qnil, Qt); if (window_resize_check (r, horflag) - && new_size == XINT (WGET (r, new_total))) + && new_size == XINT (r->new_total)) window_resize_apply (r, horflag); else { /* Finally, try with "safe" minimum sizes. */ resize_root_window (root, delta, horflag ? Qt : Qnil, Qsafe); if (window_resize_check (r, horflag) - && new_size == XINT (WGET (r, new_total))) + && new_size == XINT (r->new_total)) window_resize_apply (r, horflag); else { @@ -3627,7 +3625,7 @@ /* Are we sure we always want 1 line here? */ WSET (m, total_lines, make_number (1)); WSET (m, top_line, - make_number (XINT (WGET (r, top_line)) + XINT (WGET (r, total_lines)))); + make_number (XINT (r->top_line) + XINT (r->total_lines))); } } } @@ -3683,10 +3681,10 @@ parent, or OLD is ortho-combined. */ combination_limit = !NILP (Vwindow_combination_limit) - || NILP (WGET (o, parent)) + || NILP (o->parent) || NILP (horflag - ? (WGET (XWINDOW (WGET (o, parent)), hchild)) - : (WGET (XWINDOW (WGET (o, parent)), vchild))); + ? (XWINDOW (o->parent)->hchild) + : (XWINDOW (o->parent)->vchild)); /* We need a live reference window to initialize some parameters. */ if (WINDOW_LIVE_P (old)) @@ -3706,24 +3704,24 @@ /* `window-combination-resize' non-nil means try to resize OLD's siblings proportionally. */ { - p = XWINDOW (WGET (o, parent)); + p = XWINDOW (o->parent); /* Temporarily pretend we split the parent window. */ WSET (p, new_total, - make_number (XINT (horflag ? WGET (p, total_cols) : WGET (p, total_lines)) + make_number (XINT (horflag ? p->total_cols : p->total_lines) - XINT (total_size))); if (!window_resize_check (p, horflag)) error ("Window sizes don't fit"); else /* Undo the temporary pretension. */ WSET (p, new_total, - horflag ? WGET (p, total_cols) : WGET (p, total_lines)); + horflag ? p->total_cols : p->total_lines); } else { if (!window_resize_check (o, horflag)) error ("Resizing old window failed"); - else if (XINT (total_size) + XINT (WGET (o, new_total)) - != XINT (horflag ? WGET (o, total_cols) : WGET (o, total_lines))) + else if (XINT (total_size) + XINT (o->new_total) + != XINT (horflag ? o->total_cols : o->total_lines)) error ("Sum of sizes of old and new window don't fit"); } @@ -3734,48 +3732,47 @@ by make_parent_window and we need it below for assigning it to p->new_normal. */ Lisp_Object new_normal - = horflag ? WGET (o, normal_cols) : WGET (o, normal_lines); + = horflag ? o->normal_cols : o->normal_lines; make_parent_window (old, horflag); - p = XWINDOW (WGET (o, parent)); + p = XWINDOW (o->parent); /* Store value of `window-combination-limit' in new parent's combination_limit slot. */ WSET (p, combination_limit, Vwindow_combination_limit); /* These get applied below. */ - WSET (p, new_total, - horflag ? WGET (o, total_cols) : WGET (o, total_lines)); + WSET (p, new_total, horflag ? o->total_cols : o->total_lines); WSET (p, new_normal, new_normal); } else - p = XWINDOW (WGET (o, parent)); + p = XWINDOW (o->parent); windows_or_buffers_changed++; FRAME_WINDOW_SIZES_CHANGED (f) = 1; new = make_window (); n = XWINDOW (new); WSET (n, frame, frame); - WSET (n, parent, WGET (o, parent)); + WSET (n, parent, o->parent); WSET (n, vchild, Qnil); WSET (n, hchild, Qnil); if (EQ (side, Qabove) || EQ (side, Qleft)) { - WSET (n, prev, WGET (o, prev)); - if (NILP (WGET (n, prev))) + WSET (n, prev, o->prev); + if (NILP (n->prev)) if (horflag) WSET (p, hchild, new); else WSET (p, vchild, new); else - WSET (XWINDOW (WGET (n, prev)), next, new); + WSET (XWINDOW (n->prev), next, new); WSET (n, next, old); WSET (o, prev, new); } else { - WSET (n, next, WGET (o, next)); - if (!NILP (WGET (n, next))) - WSET (XWINDOW (WGET (n, next)), prev, new); + WSET (n, next, o->next); + if (!NILP (n->next)) + WSET (XWINDOW (n->next), prev, new); WSET (n, prev, old); WSET (o, next, new); } @@ -3785,24 +3782,24 @@ memset (&n->last_cursor, 0, sizeof n->last_cursor); /* Get special geometry settings from reference window. */ - WSET (n, left_margin_cols, WGET (r, left_margin_cols)); - WSET (n, right_margin_cols, WGET (r, right_margin_cols)); - WSET (n, left_fringe_width, WGET (r, left_fringe_width)); - WSET (n, right_fringe_width, WGET (r, right_fringe_width)); + WSET (n, left_margin_cols, r->left_margin_cols); + WSET (n, right_margin_cols, r->right_margin_cols); + WSET (n, left_fringe_width, r->left_fringe_width); + WSET (n, right_fringe_width, r->right_fringe_width); n->fringes_outside_margins = r->fringes_outside_margins; - WSET (n, scroll_bar_width, WGET (r, scroll_bar_width)); - WSET (n, vertical_scroll_bar_type, WGET (r, vertical_scroll_bar_type)); + WSET (n, scroll_bar_width, r->scroll_bar_width); + WSET (n, vertical_scroll_bar_type, r->vertical_scroll_bar_type); /* Directly assign orthogonal coordinates and sizes. */ if (horflag) { - WSET (n, top_line, WGET (o, top_line)); - WSET (n, total_lines, WGET (o, total_lines)); + WSET (n, top_line, o->top_line); + WSET (n, total_lines, o->total_lines); } else { - WSET (n, left_col, WGET (o, left_col)); - WSET (n, total_cols, WGET (o, total_cols)); + WSET (n, left_col, o->left_col); + WSET (n, total_cols, o->total_cols); } /* Iso-coordinates and sizes are assigned by window_resize_apply, @@ -3815,14 +3812,14 @@ adjust_glyphs (f); /* Set buffer of NEW to buffer of reference window. Don't run any hooks. */ - set_window_buffer (new, WGET (r, buffer), 0, 1); + set_window_buffer (new, r->buffer, 0, 1); UNBLOCK_INPUT; /* Maybe we should run the scroll functions in Elisp (which already runs the configuration change hook). */ if (! NILP (Vwindow_scroll_functions)) run_hook_with_args_2 (Qwindow_scroll_functions, new, - Fmarker_position (WGET (n, start))); + Fmarker_position (n->start)); /* Return NEW. */ return new; } @@ -3841,25 +3838,25 @@ int before_sibling = 0; w = decode_any_window (window); - CHECK_LIVE_FRAME (WGET (w, frame)); + CHECK_LIVE_FRAME (w->frame); XSETWINDOW (window, w); - if (NILP (WGET (w, buffer)) - && NILP (WGET (w, hchild)) && NILP (WGET (w, vchild))) + if (NILP (w->buffer) + && NILP (w->hchild) && NILP (w->vchild)) /* It's a no-op to delete an already deleted window. */ return Qnil; - parent = WGET (w, parent); + parent = w->parent; if (NILP (parent)) /* Never delete a minibuffer or frame root window. */ error ("Attempt to delete minibuffer or sole ordinary window"); - else if (NILP (WGET (w, prev)) && NILP (WGET (w, next))) + else if (NILP (w->prev) && NILP (w->next)) /* Rather bow out here, this case should be handled on the Elisp level. */ error ("Attempt to delete sole window of parent"); p = XWINDOW (parent); - horflag = NILP (WGET (p, vchild)); + horflag = NILP (p->vchild); frame = WINDOW_FRAME (w); f = XFRAME (frame); @@ -3868,13 +3865,13 @@ r = XWINDOW (root); /* Unlink WINDOW from window tree. */ - if (NILP (WGET (w, prev))) + if (NILP (w->prev)) /* Get SIBLING below (on the right of) WINDOW. */ { /* before_sibling 1 means WINDOW is the first child of its parent and thus before the sibling. */ before_sibling = 1; - sibling = WGET (w, next); + sibling = w->next; s = XWINDOW (sibling); WSET (s, prev, Qnil); if (horflag) @@ -3885,16 +3882,16 @@ else /* Get SIBLING above (on the left of) WINDOW. */ { - sibling = WGET (w, prev); + sibling = w->prev; s = XWINDOW (sibling); - WSET (s, next, WGET (w, next)); - if (!NILP (WGET (s, next))) - WSET (XWINDOW (WGET (s, next)), prev, sibling); + WSET (s, next, w->next); + if (!NILP (s->next)) + WSET (XWINDOW (s->next), prev, sibling); } if (window_resize_check (r, horflag) - && EQ (WGET (r, new_total), - (horflag ? WGET (r, total_cols) : WGET (r, total_lines)))) + && EQ (r->new_total, + (horflag ? r->total_cols : r->total_lines))) /* We can delete WINDOW now. */ { @@ -3919,25 +3916,25 @@ WSET (w, next, Qnil); /* Don't delete w->next too. */ free_window_matrices (w); - if (!NILP (WGET (w, vchild))) + if (!NILP (w->vchild)) { - delete_all_child_windows (WGET (w, vchild)); + delete_all_child_windows (w->vchild); WSET (w, vchild, Qnil); } - else if (!NILP (WGET (w, hchild))) + else if (!NILP (w->hchild)) { - delete_all_child_windows (WGET (w, hchild)); + delete_all_child_windows (w->hchild); WSET (w, hchild, Qnil); } - else if (!NILP (WGET (w, buffer))) + else if (!NILP (w->buffer)) { unshow_buffer (w); - unchain_marker (XMARKER (WGET (w, pointm))); - unchain_marker (XMARKER (WGET (w, start))); + unchain_marker (XMARKER (w->pointm)); + unchain_marker (XMARKER (w->start)); WSET (w, buffer, Qnil); } - if (NILP (WGET (s, prev)) && NILP (WGET (s, next))) + if (NILP (s->prev) && NILP (s->next)) /* A matrjoshka where SIBLING has become the only child of PARENT. */ { @@ -3945,8 +3942,8 @@ replace_window (parent, sibling, 0); /* Have SIBLING inherit the following three slot values from PARENT (the combination_limit slot is not inherited). */ - WSET (s, normal_cols, WGET (p, normal_cols)); - WSET (s, normal_lines, WGET (p, normal_lines)); + WSET (s, normal_cols, p->normal_cols); + WSET (s, normal_lines, p->normal_lines); /* Mark PARENT as deleted. */ WSET (p, vchild, Qnil); WSET (p, hchild, Qnil); @@ -3976,7 +3973,7 @@ /* Now look whether `get-mru-window' gets us something. */ mru_window = call1 (Qget_mru_window, frame); if (WINDOW_LIVE_P (mru_window) - && EQ (WGET (XWINDOW (mru_window), frame), frame)) + && EQ (XWINDOW (mru_window)->frame, frame)) new_selected_window = mru_window; /* If all ended up well, we now promote the mru window. */ @@ -4005,8 +4002,8 @@ else { WSET (s, next, window); - if (!NILP (WGET (w, next))) - WSET (XWINDOW (WGET (w, next)), prev, window); + if (!NILP (w->next)) + WSET (XWINDOW (w->next), prev, window); } error ("Deletion failed"); } @@ -4023,7 +4020,7 @@ void grow_mini_window (struct window *w, int delta) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); struct window *r; Lisp_Object root, value; @@ -4041,9 +4038,9 @@ /* Grow the mini-window. */ WSET (w, top_line, - make_number (XFASTINT (WGET (r, top_line)) + XFASTINT (WGET (r, total_lines)))); + make_number (XFASTINT (r->top_line) + XFASTINT (r->total_lines))); WSET (w, total_lines, - make_number (XFASTINT (WGET (w, total_lines)) - XINT (value))); + make_number (XFASTINT (w->total_lines) - XINT (value))); w->last_modified = 0; w->last_overlay_modified = 0; @@ -4057,14 +4054,14 @@ void shrink_mini_window (struct window *w) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); struct window *r; Lisp_Object root, value; EMACS_INT size; eassert (MINI_WINDOW_P (w)); - size = XINT (WGET (w, total_lines)); + size = XINT (w->total_lines); if (size > 1) { root = FRAME_ROOT_WINDOW (f); @@ -4078,7 +4075,7 @@ /* Shrink the mini-window. */ WSET (w, top_line, - make_number (XFASTINT (WGET (r, top_line)) + XFASTINT (WGET (r, total_lines)))); + make_number (XFASTINT (r->top_line) + XFASTINT (r->total_lines))); WSET (w, total_lines, make_number (1)); w->last_modified = 0; @@ -4104,25 +4101,25 @@ int height; CHECK_WINDOW (window); - f = XFRAME (WGET (w, frame)); + f = XFRAME (w->frame); - if (!EQ (FRAME_MINIBUF_WINDOW (XFRAME (WGET (w, frame))), window)) + if (!EQ (FRAME_MINIBUF_WINDOW (XFRAME (w->frame)), window)) error ("Not a valid minibuffer window"); else if (FRAME_MINIBUF_ONLY_P (f)) error ("Cannot resize a minibuffer-only frame"); r = XWINDOW (FRAME_ROOT_WINDOW (f)); - height = XINT (WGET (r, total_lines)) + XINT (WGET (w, total_lines)); + height = XINT (r->total_lines) + XINT (w->total_lines); if (window_resize_check (r, 0) - && XINT (WGET (w, new_total)) > 0 - && height == XINT (WGET (r, new_total)) + XINT (WGET (w, new_total))) + && XINT (w->new_total) > 0 + && height == XINT (r->new_total) + XINT (w->new_total)) { BLOCK_INPUT; window_resize_apply (r, 0); - WSET (w, total_lines, WGET (w, new_total)); + WSET (w, total_lines, w->new_total); WSET (w, top_line, - make_number (XINT (WGET (r, top_line)) + XINT (WGET (r, total_lines)))); + make_number (XINT (r->top_line) + XINT (r->total_lines))); windows_or_buffers_changed++; FRAME_WINDOW_SIZES_CHANGED (f) = 1; @@ -4145,14 +4142,14 @@ { while (w) { - if (!NILP (WGET (w, hchild))) - mark_window_cursors_off (XWINDOW (WGET (w, hchild))); - else if (!NILP (WGET (w, vchild))) - mark_window_cursors_off (XWINDOW (WGET (w, vchild))); + if (!NILP (w->hchild)) + mark_window_cursors_off (XWINDOW (w->hchild)); + else if (!NILP (w->vchild)) + mark_window_cursors_off (XWINDOW (w->vchild)); else w->phys_cursor_on_p = 0; - w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); + w = NILP (w->next) ? 0 : XWINDOW (w->next); } } @@ -4162,15 +4159,15 @@ int window_internal_height (struct window *w) { - int ht = XFASTINT (WGET (w, total_lines)); + int ht = XFASTINT (w->total_lines); if (!MINI_WINDOW_P (w)) { - if (!NILP (WGET (w, parent)) - || !NILP (WGET (w, vchild)) - || !NILP (WGET (w, hchild)) - || !NILP (WGET (w, next)) - || !NILP (WGET (w, prev)) + if (!NILP (w->parent) + || !NILP (w->vchild) + || !NILP (w->hchild) + || !NILP (w->next) + || !NILP (w->prev) || WINDOW_WANTS_MODELINE_P (w)) --ht; @@ -4200,7 +4197,7 @@ /* If we must, use the pixel-based version which is much slower than the line-based one but can handle varying line heights. */ - if (FRAME_WINDOW_P (XFRAME (WGET (XWINDOW (window), frame)))) + if (FRAME_WINDOW_P (XFRAME (XWINDOW (window)->frame))) window_scroll_pixel_based (window, n, whole, noerror); else window_scroll_line_based (window, n, whole, noerror); @@ -4225,7 +4222,7 @@ int x, y, rtop, rbot, rowh, vpos; void *itdata = NULL; - SET_TEXT_POS_FROM_MARKER (start, WGET (w, start)); + SET_TEXT_POS_FROM_MARKER (start, w->start); /* Scrolling a minibuffer window via scroll bar when the echo area shows long text sometimes resets the minibuffer contents behind our backs. */ @@ -4306,8 +4303,8 @@ spos = XINT (Fline_beginning_position (Qnil)); else spos = min (XINT (Fline_end_position (Qnil)) + 1, ZV); - set_marker_restricted (WGET (w, start), make_number (spos), - WGET (w, buffer)); + set_marker_restricted (w->start, make_number (spos), + w->buffer); w->start_at_line_beg = 1; w->update_mode_line = 1; w->last_modified = 0; @@ -4431,7 +4428,7 @@ /* If control gets here, then we vscrolled. */ - XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1; + XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; /* Don't try to change the window start below. */ vscrolled = 1; @@ -4451,9 +4448,9 @@ } /* Set the window start, and set up the window for redisplay. */ - set_marker_restricted (WGET (w, start), make_number (pos), - WGET (w, buffer)); - bytepos = XMARKER (WGET (w, start))->bytepos; + set_marker_restricted (w->start, make_number (pos), + w->buffer); + bytepos = XMARKER (w->start)->bytepos; w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n'); w->update_mode_line = 1; w->last_modified = 0; @@ -4472,7 +4469,7 @@ even if there is a header line. */ this_scroll_margin = max (0, scroll_margin); this_scroll_margin - = min (this_scroll_margin, XFASTINT (WGET (w, total_lines)) / 4); + = min (this_scroll_margin, XFASTINT (w->total_lines) / 4); this_scroll_margin *= FRAME_LINE_HEIGHT (it.f); if (n > 0) @@ -4546,7 +4543,7 @@ ; else if (window_scroll_pixel_based_preserve_y >= 0) { - SET_TEXT_POS_FROM_MARKER (start, WGET (w, start)); + SET_TEXT_POS_FROM_MARKER (start, w->start); start_display (&it, w, start); /* It would be wrong to subtract CURRENT_HEADER_LINE_HEIGHT here because we called start_display again and did not @@ -4600,7 +4597,7 @@ if (whole) n *= max (1, ht - next_screen_context_lines); - startpos = marker_position (WGET (w, start)); + startpos = marker_position (w->start); if (!NILP (Vscroll_preserve_screen_position)) { @@ -4651,9 +4648,9 @@ { /* Don't use a scroll margin that is negative or too large. */ int this_scroll_margin = - max (0, min (scroll_margin, XINT (WGET (w, total_lines)) / 4)); + max (0, min (scroll_margin, XINT (w->total_lines) / 4)); - set_marker_restricted_both (WGET (w, start), WGET (w, buffer), pos, pos_byte); + set_marker_restricted_both (w->start, w->buffer, pos, pos_byte); w->start_at_line_beg = !NILP (bolp); w->update_mode_line = 1; w->last_modified = 0; @@ -4747,10 +4744,10 @@ /* If selected window's buffer isn't current, make it current for the moment. But don't screw up if window_scroll gets an error. */ - if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) != current_buffer) + if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer) { record_unwind_protect (save_excursion_restore, save_excursion_save ()); - Fset_buffer (WGET (XWINDOW (selected_window), buffer)); + Fset_buffer (XWINDOW (selected_window)->buffer); /* Make redisplay consider other windows than just selected_window. */ ++windows_or_buffers_changed; @@ -4865,8 +4862,8 @@ record_unwind_protect (save_excursion_restore, save_excursion_save ()); ++windows_or_buffers_changed; - Fset_buffer (WGET (w, buffer)); - SET_PT (marker_position (WGET (w, pointm))); + Fset_buffer (w->buffer); + SET_PT (marker_position (w->pointm)); if (NILP (arg)) window_scroll (window, 1, 1, 1); @@ -4880,7 +4877,7 @@ window_scroll (window, XINT (arg), 0, 1); } - set_marker_both (WGET (w, pointm), Qnil, PT, PT_BYTE); + set_marker_both (w->pointm, Qnil, PT, PT_BYTE); unbind_to (count, Qnil); return Qnil; @@ -4958,10 +4955,10 @@ int bottom_y; void *itdata = NULL; - if (XBUFFER (WGET (w, buffer)) != current_buffer) + if (XBUFFER (w->buffer) != current_buffer) { old_buffer = current_buffer; - set_buffer_internal (XBUFFER (WGET (w, buffer))); + set_buffer_internal (XBUFFER (w->buffer)); } else old_buffer = NULL; @@ -4969,12 +4966,12 @@ /* In case W->start is out of the accessible range, do something reasonable. This happens in Info mode when Info-scroll-down calls (recenter -1) while W->start is 1. */ - if (XMARKER (WGET (w, start))->charpos < BEGV) + if (XMARKER (w->start)->charpos < BEGV) SET_TEXT_POS (start, BEGV, BEGV_BYTE); - else if (XMARKER (WGET (w, start))->charpos > ZV) + else if (XMARKER (w->start)->charpos > ZV) SET_TEXT_POS (start, ZV, ZV_BYTE); else - SET_TEXT_POS_FROM_MARKER (start, WGET (w, start)); + SET_TEXT_POS_FROM_MARKER (start, w->start); itdata = bidi_shelve_cache (); start_display (&it, w, start); @@ -4988,7 +4985,7 @@ This kludge fixes a bug whereby (move-to-window-line -1) when ZV is on the last screen line moves to the previous screen line instead of the last one. */ - if (! FRAME_WINDOW_P (XFRAME (WGET (w, frame)))) + if (! FRAME_WINDOW_P (XFRAME (w->frame))) height++; /* Add in empty lines at the bottom of the window. */ @@ -5023,7 +5020,7 @@ (register Lisp_Object arg) { struct window *w = XWINDOW (selected_window); - struct buffer *buf = XBUFFER (WGET (w, buffer)); + struct buffer *buf = XBUFFER (w->buffer); struct buffer *obuf = current_buffer; int center_p = 0; ptrdiff_t charpos, bytepos; @@ -5067,12 +5064,12 @@ /* Do this after making BUF current in case scroll_margin is buffer-local. */ this_scroll_margin = - max (0, min (scroll_margin, XFASTINT (WGET (w, total_lines)) / 4)); + max (0, min (scroll_margin, XFASTINT (w->total_lines) / 4)); /* Handle centering on a graphical frame specially. Such frames can have variable-height lines and centering point on the basis of line counts would lead to strange effects. */ - if (FRAME_WINDOW_P (XFRAME (WGET (w, frame)))) + if (FRAME_WINDOW_P (XFRAME (w->frame))) { if (center_p) { @@ -5189,7 +5186,7 @@ } /* Set the new window start. */ - set_marker_both (WGET (w, start), WGET (w, buffer), charpos, bytepos); + set_marker_both (w->start, w->buffer, charpos, bytepos); WSET (w, window_end_valid, Qnil); w->optional_new_start = 1; @@ -5212,7 +5209,7 @@ { struct window *w = decode_window (window); int pixel_height = window_box_height (w); - int line_height = pixel_height / FRAME_LINE_HEIGHT (XFRAME (WGET (w, frame))); + int line_height = pixel_height / FRAME_LINE_HEIGHT (XFRAME (w->frame)); return make_number (line_height); } @@ -5233,24 +5230,24 @@ int this_scroll_margin; #endif - if (!(BUFFERP (WGET (w, buffer)) - && XBUFFER (WGET (w, buffer)) == current_buffer)) + if (!(BUFFERP (w->buffer) + && XBUFFER (w->buffer) == current_buffer)) /* This test is needed to make sure PT/PT_BYTE make sense in w->buffer when passed below to set_marker_both. */ error ("move-to-window-line called from unrelated buffer"); window = selected_window; - start = marker_position (WGET (w, start)); + start = marker_position (w->start); if (start < BEGV || start > ZV) { int height = window_internal_height (w); Fvertical_motion (make_number (- (height / 2)), window); - set_marker_both (WGET (w, start), WGET (w, buffer), PT, PT_BYTE); + set_marker_both (w->start, w->buffer, PT, PT_BYTE); w->start_at_line_beg = !NILP (Fbolp ()); w->force_start = 1; } else - Fgoto_char (WGET (w, start)); + Fgoto_char (w->start); lines = displayed_window_lines (w); @@ -5354,7 +5351,7 @@ data = (struct save_window_data *) XVECTOR (config); saved_windows = XVECTOR (data->saved_windows); - return WGET (XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window), frame); + return XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame; } DEFUN ("set-window-configuration", Fset_window_configuration, @@ -5396,11 +5393,11 @@ window-point of the final-selected-window to the window-point of the current-selected-window. So we have to be careful which point of the current-buffer we copy into old_point. */ - if (EQ (WGET (XWINDOW (data->current_window), buffer), new_current_buffer) + if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer) && WINDOWP (selected_window) - && EQ (WGET (XWINDOW (selected_window), buffer), new_current_buffer) + && EQ (XWINDOW (selected_window)->buffer, new_current_buffer) && !EQ (selected_window, data->current_window)) - old_point = XMARKER (WGET (XWINDOW (data->current_window), pointm))->charpos; + old_point = XMARKER (XWINDOW (data->current_window)->pointm)->charpos; else old_point = PT; else @@ -5412,15 +5409,15 @@ So if possible we want this arbitrary choice of "which point" to be the one from the to-be-selected-window so as to prevent this window's cursor from being copied from another window. */ - if (EQ (WGET (XWINDOW (data->current_window), buffer), new_current_buffer) + if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer) /* If current_window = selected_window, its point is in BUF_PT. */ && !EQ (selected_window, data->current_window)) - old_point = XMARKER (WGET (XWINDOW (data->current_window), pointm))->charpos; + old_point = XMARKER (XWINDOW (data->current_window)->pointm)->charpos; else old_point = BUF_PT (XBUFFER (new_current_buffer)); } - frame = WGET (XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window), frame); + frame = XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame; f = XFRAME (frame); /* If f is a dead frame, don't bother rebuilding its window tree. @@ -5473,13 +5470,13 @@ window holds garbage.) We do this now, before restoring the window contents, and prevent it from being done later on when we select a new window. */ - if (! NILP (WGET (XWINDOW (selected_window), buffer))) + if (! NILP (XWINDOW (selected_window)->buffer)) { w = XWINDOW (selected_window); - set_marker_both (WGET (w, pointm), - WGET (w, buffer), - BUF_PT (XBUFFER (WGET (w, buffer))), - BUF_PT_BYTE (XBUFFER (WGET (w, buffer)))); + set_marker_both (w->pointm, + w->buffer, + BUF_PT (XBUFFER (w->buffer)), + BUF_PT_BYTE (XBUFFER (w->buffer))); } windows_or_buffers_changed++; @@ -5511,39 +5508,39 @@ WSET (w, next, Qnil); if (!NILP (p->parent)) - WSET (w, parent, SAVED_WINDOW_N (saved_windows, - XFASTINT (p->parent))->window); + WSET (w, parent, SAVED_WINDOW_N + (saved_windows, XFASTINT (p->parent))->window); else WSET (w, parent, Qnil); if (!NILP (p->prev)) { - WSET (w, prev, SAVED_WINDOW_N (saved_windows, - XFASTINT (p->prev))->window); - WSET (XWINDOW (WGET (w, prev)), next, p->window); + WSET (w, prev, SAVED_WINDOW_N + (saved_windows, XFASTINT (p->prev))->window); + WSET (XWINDOW (w->prev), next, p->window); } else { WSET (w, prev, Qnil); - if (!NILP (WGET (w, parent))) + if (!NILP (w->parent)) { - if (EQ (p->total_cols, WGET (XWINDOW (WGET (w, parent)), total_cols))) + if (EQ (p->total_cols, XWINDOW (w->parent)->total_cols)) { - WSET (XWINDOW (WGET (w, parent)), vchild, p->window); - WSET (XWINDOW (WGET (w, parent)), hchild, Qnil); + WSET (XWINDOW (w->parent), vchild, p->window); + WSET (XWINDOW (w->parent), hchild, Qnil); } else { - WSET (XWINDOW (WGET (w, parent)), hchild, p->window); - WSET (XWINDOW (WGET (w, parent)), vchild, Qnil); + WSET (XWINDOW (w->parent), hchild, p->window); + WSET (XWINDOW (w->parent), vchild, Qnil); } } } /* If we squirreled away the buffer in the window's height, restore it now. */ - if (BUFFERP (WGET (w, total_lines))) - WSET (w, buffer, WGET (w, total_lines)); + if (BUFFERP (w->total_lines)) + WSET (w, buffer, w->total_lines); WSET (w, left_col, p->left_col); WSET (w, top_line, p->top_line); WSET (w, total_cols, p->total_cols); @@ -5571,7 +5568,7 @@ { if (NILP (XCDR (pers))) { - par = Fassq (XCAR (pers), WGET (w, window_parameters)); + par = Fassq (XCAR (pers), w->window_parameters); if (CONSP (par) && !NILP (XCDR (par))) /* Reset a parameter to nil if and only if it has a non-nil association. Don't make new @@ -5596,33 +5593,33 @@ { WSET (w, buffer, p->buffer); w->start_at_line_beg = !NILP (p->start_at_line_beg); - set_marker_restricted (WGET (w, start), p->start, WGET (w, buffer)); - set_marker_restricted (WGET (w, pointm), p->pointm, - WGET (w, buffer)); - Fset_marker (BVAR (XBUFFER (WGET (w, buffer)), mark), - p->mark, WGET (w, buffer)); + set_marker_restricted (w->start, p->start, w->buffer); + set_marker_restricted (w->pointm, p->pointm, + w->buffer); + Fset_marker (BVAR (XBUFFER (w->buffer), mark), + p->mark, w->buffer); /* As documented in Fcurrent_window_configuration, don't restore the location of point in the buffer which was current when the window configuration was recorded. */ if (!EQ (p->buffer, new_current_buffer) && XBUFFER (p->buffer) == current_buffer) - Fgoto_char (WGET (w, pointm)); + Fgoto_char (w->pointm); } - else if (!NILP (WGET (w, buffer)) - && !NILP (BVAR (XBUFFER (WGET (w, buffer)), name))) + else if (!NILP (w->buffer) + && !NILP (BVAR (XBUFFER (w->buffer), name))) /* Keep window's old buffer; make sure the markers are real. */ { /* Set window markers at start of visible range. */ - if (XMARKER (WGET (w, start))->buffer == 0) - set_marker_restricted (WGET (w, start), make_number (0), - WGET (w, buffer)); - if (XMARKER (WGET (w, pointm))->buffer == 0) + if (XMARKER (w->start)->buffer == 0) + set_marker_restricted (w->start, make_number (0), + w->buffer); + if (XMARKER (w->pointm)->buffer == 0) set_marker_restricted_both - (WGET (w, pointm), WGET (w, buffer), - BUF_PT (XBUFFER (WGET (w, buffer))), - BUF_PT_BYTE (XBUFFER (WGET (w, buffer)))); + (w->pointm, w->buffer, + BUF_PT (XBUFFER (w->buffer)), + BUF_PT_BYTE (XBUFFER (w->buffer))); w->start_at_line_beg = 1; } else if (STRINGP (auto_buffer_name = @@ -5630,10 +5627,10 @@ && SCHARS (auto_buffer_name) != 0 && !NILP (WSET (w, buffer, Fget_buffer_create (auto_buffer_name)))) { - set_marker_restricted (WGET (w, start), - make_number (0), WGET (w, buffer)); - set_marker_restricted (WGET (w, pointm), - make_number (0), WGET (w, buffer)); + set_marker_restricted (w->start, + make_number (0), w->buffer); + set_marker_restricted (w->pointm, + make_number (0), w->buffer); w->start_at_line_beg = 1; } else @@ -5646,12 +5643,12 @@ WSET (w, buffer, other_buffer_safely (Fcurrent_buffer ())); /* This will set the markers to beginning of visible range. */ - set_marker_restricted (WGET (w, start), - make_number (0), WGET (w, buffer)); - set_marker_restricted (WGET (w, pointm), - make_number (0), WGET (w, buffer)); + set_marker_restricted (w->start, + make_number (0), w->buffer); + set_marker_restricted (w->pointm, + make_number (0), w->buffer); w->start_at_line_beg = 1; - if (!NILP (WGET (w, dedicated))) + if (!NILP (w->dedicated)) /* Record this window as dead. */ dead_windows = Fcons (window, dead_windows); /* Make sure window is no more dedicated. */ @@ -5662,17 +5659,17 @@ FSET (f, root_window, data->root_window); /* Arrange *not* to restore point in the buffer that was current when the window configuration was saved. */ - if (EQ (WGET (XWINDOW (data->current_window), buffer), new_current_buffer)) - set_marker_restricted (WGET (XWINDOW (data->current_window), pointm), + if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer)) + set_marker_restricted (XWINDOW (data->current_window)->pointm, make_number (old_point), - WGET (XWINDOW (data->current_window), buffer)); + XWINDOW (data->current_window)->buffer); /* In the following call to `select-window', prevent "swapping out point" in the old selected window using the buffer that has been restored into it. We already swapped out that point from that window's old buffer. */ select_window (data->current_window, Qnil, 1); - BVAR (XBUFFER (WGET (XWINDOW (selected_window), buffer)), last_selected_window) + BVAR (XBUFFER (XWINDOW (selected_window)->buffer), last_selected_window) = selected_window; if (NILP (data->focus_frame) @@ -5699,14 +5696,14 @@ /* Now, free glyph matrices in windows that were not reused. */ for (i = n = 0; i < n_leaf_windows; ++i) { - if (NILP (WGET (leaf_windows[i], buffer))) + if (NILP (leaf_windows[i]->buffer)) { /* Assert it's not reused as a combination. */ - eassert (NILP (WGET (leaf_windows[i], hchild)) - && NILP (WGET (leaf_windows[i], vchild))); + eassert (NILP (leaf_windows[i]->hchild) + && NILP (leaf_windows[i]->vchild)); free_window_matrices (leaf_windows[i]); } - else if (EQ (WGET (leaf_windows[i], buffer), new_current_buffer)) + else if (EQ (leaf_windows[i]->buffer, new_current_buffer)) ++n; } @@ -5751,27 +5748,27 @@ w = XWINDOW (window); - if (!NILP (WGET (w, next))) + if (!NILP (w->next)) /* Delete WINDOW's siblings (we traverse postorderly). */ - delete_all_child_windows (WGET (w, next)); - - WSET (w, total_lines, WGET (w, buffer)); /* See Fset_window_configuration for excuse. */ - - if (!NILP (WGET (w, vchild))) + delete_all_child_windows (w->next); + + WSET (w, total_lines, w->buffer); /* See Fset_window_configuration for excuse. */ + + if (!NILP (w->vchild)) { - delete_all_child_windows (WGET (w, vchild)); + delete_all_child_windows (w->vchild); WSET (w, vchild, Qnil); } - else if (!NILP (WGET (w, hchild))) + else if (!NILP (w->hchild)) { - delete_all_child_windows (WGET (w, hchild)); + delete_all_child_windows (w->hchild); WSET (w, hchild, Qnil); } - else if (!NILP (WGET (w, buffer))) + else if (!NILP (w->buffer)) { unshow_buffer (w); - unchain_marker (XMARKER (WGET (w, pointm))); - unchain_marker (XMARKER (WGET (w, start))); + unchain_marker (XMARKER (w->pointm)); + unchain_marker (XMARKER (w->start)); WSET (w, buffer, Qnil); } @@ -5782,12 +5779,12 @@ count_windows (register struct window *window) { register int count = 1; - if (!NILP (WGET (window, next))) - count += count_windows (XWINDOW (WGET (window, next))); - if (!NILP (WGET (window, vchild))) - count += count_windows (XWINDOW (WGET (window, vchild))); - if (!NILP (WGET (window, hchild))) - count += count_windows (XWINDOW (WGET (window, hchild))); + if (!NILP (window->next)) + count += count_windows (XWINDOW (window->next)); + if (!NILP (window->vchild)) + count += count_windows (XWINDOW (window->vchild)); + if (!NILP (window->hchild)) + count += count_windows (XWINDOW (window->hchild)); return count; } @@ -5799,14 +5796,14 @@ { while (w) { - if (!NILP (WGET (w, hchild))) - i = get_leaf_windows (XWINDOW (WGET (w, hchild)), flat, i); - else if (!NILP (WGET (w, vchild))) - i = get_leaf_windows (XWINDOW (WGET (w, vchild)), flat, i); + if (!NILP (w->hchild)) + i = get_leaf_windows (XWINDOW (w->hchild), flat, i); + else if (!NILP (w->vchild)) + i = get_leaf_windows (XWINDOW (w->vchild), flat, i); else flat[i++] = w; - w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); + w = NILP (w->next) ? 0 : XWINDOW (w->next); } return i; @@ -5859,32 +5856,32 @@ register struct window *w; register Lisp_Object tem, pers, par; - for (;!NILP (window); window = WGET (w, next)) + for (;!NILP (window); window = w->next) { p = SAVED_WINDOW_N (vector, i); w = XWINDOW (window); WSET (w, temslot, make_number (i)); i++; p->window = window; - p->buffer = WGET (w, buffer); - p->left_col = WGET (w, left_col); - p->top_line = WGET (w, top_line); - p->total_cols = WGET (w, total_cols); - p->total_lines = WGET (w, total_lines); - p->normal_cols = WGET (w, normal_cols); - p->normal_lines = WGET (w, normal_lines); + p->buffer = w->buffer; + p->left_col = w->left_col; + p->top_line = w->top_line; + p->total_cols = w->total_cols; + p->total_lines = w->total_lines; + p->normal_cols = w->normal_cols; + p->normal_lines = w->normal_lines; XSETFASTINT (p->hscroll, w->hscroll); XSETFASTINT (p->min_hscroll, w->min_hscroll); - p->display_table = WGET (w, display_table); - p->left_margin_cols = WGET (w, left_margin_cols); - p->right_margin_cols = WGET (w, right_margin_cols); - p->left_fringe_width = WGET (w, left_fringe_width); - p->right_fringe_width = WGET (w, right_fringe_width); + p->display_table = w->display_table; + p->left_margin_cols = w->left_margin_cols; + p->right_margin_cols = w->right_margin_cols; + p->left_fringe_width = w->left_fringe_width; + p->right_fringe_width = w->right_fringe_width; p->fringes_outside_margins = w->fringes_outside_margins ? Qt : Qnil; - p->scroll_bar_width = WGET (w, scroll_bar_width); - p->vertical_scroll_bar_type = WGET (w, vertical_scroll_bar_type); - p->dedicated = WGET (w, dedicated); - p->combination_limit = WGET (w, combination_limit); + p->scroll_bar_width = w->scroll_bar_width; + p->vertical_scroll_bar_type = w->vertical_scroll_bar_type; + p->dedicated = w->dedicated; + p->combination_limit = w->combination_limit; p->window_parameters = Qnil; if (!NILP (Vwindow_persistent_parameters)) @@ -5917,7 +5914,7 @@ /* Save values for persistent window parameters. */ if (CONSP (pers) && !NILP (XCDR (pers))) { - par = Fassq (XCAR (pers), WGET (w, window_parameters)); + par = Fassq (XCAR (pers), w->window_parameters); if (NILP (par)) /* If the window has no value for the parameter, make one. */ @@ -5933,24 +5930,24 @@ } } - if (!NILP (WGET (w, buffer))) + if (!NILP (w->buffer)) { /* Save w's value of point in the window configuration. If w is the selected window, then get the value of point from the buffer; pointm is garbage in the selected window. */ if (EQ (window, selected_window)) - p->pointm = build_marker (XBUFFER (WGET (w, buffer)), - BUF_PT (XBUFFER (WGET (w, buffer))), - BUF_PT_BYTE (XBUFFER (WGET (w, buffer)))); + p->pointm = build_marker (XBUFFER (w->buffer), + BUF_PT (XBUFFER (w->buffer)), + BUF_PT_BYTE (XBUFFER (w->buffer))); else - p->pointm = Fcopy_marker (WGET (w, pointm), Qnil); + p->pointm = Fcopy_marker (w->pointm, Qnil); XMARKER (p->pointm)->insertion_type = !NILP (Vwindow_point_insertion_type); - p->start = Fcopy_marker (WGET (w, start), Qnil); + p->start = Fcopy_marker (w->start, Qnil); p->start_at_line_beg = w->start_at_line_beg ? Qt : Qnil; - tem = BVAR (XBUFFER (WGET (w, buffer)), mark); + tem = BVAR (XBUFFER (w->buffer), mark); p->mark = Fcopy_marker (tem, Qnil); } else @@ -5961,20 +5958,20 @@ p->start_at_line_beg = Qnil; } - if (NILP (WGET (w, parent))) + if (NILP (w->parent)) p->parent = Qnil; else - p->parent = WGET (XWINDOW (WGET (w, parent)), temslot); + p->parent = XWINDOW (w->parent)->temslot; - if (NILP (WGET (w, prev))) + if (NILP (w->prev)) p->prev = Qnil; else - p->prev = WGET (XWINDOW (WGET (w, prev)), temslot); + p->prev = XWINDOW (w->prev)->temslot; - if (!NILP (WGET (w, vchild))) - i = save_window_save (WGET (w, vchild), vector, i); - if (!NILP (WGET (w, hchild))) - i = save_window_save (WGET (w, hchild), vector, i); + if (!NILP (w->vchild)) + i = save_window_save (w->vchild, vector, i); + if (!NILP (w->hchild)) + i = save_window_save (w->hchild, vector, i); } return i; @@ -6063,8 +6060,8 @@ right_width = Qnil; } - if (!EQ (WGET (w, left_margin_cols), left_width) - || !EQ (WGET (w, right_margin_cols), right_width)) + if (!EQ (w->left_margin_cols, left_width) + || !EQ (w->right_margin_cols, right_width)) { WSET (w, left_margin_cols, left_width); WSET (w, right_margin_cols, right_width); @@ -6089,7 +6086,7 @@ (Lisp_Object window) { struct window *w = decode_window (window); - return Fcons (WGET (w, left_margin_cols), WGET (w, right_margin_cols)); + return Fcons (w->left_margin_cols, w->right_margin_cols); } @@ -6123,8 +6120,8 @@ /* Do nothing on a tty. */ if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) - && (!EQ (WGET (w, left_fringe_width), left_width) - || !EQ (WGET (w, right_fringe_width), right_width) + && (!EQ (w->left_fringe_width, left_width) + || !EQ (w->right_fringe_width, right_width) || w->fringes_outside_margins != outside)) { WSET (w, left_fringe_width, left_width); @@ -6194,8 +6191,8 @@ || EQ (vertical_type, Qt))) error ("Invalid type of vertical scroll bar"); - if (!EQ (WGET (w, scroll_bar_width), width) - || !EQ (WGET (w, vertical_scroll_bar_type), vertical_type)) + if (!EQ (w->scroll_bar_width, width) + || !EQ (w->vertical_scroll_bar_type, vertical_type)) { WSET (w, scroll_bar_width, width); WSET (w, vertical_scroll_bar_type, vertical_type); @@ -6227,7 +6224,7 @@ ? WINDOW_CONFIG_SCROLL_BAR_WIDTH (w) : WINDOW_SCROLL_BAR_AREA_WIDTH (w))), Fcons (make_number (WINDOW_SCROLL_BAR_COLS (w)), - Fcons (WGET (w, vertical_scroll_bar_type), + Fcons (w->vertical_scroll_bar_type, Fcons (Qnil, Qnil)))); } @@ -6253,7 +6250,7 @@ else CHECK_WINDOW (window); w = XWINDOW (window); - f = XFRAME (WGET (w, frame)); + f = XFRAME (w->frame); if (FRAME_WINDOW_P (f)) result = (NILP (pixels_p) @@ -6287,7 +6284,7 @@ CHECK_NUMBER_OR_FLOAT (vscroll); w = XWINDOW (window); - f = XFRAME (WGET (w, frame)); + f = XFRAME (w->frame); if (FRAME_WINDOW_P (f)) { @@ -6306,7 +6303,7 @@ adjust_glyphs (f); /* Prevent redisplay shortcuts. */ - XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1; + XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; } } @@ -6340,14 +6337,14 @@ for (cont = 1; w && cont;) { - if (!NILP (WGET (w, hchild))) - cont = foreach_window_1 (XWINDOW (WGET (w, hchild)), fn, user_data); - else if (!NILP (WGET (w, vchild))) - cont = foreach_window_1 (XWINDOW (WGET (w, vchild)), fn, user_data); + if (!NILP (w->hchild)) + cont = foreach_window_1 (XWINDOW (w->hchild), fn, user_data); + else if (!NILP (w->vchild)) + cont = foreach_window_1 (XWINDOW (w->vchild), fn, user_data); else cont = fn (w, user_data); - w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); + w = NILP (w->next) ? 0 : XWINDOW (w->next); } return cont; === modified file 'src/window.h' --- src/window.h 2012-08-07 05:29:25 +0000 +++ src/window.h 2012-08-07 07:33:18 +0000 @@ -86,15 +86,9 @@ int hpos, vpos; }; -/* Most code should use these macros to access Lisp fields - in struct window. WGET should not be used as lvalue. */ - -#define WGET(f, field) \ - (eassert (offsetof (struct window, field ## _) \ - < offsetof (struct window, current_matrix)), \ - ((f)->INTERNAL_FIELD (field))) - -#define WSET(w, field, value) ((w)->INTERNAL_FIELD (field) = (value)) +/* Most code should use this macro to set Lisp fields in struct window. */ + +#define WSET(w, field, value) ((w)->field = (value)) struct window { @@ -102,140 +96,140 @@ struct vectorlike_header header; /* The frame this window is on. */ - Lisp_Object INTERNAL_FIELD (frame); + Lisp_Object frame; /* Following (to right or down) and preceding (to left or up) child at same level of tree. */ - Lisp_Object INTERNAL_FIELD (next); - Lisp_Object INTERNAL_FIELD (prev); + Lisp_Object next; + Lisp_Object prev; /* First child of this window: vchild is used if this is a vertical combination, hchild if this is a horizontal combination. Of the fields vchild, hchild and buffer, one and only one is non-nil unless the window is dead. */ - Lisp_Object INTERNAL_FIELD (hchild); - Lisp_Object INTERNAL_FIELD (vchild); + Lisp_Object hchild; + Lisp_Object vchild; /* The window this one is a child of. */ - Lisp_Object INTERNAL_FIELD (parent); + Lisp_Object parent; /* The upper left corner coordinates of this window, as integers relative to upper left corner of frame = 0, 0. */ - Lisp_Object INTERNAL_FIELD (left_col); - Lisp_Object INTERNAL_FIELD (top_line); + Lisp_Object left_col; + Lisp_Object top_line; /* The size of the window. */ - Lisp_Object INTERNAL_FIELD (total_lines); - Lisp_Object INTERNAL_FIELD (total_cols); + Lisp_Object total_lines; + Lisp_Object total_cols; /* The normal size of the window. */ - Lisp_Object INTERNAL_FIELD (normal_lines); - Lisp_Object INTERNAL_FIELD (normal_cols); + Lisp_Object normal_lines; + Lisp_Object normal_cols; /* New sizes of the window. */ - Lisp_Object INTERNAL_FIELD (new_total); - Lisp_Object INTERNAL_FIELD (new_normal); + Lisp_Object new_total; + Lisp_Object new_normal; /* The buffer displayed in this window. Of the fields vchild, hchild and buffer, one and only one is non-nil unless the window is dead. */ - Lisp_Object INTERNAL_FIELD (buffer); + Lisp_Object buffer; /* A marker pointing to where in the text to start displaying. BIDI Note: This is the _logical-order_ start, i.e. the smallest buffer position visible in the window, not necessarily the character displayed in the top left corner of the window. */ - Lisp_Object INTERNAL_FIELD (start); + Lisp_Object start; /* A marker pointing to where in the text point is in this window, used only when the window is not selected. This exists so that when multiple windows show one buffer each one can have its own value of point. */ - Lisp_Object INTERNAL_FIELD (pointm); + Lisp_Object pointm; /* No permanent meaning; used by save-window-excursion's bookkeeping. */ - Lisp_Object INTERNAL_FIELD (temslot); + Lisp_Object temslot; /* This window's vertical scroll bar. This field is only for use by the window-system-dependent code which implements the scroll bars; it can store anything it likes here. If this window is newly created and we haven't displayed a scroll bar in it yet, or if the frame doesn't have any scroll bars, this is nil. */ - Lisp_Object INTERNAL_FIELD (vertical_scroll_bar); + Lisp_Object vertical_scroll_bar; /* Width of left and right marginal areas. A value of nil means no margin. */ - Lisp_Object INTERNAL_FIELD (left_margin_cols); - Lisp_Object INTERNAL_FIELD (right_margin_cols); + Lisp_Object left_margin_cols; + Lisp_Object right_margin_cols; /* Width of left and right fringes. A value of nil or t means use frame values. */ - Lisp_Object INTERNAL_FIELD (left_fringe_width); - Lisp_Object INTERNAL_FIELD (right_fringe_width); + Lisp_Object left_fringe_width; + Lisp_Object right_fringe_width; /* Pixel width of scroll bars. A value of nil or t means use frame values. */ - Lisp_Object INTERNAL_FIELD (scroll_bar_width); + Lisp_Object scroll_bar_width; /* Type of vertical scroll bar. A value of nil means no scroll bar. A value of t means use frame value. */ - Lisp_Object INTERNAL_FIELD (vertical_scroll_bar_type); + Lisp_Object vertical_scroll_bar_type; /* Z - the buffer position of the last glyph in the current matrix of W. Only valid if WINDOW_END_VALID is not nil. */ - Lisp_Object INTERNAL_FIELD (window_end_pos); + Lisp_Object window_end_pos; /* Glyph matrix row of the last glyph in the current matrix of W. Only valid if WINDOW_END_VALID is not nil. */ - Lisp_Object INTERNAL_FIELD (window_end_vpos); + Lisp_Object window_end_vpos; /* t if window_end_pos is truly valid. This is nil if nontrivial redisplay is preempted since in that case the frame image that window_end_pos did not get onto the frame. */ - Lisp_Object INTERNAL_FIELD (window_end_valid); + Lisp_Object window_end_valid; /* Display-table to use for displaying chars in this window. Nil means use the buffer's own display-table. */ - Lisp_Object INTERNAL_FIELD (display_table); + Lisp_Object display_table; /* Non-nil usually means window is marked as dedicated. Note Lisp code may set this to something beyond Qnil and Qt, so bitfield can't be used here. */ - Lisp_Object INTERNAL_FIELD (dedicated); + Lisp_Object dedicated; /* Line number and position of a line somewhere above the top of the screen. If this field is nil, it means we don't have a base line. */ - Lisp_Object INTERNAL_FIELD (base_line_number); + Lisp_Object base_line_number; /* If this field is nil, it means we don't have a base line. If it is a buffer, it means don't display the line number as long as the window shows that buffer. */ - Lisp_Object INTERNAL_FIELD (base_line_pos); + Lisp_Object base_line_pos; /* If we have highlighted the region (or any part of it), this is the mark position that we used, as an integer. */ - Lisp_Object INTERNAL_FIELD (region_showing); + Lisp_Object region_showing; /* The column number currently displayed in this window's mode line, or nil if column numbers are not being displayed. */ - Lisp_Object INTERNAL_FIELD (column_number_displayed); + Lisp_Object column_number_displayed; /* If redisplay in this window goes beyond this buffer position, must run the redisplay-end-trigger-hook. */ - Lisp_Object INTERNAL_FIELD (redisplay_end_trigger); + Lisp_Object redisplay_end_trigger; /* t means this window's child windows are not (re-)combined. */ - Lisp_Object INTERNAL_FIELD (combination_limit); + Lisp_Object combination_limit; /* Alist of triples listing buffers previously shown in this window. */ - Lisp_Object INTERNAL_FIELD (prev_buffers); + Lisp_Object prev_buffers; /* List of buffers re-shown in this window. */ - Lisp_Object INTERNAL_FIELD (next_buffers); + Lisp_Object next_buffers; /* An alist with parameters. */ - Lisp_Object INTERNAL_FIELD (window_parameters); + Lisp_Object window_parameters; /* No Lisp data may follow below this point without changing mark_object in alloc.c. The member current_matrix must be the @@ -402,13 +396,13 @@ This includes scroll bars and fringes. */ #define WINDOW_TOTAL_COLS(W) \ - (XFASTINT (WGET (W, total_cols))) + (XFASTINT (W->total_cols)) /* Return the height of window W in canonical line units. This includes header and mode lines, if any. */ #define WINDOW_TOTAL_LINES(W) \ - (XFASTINT (WGET (W, total_lines))) + (XFASTINT (W->total_lines)) /* Return the total pixel width of window W. */ @@ -436,7 +430,7 @@ This includes a left-hand scroll bar, if any. */ #define WINDOW_LEFT_EDGE_COL(W) \ - (XFASTINT (WGET (W, left_col))) + (XFASTINT (W->left_col)) /* Return the canonical frame column before which window W ends. This includes a right-hand scroll bar, if any. */ @@ -448,7 +442,7 @@ This includes a header line, if any. */ #define WINDOW_TOP_EDGE_LINE(W) \ - (XFASTINT (WGET (W, top_line))) + (XFASTINT (W->top_line)) /* Return the canonical frame line before which window W ends. This includes a mode line, if any. */ @@ -552,32 +546,32 @@ /* Width of left margin area in columns. */ -#define WINDOW_LEFT_MARGIN_COLS(W) \ - (NILP (WGET (W, left_margin_cols)) \ - ? 0 \ - : XINT (WGET (W, left_margin_cols))) +#define WINDOW_LEFT_MARGIN_COLS(W) \ + (NILP (W->left_margin_cols) \ + ? 0 \ + : XINT (W->left_margin_cols)) /* Width of right marginal area in columns. */ -#define WINDOW_RIGHT_MARGIN_COLS(W) \ - (NILP (WGET (W, right_margin_cols)) \ - ? 0 \ - : XINT (WGET (W, right_margin_cols))) +#define WINDOW_RIGHT_MARGIN_COLS(W) \ + (NILP (W->right_margin_cols) \ + ? 0 \ + : XINT (W->right_margin_cols)) /* Width of left margin area in pixels. */ -#define WINDOW_LEFT_MARGIN_WIDTH(W) \ - (NILP (WGET (W, left_margin_cols)) \ - ? 0 \ - : (XINT (WGET (W, left_margin_cols)) \ +#define WINDOW_LEFT_MARGIN_WIDTH(W) \ + (NILP (W->left_margin_cols) \ + ? 0 \ + : (XINT (W->left_margin_cols) \ * WINDOW_FRAME_COLUMN_WIDTH (W))) /* Width of right marginal area in pixels. */ -#define WINDOW_RIGHT_MARGIN_WIDTH(W) \ - (NILP (WGET (W, right_margin_cols)) \ - ? 0 \ - : (XINT (WGET (W, right_margin_cols)) \ +#define WINDOW_RIGHT_MARGIN_WIDTH(W) \ + (NILP (W->right_margin_cols) \ + ? 0 \ + : (XINT (W->right_margin_cols) \ * WINDOW_FRAME_COLUMN_WIDTH (W))) /* Total width of fringes reserved for drawing truncation bitmaps, @@ -586,37 +580,37 @@ sizes aren't pixel values. If it weren't the case, we wouldn't be able to split windows horizontally nicely. */ -#define WINDOW_FRINGE_COLS(W) \ - ((INTEGERP (WGET (W, left_fringe_width)) \ - || INTEGERP (WGET (W, right_fringe_width))) \ - ? ((WINDOW_LEFT_FRINGE_WIDTH (W) \ - + WINDOW_RIGHT_FRINGE_WIDTH (W) \ - + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \ - / WINDOW_FRAME_COLUMN_WIDTH (W)) \ +#define WINDOW_FRINGE_COLS(W) \ + ((INTEGERP (W->left_fringe_width) \ + || INTEGERP (W->right_fringe_width)) \ + ? ((WINDOW_LEFT_FRINGE_WIDTH (W) \ + + WINDOW_RIGHT_FRINGE_WIDTH (W) \ + + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \ + / WINDOW_FRAME_COLUMN_WIDTH (W)) \ : FRAME_FRINGE_COLS (WINDOW_XFRAME (W))) /* Column-width of the left and right fringe. */ -#define WINDOW_LEFT_FRINGE_COLS(W) \ - ((WINDOW_LEFT_FRINGE_WIDTH ((W)) \ - + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \ +#define WINDOW_LEFT_FRINGE_COLS(W) \ + ((WINDOW_LEFT_FRINGE_WIDTH ((W)) \ + + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \ / WINDOW_FRAME_COLUMN_WIDTH (W)) -#define WINDOW_RIGHT_FRINGE_COLS(W) \ - ((WINDOW_RIGHT_FRINGE_WIDTH ((W)) \ - + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \ +#define WINDOW_RIGHT_FRINGE_COLS(W) \ + ((WINDOW_RIGHT_FRINGE_WIDTH ((W)) \ + + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \ / WINDOW_FRAME_COLUMN_WIDTH (W)) /* Pixel-width of the left and right fringe. */ #define WINDOW_LEFT_FRINGE_WIDTH(W) \ - (INTEGERP (WGET (W, left_fringe_width)) \ - ? XFASTINT (WGET (W, left_fringe_width)) \ + (INTEGERP (W->left_fringe_width) \ + ? XFASTINT (W->left_fringe_width) \ : FRAME_LEFT_FRINGE_WIDTH (WINDOW_XFRAME (W))) #define WINDOW_RIGHT_FRINGE_WIDTH(W) \ - (INTEGERP (WGET (W, right_fringe_width)) \ - ? XFASTINT (WGET (W, right_fringe_width)) \ + (INTEGERP (W->right_fringe_width) \ + ? XFASTINT (W->right_fringe_width) \ : FRAME_RIGHT_FRINGE_WIDTH (WINDOW_XFRAME (W))) /* Total width of fringes in pixels. */ @@ -633,36 +627,36 @@ and which side they are on. */ #define WINDOW_VERTICAL_SCROLL_BAR_TYPE(w) \ - (EQ (WGET (w, vertical_scroll_bar_type), Qt) \ + (EQ (w->vertical_scroll_bar_type, Qt) \ ? FRAME_VERTICAL_SCROLL_BAR_TYPE (WINDOW_XFRAME (w)) \ - : EQ (WGET (w, vertical_scroll_bar_type), Qleft) \ + : EQ (w->vertical_scroll_bar_type, Qleft) \ ? vertical_scroll_bar_left \ - : EQ (WGET (w, vertical_scroll_bar_type), Qright) \ + : EQ (w->vertical_scroll_bar_type, Qright) \ ? vertical_scroll_bar_right \ : vertical_scroll_bar_none) \ #define WINDOW_HAS_VERTICAL_SCROLL_BAR(w) \ - (EQ (WGET (w, vertical_scroll_bar_type), Qt) \ + (EQ (w->vertical_scroll_bar_type, Qt) \ ? FRAME_HAS_VERTICAL_SCROLL_BARS (WINDOW_XFRAME (w)) \ - : !NILP (WGET (w, vertical_scroll_bar_type))) + : !NILP (w->vertical_scroll_bar_type)) #define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT(w) \ - (EQ (WGET (w, vertical_scroll_bar_type), Qt) \ + (EQ (w->vertical_scroll_bar_type, Qt) \ ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (WINDOW_XFRAME (w)) \ - : EQ (WGET (w, vertical_scroll_bar_type), Qleft)) + : EQ (w->vertical_scroll_bar_type, Qleft)) -#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT(w) \ - (EQ (WGET (w, vertical_scroll_bar_type), Qt) \ - ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (WINDOW_XFRAME (w))\ - : EQ (WGET (w, vertical_scroll_bar_type), Qright)) +#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT(w) \ + (EQ (w->vertical_scroll_bar_type, Qt) \ + ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (WINDOW_XFRAME (w)) \ + : EQ (w->vertical_scroll_bar_type, Qright)) /* Width that a scroll bar in window W should have, if there is one. Measured in pixels. If scroll bars are turned off, this is still nonzero. */ #define WINDOW_CONFIG_SCROLL_BAR_WIDTH(w) \ - (INTEGERP (WGET (w, scroll_bar_width)) \ - ? XFASTINT (WGET (w, scroll_bar_width)) \ + (INTEGERP (w->scroll_bar_width) \ + ? XFASTINT (w->scroll_bar_width) \ : FRAME_CONFIG_SCROLL_BAR_WIDTH (WINDOW_XFRAME (w))) /* Width that a scroll bar in window W should have, if there is one. @@ -670,8 +664,8 @@ this is still nonzero. */ #define WINDOW_CONFIG_SCROLL_BAR_COLS(w) \ - (INTEGERP (WGET (w, scroll_bar_width)) \ - ? ((XFASTINT (WGET (w, scroll_bar_width)) \ + (INTEGERP (w->scroll_bar_width) \ + ? ((XFASTINT (w->scroll_bar_width) \ + WINDOW_FRAME_COLUMN_WIDTH (w) - 1) \ / WINDOW_FRAME_COLUMN_WIDTH (w)) \ : FRAME_CONFIG_SCROLL_BAR_COLS (WINDOW_XFRAME (w))) @@ -681,14 +675,14 @@ the right in this frame, or there are no scroll bars, value is 0. */ #define WINDOW_LEFT_SCROLL_BAR_COLS(w) \ - (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \ + (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \ ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w)) \ : 0) /* Width of a left scroll bar area in window W , measured in pixels. */ -#define WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH(w) \ - (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \ +#define WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH(w) \ + (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \ ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w)) \ : 0) @@ -697,7 +691,7 @@ the left in this frame, or there are no scroll bars, value is 0. */ #define WINDOW_RIGHT_SCROLL_BAR_COLS(w) \ - (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w) \ + (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w) \ ? WINDOW_CONFIG_SCROLL_BAR_COLS (w) \ : 0) @@ -719,7 +713,7 @@ /* Width of a left scroll bar area in window W , measured in pixels. */ #define WINDOW_SCROLL_BAR_AREA_WIDTH(w) \ - (WINDOW_HAS_VERTICAL_SCROLL_BAR (w) \ + (WINDOW_HAS_VERTICAL_SCROLL_BAR (w) \ ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w)) \ : 0) @@ -740,7 +734,7 @@ ? CURRENT_MODE_LINE_HEIGHT (W) \ : 0) -#define WINDOW_MODE_LINE_LINES(W) \ +#define WINDOW_MODE_LINE_LINES(W) \ (!! WINDOW_WANTS_MODELINE_P ((W))) /* Height in pixels, and in lines, of the header line. @@ -751,7 +745,7 @@ ? CURRENT_HEADER_LINE_HEIGHT (W) \ : 0) -#define WINDOW_HEADER_LINE_LINES(W) \ +#define WINDOW_HEADER_LINE_LINES(W) \ (!! WINDOW_WANTS_HEADER_LINE_P ((W))) /* Pixel height of window W without mode line. */ @@ -762,36 +756,36 @@ /* Pixel height of window W without mode and header line. */ -#define WINDOW_BOX_TEXT_HEIGHT(W) \ - (WINDOW_TOTAL_HEIGHT ((W)) \ - - WINDOW_MODE_LINE_HEIGHT ((W)) \ +#define WINDOW_BOX_TEXT_HEIGHT(W) \ + (WINDOW_TOTAL_HEIGHT ((W)) \ + - WINDOW_MODE_LINE_HEIGHT ((W)) \ - WINDOW_HEADER_LINE_HEIGHT ((W))) /* Convert window W relative pixel X to frame pixel coordinates. */ -#define WINDOW_TO_FRAME_PIXEL_X(W, X) \ +#define WINDOW_TO_FRAME_PIXEL_X(W, X) \ ((X) + WINDOW_BOX_LEFT_EDGE_X ((W))) /* Convert window W relative pixel Y to frame pixel coordinates. */ -#define WINDOW_TO_FRAME_PIXEL_Y(W, Y) \ +#define WINDOW_TO_FRAME_PIXEL_Y(W, Y) \ ((Y) + WINDOW_TOP_EDGE_Y ((W))) /* Convert frame relative pixel X to window relative pixel X. */ -#define FRAME_TO_WINDOW_PIXEL_X(W, X) \ +#define FRAME_TO_WINDOW_PIXEL_X(W, X) \ ((X) - WINDOW_BOX_LEFT_EDGE_X ((W))) /* Convert frame relative pixel Y to window relative pixel Y. */ -#define FRAME_TO_WINDOW_PIXEL_Y(W, Y) \ +#define FRAME_TO_WINDOW_PIXEL_Y(W, Y) \ ((Y) - WINDOW_TOP_EDGE_Y ((W))) /* Convert a text area relative x-position in window W to frame X pixel coordinates. */ -#define WINDOW_TEXT_TO_FRAME_PIXEL_X(W, X) \ +#define WINDOW_TEXT_TO_FRAME_PIXEL_X(W, X) \ (window_box_left ((W), TEXT_AREA) + (X)) /* This is the window in which the terminal's cursor should @@ -894,7 +888,7 @@ /* Value is non-zero if WINDOW is a live window. */ #define WINDOW_LIVE_P(WINDOW) \ - (WINDOWP (WINDOW) && !NILP (WGET (XWINDOW (WINDOW), buffer))) + (WINDOWP (WINDOW) && !NILP (XWINDOW (WINDOW)->buffer)) /* These used to be in lisp.h. */ === modified file 'src/xdisp.c' --- src/xdisp.c 2012-08-07 05:29:25 +0000 +++ src/xdisp.c 2012-08-07 07:33:18 +0000 @@ -984,7 +984,7 @@ int window_box_width (struct window *w, int area) { - int cols = XFASTINT (WGET (w, total_cols)); + int cols = XFASTINT (w->total_cols); int pixels = 0; if (!w->pseudo_window_p) @@ -993,22 +993,22 @@ if (area == TEXT_AREA) { - if (INTEGERP (WGET (w, left_margin_cols))) - cols -= XFASTINT (WGET (w, left_margin_cols)); - if (INTEGERP (WGET (w, right_margin_cols))) - cols -= XFASTINT (WGET (w, right_margin_cols)); + if (INTEGERP (w->left_margin_cols)) + cols -= XFASTINT (w->left_margin_cols); + if (INTEGERP (w->right_margin_cols)) + cols -= XFASTINT (w->right_margin_cols); pixels = -WINDOW_TOTAL_FRINGE_WIDTH (w); } else if (area == LEFT_MARGIN_AREA) { - cols = (INTEGERP (WGET (w, left_margin_cols)) - ? XFASTINT (WGET (w, left_margin_cols)) : 0); + cols = (INTEGERP (w->left_margin_cols) + ? XFASTINT (w->left_margin_cols) : 0); pixels = 0; } else if (area == RIGHT_MARGIN_AREA) { - cols = (INTEGERP (WGET (w, right_margin_cols)) - ? XFASTINT (WGET (w, right_margin_cols)) : 0); + cols = (INTEGERP (w->right_margin_cols) + ? XFASTINT (w->right_margin_cols) : 0); pixels = 0; } } @@ -1023,7 +1023,7 @@ int window_box_height (struct window *w) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); int height = WINDOW_TOTAL_HEIGHT (w); eassert (height >= 0); @@ -1112,7 +1112,7 @@ int window_box_left (struct window *w, int area) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); int x; if (w->pseudo_window_p) @@ -1288,13 +1288,13 @@ if (FRAME_INITIAL_P (XFRAME (WINDOW_FRAME (w)))) return visible_p; - if (XBUFFER (WGET (w, buffer)) != current_buffer) + if (XBUFFER (w->buffer) != current_buffer) { old_buffer = current_buffer; - set_buffer_internal_1 (XBUFFER (WGET (w, buffer))); + set_buffer_internal_1 (XBUFFER (w->buffer)); } - SET_TEXT_POS_FROM_MARKER (top, WGET (w, start)); + SET_TEXT_POS_FROM_MARKER (top, w->start); /* Scrolling a minibuffer window via scroll bar when the echo area shows long text sometimes resets the minibuffer contents behind our backs. */ @@ -1913,7 +1913,7 @@ { /* A pseudo-window is always full-width, and starts at the left edge of the frame, plus a frame border. */ - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); *x -= FRAME_INTERNAL_BORDER_WIDTH (f); *y = FRAME_TO_WINDOW_PIXEL_Y (w, *y); } @@ -2522,11 +2522,11 @@ check_window_end (struct window *w) { if (!MINI_WINDOW_P (w) - && !NILP (WGET (w, window_end_valid))) + && !NILP (w->window_end_valid)) { struct glyph_row *row; eassert ((row = MATRIX_ROW (w->current_matrix, - XFASTINT (WGET (w, window_end_vpos))), + XFASTINT (w->window_end_vpos)), !row->enabled_p || MATRIX_ROW_DISPLAYS_TEXT_P (row) || MATRIX_ROW_VPOS (row, w->current_matrix) == 0)); @@ -2592,7 +2592,7 @@ /* Perhaps remap BASE_FACE_ID to a user-specified alternative. */ if (! NILP (Vface_remapping_alist)) remapped_base_face_id - = lookup_basic_face (XFRAME (WGET (w, frame)), base_face_id); + = lookup_basic_face (XFRAME (w->frame), base_face_id); /* Use one of the mode line rows of W's desired matrix if appropriate. */ @@ -2620,7 +2620,7 @@ /* The window in which we iterate over current_buffer: */ XSETWINDOW (it->window, w); it->w = w; - it->f = XFRAME (WGET (w, frame)); + it->f = XFRAME (w->frame); it->cmp_it.id = -1; @@ -2704,13 +2704,13 @@ /* Get the position at which the redisplay_end_trigger hook should be run, if it is to be run at all. */ - if (MARKERP (WGET (w, redisplay_end_trigger)) - && XMARKER (WGET (w, redisplay_end_trigger))->buffer != 0) + if (MARKERP (w->redisplay_end_trigger) + && XMARKER (w->redisplay_end_trigger)->buffer != 0) it->redisplay_end_trigger_charpos - = marker_position (WGET (w, redisplay_end_trigger)); - else if (INTEGERP (WGET (w, redisplay_end_trigger))) + = marker_position (w->redisplay_end_trigger); + else if (INTEGERP (w->redisplay_end_trigger)) it->redisplay_end_trigger_charpos = - clip_to_bounds (PTRDIFF_MIN, XINT (WGET (w, redisplay_end_trigger)), PTRDIFF_MAX); + clip_to_bounds (PTRDIFF_MIN, XINT (w->redisplay_end_trigger), PTRDIFF_MAX); it->tab_width = SANE_TAB_WIDTH (current_buffer); @@ -4408,7 +4408,7 @@ if it was a text property. */ if (!STRINGP (it->string)) - object = WGET (it->w, buffer); + object = it->w->buffer; display_replaced_p = handle_display_spec (it, propval, object, overlay, position, bufpos, @@ -4816,7 +4816,7 @@ it->what = IT_IMAGE; it->image_id = -1; /* no image */ it->position = start_pos; - it->object = NILP (object) ? WGET (it->w, buffer) : object; + it->object = NILP (object) ? it->w->buffer : object; it->method = GET_FROM_IMAGE; it->from_overlay = Qnil; it->face_id = face_id; @@ -4962,7 +4962,7 @@ it->what = IT_IMAGE; it->image_id = lookup_image (it->f, value); it->position = start_pos; - it->object = NILP (object) ? WGET (it->w, buffer) : object; + it->object = NILP (object) ? it->w->buffer : object; it->method = GET_FROM_IMAGE; /* Say that we haven't consumed the characters with @@ -5785,7 +5785,7 @@ it->object = p->u.stretch.object; break; case GET_FROM_BUFFER: - it->object = WGET (it->w, buffer); + it->object = it->w->buffer; break; case GET_FROM_STRING: it->object = it->string; @@ -5798,7 +5798,7 @@ else { it->method = GET_FROM_BUFFER; - it->object = WGET (it->w, buffer); + it->object = it->w->buffer; } } it->end_charpos = p->end_charpos; @@ -6236,7 +6236,7 @@ IT_STRING_BYTEPOS (*it) = -1; it->string = Qnil; it->method = GET_FROM_BUFFER; - it->object = WGET (it->w, buffer); + it->object = it->w->buffer; it->area = TEXT_AREA; it->multibyte_p = !NILP (BVAR (current_buffer, enable_multibyte_characters)); it->sp = 0; @@ -7085,7 +7085,7 @@ else { it->method = GET_FROM_BUFFER; - it->object = WGET (it->w, buffer); + it->object = it->w->buffer; } it->dpvec = NULL; @@ -7660,7 +7660,7 @@ setting face_before_selective_p. */ it->saved_face_id = it->face_id; it->method = GET_FROM_BUFFER; - it->object = WGET (it->w, buffer); + it->object = it->w->buffer; reseat_at_next_visible_line_start (it, 1); it->face_before_selective_p = 1; } @@ -7924,7 +7924,7 @@ /* Record what we have and where it came from. */ it->what = IT_CHARACTER; - it->object = WGET (it->w, buffer); + it->object = it->w->buffer; it->position = it->current.pos; /* Normally we return the character found above, except when we @@ -8030,7 +8030,7 @@ return 0; } it->position = it->current.pos; - it->object = WGET (it->w, buffer); + it->object = it->w->buffer; it->c = composition_update_it (&it->cmp_it, IT_CHARPOS (*it), IT_BYTEPOS (*it), Qnil); } @@ -8891,7 +8891,7 @@ && it->current_x == it->last_visible_x - 1 && it->c != '\n' && it->c != '\t' - && it->vpos < XFASTINT (WGET (it->w, window_end_vpos))) + && it->vpos < XFASTINT (it->w->window_end_vpos)) { it->continuation_lines_width += it->current_x; it->current_x = it->hpos = it->max_ascent = it->max_descent = 0; @@ -9643,7 +9643,7 @@ /* Get the frame containing the mini-buffer that the selected frame is using. */ mini_window = FRAME_MINIBUF_WINDOW (sf); - frame = WGET (XWINDOW (mini_window), frame); + frame = XWINDOW (mini_window)->frame; f = XFRAME (frame); FRAME_SAMPLE_VISIBILITY (f); @@ -9970,7 +9970,7 @@ if (w) { WSET (w, buffer, buffer); - set_marker_both (WGET (w, pointm), buffer, BEG, BEG_BYTE); + set_marker_both (w->pointm, buffer, BEG, BEG_BYTE); } BVAR (current_buffer, undo_list) = Qt; @@ -10018,9 +10018,9 @@ if (w) { XSETWINDOW (tmp, w); ASET (vector, i, tmp); ++i; - ASET (vector, i, WGET (w, buffer)); ++i; - ASET (vector, i, make_number (XMARKER (WGET (w, pointm))->charpos)); ++i; - ASET (vector, i, make_number (XMARKER (WGET (w, pointm))->bytepos)); ++i; + ASET (vector, i, w->buffer); ++i; + ASET (vector, i, make_number (XMARKER (w->pointm)->charpos)); ++i; + ASET (vector, i, make_number (XMARKER (w->pointm)->bytepos)); ++i; } else { @@ -10055,7 +10055,7 @@ bytepos = AREF (vector, 6); WSET (w, buffer, buffer); - set_marker_both (WGET (w, pointm), buffer, + set_marker_both (w->pointm, buffer, XFASTINT (charpos), XFASTINT (bytepos)); } @@ -10194,7 +10194,7 @@ window_height_changed_p = resize_mini_window (w, 0); /* Use the starting position chosen by resize_mini_window. */ - SET_TEXT_POS_FROM_MARKER (start, WGET (w, start)); + SET_TEXT_POS_FROM_MARKER (start, w->start); /* Display. */ clear_glyph_matrix (w->desired_matrix); @@ -10265,15 +10265,15 @@ int resize_mini_window (struct window *w, int exact_p) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); int window_height_changed_p = 0; eassert (MINI_WINDOW_P (w)); /* By default, start display at the beginning. */ - set_marker_both (WGET (w, start), WGET (w, buffer), - BUF_BEGV (XBUFFER (WGET (w, buffer))), - BUF_BEGV_BYTE (XBUFFER (WGET (w, buffer)))); + set_marker_both (w->start, w->buffer, + BUF_BEGV (XBUFFER (w->buffer)), + BUF_BEGV_BYTE (XBUFFER (w->buffer))); /* Don't resize windows while redisplaying a window; it would confuse redisplay functions when the size of the window they are @@ -10300,10 +10300,10 @@ struct text_pos start; struct buffer *old_current_buffer = NULL; - if (current_buffer != XBUFFER (WGET (w, buffer))) + if (current_buffer != XBUFFER (w->buffer)) { old_current_buffer = current_buffer; - set_buffer_internal (XBUFFER (WGET (w, buffer))); + set_buffer_internal (XBUFFER (w->buffer)); } init_iterator (&it, w, BEGV, BEGV_BYTE, NULL, DEFAULT_FACE_ID); @@ -10345,7 +10345,7 @@ } else SET_TEXT_POS (start, BEGV, BEGV_BYTE); - SET_MARKER_FROM_TEXT_POS (WGET (w, start), start); + SET_MARKER_FROM_TEXT_POS (w->start, start); if (EQ (Vresize_mini_windows, Qgrow_only)) { @@ -11053,7 +11053,7 @@ Fselect_window (f->selected_window, Qt); set_buffer_internal_1 - (XBUFFER (WGET (XWINDOW (f->selected_window), buffer))); + (XBUFFER (XWINDOW (f->selected_window)->buffer)); fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format; mode_line_target = MODE_LINE_TITLE; @@ -11172,8 +11172,7 @@ if (windows_or_buffers_changed && FRAME_NS_P (f)) ns_set_doc_edited - (f, Fbuffer_modified_p - (WGET (XWINDOW (f->selected_window), buffer))); + (f, Fbuffer_modified_p (XWINDOW (f->selected_window)->buffer)); #endif UNGCPRO; } @@ -11238,19 +11237,19 @@ /* This used to test w->update_mode_line, but we believe there is no need to recompute the menu in that case. */ || update_mode_lines - || ((BUF_SAVE_MODIFF (XBUFFER (WGET (w, buffer))) - < BUF_MODIFF (XBUFFER (WGET (w, buffer)))) + || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer)) + < BUF_MODIFF (XBUFFER (w->buffer))) != w->last_had_star) || ((!NILP (Vtransient_mark_mode) - && !NILP (BVAR (XBUFFER (WGET (w, buffer)), mark_active))) - != !NILP (WGET (w, region_showing)))) + && !NILP (BVAR (XBUFFER (w->buffer), mark_active))) + != !NILP (w->region_showing))) { struct buffer *prev = current_buffer; ptrdiff_t count = SPECPDL_INDEX (); specbind (Qinhibit_menubar_update, Qt); - set_buffer_internal_1 (XBUFFER (WGET (w, buffer))); + set_buffer_internal_1 (XBUFFER (w->buffer)); if (save_match_data) record_unwind_save_match_data (); if (NILP (Voverriding_local_map_menu_flag)) @@ -11436,12 +11435,12 @@ if (windows_or_buffers_changed || w->update_mode_line || update_mode_lines - || ((BUF_SAVE_MODIFF (XBUFFER (WGET (w, buffer))) - < BUF_MODIFF (XBUFFER (WGET (w, buffer)))) + || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer)) + < BUF_MODIFF (XBUFFER (w->buffer))) != w->last_had_star) || ((!NILP (Vtransient_mark_mode) - && !NILP (BVAR (XBUFFER (WGET (w, buffer)), mark_active))) - != !NILP (WGET (w, region_showing)))) + && !NILP (BVAR (XBUFFER (w->buffer), mark_active))) + != !NILP (w->region_showing))) { struct buffer *prev = current_buffer; ptrdiff_t count = SPECPDL_INDEX (); @@ -11452,7 +11451,7 @@ /* Set current_buffer to the buffer of the selected window of the frame, so that we get the right local keymaps. */ - set_buffer_internal_1 (XBUFFER (WGET (w, buffer))); + set_buffer_internal_1 (XBUFFER (w->buffer)); /* Save match data, if we must. */ if (save_match_data) @@ -12323,10 +12322,10 @@ { struct window *w = XWINDOW (window); - if (WINDOWP (WGET (w, hchild))) - hscrolled_p |= hscroll_window_tree (WGET (w, hchild)); - else if (WINDOWP (WGET (w, vchild))) - hscrolled_p |= hscroll_window_tree (WGET (w, vchild)); + if (WINDOWP (w->hchild)) + hscrolled_p |= hscroll_window_tree (w->hchild); + else if (WINDOWP (w->vchild)) + hscrolled_p |= hscroll_window_tree (w->vchild); else if (w->cursor.vpos >= 0) { int h_margin; @@ -12346,7 +12345,7 @@ /* Scroll when cursor is inside this scroll margin. */ h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w); - if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, WGET (w, buffer))) + if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, w->buffer)) /* For left-to-right rows, hscroll when cursor is either (i) inside the right hscroll margin, or (ii) if it is inside the left margin and the window is already @@ -12381,13 +12380,13 @@ /* Find point in a display of infinite width. */ saved_current_buffer = current_buffer; - current_buffer = XBUFFER (WGET (w, buffer)); + current_buffer = XBUFFER (w->buffer); if (w == XWINDOW (selected_window)) pt = PT; else { - pt = marker_position (WGET (w, pointm)); + pt = marker_position (w->pointm); pt = max (BEGV, pt); pt = min (ZV, pt); } @@ -12438,14 +12437,14 @@ redisplay. */ if (w->hscroll != hscroll) { - XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1; + XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; w->hscroll = hscroll; hscrolled_p = 1; } } } - window = WGET (w, next); + window = w->next; } /* Value is non-zero if hscroll of any leaf window has been changed. */ @@ -12527,9 +12526,9 @@ if (trace_redisplay_p) fprintf (stderr, "%p (%s): %s\n", w, - ((BUFFERP (WGET (w, buffer)) - && STRINGP (BVAR (XBUFFER (WGET (w, buffer)), name))) - ? SSDATA (BVAR (XBUFFER (WGET (w, buffer)), name)) + ((BUFFERP (w->buffer) + && STRINGP (BVAR (XBUFFER (w->buffer), name))) + ? SSDATA (BVAR (XBUFFER (w->buffer), name)) : "no buffer"), method + len); } @@ -12594,8 +12593,8 @@ require to redisplay the whole paragraph. It might be worthwhile to find the paragraph limits and widen the range of redisplayed lines to that, but for now just give up this optimization. */ - if (!NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering)) - && NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_paragraph_direction))) + if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)) + && NILP (BVAR (XBUFFER (w->buffer), bidi_paragraph_direction))) unchanged_p = 0; } @@ -12807,7 +12806,7 @@ reconsider_clip_changes (struct window *w, struct buffer *b) { if (b->clip_changed - && !NILP (WGET (w, window_end_valid)) + && !NILP (w->window_end_valid) && w->current_matrix->buffer == b && w->current_matrix->zv == BUF_ZV (b) && w->current_matrix->begv == BUF_BEGV (b)) @@ -12819,20 +12818,20 @@ b->clip_changed has already been set to 1, we can skip this check. */ if (!b->clip_changed - && BUFFERP (WGET (w, buffer)) && !NILP (WGET (w, window_end_valid))) + && BUFFERP (w->buffer) && !NILP (w->window_end_valid)) { ptrdiff_t pt; if (w == XWINDOW (selected_window)) pt = PT; else - pt = marker_position (WGET (w, pointm)); + pt = marker_position (w->pointm); - if ((w->current_matrix->buffer != XBUFFER (WGET (w, buffer)) + if ((w->current_matrix->buffer != XBUFFER (w->buffer) || pt != w->last_point) && check_point_in_composition (w->current_matrix->buffer, w->last_point, - XBUFFER (WGET (w, buffer)), pt)) + XBUFFER (w->buffer), pt)) b->clip_changed = 1; } } @@ -12915,7 +12914,7 @@ /* Don't examine these until after testing Vinhibit_redisplay. When Emacs is shutting down, perhaps because its connection to X has dropped, we should not look at them at all. */ - fr = XFRAME (WGET (w, frame)); + fr = XFRAME (w->frame); sf = SELECTED_FRAME (); if (!fr->glyphs_initialized_p) @@ -13051,18 +13050,18 @@ specbind (Qinhibit_point_motion_hooks, Qt); /* If %c is in the mode line, update it if needed. */ - if (!NILP (WGET (w, column_number_displayed)) + if (!NILP (w->column_number_displayed) /* This alternative quickly identifies a common case where no change is needed. */ && !(PT == w->last_point && w->last_modified >= MODIFF && w->last_overlay_modified >= OVERLAY_MODIFF) - && (XFASTINT (WGET (w, column_number_displayed)) != current_column ())) + && (XFASTINT (w->column_number_displayed) != current_column ())) w->update_mode_line = 1; unbind_to (count1, Qnil); - FRAME_SCROLL_BOTTOM_VPOS (XFRAME (WGET (w, frame))) = -1; + FRAME_SCROLL_BOTTOM_VPOS (XFRAME (w->frame)) = -1; /* The variable buffer_shared is set in redisplay_window and indicates that we redisplay a buffer in different windows. See @@ -13146,11 +13145,11 @@ the whole window. The assignment to this_line_start_pos prevents the optimization directly below this if-statement. */ if (((!NILP (Vtransient_mark_mode) - && !NILP (BVAR (XBUFFER (WGET (w, buffer)), mark_active))) - != !NILP (WGET (w, region_showing))) - || (!NILP (WGET (w, region_showing)) - && !EQ (WGET (w, region_showing), - Fmarker_position (BVAR (XBUFFER (WGET (w, buffer)), mark))))) + && !NILP (BVAR (XBUFFER (w->buffer), mark_active))) + != !NILP (w->region_showing)) + || (!NILP (w->region_showing) + && !EQ (w->region_showing, + Fmarker_position (BVAR (XBUFFER (w->buffer), mark))))) CHARPOS (this_line_start_pos) = 0; /* Optimize the case that only the line containing the cursor in the @@ -13164,11 +13163,11 @@ && !w->update_mode_line && !current_buffer->clip_changed && !current_buffer->prevent_redisplay_optimizations_p - && FRAME_VISIBLE_P (XFRAME (WGET (w, frame))) - && !FRAME_OBSCURED_P (XFRAME (WGET (w, frame))) + && FRAME_VISIBLE_P (XFRAME (w->frame)) + && !FRAME_OBSCURED_P (XFRAME (w->frame)) /* Make sure recorded data applies to current buffer, etc. */ && this_line_buffer == current_buffer - && current_buffer == XBUFFER (WGET (w, buffer)) + && current_buffer == XBUFFER (w->buffer) && !w->force_start && !w->optional_new_start /* Point must be on the line that we have info recorded about. */ @@ -13266,10 +13265,10 @@ adjusted. */ if ((it.glyph_row - 1)->displays_text_p) { - if (XFASTINT (WGET (w, window_end_vpos)) < this_line_vpos) + if (XFASTINT (w->window_end_vpos) < this_line_vpos) WSET (w, window_end_vpos, make_number (this_line_vpos)); } - else if (XFASTINT (WGET (w, window_end_vpos)) == this_line_vpos + else if (XFASTINT (w->window_end_vpos) == this_line_vpos && this_line_vpos > 0) WSET (w, window_end_vpos, make_number (this_line_vpos - 1)); WSET (w, window_end_valid, Qnil); @@ -13318,7 +13317,7 @@ && (EQ (selected_window, BVAR (current_buffer, last_selected_window)) || highlight_nonselected_windows) - && NILP (WGET (w, region_showing)) + && NILP (w->region_showing) && NILP (Vshow_trailing_whitespace) && !cursor_in_echo_area) { @@ -13479,7 +13478,7 @@ Lisp_Object mini_window = FRAME_MINIBUF_WINDOW (sf); struct frame *mini_frame; - displayed_buffer = XBUFFER (WGET (XWINDOW (selected_window), buffer)); + displayed_buffer = XBUFFER (XWINDOW (selected_window)->buffer); /* Use list_of_error, not Qerror, so that we catch only errors and don't run the debugger. */ internal_condition_case_1 (redisplay_window_1, selected_window, @@ -13545,7 +13544,7 @@ /* If we pause after scrolling, some rows in the current matrices of some windows are not valid. */ if (!WINDOW_FULL_WIDTH_P (w) - && !FRAME_WINDOW_P (XFRAME (WGET (w, frame)))) + && !FRAME_WINDOW_P (XFRAME (w->frame))) update_mode_lines = 1; } else @@ -13703,9 +13702,9 @@ static void mark_window_display_accurate_1 (struct window *w, int accurate_p) { - if (BUFFERP (WGET (w, buffer))) + if (BUFFERP (w->buffer)) { - struct buffer *b = XBUFFER (WGET (w, buffer)); + struct buffer *b = XBUFFER (w->buffer); w->last_modified = accurate_p ? BUF_MODIFF(b) : 0; w->last_overlay_modified = accurate_p ? BUF_OVERLAY_MODIFF(b) : 0; @@ -13732,13 +13731,13 @@ if (w == XWINDOW (selected_window)) w->last_point = BUF_PT (b); else - w->last_point = XMARKER (WGET (w, pointm))->charpos; + w->last_point = XMARKER (w->pointm)->charpos; } } if (accurate_p) { - WSET (w, window_end_valid, WGET (w, buffer)); + WSET (w, window_end_valid, w->buffer); w->update_mode_line = 0; } } @@ -13754,15 +13753,15 @@ { struct window *w; - for (; !NILP (window); window = WGET (w, next)) + for (; !NILP (window); window = w->next) { w = XWINDOW (window); mark_window_display_accurate_1 (w, accurate_p); - if (!NILP (WGET (w, vchild))) - mark_window_display_accurate (WGET (w, vchild), accurate_p); - if (!NILP (WGET (w, hchild))) - mark_window_display_accurate (WGET (w, hchild), accurate_p); + if (!NILP (w->vchild)) + mark_window_display_accurate (w->vchild, accurate_p); + if (!NILP (w->hchild)) + mark_window_display_accurate (w->hchild, accurate_p); } if (accurate_p) @@ -13822,13 +13821,13 @@ { struct window *w = XWINDOW (window); - if (!NILP (WGET (w, hchild))) - redisplay_windows (WGET (w, hchild)); - else if (!NILP (WGET (w, vchild))) - redisplay_windows (WGET (w, vchild)); - else if (!NILP (WGET (w, buffer))) + if (!NILP (w->hchild)) + redisplay_windows (w->hchild); + else if (!NILP (w->vchild)) + redisplay_windows (w->vchild); + else if (!NILP (w->buffer)) { - displayed_buffer = XBUFFER (WGET (w, buffer)); + displayed_buffer = XBUFFER (w->buffer); /* Use list_of_error, not Qerror, so that we catch only errors and don't run the debugger. */ internal_condition_case_1 (redisplay_window_0, window, @@ -13836,7 +13835,7 @@ redisplay_window_error); } - window = WGET (w, next); + window = w->next; } } @@ -14470,7 +14469,7 @@ && !MATRIX_ROW_CONTINUATION_LINE_P (row) && row->x == 0) { - this_line_buffer = XBUFFER (WGET (w, buffer)); + this_line_buffer = XBUFFER (w->buffer); CHARPOS (this_line_start_pos) = MATRIX_ROW_START_CHARPOS (row) + delta; @@ -14504,19 +14503,19 @@ run_window_scroll_functions (Lisp_Object window, struct text_pos startp) { struct window *w = XWINDOW (window); - SET_MARKER_FROM_TEXT_POS (WGET (w, start), startp); + SET_MARKER_FROM_TEXT_POS (w->start, startp); - if (current_buffer != XBUFFER (WGET (w, buffer))) + if (current_buffer != XBUFFER (w->buffer)) abort (); if (!NILP (Vwindow_scroll_functions)) { run_hook_with_args_2 (Qwindow_scroll_functions, window, make_number (CHARPOS (startp))); - SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start)); + SET_TEXT_POS_FROM_MARKER (startp, w->start); /* In case the hook functions switch buffers. */ - if (current_buffer != XBUFFER (WGET (w, buffer))) - set_buffer_internal_1 (XBUFFER (WGET (w, buffer))); + if (current_buffer != XBUFFER (w->buffer)) + set_buffer_internal_1 (XBUFFER (w->buffer)); } return startp; @@ -14606,7 +14605,7 @@ int temp_scroll_step, int last_line_misfit) { struct window *w = XWINDOW (window); - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); struct text_pos pos, startp; struct it it; int this_scroll_margin, scroll_max, rc, height; @@ -14620,7 +14619,7 @@ debug_method_add (w, "try_scrolling"); #endif - SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start)); + SET_TEXT_POS_FROM_MARKER (startp, w->start); /* Compute scroll margin height in pixels. We scroll when point is within this distance from the top or bottom of the window. */ @@ -14881,7 +14880,7 @@ struct text_pos pos, start_pos; int window_start_changed_p = 0; - SET_TEXT_POS_FROM_MARKER (start_pos, WGET (w, start)); + SET_TEXT_POS_FROM_MARKER (start_pos, w->start); /* If window start is on a continuation line... Window start may be < BEGV in case there's invisible text at the start of the @@ -14929,7 +14928,7 @@ } /* Set the window start there. */ - SET_MARKER_FROM_TEXT_POS (WGET (w, start), pos); + SET_MARKER_FROM_TEXT_POS (w->start, pos); window_start_changed_p = 1; } } @@ -14965,7 +14964,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_step) { struct window *w = XWINDOW (window); - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); int rc = CURSOR_MOVEMENT_CANNOT_BE_USED; #ifdef GLYPH_DEBUG @@ -14996,7 +14995,7 @@ set the cursor. */ && !(!NILP (Vtransient_mark_mode) && !NILP (BVAR (current_buffer, mark_active))) - && NILP (WGET (w, region_showing)) + && NILP (w->region_showing) && NILP (Vshow_trailing_whitespace) /* This code is not used for mini-buffer for the sake of the case of redisplaying to replace an echo area message; since in @@ -15010,8 +15009,8 @@ larger than the window. This should really be fixed in window.c. I don't have this on my list, now, so we do approximately the same as the old redisplay code. --gerd. */ - && INTEGERP (WGET (w, window_end_vpos)) - && XFASTINT (WGET (w, window_end_vpos)) < w->current_matrix->nrows + && INTEGERP (w->window_end_vpos) + && XFASTINT (w->window_end_vpos) < w->current_matrix->nrows && (FRAME_WINDOW_P (f) || !overlay_arrow_in_current_buffer_p ())) { @@ -15148,7 +15147,7 @@ must_scroll = 1; } else if (rc != CURSOR_MOVEMENT_SUCCESS - && !NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering))) + && !NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))) { struct glyph_row *row1; @@ -15211,7 +15210,7 @@ else if (scroll_p) rc = CURSOR_MOVEMENT_MUST_SCROLL; else if (rc != CURSOR_MOVEMENT_SUCCESS - && !NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering))) + && !NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))) { /* With bidi-reordered rows, there could be more than one candidate row whose start and end positions @@ -15318,12 +15317,12 @@ || (w == XWINDOW (minibuf_window) && NILP (echo_area_buffer[0]))) { - struct buffer *buf = XBUFFER (WGET (w, buffer)); + struct buffer *buf = XBUFFER (w->buffer); whole = BUF_ZV (buf) - BUF_BEGV (buf); - start = marker_position (WGET (w, start)) - BUF_BEGV (buf); + start = marker_position (w->start) - BUF_BEGV (buf); /* I don't think this is guaranteed to be right. For the moment, we'll pretend it is. */ - end = BUF_Z (buf) - XFASTINT (WGET (w, window_end_pos)) - BUF_BEGV (buf); + end = BUF_Z (buf) - XFASTINT (w->window_end_pos) - BUF_BEGV (buf); if (end < start) end = start; @@ -15334,8 +15333,8 @@ start = end = whole = 0; /* Indicate what this scroll bar ought to be displaying now. */ - if (FRAME_TERMINAL (XFRAME (WGET (w, frame)))->set_vertical_scroll_bar_hook) - (*FRAME_TERMINAL (XFRAME (WGET (w, frame)))->set_vertical_scroll_bar_hook) + if (FRAME_TERMINAL (XFRAME (w->frame))->set_vertical_scroll_bar_hook) + (*FRAME_TERMINAL (XFRAME (w->frame))->set_vertical_scroll_bar_hook) (w, end - start, whole, start); } @@ -15351,8 +15350,8 @@ redisplay_window (Lisp_Object window, int just_this_one_p) { struct window *w = XWINDOW (window); - struct frame *f = XFRAME (WGET (w, frame)); - struct buffer *buffer = XBUFFER (WGET (w, buffer)); + struct frame *f = XFRAME (w->frame); + struct buffer *buffer = XBUFFER (w->buffer); struct buffer *old = current_buffer; struct text_pos lpoint, opoint, startp; int update_mode_line; @@ -15375,7 +15374,7 @@ opoint = lpoint; /* W must be a leaf window here. */ - eassert (!NILP (WGET (w, buffer))); + eassert (!NILP (w->buffer)); #ifdef GLYPH_DEBUG *w->desired_matrix->method = 0; #endif @@ -15405,10 +15404,10 @@ else if ((w != XWINDOW (minibuf_window) || minibuf_level == 0) /* When buffer is nonempty, redisplay window normally. */ - && BUF_Z (XBUFFER (WGET (w, buffer))) == BUF_BEG (XBUFFER (WGET (w, buffer))) + && BUF_Z (XBUFFER (w->buffer)) == BUF_BEG (XBUFFER (w->buffer)) /* Quail displays non-mini buffers in minibuffer window. In that case, redisplay the window normally. */ - && !NILP (Fmemq (WGET (w, buffer), Vminibuffer_list))) + && !NILP (Fmemq (w->buffer, Vminibuffer_list))) { /* W is a mini-buffer window, but it's not active, so clear it. */ @@ -15430,10 +15429,10 @@ value. */ /* Really select the buffer, for the sake of buffer-local variables. */ - set_buffer_internal_1 (XBUFFER (WGET (w, buffer))); + set_buffer_internal_1 (XBUFFER (w->buffer)); current_matrix_up_to_date_p - = (!NILP (WGET (w, window_end_valid)) + = (!NILP (w->window_end_valid) && !current_buffer->clip_changed && !current_buffer->prevent_redisplay_optimizations_p && w->last_modified >= MODIFF @@ -15457,7 +15456,7 @@ specbind (Qinhibit_point_motion_hooks, Qt); buffer_unchanged_p - = (!NILP (WGET (w, window_end_valid)) + = (!NILP (w->window_end_valid) && !current_buffer->clip_changed && w->last_modified >= MODIFF && w->last_overlay_modified >= OVERLAY_MODIFF); @@ -15468,7 +15467,7 @@ { /* If window starts on a continuation line, maybe adjust the window start in case the window's width changed. */ - if (XMARKER (WGET (w, start))->buffer == current_buffer) + if (XMARKER (w->start)->buffer == current_buffer) compute_window_start_on_continuation_line (w); WSET (w, window_end_valid, Qnil); @@ -15482,13 +15481,13 @@ abort (); /* If %c is in mode line, update it if needed. */ - if (!NILP (WGET (w, column_number_displayed)) + if (!NILP (w->column_number_displayed) /* This alternative quickly identifies a common case where no change is needed. */ && !(PT == w->last_point && w->last_modified >= MODIFF && w->last_overlay_modified >= OVERLAY_MODIFF) - && (XFASTINT (WGET (w, column_number_displayed)) != current_column ())) + && (XFASTINT (w->column_number_displayed) != current_column ())) update_mode_line = 1; /* Count number of windows showing the selected buffer. An indirect @@ -15497,7 +15496,7 @@ { struct buffer *current_base, *window_base; current_base = current_buffer; - window_base = XBUFFER (WGET (XWINDOW (selected_window), buffer)); + window_base = XBUFFER (XWINDOW (selected_window)->buffer); if (current_base->base_buffer) current_base = current_base->base_buffer; if (window_base->base_buffer) @@ -15510,19 +15509,19 @@ window, set up appropriate value. */ if (!EQ (window, selected_window)) { - ptrdiff_t new_pt = XMARKER (WGET (w, pointm))->charpos; - ptrdiff_t new_pt_byte = marker_byte_position (WGET (w, pointm)); + ptrdiff_t new_pt = XMARKER (w->pointm)->charpos; + ptrdiff_t new_pt_byte = marker_byte_position (w->pointm); if (new_pt < BEGV) { new_pt = BEGV; new_pt_byte = BEGV_BYTE; - set_marker_both (WGET (w, pointm), Qnil, BEGV, BEGV_BYTE); + set_marker_both (w->pointm, Qnil, BEGV, BEGV_BYTE); } else if (new_pt > (ZV - 1)) { new_pt = ZV; new_pt_byte = ZV_BYTE; - set_marker_both (WGET (w, pointm), Qnil, ZV, ZV_BYTE); + set_marker_both (w->pointm, Qnil, ZV, ZV_BYTE); } /* We don't use SET_PT so that the point-motion hooks don't run. */ @@ -15549,10 +15548,10 @@ } /* If window-start is screwed up, choose a new one. */ - if (XMARKER (WGET (w, start))->buffer != current_buffer) + if (XMARKER (w->start)->buffer != current_buffer) goto recenter; - SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start)); + SET_TEXT_POS_FROM_MARKER (startp, w->start); /* If someone specified a new starting point but did not insist, check whether it can be used. */ @@ -15651,7 +15650,7 @@ MATRIX_ROW_START_BYTEPOS (row)); if (w != XWINDOW (selected_window)) - set_marker_both (WGET (w, pointm), Qnil, PT, PT_BYTE); + set_marker_both (w->pointm, Qnil, PT, PT_BYTE); else if (current_buffer == old) SET_TEXT_POS (lpoint, PT, PT_BYTE); @@ -15753,7 +15752,7 @@ sets it. So, we need to check the return value of compute_window_start_on_continuation_line. (See also bug#197). */ - && XMARKER (WGET (w, start))->buffer == current_buffer + && XMARKER (w->start)->buffer == current_buffer && compute_window_start_on_continuation_line (w) /* It doesn't make sense to force the window start like we do at label force_start if it is already known that point @@ -15764,7 +15763,7 @@ && pos_visible_p (w, PT, &d1, &d2, &d3, &d4, &d5, &d6)) { w->force_start = 1; - SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start)); + SET_TEXT_POS_FROM_MARKER (startp, w->start); goto force_start; } @@ -15974,7 +15973,7 @@ /* Set the window start position here explicitly, to avoid an infinite loop in case the functions in window-scroll-functions get errors. */ - set_marker_both (WGET (w, start), Qnil, IT_CHARPOS (it), IT_BYTEPOS (it)); + set_marker_both (w->start, Qnil, IT_CHARPOS (it), IT_BYTEPOS (it)); /* Run scroll hooks. */ startp = run_window_scroll_functions (window, it.current.pos); @@ -16005,8 +16004,8 @@ line.) */ if (w->cursor.vpos < 0) { - if (!NILP (WGET (w, window_end_valid)) - && PT >= Z - XFASTINT (WGET (w, window_end_pos))) + if (!NILP (w->window_end_valid) + && PT >= Z - XFASTINT (w->window_end_pos)) { clear_glyph_matrix (w->desired_matrix); move_it_by_lines (&it, 1); @@ -16078,7 +16077,7 @@ done: - SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start)); + SET_TEXT_POS_FROM_MARKER (startp, w->start); w->start_at_line_beg = (CHARPOS (startp) == BEGV || FETCH_BYTE (BYTEPOS (startp) - 1) == '\n'); @@ -16092,10 +16091,10 @@ && !FRAME_WINDOW_P (f) && !WINDOW_FULL_WIDTH_P (w)) /* Line number to display. */ - || INTEGERP (WGET (w, base_line_pos)) + || INTEGERP (w->base_line_pos) /* Column number is displayed and different from the one displayed. */ - || (!NILP (WGET (w, column_number_displayed)) - && (XFASTINT (WGET (w, column_number_displayed)) != current_column ()))) + || (!NILP (w->column_number_displayed) + && (XFASTINT (w->column_number_displayed) != current_column ()))) /* This means that the window has a mode line. */ && (WINDOW_WANTS_MODELINE_P (w) || WINDOW_WANTS_HEADER_LINE_P (w))) @@ -16127,7 +16126,7 @@ } if (!line_number_displayed - && !BUFFERP (WGET (w, base_line_pos))) + && !BUFFERP (w->base_line_pos)) { WSET (w, base_line_pos, Qnil); WSET (w, base_line_number, Qnil); @@ -16243,10 +16242,10 @@ struct window *w = XWINDOW (window); struct it it; struct glyph_row *last_text_row = NULL; - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); /* Make POS the new window start. */ - set_marker_both (WGET (w, start), Qnil, CHARPOS (pos), BYTEPOS (pos)); + set_marker_both (w->start, Qnil, CHARPOS (pos), BYTEPOS (pos)); /* Mark cursor position as unknown. No overlay arrow seen. */ w->cursor.vpos = -1; @@ -16295,7 +16294,7 @@ } /* If bottom moved off end of frame, change mode line percentage. */ - if (XFASTINT (WGET (w, window_end_pos)) <= 0 + if (XFASTINT (w->window_end_pos) <= 0 && Z != IT_CHARPOS (it)) w->update_mode_line = 1; @@ -16308,12 +16307,12 @@ w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); WSET (w, window_end_pos, - make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row))); + make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row))); WSET (w, window_end_vpos, - make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix))); + make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix))); eassert (MATRIX_ROW (w->desired_matrix, - XFASTINT (WGET (w, window_end_vpos)))->displays_text_p); + XFASTINT (w->window_end_vpos))->displays_text_p); } else { @@ -16341,7 +16340,7 @@ static int try_window_reusing_current_matrix (struct window *w) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); struct glyph_row *bottom_row; struct it it; struct run run; @@ -16368,7 +16367,7 @@ /* Can't do this if region may have changed. */ if ((!NILP (Vtransient_mark_mode) && !NILP (BVAR (current_buffer, mark_active))) - || !NILP (WGET (w, region_showing)) + || !NILP (w->region_showing) || !NILP (Vshow_trailing_whitespace)) return 0; @@ -16385,7 +16384,7 @@ /* The variable new_start now holds the new window start. The old start `start' can be determined from the current matrix. */ - SET_TEXT_POS_FROM_MARKER (new_start, WGET (w, start)); + SET_TEXT_POS_FROM_MARKER (new_start, w->start); start = start_row->minpos; start_vpos = MATRIX_ROW_VPOS (start_row, w->current_matrix); @@ -16548,18 +16547,18 @@ w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_reused_text_row); WSET (w, window_end_pos, - make_number (Z - MATRIX_ROW_END_CHARPOS (last_reused_text_row))); + make_number (Z - MATRIX_ROW_END_CHARPOS (last_reused_text_row))); WSET (w, window_end_vpos, - make_number (MATRIX_ROW_VPOS (last_reused_text_row, w->current_matrix))); + make_number (MATRIX_ROW_VPOS (last_reused_text_row, w->current_matrix))); } else if (last_text_row) { w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); WSET (w, window_end_pos, - make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row))); + make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row))); WSET (w, window_end_vpos, - make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix))); + make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix))); } else { @@ -16722,7 +16721,7 @@ /* Can't use this optimization with bidi-reordered glyph rows, unless cursor is already at point. */ - if (!NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering))) + if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))) { if (!(w->cursor.hpos >= 0 && w->cursor.hpos < row->used[TEXT_AREA] @@ -16750,14 +16749,14 @@ w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); WSET (w, window_end_pos, - make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row))); + make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row))); WSET (w, window_end_vpos, - make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix))); + make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix))); } else { WSET (w, window_end_vpos, - make_number (XFASTINT (WGET (w, window_end_vpos)) - nrows_scrolled)); + make_number (XFASTINT (w->window_end_vpos) - nrows_scrolled)); } WSET (w, window_end_valid, Qnil); @@ -16893,16 +16892,16 @@ /* Display must not have been paused, otherwise the current matrix is not up to date. */ - eassert (!NILP (WGET (w, window_end_valid))); + eassert (!NILP (w->window_end_valid)); /* A value of window_end_pos >= END_UNCHANGED means that the window end is in the range of changed text. If so, there is no unchanged row at the end of W's current matrix. */ - if (XFASTINT (WGET (w, window_end_pos)) >= END_UNCHANGED) + if (XFASTINT (w->window_end_pos) >= END_UNCHANGED) return NULL; /* Set row to the last row in W's current matrix displaying text. */ - row = MATRIX_ROW (w->current_matrix, XFASTINT (WGET (w, window_end_vpos))); + row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); /* If matrix is entirely empty, no unchanged row exists. */ if (MATRIX_ROW_DISPLAYS_TEXT_P (row)) @@ -16913,7 +16912,7 @@ buffer positions in the current matrix to current buffer positions for characters not in changed text. */ ptrdiff_t Z_old = - MATRIX_ROW_END_CHARPOS (row) + XFASTINT (WGET (w, window_end_pos)); + MATRIX_ROW_END_CHARPOS (row) + XFASTINT (w->window_end_pos); ptrdiff_t Z_BYTE_old = MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos; ptrdiff_t last_unchanged_pos, last_unchanged_pos_old; @@ -16961,12 +16960,12 @@ static void sync_frame_with_window_matrix_rows (struct window *w) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); struct glyph_row *window_row, *window_row_end, *frame_row; /* Preconditions: W must be a leaf window and full-width. Its frame must have a frame matrix. */ - eassert (NILP (WGET (w, hchild)) && NILP (WGET (w, vchild))); + eassert (NILP (w->hchild) && NILP (w->vchild)); eassert (WINDOW_FULL_WIDTH_P (w)); eassert (!FRAME_WINDOW_P (f)); @@ -17008,7 +17007,7 @@ { struct glyph_row *row = start; struct glyph_row *best_row = NULL; - ptrdiff_t mindif = BUF_ZV (XBUFFER (WGET (w, buffer))) + 1; + ptrdiff_t mindif = BUF_ZV (XBUFFER (w->buffer)) + 1; int last_y; /* If we happen to start on a header-line, skip that. */ @@ -17044,7 +17043,7 @@ { struct glyph *g; - if (NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering)) + if (NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)) || (!best_row && !row->continued_p)) return row; /* In bidi-reordered rows, there could be several rows @@ -17113,7 +17112,7 @@ static int try_window_id (struct window *w) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); struct glyph_matrix *current_matrix = w->current_matrix; struct glyph_matrix *desired_matrix = w->desired_matrix; struct glyph_row *last_unchanged_at_beg_row; @@ -17147,7 +17146,7 @@ #define GIVE_UP(X) return 0 #endif - SET_TEXT_POS_FROM_MARKER (start, WGET (w, start)); + SET_TEXT_POS_FROM_MARKER (start, w->start); /* Don't use this for mini-windows because these can show messages and mini-buffers, and we don't handle that here. */ @@ -17185,7 +17184,7 @@ GIVE_UP (7); /* Verify that display wasn't paused. */ - if (NILP (WGET (w, window_end_valid))) + if (NILP (w->window_end_valid)) GIVE_UP (8); /* Can't use this if highlighting a region because a cursor movement @@ -17199,7 +17198,7 @@ GIVE_UP (11); /* Likewise if showing a region. */ - if (!NILP (WGET (w, region_showing))) + if (!NILP (w->region_showing)) GIVE_UP (10); /* Can't use this if overlay arrow position and/or string have @@ -17211,7 +17210,7 @@ wrapped line can change the wrap position, altering the line above it. It might be worthwhile to handle this more intelligently, but for now just redisplay from scratch. */ - if (!NILP (BVAR (XBUFFER (WGET (w, buffer)), word_wrap))) + if (!NILP (BVAR (XBUFFER (w->buffer), word_wrap))) GIVE_UP (21); /* Under bidi reordering, adding or deleting a character in the @@ -17222,8 +17221,8 @@ to find the paragraph limits and widen the range of redisplayed lines to that, but for now just give up this optimization and redisplay from scratch. */ - if (!NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering)) - && NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_paragraph_direction))) + if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)) + && NILP (BVAR (XBUFFER (w->buffer), bidi_paragraph_direction))) GIVE_UP (22); /* Make sure beg_unchanged and end_unchanged are up to date. Do it @@ -17249,7 +17248,7 @@ This case happens with stealth-fontification. Note that although the display is unchanged, glyph positions in the matrix have to be adjusted, of course. */ - row = MATRIX_ROW (w->current_matrix, XFASTINT (WGET (w, window_end_vpos))); + row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); if (MATRIX_ROW_DISPLAYS_TEXT_P (row) && ((last_changed_charpos < CHARPOS (start) && CHARPOS (start) == BEGV) @@ -17261,7 +17260,7 @@ /* Compute how many chars/bytes have been added to or removed from the buffer. */ - Z_old = MATRIX_ROW_END_CHARPOS (row) + XFASTINT (WGET (w, window_end_pos)); + Z_old = MATRIX_ROW_END_CHARPOS (row) + XFASTINT (w->window_end_pos); Z_BYTE_old = MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos; Z_delta = Z - Z_old; Z_delta_bytes = Z_BYTE - Z_BYTE_old; @@ -17368,7 +17367,7 @@ /* Give up if the window ends in strings. Overlay strings at the end are difficult to handle, so don't try. */ - row = MATRIX_ROW (current_matrix, XFASTINT (WGET (w, window_end_vpos))); + row = MATRIX_ROW (current_matrix, XFASTINT (w->window_end_vpos)); if (MATRIX_ROW_START_CHARPOS (row) == MATRIX_ROW_END_CHARPOS (row)) GIVE_UP (20); @@ -17711,7 +17710,7 @@ /* Set last_row to the glyph row in the current matrix where the window end line is found. It has been moved up or down in the matrix by dvpos. */ - int last_vpos = XFASTINT (WGET (w, window_end_vpos)) + dvpos; + int last_vpos = XFASTINT (w->window_end_vpos) + dvpos; struct glyph_row *last_row = MATRIX_ROW (current_matrix, last_vpos); /* If last_row is the window end line, it should display text. */ @@ -17770,18 +17769,18 @@ WSET (w, window_end_pos, make_number (Z - MATRIX_ROW_END_CHARPOS (row))); w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); WSET (w, window_end_vpos, - make_number (MATRIX_ROW_VPOS (row, w->current_matrix))); + make_number (MATRIX_ROW_VPOS (row, w->current_matrix))); eassert (w->window_end_bytepos >= 0); IF_DEBUG (debug_method_add (w, "A")); } else if (last_text_row_at_end) { WSET (w, window_end_pos, - make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row_at_end))); + make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row_at_end))); w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row_at_end); WSET (w, window_end_vpos, - make_number (MATRIX_ROW_VPOS (last_text_row_at_end, desired_matrix))); + make_number (MATRIX_ROW_VPOS (last_text_row_at_end, desired_matrix))); eassert (w->window_end_bytepos >= 0); IF_DEBUG (debug_method_add (w, "B")); } @@ -17791,11 +17790,11 @@ end of the window, i.e. the last row with text is to be found in the desired matrix. */ WSET (w, window_end_pos, - make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row))); + make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row))); w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); WSET (w, window_end_vpos, - make_number (MATRIX_ROW_VPOS (last_text_row, desired_matrix))); + make_number (MATRIX_ROW_VPOS (last_text_row, desired_matrix))); eassert (w->window_end_bytepos >= 0); } else if (first_unchanged_at_end_row == NULL @@ -17805,7 +17804,7 @@ /* Displayed to end of window, but no line containing text was displayed. Lines were deleted at the end of the window. */ int first_vpos = WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0; - int vpos = XFASTINT (WGET (w, window_end_vpos)); + int vpos = XFASTINT (w->window_end_vpos); struct glyph_row *current_row = current_matrix->rows + vpos; struct glyph_row *desired_row = desired_matrix->rows + vpos; @@ -17832,8 +17831,8 @@ else abort (); - IF_DEBUG (debug_end_pos = XFASTINT (WGET (w, window_end_pos)); - debug_end_vpos = XFASTINT (WGET (w, window_end_vpos))); + IF_DEBUG (debug_end_pos = XFASTINT (w->window_end_pos); + debug_end_vpos = XFASTINT (w->window_end_vpos)); /* Record that display has not been completed. */ WSET (w, window_end_valid, Qnil); @@ -18066,7 +18065,7 @@ (Lisp_Object glyphs) { struct window *w = XWINDOW (selected_window); - struct buffer *buffer = XBUFFER (WGET (w, buffer)); + struct buffer *buffer = XBUFFER (w->buffer); fprintf (stderr, "PT = %"pI"d, BEGV = %"pI"d. ZV = %"pI"d\n", BUF_PT (buffer), BUF_BEGV (buffer), BUF_ZV (buffer)); @@ -18172,7 +18171,7 @@ get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string) { struct frame *f = XFRAME (WINDOW_FRAME (w)); - struct buffer *buffer = XBUFFER (WGET (w, buffer)); + struct buffer *buffer = XBUFFER (w->buffer); struct buffer *old = current_buffer; const unsigned char *arrow_string = SDATA (overlay_arrow_string); int arrow_len = SCHARS (overlay_arrow_string); @@ -19364,7 +19363,7 @@ row->glyphs[TEXT_AREA]->charpos = -1; row->displays_text_p = 0; - if (!NILP (BVAR (XBUFFER (WGET (it->w, buffer)), indicate_empty_lines)) + if (!NILP (BVAR (XBUFFER (it->w->buffer), indicate_empty_lines)) && (!MINI_WINDOW_P (it->w) || (minibuf_level && EQ (it->window, minibuf_window)))) row->indicate_empty_line_p = 1; @@ -20187,12 +20186,12 @@ { struct window *w = XWINDOW (window); - if (WINDOWP (WGET (w, hchild))) - nwindows += redisplay_mode_lines (WGET (w, hchild), force); - else if (WINDOWP (WGET (w, vchild))) - nwindows += redisplay_mode_lines (WGET (w, vchild), force); + if (WINDOWP (w->hchild)) + nwindows += redisplay_mode_lines (w->hchild, force); + else if (WINDOWP (w->vchild)) + nwindows += redisplay_mode_lines (w->vchild, force); else if (force - || FRAME_GARBAGED_P (XFRAME (WGET (w, frame))) + || FRAME_GARBAGED_P (XFRAME (w->frame)) || !MATRIX_MODE_LINE_ROW (w->current_matrix)->enabled_p) { struct text_pos lpoint; @@ -20200,7 +20199,7 @@ /* Set the window's buffer for the mode line display. */ SET_TEXT_POS (lpoint, PT, PT_BYTE); - set_buffer_internal_1 (XBUFFER (WGET (w, buffer))); + set_buffer_internal_1 (XBUFFER (w->buffer)); /* Point refers normally to the selected window. For any other window, set up appropriate value. */ @@ -20208,7 +20207,7 @@ { struct text_pos pt; - SET_TEXT_POS_FROM_MARKER (pt, WGET (w, pointm)); + SET_TEXT_POS_FROM_MARKER (pt, w->pointm); if (CHARPOS (pt) < BEGV) TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); else if (CHARPOS (pt) > (ZV - 1)) @@ -20230,7 +20229,7 @@ TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint)); } - window = WGET (w, next); + window = w->next; } return nwindows; @@ -20247,7 +20246,7 @@ int n = 0; old_selected_frame = selected_frame; - selected_frame = WGET (w, frame); + selected_frame = w->frame; old_selected_window = selected_window; XSETWINDOW (selected_window, w); @@ -20983,7 +20982,7 @@ w = XWINDOW (window); if (NILP (buffer)) - buffer = WGET (w, buffer); + buffer = w->buffer; CHECK_BUFFER (buffer); /* Make formatting the modeline a non-op when noninteractive, otherwise @@ -21442,16 +21441,16 @@ if (mode_line_target == MODE_LINE_TITLE) return ""; - startpos = XMARKER (WGET (w, start))->charpos; - startpos_byte = marker_byte_position (WGET (w, start)); + startpos = XMARKER (w->start)->charpos; + startpos_byte = marker_byte_position (w->start); height = WINDOW_TOTAL_LINES (w); /* If we decided that this buffer isn't suitable for line numbers, don't forget that too fast. */ - if (EQ (WGET (w, base_line_pos), WGET (w, buffer))) + if (EQ (w->base_line_pos, w->buffer)) goto no_value; /* But do forget it, if the window shows a different buffer now. */ - else if (BUFFERP (WGET (w, base_line_pos))) + else if (BUFFERP (w->base_line_pos)) WSET (w, base_line_pos, Qnil); /* If the buffer is very big, don't waste time. */ @@ -21463,12 +21462,12 @@ goto no_value; } - if (INTEGERP (WGET (w, base_line_number)) - && INTEGERP (WGET (w, base_line_pos)) - && XFASTINT (WGET (w, base_line_pos)) <= startpos) + if (INTEGERP (w->base_line_number) + && INTEGERP (w->base_line_pos) + && XFASTINT (w->base_line_pos) <= startpos) { - line = XFASTINT (WGET (w, base_line_number)); - linepos = XFASTINT (WGET (w, base_line_pos)); + line = XFASTINT (w->base_line_number); + linepos = XFASTINT (w->base_line_pos); linepos_byte = buf_charpos_to_bytepos (b, linepos); } else @@ -21518,7 +21517,7 @@ give up on line numbers for this window. */ if (position == limit_byte && limit == startpos - distance) { - WSET (w, base_line_pos, WGET (w, buffer)); + WSET (w, base_line_pos, w->buffer); WSET (w, base_line_number, Qnil); goto no_value; } @@ -21562,10 +21561,10 @@ case 'p': { - ptrdiff_t pos = marker_position (WGET (w, start)); + ptrdiff_t pos = marker_position (w->start); ptrdiff_t total = BUF_ZV (b) - BUF_BEGV (b); - if (XFASTINT (WGET (w, window_end_pos)) <= BUF_Z (b) - BUF_ZV (b)) + if (XFASTINT (w->window_end_pos) <= BUF_Z (b) - BUF_ZV (b)) { if (pos <= BUF_BEGV (b)) return "All"; @@ -21593,8 +21592,8 @@ /* Display percentage of size above the bottom of the screen. */ case 'P': { - ptrdiff_t toppos = marker_position (WGET (w, start)); - ptrdiff_t botpos = BUF_Z (b) - XFASTINT (WGET (w, window_end_pos)); + ptrdiff_t toppos = marker_position (w->start); + ptrdiff_t botpos = BUF_Z (b) - XFASTINT (w->window_end_pos); ptrdiff_t total = BUF_ZV (b) - BUF_BEGV (b); if (botpos >= BUF_ZV (b)) @@ -22301,7 +22300,7 @@ return OK_PIXELS (WINDOW_SCROLL_BAR_AREA_WIDTH (it->w)); } - prop = buffer_local_value_1 (prop, WGET (it->w, buffer)); + prop = buffer_local_value_1 (prop, it->w->buffer); if (EQ (prop, Qunbound)) prop = Qnil; } @@ -22353,7 +22352,7 @@ return OK_PIXELS (pixels); } - car = buffer_local_value_1 (car, WGET (it->w, buffer)); + car = buffer_local_value_1 (car, it->w->buffer); if (EQ (car, Qunbound)) car = Qnil; } @@ -22434,7 +22433,7 @@ { memset (s, 0, sizeof *s); s->w = w; - s->f = XFRAME (WGET (w, frame)); + s->f = XFRAME (w->frame); #ifdef HAVE_NTGUI s->hdc = hdc; #endif @@ -22766,7 +22765,7 @@ int voffset; int glyph_not_available_p; - eassert (s->f == XFRAME (WGET (s->w, frame))); + eassert (s->f == XFRAME (s->w->frame)); eassert (s->nchars == 0); eassert (start >= 0 && end > start); @@ -24161,7 +24160,7 @@ int n = width; if (!STRINGP (object)) - object = WGET (it->w, buffer); + object = it->w->buffer; #ifdef HAVE_WINDOW_SYSTEM if (FRAME_WINDOW_P (it->f)) append_stretch_glyph (it, object, width, height, ascent); @@ -25388,7 +25387,7 @@ int from_x, from_y, to_y; eassert (updated_window && updated_row); - f = XFRAME (WGET (w, frame)); + f = XFRAME (w->frame); if (updated_row->full_width_p) max_x = WINDOW_TOTAL_WIDTH (w); @@ -25546,8 +25545,8 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width, int *active_cursor) { - struct frame *f = XFRAME (WGET (w, frame)); - struct buffer *b = XBUFFER (WGET (w, buffer)); + struct frame *f = XFRAME (w->frame); + struct buffer *b = XBUFFER (w->buffer); int cursor_type = DEFAULT_CURSOR; Lisp_Object alt_cursor; int non_selected = 0; @@ -25858,7 +25857,7 @@ void erase_phys_cursor (struct window *w) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); int hpos = w->phys_cursor.hpos; int vpos = w->phys_cursor.vpos; @@ -25977,7 +25976,7 @@ display_and_set_cursor (struct window *w, int on, int hpos, int vpos, int x, int y) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); int new_cursor_type; int new_cursor_width; int active_cursor; @@ -26098,14 +26097,14 @@ { while (w) { - if (!NILP (WGET (w, hchild))) - update_cursor_in_window_tree (XWINDOW (WGET (w, hchild)), on_p); - else if (!NILP (WGET (w, vchild))) - update_cursor_in_window_tree (XWINDOW (WGET (w, vchild)), on_p); + if (!NILP (w->hchild)) + update_cursor_in_window_tree (XWINDOW (w->hchild), on_p); + else if (!NILP (w->vchild)) + update_cursor_in_window_tree (XWINDOW (w->vchild), on_p); else update_window_cursor (w, on_p); - w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); + w = NILP (w->next) ? 0 : XWINDOW (w->next); } } @@ -26129,7 +26128,7 @@ void x_clear_cursor (struct window *w) { - if (FRAME_VISIBLE_P (XFRAME (WGET (w, frame))) && w->phys_cursor_on_p) + if (FRAME_VISIBLE_P (XFRAME (w->frame)) && w->phys_cursor_on_p) update_window_cursor (w, 0); } @@ -26143,7 +26142,7 @@ enum draw_glyphs_face draw) { #ifdef HAVE_WINDOW_SYSTEM - if (FRAME_WINDOW_P (XFRAME (WGET (w, frame)))) + if (FRAME_WINDOW_P (XFRAME (w->frame))) { draw_glyphs (w, start_x, row, TEXT_AREA, start_hpos, end_hpos, draw, 0); return; @@ -26314,7 +26313,7 @@ static int coords_in_mouse_face_p (struct window *w, int hpos, int vpos) { - Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WGET (w, frame))); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); /* Quickly resolve the easy cases. */ if (!(WINDOWP (hlinfo->mouse_face_window) @@ -26566,7 +26565,7 @@ /* Find the rows corresponding to START_CHARPOS and END_CHARPOS. */ rows_from_pos_range (w, start_charpos, end_charpos, disp_string, &r1, &r2); if (r1 == NULL) - r1 = MATRIX_ROW (w->current_matrix, XFASTINT (WGET (w, window_end_vpos))); + r1 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); /* If the before-string or display-string contains newlines, rows_from_pos_range skips to its last row. Move back. */ if (!NILP (before_string) || !NILP (disp_string)) @@ -26588,7 +26587,7 @@ } if (r2 == NULL) { - r2 = MATRIX_ROW (w->current_matrix, XFASTINT (WGET (w, window_end_vpos))); + r2 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); hlinfo->mouse_face_past_end = 1; } else if (!NILP (after_string)) @@ -26596,7 +26595,7 @@ /* If the after-string has newlines, advance to its last row. */ struct glyph_row *next; struct glyph_row *last - = MATRIX_ROW (w->current_matrix, XFASTINT (WGET (w, window_end_vpos))); + = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); for (next = r2 + 1; next <= last @@ -27261,7 +27260,7 @@ enum window_part area) { struct window *w = XWINDOW (window); - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); #ifdef HAVE_WINDOW_SYSTEM Display_Info *dpyinfo; @@ -27345,7 +27344,7 @@ { help_echo_string = help; XSETWINDOW (help_echo_window, w); - help_echo_object = WGET (w, buffer); + help_echo_object = w->buffer; help_echo_pos = charpos; } } @@ -27381,7 +27380,7 @@ { Lisp_Object default_help = buffer_local_value_1 (Qmode_line_default_help_echo, - WGET (w, buffer)); + w->buffer); if (STRINGP (default_help)) { @@ -27662,9 +27661,9 @@ /* Are we in a window whose display is up to date? And verify the buffer's text has not changed. */ - b = XBUFFER (WGET (w, buffer)); + b = XBUFFER (w->buffer); if (part == ON_TEXT - && EQ (WGET (w, window_end_valid), WGET (w, buffer)) + && EQ (w->window_end_valid, w->buffer) && w->last_modified == BUF_MODIFF (b) && w->last_overlay_modified == BUF_OVERLAY_MODIFF (b)) { @@ -27871,8 +27870,8 @@ if (pos > 0) { mouse_face = get_char_property_and_overlay - (make_number (pos), Qmouse_face, WGET (w, buffer), &overlay); - buffer = WGET (w, buffer); + (make_number (pos), Qmouse_face, w->buffer, &overlay); + buffer = w->buffer; disp_string = object; } } @@ -27898,12 +27897,12 @@ is the smallest. */ Lisp_Object lim1 = NILP (BVAR (XBUFFER (buffer), bidi_display_reordering)) - ? Fmarker_position (WGET (w, start)) + ? Fmarker_position (w->start) : Qnil; Lisp_Object lim2 = NILP (BVAR (XBUFFER (buffer), bidi_display_reordering)) ? make_number (BUF_Z (XBUFFER (buffer)) - - XFASTINT (WGET (w, window_end_pos))) + - XFASTINT (w->window_end_pos)) : Qnil; if (NILP (overlay)) @@ -27985,11 +27984,11 @@ if (p > 0) { help = Fget_char_property (make_number (p), - Qhelp_echo, WGET (w, buffer)); + Qhelp_echo, w->buffer); if (!NILP (help)) { charpos = p; - obj = WGET (w, buffer); + obj = w->buffer; } } } @@ -28040,7 +28039,7 @@ ptrdiff_t p = string_buffer_position (obj, start); if (p > 0) pointer = Fget_char_property (make_number (p), - Qpointer, WGET (w, buffer)); + Qpointer, w->buffer); } } else if (BUFFERP (obj) @@ -28078,7 +28077,7 @@ void x_clear_window_mouse_face (struct window *w) { - Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WGET (w, frame))); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); Lisp_Object window; BLOCK_INPUT; @@ -28100,7 +28099,7 @@ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); window = hlinfo->mouse_face_window; - if (! NILP (window) && XFRAME (WGET (XWINDOW (window), frame)) == f) + if (! NILP (window) && XFRAME (XWINDOW (window)->frame) == f) { hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; @@ -28294,7 +28293,7 @@ do it for frames with vertical scroll bars because either the right scroll bar of a window, or the left scroll bar of its neighbor will suffice as a border. */ - if (FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (WGET (w, frame)))) + if (FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (w->frame))) return; if (!WINDOW_RIGHTMOST_P (w) @@ -28334,7 +28333,7 @@ static int expose_window (struct window *w, XRectangle *fr) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); XRectangle wr, r; int mouse_face_overwritten_p = 0; @@ -28475,21 +28474,21 @@ static int expose_window_tree (struct window *w, XRectangle *r) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); int mouse_face_overwritten_p = 0; while (w && !FRAME_GARBAGED_P (f)) { - if (!NILP (WGET (w, hchild))) - mouse_face_overwritten_p - |= expose_window_tree (XWINDOW (WGET (w, hchild)), r); - else if (!NILP (WGET (w, vchild))) - mouse_face_overwritten_p - |= expose_window_tree (XWINDOW (WGET (w, vchild)), r); + if (!NILP (w->hchild)) + mouse_face_overwritten_p + |= expose_window_tree (XWINDOW (w->hchild), r); + else if (!NILP (w->vchild)) + mouse_face_overwritten_p + |= expose_window_tree (XWINDOW (w->vchild), r); else mouse_face_overwritten_p |= expose_window (w, r); - w = NILP (WGET (w, next)) ? NULL : XWINDOW (WGET (w, next)); + w = NILP (w->next) ? NULL : XWINDOW (w->next); } return mouse_face_overwritten_p; @@ -29281,7 +29280,7 @@ if (!noninteractive) { struct window *m = XWINDOW (minibuf_window); - Lisp_Object frame = WGET (m, frame); + Lisp_Object frame = m->frame; struct frame *f = XFRAME (frame); Lisp_Object root = FRAME_ROOT_WINDOW (f); struct window *r = XWINDOW (root); === modified file 'src/xfaces.c' --- src/xfaces.c 2012-08-07 05:29:25 +0000 +++ src/xfaces.c 2012-08-07 07:33:18 +0000 @@ -6032,7 +6032,7 @@ ptrdiff_t *endptr, ptrdiff_t limit, int mouse, int base_face_id) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); Lisp_Object attrs[LFACE_VECTOR_SIZE]; Lisp_Object prop, position; ptrdiff_t i, noverlays; @@ -6054,9 +6054,9 @@ /* Get the `face' or `mouse_face' text property at POS, and determine the next position at which the property changes. */ - prop = Fget_text_property (position, propname, WGET (w, buffer)); + prop = Fget_text_property (position, propname, w->buffer); XSETFASTINT (limit1, (limit < endpos ? limit : endpos)); - end = Fnext_single_property_change (position, propname, WGET (w, buffer), limit1); + end = Fnext_single_property_change (position, propname, w->buffer, limit1); if (INTEGERP (end)) endpos = XINT (end); @@ -6142,7 +6142,7 @@ ptrdiff_t *endptr, ptrdiff_t limit, int mouse, Lisp_Object overlay) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); Lisp_Object attrs[LFACE_VECTOR_SIZE]; Lisp_Object prop, position; ptrdiff_t endpos; @@ -6162,9 +6162,9 @@ /* Get the `face' or `mouse_face' text property at POS, and determine the next position at which the property changes. */ - prop = Fget_text_property (position, propname, WGET (w, buffer)); + prop = Fget_text_property (position, propname, w->buffer); XSETFASTINT (limit1, (limit < endpos ? limit : endpos)); - end = Fnext_single_property_change (position, propname, WGET (w, buffer), limit1); + end = Fnext_single_property_change (position, propname, w->buffer, limit1); if (INTEGERP (end)) endpos = XINT (end); === modified file 'src/xfns.c' --- src/xfns.c 2012-08-07 05:29:25 +0000 +++ src/xfns.c 2012-08-07 07:33:18 +0000 @@ -2260,7 +2260,7 @@ void xic_set_preeditarea (struct window *w, int x, int y) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); XVaNestedList attr; XPoint spot; @@ -5085,13 +5085,13 @@ WSET (w, total_lines, make_number (40)); } - FRAME_TOTAL_COLS (f) = XINT (WGET (w, total_cols)); + FRAME_TOTAL_COLS (f) = XINT (w->total_cols); adjust_glyphs (f); w->pseudo_window_p = 1; /* Display the tooltip text in a temporary buffer. */ old_buffer = current_buffer; - set_buffer_internal_1 (XBUFFER (WGET (XWINDOW (FRAME_ROOT_WINDOW (f)), buffer))); + set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer)); BVAR (current_buffer, truncate_lines) = Qnil; clear_glyph_matrix (w->desired_matrix); clear_glyph_matrix (w->current_matrix); === modified file 'src/xmenu.c' --- src/xmenu.c 2012-08-07 05:29:25 +0000 +++ src/xmenu.c 2012-08-07 07:33:18 +0000 @@ -985,7 +985,7 @@ if (! menubar_widget) previous_menu_items_used = 0; - buffer = WGET (XWINDOW (FRAME_SELECTED_WINDOW (f)), buffer); + buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer; specbind (Qinhibit_quit, Qt); /* Don't let the debugger step into this code because it is not reentrant. */ === modified file 'src/xterm.c' --- src/xterm.c 2012-08-07 05:29:25 +0000 +++ src/xterm.c 2012-08-07 07:33:18 +0000 @@ -628,7 +628,7 @@ static void x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritten_p) { - Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WGET (w, frame))); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); if (!w->pseudo_window_p) { @@ -728,7 +728,7 @@ overhead is very small. */ if (windows_or_buffers_changed && desired_row->full_width_p - && (f = XFRAME (WGET (w, frame)), + && (f = XFRAME (w->frame), width = FRAME_INTERNAL_BORDER_WIDTH (f), width != 0) && (height = desired_row->visible_height, @@ -3295,7 +3295,7 @@ static void x_scroll_run (struct window *w, struct run *run) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); int x, y, width, height, from_y, to_y, bottom_y; /* Get frame-relative bounding box of the text display area of W, @@ -4244,9 +4244,9 @@ scroll_bar_end_scroll, 0, 0); w = XWINDOW (window_being_scrolled); - if (!NILP (XSCROLL_BAR (WGET (w, vertical_scroll_bar))->dragging)) + if (!NILP (XSCROLL_BAR (w->vertical_scroll_bar)->dragging)) { - XSCROLL_BAR (WGET (w, vertical_scroll_bar))->dragging = Qnil; + XSCROLL_BAR (w->vertical_scroll_bar)->dragging = Qnil; /* The thumb size is incorrect while dragging: fix it. */ set_vertical_scroll_bar (w); } @@ -4277,7 +4277,7 @@ XEvent event; XClientMessageEvent *ev = (XClientMessageEvent *) &event; struct window *w = XWINDOW (window); - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); ptrdiff_t i; BLOCK_INPUT; @@ -4353,7 +4353,7 @@ ievent->timestamp = CurrentTime; #else ievent->timestamp = - XtLastTimestampProcessed (FRAME_X_DISPLAY (XFRAME (WGET (w, frame)))); + XtLastTimestampProcessed (FRAME_X_DISPLAY (XFRAME (w->frame))); #endif ievent->part = ev->data.l[1]; ievent->code = ev->data.l[2]; @@ -4954,7 +4954,7 @@ static struct scroll_bar * x_scroll_bar_create (struct window *w, int top, int left, int width, int height) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); struct scroll_bar *bar = ALLOCATE_PSEUDOVECTOR (struct scroll_bar, x_window, PVEC_OTHER); Lisp_Object barobj; @@ -5196,7 +5196,7 @@ static void XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int position) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); Lisp_Object barobj; struct scroll_bar *bar; int top, height, left, sb_left, width, sb_width; @@ -5248,7 +5248,7 @@ #endif /* Does the scroll bar exist yet? */ - if (NILP (WGET (w, vertical_scroll_bar))) + if (NILP (w->vertical_scroll_bar)) { if (width > 0 && height > 0) { @@ -5271,7 +5271,7 @@ /* It may just need to be moved and resized. */ unsigned int mask = 0; - bar = XSCROLL_BAR (WGET (w, vertical_scroll_bar)); + bar = XSCROLL_BAR (w->vertical_scroll_bar); BLOCK_INPUT; @@ -5441,10 +5441,10 @@ Lisp_Object barobj; /* We can't redeem this window's scroll bar if it doesn't have one. */ - if (NILP (WGET (window, vertical_scroll_bar))) + if (NILP (window->vertical_scroll_bar)) abort (); - bar = XSCROLL_BAR (WGET (window, vertical_scroll_bar)); + bar = XSCROLL_BAR (window->vertical_scroll_bar); /* Unlink it from the condemned list. */ f = XFRAME (WINDOW_FRAME (window)); @@ -5452,11 +5452,11 @@ { /* If the prev pointer is nil, it must be the first in one of the lists. */ - if (EQ (FRAME_SCROLL_BARS (f), WGET (window, vertical_scroll_bar))) + if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar)) /* It's not condemned. Everything's fine. */ return; else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), - WGET (window, vertical_scroll_bar))) + window->vertical_scroll_bar)) FSET (f, condemned_scroll_bars, bar->next); else /* If its prev pointer is nil, it must be at the front of @@ -5616,7 +5616,7 @@ static void x_scroll_bar_note_movement (struct scroll_bar *bar, XEvent *event) { - FRAME_PTR f = XFRAME (WGET (XWINDOW (bar->window), frame)); + FRAME_PTR f = XFRAME (XWINDOW (bar->window)->frame); last_mouse_movement_time = event->xmotion.time; @@ -6790,8 +6790,8 @@ create event iff we don't leave the selected frame. */ && (focus_follows_mouse - || (EQ (WGET (XWINDOW (window), frame), - WGET (XWINDOW (selected_window), frame))))) + || (EQ (XWINDOW (window)->frame, + XWINDOW (selected_window)->frame)))) { inev.ie.kind = SELECT_WINDOW_EVENT; inev.ie.frame_or_window = window; @@ -7340,7 +7340,7 @@ static void x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text_cursor_kinds kind) { - struct frame *f = XFRAME (WGET (w, frame)); + struct frame *f = XFRAME (w->frame); struct glyph *cursor_glyph; /* If cursor is out of bounds, don't draw garbage. This can happen ------------------------------------------------------------ revno: 109488 fixes bug: http://debbugs.gnu.org/12025 committer: Chong Yidong branch nick: trunk timestamp: Tue 2012-08-07 15:02:04 +0800 message: Check for live frames explicitly in window.c functions which need it. * window.c (Fwindow_edges, Fwindow_pixel_edges) (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal) (Fdelete_window_internal): Signal an error if the window is not on a live frame. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-07 05:29:25 +0000 +++ src/ChangeLog 2012-08-07 07:02:04 +0000 @@ -1,3 +1,10 @@ +2012-08-07 Chong Yidong + + * window.c (Fwindow_edges, Fwindow_pixel_edges) + (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal) + (Fdelete_window_internal): Signal an error if the window is not on + a live frame (Bug#12025). + 2012-08-07 Dmitry Antipov Drop FGET and revert read access to Lisp_Objects slots of struct frame. === modified file 'src/window.c' --- src/window.c 2012-08-07 05:29:25 +0000 +++ src/window.c 2012-08-07 07:02:04 +0000 @@ -151,8 +151,6 @@ CHECK_WINDOW (window); w = XWINDOW (window); - /* The following test throws up every time a tooltip frame is displayed. */ - /* CHECK_LIVE_FRAME (w->frame); */ return w; } @@ -746,6 +744,7 @@ (Lisp_Object window) { register struct window *w = decode_any_window (window); + CHECK_LIVE_FRAME (WGET (w, frame)); return Fcons (make_number (WINDOW_LEFT_EDGE_COL (w)), Fcons (make_number (WINDOW_TOP_EDGE_LINE (w)), @@ -767,6 +766,7 @@ (Lisp_Object window) { register struct window *w = decode_any_window (window); + CHECK_LIVE_FRAME (WGET (w, frame)); return Fcons (make_number (WINDOW_LEFT_EDGE_X (w)), Fcons (make_number (WINDOW_TOP_EDGE_Y (w)), @@ -812,6 +812,8 @@ { register struct window *w = decode_any_window (window); int add_x, add_y; + + CHECK_LIVE_FRAME (WGET (w, frame)); calc_absolute_offset (w, &add_x, &add_y); return Fcons (make_number (WINDOW_LEFT_EDGE_X (w) + add_x), @@ -2580,6 +2582,7 @@ int top IF_LINT (= 0), new_top, resize_failed; w = decode_any_window (window); + CHECK_LIVE_FRAME (WGET (w, frame)); XSETWINDOW (window, w); f = XFRAME (WGET (w, frame)); @@ -2593,6 +2596,7 @@ /* ROOT must be an ancestor of WINDOW. */ { r = decode_any_window (root); + CHECK_LIVE_FRAME (WGET (r, frame)); pwindow = WGET (XWINDOW (window), parent); while (!NILP (pwindow)) if (EQ (pwindow, root)) @@ -3837,6 +3841,8 @@ int before_sibling = 0; w = decode_any_window (window); + CHECK_LIVE_FRAME (WGET (w, frame)); + XSETWINDOW (window, w); if (NILP (WGET (w, buffer)) && NILP (WGET (w, hchild)) && NILP (WGET (w, vchild))) ------------------------------------------------------------ revno: 109487 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-06 23:56:08 -0700 message: Grammar fixes diff: === modified file 'INSTALL' --- INSTALL 2012-08-07 04:16:47 +0000 +++ INSTALL 2012-08-07 06:56:08 +0000 @@ -319,17 +319,17 @@ Use --without-sound to disable sound support. -Use --disable-features if you want to build small executable with -the minimal dependencies from an external libraries, at the cost -of disabling most of the features which are enabled by default. -Using --disable-features is equivalent to --without-sound --without-dbus +Use --disable-features if you want to build a small executable with +the minimal dependencies on external libraries, at the cost +of disabling most of the features that are normally enabled by default. +Using --disable-features is equivalent to: --without-sound --without-dbus --without-libotf --without-selinux --without-xft --without-gsettings --without-gnutls --without-rsvg --without-xml2 --without-gconf --without-imagemagick --without-m17n-flt --without-jpeg --without-tiff --without-gif --without-png --without-gpm. Note that --disable-features -leaves X support enabled, and using GTK2 or GTK3 toolkit creates a lot -of library dependencies. So if you want to build small executable with -the very basic X support, use --disable-features --with-x-toolkit=no. +leaves X support enabled, and using the GTK2 or GTK3 toolkit creates a lot +of library dependencies. So if you want to build a small executable with +very basic X support, use --disable-features --with-x-toolkit=no. For the smallest possible executable without X, use --disable-features --without-x.