Now on revision 109487. ------------------------------------------------------------ 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. ------------------------------------------------------------ revno: 109486 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-08-07 09:29:25 +0400 message: Drop FGET and revert read access to Lisp_Objects slots of struct frame. * frame.h (FGET): Remove. (struct frame): Do not use INTERNAL_FIELD. * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c: * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m: * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h: * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-06 22:07:01 +0000 +++ src/ChangeLog 2012-08-07 05:29:25 +0000 @@ -1,3 +1,13 @@ +2012-08-07 Dmitry Antipov + + Drop FGET and revert read access to Lisp_Objects slots of struct frame. + * frame.h (FGET): Remove. + (struct frame): Do not use INTERNAL_FIELD. + * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c: + * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m: + * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h: + * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users. + 2012-08-06 Juanma Barranquero * w32.c: Silence compiler warnings. === modified file 'src/buffer.c' --- src/buffer.c 2012-08-06 10:24:26 +0000 +++ src/buffer.c 2012-08-07 05:29:25 +0000 @@ -193,9 +193,9 @@ Lisp_Object args[3]; CHECK_FRAME (frame); - framelist = Fcopy_sequence (FGET (XFRAME (frame), buffer_list)); + framelist = Fcopy_sequence (XFRAME (frame)->buffer_list); prevlist = Fnreverse (Fcopy_sequence - (FGET (XFRAME (frame), buried_buffer_list))); + (XFRAME (frame)->buried_buffer_list)); /* Remove from GENERAL any buffer that duplicates one in FRAMELIST or PREVLIST. */ @@ -1327,7 +1327,7 @@ pred = frame_buffer_predicate (frame); /* Consider buffers that have been seen in the frame first. */ - tail = FGET (XFRAME (frame), buffer_list); + tail = XFRAME (frame)->buffer_list; for (; CONSP (tail); tail = XCDR (tail)) { buf = XCAR (tail); @@ -1767,8 +1767,8 @@ Vinhibit_quit = tem; /* Update buffer list of selected frame. */ - FSET (f, buffer_list, Fcons (buffer, Fdelq (buffer, FGET (f, buffer_list)))); - FSET (f, buried_buffer_list, Fdelq (buffer, FGET (f, buried_buffer_list))); + FSET (f, buffer_list, Fcons (buffer, Fdelq (buffer, f->buffer_list))); + FSET (f, buried_buffer_list, Fdelq (buffer, f->buried_buffer_list)); /* Run buffer-list-update-hook. */ if (!NILP (Vrun_hooks)) @@ -1805,9 +1805,9 @@ Vinhibit_quit = tem; /* Update buffer lists of selected frame. */ - FSET (f, buffer_list, Fdelq (buffer, FGET (f, buffer_list))); + FSET (f, buffer_list, Fdelq (buffer, f->buffer_list)); FSET (f, buried_buffer_list, - Fcons (buffer, Fdelq (buffer, FGET (f, buried_buffer_list)))); + Fcons (buffer, Fdelq (buffer, f->buried_buffer_list))); /* Run buffer-list-update-hook. */ if (!NILP (Vrun_hooks)) === modified file 'src/data.c' --- src/data.c 2012-08-06 05:27:54 +0000 +++ src/data.c 2012-08-07 05:29:25 +0000 @@ -1006,8 +1006,7 @@ XSETSYMBOL (var, symbol); if (blv->frame_local) { - tem1 = assq_no_quit (var, FGET (XFRAME (selected_frame), - param_alist)); + tem1 = assq_no_quit (var, XFRAME (selected_frame)->param_alist); blv->where = selected_frame; } else @@ -1180,7 +1179,7 @@ XSETSYMBOL (symbol, sym); /* May have changed via aliasing. */ tem1 = Fassq (symbol, (blv->frame_local - ? FGET (XFRAME (where), param_alist) + ? XFRAME (where)->param_alist : BVAR (XBUFFER (where), local_var_alist))); blv->where = where; blv->found = 1; === modified file 'src/dispnew.c' --- src/dispnew.c 2012-08-06 20:22:22 +0000 +++ src/dispnew.c 2012-08-07 05:29:25 +0000 @@ -821,12 +821,12 @@ /* Clear the matrix of the menu bar window, if such a window exists. The menu bar window is currently used to display menus on X when no toolkit support is compiled in. */ - if (WINDOWP (FGET (f, menu_bar_window))) - clear_glyph_matrix (XWINDOW (FGET (f, menu_bar_window))->current_matrix); + if (WINDOWP (f->menu_bar_window)) + clear_glyph_matrix (XWINDOW (f->menu_bar_window)->current_matrix); /* Clear the matrix of the tool-bar window, if any. */ - if (WINDOWP (FGET (f, tool_bar_window))) - clear_glyph_matrix (XWINDOW (FGET (f, tool_bar_window))->current_matrix); + if (WINDOWP (f->tool_bar_window)) + clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix); /* Clear current window matrices. */ eassert (WINDOWP (FRAME_ROOT_WINDOW (f))); @@ -842,11 +842,11 @@ if (f->desired_matrix) clear_glyph_matrix (f->desired_matrix); - if (WINDOWP (FGET (f, menu_bar_window))) - clear_glyph_matrix (XWINDOW (FGET (f, menu_bar_window))->desired_matrix); + if (WINDOWP (f->menu_bar_window)) + clear_glyph_matrix (XWINDOW (f->menu_bar_window)->desired_matrix); - if (WINDOWP (FGET (f, tool_bar_window))) - clear_glyph_matrix (XWINDOW (FGET (f, tool_bar_window))->desired_matrix); + if (WINDOWP (f->tool_bar_window)) + clear_glyph_matrix (XWINDOW (f->tool_bar_window)->desired_matrix); /* Do it for window matrices. */ eassert (WINDOWP (FRAME_ROOT_WINDOW (f))); @@ -1881,7 +1881,7 @@ adjust_frame_glyphs_initially (void) { struct frame *sf = SELECTED_FRAME (); - struct window *root = XWINDOW (FGET (sf, root_window)); + struct window *root = XWINDOW (sf->root_window); struct window *mini = XWINDOW (WGET (root, next)); int frame_lines = FRAME_LINES (sf); int frame_cols = FRAME_COLS (sf); @@ -2164,17 +2164,17 @@ { /* Allocate a dummy window if not already done. */ struct window *w; - if (NILP (FGET (f, menu_bar_window))) + if (NILP (f->menu_bar_window)) { Lisp_Object frame; FSET (f, menu_bar_window, make_window ()); - w = XWINDOW (FGET (f, menu_bar_window)); + w = XWINDOW (f->menu_bar_window); XSETFRAME (frame, f); WSET (w, frame, frame); w->pseudo_window_p = 1; } else - w = XWINDOW (FGET (f, menu_bar_window)); + w = XWINDOW (f->menu_bar_window); /* Set window dimensions to frame dimensions and allocate or adjust glyph matrices of W. */ @@ -2192,17 +2192,17 @@ /* Allocate/ reallocate matrices of the tool bar window. If we don't have a tool bar window yet, make one. */ struct window *w; - if (NILP (FGET (f, tool_bar_window))) + if (NILP (f->tool_bar_window)) { Lisp_Object frame; FSET (f, tool_bar_window, make_window ()); - w = XWINDOW (FGET (f, tool_bar_window)); + w = XWINDOW (f->tool_bar_window); XSETFRAME (frame, f); WSET (w, frame, frame); w->pseudo_window_p = 1; } else - w = XWINDOW (FGET (f, tool_bar_window)); + w = XWINDOW (f->tool_bar_window); WSET (w, top_line, make_number (FRAME_MENU_BAR_LINES (f))); WSET (w, left_col, make_number (0)); @@ -2262,14 +2262,14 @@ f->glyphs_initialized_p = 0; /* Release window sub-matrices. */ - if (!NILP (FGET (f, root_window))) - free_window_matrices (XWINDOW (FGET (f, root_window))); + if (!NILP (f->root_window)) + free_window_matrices (XWINDOW (f->root_window)); /* Free the dummy window for menu bars without X toolkit and its glyph matrices. */ - if (!NILP (FGET (f, menu_bar_window))) + if (!NILP (f->menu_bar_window)) { - struct window *w = XWINDOW (FGET (f, menu_bar_window)); + struct window *w = XWINDOW (f->menu_bar_window); free_glyph_matrix (w->desired_matrix); free_glyph_matrix (w->current_matrix); w->desired_matrix = w->current_matrix = NULL; @@ -2277,9 +2277,9 @@ } /* Free the tool bar window and its glyph matrices. */ - if (!NILP (FGET (f, tool_bar_window))) + if (!NILP (f->tool_bar_window)) { - struct window *w = XWINDOW (FGET (f, tool_bar_window)); + struct window *w = XWINDOW (f->tool_bar_window); free_glyph_matrix (w->desired_matrix); free_glyph_matrix (w->current_matrix); w->desired_matrix = w->current_matrix = NULL; @@ -2706,7 +2706,7 @@ /* If we are called on frame matrices, perform analogous operations for window matrices. */ if (frame_matrix_frame) - mirror_make_current (XWINDOW (FGET (frame_matrix_frame, root_window)), row); + mirror_make_current (XWINDOW (frame_matrix_frame->root_window), row); } @@ -2804,7 +2804,7 @@ /* Do the same for window matrices, if MATRIX is a frame matrix. */ if (frame_matrix_frame) - mirror_line_dance (XWINDOW (FGET (frame_matrix_frame, root_window)), + mirror_line_dance (XWINDOW (frame_matrix_frame->root_window), unchanged_at_top, nlines, copy_from, retained_p); } @@ -3167,7 +3167,7 @@ { /* 1 means display has been paused because of pending input. */ int paused_p; - struct window *root_window = XWINDOW (FGET (f, root_window)); + struct window *root_window = XWINDOW (f->root_window); if (redisplay_dont_pause) force_p = 1; @@ -3202,13 +3202,13 @@ /* Update the menu bar on X frames that don't have toolkit support. */ - if (WINDOWP (FGET (f, menu_bar_window))) - update_window (XWINDOW (FGET (f, menu_bar_window)), 1); + if (WINDOWP (f->menu_bar_window)) + update_window (XWINDOW (f->menu_bar_window), 1); /* Update the tool-bar window, if present. */ - if (WINDOWP (FGET (f, tool_bar_window))) + if (WINDOWP (f->tool_bar_window)) { - struct window *w = XWINDOW (FGET (f, tool_bar_window)); + struct window *w = XWINDOW (f->tool_bar_window); /* Update tool-bar window. */ if (w->must_be_updated_p) @@ -3220,9 +3220,8 @@ /* Swap tool-bar strings. We swap because we want to reuse strings. */ - tem = FGET (f, current_tool_bar_string); - FSET (f, current_tool_bar_string, - FGET (f, desired_tool_bar_string)); + tem = f->current_tool_bar_string; + FSET (f, current_tool_bar_string, f->desired_tool_bar_string); FSET (f, desired_tool_bar_string, tem); } } @@ -5745,8 +5744,8 @@ if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f)) FrameCols (FRAME_TTY (f)) = newwidth; - if (WINDOWP (FGET (f, tool_bar_window))) - WSET (XWINDOW (FGET (f, tool_bar_window)), + if (WINDOWP (f->tool_bar_window)) + WSET (XWINDOW (f->tool_bar_window), total_cols, make_number (newwidth)); } @@ -6071,7 +6070,7 @@ goto changed; if (vecp == end) goto changed; - if (!EQ (*vecp++, FGET (XFRAME (frame), name))) + if (!EQ (*vecp++, XFRAME (frame)->name)) goto changed; } /* Check that the buffer info matches. */ @@ -6128,7 +6127,7 @@ FOR_EACH_FRAME (tail, frame) { *vecp++ = frame; - *vecp++ = FGET (XFRAME (frame), name); + *vecp++ = XFRAME (frame)->name; } for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) { === modified file 'src/dosfns.c' --- src/dosfns.c 2012-08-06 05:27:54 +0000 +++ src/dosfns.c 2012-08-07 05:29:25 +0000 @@ -468,7 +468,7 @@ x_set_title (struct frame *f, Lisp_Object name) { /* Don't change the title if it's already NAME. */ - if (EQ (name, FGET (f, title))) + if (EQ (name, f->title)) return; update_mode_lines = 1; @@ -476,7 +476,7 @@ FSET (f, title, name); if (NILP (name)) - name = FGET (f, name); + name = f->name; if (FRAME_MSDOS_P (f)) { === modified file 'src/eval.c' --- src/eval.c 2012-08-06 05:27:54 +0000 +++ src/eval.c 2012-08-07 05:29:25 +0000 @@ -3254,7 +3254,7 @@ local binding, but only if that binding still exists. */ else if (BUFFERP (where) ? !NILP (Flocal_variable_p (symbol, where)) - : !NILP (Fassq (symbol, FGET (XFRAME (where), param_alist)))) + : !NILP (Fassq (symbol, XFRAME (where)->param_alist))) set_internal (symbol, this_binding.old_value, where, 1); } /* If variable has a trivial value (no forwarding), we can === modified file 'src/fontset.c' --- src/fontset.c 2012-08-06 10:24:26 +0000 +++ src/fontset.c 2012-08-07 05:29:25 +0000 @@ -2118,7 +2118,7 @@ if (FRAME_LIVE_P (f)) ASET (vec, 1, Fcons (FONTSET_NAME (FONTSET_BASE (fontset)), - FGET (f, name))); + f->name)); else ASET (vec, 1, Fcons (FONTSET_NAME (FONTSET_BASE (fontset)), Qnil)); === modified file 'src/frame.c' --- src/frame.c 2012-08-06 10:24:26 +0000 +++ src/frame.c 2012-08-07 05:29:25 +0000 @@ -170,7 +170,7 @@ windows_or_buffers_changed++; FRAME_WINDOW_SIZES_CHANGED (f) = 1; FRAME_MENU_BAR_LINES (f) = nlines; - set_menu_bar_lines_1 (FGET (f, root_window), nlines - olines); + set_menu_bar_lines_1 (f->root_window, nlines - olines); adjust_glyphs (f); } } @@ -356,7 +356,7 @@ FSET (f, selected_window, root_window); /* Make sure this window seems more recently used than a newly-created, never-selected window. */ - XWINDOW (FGET (f, selected_window))->use_time = ++window_select_count; + XWINDOW (f->selected_window)->use_time = ++window_select_count; return f; } @@ -398,8 +398,8 @@ UNGCPRO; } - mini_window = FGET (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)), - minibuffer_window); + mini_window + = XFRAME (KVAR (kb, Vdefault_minibuffer_frame))->minibuffer_window; } FSET (f, minibuffer_window, mini_window); @@ -437,7 +437,7 @@ Avoid infinite looping on the window chain by marking next pointer as nil. */ - mini_window = FSET (f, minibuffer_window, FGET (f, root_window)); + mini_window = FSET (f, minibuffer_window, f->root_window); XWINDOW (mini_window)->mini = 1; WSET (XWINDOW (mini_window), next, Qnil); WSET (XWINDOW (mini_window), prev, Qnil); @@ -570,7 +570,7 @@ result = Fassq (parameter, supplied_parms); if (NILP (result)) - result = Fassq (parameter, FGET (XFRAME (selected_frame), param_alist)); + result = Fassq (parameter, XFRAME (selected_frame)->param_alist); if (NILP (result) && current_value != NULL) result = build_string (current_value); if (!NILP (result) && !STRINGP (result)) @@ -689,11 +689,11 @@ /* Make the frame face alist be frame-specific, so that each frame could change its face definitions independently. */ - FSET (f, face_alist, Fcopy_alist (FGET (sf, face_alist))); + FSET (f, face_alist, Fcopy_alist (sf->face_alist)); /* Simple Fcopy_alist isn't enough, because we need the contents of the vectors which are the CDRs of associations in face_alist to be copied as well. */ - for (tem = FGET (f, face_alist); CONSP (tem); tem = XCDR (tem)) + for (tem = f->face_alist; CONSP (tem); tem = XCDR (tem)) XSETCDR (XCAR (tem), Fcopy_sequence (XCDR (XCAR (tem)))); return frame; } @@ -797,7 +797,7 @@ if (! FRAME_MINIBUF_ONLY_P (XFRAME (selected_frame))) last_nonminibuf_frame = XFRAME (selected_frame); - Fselect_window (FGET (XFRAME (frame), selected_window), norecord); + Fselect_window (XFRAME (frame)->selected_window, norecord); /* We want to make sure that the next event generates a frame-switch event to the appropriate frame. This seems kludgy to me, but @@ -1238,11 +1238,11 @@ } /* Don't allow minibuf_window to remain on a deleted frame. */ - if (EQ (FGET (f, minibuffer_window), minibuf_window)) + if (EQ (f->minibuffer_window, minibuf_window)) { - Fset_window_buffer (FGET (sf, minibuffer_window), + Fset_window_buffer (sf->minibuffer_window, WGET (XWINDOW (minibuf_window), buffer), Qnil); - minibuf_window = FGET (sf, minibuffer_window); + minibuf_window = sf->minibuffer_window; /* If the dying minibuffer window was selected, select the new one. */ @@ -1251,8 +1251,8 @@ } /* Don't let echo_area_window to remain on a deleted frame. */ - if (EQ (FGET (f, minibuffer_window), echo_area_window)) - echo_area_window = FGET (sf, minibuffer_window); + if (EQ (f->minibuffer_window, echo_area_window)) + echo_area_window = sf->minibuffer_window; /* Clear any X selections for this frame. */ #ifdef HAVE_X_WINDOWS @@ -1273,7 +1273,7 @@ /* Mark all the windows that used to be on FRAME as deleted, and then remove the reference to them. */ - delete_all_child_windows (FGET (f, root_window)); + delete_all_child_windows (f->root_window); FSET (f, root_window, Qnil); Vframe_list = Fdelq (frame, Vframe_list); @@ -1656,7 +1656,7 @@ } #endif - make_frame_visible_1 (FGET (XFRAME (frame), root_window)); + make_frame_visible_1 (XFRAME (frame)->root_window); /* Make menu bar update for the Buffers and Frames menus. */ windows_or_buffers_changed++; @@ -1710,12 +1710,12 @@ error ("Attempt to make invisible the sole visible or iconified frame"); /* Don't allow minibuf_window to remain on a deleted frame. */ - if (EQ (FGET (XFRAME (frame), minibuffer_window), minibuf_window)) + if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window)) { struct frame *sf = XFRAME (selected_frame); - Fset_window_buffer (FGET (sf, minibuffer_window), + Fset_window_buffer (sf->minibuffer_window, WGET (XWINDOW (minibuf_window), buffer), Qnil); - minibuf_window = FGET (sf, minibuffer_window); + minibuf_window = sf->minibuffer_window; } /* I think this should be done with a hook. */ @@ -1748,12 +1748,12 @@ #endif /* Don't allow minibuf_window to remain on a deleted frame. */ - if (EQ (FGET (XFRAME (frame), minibuffer_window), minibuf_window)) + if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window)) { struct frame *sf = XFRAME (selected_frame); - Fset_window_buffer (FGET (sf, minibuffer_window), + Fset_window_buffer (sf->minibuffer_window, WGET (XWINDOW (minibuf_window), buffer), Qnil); - minibuf_window = FGET (sf, minibuffer_window); + minibuf_window = sf->minibuffer_window; } /* I think this should be done with a hook. */ @@ -1940,7 +1940,7 @@ { register Lisp_Object tem; - tem = Fassq (prop, FGET (frame, param_alist)); + tem = Fassq (prop, frame->param_alist); if (EQ (tem, Qnil)) return tem; return Fcdr (tem); @@ -1952,7 +1952,7 @@ Lisp_Object frame_buffer_predicate (Lisp_Object frame) { - return FGET (XFRAME (frame), buffer_predicate); + return XFRAME (frame)->buffer_predicate; } /* Return the buffer-list of the selected frame. */ @@ -1960,7 +1960,7 @@ static Lisp_Object frame_buffer_list (Lisp_Object frame) { - return FGET (XFRAME (frame), buffer_list); + return XFRAME (frame)->buffer_list; } /* Discard BUFFER from the buffer-list and buried-buffer-list of each frame. */ @@ -1973,9 +1973,9 @@ FOR_EACH_FRAME (tail, frame) { FSET (XFRAME (frame), buffer_list, - Fdelq (buffer, FGET (XFRAME (frame), buffer_list))); + Fdelq (buffer, XFRAME (frame)->buffer_list)); FSET (XFRAME (frame), buried_buffer_list, - Fdelq (buffer, FGET (XFRAME (frame), buried_buffer_list))); + Fdelq (buffer, XFRAME (frame)->buried_buffer_list)); } } @@ -2023,8 +2023,7 @@ /* Check for no change needed in this very common case before we do any consing. */ - if (frame_name_fnn_p (SSDATA (FGET (f, name)), - SBYTES (FGET (f, name)))) + if (frame_name_fnn_p (SSDATA (f->name), SBYTES (f->name))) return; name = make_formatted_string (namebuf, "F%"pMd, ++tty_frame_count); @@ -2034,7 +2033,7 @@ CHECK_STRING (name); /* Don't change the name if it's already NAME. */ - if (! NILP (Fstring_equal (name, FGET (f, name)))) + if (! NILP (Fstring_equal (name, f->name))) return; /* Don't allow the user to set the frame name to F, so it @@ -2104,9 +2103,9 @@ FRAME_TTY (f)->previous_frame = NULL; /* Update the frame parameter alist. */ - old_alist_elt = Fassq (prop, FGET (f, param_alist)); + old_alist_elt = Fassq (prop, f->param_alist); if (EQ (old_alist_elt, Qnil)) - FSET (f, param_alist, Fcons (Fcons (prop, val), FGET (f, param_alist))); + FSET (f, param_alist, Fcons (Fcons (prop, val), f->param_alist)); else Fsetcdr (old_alist_elt, val); @@ -2130,7 +2129,7 @@ error ("Surrogate minibuffer windows must be minibuffer windows"); if ((FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f)) - && !EQ (val, FGET (f, minibuffer_window))) + && !EQ (val, f->minibuffer_window)) error ("Can't change the surrogate minibuffer of a frame with its own minibuffer"); /* Install the chosen minibuffer window, with proper buffer. */ @@ -2159,7 +2158,7 @@ if (!FRAME_LIVE_P (f)) return Qnil; - alist = Fcopy_alist (FGET (f, param_alist)); + alist = Fcopy_alist (f->param_alist); GCPRO1 (alist); if (!FRAME_WINDOW_P (f)) @@ -2205,7 +2204,7 @@ : FRAME_W32_P (f) ? "w32term" :"tty")); } - store_in_alist (&alist, Qname, FGET (f, name)); + store_in_alist (&alist, Qname, f->name); height = (f->new_text_lines ? f->new_text_lines : FRAME_LINES (f)); store_in_alist (&alist, Qheight, make_number (height)); width = (f->new_text_cols ? f->new_text_cols : FRAME_COLS (f)); @@ -2218,7 +2217,7 @@ store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil)); store_in_alist (&alist, Qbuffer_list, frame_buffer_list (frame)); store_in_alist (&alist, Qburied_buffer_list, - FGET (XFRAME (frame), buried_buffer_list)); + XFRAME (frame)->buried_buffer_list); /* I think this should be done with a hook. */ #ifdef HAVE_WINDOW_SYSTEM @@ -2259,7 +2258,7 @@ { /* Avoid consing in frequent cases. */ if (EQ (parameter, Qname)) - value = FGET (f, name); + value = f->name; #ifdef HAVE_X_WINDOWS else if (EQ (parameter, Qdisplay) && FRAME_X_P (f)) value = XCAR (FRAME_X_DISPLAY_INFO (f)->name_list_element); @@ -2267,7 +2266,7 @@ else if (EQ (parameter, Qbackground_color) || EQ (parameter, Qforeground_color)) { - value = Fassq (parameter, FGET (f, param_alist)); + value = Fassq (parameter, f->param_alist); if (CONSP (value)) { value = XCDR (value); @@ -2305,7 +2304,7 @@ } else if (EQ (parameter, Qdisplay_type) || EQ (parameter, Qbackground_mode)) - value = Fcdr (Fassq (parameter, FGET (f, param_alist))); + value = Fcdr (Fassq (parameter, f->param_alist)); else /* FIXME: Avoid this code path at all (as well as code duplication) by sharing more code with Fframe_parameters. */ @@ -2891,14 +2890,14 @@ if (! TYPE_RANGED_INTEGERP (int, icon_left)) { icon_left_no_change = 1; - icon_left = Fcdr (Fassq (Qicon_left, FGET (f, param_alist))); + icon_left = Fcdr (Fassq (Qicon_left, f->param_alist)); if (NILP (icon_left)) XSETINT (icon_left, 0); } if (! TYPE_RANGED_INTEGERP (int, icon_top)) { icon_top_no_change = 1; - icon_top = Fcdr (Fassq (Qicon_top, FGET (f, param_alist))); + icon_top = Fcdr (Fassq (Qicon_top, f->param_alist)); if (NILP (icon_top)) XSETINT (icon_top, 0); } @@ -3058,7 +3057,7 @@ store_in_alist (alistptr, Qouter_window_id, make_formatted_string (buf, "%lu", w)); #endif - store_in_alist (alistptr, Qicon_name, FGET (f, icon_name)); + store_in_alist (alistptr, Qicon_name, f->icon_name); FRAME_SAMPLE_VISIBILITY (f); store_in_alist (alistptr, Qvisibility, (FRAME_VISIBLE_P (f) ? Qt @@ -3072,7 +3071,7 @@ XSETFASTINT (tem, FRAME_X_OUTPUT (f)->parent_desc); store_in_alist (alistptr, Qexplicit_name, (f->explicit_name ? Qt : Qnil)); store_in_alist (alistptr, Qparent_id, tem); - store_in_alist (alistptr, Qtool_bar_position, FGET (f, tool_bar_position)); + store_in_alist (alistptr, Qtool_bar_position, f->tool_bar_position); } @@ -3132,7 +3131,7 @@ signal_error ("Invalid screen-gamma", new_value); /* Apply the new gamma value to the frame background. */ - bgcolor = Fassq (Qbackground_color, FGET (f, param_alist)); + bgcolor = Fassq (Qbackground_color, f->param_alist); if (CONSP (bgcolor) && (bgcolor = XCDR (bgcolor), STRINGP (bgcolor))) { Lisp_Object parm_index = Fget (Qbackground_color, Qx_frame_parameter); @@ -3461,7 +3460,7 @@ { Lisp_Object tem; - tem = assq_no_quit (Qicon_type, FGET (f, param_alist)); + tem = assq_no_quit (Qicon_type, f->param_alist); if (CONSP (tem)) return XCDR (tem); else === modified file 'src/frame.h' --- src/frame.h 2012-08-06 10:24:26 +0000 +++ src/frame.h 2012-08-07 05:29:25 +0000 @@ -80,15 +80,9 @@ struct font_driver_list; -/* Most code should use these macros to access Lisp fields - in struct frame. FGET should not be used as lvalue. */ - -#define FGET(f, field) \ - (eassert (offsetof (struct frame, field ## _) \ - < offsetof (struct frame, face_cache)), \ - ((f)->INTERNAL_FIELD (field))) - -#define FSET(f, field, value) ((f)->INTERNAL_FIELD (field) = (value)) +/* Most code should use this macro to set Lisp field in struct frame. */ + +#define FSET(f, field, value) ((f)->field = (value)) struct frame { @@ -99,15 +93,15 @@ /* Name of this frame: a Lisp string. It is used for looking up resources, as well as for the title in some cases. */ - Lisp_Object INTERNAL_FIELD (name); + Lisp_Object name; /* The name to use for the icon, the last time it was refreshed. nil means not explicitly specified. */ - Lisp_Object INTERNAL_FIELD (icon_name); + Lisp_Object icon_name; /* This is the frame title specified explicitly, if any. Usually it is nil. */ - Lisp_Object INTERNAL_FIELD (title); + Lisp_Object title; /* The frame which should receive keystrokes that occur in this frame, or nil if they should go to the frame itself. This is @@ -120,29 +114,29 @@ to shift from one frame to the other, any redirections to the original frame are shifted to the newly selected frame; if focus_frame is nil, Fselect_frame will leave it alone. */ - Lisp_Object INTERNAL_FIELD (focus_frame); + Lisp_Object focus_frame; /* This frame's root window. Every frame has one. If the frame has only a minibuffer window, this is it. Otherwise, if the frame has a minibuffer window, this is its sibling. */ - Lisp_Object INTERNAL_FIELD (root_window); + Lisp_Object root_window; /* This frame's selected window. Each frame has its own window hierarchy and one of the windows in it is selected within the frame. The selected window of the selected frame is Emacs's selected window. */ - Lisp_Object INTERNAL_FIELD (selected_window); + Lisp_Object selected_window; /* This frame's minibuffer window. Most frames have their own minibuffer windows, but only the selected frame's minibuffer window can actually appear to exist. */ - Lisp_Object INTERNAL_FIELD (minibuffer_window); + Lisp_Object minibuffer_window; /* Parameter alist of this frame. These are the parameters specified when creating the frame or modified with modify-frame-parameters. */ - Lisp_Object INTERNAL_FIELD (param_alist); + Lisp_Object param_alist; /* List of scroll bars on this frame. Actually, we don't specify exactly what is stored here at all; the @@ -151,51 +145,51 @@ instead of in the `device' structure so that the garbage collector doesn't need to look inside the window-system-dependent structure. */ - Lisp_Object INTERNAL_FIELD (scroll_bars); - Lisp_Object INTERNAL_FIELD (condemned_scroll_bars); + Lisp_Object scroll_bars; + Lisp_Object condemned_scroll_bars; /* Vector describing the items to display in the menu bar. Each item has four elements in this vector. They are KEY, STRING, SUBMAP, and HPOS. (HPOS is not used in when the X toolkit is in use.) There are four additional elements of nil at the end, to terminate. */ - Lisp_Object INTERNAL_FIELD (menu_bar_items); + Lisp_Object menu_bar_items; /* Alist of elements (FACE-NAME . FACE-VECTOR-DATA). */ - Lisp_Object INTERNAL_FIELD (face_alist); + Lisp_Object face_alist; /* A vector that records the entire structure of this frame's menu bar. For the format of the data, see extensive comments in xmenu.c. Only the X toolkit version uses this. */ - Lisp_Object INTERNAL_FIELD (menu_bar_vector); + Lisp_Object menu_bar_vector; /* Predicate for selecting buffers for other-buffer. */ - Lisp_Object INTERNAL_FIELD (buffer_predicate); + Lisp_Object buffer_predicate; /* List of buffers viewed in this frame, for other-buffer. */ - Lisp_Object INTERNAL_FIELD (buffer_list); + Lisp_Object buffer_list; /* List of buffers that were viewed, then buried in this frame. The most recently buried buffer is first. For last-buffer. */ - Lisp_Object INTERNAL_FIELD (buried_buffer_list); + Lisp_Object buried_buffer_list; /* A dummy window used to display menu bars under X when no X toolkit support is available. */ - Lisp_Object INTERNAL_FIELD (menu_bar_window); + Lisp_Object menu_bar_window; /* A window used to display the tool-bar of a frame. */ - Lisp_Object INTERNAL_FIELD (tool_bar_window); + Lisp_Object tool_bar_window; /* Desired and current tool-bar items. */ - Lisp_Object INTERNAL_FIELD (tool_bar_items); + Lisp_Object tool_bar_items; /* Where tool bar is, can be left, right, top or bottom. The native tool bar only supports top. */ - Lisp_Object INTERNAL_FIELD (tool_bar_position); + Lisp_Object tool_bar_position; /* Desired and current contents displayed in tool_bar_window. */ - Lisp_Object INTERNAL_FIELD (desired_tool_bar_string); - Lisp_Object INTERNAL_FIELD (current_tool_bar_string); + Lisp_Object desired_tool_bar_string; + Lisp_Object current_tool_bar_string; /* Beyond here, there should be no more Lisp_Object components. */ @@ -646,13 +640,13 @@ #define FRAME_WINDOW_SIZES_CHANGED(f) (f)->window_sizes_changed /* The minibuffer window of frame F, if it has one; otherwise nil. */ -#define FRAME_MINIBUF_WINDOW(f) FGET (f, minibuffer_window) +#define FRAME_MINIBUF_WINDOW(f) f->minibuffer_window /* The root window of the window tree of frame F. */ -#define FRAME_ROOT_WINDOW(f) FGET (f, root_window) +#define FRAME_ROOT_WINDOW(f) f->root_window /* The currently selected window of the window tree of frame F. */ -#define FRAME_SELECTED_WINDOW(f) FGET (f, selected_window) +#define FRAME_SELECTED_WINDOW(f) f->selected_window #define FRAME_INSERT_COST(f) (f)->insert_line_cost #define FRAME_DELETE_COST(f) (f)->delete_line_cost @@ -660,7 +654,7 @@ #define FRAME_DELETEN_COST(f) (f)->delete_n_lines_cost #define FRAME_MESSAGE_BUF(f) (f)->message_buf #define FRAME_SCROLL_BOTTOM_VPOS(f) (f)->scroll_bottom_vpos -#define FRAME_FOCUS_FRAME(f) FGET (f, focus_frame) +#define FRAME_FOCUS_FRAME(f) f->focus_frame /* Nonzero if frame F supports scroll bars. If this is zero, then it is impossible to enable scroll bars @@ -761,10 +755,10 @@ /* Nonzero if frame F has scroll bars. */ -#define FRAME_SCROLL_BARS(f) (FGET (f, scroll_bars)) +#define FRAME_SCROLL_BARS(f) (f->scroll_bars) -#define FRAME_CONDEMNED_SCROLL_BARS(f) (FGET (f, condemned_scroll_bars)) -#define FRAME_MENU_BAR_ITEMS(f) (FGET (f, menu_bar_items)) +#define FRAME_CONDEMNED_SCROLL_BARS(f) (f->condemned_scroll_bars) +#define FRAME_MENU_BAR_ITEMS(f) (f->menu_bar_items) #define FRAME_COST_BAUD_RATE(f) ((f)->cost_calculation_baud_rate) #define FRAME_DESIRED_CURSOR(f) ((f)->desired_cursor) @@ -832,10 +826,10 @@ supported. An alternate definition of the macro would expand to something which executes the statement once. */ -#define FOR_EACH_FRAME(list_var, frame_var) \ - for ((list_var) = Vframe_list; \ - (CONSP (list_var) \ - && (frame_var = XCAR (list_var), 1)); \ +#define FOR_EACH_FRAME(list_var, frame_var) \ + for ((list_var) = Vframe_list; \ + (CONSP (list_var) \ + && (frame_var = XCAR (list_var), 1)); \ list_var = XCDR (list_var)) === modified file 'src/fringe.c' --- src/fringe.c 2012-08-06 10:24:26 +0000 +++ src/fringe.c 2012-08-07 05:29:25 +0000 @@ -1338,8 +1338,8 @@ int o_right = FRAME_RIGHT_FRINGE_WIDTH (f); int o_cols = FRAME_FRINGE_COLS (f); - Lisp_Object left_fringe = Fassq (Qleft_fringe, FGET (f, param_alist)); - Lisp_Object right_fringe = Fassq (Qright_fringe, FGET (f, param_alist)); + Lisp_Object left_fringe = Fassq (Qleft_fringe, f->param_alist); + Lisp_Object right_fringe = Fassq (Qright_fringe, f->param_alist); int left_fringe_width, right_fringe_width; if (!NILP (left_fringe)) === modified file 'src/gtkutil.c' --- src/gtkutil.c 2012-08-06 05:27:54 +0000 +++ src/gtkutil.c 2012-08-07 05:29:25 +0000 @@ -1148,10 +1148,10 @@ gtk_widget_set_name (wfixed, SSDATA (Vx_resource_name)); /* If this frame has a title or name, set it in the title bar. */ - if (! NILP (FGET (f, title))) - title = SSDATA (ENCODE_UTF_8 (FGET (f, title))); - else if (! NILP (FGET (f, name))) - title = SSDATA (ENCODE_UTF_8 (FGET (f, name))); + if (! NILP (f->title)) + title = SSDATA (ENCODE_UTF_8 (f->title)); + else if (! NILP (f->name)) + title = SSDATA (ENCODE_UTF_8 (f->name)); if (title) gtk_window_set_title (GTK_WINDOW (wtop), title); @@ -2061,7 +2061,7 @@ { cl_data = xmalloc (sizeof *cl_data); cl_data->f = f; - cl_data->menu_bar_vector = FGET (f, menu_bar_vector); + cl_data->menu_bar_vector = f->menu_bar_vector; cl_data->menu_bar_items_used = f->menu_bar_items_used; cl_data->highlight_cb = highlight_cb; cl_data->ref_count = 0; @@ -2093,7 +2093,7 @@ if (cl_data) { cl_data->f = f; - cl_data->menu_bar_vector = FGET (f, menu_bar_vector); + cl_data->menu_bar_vector = f->menu_bar_vector; cl_data->menu_bar_items_used = f->menu_bar_items_used; cl_data->highlight_cb = highlight_cb; } @@ -3810,12 +3810,12 @@ struct input_event event; EVENT_INIT (event); - if (! f || ! f->n_tool_bar_items || NILP (FGET (f, tool_bar_items))) + if (! f || ! f->n_tool_bar_items || NILP (f->tool_bar_items)) return; idx *= TOOL_BAR_ITEM_NSLOTS; - key = AREF (FGET (f, tool_bar_items), idx + TOOL_BAR_ITEM_KEY); + key = AREF (f->tool_bar_items, idx + TOOL_BAR_ITEM_KEY); XSETFRAME (frame, f); /* We generate two events here. The first one is to set the prefix @@ -4086,16 +4086,16 @@ FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); Lisp_Object help, frame; - if (! f || ! f->n_tool_bar_items || NILP (FGET (f, tool_bar_items))) + if (! f || ! f->n_tool_bar_items || NILP (f->tool_bar_items)) return FALSE; if (event->type == GDK_ENTER_NOTIFY) { idx *= TOOL_BAR_ITEM_NSLOTS; - help = AREF (FGET (f, tool_bar_items), idx + TOOL_BAR_ITEM_HELP); + help = AREF (f->tool_bar_items, idx + TOOL_BAR_ITEM_HELP); if (NILP (help)) - help = AREF (FGET (f, tool_bar_items), idx + TOOL_BAR_ITEM_CAPTION); + help = AREF (f->tool_bar_items, idx + TOOL_BAR_ITEM_CAPTION); } else help = Qnil; @@ -4223,7 +4223,7 @@ } -#define PROP(IDX) AREF (FGET (f, tool_bar_items), i * TOOL_BAR_ITEM_NSLOTS + (IDX)) +#define PROP(IDX) AREF (f->tool_bar_items, i * TOOL_BAR_ITEM_NSLOTS + (IDX)) /* Find the right-to-left image named by RTL in the tool bar images for F. Returns IMAGE if RTL is not found. */ @@ -4706,7 +4706,7 @@ if (f->n_tool_bar_items != 0) { if (pack_tool_bar) - xg_pack_tool_bar (f, FGET (f, tool_bar_position)); + xg_pack_tool_bar (f, f->tool_bar_position); gtk_widget_show_all (GTK_WIDGET (x->handlebox_widget)); if (xg_update_tool_bar_sizes (f)) xg_height_or_width_changed (f); === modified file 'src/minibuf.c' --- src/minibuf.c 2012-08-06 10:24:26 +0000 +++ src/minibuf.c 2012-08-07 05:29:25 +0000 @@ -102,14 +102,14 @@ { if (FRAMEP (selected_frame) && FRAME_LIVE_P (XFRAME (selected_frame)) - && !EQ (minibuf_window, FGET (XFRAME (selected_frame), minibuffer_window))) + && !EQ (minibuf_window, XFRAME (selected_frame)->minibuffer_window)) { struct frame *sf = XFRAME (selected_frame); Lisp_Object buffer; /* I don't think that any frames may validly have a null minibuffer window anymore. */ - if (NILP (FGET (sf, minibuffer_window))) + if (NILP (sf->minibuffer_window)) abort (); /* Under X, we come here with minibuf_window being the @@ -117,8 +117,8 @@ init_window_once. That window doesn't have a buffer. */ buffer = WGET (XWINDOW (minibuf_window), buffer); if (BUFFERP (buffer)) - Fset_window_buffer (FGET (sf, minibuffer_window), buffer, Qnil); - minibuf_window = FGET (sf, minibuffer_window); + Fset_window_buffer (sf->minibuffer_window, buffer, Qnil); + minibuf_window = sf->minibuffer_window; } /* Make sure no other frame has a minibuffer as its selected window, === modified file 'src/msdos.c' --- src/msdos.c 2012-08-06 10:24:26 +0000 +++ src/msdos.c 2012-08-07 05:29:25 +0000 @@ -1318,8 +1318,8 @@ frame parameters. For the selected window, we use either its buffer-local value or the value from the frame parameters if the buffer doesn't define its local value for the cursor type. */ - sw = XWINDOW (FGET (f, selected_window)); - frame_desired_cursor = Fcdr (Fassq (Qcursor_type, FGET (f, param_alist))); + sw = XWINDOW (f->selected_window); + frame_desired_cursor = Fcdr (Fassq (Qcursor_type, f->param_alist)); if (cursor_in_echo_area && FRAME_HAS_MINIBUF_P (f) && EQ (FRAME_MINIBUF_WINDOW (f), echo_area_window) @@ -1598,7 +1598,7 @@ Lisp_Object *values = (Lisp_Object *) alloca (length * word_size); /* Do we have to reverse the foreground and background colors? */ - int reverse = EQ (Fcdr (Fassq (Qreverse, FGET (f, param_alist))), Qt); + int reverse = EQ (Fcdr (Fassq (Qreverse, f->param_alist)), Qt); int redraw = 0, fg_set = 0, bg_set = 0; unsigned long orig_fg, orig_bg; struct tty_display_info *tty = FRAME_TTY (f); === modified file 'src/nsfns.m' --- src/nsfns.m 2012-08-06 10:24:26 +0000 +++ src/nsfns.m 2012-08-07 05:29:25 +0000 @@ -452,12 +452,12 @@ if (NILP (arg)) { - if (!NILP (FGET (f, title))) - arg = FGET (f, title); + if (!NILP (f->title)) + arg = f->title; else /* explicit name and no icon-name -> explicit_name */ if (f->explicit_name) - arg = FGET (f, name); + arg = f->name; else { /* no explicit name and no icon-name -> @@ -496,10 +496,10 @@ if (! [[[view window] title] isEqualToString: str]) [[view window] setTitle: str]; - if (!STRINGP (FGET (f, icon_name))) + if (!STRINGP (f->icon_name)) encoded_icon_name = encoded_name; else - encoded_icon_name = ENCODE_UTF_8 (FGET (f, icon_name)); + encoded_icon_name = ENCODE_UTF_8 (f->icon_name); str = [NSString stringWithUTF8String: SSDATA (encoded_icon_name)]; @@ -537,14 +537,14 @@ CHECK_STRING (name); /* Don't change the name if it's already NAME. */ - if (! NILP (Fstring_equal (name, FGET (f, name)))) + if (! NILP (Fstring_equal (name, f->name))) return; FSET (f, name, name); /* title overrides explicit name */ - if (! NILP (FGET (f, title))) - name = FGET (f, title); + if (! NILP (f->title)) + name = f->title; ns_set_name_internal (f, name); } @@ -586,7 +586,7 @@ { NSTRACE (x_set_title); /* Don't change the title if it's already NAME. */ - if (EQ (name, FGET (f, title))) + if (EQ (name, f->title)) return; update_mode_lines = 1; @@ -594,7 +594,7 @@ FSET (f, title, name); if (NILP (name)) - name = FGET (f, name); + name = f->name; else CHECK_STRING (name); @@ -607,7 +607,7 @@ { NSView *view; Lisp_Object name, filename; - Lisp_Object buf = WGET (XWINDOW (FGET (f, selected_window)), buffer); + Lisp_Object buf = WGET (XWINDOW (f->selected_window), buffer); const char *title; NSAutoreleasePool *pool; struct gcpro gcpro1; @@ -615,7 +615,7 @@ NSString *str; NSTRACE (ns_set_name_as_filename); - if (f->explicit_name || ! NILP (FGET (f, title)) || ns_in_resize) + if (f->explicit_name || ! NILP (f->title) || ns_in_resize) return; BLOCK_INPUT; @@ -690,7 +690,7 @@ { NSView *view = FRAME_NS_VIEW (f); NSAutoreleasePool *pool; - if (!MINI_WINDOW_P (XWINDOW (FGET (f, selected_window)))) + if (!MINI_WINDOW_P (XWINDOW (f->selected_window))) { BLOCK_INPUT; pool = [[NSAutoreleasePool alloc] init]; @@ -777,7 +777,7 @@ BLOCK_INPUT; pool = [[NSAutoreleasePool alloc] init]; if (f->output_data.ns->miniimage - && [[NSString stringWithUTF8String: SSDATA (FGET (f, name))] + && [[NSString stringWithUTF8String: SSDATA (f->name)] isEqualToString: [(NSImage *)f->output_data.ns->miniimage name]]) { [pool release]; @@ -785,7 +785,7 @@ return; } - tem = assq_no_quit (Qicon_type, FGET (f, param_alist)); + tem = assq_no_quit (Qicon_type, f->param_alist); if (CONSP (tem) && ! NILP (XCDR (tem))) { [pool release]; @@ -799,17 +799,17 @@ { elt = XCAR (chain); /* special case: 't' means go by file type */ - if (SYMBOLP (elt) && EQ (elt, Qt) && SSDATA (FGET (f, name))[0] == '/') + if (SYMBOLP (elt) && EQ (elt, Qt) && SSDATA (f->name)[0] == '/') { NSString *str - = [NSString stringWithUTF8String: SSDATA (FGET (f, name))]; + = [NSString stringWithUTF8String: SSDATA (f->name)]; if ([[NSFileManager defaultManager] fileExistsAtPath: str]) image = [[[NSWorkspace sharedWorkspace] iconForFile: str] retain]; } else if (CONSP (elt) && STRINGP (XCAR (elt)) && STRINGP (XCDR (elt)) && - fast_string_match (XCAR (elt), FGET (f, name)) >= 0) + fast_string_match (XCAR (elt), f->name) >= 0) { image = [EmacsImage allocInitFromFile: XCDR (elt)]; if (image == nil) @@ -1208,7 +1208,7 @@ FSET (f, icon_name, x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title", RES_TYPE_STRING)); - if (! STRINGP (FGET (f, icon_name))) + if (! STRINGP (f->icon_name)) FSET (f, icon_name, Qnil); FRAME_NS_DISPLAY_INFO (f) = dpyinfo; @@ -1398,7 +1398,7 @@ by x_get_arg and friends, now go in the misc. alist of the frame. */ for (tem = parms; CONSP (tem); tem = XCDR (tem)) if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) - FSET (f, param_alist, Fcons (XCAR (tem), FGET (f, param_alist))); + FSET (f, param_alist, Fcons (XCAR (tem), f->param_alist)); UNGCPRO; === modified file 'src/nsmenu.m' --- src/nsmenu.m 2012-08-06 12:54:54 +0000 +++ src/nsmenu.m 2012-08-07 05:29:25 +0000 @@ -222,13 +222,13 @@ /* Save the frame's previous menu bar contents data */ if (previous_menu_items_used) - memcpy (previous_items, aref_addr (FGET (f, menu_bar_vector), 0), + memcpy (previous_items, aref_addr (f->menu_bar_vector, 0), previous_menu_items_used * sizeof (Lisp_Object)); /* parse stage 1: extract from lisp */ save_menu_items (); - menu_items = FGET (f, menu_bar_vector); + menu_items = f->menu_bar_vector; menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0; submenu_start = alloca (ASIZE (items) * sizeof *submenu_start); submenu_end = alloca (ASIZE (items) * sizeof *submenu_end); @@ -1040,7 +1040,7 @@ /* update EmacsToolbar as in GtkUtils, build items list */ for (i = 0; i < f->n_tool_bar_items; ++i) { -#define TOOLPROP(IDX) AREF (FGET (f, tool_bar_items), \ +#define TOOLPROP(IDX) AREF (f->tool_bar_items, \ i * TOOL_BAR_ITEM_NSLOTS + (IDX)) BOOL enabled_p = !NILP (TOOLPROP (TOOL_BAR_ITEM_ENABLED_P)); === modified file 'src/nsterm.m' --- src/nsterm.m 2012-08-06 12:54:54 +0000 +++ src/nsterm.m 2012-08-07 05:29:25 +0000 @@ -1304,7 +1304,7 @@ FRAME_PIXEL_HEIGHT (f) = pixelheight; /* SET_FRAME_GARBAGED (f); // this short-circuits expose call in drawRect */ - mark_window_cursors_off (XWINDOW (FGET (f, root_window))); + mark_window_cursors_off (XWINDOW (f->root_window)); cancel_mouse_face (f); UNBLOCK_INPUT; @@ -2123,8 +2123,8 @@ int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y)); /* Internal border is drawn below the tool bar. */ - if (WINDOWP (FGET (f, tool_bar_window)) - && w == XWINDOW (FGET (f, tool_bar_window))) + if (WINDOWP (f->tool_bar_window) + && w == XWINDOW (f->tool_bar_window)) y -= width; /* end copy from other terms */ @@ -5540,7 +5540,7 @@ if (ns_drag_types) [self registerForDraggedTypes: ns_drag_types]; - tem = FGET (f, name); + tem = f->name; name = [NSString stringWithUTF8String: NILP (tem) ? "Emacs" : SSDATA (tem)]; [win setTitle: name]; @@ -5558,7 +5558,7 @@ #endif FRAME_TOOLBAR_HEIGHT (f) = 0; - tem = FGET (f, icon_name); + tem = f->icon_name; if (!NILP (tem)) [win setMiniwindowTitle: [NSString stringWithUTF8String: SSDATA (tem)]]; @@ -5739,7 +5739,7 @@ { NSInteger tag = [sender tag]; find_and_call_menu_selection (emacsframe, emacsframe->menu_bar_items_used, - FGET (emacsframe, menu_bar_vector), + emacsframe->menu_bar_vector, (void *)tag); } @@ -5773,7 +5773,7 @@ emacs_event->kind = TOOL_BAR_EVENT; /* XSETINT (emacs_event->code, 0); */ - emacs_event->arg = AREF (FGET (emacsframe, tool_bar_items), + emacs_event->arg = AREF (emacsframe->tool_bar_items, idx + TOOL_BAR_ITEM_KEY); emacs_event->modifiers = EV_MODIFIERS (theEvent); EV_TRAILER (theEvent); @@ -6062,7 +6062,7 @@ Lisp_Object str = Qnil; struct frame *f = SELECTED_FRAME (); struct buffer *curbuf - = XBUFFER (WGET (XWINDOW (FGET (f, selected_window)), buffer)); + = XBUFFER (WGET (XWINDOW (f->selected_window), buffer)); if ([attribute isEqualToString:NSAccessibilityRoleAttribute]) return NSAccessibilityTextFieldRole; === modified file 'src/print.c' --- src/print.c 2012-08-06 11:16:07 +0000 +++ src/print.c 2012-08-07 05:29:25 +0000 @@ -1896,7 +1896,7 @@ else if (FRAMEP (obj)) { int len; - Lisp_Object frame_name = FGET (XFRAME (obj), name); + Lisp_Object frame_name = XFRAME (obj)->name; strout ((FRAME_LIVE_P (XFRAME (obj)) ? "#param_alist); val = CONSP (tem) ? XCDR (tem) : Qnil; if (INTEGERP (val)) === modified file 'src/w32fns.c' --- src/w32fns.c 2012-08-06 10:24:26 +0000 +++ src/w32fns.c 2012-08-07 05:29:25 +0000 @@ -1498,11 +1498,11 @@ BLOCK_INPUT; result = x_text_icon (f, - SSDATA ((!NILP (FGET (f, icon_name)) - ? FGET (f, icon_name) - : !NILP (FGET (f, title)) - ? FGET (f, title) - : FGET (f, name)))); + SSDATA ((!NILP (f->icon_name) + ? f->icon_name + : !NILP (f->title) + ? f->title + : f->name))); if (result) { @@ -1631,8 +1631,8 @@ } UNBLOCK_INPUT; - if (WINDOWP (FGET (f, tool_bar_window))) - clear_glyph_matrix (XWINDOW (FGET (f, tool_bar_window))->current_matrix); + if (WINDOWP (f->tool_bar_window)) + clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix); } run_window_configuration_change_hook (f); @@ -1674,7 +1674,7 @@ /* Check for no change needed in this very common case before we do any consing. */ if (!strcmp (FRAME_W32_DISPLAY_INFO (f)->w32_id_name, - SDATA (FGET (f, name)))) + SDATA (f->name))) return; name = build_string (FRAME_W32_DISPLAY_INFO (f)->w32_id_name); } @@ -1682,15 +1682,15 @@ CHECK_STRING (name); /* Don't change the name if it's already NAME. */ - if (! NILP (Fstring_equal (name, FGET (f, name)))) + if (! NILP (Fstring_equal (name, f->name))) return; FSET (f, name, name); /* For setting the frame title, the title parameter should override the name parameter. */ - if (! NILP (FGET (f, title))) - name = FGET (f, title); + if (! NILP (f->title)) + name = f->title; if (FRAME_W32_WINDOW (f)) { @@ -1728,7 +1728,7 @@ x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name) { /* Don't change the title if it's already NAME. */ - if (EQ (name, FGET (f, title))) + if (EQ (name, f->title)) return; update_mode_lines = 1; @@ -1736,7 +1736,7 @@ FSET (f, title, name); if (NILP (name)) - name = FGET (f, name); + name = f->name; if (FRAME_W32_WINDOW (f)) { @@ -3896,7 +3896,7 @@ int explicit = f->explicit_name; f->explicit_name = 0; - name = FGET (f, name); + name = f->name; FSET (f, name, Qnil); x_set_name (f, name, explicit); } @@ -3944,9 +3944,9 @@ ? IconicState : NormalState)); - x_text_icon (f, SSDATA ((!NILP (FGET (f, icon_name)) - ? FGET (f, icon_name) - : FGET (f, name)))); + x_text_icon (f, SSDATA ((!NILP (f->icon_name) + ? f->icon_name + : f->name))); #endif UNBLOCK_INPUT; @@ -4149,7 +4149,7 @@ FSET (f, icon_name, x_get_arg (dpyinfo, parameters, Qicon_name, "iconName", "Title", RES_TYPE_STRING)); - if (! STRINGP (FGET (f, icon_name))) + if (! STRINGP (f->icon_name)) FSET (f, icon_name, Qnil); /* FRAME_W32_DISPLAY_INFO (f) = dpyinfo; */ @@ -4359,7 +4359,7 @@ by x_get_arg and friends, now go in the misc. alist of the frame. */ for (tem = parameters; CONSP (tem); tem = XCDR (tem)) if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) - FSET (f, param_alist, Fcons (XCAR (tem), FGET (f, param_alist))); + FSET (f, param_alist, Fcons (XCAR (tem), f->param_alist)); UNGCPRO; === modified file 'src/w32menu.c' --- src/w32menu.c 2012-08-06 16:36:47 +0000 +++ src/w32menu.c 2012-08-07 05:29:25 +0000 @@ -277,7 +277,7 @@ return; entry = Qnil; subprefix_stack = (Lisp_Object *) alloca (f->menu_bar_items_used * word_size); - vector = FGET (f, menu_bar_vector); + vector = f->menu_bar_vector; prefix = Qnil; i = 0; while (i < f->menu_bar_items_used) @@ -419,14 +419,14 @@ /* Save the frame's previous menu bar contents data. */ if (previous_menu_items_used) - memcpy (previous_items, XVECTOR (FGET (f, menu_bar_vector))->contents, + memcpy (previous_items, XVECTOR (f->menu_bar_vector)->contents, previous_menu_items_used * word_size); /* Fill in menu_items with the current menu bar contents. This can evaluate Lisp code. */ save_menu_items (); - menu_items = FGET (f, menu_bar_vector); + menu_items = f->menu_bar_vector; menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0; submenu_start = (int *) alloca (ASIZE (items) * sizeof (int)); submenu_end = (int *) alloca (ASIZE (items) * sizeof (int)); === modified file 'src/w32term.c' --- src/w32term.c 2012-08-06 15:45:27 +0000 +++ src/w32term.c 2012-08-07 05:29:25 +0000 @@ -4194,7 +4194,7 @@ /* We may get paint messages even though the client area is clipped - these are not expose events. */ DebPrint (("clipped frame %p (%s) got WM_PAINT - ignored\n", f, - SDATA (FGET (f, name)))); + SDATA (f->name))); } else if (f->async_visible != 1) { @@ -4203,7 +4203,7 @@ f->async_iconified = 0; SET_FRAME_GARBAGED (f); DebPrint (("frame %p (%s) reexposed by WM_PAINT\n", f, - SDATA (FGET (f, name)))); + SDATA (f->name))); /* WM_PAINT serves as MapNotify as well, so report visibility changes properly. */ @@ -4259,7 +4259,7 @@ if (f && !f->iconified) { if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) - && !EQ (FGET (f, tool_bar_window), hlinfo->mouse_face_window)) + && !EQ (f->tool_bar_window, hlinfo->mouse_face_window)) { clear_mouse_face (hlinfo); hlinfo->mouse_face_hidden = 1; @@ -4284,7 +4284,7 @@ if (f && !f->iconified) { if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) - && !EQ (FGET (f, tool_bar_window), hlinfo->mouse_face_window)) + && !EQ (f->tool_bar_window, hlinfo->mouse_face_window)) { clear_mouse_face (hlinfo); hlinfo->mouse_face_hidden = 1; @@ -4362,7 +4362,7 @@ if (f && !f->iconified) { if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) - && !EQ (FGET (f, tool_bar_window), hlinfo->mouse_face_window)) + && !EQ (f->tool_bar_window, hlinfo->mouse_face_window)) { clear_mouse_face (hlinfo); hlinfo->mouse_face_hidden = 1; @@ -4486,8 +4486,8 @@ construct_mouse_click (&inev, &msg, f); /* Is this in the tool-bar? */ - if (WINDOWP (FGET (f, tool_bar_window)) - && WINDOW_TOTAL_LINES (XWINDOW (FGET (f, tool_bar_window)))) + if (WINDOWP (f->tool_bar_window) + && WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window))) { Lisp_Object window; int x = XFASTINT (inev.x); @@ -4495,7 +4495,7 @@ window = window_from_coordinates (f, x, y, 0, 1); - if (EQ (window, FGET (f, tool_bar_window))) + if (EQ (window, f->tool_bar_window)) { w32_handle_tool_bar_click (f, &inev); tool_bar_p = 1; @@ -4940,7 +4940,7 @@ if (!FRAME_OBSCURED_P (f)) { DebPrint (("frame %p (%s) obscured\n", f, - SDATA (FGET (f, name)))); + SDATA (f->name))); } } else @@ -4952,7 +4952,7 @@ { SET_FRAME_GARBAGED (f); DebPrint (("obscured frame %p (%s) found to be visible\n", f, - SDATA (FGET (f, name)))); + SDATA (f->name))); /* Force a redisplay sooner or later. */ record_asynch_buffer_change (); @@ -5600,7 +5600,7 @@ SET_FRAME_GARBAGED (f); /* If cursor was outside the new size, mark it as off. */ - mark_window_cursors_off (XWINDOW (FGET (f, root_window))); + mark_window_cursors_off (XWINDOW (f->root_window)); /* Clear out any recollection of where the mouse highlighting was, since it might be in a place that's outside the new frame size. === modified file 'src/window.c' --- src/window.c 2012-08-06 10:24:26 +0000 +++ src/window.c 2012-08-07 05:29:25 +0000 @@ -191,13 +191,13 @@ Lisp_Object window; if (NILP (frame_or_window)) - window = FGET (SELECTED_FRAME (), root_window); + window = SELECTED_FRAME ()->root_window; else if (WINDOWP (frame_or_window)) - window = FGET (XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window))), root_window); + window = XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window)))->root_window; else { CHECK_LIVE_FRAME (frame_or_window); - window = FGET (XFRAME (frame_or_window), root_window); + window = XFRAME (frame_or_window)->root_window; } return window; @@ -235,13 +235,13 @@ Lisp_Object window; if (NILP (frame_or_window)) - window = FGET (SELECTED_FRAME (), root_window); + window = SELECTED_FRAME ()->root_window; else if (WINDOWP (frame_or_window)) - window = FGET (XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window))), root_window); + window = XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window)))->root_window; else { CHECK_LIVE_FRAME (frame_or_window); - window = FGET (XFRAME (frame_or_window), root_window); + window = XFRAME (frame_or_window)->root_window; } while (NILP (WGET (XWINDOW (window), buffer))) @@ -269,14 +269,13 @@ Lisp_Object window; if (NILP (frame_or_window)) - window = FGET (SELECTED_FRAME (), selected_window); + window = SELECTED_FRAME ()->selected_window; else if (WINDOWP (frame_or_window)) - window = FGET (XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window))), - selected_window); + window = XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window)))->selected_window; else { CHECK_LIVE_FRAME (frame_or_window); - window = FGET (XFRAME (frame_or_window), selected_window); + window = XFRAME (frame_or_window)->selected_window; } return window; @@ -1214,13 +1213,13 @@ bar exists. */ if (NILP (window) && tool_bar_p - && WINDOWP (FGET (f, tool_bar_window)) - && WINDOW_TOTAL_LINES (XWINDOW (FGET (f, tool_bar_window))) > 0 - && (coordinates_in_window (XWINDOW (FGET (f, tool_bar_window)), x, y) + && WINDOWP (f->tool_bar_window) + && WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window)) > 0 + && (coordinates_in_window (XWINDOW (f->tool_bar_window), x, y) != ON_NOTHING)) { *part = ON_TEXT; - window = FGET (f, tool_bar_window); + window = f->tool_bar_window; } return window; @@ -2314,7 +2313,7 @@ (Lisp_Object frame, Lisp_Object minibuf, Lisp_Object window) { if (NILP (window)) - window = FRAMEP (frame) ? FGET (XFRAME (frame), selected_window) : selected_window; + window = FRAMEP (frame) ? XFRAME (frame)->selected_window : selected_window; CHECK_WINDOW (window); if (NILP (frame)) frame = selected_frame; @@ -3553,9 +3552,9 @@ void resize_frame_windows (struct frame *f, int size, int horflag) { - Lisp_Object root = FGET (f, root_window); + Lisp_Object root = f->root_window; struct window *r = XWINDOW (root); - Lisp_Object mini = FGET (f, minibuffer_window); + Lisp_Object mini = f->minibuffer_window; struct window *m; /* new_size is the new size of the frame's root window. */ int new_size = (horflag @@ -3603,7 +3602,7 @@ { /* We lost. Delete all windows but the frame's selected one. */ - root = FGET (f, selected_window); + root = f->selected_window; Fdelete_other_windows_internal (root, Qnil); if (horflag) WSET (XWINDOW (root), total_cols, make_number (new_size)); @@ -6484,8 +6483,8 @@ struct frame *f = make_initial_frame (); XSETFRAME (selected_frame, f); Vterminal_frame = selected_frame; - minibuf_window = FGET (f, minibuffer_window); - selected_window = FGET (f, selected_window); + minibuf_window = f->minibuffer_window; + selected_window = f->selected_window; last_nonminibuf_frame = f; window_initialized = 1; === modified file 'src/window.h' --- src/window.h 2012-08-06 10:24:26 +0000 +++ src/window.h 2012-08-07 05:29:25 +0000 @@ -474,14 +474,14 @@ /* 1 if W is a menu bar window. */ #define WINDOW_MENU_BAR_P(W) \ - (WINDOWP (FGET (WINDOW_XFRAME (W), menu_bar_window)) \ - && (W) == XWINDOW (FGET (WINDOW_XFRAME (W), menu_bar_window))) + (WINDOWP (WINDOW_XFRAME (W)->menu_bar_window) \ + && (W) == XWINDOW (WINDOW_XFRAME (W)->menu_bar_window)) /* 1 if W is a tool bar window. */ #define WINDOW_TOOL_BAR_P(W) \ - (WINDOWP (FGET (WINDOW_XFRAME (W), tool_bar_window)) \ - && (W) == XWINDOW (FGET (WINDOW_XFRAME (W), tool_bar_window))) + (WINDOWP (WINDOW_XFRAME (W)->tool_bar_window) \ + && (W) == XWINDOW (WINDOW_XFRAME (W)->tool_bar_window)) /* Return the frame y-position at which window W starts. This includes a header line, if any. */ === modified file 'src/xdisp.c' --- src/xdisp.c 2012-08-06 11:16:07 +0000 +++ src/xdisp.c 2012-08-07 05:29:25 +0000 @@ -10891,7 +10891,7 @@ /* Similarly to `with-selected-window', if the operation selects a window on another frame, we must restore that frame's selected window, and (for a tty) the top-frame. */ - ASET (vector, 8, FGET (target_frame, selected_window)); + ASET (vector, 8, target_frame->selected_window); if (FRAME_TERMCAP_P (target_frame)) ASET (vector, 9, FRAME_TTY (target_frame)->top_frame); } @@ -11051,14 +11051,14 @@ format_mode_line_unwind_data (f, current_buffer, selected_window, 0)); - Fselect_window (FGET (f, selected_window), Qt); + Fselect_window (f->selected_window, Qt); set_buffer_internal_1 - (XBUFFER (WGET (XWINDOW (FGET (f, selected_window)), buffer))); + (XBUFFER (WGET (XWINDOW (f->selected_window), buffer))); fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format; mode_line_target = MODE_LINE_TITLE; title_start = MODE_LINE_NOPROP_LEN (0); - init_iterator (&it, XWINDOW (FGET (f, selected_window)), -1, -1, + init_iterator (&it, XWINDOW (f->selected_window), -1, -1, NULL, DEFAULT_FACE_ID); display_mode_element (&it, 0, -1, -1, fmt, Qnil, 0); len = MODE_LINE_NOPROP_LEN (title_start); @@ -11070,9 +11070,9 @@ already wasted too much time by walking through the list with display_mode_element, then we might need to optimize at a higher level than this.) */ - if (! STRINGP (FGET (f, name)) - || SBYTES (FGET (f, name)) != len - || memcmp (title, SDATA (FGET (f, name)), len) != 0) + if (! STRINGP (f->name) + || SBYTES (f->name) != len + || memcmp (title, SDATA (f->name), len) != 0) x_implicitly_set_name (f, make_string (title, len), Qnil); } } @@ -11173,7 +11173,7 @@ && FRAME_NS_P (f)) ns_set_doc_edited (f, Fbuffer_modified_p - (WGET (XWINDOW (FGET (f, selected_window)), buffer))); + (WGET (XWINDOW (f->selected_window), buffer))); #endif UNGCPRO; } @@ -11414,8 +11414,8 @@ #if defined (USE_GTK) || defined (HAVE_NS) int do_update = FRAME_EXTERNAL_TOOL_BAR (f); #else - int do_update = WINDOWP (FGET (f, tool_bar_window)) - && WINDOW_TOTAL_LINES (XWINDOW (FGET (f, tool_bar_window))) > 0; + int do_update = WINDOWP (f->tool_bar_window) + && WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window)) > 0; #endif if (do_update) @@ -11477,12 +11477,12 @@ /* Build desired tool-bar items from keymaps. */ new_tool_bar - = tool_bar_items (Fcopy_sequence (FGET (f, tool_bar_items)), + = tool_bar_items (Fcopy_sequence (f->tool_bar_items), &new_n_tool_bar); /* Redisplay the tool-bar if we changed it. */ if (new_n_tool_bar != f->n_tool_bar_items - || NILP (Fequal (new_tool_bar, FGET (f, tool_bar_items)))) + || NILP (Fequal (new_tool_bar, f->tool_bar_items))) { /* Redisplay that happens asynchronously due to an expose event may access f->tool_bar_items. Make sure we update both @@ -11521,22 +11521,22 @@ Otherwise, make a new string. */ /* The size of the string we might be able to reuse. */ - size = (STRINGP (FGET (f, desired_tool_bar_string)) - ? SCHARS (FGET (f, desired_tool_bar_string)) + size = (STRINGP (f->desired_tool_bar_string) + ? SCHARS (f->desired_tool_bar_string) : 0); /* We need one space in the string for each image. */ size_needed = f->n_tool_bar_items; /* Reuse f->desired_tool_bar_string, if possible. */ - if (size < size_needed || NILP (FGET (f, desired_tool_bar_string))) + if (size < size_needed || NILP (f->desired_tool_bar_string)) FSET (f, desired_tool_bar_string, - Fmake_string (make_number (size_needed), make_number (' '))); + Fmake_string (make_number (size_needed), make_number (' '))); else { props = list4 (Qdisplay, Qnil, Qmenu_item, Qnil); Fremove_text_properties (make_number (0), make_number (size), - props, FGET (f, desired_tool_bar_string)); + props, f->desired_tool_bar_string); } /* Put a `display' property on the string for the images to display, @@ -11545,7 +11545,7 @@ for (i = 0; i < f->n_tool_bar_items; ++i) { #define PROP(IDX) \ - AREF (FGET (f, tool_bar_items), i * TOOL_BAR_ITEM_NSLOTS + (IDX)) + AREF (f->tool_bar_items, i * TOOL_BAR_ITEM_NSLOTS + (IDX)) int enabled_p = !NILP (PROP (TOOL_BAR_ITEM_ENABLED_P)); int selected_p = !NILP (PROP (TOOL_BAR_ITEM_SELECTED_P)); @@ -11654,11 +11654,11 @@ string. The string can be longer than needed when we reuse a previous string. */ if (i + 1 == f->n_tool_bar_items) - end = SCHARS (FGET (f, desired_tool_bar_string)); + end = SCHARS (f->desired_tool_bar_string); else end = i + 1; Fadd_text_properties (make_number (i), make_number (end), - props, FGET (f, desired_tool_bar_string)); + props, f->desired_tool_bar_string); #undef PROP } @@ -11808,7 +11808,7 @@ static int tool_bar_lines_needed (struct frame *f, int *n_rows) { - struct window *w = XWINDOW (FGET (f, tool_bar_window)); + struct window *w = XWINDOW (f->tool_bar_window); struct it it; /* tool_bar_lines_needed is called from redisplay_tool_bar after building the desired matrix, so use (unused) mode-line row as temporary row to @@ -11820,7 +11820,7 @@ init_iterator (&it, w, -1, -1, temp_row, TOOL_BAR_FACE_ID); it.first_visible_x = 0; it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f); - reseat_to_string (&it, NULL, FGET (f, desired_tool_bar_string), 0, 0, 0, -1); + reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); it.paragraph_embedding = L2R; while (!ITERATOR_AT_END_P (&it)) @@ -11854,8 +11854,8 @@ CHECK_FRAME (frame); f = XFRAME (frame); - if (WINDOWP (FGET (f, tool_bar_window)) - && (w = XWINDOW (FGET (f, tool_bar_window)), + if (WINDOWP (f->tool_bar_window) + && (w = XWINDOW (f->tool_bar_window), WINDOW_TOTAL_LINES (w) > 0)) { update_tool_bar (f, 1); @@ -11890,8 +11890,8 @@ do anything. This means you must start with tool-bar-lines non-zero to get the auto-sizing effect. Or in other words, you can turn off tool-bars by specifying tool-bar-lines zero. */ - if (!WINDOWP (FGET (f, tool_bar_window)) - || (w = XWINDOW (FGET (f, tool_bar_window)), + if (!WINDOWP (f->tool_bar_window) + || (w = XWINDOW (f->tool_bar_window), WINDOW_TOTAL_LINES (w) == 0)) return 0; @@ -11903,7 +11903,7 @@ /* Build a string that represents the contents of the tool-bar. */ build_desired_tool_bar_string (f); - reseat_to_string (&it, NULL, FGET (f, desired_tool_bar_string), 0, 0, 0, -1); + reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); /* FIXME: This should be controlled by a user option. But it doesn't make sense to have an R2L tool bar if the menu bar cannot be drawn also R2L, and making the menu bar R2L is tricky due @@ -12060,14 +12060,14 @@ /* This function can be called asynchronously, which means we must exclude any possibility that Fget_text_property signals an error. */ - charpos = min (SCHARS (FGET (f, current_tool_bar_string)), glyph->charpos); + charpos = min (SCHARS (f->current_tool_bar_string), glyph->charpos); charpos = max (0, charpos); /* Get the text property `menu-item' at pos. The value of that property is the start index of this item's properties in F->tool_bar_items. */ prop = Fget_text_property (make_number (charpos), - Qmenu_item, FGET (f, current_tool_bar_string)); + Qmenu_item, f->current_tool_bar_string); if (INTEGERP (prop)) { *prop_idx = XINT (prop); @@ -12095,7 +12095,7 @@ int *hpos, int *vpos, int *prop_idx) { Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); - struct window *w = XWINDOW (FGET (f, tool_bar_window)); + struct window *w = XWINDOW (f->tool_bar_window); int area; /* Find the glyph under X/Y. */ @@ -12109,7 +12109,7 @@ return -1; /* Is mouse on the highlighted item? */ - if (EQ (FGET (f, tool_bar_window), hlinfo->mouse_face_window) + if (EQ (f->tool_bar_window, hlinfo->mouse_face_window) && *vpos >= hlinfo->mouse_face_beg_row && *vpos <= hlinfo->mouse_face_end_row && (*vpos > hlinfo->mouse_face_beg_row @@ -12134,7 +12134,7 @@ int modifiers) { Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); - struct window *w = XWINDOW (FGET (f, tool_bar_window)); + struct window *w = XWINDOW (f->tool_bar_window); int hpos, vpos, prop_idx; struct glyph *glyph; Lisp_Object enabled_p; @@ -12145,7 +12145,7 @@ return; /* If item is disabled, do nothing. */ - enabled_p = AREF (FGET (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_ENABLED_P); + enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P); if (NILP (enabled_p)) return; @@ -12166,7 +12166,7 @@ show_mouse_face (hlinfo, DRAW_IMAGE_RAISED); hlinfo->mouse_face_image_state = DRAW_IMAGE_RAISED; - key = AREF (FGET (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_KEY); + key = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_KEY); XSETFRAME (frame, f); event.kind = TOOL_BAR_EVENT; @@ -12191,7 +12191,7 @@ static void note_tool_bar_highlight (struct frame *f, int x, int y) { - Lisp_Object window = FGET (f, tool_bar_window); + Lisp_Object window = f->tool_bar_window; struct window *w = XWINDOW (window); Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); @@ -12237,7 +12237,7 @@ draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED; /* If tool-bar item is not enabled, don't highlight it. */ - enabled_p = AREF (FGET (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_ENABLED_P); + enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P); if (!NILP (enabled_p)) { /* Compute the x-position of the glyph. In front and past the @@ -12271,9 +12271,9 @@ XTread_socket does the rest. */ help_echo_object = help_echo_window = Qnil; help_echo_pos = -1; - help_echo_string = AREF (FGET (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_HELP); + help_echo_string = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_HELP); if (NILP (help_echo_string)) - help_echo_string = AREF (FGET (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_CAPTION); + help_echo_string = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_CAPTION); } #endif /* HAVE_WINDOW_SYSTEM */ @@ -12854,7 +12854,7 @@ selected_frame = frame; do { - for (tail = FGET (XFRAME (frame), param_alist); + for (tail = XFRAME (frame)->param_alist; CONSP (tail); tail = XCDR (tail)) if (CONSP (XCAR (tail)) && (tem = XCAR (XCAR (tail)), @@ -13428,7 +13428,7 @@ if (!f->already_hscrolled_p) { f->already_hscrolled_p = 1; - if (hscroll_windows (FGET (f, root_window))) + if (hscroll_windows (f->root_window)) goto retry; } @@ -13441,7 +13441,7 @@ STOP_POLLING; /* Update the display. */ - set_window_update_flags (XWINDOW (FGET (f, root_window)), 1); + set_window_update_flags (XWINDOW (f->root_window), 1); pending |= update_frame (f, 0, 0); f->updated_p = 1; } @@ -13454,7 +13454,7 @@ and selected_window to be temporarily out-of-sync but let's make sure this stays contained. */ select_frame_for_redisplay (old_frame); - eassert (EQ (FGET (XFRAME (selected_frame), selected_window), + eassert (EQ (XFRAME (selected_frame)->selected_window, selected_window)); if (!pending) @@ -13467,7 +13467,7 @@ struct frame *f = XFRAME (frame); if (f->updated_p) { - mark_window_display_accurate (FGET (f, root_window), 1); + mark_window_display_accurate (f->root_window, 1); if (FRAME_TERMINAL (f)->frame_up_to_date_hook) FRAME_TERMINAL (f)->frame_up_to_date_hook (f); } @@ -16163,7 +16163,7 @@ if (FRAME_EXTERNAL_TOOL_BAR (f)) redisplay_tool_bar (f); #else - if (WINDOWP (FGET (f, tool_bar_window)) + if (WINDOWP (f->tool_bar_window) && (FRAME_TOOL_BAR_LINES (f) > 0 || !NILP (Vauto_resize_tool_bars)) && redisplay_tool_bar (f)) @@ -18118,7 +18118,7 @@ (Lisp_Object row, Lisp_Object glyphs) { struct frame *sf = SELECTED_FRAME (); - struct glyph_matrix *m = XWINDOW (FGET (sf, tool_bar_window))->current_matrix; + struct glyph_matrix *m = XWINDOW (sf->tool_bar_window)->current_matrix; EMACS_INT vpos; CHECK_NUMBER (row); @@ -20103,8 +20103,8 @@ /* Menu bar lines are displayed in the desired matrix of the dummy window menu_bar_window. */ struct window *menu_w; - eassert (WINDOWP (FGET (f, menu_bar_window))); - menu_w = XWINDOW (FGET (f, menu_bar_window)); + eassert (WINDOWP (f->menu_bar_window)); + menu_w = XWINDOW (f->menu_bar_window); init_iterator (&it, menu_w, -1, -1, menu_w->desired_matrix->rows, MENU_FACE_ID); it.first_visible_x = 0; @@ -21408,10 +21408,10 @@ case 'F': /* %F displays the frame name. */ - if (!NILP (FGET (f, title))) - return SSDATA (FGET (f, title)); + if (!NILP (f->title)) + return SSDATA (f->title); if (f->explicit_name || ! FRAME_WINDOW_P (f)) - return SSDATA (FGET (f, name)); + return SSDATA (f->name); return "Emacs"; case 'f': @@ -25575,7 +25575,7 @@ } /* Detect a nonselected window or nonselected frame. */ - else if (w != XWINDOW (FGET (f, selected_window)) + else if (w != XWINDOW (f->selected_window) || f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame) { *active_cursor = 0; @@ -26117,7 +26117,7 @@ void x_update_cursor (struct frame *f, int on_p) { - update_cursor_in_window_tree (XWINDOW (FGET (f, root_window)), on_p); + update_cursor_in_window_tree (XWINDOW (f->root_window), on_p); } @@ -26276,7 +26276,7 @@ if (FRAME_WINDOW_P (f)) { if (draw == DRAW_NORMAL_TEXT - && !EQ (hlinfo->mouse_face_window, FGET (f, tool_bar_window))) + && !EQ (hlinfo->mouse_face_window, f->tool_bar_window)) FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor); else if (draw == DRAW_MOUSE_FACE) FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor); @@ -27632,7 +27632,7 @@ #ifdef HAVE_WINDOW_SYSTEM /* Handle tool-bar window differently since it doesn't display a buffer. */ - if (EQ (window, FGET (f, tool_bar_window))) + if (EQ (window, f->tool_bar_window)) { note_tool_bar_highlight (f, x, y); return; @@ -28542,18 +28542,18 @@ } TRACE ((stderr, "(%d, %d, %d, %d)\n", r.x, r.y, r.width, r.height)); - mouse_face_overwritten_p = expose_window_tree (XWINDOW (FGET (f, root_window)), &r); + mouse_face_overwritten_p = expose_window_tree (XWINDOW (f->root_window), &r); - if (WINDOWP (FGET (f, tool_bar_window))) + if (WINDOWP (f->tool_bar_window)) mouse_face_overwritten_p - |= expose_window (XWINDOW (FGET (f, tool_bar_window)), &r); + |= expose_window (XWINDOW (f->tool_bar_window), &r); #ifdef HAVE_X_WINDOWS #ifndef MSDOS #ifndef USE_X_TOOLKIT - if (WINDOWP (FGET (f, menu_bar_window))) + if (WINDOWP (f->menu_bar_window)) mouse_face_overwritten_p - |= expose_window (XWINDOW (FGET (f, menu_bar_window)), &r); + |= expose_window (XWINDOW (f->menu_bar_window), &r); #endif /* not USE_X_TOOLKIT */ #endif #endif === modified file 'src/xfaces.c' --- src/xfaces.c 2012-08-06 10:24:26 +0000 +++ src/xfaces.c 2012-08-07 05:29:25 +0000 @@ -2053,7 +2053,7 @@ Lisp_Object lface; if (f) - lface = assq_no_quit (face_name, FGET (f, face_alist)); + lface = assq_no_quit (face_name, f->face_alist); else lface = assq_no_quit (face_name, Vface_new_frame_defaults); @@ -2680,8 +2680,7 @@ lface = Fmake_vector (make_number (LFACE_VECTOR_SIZE), Qunspecified); ASET (lface, 0, Qface); - FSET (f, face_alist, - Fcons (Fcons (face, lface), FGET (f, face_alist))); + FSET (f, face_alist, Fcons (Fcons (face, lface), f->face_alist)); } else for (i = 1; i < LFACE_VECTOR_SIZE; ++i) @@ -3360,7 +3359,7 @@ /* If there are no faces yet, give up. This is the case when called from Fx_create_frame, and we do the necessary things later in face-set-after-frame-defaults. */ - if (NILP (FGET (f, face_alist))) + if (NILP (f->face_alist)) return; if (EQ (param, Qforeground_color)) @@ -4046,7 +4045,7 @@ (Lisp_Object frame) { struct frame *f = frame_or_selected_frame (frame, 0); - return FGET (f, face_alist); + return f->face_alist; } @@ -4337,7 +4336,7 @@ matrices as invalid because they will reference faces freed above. This function is also called when a frame is destroyed. In this case, the root window of F is nil. */ - if (WINDOWP (FGET (f, root_window))) + if (WINDOWP (f->root_window)) { clear_current_matrices (f); ++windows_or_buffers_changed; @@ -5110,7 +5109,7 @@ { frame = XCAR (fl_tail); if (!NILP (Fequal (Fcdr (Fassq (Qdisplay, - FGET (XFRAME (frame), param_alist))), + XFRAME (frame)->param_alist)), display))) break; } @@ -5406,7 +5405,7 @@ { /* This function is called so early that colors are not yet set in the frame parameter list. */ - Lisp_Object color = Fassq (Qforeground_color, FGET (f, param_alist)); + Lisp_Object color = Fassq (Qforeground_color, f->param_alist); if (CONSP (color) && STRINGP (XCDR (color))) ASET (lface, LFACE_FOREGROUND_INDEX, XCDR (color)); @@ -5422,7 +5421,7 @@ { /* This function is called so early that colors are not yet set in the frame parameter list. */ - Lisp_Object color = Fassq (Qbackground_color, FGET (f, param_alist)); + Lisp_Object color = Fassq (Qbackground_color, f->param_alist); if (CONSP (color) && STRINGP (XCDR (color))) ASET (lface, LFACE_BACKGROUND_INDEX, XCDR (color)); else if (FRAME_WINDOW_P (f)) === modified file 'src/xfns.c' --- src/xfns.c 2012-08-06 10:24:26 +0000 +++ src/xfns.c 2012-08-07 05:29:25 +0000 @@ -1123,9 +1123,9 @@ BLOCK_INPUT; if (NILP (arg)) result = x_text_icon (f, - SSDATA ((!NILP (FGET (f, icon_name)) - ? FGET (f, icon_name) - : FGET (f, name)))); + SSDATA ((!NILP (f->icon_name) + ? f->icon_name + : f->name))); else result = x_bitmap_icon (f, arg); @@ -1160,11 +1160,11 @@ BLOCK_INPUT; result = x_text_icon (f, - SSDATA ((!NILP (FGET (f, icon_name)) - ? FGET (f, icon_name) - : !NILP (FGET (f, title)) - ? FGET (f, title) - : FGET (f, name)))); + SSDATA ((!NILP (f->icon_name) + ? f->icon_name + : !NILP (f->title) + ? f->title + : f->name))); if (result) { @@ -1253,8 +1253,8 @@ UNBLOCK_INPUT; } - if (nlines == 0 && WINDOWP (FGET (f, menu_bar_window))) - clear_glyph_matrix (XWINDOW (FGET (f, menu_bar_window))->current_matrix); + if (nlines == 0 && WINDOWP (f->menu_bar_window)) + clear_glyph_matrix (XWINDOW (f->menu_bar_window)->current_matrix); } #endif /* not USE_X_TOOLKIT && not USE_GTK */ adjust_glyphs (f); @@ -1352,8 +1352,8 @@ UNBLOCK_INPUT; } - if (WINDOWP (FGET (f, tool_bar_window))) - clear_glyph_matrix (XWINDOW (FGET (f, tool_bar_window))->current_matrix); + if (WINDOWP (f->tool_bar_window)) + clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix); } run_window_configuration_change_hook (f); @@ -1548,7 +1548,7 @@ if (text.nitems != bytes) error ("Window name too large"); - if (!STRINGP (FGET (f, icon_name))) + if (!STRINGP (f->icon_name)) { icon = text; encoded_icon_name = encoded_name; @@ -1556,7 +1556,7 @@ else { /* See the above comment "Note: Encoding strategy". */ - icon.value = x_encode_text (FGET (f, icon_name), coding_system, 0, + icon.value = x_encode_text (f->icon_name, coding_system, 0, &bytes, &stringp, &do_free_icon_value); icon.encoding = (stringp ? XA_STRING : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); @@ -1565,7 +1565,7 @@ if (icon.nitems != bytes) error ("Icon name too large"); - encoded_icon_name = ENCODE_UTF_8 (FGET (f, icon_name)); + encoded_icon_name = ENCODE_UTF_8 (f->icon_name); } #ifdef USE_GTK @@ -1632,7 +1632,7 @@ /* Check for no change needed in this very common case before we do any consing. */ if (!strcmp (FRAME_X_DISPLAY_INFO (f)->x_id_name, - SSDATA (FGET (f, name)))) + SSDATA (f->name))) return; name = build_string (FRAME_X_DISPLAY_INFO (f)->x_id_name); } @@ -1640,15 +1640,15 @@ CHECK_STRING (name); /* Don't change the name if it's already NAME. */ - if (! NILP (Fstring_equal (name, FGET (f, name)))) + if (! NILP (Fstring_equal (name, f->name))) return; FSET (f, name, name); /* For setting the frame title, the title parameter should override the name parameter. */ - if (! NILP (FGET (f, title))) - name = FGET (f, title); + if (! NILP (f->title)) + name = f->title; x_set_name_internal (f, name); } @@ -1678,7 +1678,7 @@ x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name) { /* Don't change the title if it's already NAME. */ - if (EQ (name, FGET (f, title))) + if (EQ (name, f->title)) return; update_mode_lines = 1; @@ -1686,7 +1686,7 @@ FSET (f, title, name); if (NILP (name)) - name = FGET (f, name); + name = f->name; else CHECK_STRING (name); @@ -2571,7 +2571,7 @@ int explicit = f->explicit_name; f->explicit_name = 0; - name = FGET (f, name); + name = f->name; FSET (f, name, Qnil); x_set_name (f, name, explicit); } @@ -2714,7 +2714,7 @@ int explicit = f->explicit_name; f->explicit_name = 0; - name = FGET (f, name); + name = f->name; FSET (f, name, Qnil); x_set_name (f, name, explicit); } @@ -2791,9 +2791,9 @@ : NormalState)); #endif - x_text_icon (f, SSDATA ((!NILP (FGET (f, icon_name)) - ? FGET (f, icon_name) - : FGET (f, name)))); + x_text_icon (f, SSDATA ((!NILP (f->icon_name) + ? f->icon_name + : f->name))); UNBLOCK_INPUT; } @@ -3138,7 +3138,7 @@ FSET (f, icon_name, x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title", RES_TYPE_STRING)); - if (! STRINGP (FGET (f, icon_name))) + if (! STRINGP (f->icon_name)) FSET (f, icon_name, Qnil); FRAME_X_DISPLAY_INFO (f) = dpyinfo; @@ -3340,7 +3340,7 @@ x_default_parameter (f, parms, Qfullscreen, Qnil, "fullscreen", "Fullscreen", RES_TYPE_SYMBOL); x_default_parameter (f, parms, Qtool_bar_position, - FGET (f, tool_bar_position), 0, 0, RES_TYPE_SYMBOL); + f->tool_bar_position, 0, 0, RES_TYPE_SYMBOL); /* Compute the size of the X window. */ window_prompting = x_figure_window_size (f, parms, 1); @@ -3468,7 +3468,7 @@ by x_get_arg and friends, now go in the misc. alist of the frame. */ for (tem = parms; CONSP (tem); tem = XCDR (tem)) if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) - FSET (f, param_alist, Fcons (XCAR (tem), FGET (f, param_alist))); + FSET (f, param_alist, Fcons (XCAR (tem), f->param_alist)); UNGCPRO; === modified file 'src/xmenu.c' --- src/xmenu.c 2012-08-06 10:24:26 +0000 +++ src/xmenu.c 2012-08-07 05:29:25 +0000 @@ -835,7 +835,7 @@ if (!f) return; find_and_call_menu_selection (f, f->menu_bar_items_used, - FGET (f, menu_bar_vector), client_data); + f->menu_bar_vector, client_data); } #endif /* not USE_GTK */ @@ -1014,14 +1014,14 @@ /* Save the frame's previous menu bar contents data. */ if (previous_menu_items_used) - memcpy (previous_items, XVECTOR (FGET (f, menu_bar_vector))->contents, + memcpy (previous_items, XVECTOR (f->menu_bar_vector)->contents, previous_menu_items_used * word_size); /* Fill in menu_items with the current menu bar contents. This can evaluate Lisp code. */ save_menu_items (); - menu_items = FGET (f, menu_bar_vector); + menu_items = f->menu_bar_vector; menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0; subitems = ASIZE (items) / 4; submenu_start = alloca ((subitems + 1) * sizeof *submenu_start); === modified file 'src/xterm.c' --- src/xterm.c 2012-08-06 10:24:26 +0000 +++ src/xterm.c 2012-08-07 05:29:25 +0000 @@ -6363,7 +6363,7 @@ mouse highlighting. */ if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) && (f == 0 - || !EQ (FGET (f, tool_bar_window), hlinfo->mouse_face_window))) + || !EQ (f->tool_bar_window, hlinfo->mouse_face_window))) { clear_mouse_face (hlinfo); hlinfo->mouse_face_hidden = 1; @@ -6910,15 +6910,15 @@ if (f) { /* Is this in the tool-bar? */ - if (WINDOWP (FGET (f, tool_bar_window)) - && WINDOW_TOTAL_LINES (XWINDOW (FGET (f, tool_bar_window)))) + if (WINDOWP (f->tool_bar_window) + && WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window))) { Lisp_Object window; int x = event.xbutton.x; int y = event.xbutton.y; window = window_from_coordinates (f, x, y, 0, 1); - tool_bar_p = EQ (window, FGET (f, tool_bar_window)); + tool_bar_p = EQ (window, f->tool_bar_window); if (tool_bar_p && event.xbutton.button < 4) { @@ -7509,7 +7509,7 @@ } #ifdef HAVE_X_I18N - if (w == XWINDOW (FGET (f, selected_window))) + if (w == XWINDOW (f->selected_window)) if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMPreeditPosition)) xic_set_preeditarea (w, x, y); #endif @@ -8160,7 +8160,7 @@ xic_set_statusarea (f); if (FRAME_XIC_STYLE (f) & XIMPreeditPosition) { - struct window *w = XWINDOW (FGET (f, selected_window)); + struct window *w = XWINDOW (f->selected_window); xic_set_preeditarea (w, w->cursor.x, w->cursor.y); } } @@ -8948,7 +8948,7 @@ #endif /* not USE_GTK */ /* If cursor was outside the new size, mark it as off. */ - mark_window_cursors_off (XWINDOW (FGET (f, root_window))); + mark_window_cursors_off (XWINDOW (f->root_window)); /* Clear out any recollection of where the mouse highlighting was, since it might be in a place that's outside the new frame size. ------------------------------------------------------------ revno: 109485 fixes bug: http://debbugs.gnu.org/8384 committer: Chong Yidong branch nick: trunk timestamp: Tue 2012-08-07 12:52:15 +0800 message: Preserve text properties when saving primary selection. * lisp/simple.el (deactivate-mark): Preserve text properties when saving the primary selection. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-07 03:57:05 +0000 +++ lisp/ChangeLog 2012-08-07 04:52:15 +0000 @@ -1,3 +1,8 @@ +2012-08-07 Chong Yidong + + * simple.el (deactivate-mark): Preserve text properties when + saving the primary selection (Bug#8384). + 2012-08-07 Kevin Ryde * woman.el (woman0-if): Quietly treat ".if v" as false (Bug#12109). === modified file 'lisp/simple.el' --- lisp/simple.el 2012-08-04 08:09:24 +0000 +++ lisp/simple.el 2012-08-07 04:52:15 +0000 @@ -3960,9 +3960,8 @@ (or (x-selection-owner-p 'PRIMARY) (null (x-selection-exists-p 'PRIMARY)))) (x-set-selection 'PRIMARY - (buffer-substring-no-properties - (region-beginning) - (region-end)))))) + (buffer-substring (region-beginning) + (region-end)))))) (if (and (null force) (or (eq transient-mark-mode 'lambda) (and (eq (car-safe transient-mark-mode) 'only) ------------------------------------------------------------ revno: 109484 committer: Chong Yidong branch nick: trunk timestamp: Tue 2012-08-07 12:50:55 +0800 message: Update cl-loaddefs.el. diff: === modified file 'lisp/emacs-lisp/cl-loaddefs.el' --- lisp/emacs-lisp/cl-loaddefs.el 2012-07-26 01:29:24 +0000 +++ lisp/emacs-lisp/cl-loaddefs.el 2012-08-07 04:50:55 +0000 @@ -260,7 +260,7 @@ ;;;;;; cl-do cl-loop cl-return-from cl-return cl-block cl-etypecase ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp -;;;;;; cl-gensym) "cl-macs" "cl-macs.el" "db390970b6e9bd057169b197d5189781") +;;;;;; cl-gensym) "cl-macs" "cl-macs.el" "37a13242a811078a7ae71578eeed4254") ;;; Generated autoloads from cl-macs.el (autoload 'cl-gensym "cl-macs" "\ ------------------------------------------------------------ revno: 109483 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-08-07 08:16:47 +0400 message: * configure.ac: New option --disable-features. (OPTION_DEFAULT_ON): Change to use enable_features. * INSTALL: Explain --disable-features. diff: === modified file 'ChangeLog' --- ChangeLog 2012-08-07 01:03:44 +0000 +++ ChangeLog 2012-08-07 04:16:47 +0000 @@ -1,3 +1,9 @@ +2012-08-07 Dmitry Antipov + + * configure.ac: New option --disable-features. + (OPTION_DEFAULT_ON): Change to use enable_features. + * INSTALL: Explain --disable-features. + 2012-08-07 Glenn Morris * configure.ac: Require automake 1.11 (fairly arbitrarily). === modified file 'INSTALL' --- INSTALL 2012-08-06 21:05:25 +0000 +++ INSTALL 2012-08-07 04:16:47 +0000 @@ -319,6 +319,20 @@ 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 +--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. +For the smallest possible executable without X, use --disable-features +--without-x. + Use --with-wide-int to implement Emacs values with the type 'long long', even on hosts where a narrower type would do. With this option, on a typical 32-bit host, Emacs integers have 62 bits instead of 30. === modified file 'configure.ac' --- configure.ac 2012-08-07 01:03:44 +0000 +++ configure.ac 2012-08-07 04:16:47 +0000 @@ -48,6 +48,14 @@ docdir='${datadir}/emacs/${version}/etc' gamedir='${localstatedir}/games/emacs' +dnl Do not omit a lot of the nice features by default. +AC_ARG_ENABLE(features, +[AS_HELP_STRING([--disable-features], + [omit almost all features and build + small executable with minimal dependencies])], + enable_features=$enableval, + enable_features=yes) + dnl OPTION_DEFAULT_OFF(NAME, HELP-STRING) dnl Create a new --with option that defaults to being disabled. dnl NAME is the base name of the option. The shell variable with_NAME @@ -63,8 +71,8 @@ ])dnl dnl OPTION_DEFAULT_ON(NAME, HELP-STRING) -dnl Create a new --with option that defaults to being enabled. NAME -dnl is the base name of the option. The shell variable with_NAME +dnl Create a new --with option that defaults to $enable_features. +dnl NAME is the base name of the option. The shell variable with_NAME dnl will be set either to 'no' (for a plain --without-NAME) or to dnl 'yes' (if the option is not specified). Note that the shell dnl variable name is constructed as autoconf does, by replacing @@ -72,7 +80,7 @@ dnl HELP-STRING is the help text for the option. AC_DEFUN([OPTION_DEFAULT_ON], [dnl AC_ARG_WITH([$1],[AS_HELP_STRING([--without-$1],[$2])],[],[dnl - m4_bpatsubst([with_$1], [[^0-9a-z]], [_])=yes])dnl + m4_bpatsubst([with_$1], [[^0-9a-z]], [_])=$enable_features])dnl ])dnl OPTION_DEFAULT_ON([pop],[don't support POP mail retrieval with movemail]) ------------------------------------------------------------ revno: 109482 fixes bugs: http://debbugs.gnu.org/12110 http://debbugs.gnu.org/12109 author: Kevin Ryde committer: Chong Yidong branch nick: trunk timestamp: Tue 2012-08-07 11:57:05 +0800 message: Fix two woman bugs. * lisp/woman.el (woman0-if): Quietly treat ".if v" as false. (woman-parse-numeric-value): On a bad .IP line, issue a warning and continue processing. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-07 03:31:53 +0000 +++ lisp/ChangeLog 2012-08-07 03:57:05 +0000 @@ -1,3 +1,9 @@ +2012-08-07 Kevin Ryde + + * woman.el (woman0-if): Quietly treat ".if v" as false (Bug#12109). + (woman-parse-numeric-value): On a bad .IP line, issue a warning + and continue processing (Bug#12110). + 2012-08-06 Stefan Monnier * progmodes/cperl-mode.el (cperl-mode): Yet another fix for === modified file 'lisp/woman.el' --- lisp/woman.el 2012-07-31 13:32:21 +0000 +++ lisp/woman.el 2012-08-07 03:57:05 +0000 @@ -2531,7 +2531,8 @@ (cond ;; ((looking-at "[no]") (setq c t)) ; accept n(roff) and o(dd page) ;; ((looking-at "[te]") (setq c nil)) ; reject t(roff) and e(ven page) - ((looking-at "[ntoe]") + ;; Per groff ".if v" is recognised as false (it means -Tversatec). + ((looking-at "[ntoev]") (setq c (memq (following-char) woman-if-conditions-true))) ;; Unrecognized letter so reject: ((looking-at "[A-Za-z]") (setq c nil) @@ -3569,7 +3570,7 @@ (let (n) (forward-char) (setq n (woman-parse-numeric-arg)) - (skip-syntax-forward " ") + (skip-syntax-forward " " (line-end-position)) (if (eq (following-char) ?\)) (forward-char) (WoMan-warn "Parenthesis confusion in numeric expression!")) @@ -3621,7 +3622,7 @@ (buffer-substring (point) (line-end-position))) - (skip-syntax-forward "^ ") + (skip-syntax-forward "^ " (line-end-position)) 0) (goto-char (match-end 0)) ;; Check for scale factor: ------------------------------------------------------------ revno: 109481 [merge] committer: Chong Yidong branch nick: trunk timestamp: Tue 2012-08-07 11:33:37 +0800 message: Merge from emacs-24; up to r108090. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2012-08-05 09:24:55 +0000 +++ doc/emacs/ChangeLog 2012-08-07 03:31:53 +0000 @@ -1,3 +1,7 @@ +2012-07-31 Chong Yidong + + * emacs.texi: Fix ISBN (Bug#12080). + 2012-08-05 Chong Yidong * display.texi (Faces): Document frame-background-mode (Bug#7774). === modified file 'doc/emacs/emacs.texi' --- doc/emacs/emacs.texi 2012-07-21 06:13:23 +0000 +++ doc/emacs/emacs.texi 2012-08-07 03:31:53 +0000 @@ -94,7 +94,7 @@ Published by the Free Software Foundation @* 51 Franklin Street, Fifth Floor @* Boston, MA 02110-1301 USA @* -ISBN 978-0-9831592-3-0 +ISBN 978-0-9831592-4-7 @sp 2 Cover art by Etienne Suvasa; cover design by Matt Lee. === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-08-05 09:24:55 +0000 +++ doc/lispref/ChangeLog 2012-08-07 03:31:53 +0000 @@ -1,3 +1,11 @@ +2012-08-06 Eli Zaretskii + + * functions.texi (Closures): Put the main index entry for + "closures" here. (Bug#12138) + + * variables.texi (Lexical Binding): Disambiguate the index entry + for "closures". + 2012-08-05 Chong Yidong * display.texi (Defining Faces): Move documentation of === modified file 'doc/lispref/functions.texi' --- doc/lispref/functions.texi 2012-06-18 15:57:41 +0000 +++ doc/lispref/functions.texi 2012-08-07 03:33:37 +0000 @@ -1100,8 +1100,9 @@ any anonymous function that you create using the @code{lambda} macro or the @code{function} special form or the @code{#'} syntax (@pxref{Anonymous Functions}), is automatically converted into a -closure. +@dfn{closure}. +@cindex closure A closure is a function that also carries a record of the lexical environment that existed when the function was defined. When it is invoked, any lexical variable references within its definition use the === modified file 'doc/lispref/variables.texi' --- doc/lispref/variables.texi 2012-05-27 01:34:14 +0000 +++ doc/lispref/variables.texi 2012-08-07 03:31:53 +0000 @@ -967,11 +967,11 @@ environment; if the variable is not specified in there, it looks in the symbol's value cell, where the dynamic value is stored. -@cindex closures +@cindex closures, example of using Lexical bindings have indefinite extent. Even after a binding construct has finished executing, its lexical environment can be ``kept around'' in Lisp objects called @dfn{closures}. A closure is -created when you create a named or anonymous function with lexical +created when you define a named or anonymous function with lexical binding enabled. @xref{Closures}, for details. When a closure is called as a function, any lexical variable === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2012-08-01 23:42:29 +0000 +++ doc/misc/ChangeLog 2012-08-07 03:31:53 +0000 @@ -1,3 +1,8 @@ +2012-08-06 Aurélien Aptel + + * url.texi (Parsed URLs): Adjust to the code's use of defstruct + (bug#12096). + 2012-08-01 Jay Belanger * calc.texi (Simplification modes, Conversions) === modified file 'doc/misc/url.texi' --- doc/misc/url.texi 2012-02-29 08:12:51 +0000 +++ doc/misc/url.texi 2012-08-06 21:50:25 +0000 @@ -126,10 +126,10 @@ @section Parsed URLs @cindex parsed URLs The library functions typically operate on @dfn{parsed} versions of -URLs. These are actually vectors of the form: +URLs. These are actually CL structures (vectors) of the form: @example -[@var{type} @var{user} @var{password} @var{host} @var{port} @var{file} @var{target} @var{attributes} @var{full}] +[cl-struct-url @var{type} @var{user} @var{password} @var{host} @var{port} @var{filename} @var{target} @var{attributes} @var{fullness} @var{use-cookies}] @end example @noindent where @@ -144,16 +144,19 @@ is the host name associated with it, or @code{nil}; @item port is the port number associated with it, or @code{nil}; -@item file +@item filename is the ``file'' part of it, or @code{nil}. This doesn't necessarily actually refer to a file; @item target is the target part, or @code{nil}; @item attributes is the attributes associated with it, or @code{nil}; -@item full +@item fullness is @code{t} for a fully-specified URL, with a host part indicated by @samp{//} after the scheme part. +@item use-cookies +is @code{nil} to neither send or store cookies to the server, @code{t} +otherwise. @end table @findex url-type @@ -161,23 +164,21 @@ @findex url-password @findex url-host @findex url-port -@findex url-file +@findex url-filename @findex url-target @findex url-attributes -@findex url-full -@findex url-set-type -@findex url-set-user -@findex url-set-password -@findex url-set-host -@findex url-set-port -@findex url-set-file -@findex url-set-target -@findex url-set-attributes -@findex url-set-full +@findex url-fullness These attributes have accessors named @code{url-@var{part}}, where @var{part} is the name of one of the elements above, e.g., -@code{url-host}. Similarly, there are setters of the form -@code{url-set-@var{part}}. +@code{url-host}. These attributes can be set with the same accessors +using @code{setf}: + +@example +(setf (url-port url) 80) +@end example + +If @var{port} is @var{nil}, @code{url-port} returns the default port +of the protocol. There are functions for parsing and unparsing between the string and vector forms. === modified file 'etc/NEWS' --- etc/NEWS 2012-08-06 07:36:35 +0000 +++ etc/NEWS 2012-08-07 03:31:53 +0000 @@ -1179,7 +1179,7 @@ The search is performed using `customize-apropos'. To turn off the search field, set `custom-search-field' to nil. -*** Custom options now start out hidden if at their default values. +*** Options in customize group buffers start out hidden if not customized. Use the arrow to the left of the option name to toggle visibility. *** custom-buffer-sort-alphabetically now defaults to t. === modified file 'leim/quail/persian.el' --- leim/quail/persian.el 2012-08-06 07:34:35 +0000 +++ leim/quail/persian.el 2012-08-07 03:31:53 +0000 @@ -22,8 +22,6 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . -;; This is a Halaal Poly-Existential intended to remain perpetually Halaal. - ;;; Commentary: ;; ;; This file contains a collection of input methods for === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-06 21:05:48 +0000 +++ lisp/ChangeLog 2012-08-07 03:31:53 +0000 @@ -1,5 +1,10 @@ 2012-08-06 Stefan Monnier + * progmodes/cperl-mode.el (cperl-mode): Yet another fix for + syntax-propertize-function (bug#10095). + +2012-08-06 Stefan Monnier + * help-fns.el (help-fns--key-bindings, help-fns--signature) (help-fns--parent-mode, help-fns--obsolete): New funs, extracted from describe-function-1. === modified file 'lisp/progmodes/cperl-mode.el' --- lisp/progmodes/cperl-mode.el 2012-07-21 06:13:23 +0000 +++ lisp/progmodes/cperl-mode.el 2012-08-07 03:31:53 +0000 @@ -1838,7 +1838,13 @@ (set (make-local-variable 'cperl-syntax-done-to) nil) (set (make-local-variable 'syntax-propertize-function) (lambda (start end) - (goto-char start) (cperl-fontify-syntaxically end)))) + (goto-char start) + ;; Even if cperl-fontify-syntaxically has already gone + ;; beyond `start', syntax-propertize has just removed + ;; syntax-table properties between start and end, so we have + ;; to re-apply them. + (setq cperl-syntax-done-to start) + (cperl-fontify-syntaxically end)))) (make-local-variable 'parse-sexp-lookup-properties) ;; Do not introduce variable if not needed, we check it! (set 'parse-sexp-lookup-properties t) ------------------------------------------------------------ revno: 109480 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-06 21:03:44 -0400 message: Set a minimum automake version * configure.ac: Require automake 1.11 (fairly arbitrarily). * autogen.sh (automake_min): Get it from configure.ac. diff: === modified file 'ChangeLog' --- ChangeLog 2012-08-06 21:05:25 +0000 +++ ChangeLog 2012-08-07 01:03:44 +0000 @@ -1,3 +1,8 @@ +2012-08-07 Glenn Morris + + * configure.ac: Require automake 1.11 (fairly arbitrarily). + * autogen.sh (automake_min): Get it from configure.ac. + 2012-08-06 Glenn Morris * configure.ac (BROKEN_GETWD) [unixware]: New define. === modified file 'autogen.sh' --- autogen.sh 2012-08-02 01:59:19 +0000 +++ autogen.sh 2012-08-07 01:03:44 +0000 @@ -36,8 +36,9 @@ ## Minimum versions we need: autoconf_min=`sed -n 's/^ *AC_PREREQ(\([0-9\.]*\)).*/\1/p' configure.ac` -## FIXME how to determine this from the sources? -automake_min=1.11 +## This will need improving if more options are ever added to the +## AM_INIT_AUTOMAKE call. +automake_min=`sed -n 's/^ *AM_INIT_AUTOMAKE(\([0-9\.]*\)).*/\1/p' configure.ac` ## $1 = program, eg "autoconf". === modified file 'configure.ac' --- configure.ac 2012-08-06 20:29:45 +0000 +++ configure.ac 2012-08-07 01:03:44 +0000 @@ -26,7 +26,8 @@ AC_CONFIG_HEADER(src/config.h:src/config.in) AC_CONFIG_SRCDIR(src/lisp.h) AC_CONFIG_AUX_DIR(build-aux) -AM_INIT_AUTOMAKE +dnl Fairly arbitrary, older versions might work too. +AM_INIT_AUTOMAKE(1.11) dnl Support for --program-prefix, --program-suffix and dnl --program-transform-name options ------------------------------------------------------------ revno: 109479 committer: Juanma Barranquero branch nick: trunk timestamp: Tue 2012-08-07 00:07:01 +0200 message: src/w32.c: Silence compiler warnings. (map_w32_filename): Remove unused variable `is_fat'. (chase_symlinks): Add parentheses around expression. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-06 20:29:45 +0000 +++ src/ChangeLog 2012-08-06 22:07:01 +0000 @@ -1,3 +1,9 @@ +2012-08-06 Juanma Barranquero + + * w32.c: Silence compiler warnings. + (map_w32_filename): Remove unused variable `is_fat'. + (chase_symlinks): Add parentheses around expression. + 2012-08-06 Glenn Morris * sysdep.c: Respect BROKEN_GETWD. === modified file 'src/w32.c' --- src/w32.c 2012-08-06 11:16:07 +0000 +++ src/w32.c 2012-08-06 22:07:01 +0000 @@ -2395,7 +2395,6 @@ char c; char * path; const char * save_name = name; - int is_fat = 0; if (strlen (name) >= MAX_PATH) { @@ -4433,7 +4432,7 @@ { target[res] = '\0'; if (!(IS_DEVICE_SEP (target[1]) - || IS_DIRECTORY_SEP (target[0]) && IS_DIRECTORY_SEP (target[1]))) + || (IS_DIRECTORY_SEP (target[0]) && IS_DIRECTORY_SEP (target[1])))) { /* Target is relative. Append it to the directory part of the symlink, then copy the result back to target. */ ------------------------------------------------------------ revno: 109478 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2012-08-06 17:05:48 -0400 message: * lisp/help-fns.el (help-fns--key-bindings, help-fns--signature) (help-fns--parent-mode, help-fns--obsolete): New funs, extracted from describe-function-1. (describe-function-1): Use them. Move compiler macro after sig. (help-fns--compiler-macro): Use function-get. Assume we're already in standard-output. Adjust layout to new call order. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-06 19:53:45 +0000 +++ lisp/ChangeLog 2012-08-06 21:05:48 +0000 @@ -1,5 +1,12 @@ 2012-08-06 Stefan Monnier + * help-fns.el (help-fns--key-bindings, help-fns--signature) + (help-fns--parent-mode, help-fns--obsolete): New funs, extracted from + describe-function-1. + (describe-function-1): Use them. Move compiler macro after sig. + (help-fns--compiler-macro): Use function-get. Assume we're already in + standard-output. Adjust layout to new call order. + * emacs-lisp/cl-macs.el (cl--sm-macroexpand): Fix handling of re-binding a symbol that has a symbol-macro (bug#12119). === modified file 'lisp/help-fns.el' --- lisp/help-fns.el 2012-08-05 08:41:12 +0000 +++ lisp/help-fns.el 2012-08-06 21:05:48 +0000 @@ -380,26 +380,125 @@ (declare-function ad-get-advice-info "advice" (function)) +(defun help-fns--key-bindings (function) + (when (commandp function) + (let ((pt2 (with-current-buffer standard-output (point))) + (remapped (command-remapping function))) + (unless (memq remapped '(ignore undefined)) + (let ((keys (where-is-internal + (or remapped function) overriding-local-map nil nil)) + non-modified-keys) + (if (and (eq function 'self-insert-command) + (vectorp (car-safe keys)) + (consp (aref (car keys) 0))) + (princ "It is bound to many ordinary text characters.\n") + ;; Which non-control non-meta keys run this command? + (dolist (key keys) + (if (member (event-modifiers (aref key 0)) '(nil (shift))) + (push key non-modified-keys))) + (when remapped + (princ "Its keys are remapped to `") + (princ (symbol-name remapped)) + (princ "'.\n")) + + (when keys + (princ (if remapped + "Without this remapping, it would be bound to " + "It is bound to ")) + ;; If lots of ordinary text characters run this command, + ;; don't mention them one by one. + (if (< (length non-modified-keys) 10) + (princ (mapconcat 'key-description keys ", ")) + (dolist (key non-modified-keys) + (setq keys (delq key keys))) + (if keys + (progn + (princ (mapconcat 'key-description keys ", ")) + (princ ", and many ordinary text characters")) + (princ "many ordinary text characters")))) + (when (or remapped keys non-modified-keys) + (princ ".") + (terpri))))) + + (with-current-buffer standard-output + (fill-region-as-paragraph pt2 (point)) + (unless (looking-back "\n\n") + (terpri)))))) + (defun help-fns--compiler-macro (function) - (let ((handler nil)) - ;; FIXME: Copied from macroexp.el. - (while (and (symbolp function) - (not (setq handler (get function 'compiler-macro))) - (fboundp function)) - ;; Follow the sequence of aliases. - (setq function (symbol-function function))) + (let ((handler (function-get function 'compiler-macro))) (when handler - (princ "This function has a compiler macro") + (insert "\nThis function has a compiler macro") (let ((lib (get function 'compiler-macro-file))) ;; FIXME: rather than look at the compiler-macro-file property, ;; just look at `handler' itself. (when (stringp lib) - (princ (format " in `%s'" lib)) - (with-current-buffer standard-output - (save-excursion - (re-search-backward "`\\([^`']+\\)'" nil t) - (help-xref-button 1 'help-function-cmacro function lib))))) - (princ ".\n\n")))) + (insert (format " in `%s'" lib)) + (save-excursion + (re-search-backward "`\\([^`']+\\)'" nil t) + (help-xref-button 1 'help-function-cmacro function lib)))) + (insert ".\n")))) + +(defun help-fns--signature (function doc real-def real-function) + (unless (keymapp function) ; If definition is a keymap, skip arglist note. + (let* ((advertised (gethash real-def advertised-signature-table t)) + (arglist (if (listp advertised) + advertised (help-function-arglist real-def))) + (usage (help-split-fundoc doc function))) + (if usage (setq doc (cdr usage))) + (let* ((use (cond + ((and usage (not (listp advertised))) (car usage)) + ((listp arglist) + (format "%S" (help-make-usage function arglist))) + ((stringp arglist) arglist) + ;; Maybe the arglist is in the docstring of a symbol + ;; this one is aliased to. + ((let ((fun real-function)) + (while (and (symbolp fun) + (setq fun (symbol-function fun)) + (not (setq usage (help-split-fundoc + (documentation fun) + function))))) + usage) + (car usage)) + ((or (stringp real-def) + (vectorp real-def)) + (format "\nMacro: %s" (format-kbd-macro real-def))) + (t "[Missing arglist. Please make a bug report.]"))) + (high (help-highlight-arguments use doc))) + (let ((fill-begin (point))) + (insert (car high) "\n") + (fill-region fill-begin (point))) + (cdr high))))) + +(defun help-fns--parent-mode (function) + ;; If this is a derived mode, link to the parent. + (let ((parent-mode (and (symbolp function) + (get function + 'derived-mode-parent)))) + (when parent-mode + (insert "\nParent mode: `") + (let ((beg (point))) + (insert (format "%s" parent-mode)) + (make-text-button beg (point) + 'type 'help-function + 'help-args (list parent-mode))) + (insert "'.\n")))) + +(defun help-fns--obsolete (function) + (let* ((obsolete (and + ;; `function' might be a lambda construct. + (symbolp function) + (get function 'byte-obsolete-info))) + (use (car obsolete))) + (when obsolete + (insert "\nThis function is obsolete") + (when (nth 2 obsolete) + (insert (format " since %s" (nth 2 obsolete)))) + (insert (cond ((stringp use) (concat ";\n" use)) + (use (format ";\nuse `%s' instead." use)) + (t ".")) + "\n")))) ;; We could use `symbol-file' but this is a wee bit more efficient. (defun help-fns--autoloaded-p (function file) @@ -510,54 +609,8 @@ (fill-region-as-paragraph (save-excursion (goto-char pt1) (forward-line 0) (point)) (point))) (terpri)(terpri) - (when (commandp function) - (let ((pt2 (with-current-buffer (help-buffer) (point))) - (remapped (command-remapping function))) - (unless (memq remapped '(ignore undefined)) - (let ((keys (where-is-internal - (or remapped function) overriding-local-map nil nil)) - non-modified-keys) - (if (and (eq function 'self-insert-command) - (vectorp (car-safe keys)) - (consp (aref (car keys) 0))) - (princ "It is bound to many ordinary text characters.\n") - ;; Which non-control non-meta keys run this command? - (dolist (key keys) - (if (member (event-modifiers (aref key 0)) '(nil (shift))) - (push key non-modified-keys))) - (when remapped - (princ "Its keys are remapped to `") - (princ (symbol-name remapped)) - (princ "'.\n")) - - (when keys - (princ (if remapped - "Without this remapping, it would be bound to " - "It is bound to ")) - ;; If lots of ordinary text characters run this command, - ;; don't mention them one by one. - (if (< (length non-modified-keys) 10) - (princ (mapconcat 'key-description keys ", ")) - (dolist (key non-modified-keys) - (setq keys (delq key keys))) - (if keys - (progn - (princ (mapconcat 'key-description keys ", ")) - (princ ", and many ordinary text characters")) - (princ "many ordinary text characters")))) - (when (or remapped keys non-modified-keys) - (princ ".") - (terpri))))) - - (with-current-buffer (help-buffer) - (fill-region-as-paragraph pt2 (point)) - (unless (looking-back "\n\n") - (terpri))))) - (help-fns--compiler-macro function) - (let* ((advertised (gethash real-def advertised-signature-table t)) - (arglist (if (listp advertised) - advertised (help-function-arglist real-def))) - (doc-raw (condition-case err + + (let* ((doc-raw (condition-case err (documentation function t) (error (format "No Doc! %S" err)))) ;; If the function is autoloaded, and its docstring has @@ -568,66 +621,18 @@ (string-match "\\([^\\]=\\|[^=]\\|\\`\\)\\\\[[{<]" doc-raw) (load (cadr real-def) t)) - (substitute-command-keys doc-raw))) - (usage (help-split-fundoc doc function))) - (with-current-buffer standard-output - ;; If definition is a keymap, skip arglist note. - (unless (keymapp function) - (if usage (setq doc (cdr usage))) - (let* ((use (cond - ((and usage (not (listp advertised))) (car usage)) - ((listp arglist) - (format "%S" (help-make-usage function arglist))) - ((stringp arglist) arglist) - ;; Maybe the arglist is in the docstring of a symbol - ;; this one is aliased to. - ((let ((fun real-function)) - (while (and (symbolp fun) - (setq fun (symbol-function fun)) - (not (setq usage (help-split-fundoc - (documentation fun) - function))))) - usage) - (car usage)) - ((or (stringp real-def) - (vectorp real-def)) - (format "\nMacro: %s" (format-kbd-macro real-def))) - (t "[Missing arglist. Please make a bug report.]"))) - (high (help-highlight-arguments use doc))) - (let ((fill-begin (point))) - (insert (car high) "\n") - (fill-region fill-begin (point))) - (setq doc (cdr high)))) - - ;; If this is a derived mode, link to the parent. - (let ((parent-mode (and (symbolp real-function) - (get real-function - 'derived-mode-parent)))) - (when parent-mode - (with-current-buffer standard-output - (insert "\nParent mode: `") - (let ((beg (point))) - (insert (format "%s" parent-mode)) - (make-text-button beg (point) - 'type 'help-function - 'help-args (list parent-mode)))) - (princ "'.\n"))) - - (let* ((obsolete (and - ;; function might be a lambda construct. - (symbolp function) - (get function 'byte-obsolete-info))) - (use (car obsolete))) - (when obsolete - (princ "\nThis function is obsolete") - (when (nth 2 obsolete) - (insert (format " since %s" (nth 2 obsolete)))) - (insert (cond ((stringp use) (concat ";\n" use)) - (use (format ";\nuse `%s' instead." use)) - (t ".")) - "\n")) - (insert "\n" - (or doc "Not documented.")))))))) + (substitute-command-keys doc-raw)))) + + (help-fns--key-bindings function) + (with-current-buffer standard-output + (setq doc (help-fns--signature function doc real-def real-function)) + + (help-fns--compiler-macro function) + (help-fns--parent-mode function) + (help-fns--obsolete function) + + (insert "\n" + (or doc "Not documented."))))))) ;; Variables ------------------------------------------------------------ revno: 109477 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-06 17:05:25 -0400 message: Grammar fixes diff: === modified file 'ChangeLog' --- ChangeLog 2012-08-06 20:29:45 +0000 +++ ChangeLog 2012-08-06 21:05:25 +0000 @@ -8,7 +8,7 @@ 2012-08-05 Michael Albinus - * INSTALL: Explain, how to disable D-Bus at all. (Bug#12112) + * INSTALL: Explain how to completely disable D-Bus. (Bug#12112) 2012-08-05 Ulrich Müller === modified file 'INSTALL' --- INSTALL 2012-08-05 12:53:48 +0000 +++ INSTALL 2012-08-06 21:05:25 +0000 @@ -283,8 +283,8 @@ Emacs will autolaunch a D-Bus session bus, when the environment variable DISPLAY is set, but no session bus is running. This might be inconvenient for Emacs when running as daemon or running via a remote -ssh connection. In order to suppress D-Bus at all, configure Emacs -with the options `--without-dbus --without-gconf --without-gsettings'. +ssh connection. In order to completely prevent the use of D-Bus, configure +Emacs with the options `--without-dbus --without-gconf --without-gsettings'. The Emacs mail reader RMAIL is configured to be able to read mail from a POP3 server by default. Versions of the POP protocol older than ------------------------------------------------------------ revno: 109476 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-06 16:29:45 -0400 message: Guard against potential configure bug wrt HAVE_GETWD * configure.ac (BROKEN_GETWD) [unixware]: New define. * src/sysdep.c: Respect BROKEN_GETWD. diff: === modified file 'ChangeLog' --- ChangeLog 2012-08-06 20:22:22 +0000 +++ ChangeLog 2012-08-06 20:29:45 +0000 @@ -1,5 +1,7 @@ 2012-08-06 Glenn Morris + * configure.ac (BROKEN_GETWD) [unixware]: New define. + * configure.ac (GNU_LIBRARY_PENDING_OUTPUT_COUNT): Remove. (PENDING_OUTPUT_COUNT): Absorb GNU_LIBRARY_PENDING_OUTPUT_COUNT. (DISPNEW_NEEDS_STDIO_EXT): New define. === modified file 'configure.ac' --- configure.ac 2012-08-06 20:22:22 +0000 +++ configure.ac 2012-08-06 20:29:45 +0000 @@ -2724,10 +2724,11 @@ touchlock \ cfmakeraw cfsetspeed copysign __executable_start) -dnl FIXME Fragile: something else may test for getwd as a dependency. -dnl Change to defining BROKEN_xxx ? dnl getwd appears to be buggy on SVR4.2, so we don't use it. -if test $opsys != unixware; then +if test $opsys = unixware; then + dnl In case some other test ends up checking for getwd. + AC_DEFINE(BROKEN_GETWD, 1, [Define if getwd should not be used.]) +else AC_CHECK_FUNCS(getwd) fi === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-06 20:22:22 +0000 +++ src/ChangeLog 2012-08-06 20:29:45 +0000 @@ -1,5 +1,7 @@ 2012-08-06 Glenn Morris + * sysdep.c: Respect BROKEN_GETWD. + * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT): Let configure handle it. (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it. === modified file 'src/sysdep.c' --- src/sysdep.c 2012-08-06 11:16:07 +0000 +++ src/sysdep.c 2012-08-06 20:29:45 +0000 @@ -1971,7 +1971,7 @@ * under error conditions. */ -#ifndef HAVE_GETWD +#if !defined (HAVE_GETWD) || defined (BROKEN_GETWD) #ifndef MAXPATHLEN /* In 4.1, param.h fails to define this. */ @@ -2001,7 +2001,7 @@ return pathname; } -#endif /* HAVE_GETWD */ +#endif /* !defined (HAVE_GETWD) || defined (BROKEN_GETWD) */ /* * This function will go away as soon as all the stubs fixed. (fnf) ------------------------------------------------------------ revno: 109475 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-06 16:22:22 -0400 message: Remove GNU_LIBRARY_PENDING_OUTPUT_COUNT * configure.ac (GNU_LIBRARY_PENDING_OUTPUT_COUNT): Remove. (PENDING_OUTPUT_COUNT): Absorb GNU_LIBRARY_PENDING_OUTPUT_COUNT. (DISPNEW_NEEDS_STDIO_EXT): New define. * src/dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT): Let configure handle it. (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it. * nt/config.nt (GNU_LIBRARY_PENDING_OUTPUT_COUNT): Remove. (PENDING_OUTPUT_COUNT): Define it as dispnew.c used to. * admin/CPP-DEFINES (GNU_LIBRARY_PENDING_OUTPUT_COUNT): Remove. diff: === modified file 'ChangeLog' --- ChangeLog 2012-08-05 12:53:48 +0000 +++ ChangeLog 2012-08-06 20:22:22 +0000 @@ -1,3 +1,9 @@ +2012-08-06 Glenn Morris + + * configure.ac (GNU_LIBRARY_PENDING_OUTPUT_COUNT): Remove. + (PENDING_OUTPUT_COUNT): Absorb GNU_LIBRARY_PENDING_OUTPUT_COUNT. + (DISPNEW_NEEDS_STDIO_EXT): New define. + 2012-08-05 Michael Albinus * INSTALL: Explain, how to disable D-Bus at all. (Bug#12112) === modified file 'admin/CPP-DEFINES' --- admin/CPP-DEFINES 2012-08-02 06:47:17 +0000 +++ admin/CPP-DEFINES 2012-08-06 20:22:22 +0000 @@ -112,7 +112,6 @@ GC_MARK_STACK GC_SETJMP_WORKS GMALLOC_INHIBIT_VALLOC -GNU_LIBRARY_PENDING_OUTPUT_COUNT GNU_MALLOC HAVE_AIX_SMT_EXP HAVE_CBRT === modified file 'configure.ac' --- configure.ac 2012-08-05 05:00:52 +0000 +++ configure.ac 2012-08-06 20:22:22 +0000 @@ -3506,31 +3506,32 @@ dnl Used in dispnew.c AH_TEMPLATE(PENDING_OUTPUT_COUNT, [Number of chars of output in the -buffer of a stdio stream.]) - -dnl FIXME just PENDING_OUTPUT_COUNT should suffice. -AH_TEMPLATE(GNU_LIBRARY_PENDING_OUTPUT_COUNT, [Value of -PENDING_OUTPUT_COUNT if using the GNU C library.]) - -case $opsys in - cygwin | darwin | freebsd | netbsd | openbsd ) - AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->_p - (FILE)->_bf._base)]) - ;; - - unixware) - AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->__ptr - (FILE)->__base)]) - ;; - - gnu | gnu-linux | gnu-kfreebsd ) - AC_MSG_CHECKING([for style of pending output formalism]) - dnl In autoconf 2.67 and later, we could use a single test - dnl since the preprocessed output is accessible in "conftest.i". - AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ + buffer of a stdio stream.]) + +AC_MSG_CHECKING([whether we are using the GNU C library]) +AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ +#include +#ifndef __GNU_LIBRARY__ +# error "this is not the GNU C library" +#endif + ]], [[]])], emacs_glibc=yes, emacs_glibc=no) +AC_MSG_RESULT([$emacs_glibc]) + +if test $emacs_glibc = yes; then + + emacs_pending_output=unknown + + case $opsys in + gnu | gnu-linux | gnu-kfreebsd ) + AC_MSG_CHECKING([for style of pending output formalism]) + dnl In autoconf 2.67 and later, we could use a single test + dnl since the preprocessed output is accessible in "conftest.i". + AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ #include #if !defined (_IO_STDIO_H) && !defined (_STDIO_USES_IOSTREAM) # error "stdio definitions not found" #endif - ]], [[]])], emacs_pending_output=new, emacs_pending_output=unknown) + ]], [[]])], emacs_pending_output=new, []) if test $emacs_pending_output = unknown; then case $opsys in @@ -3550,22 +3551,51 @@ case $emacs_pending_output in new) dnl New C libio names. - AC_DEFINE(GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE), + AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)]) ;; uclibc) dnl Using the uClibc library. - AC_DEFINE(GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE), + AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->__bufpos - (FILE)->__bufstart)]) ;; old) dnl Old C++ iostream names. - AC_DEFINE(GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE), + AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->_pptr - (FILE)->_pbase)]) ;; esac ;; -esac + esac dnl opsys + + if test $emacs_pending_output = unknown; then + AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->__bufp - (FILE)->__buffer)]) + fi + +else dnl !emacs_glibc + + case $opsys in + cygwin | darwin | freebsd | netbsd | openbsd ) + AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->_p - (FILE)->_bf._base)]) + ;; + + unixware) + AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->__ptr - (FILE)->__base)]) + ;; + + *) + dnl HAVE_STDIO_EXT_H && HAVE___FPENDING + if test x$ac_cv_header_stdio_ext_h = xyes && \ + test x$ac_cv_func___fpending = xyes; then + AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [__fpending (FILE)]) + AC_DEFINE(DISPNEW_NEEDS_STDIO_EXT, 1, + [Define if dispnew.c should include stdio_ext.h.]) + else + AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->_ptr - (FILE)->_base)]) + fi + ;; + esac +fi dnl emacs_glibc dnl Used in vm-limit.c === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-08-04 14:17:10 +0000 +++ nt/ChangeLog 2012-08-06 20:22:22 +0000 @@ -1,3 +1,8 @@ +2012-08-06 Glenn Morris + + * config.nt (GNU_LIBRARY_PENDING_OUTPUT_COUNT): Remove. + (PENDING_OUTPUT_COUNT): Define it as dispnew.c used to. + 2012-08-04 Eli Zaretskii * paths.h (PATH_LOADSEARCH, PATH_SITELOADSEARCH, PATH_EXEC) === modified file 'nt/config.nt' --- nt/config.nt 2012-08-03 12:16:40 +0000 +++ nt/config.nt 2012-08-06 20:22:22 +0000 @@ -211,9 +211,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 @@ -1229,7 +1226,11 @@ #undef PACKAGE_VERSION /* Number of chars of output in the buffer of a stdio stream. */ -#undef PENDING_OUTPUT_COUNT +#ifdef __GNU_LIBRARY__ +#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->__bufp - (FILE)->__buffer) +#else +#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_ptr - (FILE)->_base) +#endif /* Define to empty to suppress deprecation warnings when building with --enable-gcc-warnings and with libpng versions before 1.5, which lack === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-06 16:55:46 +0000 +++ src/ChangeLog 2012-08-06 20:22:22 +0000 @@ -1,3 +1,9 @@ +2012-08-06 Glenn Morris + + * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT): + Let configure handle it. + (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it. + 2012-08-06 Dmitry Antipov Use GCALIGNMENT where appropriate. === modified file 'src/dispnew.c' --- src/dispnew.c 2012-08-06 10:24:26 +0000 +++ src/dispnew.c 2012-08-06 20:22:22 +0000 @@ -65,33 +65,10 @@ #include "systime.h" #include -/* Get number of chars of output now in the buffer of a stdio stream. - This ought to be built in stdio, but it isn't. Some s- files - override this because their stdio internals differ. */ -#ifdef __GNU_LIBRARY__ - -/* The s- file might have overridden the definition with one that - works for the system's C library. But we are using the GNU C - library, so this is the right definition for every system. */ -#ifdef GNU_LIBRARY_PENDING_OUTPUT_COUNT -#define PENDING_OUTPUT_COUNT GNU_LIBRARY_PENDING_OUTPUT_COUNT -#else -#undef PENDING_OUTPUT_COUNT -#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->__bufp - (FILE)->__buffer) -#endif - -/* not __GNU_LIBRARY__ and no PENDING_OUTPUT_COUNT defined */ -#elif !defined (PENDING_OUTPUT_COUNT) - -#if HAVE_STDIO_EXT_H && HAVE___FPENDING +#ifdef DISPNEW_NEEDS_STDIO_EXT #include -#define PENDING_OUTPUT_COUNT(FILE) __fpending (FILE) -#else -#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_ptr - (FILE)->_base) #endif -#endif /* not __GNU_LIBRARY__ and no PENDING_OUTPUT_COUNT defined */ - #if defined (HAVE_TERM_H) && defined (GNU_LINUX) #include /* for tgetent */ #endif ------------------------------------------------------------ revno: 109474 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12119 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2012-08-06 15:53:45 -0400 message: * lisp/emacs-lisp/cl-macs.el (cl--sm-macroexpand): Fix handling of re-binding a symbol that has a symbol-macro. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-06 07:31:31 +0000 +++ lisp/ChangeLog 2012-08-06 19:53:45 +0000 @@ -1,3 +1,8 @@ +2012-08-06 Stefan Monnier + + * emacs-lisp/cl-macs.el (cl--sm-macroexpand): Fix handling of + re-binding a symbol that has a symbol-macro (bug#12119). + 2012-08-06 Mohsen BANAN * language/persian.el: New file. (Bug#11812) === modified file 'lisp/emacs-lisp/cl-macs.el' --- lisp/emacs-lisp/cl-macs.el 2012-07-26 01:27:33 +0000 +++ lisp/emacs-lisp/cl-macs.el 2012-08-06 19:53:45 +0000 @@ -1668,31 +1668,86 @@ cl--old-macroexpand (symbol-function 'macroexpand))) -(defun cl--sm-macroexpand (cl-macro &optional cl-env) +(defun cl--sm-macroexpand (exp &optional env) "Special macro expander used inside `cl-symbol-macrolet'. This function replaces `macroexpand' during macro expansion of `cl-symbol-macrolet', and does the same thing as `macroexpand' except that it additionally expands symbol macros." - (let ((macroexpand-all-environment cl-env)) + (let ((macroexpand-all-environment env)) (while (progn - (setq cl-macro (funcall cl--old-macroexpand cl-macro cl-env)) - (cond - ((symbolp cl-macro) - ;; Perform symbol-macro expansion. - (when (cdr (assq (symbol-name cl-macro) cl-env)) - (setq cl-macro (cadr (assq (symbol-name cl-macro) cl-env))))) - ((eq 'setq (car-safe cl-macro)) - ;; Convert setq to setf if required by symbol-macro expansion. - (let* ((args (mapcar (lambda (f) (cl--sm-macroexpand f cl-env)) - (cdr cl-macro))) - (p args)) - (while (and p (symbolp (car p))) (setq p (cddr p))) - (if p (setq cl-macro (cons 'setf args)) - (setq cl-macro (cons 'setq args)) - ;; Don't loop further. - nil)))))) - cl-macro)) + (setq exp (funcall cl--old-macroexpand exp env)) + (pcase exp + ((pred symbolp) + ;; Perform symbol-macro expansion. + (when (cdr (assq (symbol-name exp) env)) + (setq exp (cadr (assq (symbol-name exp) env))))) + (`(setq . ,_) + ;; Convert setq to setf if required by symbol-macro expansion. + (let* ((args (mapcar (lambda (f) (cl--sm-macroexpand f env)) + (cdr exp))) + (p args)) + (while (and p (symbolp (car p))) (setq p (cddr p))) + (if p (setq exp (cons 'setf args)) + (setq exp (cons 'setq args)) + ;; Don't loop further. + nil))) + (`(,(or `let `let*) . ,(or `(,bindings . ,body) dontcare)) + ;; CL's symbol-macrolet treats re-bindings as candidates for + ;; expansion (turning the let into a letf if needed), contrary to + ;; Common-Lisp where such re-bindings hide the symbol-macro. + (let ((letf nil) (found nil) (nbs ())) + (dolist (binding bindings) + (let* ((var (if (symbolp binding) binding (car binding))) + (sm (assq (symbol-name var) env))) + (push (if (not (cdr sm)) + binding + (let ((nexp (cadr sm))) + (setq found t) + (unless (symbolp nexp) (setq letf t)) + (cons nexp (cdr-safe binding)))) + nbs))) + (when found + (setq exp `(,(if letf + (if (eq (car exp) 'let) 'cl-letf 'cl-letf*) + (car exp)) + ,(nreverse nbs) + ,@body))))) + ;; FIXME: The behavior of CL made sense in a dynamically scoped + ;; language, but for lexical scoping, Common-Lisp's behavior might + ;; make more sense (and indeed, CL behaves like Common-Lisp w.r.t + ;; lexical-let), so maybe we should adjust the behavior based on + ;; the use of lexical-binding. + ;; (`(,(or `let `let*) . ,(or `(,bindings . ,body) dontcare)) + ;; (let ((nbs ()) (found nil)) + ;; (dolist (binding bindings) + ;; (let* ((var (if (symbolp binding) binding (car binding))) + ;; (name (symbol-name var)) + ;; (val (and found (consp binding) (eq 'let* (car exp)) + ;; (list (macroexpand-all (cadr binding) + ;; env))))) + ;; (push (if (assq name env) + ;; ;; This binding should hide its symbol-macro, + ;; ;; but given the way macroexpand-all works, we + ;; ;; can't prevent application of `env' to the + ;; ;; sub-expressions, so we need to α-rename this + ;; ;; variable instead. + ;; (let ((nvar (make-symbol + ;; (copy-sequence name)))) + ;; (setq found t) + ;; (push (list name nvar) env) + ;; (cons nvar (or val (cdr-safe binding)))) + ;; (if val (cons var val) binding)) + ;; nbs))) + ;; (when found + ;; (setq exp `(,(car exp) + ;; ,(nreverse nbs) + ;; ,@(macroexp-unprogn + ;; (macroexpand-all (macroexp-progn body) + ;; env))))) + ;; nil)) + ))) + exp)) ;;;###autoload (defmacro cl-symbol-macrolet (bindings &rest body) ------------------------------------------------------------ revno: 109473 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2012-08-06 20:55:46 +0400 message: Use GCALIGNMENT where appropriate. * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size): (union aligned_Lisp_Symbol, union aligned_Lisp_Misc): (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-06 16:36:47 +0000 +++ src/ChangeLog 2012-08-06 16:55:46 +0000 @@ -1,3 +1,10 @@ +2012-08-06 Dmitry Antipov + + Use GCALIGNMENT where appropriate. + * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size): + (union aligned_Lisp_Symbol, union aligned_Lisp_Misc): + (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT. + 2012-08-06 Eli Zaretskii * w32menu.c (set_frame_menubar, initialize_frame_menubar): Don't === modified file 'src/alloc.c' --- src/alloc.c 2012-08-06 10:24:26 +0000 +++ src/alloc.c 2012-08-06 16:55:46 +0000 @@ -521,7 +521,7 @@ #if USE_LSB_TAG # define XMALLOC_HEADER_ALIGNMENT \ - COMMON_MULTIPLE (1 << GCTYPEBITS, XMALLOC_BASE_ALIGNMENT) + COMMON_MULTIPLE (GCALIGNMENT, XMALLOC_BASE_ALIGNMENT) #else # define XMALLOC_HEADER_ALIGNMENT XMALLOC_BASE_ALIGNMENT #endif @@ -2902,8 +2902,7 @@ /* Align allocation request sizes to be a multiple of ROUNDUP_SIZE. */ enum { - roundup_size = COMMON_MULTIPLE (word_size, - USE_LSB_TAG ? 1 << GCTYPEBITS : 1) + roundup_size = COMMON_MULTIPLE (word_size, USE_LSB_TAG ? GCALIGNMENT : 1) }; /* ROUNDUP_SIZE must be a power of 2. */ @@ -3457,8 +3456,8 @@ { struct Lisp_Symbol s; #if USE_LSB_TAG - unsigned char c[(sizeof (struct Lisp_Symbol) + (1 << GCTYPEBITS) - 1) - & -(1 << GCTYPEBITS)]; + unsigned char c[(sizeof (struct Lisp_Symbol) + GCALIGNMENT - 1) + & -GCALIGNMENT]; #endif }; @@ -3552,8 +3551,8 @@ { union Lisp_Misc m; #if USE_LSB_TAG - unsigned char c[(sizeof (union Lisp_Misc) + (1 << GCTYPEBITS) - 1) - & -(1 << GCTYPEBITS)]; + unsigned char c[(sizeof (union Lisp_Misc) + GCALIGNMENT - 1) + & -GCALIGNMENT]; #endif }; @@ -4563,9 +4562,9 @@ struct mem_node *m; /* Quickly rule out some values which can't point to Lisp data. - USE_LSB_TAG needs Lisp data to be aligned on multiples of 1 << GCTYPEBITS. + USE_LSB_TAG needs Lisp data to be aligned on multiples of GCALIGNMENT. Otherwise, assume that Lisp data is aligned on even addresses. */ - if ((intptr_t) p % (USE_LSB_TAG ? 1 << GCTYPEBITS : 2)) + if ((intptr_t) p % (USE_LSB_TAG ? GCALIGNMENT : 2)) return; m = mem_find (p); @@ -5080,7 +5079,7 @@ { void *result; #if USE_LSB_TAG - size_t alignment = (1 << GCTYPEBITS); + size_t alignment = GCALIGNMENT; #else size_t alignment = alignof (EMACS_INT); ------------------------------------------------------------ revno: 109472 committer: Eli Zaretskii branch nick: trunk timestamp: Mon 2012-08-06 19:36:47 +0300 message: Fix usage of FRAME_MENU_BAR_ITEMS in w32menu.c. src/w32menu.c (set_frame_menubar, initialize_frame_menubar): Don't use FRAME_MENU_BAR_ITEMS as an lvalue. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-06 16:22:43 +0000 +++ src/ChangeLog 2012-08-06 16:36:47 +0000 @@ -1,3 +1,8 @@ +2012-08-06 Eli Zaretskii + + * w32menu.c (set_frame_menubar, initialize_frame_menubar): Don't + use FRAME_MENU_BAR_ITEMS as an lvalue. + 2012-08-06 Stefan Monnier * buffer.h (struct buffer): Revert `indirections' to a simple int; === modified file 'src/w32menu.c' --- src/w32menu.c 2012-08-06 10:24:26 +0000 +++ src/w32menu.c 2012-08-06 16:36:47 +0000 @@ -413,7 +413,7 @@ /* Run the hooks. */ safe_run_hooks (Qactivate_menubar_hook); safe_run_hooks (Qmenu_bar_update_hook); - FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f)); + FSET (f, menu_bar_items, menu_bar_items (FRAME_MENU_BAR_ITEMS (f))); items = FRAME_MENU_BAR_ITEMS (f); @@ -615,7 +615,7 @@ { /* This function is called before the first chance to redisplay the frame. It has to be, so the frame will have the right size. */ - FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f)); + FSET (f, menu_bar_items, menu_bar_items (FRAME_MENU_BAR_ITEMS (f))); set_frame_menubar (f, 1, 1); } ------------------------------------------------------------ revno: 109471 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2012-08-06 12:22:43 -0400 message: * src/buffer.h (struct buffer): Revert `indirections' to a simple int; that should be sufficient for everyone. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-06 16:09:02 +0000 +++ src/ChangeLog 2012-08-06 16:22:43 +0000 @@ -1,3 +1,8 @@ +2012-08-06 Stefan Monnier + + * buffer.h (struct buffer): Revert `indirections' to a simple int; + that should be sufficient for everyone. + 2012-08-06 Jan Djärv * keyboard.c (timer_check_2): Add break so timer_check returns next === modified file 'src/buffer.h' --- src/buffer.h 2012-08-05 15:47:28 +0000 +++ src/buffer.h 2012-08-06 16:22:43 +0000 @@ -778,7 +778,7 @@ /* In an indirect buffer, this is -1. In an ordinary buffer, it's the number of indirect buffers that share our text; zero means that we're the only owner of this text. */ - ptrdiff_t indirections; + int indirections; /* A non-zero value in slot IDX means that per-buffer variable with index IDX has a local value in this buffer. The index IDX ------------------------------------------------------------ revno: 109470 committer: Jan D. branch nick: trunk timestamp: Mon 2012-08-06 18:09:02 +0200 message: * keyboard.c (timer_check_2): Add break so timer_check returns next timeout. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-06 15:45:27 +0000 +++ src/ChangeLog 2012-08-06 16:09:02 +0000 @@ -1,3 +1,8 @@ +2012-08-06 Jan Djärv + + * keyboard.c (timer_check_2): Add break so timer_check returns next + timeout. + 2012-08-06 Dmitry Antipov Fix Windows build errors introduced after converting to WGET and WSET. === modified file 'src/keyboard.c' --- src/keyboard.c 2012-08-06 10:24:26 +0000 +++ src/keyboard.c 2012-08-06 16:09:02 +0000 @@ -4459,6 +4459,7 @@ } nexttime = make_emacs_time (0, 0); + break; } else /* When we encounter a timer that is still waiting, ------------------------------------------------------------ revno: 109469 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2012-08-06 19:45:27 +0400 message: Fix Windows build errors introduced after converting to WGET and WSET. * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET. Reported by Andy Moreton . diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-06 12:54:54 +0000 +++ src/ChangeLog 2012-08-06 15:45:27 +0000 @@ -1,3 +1,9 @@ +2012-08-06 Dmitry Antipov + + Fix Windows build errors introduced after converting to WGET and WSET. + * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET. + Reported by Andy Moreton . + 2012-08-06 Jan Djärv * nsterm.m (ns_frame_rehighlight): Use FSET. === modified file 'src/w32term.c' --- src/w32term.c 2012-08-06 10:24:26 +0000 +++ src/w32term.c 2012-08-06 15:45:27 +0000 @@ -3684,6 +3684,7 @@ int portion, int whole, int position) { struct frame *f = XFRAME (WGET (w, frame)); + Lisp_Object barobj; struct scroll_bar *bar; int top, height, left, sb_left, width, sb_width; int window_y, window_height; @@ -3806,8 +3807,8 @@ bar->fringe_extended_p = fringe_extended_p ? Qt : Qnil; w32_set_scroll_bar_thumb (bar, portion, position, whole); - - XSETVECTOR (WGET (w, vertical_scroll_bar), bar); + XSETVECTOR (barobj, bar); + WSET (w, vertical_scroll_bar, barobj); } ------------------------------------------------------------ revno: 109468 committer: Jan Djärv branch nick: trunk timestamp: Mon 2012-08-06 14:54:54 +0200 message: Use FSET. * nsmenu.m (ns_update_menubar): Use FSET. * nsterm.m (ns_frame_rehighlight): Use FSET. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-06 11:16:07 +0000 +++ src/ChangeLog 2012-08-06 12:54:54 +0000 @@ -1,3 +1,9 @@ +2012-08-06 Jan Djärv + + * nsterm.m (ns_frame_rehighlight): Use FSET. + + * nsmenu.m (ns_update_menubar): Use FSET. + 2012-08-06 Dmitry Antipov Separate read and write access to Lisp_Object slots of Lisp_Process. === modified file 'src/nsmenu.m' --- src/nsmenu.m 2012-08-06 10:24:26 +0000 +++ src/nsmenu.m 2012-08-06 12:54:54 +0000 @@ -215,7 +215,7 @@ if (! NILP (Vlucid_menu_bar_dirty_flag)) call0 (Qrecompute_lucid_menubar); safe_run_hooks (Qmenu_bar_update_hook); - FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f)); + FSET (f, menu_bar_items, menu_bar_items (FRAME_MENU_BAR_ITEMS (f))); /* Now ready to go */ items = FRAME_MENU_BAR_ITEMS (f); === modified file 'src/nsterm.m' --- src/nsterm.m 2012-08-06 10:24:26 +0000 +++ src/nsterm.m 2012-08-06 12:54:54 +0000 @@ -1018,7 +1018,7 @@ : dpyinfo->x_focus_frame); if (!FRAME_LIVE_P (dpyinfo->x_highlight_frame)) { - FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame) = Qnil; + FSET (dpyinfo->x_focus_frame, focus_frame, Qnil); dpyinfo->x_highlight_frame = dpyinfo->x_focus_frame; } } ------------------------------------------------------------ revno: 109467 author: Julien Danjou committer: Katsumi Yamaoka branch nick: trunk timestamp: Mon 2012-08-06 11:56:36 +0000 message: gnus-demon.el (gnus-demon-add-handler, gnus-demon-remove-handler): Remove autoload diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-08-05 22:02:24 +0000 +++ lisp/gnus/ChangeLog 2012-08-06 11:56:36 +0000 @@ -1,3 +1,8 @@ +2012-08-06 Julien Danjou + + * gnus-demon.el (gnus-demon-add-handler, gnus-demon-remove-handler): + Remove autoload, already handled by gnus.el. + 2012-08-05 Julien Danjou * gnus-demon.el (gnus-demon-add-handler, gnus-demon-remove-handler): === modified file 'lisp/gnus/gnus-demon.el' --- lisp/gnus/gnus-demon.el 2012-08-05 22:02:24 +0000 +++ lisp/gnus/gnus-demon.el 2012-08-06 11:56:36 +0000 @@ -77,7 +77,6 @@ ;;; Functions. -;;;###autoload (defun gnus-demon-add-handler (function time idle) "Add the handler FUNCTION to be run at TIME and IDLE." ;; First remove any old handlers that use this function. @@ -86,7 +85,6 @@ (push (list function time idle) gnus-demon-handlers) (gnus-demon-init)) -;;;###autoload (defun gnus-demon-remove-handler (function &optional no-init) "Remove the handler FUNCTION from the list of handlers." (gnus-alist-pull function gnus-demon-handlers) ------------------------------------------------------------ revno: 109466 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2012-08-06 15:16:07 +0400 message: Separate read and write access to Lisp_Object slots of Lisp_Process. * process.h (PGET, PSET): New macros similar to AREF and ASET. * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-06 10:24:26 +0000 +++ src/ChangeLog 2012-08-06 11:16:07 +0000 @@ -1,5 +1,11 @@ 2012-08-06 Dmitry Antipov + Separate read and write access to Lisp_Object slots of Lisp_Process. + * process.h (PGET, PSET): New macros similar to AREF and ASET. + * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users. + +2012-08-06 Dmitry Antipov + Separate read and write access to Lisp_Object slots of struct window. * window.h (WGET, WSET): New macros similar to AREF and ASET. * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c: === modified file 'src/gnutls.c' --- src/gnutls.c 2012-07-11 07:20:14 +0000 +++ src/gnutls.c 2012-08-06 11:16:07 +0000 @@ -830,7 +830,7 @@ XPROCESS (proc)->gnutls_state = NULL; XPROCESS (proc)->gnutls_x509_cred = NULL; XPROCESS (proc)->gnutls_anon_cred = NULL; - XPROCESS (proc)->gnutls_cred_type = type; + PSET (XPROCESS (proc), gnutls_cred_type, type); GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_EMPTY; GNUTLS_LOG (1, max_log_level, "allocating credentials"); === modified file 'src/print.c' --- src/print.c 2012-08-06 10:24:26 +0000 +++ src/print.c 2012-08-06 11:16:07 +0000 @@ -1697,11 +1697,11 @@ if (escapeflag) { strout ("#'); } else - print_string (PVAR (XPROCESS (obj), name), printcharfun); + print_string (PGET (XPROCESS (obj), name), printcharfun); } else if (BOOL_VECTOR_P (obj)) { === modified file 'src/process.c' --- src/process.c 2012-08-02 04:14:48 +0000 +++ src/process.c 2012-08-06 11:16:07 +0000 @@ -172,10 +172,10 @@ /* QCfilter is defined in keyboard.c. */ extern Lisp_Object QCfilter; -#define NETCONN_P(p) (EQ (PVAR (XPROCESS (p), type), Qnetwork)) -#define NETCONN1_P(p) (EQ (PVAR (p, type), Qnetwork)) -#define SERIALCONN_P(p) (EQ (PVAR (XPROCESS (p), type), Qserial)) -#define SERIALCONN1_P(p) (EQ (PVAR (p, type), Qserial)) +#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)) #ifndef HAVE_H_ERRNO extern int h_errno; @@ -428,7 +428,7 @@ update_status (struct Lisp_Process *p) { eassert (p->raw_status_new); - PVAR (p, status) = status_convert (p->raw_status); + PSET (p, status, status_convert (p->raw_status)); p->raw_status_new = 0; } @@ -479,7 +479,7 @@ static Lisp_Object status_message (struct Lisp_Process *p) { - Lisp_Object status = PVAR (p, status); + Lisp_Object status = PGET (p, status); Lisp_Object symbol; int code, coredump; Lisp_Object string, string2; @@ -626,8 +626,8 @@ p = allocate_process (); /* Initialize Lisp data. Note that allocate_process initializes all Lisp data to nil, so do it only for slots which should not be nil. */ - PVAR (p, status) = Qrun; - PVAR (p, mark) = Fmake_marker (); + PSET (p, status, Qrun); + PSET (p, mark, Fmake_marker ()); /* Initialize non-Lisp data. Note that allocate_process zeroes out all non-Lisp data, so do it only for slots which should not be zero. */ @@ -648,7 +648,7 @@ name1 = concat2 (name, make_formatted_string (suffix, "<%"pMd">", i)); } name = name1; - PVAR (p, name) = name; + PSET (p, name, name); XSETPROCESS (val, p); Vprocess_alist = Fcons (Fcons (name, val), Vprocess_alist); return val; @@ -745,7 +745,7 @@ p->raw_status_new = 0; if (NETCONN1_P (p) || SERIALCONN1_P (p)) { - PVAR (p, status) = Fcons (Qexit, Fcons (make_number (0), Qnil)); + PSET (p, status, Fcons (Qexit, Fcons (make_number (0), Qnil))); p->tick = ++process_tick; status_notify (p); redisplay_preserve_echo_area (13); @@ -763,9 +763,9 @@ /* If the process has already signaled, remove it from the list. */ if (p->raw_status_new) update_status (p); - symbol = PVAR (p, status); - if (CONSP (PVAR (p, status))) - symbol = XCAR (PVAR (p, status)); + symbol = PGET (p, status); + if (CONSP (PGET (p, status))) + symbol = XCAR (PGET (p, status)); if (EQ (symbol, Qsignal) || EQ (symbol, Qexit)) deleted_pid_list = Fdelete (make_fixnum_or_float (pid), deleted_pid_list); @@ -774,8 +774,7 @@ { Fkill_process (process, Qnil); /* Do this now, since remove_process will make sigchld_handler do nothing. */ - PVAR (p, status) - = Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil)); + PSET (p, status, Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil))); p->tick = ++process_tick; status_notify (p); redisplay_preserve_echo_area (13); @@ -816,14 +815,14 @@ p = XPROCESS (process); if (p->raw_status_new) update_status (p); - status = PVAR (p, status); + status = PGET (p, status); if (CONSP (status)) status = XCAR (status); if (NETCONN1_P (p) || SERIALCONN1_P (p)) { if (EQ (status, Qexit)) status = Qclosed; - else if (EQ (PVAR (p, command), Qt)) + else if (EQ (PGET (p, command), Qt)) status = Qstop; else if (EQ (status, Qrun)) status = Qopen; @@ -840,8 +839,8 @@ CHECK_PROCESS (process); if (XPROCESS (process)->raw_status_new) update_status (XPROCESS (process)); - if (CONSP (PVAR (XPROCESS (process), status))) - return XCAR (XCDR (PVAR (XPROCESS (process), status))); + if (CONSP (PGET (XPROCESS (process), status))) + return XCAR (XCDR (PGET (XPROCESS (process), status))); return make_number (0); } @@ -865,7 +864,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return PVAR (XPROCESS (process), name); + return PGET (XPROCESS (process), name); } DEFUN ("process-command", Fprocess_command, Sprocess_command, 1, 1, 0, @@ -877,7 +876,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return PVAR (XPROCESS (process), command); + return PGET (XPROCESS (process), command); } DEFUN ("process-tty-name", Fprocess_tty_name, Sprocess_tty_name, 1, 1, 0, @@ -887,7 +886,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return PVAR (XPROCESS (process), tty_name); + return PGET (XPROCESS (process), tty_name); } DEFUN ("set-process-buffer", Fset_process_buffer, Sset_process_buffer, @@ -902,9 +901,9 @@ if (!NILP (buffer)) CHECK_BUFFER (buffer); p = XPROCESS (process); - PVAR (p, buffer) = buffer; + PSET (p, buffer, buffer); if (NETCONN1_P (p) || SERIALCONN1_P (p)) - PVAR (p, childp) = Fplist_put (PVAR (p, childp), QCbuffer, buffer); + PSET (p, childp, Fplist_put (PGET (p, childp), QCbuffer, buffer)); setup_process_coding_systems (process); return buffer; } @@ -916,7 +915,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return PVAR (XPROCESS (process), buffer); + return PGET (XPROCESS (process), buffer); } DEFUN ("process-mark", Fprocess_mark, Sprocess_mark, @@ -925,7 +924,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return PVAR (XPROCESS (process), mark); + return PGET (XPROCESS (process), mark); } DEFUN ("set-process-filter", Fset_process_filter, Sset_process_filter, @@ -961,23 +960,23 @@ if (p->infd >= 0) { - if (EQ (filter, Qt) && !EQ (PVAR (p, status), Qlisten)) + if (EQ (filter, Qt) && !EQ (PGET (p, status), Qlisten)) { FD_CLR (p->infd, &input_wait_mask); FD_CLR (p->infd, &non_keyboard_wait_mask); } - else if (EQ (PVAR (p, filter), Qt) + else if (EQ (PGET (p, filter), Qt) /* Network or serial process not stopped: */ - && !EQ (PVAR (p, command), Qt)) + && !EQ (PGET (p, command), Qt)) { FD_SET (p->infd, &input_wait_mask); FD_SET (p->infd, &non_keyboard_wait_mask); } } - PVAR (p, filter) = filter; + PSET (p, filter, filter); if (NETCONN1_P (p) || SERIALCONN1_P (p)) - PVAR (p, childp) = Fplist_put (PVAR (p, childp), QCfilter, filter); + PSET (p, childp, Fplist_put (PGET (p, childp), QCfilter, filter)); setup_process_coding_systems (process); return filter; } @@ -989,7 +988,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return PVAR (XPROCESS (process), filter); + return PGET (XPROCESS (process), filter); } DEFUN ("set-process-sentinel", Fset_process_sentinel, Sset_process_sentinel, @@ -1004,9 +1003,9 @@ CHECK_PROCESS (process); p = XPROCESS (process); - PVAR (p, sentinel) = sentinel; + PSET (p, sentinel, sentinel); if (NETCONN1_P (p) || SERIALCONN1_P (p)) - PVAR (p, childp) = Fplist_put (PVAR (p, childp), QCsentinel, sentinel); + PSET (p, childp, Fplist_put (PGET (p, childp), QCsentinel, sentinel)); return sentinel; } @@ -1017,7 +1016,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return PVAR (XPROCESS (process), sentinel); + return PGET (XPROCESS (process), sentinel); } DEFUN ("set-process-window-size", Fset_process_window_size, @@ -1102,7 +1101,7 @@ Lisp_Object contact; CHECK_PROCESS (process); - contact = PVAR (XPROCESS (process), childp); + contact = PGET (XPROCESS (process), childp); #ifdef DATAGRAM_SOCKETS if (DATAGRAM_CONN_P (process) @@ -1128,7 +1127,7 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return PVAR (XPROCESS (process), plist); + return PGET (XPROCESS (process), plist); } DEFUN ("set-process-plist", Fset_process_plist, Sset_process_plist, @@ -1139,7 +1138,7 @@ CHECK_PROCESS (process); CHECK_LIST (plist); - PVAR (XPROCESS (process), plist) = plist; + PSET (XPROCESS (process), plist, plist); return plist; } @@ -1151,7 +1150,7 @@ a socket connection. */) (Lisp_Object process) { - return PVAR (XPROCESS (process), type); + return PGET (XPROCESS (process), type); } #endif @@ -1164,7 +1163,7 @@ { Lisp_Object proc; proc = get_process (process); - return PVAR (XPROCESS (proc), type); + return PGET (XPROCESS (proc), type); } DEFUN ("format-network-address", Fformat_network_address, Sformat_network_address, @@ -1325,18 +1324,18 @@ itself; it's all taken care of here. */ record_unwind_protect (start_process_unwind, proc); - PVAR (XPROCESS (proc), childp) = Qt; - PVAR (XPROCESS (proc), plist) = Qnil; - PVAR (XPROCESS (proc), type) = Qreal; - PVAR (XPROCESS (proc), buffer) = buffer; - PVAR (XPROCESS (proc), sentinel) = Qnil; - PVAR (XPROCESS (proc), filter) = Qnil; - PVAR (XPROCESS (proc), command) = Flist (nargs - 2, args + 2); + PSET (XPROCESS (proc), childp, Qt); + PSET (XPROCESS (proc), plist, Qnil); + PSET (XPROCESS (proc), type, Qreal); + PSET (XPROCESS (proc), buffer, buffer); + PSET (XPROCESS (proc), sentinel, Qnil); + PSET (XPROCESS (proc), filter, Qnil); + PSET (XPROCESS (proc), command, Flist (nargs - 2, args + 2)); #ifdef HAVE_GNUTLS /* AKA GNUTLS_INITSTAGE(proc). */ XPROCESS (proc)->gnutls_initstage = GNUTLS_STAGE_EMPTY; - XPROCESS (proc)->gnutls_cred_type = Qnil; + PSET (XPROCESS (proc), gnutls_cred_type, Qnil); #endif #ifdef ADAPTIVE_READ_BUFFERING @@ -1347,7 +1346,7 @@ /* Make the process marker point into the process buffer (if any). */ if (BUFFERP (buffer)) - set_marker_both (PVAR (XPROCESS (proc), mark), buffer, + set_marker_both (PGET (XPROCESS (proc), mark), buffer, BUF_ZV (XBUFFER (buffer)), BUF_ZV_BYTE (XBUFFER (buffer))); @@ -1376,7 +1375,7 @@ else if (CONSP (Vdefault_process_coding_system)) val = XCAR (Vdefault_process_coding_system); } - PVAR (XPROCESS (proc), decode_coding_system) = val; + PSET (XPROCESS (proc), decode_coding_system, val); val = Vcoding_system_for_write; if (NILP (val)) @@ -1396,7 +1395,7 @@ else if (CONSP (Vdefault_process_coding_system)) val = XCDR (Vdefault_process_coding_system); } - PVAR (XPROCESS (proc), encode_coding_system) = val; + PSET (XPROCESS (proc), encode_coding_system, val); /* Note: At this moment, the above coding system may leave text-conversion or eol-conversion unspecified. They will be decided after we read output from the process and decode it by @@ -1405,9 +1404,9 @@ } - PVAR (XPROCESS (proc), decoding_buf) = empty_unibyte_string; + PSET (XPROCESS (proc), decoding_buf, empty_unibyte_string); XPROCESS (proc)->decoding_carryover = 0; - PVAR (XPROCESS (proc), encoding_buf) = empty_unibyte_string; + PSET (XPROCESS (proc), encoding_buf, empty_unibyte_string); XPROCESS (proc)->inherit_coding_system_flag = !(NILP (buffer) || !inherit_process_coding_system); @@ -1465,7 +1464,7 @@ { if (NILP (arg_encoding)) arg_encoding = (complement_process_encoding_system - (PVAR (XPROCESS (proc), encode_coding_system))); + (PGET (XPROCESS (proc), encode_coding_system))); XSETCAR (tem, code_convert_string_norecord (XCAR (tem), arg_encoding, 1)); @@ -1629,7 +1628,7 @@ more portable (see USG_SUBTTY_WORKS above). */ XPROCESS (process)->pty_flag = pty_flag; - PVAR (XPROCESS (process), status) = Qrun; + PSET (XPROCESS (process), status, Qrun); /* Delay interrupts until we have a chance to store the new fork's pid in its process structure */ @@ -1868,10 +1867,10 @@ #ifdef HAVE_PTYS if (pty_flag) - PVAR (XPROCESS (process), tty_name) = build_string (pty_name); + PSET (XPROCESS (process), tty_name, build_string (pty_name)); else #endif - PVAR (XPROCESS (process), tty_name) = Qnil; + PSET (XPROCESS (process), tty_name, Qnil); #if !defined (WINDOWSNT) && defined (FD_CLOEXEC) /* Wait for child_setup to complete in case that vfork is @@ -1966,7 +1965,7 @@ more portable (see USG_SUBTTY_WORKS above). */ XPROCESS (process)->pty_flag = pty_flag; - PVAR (XPROCESS (process), status) = Qrun; + PSET (XPROCESS (process), status, Qrun); setup_process_coding_systems (process); FD_SET (inchannel, &input_wait_mask); @@ -1977,10 +1976,10 @@ XPROCESS (process)->pid = -2; #ifdef HAVE_PTYS if (pty_flag) - PVAR (XPROCESS (process), tty_name) = build_string (pty_name); + PSET (XPROCESS (process), tty_name, build_string (pty_name)); else #endif - PVAR (XPROCESS (process), tty_name) = Qnil; + PSET (XPROCESS (process), tty_name, Qnil); } @@ -2369,7 +2368,7 @@ if (set_socket_option (s, option, value)) { - PVAR (p, childp) = Fplist_put (PVAR (p, childp), option, value); + PSET (p, childp, Fplist_put (PGET (p, childp), option, value)); return Qt; } @@ -2458,10 +2457,10 @@ proc = Fplist_get (contact, QCport); proc = get_process (proc); p = XPROCESS (proc); - if (!EQ (PVAR (p, type), Qserial)) + if (!EQ (PGET (p, type), Qserial)) error ("Not a serial process"); - if (NILP (Fplist_get (PVAR (p, childp), QCspeed))) + if (NILP (Fplist_get (PGET (p, childp), QCspeed))) { UNGCPRO; return Qnil; @@ -2602,21 +2601,21 @@ if (NILP (buffer)) buffer = name; buffer = Fget_buffer_create (buffer); - PVAR (p, buffer) = buffer; + PSET (p, buffer, buffer); - PVAR (p, childp) = contact; - PVAR (p, plist) = Fcopy_sequence (Fplist_get (contact, QCplist)); - PVAR (p, type) = Qserial; - PVAR (p, sentinel) = Fplist_get (contact, QCsentinel); - PVAR (p, filter) = Fplist_get (contact, QCfilter); - PVAR (p, log) = Qnil; + PSET (p, childp, contact); + PSET (p, plist, Fcopy_sequence (Fplist_get (contact, QCplist))); + PSET (p, type, Qserial); + PSET (p, sentinel, Fplist_get (contact, QCsentinel)); + PSET (p, filter, Fplist_get (contact, QCfilter)); + PSET (p, log, Qnil); if (tem = Fplist_get (contact, QCnoquery), !NILP (tem)) p->kill_without_query = 1; if (tem = Fplist_get (contact, QCstop), !NILP (tem)) - PVAR (p, command) = Qt; + PSET (p, command, Qt); p->pty_flag = 0; - if (!EQ (PVAR (p, command), Qt)) + if (!EQ (PGET (p, command), Qt)) { FD_SET (fd, &input_wait_mask); FD_SET (fd, &non_keyboard_wait_mask); @@ -2624,7 +2623,7 @@ if (BUFFERP (buffer)) { - set_marker_both (PVAR (p, mark), buffer, + set_marker_both (PGET (p, mark), buffer, BUF_ZV (XBUFFER (buffer)), BUF_ZV_BYTE (XBUFFER (buffer))); } @@ -2645,7 +2644,7 @@ else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer), enable_multibyte_characters))) || (NILP (buffer) && NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))) val = Qnil; - PVAR (p, decode_coding_system) = val; + PSET (p, decode_coding_system, val); val = Qnil; if (!NILP (tem)) @@ -2659,12 +2658,12 @@ else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer), enable_multibyte_characters))) || (NILP (buffer) && NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))) val = Qnil; - PVAR (p, encode_coding_system) = val; + PSET (p, encode_coding_system, val); setup_process_coding_systems (proc); - PVAR (p, decoding_buf) = empty_unibyte_string; + PSET (p, decoding_buf, empty_unibyte_string); p->decoding_carryover = 0; - PVAR (p, encoding_buf) = empty_unibyte_string; + PSET (p, encoding_buf, empty_unibyte_string); p->inherit_coding_system_flag = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system); @@ -3401,27 +3400,27 @@ p = XPROCESS (proc); - PVAR (p, childp) = contact; - PVAR (p, plist) = Fcopy_sequence (Fplist_get (contact, QCplist)); - PVAR (p, type) = Qnetwork; + PSET (p, childp, contact); + PSET (p, plist, Fcopy_sequence (Fplist_get (contact, QCplist))); + PSET (p, type, Qnetwork); - PVAR (p, buffer) = buffer; - PVAR (p, sentinel) = sentinel; - PVAR (p, filter) = filter; - PVAR (p, log) = Fplist_get (contact, QClog); + PSET (p, buffer, buffer); + PSET (p, sentinel, sentinel); + PSET (p, filter, filter); + PSET (p, log, Fplist_get (contact, QClog)); if (tem = Fplist_get (contact, QCnoquery), !NILP (tem)) p->kill_without_query = 1; if ((tem = Fplist_get (contact, QCstop), !NILP (tem))) - PVAR (p, command) = Qt; + PSET (p, command, Qt); p->pid = 0; p->infd = inch; p->outfd = outch; if (is_server && socktype != SOCK_DGRAM) - PVAR (p, status) = Qlisten; + PSET (p, status, Qlisten); /* Make the process marker point into the process buffer (if any). */ if (BUFFERP (buffer)) - set_marker_both (PVAR (p, mark), buffer, + set_marker_both (PGET (p, mark), buffer, BUF_ZV (XBUFFER (buffer)), BUF_ZV_BYTE (XBUFFER (buffer))); @@ -3431,7 +3430,7 @@ /* We may get here if connect did succeed immediately. However, in that case, we still need to signal this like a non-blocking connection. */ - PVAR (p, status) = Qconnect; + PSET (p, status, Qconnect); if (!FD_ISSET (inch, &connect_wait_mask)) { FD_SET (inch, &connect_wait_mask); @@ -3443,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 (PVAR (p, filter), Qt) && !EQ (PVAR (p, command), Qt)) - || (EQ (PVAR (p, status), Qlisten) && NILP (PVAR (p, command)))) + if ((!EQ (PGET (p, filter), Qt) && !EQ (PGET (p, command), Qt)) + || (EQ (PGET (p, status), Qlisten) && NILP (PGET (p, command)))) { FD_SET (inch, &input_wait_mask); FD_SET (inch, &non_keyboard_wait_mask); @@ -3498,7 +3497,7 @@ else val = Qnil; } - PVAR (p, decode_coding_system) = val; + PSET (p, decode_coding_system, val); if (!NILP (tem)) { @@ -3532,13 +3531,13 @@ else val = Qnil; } - PVAR (p, encode_coding_system) = val; + PSET (p, encode_coding_system, val); } setup_process_coding_systems (proc); - PVAR (p, decoding_buf) = empty_unibyte_string; + PSET (p, decoding_buf, empty_unibyte_string); p->decoding_carryover = 0; - PVAR (p, encoding_buf) = empty_unibyte_string; + PSET (p, encoding_buf, empty_unibyte_string); p->inherit_coding_system_flag = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system); @@ -4031,8 +4030,8 @@ return; #endif - if (!NILP (PVAR (ps, log))) - call3 (PVAR (ps, log), server, Qnil, + if (!NILP (PGET (ps, log))) + call3 (PGET (ps, log), server, Qnil, concat3 (build_string ("accept failed with code"), Fnumber_to_string (make_number (code)), build_string ("\n"))); @@ -4102,15 +4101,15 @@ process name of the server process concatenated with the caller identification. */ - if (!NILP (PVAR (ps, filter)) && !EQ (PVAR (ps, filter), Qt)) + if (!NILP (PGET (ps, filter)) && !EQ (PGET (ps, filter), Qt)) buffer = Qnil; else { - buffer = PVAR (ps, buffer); + buffer = PGET (ps, buffer); if (!NILP (buffer)) buffer = Fbuffer_name (buffer); else - buffer = PVAR (ps, name); + buffer = PGET (ps, name); if (!NILP (buffer)) { buffer = concat2 (buffer, caller); @@ -4121,7 +4120,7 @@ /* Generate a unique name for the new server process. Combine the server process name with the caller identification. */ - name = concat2 (PVAR (ps, name), caller); + name = concat2 (PGET (ps, name), caller); proc = make_process (name); chan_process[s] = proc; @@ -4137,7 +4136,7 @@ p = XPROCESS (proc); /* Build new contact information for this setup. */ - contact = Fcopy_sequence (PVAR (ps, childp)); + contact = Fcopy_sequence (PGET (ps, childp)); contact = Fplist_put (contact, QCserver, Qnil); contact = Fplist_put (contact, QChost, host); if (!NILP (service)) @@ -4151,21 +4150,21 @@ conv_sockaddr_to_lisp (&saddr.sa, len)); #endif - PVAR (p, childp) = contact; - PVAR (p, plist) = Fcopy_sequence (PVAR (ps, plist)); - PVAR (p, type) = Qnetwork; + PSET (p, childp, contact); + PSET (p, plist, Fcopy_sequence (PGET (ps, plist))); + PSET (p, type, Qnetwork); - PVAR (p, buffer) = buffer; - PVAR (p, sentinel) = PVAR (ps, sentinel); - PVAR (p, filter) = PVAR (ps, filter); - PVAR (p, command) = Qnil; + PSET (p, buffer, buffer); + PSET (p, sentinel, PGET (ps, sentinel)); + PSET (p, filter, PGET (ps, filter)); + PSET (p, command, Qnil); p->pid = 0; p->infd = s; p->outfd = s; - PVAR (p, status) = Qrun; + PSET (p, status, Qrun); /* Client processes for accepted connections are not stopped initially. */ - if (!EQ (PVAR (p, filter), Qt)) + if (!EQ (PGET (p, filter), Qt)) { FD_SET (s, &input_wait_mask); FD_SET (s, &non_keyboard_wait_mask); @@ -4179,24 +4178,24 @@ of the new process should reflect the settings at the time the server socket was opened; not the current settings. */ - PVAR (p, decode_coding_system) = PVAR (ps, decode_coding_system); - PVAR (p, encode_coding_system) = PVAR (ps, encode_coding_system); + PSET (p, decode_coding_system, PGET (ps, decode_coding_system)); + PSET (p, encode_coding_system, PGET (ps, encode_coding_system)); setup_process_coding_systems (proc); - PVAR (p, decoding_buf) = empty_unibyte_string; + PSET (p, decoding_buf, empty_unibyte_string); p->decoding_carryover = 0; - PVAR (p, encoding_buf) = empty_unibyte_string; + PSET (p, encoding_buf, empty_unibyte_string); p->inherit_coding_system_flag = (NILP (buffer) ? 0 : ps->inherit_coding_system_flag); - if (!NILP (PVAR (ps, log))) - call3 (PVAR (ps, log), server, proc, + if (!NILP (PGET (ps, log))) + call3 (PGET (ps, log), server, proc, concat3 (build_string ("accept from "), (STRINGP (host) ? host : build_string ("-")), build_string ("\n"))); - if (!NILP (PVAR (p, sentinel))) + if (!NILP (PGET (p, sentinel))) exec_sentinel (proc, concat3 (build_string ("open from "), (STRINGP (host) ? host : build_string ("-")), @@ -4287,8 +4286,8 @@ FD_ZERO (&Writeok); if (time_limit == 0 && nsecs == 0 && wait_proc && !NILP (Vinhibit_quit) - && !(CONSP (PVAR (wait_proc, status)) - && EQ (XCAR (PVAR (wait_proc, status)), Qexit))) + && !(CONSP (PGET (wait_proc, status)) + && EQ (XCAR (PGET (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. */ @@ -4461,8 +4460,8 @@ if (wait_proc && wait_proc->raw_status_new) update_status (wait_proc); if (wait_proc - && ! EQ (PVAR (wait_proc, status), Qrun) - && ! EQ (PVAR (wait_proc, status), Qconnect)) + && ! EQ (PGET (wait_proc, status), Qrun) + && ! EQ (PGET (wait_proc, status), Qconnect)) { int nread, total_nread = 0; @@ -4821,7 +4820,7 @@ continue; /* If this is a server stream socket, accept connection. */ - if (EQ (PVAR (XPROCESS (proc), status), Qlisten)) + if (EQ (PGET (XPROCESS (proc), status), Qlisten)) { server_accept_connection (proc, channel); continue; @@ -4890,7 +4889,7 @@ waitpid() will not find the process object to delete. Do it here. */ p->tick = ++process_tick; - PVAR (p, status) = Qfailed; + PSET (p, status, Qfailed); } else kill (getpid (), SIGCHLD); @@ -4909,9 +4908,9 @@ deactivate_process (proc); if (XPROCESS (proc)->raw_status_new) update_status (XPROCESS (proc)); - if (EQ (PVAR (XPROCESS (proc), status), Qrun)) - PVAR (XPROCESS (proc), status) - = Fcons (Qexit, Fcons (make_number (256), Qnil)); + if (EQ (PGET (XPROCESS (proc), status), Qrun)) + PSET (XPROCESS (proc), status, + Fcons (Qexit, Fcons (make_number (256), Qnil))); } } #ifdef NON_BLOCKING_CONNECT @@ -4959,18 +4958,18 @@ if (xerrno) { p->tick = ++process_tick; - PVAR (p, status) - = Fcons (Qfailed, Fcons (make_number (xerrno), Qnil)); + PSET (p, status, + Fcons (Qfailed, Fcons (make_number (xerrno), Qnil))); deactivate_process (proc); } else { - PVAR (p, status) = Qrun; + PSET (p, status, Qrun); /* Execute the sentinel here. If we had relied on 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 (PVAR (p, filter), Qt) && !EQ (PVAR (p, command), Qt)) + if (!EQ (PGET (p, filter), Qt) && !EQ (PGET (p, command), Qt)) { FD_SET (p->infd, &input_wait_mask); FD_SET (p->infd, &non_keyboard_wait_mask); @@ -5042,7 +5041,7 @@ chars = alloca (carryover + readmax); if (carryover) /* See the comment above. */ - memcpy (chars, SDATA (PVAR (p, decoding_buf)), carryover); + memcpy (chars, SDATA (PGET (p, decoding_buf)), carryover); #ifdef DATAGRAM_SOCKETS /* We have a working select, so proc_buffered_char is always -1. */ @@ -5121,7 +5120,7 @@ record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); /* Read and dispose of the process output. */ - outstream = PVAR (p, filter); + outstream = PGET (p, filter); if (!NILP (outstream)) { Lisp_Object text; @@ -5163,9 +5162,9 @@ text = coding->dst_object; Vlast_coding_system_used = CODING_ID_NAME (coding->id); /* A new coding system might be found. */ - if (!EQ (PVAR (p, decode_coding_system), Vlast_coding_system_used)) + if (!EQ (PGET (p, decode_coding_system), Vlast_coding_system_used)) { - PVAR (p, decode_coding_system) = Vlast_coding_system_used; + PSET (p, decode_coding_system, Vlast_coding_system_used); /* Don't call setup_coding_system for proc_decode_coding_system[channel] here. It is done in @@ -5178,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 (PVAR (p, encode_coding_system)) + if (NILP (PGET (p, encode_coding_system)) && proc_encode_coding_system[p->outfd]) { - PVAR (p, encode_coding_system) - = coding_inherit_eol_type (Vlast_coding_system_used, Qnil); - setup_coding_system (PVAR (p, encode_coding_system), + PSET (p, encode_coding_system, + coding_inherit_eol_type (Vlast_coding_system_used, Qnil)); + setup_coding_system (PGET (p, encode_coding_system), proc_encode_coding_system[p->outfd]); } } if (coding->carryover_bytes > 0) { - if (SCHARS (PVAR (p, decoding_buf)) < coding->carryover_bytes) - PVAR (p, decoding_buf) = make_uninit_string (coding->carryover_bytes); - memcpy (SDATA (PVAR (p, decoding_buf)), coding->carryover, + if (SCHARS (PGET (p, decoding_buf)) < coding->carryover_bytes) + PSET (p, decoding_buf, make_uninit_string (coding->carryover_bytes)); + memcpy (SDATA (PGET (p, decoding_buf)), coding->carryover, coding->carryover_bytes); p->decoding_carryover = coding->carryover_bytes; } @@ -5228,7 +5227,7 @@ } /* If no filter, write into buffer if it isn't dead. */ - else if (!NILP (PVAR (p, buffer)) && !NILP (BVAR (XBUFFER (PVAR (p, buffer)), name))) + else if (!NILP (PGET (p, buffer)) && !NILP (BVAR (XBUFFER (PGET (p, buffer)), name))) { Lisp_Object old_read_only; ptrdiff_t old_begv, old_zv; @@ -5238,7 +5237,7 @@ Lisp_Object text; struct buffer *b; - Fset_buffer (PVAR (p, buffer)); + Fset_buffer (PGET (p, buffer)); opoint = PT; opoint_byte = PT_BYTE; old_read_only = BVAR (current_buffer, read_only); @@ -5252,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 (PVAR (p, mark))->buffer) + if (XMARKER (PGET (p, mark))->buffer) SET_PT_BOTH (clip_to_bounds (BEGV, - marker_position (PVAR (p, mark)), ZV), + marker_position (PGET (p, mark)), ZV), clip_to_bounds (BEGV_BYTE, - marker_byte_position (PVAR (p, mark)), + marker_byte_position (PGET (p, mark)), ZV_BYTE)); else SET_PT_BOTH (ZV, ZV_BYTE); @@ -5273,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 (PVAR (p, decode_coding_system), Vlast_coding_system_used)) + if (!EQ (PGET (p, decode_coding_system), Vlast_coding_system_used)) { - PVAR (p, decode_coding_system) = Vlast_coding_system_used; - if (NILP (PVAR (p, encode_coding_system)) + PSET (p, decode_coding_system, Vlast_coding_system_used); + if (NILP (PGET (p, encode_coding_system)) && proc_encode_coding_system[p->outfd]) { - PVAR (p, encode_coding_system) - = coding_inherit_eol_type (Vlast_coding_system_used, Qnil); - setup_coding_system (PVAR (p, encode_coding_system), + PSET (p, encode_coding_system, + coding_inherit_eol_type (Vlast_coding_system_used, Qnil)); + setup_coding_system (PGET (p, encode_coding_system), proc_encode_coding_system[p->outfd]); } } if (coding->carryover_bytes > 0) { - if (SCHARS (PVAR (p, decoding_buf)) < coding->carryover_bytes) - PVAR (p, decoding_buf) = make_uninit_string (coding->carryover_bytes); - memcpy (SDATA (PVAR (p, decoding_buf)), coding->carryover, + if (SCHARS (PGET (p, decoding_buf)) < coding->carryover_bytes) + PSET (p, decoding_buf, make_uninit_string (coding->carryover_bytes)); + memcpy (SDATA (PGET (p, decoding_buf)), coding->carryover, coding->carryover_bytes); p->decoding_carryover = coding->carryover_bytes; } @@ -5307,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 (PVAR (p, buffer)) - && (b = XBUFFER (PVAR (p, buffer)), b != current_buffer)) - set_marker_both (PVAR (p, mark), PVAR (p, buffer), BUF_PT (b), BUF_PT_BYTE (b)); + 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)); else - set_marker_both (PVAR (p, mark), PVAR (p, buffer), PT, PT_BYTE); + set_marker_both (PGET (p, mark), PGET (p, buffer), PT, PT_BYTE); update_mode_lines++; @@ -5405,9 +5404,9 @@ entry = Fcons (obj, Fcons (make_number (offset), make_number (len))); if (front) - PVAR (p, write_queue) = Fcons (entry, PVAR (p, write_queue)); + PSET (p, write_queue, Fcons (entry, PGET (p, write_queue))); else - PVAR (p, write_queue) = nconc2 (PVAR (p, write_queue), Fcons (entry, Qnil)); + PSET (p, write_queue, nconc2 (PGET (p, write_queue), Fcons (entry, Qnil))); } /* Remove the first element in the write_queue of process P, put its @@ -5421,11 +5420,11 @@ Lisp_Object entry, offset_length; ptrdiff_t offset; - if (NILP (PVAR (p, write_queue))) + if (NILP (PGET (p, write_queue))) return 0; - entry = XCAR (PVAR (p, write_queue)); - PVAR (p, write_queue) = XCDR (PVAR (p, write_queue)); + entry = XCAR (PGET (p, write_queue)); + PSET (p, write_queue, XCDR (PGET (p, write_queue))); *obj = XCAR (entry); offset_length = XCDR (entry); @@ -5459,10 +5458,10 @@ if (p->raw_status_new) update_status (p); - if (! EQ (PVAR (p, status), Qrun)) - error ("Process %s not running", SDATA (PVAR (p, name))); + if (! EQ (PGET (p, status), Qrun)) + error ("Process %s not running", SDATA (PGET (p, name))); if (p->outfd < 0) - error ("Output file descriptor of %s is closed", SDATA (PVAR (p, name))); + error ("Output file descriptor of %s is closed", SDATA (PGET (p, name))); coding = proc_encode_coding_system[p->outfd]; Vlast_coding_system_used = CODING_ID_NAME (coding->id); @@ -5472,9 +5471,9 @@ && !NILP (BVAR (XBUFFER (object), enable_multibyte_characters))) || EQ (object, Qt)) { - PVAR (p, encode_coding_system) - = complement_process_encoding_system (PVAR (p, encode_coding_system)); - if (!EQ (Vlast_coding_system_used, PVAR (p, encode_coding_system))) + 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))) { /* The coding system for encoding was changed to raw-text because we sent a unibyte text previously. Now we are @@ -5484,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 (PVAR (p, encode_coding_system), coding); - Vlast_coding_system_used = PVAR (p, encode_coding_system); + setup_coding_system (PGET (p, encode_coding_system), coding); + Vlast_coding_system_used = PGET (p, encode_coding_system); } coding->src_multibyte = 1; } @@ -5572,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 (PVAR (p, write_queue))) + if (!NILP (PGET (p, write_queue))) write_queue_push (p, object, buf, len, 0); do /* while !NILP (p->write_queue) */ @@ -5686,7 +5685,7 @@ cur_len -= written; } } - while (!NILP (PVAR (p, write_queue))); + while (!NILP (PGET (p, write_queue))); } else { @@ -5694,10 +5693,10 @@ proc = process_sent_to; p = XPROCESS (proc); p->raw_status_new = 0; - PVAR (p, status) = Fcons (Qexit, Fcons (make_number (256), Qnil)); + 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 (PVAR (p, name))); + error ("SIGPIPE raised on process %s; closed it", SDATA (PGET (p, name))); } } @@ -5755,12 +5754,12 @@ pid_t gid = -1; #ifdef TIOCGPGRP - if (ioctl (p->infd, TIOCGPGRP, &gid) == -1 && ! NILP (PVAR (p, tty_name))) + if (ioctl (p->infd, TIOCGPGRP, &gid) == -1 && ! NILP (PGET (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 (PVAR (p, tty_name)), O_RDONLY, 0); + fd = emacs_open (SSDATA (PGET (p, tty_name)), O_RDONLY, 0); if (fd != -1) { @@ -5789,12 +5788,12 @@ proc = get_process (process); p = XPROCESS (proc); - if (!EQ (PVAR (p, type), Qreal)) + if (!EQ (PGET (p, type), Qreal)) error ("Process %s is not a subprocess", - SDATA (PVAR (p, name))); + SDATA (PGET (p, name))); if (p->infd < 0) error ("Process %s is not active", - SDATA (PVAR (p, name))); + SDATA (PGET (p, name))); gid = emacs_get_tty_pgrp (p); @@ -5829,12 +5828,12 @@ proc = get_process (process); p = XPROCESS (proc); - if (!EQ (PVAR (p, type), Qreal)) + if (!EQ (PGET (p, type), Qreal)) error ("Process %s is not a subprocess", - SDATA (PVAR (p, name))); + SDATA (PGET (p, name))); if (p->infd < 0) error ("Process %s is not active", - SDATA (PVAR (p, name))); + SDATA (PGET (p, name))); if (!p->pty_flag) current_group = Qnil; @@ -5923,7 +5922,7 @@ #ifdef SIGCONT case SIGCONT: p->raw_status_new = 0; - PVAR (p, status) = Qrun; + PSET (p, status, Qrun); p->tick = ++process_tick; if (!nomsg) { @@ -6013,13 +6012,13 @@ struct Lisp_Process *p; p = XPROCESS (process); - if (NILP (PVAR (p, command)) + if (NILP (PGET (p, command)) && p->infd >= 0) { FD_CLR (p->infd, &input_wait_mask); FD_CLR (p->infd, &non_keyboard_wait_mask); } - PVAR (p, command) = Qt; + PSET (p, command, Qt); return process; } #ifndef SIGTSTP @@ -6042,9 +6041,9 @@ struct Lisp_Process *p; p = XPROCESS (process); - if (EQ (PVAR (p, command), Qt) + if (EQ (PGET (p, command), Qt) && p->infd >= 0 - && (!EQ (PVAR (p, filter), Qt) || EQ (PVAR (p, status), Qlisten))) + && (!EQ (PGET (p, filter), Qt) || EQ (PGET (p, status), Qlisten))) { FD_SET (p->infd, &input_wait_mask); FD_SET (p->infd, &non_keyboard_wait_mask); @@ -6055,7 +6054,7 @@ tcflush (p->infd, TCIFLUSH); #endif /* not WINDOWSNT */ } - PVAR (p, command) = Qnil; + PSET (p, command, Qnil); return process; } #ifdef SIGCONT @@ -6103,7 +6102,7 @@ pid = XPROCESS (process)->pid; if (pid <= 0) error ("Cannot signal process %s", - SDATA (PVAR (XPROCESS (process), name))); + SDATA (PGET (XPROCESS (process), name))); } #define parse_signal(NAME, VALUE) \ @@ -6247,8 +6246,8 @@ /* Make sure the process is really alive. */ if (XPROCESS (proc)->raw_status_new) update_status (XPROCESS (proc)); - if (! EQ (PVAR (XPROCESS (proc), status), Qrun)) - error ("Process %s not running", SDATA (PVAR (XPROCESS (proc), name))); + if (! EQ (PGET (XPROCESS (proc), status), Qrun)) + error ("Process %s not running", SDATA (PGET (XPROCESS (proc), name))); if (CODING_REQUIRE_FLUSHING (coding)) { @@ -6258,7 +6257,7 @@ if (XPROCESS (proc)->pty_flag) send_process (proc, "\004", 1, Qnil); - else if (EQ (PVAR (XPROCESS (proc), type), Qserial)) + else if (EQ (PGET (XPROCESS (proc), type), Qserial)) { #ifndef WINDOWSNT if (tcdrain (XPROCESS (proc)->outfd) != 0) @@ -6275,7 +6274,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 (PVAR (XPROCESS (proc), type), Qnetwork) + if (EQ (PGET (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. */ @@ -6388,7 +6387,7 @@ { proc = XCDR (XCAR (tail)); p = XPROCESS (proc); - if (EQ (PVAR (p, type), Qreal) && p->pid == pid) + if (EQ (PGET (p, type), Qreal) && p->pid == pid) break; p = 0; } @@ -6472,7 +6471,7 @@ static Lisp_Object exec_sentinel_unwind (Lisp_Object data) { - PVAR (XPROCESS (XCAR (data)), sentinel) = XCDR (data); + PSET (XPROCESS (XCAR (data)), sentinel, XCDR (data)); return Qnil; } @@ -6512,13 +6511,13 @@ friends don't expect current-buffer to be changed from under them. */ record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); - sentinel = PVAR (p, sentinel); + sentinel = PGET (p, sentinel); if (NILP (sentinel)) return; /* Zilch the sentinel while it's running, to avoid recursive invocations; assure that it gets restored no matter how the sentinel exits. */ - PVAR (p, sentinel) = Qnil; + PSET (p, sentinel, Qnil); record_unwind_protect (exec_sentinel_unwind, Fcons (proc, sentinel)); /* Inhibit quit so that random quits don't screw up a running filter. */ specbind (Qinhibit_quit, Qt); @@ -6606,16 +6605,16 @@ p->update_tick = p->tick; /* If process is still active, read any output that remains. */ - while (! EQ (PVAR (p, filter), Qt) - && ! EQ (PVAR (p, status), Qconnect) - && ! EQ (PVAR (p, status), Qlisten) + while (! EQ (PGET (p, filter), Qt) + && ! EQ (PGET (p, status), Qconnect) + && ! EQ (PGET (p, status), Qlisten) /* Network or serial process not stopped: */ - && ! EQ (PVAR (p, command), Qt) + && ! EQ (PGET (p, command), Qt) && p->infd >= 0 && p != deleting_process && read_process_output (proc, p->infd) > 0); - buffer = PVAR (p, buffer); + buffer = PGET (p, buffer); /* Get the text to use for the message. */ if (p->raw_status_new) @@ -6623,9 +6622,9 @@ msg = status_message (p); /* If process is terminated, deactivate it or delete it. */ - symbol = PVAR (p, status); - if (CONSP (PVAR (p, status))) - symbol = XCAR (PVAR (p, status)); + symbol = PGET (p, status); + if (CONSP (PGET (p, status))) + symbol = XCAR (PGET (p, status)); if (EQ (symbol, Qsignal) || EQ (symbol, Qexit) || EQ (symbol, Qclosed)) @@ -6642,7 +6641,7 @@ this code to be run again. */ p->update_tick = p->tick; /* Now output the message suitably. */ - if (!NILP (PVAR (p, sentinel))) + if (!NILP (PGET (p, sentinel))) exec_sentinel (proc, msg); /* Don't bother with a message in the buffer when a process becomes runnable. */ @@ -6664,8 +6663,8 @@ /* Insert new output into buffer at the current end-of-output marker, thus preserving logical ordering of input and output. */ - if (XMARKER (PVAR (p, mark))->buffer) - Fgoto_char (PVAR (p, mark)); + if (XMARKER (PGET (p, mark))->buffer) + Fgoto_char (PGET (p, mark)); else SET_PT_BOTH (ZV, ZV_BYTE); @@ -6675,11 +6674,12 @@ tem = BVAR (current_buffer, read_only); BVAR (current_buffer, read_only) = Qnil; insert_string ("\nProcess "); - Finsert (1, &PVAR (p, name)); + { /* FIXME: temporary kludge */ + Lisp_Object tem2 = PGET (p, name); Finsert (1, &tem2); } insert_string (" "); Finsert (1, &msg); BVAR (current_buffer, read_only) = tem; - set_marker_both (PVAR (p, mark), PVAR (p, buffer), PT, PT_BYTE); + set_marker_both (PGET (p, mark), PGET (p, buffer), PT, PT_BYTE); if (opoint >= before) SET_PT_BOTH (opoint + (PT - before), @@ -6709,14 +6709,14 @@ CHECK_PROCESS (process); p = XPROCESS (process); if (p->infd < 0) - error ("Input file descriptor of %s closed", SDATA (PVAR (p, name))); + error ("Input file descriptor of %s closed", SDATA (PGET (p, name))); if (p->outfd < 0) - error ("Output file descriptor of %s closed", SDATA (PVAR (p, name))); + error ("Output file descriptor of %s closed", SDATA (PGET (p, name))); Fcheck_coding_system (decoding); Fcheck_coding_system (encoding); encoding = coding_inherit_eol_type (encoding, Qnil); - PVAR (p, decode_coding_system) = decoding; - PVAR (p, encode_coding_system) = encoding; + PSET (p, decode_coding_system, decoding); + PSET (p, encode_coding_system, encoding); setup_process_coding_systems (process); return Qnil; @@ -6728,8 +6728,8 @@ (register Lisp_Object process) { CHECK_PROCESS (process); - return Fcons (PVAR (XPROCESS (process), decode_coding_system), - PVAR (XPROCESS (process), encode_coding_system)); + return Fcons (PGET (XPROCESS (process), decode_coding_system), + PGET (XPROCESS (process), encode_coding_system)); } DEFUN ("set-process-filter-multibyte", Fset_process_filter_multibyte, @@ -6746,8 +6746,8 @@ CHECK_PROCESS (process); p = XPROCESS (process); if (NILP (flag)) - PVAR (p, decode_coding_system) - = raw_text_coding_system (PVAR (p, decode_coding_system)); + PSET (p, decode_coding_system, + raw_text_coding_system (PGET (p, decode_coding_system))); setup_process_coding_systems (process); return Qnil; @@ -7085,19 +7085,19 @@ if (!proc_decode_coding_system[inch]) proc_decode_coding_system[inch] = xmalloc (sizeof (struct coding_system)); - coding_system = PVAR (p, decode_coding_system); - if (! NILP (PVAR (p, filter))) + coding_system = PGET (p, decode_coding_system); + if (! NILP (PGET (p, filter))) ; - else if (BUFFERP (PVAR (p, buffer))) + else if (BUFFERP (PGET (p, buffer))) { - if (NILP (BVAR (XBUFFER (PVAR (p, buffer)), enable_multibyte_characters))) + if (NILP (BVAR (XBUFFER (PGET (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 (PVAR (p, encode_coding_system), + setup_coding_system (PGET (p, encode_coding_system), proc_encode_coding_system[outch]); #endif } @@ -7143,7 +7143,7 @@ for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail)) { proc = Fcdr (XCAR (tail)); - if (PROCESSP (proc) && EQ (PVAR (XPROCESS (proc), buffer), buf)) + if (PROCESSP (proc) && EQ (PGET (XPROCESS (proc), buffer), buf)) return proc; } #endif /* subprocesses */ @@ -7182,7 +7182,7 @@ { proc = XCDR (XCAR (tail)); if (PROCESSP (proc) - && (NILP (buffer) || EQ (PVAR (XPROCESS (proc), buffer), buffer))) + && (NILP (buffer) || EQ (PGET (XPROCESS (proc), buffer), buffer))) { if (NETCONN_P (proc) || SERIALCONN_P (proc)) Fdelete_process (proc); === modified file 'src/process.h' --- src/process.h 2012-08-01 06:23:24 +0000 +++ src/process.h 2012-08-06 11:16:07 +0000 @@ -26,10 +26,15 @@ #include "gnutls.h" #endif -/* Most code should use this macro to access - Lisp fields in struct Lisp_Process. */ - -#define PVAR(w, field) ((w)->INTERNAL_FIELD (field)) +/* 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)) /* This structure records information about a subprocess or network connection. */ @@ -100,7 +105,7 @@ Lisp_Object INTERNAL_FIELD (write_queue); #ifdef HAVE_GNUTLS - Lisp_Object gnutls_cred_type; + Lisp_Object INTERNAL_FIELD (gnutls_cred_type); #endif /* After this point, there are no Lisp_Objects any more. */ === modified file 'src/sysdep.c' --- src/sysdep.c 2012-08-03 23:36:11 +0000 +++ src/sysdep.c 2012-08-06 11:16:07 +0000 @@ -2159,7 +2159,7 @@ int err = -1; char summary[4] = "???"; /* This usually becomes "8N1". */ - childp2 = Fcopy_sequence (PVAR (p, childp)); + childp2 = Fcopy_sequence (PGET (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 (PVAR (p, childp), QCspeed); + tem = Fplist_get (PGET (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 (PVAR (p, childp), QCbytesize); + tem = Fplist_get (PGET (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 (PVAR (p, childp), QCparity); + tem = Fplist_get (PGET (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 (PVAR (p, childp), QCstopbits); + tem = Fplist_get (PGET (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 (PVAR (p, childp), QCflowcontrol); + tem = Fplist_get (PGET (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) @@ -2307,7 +2307,7 @@ error ("tcsetattr() failed: %s", emacs_strerror (errno)); childp2 = Fplist_put (childp2, QCsummary, build_string (summary)); - PVAR (p, childp) = childp2; + PSET (p, childp, childp2); } #endif /* not DOS_NT */ === modified file 'src/w32.c' --- src/w32.c 2012-08-04 14:17:10 +0000 +++ src/w32.c 2012-08-06 11:16:07 +0000 @@ -6891,7 +6891,7 @@ error ("Not a serial process"); hnd = fd_info[ p->outfd ].hnd; - childp2 = Fcopy_sequence (PVAR (p, childp)); + childp2 = Fcopy_sequence (PGET (p, childp)); /* Initialize timeouts for blocking read and blocking write. */ if (!GetCommTimeouts (hnd, &ct)) @@ -6920,7 +6920,7 @@ if (!NILP (Fplist_member (contact, QCspeed))) tem = Fplist_get (contact, QCspeed); else - tem = Fplist_get (PVAR (p, childp), QCspeed); + tem = Fplist_get (PGET (p, childp), QCspeed); CHECK_NUMBER (tem); dcb.BaudRate = XINT (tem); childp2 = Fplist_put (childp2, QCspeed, tem); @@ -6929,7 +6929,7 @@ if (!NILP (Fplist_member (contact, QCbytesize))) tem = Fplist_get (contact, QCbytesize); else - tem = Fplist_get (PVAR (p, childp), QCbytesize); + tem = Fplist_get (PGET (p, childp), QCbytesize); if (NILP (tem)) tem = make_number (8); CHECK_NUMBER (tem); @@ -6943,7 +6943,7 @@ if (!NILP (Fplist_member (contact, QCparity))) tem = Fplist_get (contact, QCparity); else - tem = Fplist_get (PVAR (p, childp), QCparity); + tem = Fplist_get (PGET (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; @@ -6973,7 +6973,7 @@ if (!NILP (Fplist_member (contact, QCstopbits))) tem = Fplist_get (contact, QCstopbits); else - tem = Fplist_get (PVAR (p, childp), QCstopbits); + tem = Fplist_get (PGET (p, childp), QCstopbits); if (NILP (tem)) tem = make_number (1); CHECK_NUMBER (tem); @@ -6990,7 +6990,7 @@ if (!NILP (Fplist_member (contact, QCflowcontrol))) tem = Fplist_get (contact, QCflowcontrol); else - tem = Fplist_get (PVAR (p, childp), QCflowcontrol); + tem = Fplist_get (PGET (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; @@ -7024,7 +7024,7 @@ error ("SetCommState() failed"); childp2 = Fplist_put (childp2, QCsummary, build_string (summary)); - PVAR (p, childp) = childp2; + PSET (p, childp, childp2); } #ifdef HAVE_GNUTLS === modified file 'src/xdisp.c' --- src/xdisp.c 2012-08-06 10:24:26 +0000 +++ src/xdisp.c 2012-08-06 11:16:07 +0000 @@ -21677,9 +21677,9 @@ if (PROCESSP (obj)) { p = decode_mode_spec_coding - (PVAR (XPROCESS (obj), decode_coding_system), p, eol_flag); + (PGET (XPROCESS (obj), decode_coding_system), p, eol_flag); p = decode_mode_spec_coding - (PVAR (XPROCESS (obj), encode_coding_system), p, eol_flag); + (PGET (XPROCESS (obj), encode_coding_system), p, eol_flag); } #endif /* subprocesses */ #endif /* 0 */ ------------------------------------------------------------ revno: 109465 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2012-08-06 14:24:26 +0400 message: Separate read and write access to Lisp_Object slots of struct window. * window.h (WGET, WSET): New macros similar to AREF and ASET. * 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-06 09:28:17 +0000 +++ src/ChangeLog 2012-08-06 10:24:26 +0000 @@ -1,5 +1,16 @@ 2012-08-06 Dmitry Antipov + Separate read and write access to Lisp_Object slots of struct window. + * window.h (WGET, WSET): New macros similar to AREF and ASET. + * 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-06 Dmitry Antipov + Fix Windows build errors introduced after converting to FGET and FSET. * w32term.c (x_frame_rehighlight, x_scroll_bar_create): (w32_condemn_scroll_bars, w32_redeem_scroll_bar): === modified file 'src/alloc.c' --- src/alloc.c 2012-08-05 15:47:28 +0000 +++ src/alloc.c 2012-08-06 10:24:26 +0000 @@ -6015,7 +6015,7 @@ /* Mark glyphs for leaf windows. Marking window matrices is sufficient because frame matrices use the same glyph memory. */ - if (NILP (WVAR (w, hchild)) && NILP (WVAR (w, vchild)) + if (NILP (WGET (w, hchild)) && NILP (WGET (w, vchild)) && w->current_matrix) { mark_glyph_matrix (w->current_matrix); === modified file 'src/buffer.c' --- src/buffer.c 2012-08-06 05:27:54 +0000 +++ src/buffer.c 2012-08-06 10:24:26 +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, WVAR (XWINDOW (minibuf_window), buffer))) + if (EQ (buffer, WGET (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, WVAR (XWINDOW (minibuf_window), buffer)) + if (EQ (tem, WGET (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 (WVAR (XWINDOW (w), pointm)) - && (EQ (WVAR (XWINDOW (w), buffer), buf1) - || EQ (WVAR (XWINDOW (w), buffer), buf2))) - Fset_marker (WVAR (XWINDOW (w), pointm), + if (MARKERP (WGET (XWINDOW (w), pointm)) + && (EQ (WGET (XWINDOW (w), buffer), buf1) + || EQ (WGET (XWINDOW (w), buffer), buf2))) + Fset_marker (WGET (XWINDOW (w), pointm), make_number - (BUF_BEGV (XBUFFER (WVAR (XWINDOW (w), buffer)))), - WVAR (XWINDOW (w), buffer)); + (BUF_BEGV (XBUFFER (WGET (XWINDOW (w), buffer)))), + WGET (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 (WVAR (XWINDOW (selected_window), buffer))) + if (buf != XBUFFER (WGET (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-02 07:31:34 +0000 +++ src/composite.c 2012-08-06 10:24:26 +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 (WVAR (win, frame)); + FRAME_PTR f = XFRAME (WGET (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 = WVAR (win, frame); + font_object = WGET (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-02 07:31:34 +0000 +++ src/dispextern.h 2012-08-06 10:24:26 +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 (WVAR (W, frame)), \ + : estimate_mode_line_height (XFRAME (WGET (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 (WVAR (W, frame)),\ + : estimate_mode_line_height (XFRAME (WGET (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 (WVAR (W, buffer)) \ - && !NILP (BVAR (XBUFFER (WVAR (W, buffer)), mode_line_format)) \ + && BUFFERP (WGET (W, buffer)) \ + && !NILP (BVAR (XBUFFER (WGET (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 (WVAR (W, buffer)) \ - && !NILP (BVAR (XBUFFER (WVAR (W, buffer)), header_line_format)) \ + && BUFFERP (WGET (W, buffer)) \ + && !NILP (BVAR (XBUFFER (WGET (W, buffer)), header_line_format)) \ && WINDOW_TOTAL_LINES (W) > 1 \ - + !NILP (BVAR (XBUFFER (WVAR (W, buffer)), mode_line_format))) + + !NILP (BVAR (XBUFFER (WGET (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-06 05:27:54 +0000 +++ src/dispnew.c 2012-08-06 10:24:26 +0000 @@ -268,9 +268,9 @@ "%"pMu": window %p (`%s')%s\n%s", history_tick++, w, - ((BUFFERP (WVAR (w, buffer)) - && STRINGP (BVAR (XBUFFER (WVAR (w, buffer)), name))) - ? SSDATA (BVAR (XBUFFER (WVAR (w, buffer)), name)) + ((BUFFERP (WGET (w, buffer)) + && STRINGP (BVAR (XBUFFER (WGET (w, buffer)), name))) + ? SSDATA (BVAR (XBUFFER (WGET (w, buffer)), name)) : "???"), paused_p ? " ***paused***" : "", msg); @@ -408,7 +408,7 @@ if (NUMBERP (margin)) { - int width = XFASTINT (WVAR (w, total_cols)); + int width = XFASTINT (WGET (w, total_cols)); double d = max (0, XFLOATINT (margin)); d = min (width / 2 - 1, d); n = (int) ((double) total_glyphs / width * d); @@ -478,8 +478,8 @@ the matrix means preventing redisplay. */ if (matrix->pool == NULL) { - left = margin_glyphs_to_reserve (w, dim.width, WVAR (w, left_margin_cols)); - right = margin_glyphs_to_reserve (w, dim.width, WVAR (w, right_margin_cols)); + 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)); eassert (left >= 0 && right >= 0); marginal_areas_changed_p = (left != matrix->left_margin_glyphs || right != matrix->right_margin_glyphs); @@ -518,9 +518,9 @@ if (w) { left = margin_glyphs_to_reserve (w, dim.width, - WVAR (w, left_margin_cols)); + WGET (w, left_margin_cols)); right = margin_glyphs_to_reserve (w, dim.width, - WVAR (w, right_margin_cols)); + WGET (w, right_margin_cols)); } else left = right = 0; @@ -643,9 +643,9 @@ /* Window end is invalid, if inside of the rows that are invalidated below. */ - if (INTEGERP (WVAR (w, window_end_vpos)) - && XFASTINT (WVAR (w, window_end_vpos)) >= i) - WVAR (w, window_end_valid) = Qnil; + if (INTEGERP (WGET (w, window_end_vpos)) + && XFASTINT (WGET (w, window_end_vpos)) >= i) + WSET (w, window_end_valid, Qnil); while (i < matrix->nrows) matrix->rows[i++].enabled_p = 0; @@ -885,15 +885,15 @@ { while (w) { - if (!NILP (WVAR (w, hchild))) + if (!NILP (WGET (w, hchild))) { - eassert (WINDOWP (WVAR (w, hchild))); - clear_window_matrices (XWINDOW (WVAR (w, hchild)), desired_p); + eassert (WINDOWP (WGET (w, hchild))); + clear_window_matrices (XWINDOW (WGET (w, hchild)), desired_p); } - else if (!NILP (WVAR (w, vchild))) + else if (!NILP (WGET (w, vchild))) { - eassert (WINDOWP (WVAR (w, vchild))); - clear_window_matrices (XWINDOW (WVAR (w, vchild)), desired_p); + eassert (WINDOWP (WGET (w, vchild))); + clear_window_matrices (XWINDOW (WGET (w, vchild)), desired_p); } else { @@ -902,11 +902,11 @@ else { clear_glyph_matrix (w->current_matrix); - WVAR (w, window_end_valid) = Qnil; + WSET (w, window_end_valid, Qnil); } } - w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); + w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); } } @@ -970,7 +970,7 @@ clear_glyph_row (row); row->y = y; row->ascent = row->phys_ascent = 0; - row->height = row->phys_height = FRAME_LINE_HEIGHT (XFRAME (WVAR (w, frame))); + row->height = row->phys_height = FRAME_LINE_HEIGHT (XFRAME (WGET (w, frame))); row->visible_height = row->height; if (row->y < min_y) @@ -1516,7 +1516,7 @@ struct glyph_row *row = matrix->rows; struct glyph_row *last_text_row = NULL; struct buffer *saved = current_buffer; - struct buffer *buffer = XBUFFER (WVAR (w, buffer)); + struct buffer *buffer = XBUFFER (WGET (w, buffer)); int c; /* This can sometimes happen for a fresh window. */ @@ -1679,8 +1679,8 @@ points to the mini-buffer window, if any, which is arranged vertically below other windows. */ in_horz_combination_p - = (!NILP (WVAR (XWINDOW (window), parent)) - && !NILP (WVAR (XWINDOW (WVAR (XWINDOW (window), parent)), hchild))); + = (!NILP (WGET (XWINDOW (window), parent)) + && !NILP (WGET (XWINDOW (WGET (XWINDOW (window), parent)), hchild))); /* For WINDOW and all windows on the same level. */ do @@ -1689,12 +1689,12 @@ /* Get the dimension of the window sub-matrix for W, depending on whether this is a combination or a leaf window. */ - if (!NILP (WVAR (w, hchild))) - dim = allocate_matrices_for_frame_redisplay (WVAR (w, hchild), x, y, + if (!NILP (WGET (w, hchild))) + dim = allocate_matrices_for_frame_redisplay (WGET (w, hchild), x, y, dim_only_p, window_change_flags); - else if (!NILP (WVAR (w, vchild))) - dim = allocate_matrices_for_frame_redisplay (WVAR (w, vchild), x, y, + else if (!NILP (WGET (w, vchild))) + dim = allocate_matrices_for_frame_redisplay (WGET (w, vchild), x, y, dim_only_p, window_change_flags); else @@ -1718,10 +1718,10 @@ || dim.width != w->desired_matrix->matrix_w || dim.height != w->desired_matrix->matrix_h || (margin_glyphs_to_reserve (w, dim.width, - WVAR (w, left_margin_cols)) + WGET (w, left_margin_cols)) != w->desired_matrix->left_margin_glyphs) || (margin_glyphs_to_reserve (w, dim.width, - WVAR (w, right_margin_cols)) + WGET (w, right_margin_cols)) != w->desired_matrix->right_margin_glyphs)) *window_change_flags |= CHANGED_LEAF_MATRIX; @@ -1750,7 +1750,7 @@ hmax = max (hmax, dim.height); /* Next window on same level. */ - window = WVAR (w, next); + window = WGET (w, next); } while (!NILP (window)); @@ -1781,7 +1781,7 @@ required_matrix_height (struct window *w) { #ifdef HAVE_WINDOW_SYSTEM - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); if (FRAME_WINDOW_P (f)) { @@ -1807,7 +1807,7 @@ required_matrix_width (struct window *w) { #ifdef HAVE_WINDOW_SYSTEM - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); if (FRAME_WINDOW_P (f)) { int ch_width = FRAME_SMALLEST_CHAR_WIDTH (f); @@ -1824,7 +1824,7 @@ } #endif /* HAVE_WINDOW_SYSTEM */ - return XINT (WVAR (w, total_cols)); + return XINT (WGET (w, total_cols)); } @@ -1836,10 +1836,10 @@ { while (w) { - if (!NILP (WVAR (w, vchild))) - allocate_matrices_for_window_redisplay (XWINDOW (WVAR (w, vchild))); - else if (!NILP (WVAR (w, hchild))) - allocate_matrices_for_window_redisplay (XWINDOW (WVAR (w, hchild))); + 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))); else { /* W is a leaf window. */ @@ -1858,7 +1858,7 @@ adjust_glyph_matrix (w, w->current_matrix, 0, 0, dim); } - w = NILP (WVAR (w, next)) ? NULL : XWINDOW (WVAR (w, next)); + w = NILP (WGET (w, next)) ? NULL : XWINDOW (WGET (w, next)); } } @@ -1905,20 +1905,20 @@ { struct frame *sf = SELECTED_FRAME (); struct window *root = XWINDOW (FGET (sf, root_window)); - struct window *mini = XWINDOW (WVAR (root, next)); + struct window *mini = XWINDOW (WGET (root, next)); int frame_lines = FRAME_LINES (sf); int frame_cols = FRAME_COLS (sf); int top_margin = FRAME_TOP_MARGIN (sf); /* Do it for the root window. */ - XSETFASTINT (WVAR (root, top_line), top_margin); - XSETFASTINT (WVAR (root, total_lines), frame_lines - 1 - top_margin); - XSETFASTINT (WVAR (root, total_cols), frame_cols); + WSET (root, top_line, make_number (top_margin)); + WSET (root, total_lines, make_number (frame_lines - 1 - top_margin)); + WSET (root, total_cols, make_number (frame_cols)); /* Do it for the mini-buffer window. */ - XSETFASTINT (WVAR (mini, top_line), frame_lines - 1); - XSETFASTINT (WVAR (mini, total_lines), 1); - XSETFASTINT (WVAR (mini, total_cols), frame_cols); + WSET (mini, top_line, make_number (frame_lines - 1)); + WSET (mini, total_lines, make_number (1)); + WSET (mini, total_cols, make_number (frame_cols)); adjust_frame_glyphs (sf); glyphs_initialized_initially_p = 1; @@ -1950,21 +1950,21 @@ { while (w) { - if (!NILP (WVAR (w, hchild))) - { - if (showing_window_margins_p (XWINDOW (WVAR (w, hchild)))) - return 1; - } - else if (!NILP (WVAR (w, vchild))) - { - if (showing_window_margins_p (XWINDOW (WVAR (w, vchild)))) - return 1; - } - else if (!NILP (WVAR (w, left_margin_cols)) - || !NILP (WVAR (w, right_margin_cols))) + 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))) return 1; - w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); + w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); } return 0; } @@ -1978,18 +1978,18 @@ { struct window *w; - for (; !NILP (window); window = WVAR (w, next)) + for (; !NILP (window); window = WGET (w, next)) { w = XWINDOW (window); - if (!NILP (WVAR (w, hchild))) - fake_current_matrices (WVAR (w, hchild)); - else if (!NILP (WVAR (w, vchild))) - fake_current_matrices (WVAR (w, vchild)); + if (!NILP (WGET (w, hchild))) + fake_current_matrices (WGET (w, hchild)); + else if (!NILP (WGET (w, vchild))) + fake_current_matrices (WGET (w, vchild)); else { int i; - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); struct glyph_matrix *m = w->current_matrix; struct glyph_matrix *fm = f->current_matrix; @@ -2189,9 +2189,11 @@ struct window *w; if (NILP (FGET (f, menu_bar_window))) { + Lisp_Object frame; FSET (f, menu_bar_window, make_window ()); w = XWINDOW (FGET (f, menu_bar_window)); - XSETFRAME (WVAR (w, frame), f); + XSETFRAME (frame, f); + WSET (w, frame, frame); w->pseudo_window_p = 1; } else @@ -2199,10 +2201,10 @@ /* Set window dimensions to frame dimensions and allocate or adjust glyph matrices of W. */ - XSETFASTINT (WVAR (w, top_line), 0); - XSETFASTINT (WVAR (w, left_col), 0); - XSETFASTINT (WVAR (w, total_lines), FRAME_MENU_BAR_LINES (f)); - XSETFASTINT (WVAR (w, total_cols), FRAME_TOTAL_COLS (f)); + WSET (w, top_line, make_number (0)); + WSET (w, left_col, make_number (0)); + WSET (w, total_lines, make_number (FRAME_MENU_BAR_LINES (f))); + WSET (w, total_cols, make_number (FRAME_TOTAL_COLS (f))); allocate_matrices_for_window_redisplay (w); } #endif /* not USE_X_TOOLKIT && not USE_GTK */ @@ -2215,18 +2217,20 @@ struct window *w; if (NILP (FGET (f, tool_bar_window))) { + Lisp_Object frame; FSET (f, tool_bar_window, make_window ()); w = XWINDOW (FGET (f, tool_bar_window)); - XSETFRAME (WVAR (w, frame), f); + XSETFRAME (frame, f); + WSET (w, frame, frame); w->pseudo_window_p = 1; } else w = XWINDOW (FGET (f, tool_bar_window)); - XSETFASTINT (WVAR (w, top_line), FRAME_MENU_BAR_LINES (f)); - XSETFASTINT (WVAR (w, left_col), 0); - XSETFASTINT (WVAR (w, total_lines), FRAME_TOOL_BAR_LINES (f)); - XSETFASTINT (WVAR (w, total_cols), FRAME_TOTAL_COLS (f)); + WSET (w, top_line, make_number (FRAME_MENU_BAR_LINES (f))); + WSET (w, left_col, make_number (0)); + WSET (w, total_lines, make_number (FRAME_TOOL_BAR_LINES (f))); + WSET (w, total_cols, make_number (FRAME_TOTAL_COLS (f))); allocate_matrices_for_window_redisplay (w); } #endif @@ -2336,10 +2340,10 @@ { while (w) { - if (!NILP (WVAR (w, hchild))) - free_window_matrices (XWINDOW (WVAR (w, hchild))); - else if (!NILP (WVAR (w, vchild))) - free_window_matrices (XWINDOW (WVAR (w, vchild))); + 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))); else { /* This is a leaf window. Free its memory and reset fields @@ -2351,7 +2355,7 @@ } /* Next window on same level. */ - w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); + w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); } } @@ -2472,14 +2476,14 @@ { while (w) { - if (!NILP (WVAR (w, hchild))) - build_frame_matrix_from_window_tree (matrix, XWINDOW (WVAR (w, hchild))); - else if (!NILP (WVAR (w, vchild))) - build_frame_matrix_from_window_tree (matrix, XWINDOW (WVAR (w, vchild))); + 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))); else build_frame_matrix_from_leaf_window (matrix, w); - w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); + w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); } } @@ -2618,7 +2622,7 @@ /* Convert the glyph's specified face to a realized (cache) face. */ if (lface_id > 0) { - int face_id = merge_faces (XFRAME (WVAR (w, frame)), + int face_id = merge_faces (XFRAME (WGET (w, frame)), Qt, lface_id, DEFAULT_FACE_ID); SET_GLYPH_FACE (*glyph, face_id); } @@ -2739,10 +2743,10 @@ { while (w) { - if (!NILP (WVAR (w, hchild))) - mirror_make_current (XWINDOW (WVAR (w, hchild)), frame_row); - else if (!NILP (WVAR (w, vchild))) - mirror_make_current (XWINDOW (WVAR (w, vchild)), frame_row); + 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); else { /* Row relative to window W. Don't use FRAME_TO_WINDOW_VPOS @@ -2775,7 +2779,7 @@ } } - w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); + w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); } } @@ -2834,16 +2838,16 @@ static void sync_window_with_frame_matrix_rows (struct window *w) { - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (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 (WVAR (w, hchild)) && NILP (WVAR (w, vchild))); + eassert (NILP (WGET (w, hchild)) && NILP (WGET (w, vchild))); eassert (!FRAME_WINDOW_P (f)); - left = margin_glyphs_to_reserve (w, 1, WVAR (w, left_margin_cols)); - right = margin_glyphs_to_reserve (w, 1, WVAR (w, right_margin_cols)); + left = margin_glyphs_to_reserve (w, 1, WGET (w, left_margin_cols)); + right = margin_glyphs_to_reserve (w, 1, WGET (w, right_margin_cols)); x = w->current_matrix->matrix_x; width = w->current_matrix->matrix_w; @@ -2875,15 +2879,15 @@ while (w && !found) { - if (!NILP (WVAR (w, hchild))) - found = frame_row_to_window (XWINDOW (WVAR (w, hchild)), row); - else if (!NILP (WVAR (w, vchild))) - found = frame_row_to_window (XWINDOW (WVAR (w, vchild)), row); + 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); else if (row >= WINDOW_TOP_EDGE_LINE (w) && row < WINDOW_BOTTOM_EDGE_LINE (w)) found = w; - w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); + w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); } return found; @@ -2906,11 +2910,11 @@ { while (w) { - if (!NILP (WVAR (w, hchild))) - mirror_line_dance (XWINDOW (WVAR (w, hchild)), unchanged_at_top, + if (!NILP (WGET (w, hchild))) + mirror_line_dance (XWINDOW (WGET (w, hchild)), unchanged_at_top, nlines, copy_from, retained_p); - else if (!NILP (WVAR (w, vchild))) - mirror_line_dance (XWINDOW (WVAR (w, vchild)), unchanged_at_top, + else if (!NILP (WGET (w, vchild))) + mirror_line_dance (XWINDOW (WGET (w, vchild)), unchanged_at_top, nlines, copy_from, retained_p); else { @@ -2966,7 +2970,7 @@ { /* A copy between windows. This is an infrequent case not worth optimizing. */ - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); struct window *root = XWINDOW (FRAME_ROOT_WINDOW (f)); struct window *w2; struct glyph_matrix *m2; @@ -3003,7 +3007,7 @@ } /* Next window on same level. */ - w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); + w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); } } @@ -3021,18 +3025,18 @@ { while (w) { - if (!NILP (WVAR (w, hchild))) - check_window_matrix_pointers (XWINDOW (WVAR (w, hchild))); - else if (!NILP (WVAR (w, vchild))) - check_window_matrix_pointers (XWINDOW (WVAR (w, vchild))); + 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))); else { - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); check_matrix_pointers (w->desired_matrix, f->desired_matrix); check_matrix_pointers (w->current_matrix, f->current_matrix); } - w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); + w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); } } @@ -3080,10 +3084,10 @@ static int window_to_frame_vpos (struct window *w, int vpos) { - eassert (!FRAME_WINDOW_P (XFRAME (WVAR (w, frame)))); + eassert (!FRAME_WINDOW_P (XFRAME (WGET (w, frame)))); eassert (vpos >= 0 && vpos <= w->desired_matrix->nrows); vpos += WINDOW_TOP_EDGE_LINE (w); - eassert (vpos >= 0 && vpos <= FRAME_LINES (XFRAME (WVAR (w, frame)))); + eassert (vpos >= 0 && vpos <= FRAME_LINES (XFRAME (WGET (w, frame)))); return vpos; } @@ -3094,7 +3098,7 @@ static int window_to_frame_hpos (struct window *w, int hpos) { - eassert (!FRAME_WINDOW_P (XFRAME (WVAR (w, frame)))); + eassert (!FRAME_WINDOW_P (XFRAME (WGET (w, frame)))); hpos += WINDOW_LEFT_EDGE_COL (w); return hpos; } @@ -3314,14 +3318,14 @@ while (w && !paused_p) { - if (!NILP (WVAR (w, hchild))) - paused_p |= update_window_tree (XWINDOW (WVAR (w, hchild)), force_p); - else if (!NILP (WVAR (w, vchild))) - paused_p |= update_window_tree (XWINDOW (WVAR (w, vchild)), force_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); else if (w->must_be_updated_p) paused_p |= update_window (w, force_p); - w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); + w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); } return paused_p; @@ -3809,7 +3813,7 @@ struct glyph *glyph = ¤t_row->glyphs[TEXT_AREA][i - 1]; int left, right; - rif->get_glyph_overhangs (glyph, XFRAME (WVAR (w, frame)), + rif->get_glyph_overhangs (glyph, XFRAME (WGET (w, frame)), &left, &right); can_skip_p = (right == 0 && !abort_skipping); } @@ -3842,7 +3846,7 @@ int left, right; rif->get_glyph_overhangs (current_glyph, - XFRAME (WVAR (w, frame)), + XFRAME (WGET (w, frame)), &left, &right); while (left > 0 && i > 0) { @@ -3985,7 +3989,7 @@ /* Update display of the left margin area, if there is one. */ if (!desired_row->full_width_p - && !NILP (WVAR (w, left_margin_cols))) + && !NILP (WGET (w, left_margin_cols))) { changed_p = 1; update_marginal_area (w, LEFT_MARGIN_AREA, vpos); @@ -4001,7 +4005,7 @@ /* Update display of the right margin area, if there is one. */ if (!desired_row->full_width_p - && !NILP (WVAR (w, right_margin_cols))) + && !NILP (WGET (w, right_margin_cols))) { changed_p = 1; update_marginal_area (w, RIGHT_MARGIN_AREA, vpos); @@ -4034,7 +4038,7 @@ static void set_window_cursor_after_update (struct window *w) { - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); struct redisplay_interface *rif = FRAME_RIF (f); int cx, cy, vpos, hpos; @@ -4120,14 +4124,14 @@ { while (w) { - if (!NILP (WVAR (w, hchild))) - set_window_update_flags (XWINDOW (WVAR (w, hchild)), on_p); - else if (!NILP (WVAR (w, vchild))) - set_window_update_flags (XWINDOW (WVAR (w, vchild)), on_p); + 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); else w->must_be_updated_p = on_p; - w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); + w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); } } @@ -4810,8 +4814,8 @@ int x = WINDOW_TO_FRAME_HPOS (w, w->cursor.hpos); int y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos); - if (INTEGERP (WVAR (w, left_margin_cols))) - x += XFASTINT (WVAR (w, left_margin_cols)); + if (INTEGERP (WGET (w, left_margin_cols))) + x += XFASTINT (WGET (w, left_margin_cols)); /* x = max (min (x, FRAME_TOTAL_COLS (f) - 1), 0); */ cursor_to (f, y, x); @@ -5301,9 +5305,9 @@ /* We used to set current_buffer directly here, but that does the wrong thing with `face-remapping-alist' (bug#2044). */ - Fset_buffer (WVAR (w, buffer)); + Fset_buffer (WGET (w, buffer)); itdata = bidi_shelve_cache (); - SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start)); + SET_TEXT_POS_FROM_MARKER (startp, WGET (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); @@ -5347,7 +5351,7 @@ *dx = x0 + it.first_visible_x - it.current_x; *dy = *y - it.current_y; - string = WVAR (w, buffer); + string = WGET (w, buffer); if (STRINGP (it.string)) string = it.string; *pos = it.current; @@ -5365,7 +5369,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 (WVAR (w, buffer)), + BYTEPOS (pos->pos) = buf_charpos_to_bytepos (XBUFFER (WGET (w, buffer)), CHARPOS (pos->pos)); } @@ -5765,7 +5769,8 @@ FrameCols (FRAME_TTY (f)) = newwidth; if (WINDOWP (FGET (f, tool_bar_window))) - XSETFASTINT (WVAR (XWINDOW (FGET (f, tool_bar_window)), total_cols), newwidth); + WSET (XWINDOW (FGET (f, tool_bar_window)), + total_cols, make_number (newwidth)); } FRAME_LINES (f) = newheight; === modified file 'src/editfns.c' --- src/editfns.c 2012-08-03 23:36:11 +0000 +++ src/editfns.c 2012-08-06 10:24:26 +0000 @@ -366,7 +366,7 @@ if (NILP (object)) XSETBUFFER (object, current_buffer); else if (WINDOWP (object)) - object = WVAR (XWINDOW (object), buffer); + object = WGET (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 (WVAR (XWINDOW (selected_window), buffer)) + int visible = (XBUFFER (WGET (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 (WVAR (XWINDOW (selected_window), buffer))) + && current_buffer != XBUFFER (WGET (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 = WVAR (XWINDOW (tem), buffer), + && (tem1 = WGET (XWINDOW (tem), buffer), (/* Window is live... */ BUFFERP (tem1) /* ...and it shows the current buffer. */ === modified file 'src/fileio.c' --- src/fileio.c 2012-08-03 23:36:11 +0000 +++ src/fileio.c 2012-08-06 10:24:26 +0000 @@ -3731,7 +3731,7 @@ /* If display currently starts at beginning of line, keep it that way. */ - if (XBUFFER (WVAR (XWINDOW (selected_window), buffer)) == current_buffer) + if (XBUFFER (WGET (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 (WVAR (XWINDOW (selected_window), buffer)) == current_buffer) + if (XBUFFER (WGET (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-05 15:47:28 +0000 +++ src/font.c 2012-08-06 10:24:26 +0000 @@ -3665,7 +3665,7 @@ } } - f = XFRAME (WVAR (w, frame)); + f = XFRAME (WGET (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 (WVAR (w, frame)), face_id); + face = FACE_FROM_ID (XFRAME (WGET (w, frame)), face_id); } } else === modified file 'src/fontset.c' --- src/fontset.c 2012-08-06 05:27:54 +0000 +++ src/fontset.c 2012-08-06 10:24:26 +0000 @@ -1841,7 +1841,7 @@ if (NILP (window)) return Qnil; w = XWINDOW (window); - f = XFRAME (WVAR (w, frame)); + f = XFRAME (WGET (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-06 05:27:54 +0000 +++ src/frame.c 2012-08-06 10:24:26 +0000 @@ -132,15 +132,15 @@ struct window *w = XWINDOW (window); w->last_modified = 0; - XSETFASTINT (WVAR (w, top_line), XFASTINT (WVAR (w, top_line)) + n); - XSETFASTINT (WVAR (w, total_lines), XFASTINT (WVAR (w, total_lines)) - n); + WSET (w, top_line, make_number (XFASTINT (WGET (w, top_line)) + n)); + WSET (w, total_lines, make_number (XFASTINT (WGET (w, total_lines)) - n)); /* Handle just the top child in a vertical split. */ - if (!NILP (WVAR (w, vchild))) - set_menu_bar_lines_1 (WVAR (w, vchild), n); + if (!NILP (WGET (w, vchild))) + set_menu_bar_lines_1 (WGET (w, vchild), n); /* Adjust all children in a horizontal split. */ - for (window = WVAR (w, hchild); !NILP (window); window = WVAR (w, next)) + for (window = WGET (w, hchild); !NILP (window); window = WGET (w, next)) { w = XWINDOW (window); set_menu_bar_lines_1 (window, n); @@ -289,20 +289,20 @@ if (mini_p) { mini_window = make_window (); - WVAR (XWINDOW (root_window), next) = mini_window; - WVAR (XWINDOW (mini_window), prev) = root_window; + WSET (XWINDOW (root_window), next, mini_window); + WSET (XWINDOW (mini_window), prev, root_window); XWINDOW (mini_window)->mini = 1; - WVAR (XWINDOW (mini_window), frame) = frame; + WSET (XWINDOW (mini_window), frame, frame); FSET (f, minibuffer_window, mini_window); } else { mini_window = Qnil; - WVAR (XWINDOW (root_window), next) = Qnil; + WSET (XWINDOW (root_window), next, Qnil); FSET (f, minibuffer_window, Qnil); } - WVAR (XWINDOW (root_window), frame) = frame; + WSET (XWINDOW (root_window), frame, frame); /* 10 is arbitrary, just so that there is "something there." @@ -311,21 +311,21 @@ SET_FRAME_COLS (f, 10); FRAME_LINES (f) = 10; - XSETFASTINT (WVAR (XWINDOW (root_window), total_cols), 10); - XSETFASTINT (WVAR (XWINDOW (root_window), total_lines), (mini_p ? 9 : 10)); + WSET (XWINDOW (root_window), total_cols, make_number (10)); + WSET (XWINDOW (root_window), total_lines, make_number (mini_p ? 9 : 10)); if (mini_p) { - XSETFASTINT (WVAR (XWINDOW (mini_window), total_cols), 10); - XSETFASTINT (WVAR (XWINDOW (mini_window), top_line), 9); - XSETFASTINT (WVAR (XWINDOW (mini_window), total_lines), 1); + WSET (XWINDOW (mini_window), total_cols, make_number (10)); + WSET (XWINDOW (mini_window), top_line, make_number (9)); + WSET (XWINDOW (mini_window), total_lines, make_number (1)); } /* Choose a buffer for the frame's root window. */ { Lisp_Object buf; - WVAR (XWINDOW (root_window), buffer) = Qt; + WSET (XWINDOW (root_window), buffer, Qt); buf = Fcurrent_buffer (); /* If buf is a 'hidden' buffer (i.e. one whose name starts with a space), try to find another one. */ @@ -344,7 +344,7 @@ if (mini_p) { - WVAR (XWINDOW (mini_window), buffer) = Qt; + WSET (XWINDOW (mini_window), buffer, Qt); set_window_buffer (mini_window, (NILP (Vminibuffer_list) ? get_minibuffer (0) @@ -376,7 +376,7 @@ CHECK_LIVE_WINDOW (mini_window); if (!NILP (mini_window) - && FRAME_KBOARD (XFRAME (WVAR (XWINDOW (mini_window), frame))) != kb) + && FRAME_KBOARD (XFRAME (WGET (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 (WVAR (XWINDOW (mini_window), buffer), Vminibuffer_list))) + if (NILP (Fmemq (WGET (XWINDOW (mini_window), buffer), Vminibuffer_list))) Fset_window_buffer (mini_window, (NILP (Vminibuffer_list) ? get_minibuffer (0) @@ -439,9 +439,9 @@ mini_window = FSET (f, minibuffer_window, FGET (f, root_window)); XWINDOW (mini_window)->mini = 1; - WVAR (XWINDOW (mini_window), next) = Qnil; - WVAR (XWINDOW (mini_window), prev) = Qnil; - WVAR (XWINDOW (mini_window), frame) = frame; + WSET (XWINDOW (mini_window), next, Qnil); + WSET (XWINDOW (mini_window), prev, Qnil); + WSET (XWINDOW (mini_window), frame, frame); /* Put the proper buffer in that window. */ @@ -1241,7 +1241,7 @@ if (EQ (FGET (f, minibuffer_window), minibuf_window)) { Fset_window_buffer (FGET (sf, minibuffer_window), - WVAR (XWINDOW (minibuf_window), buffer), Qnil); + WGET (XWINDOW (minibuf_window), buffer), Qnil); minibuf_window = FGET (sf, minibuffer_window); /* If the dying minibuffer window was selected, @@ -1672,17 +1672,17 @@ { struct window *w; - for (;!NILP (window); window = WVAR (w, next)) + for (;!NILP (window); window = WGET (w, next)) { w = XWINDOW (window); - if (!NILP (WVAR (w, buffer))) - BVAR (XBUFFER (WVAR (w, buffer)), display_time) = Fcurrent_time (); + if (!NILP (WGET (w, buffer))) + BVAR (XBUFFER (WGET (w, buffer)), display_time) = Fcurrent_time (); - if (!NILP (WVAR (w, vchild))) - make_frame_visible_1 (WVAR (w, vchild)); - if (!NILP (WVAR (w, hchild))) - make_frame_visible_1 (WVAR (w, hchild)); + if (!NILP (WGET (w, vchild))) + make_frame_visible_1 (WGET (w, vchild)); + if (!NILP (WGET (w, hchild))) + make_frame_visible_1 (WGET (w, hchild)); } } @@ -1714,7 +1714,7 @@ { struct frame *sf = XFRAME (selected_frame); Fset_window_buffer (FGET (sf, minibuffer_window), - WVAR (XWINDOW (minibuf_window), buffer), Qnil); + WGET (XWINDOW (minibuf_window), buffer), Qnil); minibuf_window = FGET (sf, minibuffer_window); } @@ -1752,7 +1752,7 @@ { struct frame *sf = XFRAME (selected_frame); Fset_window_buffer (FGET (sf, minibuffer_window), - WVAR (XWINDOW (minibuf_window), buffer), Qnil); + WGET (XWINDOW (minibuf_window), buffer), Qnil); minibuf_window = FGET (sf, minibuffer_window); } === modified file 'src/frame.h' --- src/frame.h 2012-08-06 05:27:54 +0000 +++ src/frame.h 2012-08-06 10:24:26 +0000 @@ -517,7 +517,7 @@ #define XSETFRAME(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FRAME)) /* Given a window, return its frame as a Lisp_Object. */ -#define WINDOW_FRAME(w) WVAR (w, frame) +#define WINDOW_FRAME(w) WGET (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-06 05:27:54 +0000 +++ src/fringe.c 2012-08-06 10:24:26 +0000 @@ -692,7 +692,7 @@ { Lisp_Object cmap, bm = Qnil; - if ((cmap = BVAR (XBUFFER (WVAR (w, buffer)), fringe_cursor_alist)), !NILP (cmap)) + if ((cmap = BVAR (XBUFFER (WGET (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 (WVAR (w, buffer)), fringe_indicator_alist)), !NILP (cmap)) + if ((cmap = BVAR (XBUFFER (WGET (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 (WVAR (w, buffer)), indicate_buffer_boundaries), !NILP (ind))) + && (ind = BVAR (XBUFFER (WGET (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 (WVAR (w, buffer))) + if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (WGET (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 (WVAR (w, buffer))) + if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (WGET (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 (WVAR (w, buffer)), indicate_empty_lines); + empty_pos = BVAR (XBUFFER (WGET (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 (WVAR (w, pointm))->charpos; + textpos = XMARKER (WGET (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-01 05:11:36 +0000 +++ src/indent.c 2012-08-06 10:24:26 +0000 @@ -258,7 +258,7 @@ the next property change */ prop = Fget_char_property (position, Qinvisible, (!NILP (window) - && EQ (WVAR (XWINDOW (window), buffer), buffer)) + && EQ (WGET (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 (WVAR (win, frame)))) + if (!FRAME_WINDOW_P (XFRAME (WGET (win, frame)))) #endif width -= 1; } continuation_glyph_width = 1; #ifdef HAVE_WINDOW_SYSTEM - if (FRAME_WINDOW_P (XFRAME (WVAR (win, frame)))) + if (FRAME_WINDOW_P (XFRAME (WGET (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 (WVAR (w, frame))) ? 0 : + FRAME_WINDOW_P (XFRAME (WGET (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 (WVAR (w, buffer), Fcurrent_buffer ())) + if (EQ (WGET (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 (WVAR (w, buffer)) != current_buffer) + if (XBUFFER (WGET (w, buffer)) != current_buffer) { /* Set the window's buffer temporarily to the current buffer. */ - old_buffer = WVAR (w, buffer); - old_charpos = XMARKER (WVAR (w, pointm))->charpos; - old_bytepos = XMARKER (WVAR (w, pointm))->bytepos; - XSETBUFFER (WVAR (w, buffer), current_buffer); - set_marker_both (WVAR (w, pointm), WVAR (w, buffer), + old_buffer = WGET (w, buffer); + old_charpos = XMARKER (WGET (w, pointm))->charpos; + old_bytepos = XMARKER (WGET (w, pointm))->bytepos; + WSET (w, buffer, Fcurrent_buffer ()); + set_marker_both (WGET (w, pointm), WGET (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 (WVAR (w, frame))) + 0.5), + (int)(cols * FRAME_COLUMN_WIDTH (XFRAME (WGET (w, frame))) + 0.5), MOVE_TO_X); } @@ -2147,8 +2147,8 @@ if (BUFFERP (old_buffer)) { - WVAR (w, buffer) = old_buffer; - set_marker_both (WVAR (w, pointm), WVAR (w, buffer), + WSET (w, buffer, old_buffer); + set_marker_both (WGET (w, pointm), WGET (w, buffer), old_charpos, old_bytepos); } === modified file 'src/insdel.c' --- src/insdel.c 2012-08-01 05:11:36 +0000 +++ src/insdel.c 2012-08-06 10:24:26 +0000 @@ -1820,7 +1820,7 @@ /* Let redisplay consider other windows than selected_window if modifying another buffer. */ - if (XBUFFER (WVAR (XWINDOW (selected_window), buffer)) != current_buffer) + if (XBUFFER (WGET (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-05 15:47:28 +0000 +++ src/keyboard.c 2012-08-06 10:24:26 +0000 @@ -800,7 +800,7 @@ update_mode_lines = 1; if (command_loop_level - && current_buffer != XBUFFER (WVAR (XWINDOW (selected_window), buffer))) + && current_buffer != XBUFFER (WGET (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 (WVAR (XWINDOW (selected_window), buffer)) != current_buffer) - set_buffer_internal (XBUFFER (WVAR (XWINDOW (selected_window), buffer))); + if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) != current_buffer) + set_buffer_internal (XBUFFER (WGET (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 (WVAR (XWINDOW (selected_window), buffer)) != current_buffer) - set_buffer_internal (XBUFFER (WVAR (XWINDOW (selected_window), buffer))); + if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) != current_buffer) + set_buffer_internal (XBUFFER (WGET (XWINDOW (selected_window), buffer))); ++num_input_keys; @@ -1484,7 +1484,7 @@ { struct buffer *b; XWINDOW (selected_window)->force_start = 0; - b = XBUFFER (WVAR (XWINDOW (selected_window), buffer)); + b = XBUFFER (WGET (XWINDOW (selected_window), buffer)); BUF_BEG_UNCHANGED (b) = BUF_END_UNCHANGED (b) = 0; } @@ -5174,8 +5174,8 @@ if (STRINGP (string)) string_info = Fcons (string, make_number (charpos)); textpos = (w == XWINDOW (selected_window) - && current_buffer == XBUFFER (WVAR (w, buffer))) - ? PT : XMARKER (WVAR (w, pointm))->charpos; + && current_buffer == XBUFFER (WGET (w, buffer))) + ? PT : XMARKER (WGET (w, pointm))->charpos; xret = wx; yret = wy; @@ -5563,7 +5563,7 @@ int fuzz; if (WINDOWP (event->frame_or_window)) - f = XFRAME (WVAR (XWINDOW (event->frame_or_window), frame)); + f = XFRAME (WGET (XWINDOW (event->frame_or_window), frame)); else if (FRAMEP (event->frame_or_window)) f = XFRAME (event->frame_or_window); else @@ -5731,7 +5731,7 @@ int is_double; if (WINDOWP (event->frame_or_window)) - fr = XFRAME (WVAR (XWINDOW (event->frame_or_window), frame)); + fr = XFRAME (WGET (XWINDOW (event->frame_or_window), frame)); else if (FRAMEP (event->frame_or_window)) fr = XFRAME (event->frame_or_window); else @@ -9401,8 +9401,8 @@ { if (! FRAME_LIVE_P (XFRAME (selected_frame))) Fkill_emacs (Qnil); - if (XBUFFER (WVAR (XWINDOW (selected_window), buffer)) != current_buffer) - Fset_buffer (WVAR (XWINDOW (selected_window), buffer)); + if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) != current_buffer) + Fset_buffer (WGET (XWINDOW (selected_window), buffer)); } orig_local_map = get_local_map (PT, current_buffer, Qlocal_map); @@ -9494,8 +9494,8 @@ not the current buffer. If we're at the beginning of a key sequence, switch buffers. */ if (WINDOWP (window) - && BUFFERP (WVAR (XWINDOW (window), buffer)) - && XBUFFER (WVAR (XWINDOW (window), buffer)) != current_buffer) + && BUFFERP (WGET (XWINDOW (window), buffer)) + && XBUFFER (WGET (XWINDOW (window), buffer)) != current_buffer) { ASET (raw_keybuf, raw_keybuf_count, key); raw_keybuf_count++; @@ -9516,7 +9516,7 @@ if (! FRAME_LIVE_P (XFRAME (selected_frame))) Fkill_emacs (Qnil); - set_buffer_internal (XBUFFER (WVAR (XWINDOW (window), buffer))); + set_buffer_internal (XBUFFER (WGET (XWINDOW (window), buffer))); orig_local_map = get_local_map (PT, current_buffer, Qlocal_map); orig_keymap = get_local_map (PT, current_buffer, @@ -11200,7 +11200,7 @@ ? window_box_left_offset (w, TEXT_AREA) : 0))); XSETINT (y, WINDOW_TO_FRAME_PIXEL_Y (w, XINT (y))); - frame_or_window = WVAR (w, frame); + frame_or_window = WGET (w, frame); } CHECK_LIVE_FRAME (frame_or_window); === modified file 'src/keymap.c' --- src/keymap.c 2012-08-05 15:47:28 +0000 +++ src/keymap.c 2012-08-06 10:24:26 +0000 @@ -1560,8 +1560,8 @@ window = POSN_WINDOW (position); if (WINDOWP (window) - && BUFFERP (WVAR (XWINDOW (window), buffer)) - && XBUFFER (WVAR (XWINDOW (window), buffer)) != current_buffer) + && BUFFERP (WGET (XWINDOW (window), buffer)) + && XBUFFER (WGET (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 (WVAR (XWINDOW (window), buffer))); + set_buffer_internal (XBUFFER (WGET (XWINDOW (window), buffer))); } } === modified file 'src/lisp.h' --- src/lisp.h 2012-08-05 15:47:28 +0000 +++ src/lisp.h 2012-08-06 10:24:26 +0000 @@ -1787,7 +1787,7 @@ vchild, and hchild members are all nil. */ #define CHECK_LIVE_WINDOW(x) \ - CHECK_TYPE (WINDOWP (x) && !NILP (WVAR (XWINDOW (x), buffer)), \ + CHECK_TYPE (WINDOWP (x) && !NILP (WGET (XWINDOW (x), buffer)), \ Qwindow_live_p, x) #define CHECK_PROCESS(x) \ === modified file 'src/minibuf.c' --- src/minibuf.c 2012-08-06 05:27:54 +0000 +++ src/minibuf.c 2012-08-06 10:24:26 +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 = WVAR (XWINDOW (minibuf_window), buffer); + buffer = WGET (XWINDOW (minibuf_window), buffer); if (BUFFERP (buffer)) Fset_window_buffer (FGET (sf, minibuffer_window), buffer, Qnil); minibuf_window = FGET (sf, minibuffer_window); @@ -612,7 +612,7 @@ FOR_EACH_FRAME (dummy, frame) { Lisp_Object root_window = Fframe_root_window (frame); - Lisp_Object mini_window = WVAR (XWINDOW (root_window), next); + Lisp_Object mini_window = WGET (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 (WVAR (XWINDOW (minibuf_window), frame)); + struct frame *f = XFRAME (WGET (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 (WVAR (XWINDOW (window), buffer)); + Fset_buffer (WGET (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-06 05:27:54 +0000 +++ src/msdos.c 2012-08-06 10:24:26 +0000 @@ -594,7 +594,7 @@ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); Lisp_Object window = hlinfo->mouse_face_window; - if (! NILP (window) && XFRAME (WVAR (XWINDOW (window), frame)) == f) + if (! NILP (window) && XFRAME (WGET (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 (WVAR (w, buffer))) + if (NILP (WGET (w, buffer))) hlinfo->mouse_face_window = Qnil; else { @@ -1265,7 +1265,7 @@ break; } - if (NILP (WVAR (w, buffer)) || i < w->desired_matrix->nrows) + if (NILP (WGET (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 (WVAR (sw, buffer)); + struct buffer *b = XBUFFER (WGET (sw, buffer)); if (EQ (BVAR (b,cursor_type), Qt)) new_cursor = frame_desired_cursor; === modified file 'src/nsfns.m' --- src/nsfns.m 2012-08-06 05:27:54 +0000 +++ src/nsfns.m 2012-08-06 10:24:26 +0000 @@ -607,7 +607,7 @@ { NSView *view; Lisp_Object name, filename; - Lisp_Object buf = WVAR (XWINDOW (FGET (f, selected_window)), buffer); + Lisp_Object buf = WGET (XWINDOW (FGET (f, selected_window)), buffer); const char *title; NSAutoreleasePool *pool; struct gcpro gcpro1; === modified file 'src/nsmenu.m' --- src/nsmenu.m 2012-08-06 05:27:54 +0000 +++ src/nsmenu.m 2012-08-06 10:24:26 +0000 @@ -193,7 +193,7 @@ = alloca (previous_menu_items_used * sizeof *previous_items); /* lisp preliminaries */ - buffer = WVAR (XWINDOW (FRAME_SELECTED_WINDOW (f)), buffer); + buffer = WGET (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-06 05:27:54 +0000 +++ src/nsterm.m 2012-08-06 10:24:26 +0000 @@ -667,7 +667,7 @@ external (RIF) call; for one window called before update_end -------------------------------------------------------------------------- */ { - Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WVAR (w, frame))); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WGET (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 (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (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 (WVAR (w, frame)), + && (f = XFRAME (WGET (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 (WVAR (window, vertical_scroll_bar))) + if (!NILP (WGET (window, vertical_scroll_bar))) { - bar = XNS_SCROLL_BAR (WVAR (window, vertical_scroll_bar)); + bar = XNS_SCROLL_BAR (WGET (window, vertical_scroll_bar)); if ([bar checkSamePosition: position portion: portion whole: whole]) { if (view->scrollbarsNeedingUpdate == 0) @@ -3672,27 +3672,27 @@ /* we want at least 5 lines to display a scrollbar */ if (WINDOW_TOTAL_LINES (window) < 5) { - if (!NILP (WVAR (window, vertical_scroll_bar))) + if (!NILP (WGET (window, vertical_scroll_bar))) { - bar = XNS_SCROLL_BAR (WVAR (window, vertical_scroll_bar)); + bar = XNS_SCROLL_BAR (WGET (window, vertical_scroll_bar)); [bar removeFromSuperview]; - WVAR (window, vertical_scroll_bar) = Qnil; + WSET (window, vertical_scroll_bar, Qnil); } ns_clear_frame_area (f, sb_left, top, width, height); UNBLOCK_INPUT; return; } - if (NILP (WVAR (window, vertical_scroll_bar))) + if (NILP (WGET (window, vertical_scroll_bar))) { ns_clear_frame_area (f, sb_left, top, width, height); bar = [[EmacsScroller alloc] initFrame: r window: win]; - WVAR (window, vertical_scroll_bar) = make_save_value (bar, 0); + WSET (window, vertical_scroll_bar, make_save_value (bar, 0)); } else { NSRect oldRect; - bar = XNS_SCROLL_BAR (WVAR (window, vertical_scroll_bar)); + bar = XNS_SCROLL_BAR (WGET (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 (WVAR (window, vertical_scroll_bar))) + if (!NILP (WGET (window, vertical_scroll_bar))) { - bar = XNS_SCROLL_BAR (WVAR (window, vertical_scroll_bar)); + bar = XNS_SCROLL_BAR (WGET (window, vertical_scroll_bar)); [bar reprieve]; } } @@ -6062,7 +6062,7 @@ Lisp_Object str = Qnil; struct frame *f = SELECTED_FRAME (); struct buffer *curbuf - = XBUFFER (WVAR (XWINDOW (FGET (f, selected_window)), buffer)); + = XBUFFER (WGET (XWINDOW (FGET (f, selected_window)), buffer)); if ([attribute isEqualToString:NSAccessibilityRoleAttribute]) return NSAccessibilityTextFieldRole; @@ -6237,7 +6237,7 @@ if (pixel_height == 0) pixel_height = 1; min_portion = 20 / pixel_height; - frame = XFRAME (WVAR (XWINDOW (win), frame)); + frame = XFRAME (WGET (XWINDOW (win), frame)); if (FRAME_LIVE_P (frame)) { int i; @@ -6276,7 +6276,7 @@ { NSTRACE (EmacsScroller_dealloc); if (!NILP (win)) - WVAR (XWINDOW (win), vertical_scroll_bar) = Qnil; + WSET (XWINDOW (win), vertical_scroll_bar, Qnil); [super dealloc]; } === modified file 'src/print.c' --- src/print.c 2012-08-06 05:27:54 +0000 +++ src/print.c 2012-08-06 10:24:26 +0000 @@ -1773,10 +1773,10 @@ strout ("#sequence_number); strout (buf, len, len, printcharfun); - if (!NILP (WVAR (XWINDOW (obj), buffer))) + if (!NILP (WGET (XWINDOW (obj), buffer))) { strout (" on ", -1, -1, printcharfun); - print_string (BVAR (XBUFFER (WVAR (XWINDOW (obj), buffer)), name), + print_string (BVAR (XBUFFER (WGET (XWINDOW (obj), buffer)), name), printcharfun); } PRINTCHAR ('>'); === modified file 'src/textprop.c' --- src/textprop.c 2012-08-01 05:11:36 +0000 +++ src/textprop.c 2012-08-06 10:24:26 +0000 @@ -587,7 +587,7 @@ if (WINDOWP (object)) { w = XWINDOW (object); - object = WVAR (w, buffer); + object = WGET (w, buffer); } if (BUFFERP (object)) { === modified file 'src/w32fns.c' --- src/w32fns.c 2012-08-06 05:27:54 +0000 +++ src/w32fns.c 2012-08-06 10:24:26 +0000 @@ -5617,7 +5617,8 @@ /* Set up the frame's root window. */ w = XWINDOW (FRAME_ROOT_WINDOW (f)); - WVAR (w, left_col) = WVAR (w, top_line) = make_number (0); + WSET (w, left_col, make_number (0)); + WSET (w, top_line, make_number (0)); if (CONSP (Vx_max_tooltip_size) && INTEGERP (XCAR (Vx_max_tooltip_size)) @@ -5625,22 +5626,22 @@ && INTEGERP (XCDR (Vx_max_tooltip_size)) && XINT (XCDR (Vx_max_tooltip_size)) > 0) { - WVAR (w, total_cols) = XCAR (Vx_max_tooltip_size); - WVAR (w, total_lines) = XCDR (Vx_max_tooltip_size); + WSET (w, total_cols, XCAR (Vx_max_tooltip_size)); + WSET (w, total_lines, XCDR (Vx_max_tooltip_size)); } else { - WVAR (w, total_cols) = make_number (80); - WVAR (w, total_lines) = make_number (40); + WSET (w, total_cols, make_number (80)); + WSET (w, total_lines, make_number (40)); } - FRAME_TOTAL_COLS (f) = XINT (WVAR (w, total_cols)); + FRAME_TOTAL_COLS (f) = XINT (WGET (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 (WVAR (XWINDOW (FRAME_ROOT_WINDOW (f)), buffer))); + set_buffer_internal_1 (XBUFFER (WGET (XWINDOW (FRAME_ROOT_WINDOW (f)), buffer))); BVAR (current_buffer, truncate_lines) = Qnil; clear_glyph_matrix (w->desired_matrix); clear_glyph_matrix (w->current_matrix); @@ -5702,7 +5703,7 @@ /* w->total_cols and FRAME_TOTAL_COLS want the width in columns, not in pixels. */ width /= WINDOW_FRAME_COLUMN_WIDTH (w); - WVAR (w, total_cols) = make_number (width); + WSET (w, total_cols, make_number (width)); FRAME_TOTAL_COLS (f) = width; adjust_glyphs (f); w->pseudo_window_p = 1; === modified file 'src/w32menu.c' --- src/w32menu.c 2012-08-06 05:27:54 +0000 +++ src/w32menu.c 2012-08-06 10:24:26 +0000 @@ -394,7 +394,7 @@ if (! menubar_widget) previous_menu_items_used = 0; - buffer = WVAR (XWINDOW (FRAME_SELECTED_WINDOW (f)), buffer); + buffer = WGET (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-06 09:28:17 +0000 +++ src/w32term.c 2012-08-06 10:24:26 +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 (WVAR (w, frame))); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WGET (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 (WVAR (w, frame)), + && (f = XFRAME (WGET (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 (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); int x, y, width, height, from_y, to_y, bottom_y; HWND hwnd = FRAME_W32_WINDOW (f); HRGN expect_dirty; @@ -3670,7 +3670,7 @@ my_destroy_window (f, SCROLL_BAR_W32_WINDOW (bar)); /* Dissociate this scroll bar from its window. */ - WVAR (XWINDOW (bar->window), vertical_scroll_bar) = Qnil; + WSET (XWINDOW (bar->window), vertical_scroll_bar, Qnil); UNBLOCK_INPUT; } @@ -3683,7 +3683,7 @@ w32_set_vertical_scroll_bar (struct window *w, int portion, int whole, int position) { - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); struct scroll_bar *bar; int top, height, left, sb_left, width, sb_width; int window_y, window_height; @@ -3723,7 +3723,7 @@ || WINDOW_RIGHT_MARGIN_COLS (w) == 0)); /* Does the scroll bar exist yet? */ - if (NILP (WVAR (w, vertical_scroll_bar))) + if (NILP (WGET (w, vertical_scroll_bar))) { HDC hdc; BLOCK_INPUT; @@ -3745,7 +3745,7 @@ /* It may just need to be moved and resized. */ HWND hwnd; - bar = XSCROLL_BAR (WVAR (w, vertical_scroll_bar)); + bar = XSCROLL_BAR (WGET (w, vertical_scroll_bar)); hwnd = SCROLL_BAR_W32_WINDOW (bar); /* If already correctly positioned, do nothing. */ @@ -3807,7 +3807,7 @@ w32_set_scroll_bar_thumb (bar, portion, position, whole); - XSETVECTOR (WVAR (w, vertical_scroll_bar), bar); + XSETVECTOR (WGET (w, vertical_scroll_bar), bar); } @@ -3852,10 +3852,10 @@ struct frame *f; /* We can't redeem this window's scroll bar if it doesn't have one. */ - if (NILP (WVAR (window, vertical_scroll_bar))) + if (NILP (WGET (window, vertical_scroll_bar))) abort (); - bar = XSCROLL_BAR (WVAR (window, vertical_scroll_bar)); + bar = XSCROLL_BAR (WGET (window, vertical_scroll_bar)); /* Unlink it from the condemned list. */ f = XFRAME (WINDOW_FRAME (window)); @@ -3863,11 +3863,11 @@ { /* If the prev pointer is nil, it must be the first in one of the lists. */ - if (EQ (FRAME_SCROLL_BARS (f), WVAR (window, vertical_scroll_bar))) + if (EQ (FRAME_SCROLL_BARS (f), WGET (window, vertical_scroll_bar))) /* It's not condemned. Everything's fine. */ return; else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), - WVAR (window, vertical_scroll_bar))) + WGET (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 @@ -4426,8 +4426,8 @@ create event iff we don't leave the selected frame. */ && (focus_follows_mouse - || (EQ (WVAR (XWINDOW (window), frame), - WVAR (XWINDOW (selected_window), frame))))) + || (EQ (WGET (XWINDOW (window), frame), + WGET (XWINDOW (selected_window), frame))))) { inev.kind = SELECT_WINDOW_EVENT; inev.frame_or_window = window; @@ -5042,7 +5042,7 @@ x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text_cursor_kinds kind) { - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (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-06 08:32:49 +0000 +++ src/window.c 2012-08-06 10:24:26 +0000 @@ -178,7 +178,7 @@ If WINDOW is omitted or nil, it defaults to the selected window. */) (Lisp_Object window) { - return WVAR (decode_any_window (window), frame); + return WGET (decode_any_window (window), frame); } DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0, @@ -244,12 +244,12 @@ window = FGET (XFRAME (frame_or_window), root_window); } - while (NILP (WVAR (XWINDOW (window), buffer))) + while (NILP (WGET (XWINDOW (window), buffer))) { - if (! NILP (WVAR (XWINDOW (window), hchild))) - window = WVAR (XWINDOW (window), hchild); - else if (! NILP (WVAR (XWINDOW (window), vchild))) - window = WVAR (XWINDOW (window), vchild); + if (! NILP (WGET (XWINDOW (window), hchild))) + window = WGET (XWINDOW (window), hchild); + else if (! NILP (WGET (XWINDOW (window), vchild))) + window = WGET (XWINDOW (window), vchild); else abort (); } @@ -338,7 +338,7 @@ if (NILP (norecord)) { w->use_time = ++window_select_count; - record_buffer (WVAR (w, buffer)); + record_buffer (WGET (w, buffer)); } if (EQ (window, selected_window) && !inhibit_point_swap) @@ -366,17 +366,17 @@ if (!inhibit_point_swap) { ow = XWINDOW (selected_window); - if (! NILP (WVAR (ow, buffer))) - set_marker_both (WVAR (ow, pointm), WVAR (ow, buffer), - BUF_PT (XBUFFER (WVAR (ow, buffer))), - BUF_PT_BYTE (XBUFFER (WVAR (ow, buffer)))); + 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)))); } selected_window = window; - Fset_buffer (WVAR (w, buffer)); + Fset_buffer (WGET (w, buffer)); - BVAR (XBUFFER (WVAR (w, buffer)), last_selected_window) = window; + BVAR (XBUFFER (WGET (w, buffer)), last_selected_window) = window; /* Go to the point recorded in the window. This is important when the buffer is in more @@ -384,7 +384,7 @@ redisplay_window has altered point after scrolling, because it makes the change only in the window. */ { - register ptrdiff_t new_point = marker_position (WVAR (w, pointm)); + register ptrdiff_t new_point = marker_position (WGET (w, pointm)); if (new_point < BEGV) SET_PT (BEGV); else if (new_point > ZV) @@ -419,7 +419,7 @@ Return nil for an internal window or a deleted window. */) (Lisp_Object window) { - return WVAR (decode_any_window (window), buffer); + return WGET (decode_any_window (window), buffer); } DEFUN ("window-parent", Fwindow_parent, Swindow_parent, 0, 1, 0, @@ -428,7 +428,7 @@ Return nil for a window with no parent (e.g. a root window). */) (Lisp_Object window) { - return WVAR (decode_any_window (window), parent); + return WGET (decode_any_window (window), parent); } DEFUN ("window-top-child", Fwindow_top_child, Swindow_top_child, 1, 1, 0, @@ -439,7 +439,7 @@ (Lisp_Object window) { CHECK_WINDOW (window); - return WVAR (decode_any_window (window), vchild); + return WGET (decode_any_window (window), vchild); } DEFUN ("window-left-child", Fwindow_left_child, Swindow_left_child, 1, 1, 0, @@ -450,7 +450,7 @@ (Lisp_Object window) { CHECK_WINDOW (window); - return WVAR (decode_any_window (window), hchild); + return WGET (decode_any_window (window), hchild); } DEFUN ("window-next-sibling", Fwindow_next_sibling, Swindow_next_sibling, 0, 1, 0, @@ -459,7 +459,7 @@ Return nil if WINDOW has no next sibling. */) (Lisp_Object window) { - return WVAR (decode_any_window (window), next); + return WGET (decode_any_window (window), next); } DEFUN ("window-prev-sibling", Fwindow_prev_sibling, Swindow_prev_sibling, 0, 1, 0, @@ -468,7 +468,7 @@ Return nil if WINDOW has no previous sibling. */) (Lisp_Object window) { - return WVAR (decode_any_window (window), prev); + return WGET (decode_any_window (window), prev); } DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 1, 1, 0, @@ -478,7 +478,7 @@ WINDOW are never \(re-)combined with WINDOW's siblings. */) (Lisp_Object window) { - return WVAR (decode_any_window (window), combination_limit); + return WGET (decode_any_window (window), combination_limit); } DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0, @@ -489,9 +489,7 @@ for future use. */) (Lisp_Object window, Lisp_Object limit) { - register struct window *w = decode_any_window (window); - WVAR (w, combination_limit) = limit; - return WVAR (w, combination_limit); + return WSET (decode_any_window (window), combination_limit, limit); } DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0, @@ -517,7 +515,7 @@ integer multiple of the default character height. */) (Lisp_Object window) { - return WVAR (decode_any_window (window), total_lines); + return WGET (decode_any_window (window), total_lines); } DEFUN ("window-total-width", Fwindow_total_width, Swindow_total_width, 0, 1, 0, @@ -532,7 +530,7 @@ integer multiple of the default character width. */) (Lisp_Object window) { - return WVAR (decode_any_window (window), total_cols); + return WGET (decode_any_window (window), total_cols); } DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0, @@ -540,7 +538,7 @@ If WINDOW is omitted or nil, it defaults to the selected window. */) (Lisp_Object window) { - return WVAR (decode_any_window (window), new_total); + return WGET (decode_any_window (window), new_total); } DEFUN ("window-normal-size", Fwindow_normal_size, Swindow_normal_size, 0, 2, 0, @@ -550,9 +548,9 @@ (Lisp_Object window, Lisp_Object horizontal) { if (NILP (horizontal)) - return WVAR (decode_any_window (window), normal_lines); + return WGET (decode_any_window (window), normal_lines); else - return WVAR (decode_any_window (window), normal_cols); + return WGET (decode_any_window (window), normal_cols); } DEFUN ("window-new-normal", Fwindow_new_normal, Swindow_new_normal, 0, 1, 0, @@ -560,7 +558,7 @@ If WINDOW is omitted or nil, it defaults to the selected window. */) (Lisp_Object window) { - return WVAR (decode_any_window (window), new_normal); + return WGET (decode_any_window (window), new_normal); } DEFUN ("window-left-column", Fwindow_left_column, Swindow_left_column, 0, 1, 0, @@ -572,7 +570,7 @@ If WINDOW is omitted or nil, it defaults to the selected window. */) (Lisp_Object window) { - return WVAR (decode_any_window (window), left_col); + return WGET (decode_any_window (window), left_col); } DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0, @@ -584,7 +582,7 @@ If WINDOW is omitted or nil, it defaults to the selected window. */) (Lisp_Object window) { - return WVAR (decode_any_window (window), top_line); + return WGET (decode_any_window (window), top_line); } /* Return the number of lines of W's body. Don't count any mode or @@ -593,7 +591,7 @@ static int window_body_lines (struct window *w) { - int height = XFASTINT (WVAR (w, total_lines)); + int height = XFASTINT (WGET (w, total_lines)); if (!MINI_WINDOW_P (w)) { @@ -615,7 +613,7 @@ window_body_cols (struct window *w) { struct frame *f = XFRAME (WINDOW_FRAME (w)); - int width = XINT (WVAR (w, total_cols)); + int width = XINT (WGET (w, total_cols)); if (WINDOW_HAS_VERTICAL_SCROLL_BAR (w)) /* Scroll bars occupy a few columns. */ @@ -690,7 +688,7 @@ /* Prevent redisplay shortcuts when changing the hscroll. */ if (w->hscroll != new_hscroll) - XBUFFER (WVAR (w, buffer))->prevent_redisplay_optimizations_p = 1; + XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1; w->hscroll = new_hscroll; return make_number (new_hscroll); @@ -719,7 +717,7 @@ See `set-window-redisplay-end-trigger' for more information. */) (Lisp_Object window) { - return WVAR (decode_window (window), redisplay_end_trigger); + return WGET (decode_window (window), redisplay_end_trigger); } DEFUN ("set-window-redisplay-end-trigger", Fset_window_redisplay_end_trigger, @@ -732,11 +730,7 @@ Afterwards the end-trigger value is reset to nil. */) (register Lisp_Object window, Lisp_Object value) { - register struct window *w; - - w = decode_window (window); - WVAR (w, redisplay_end_trigger) = value; - return value; + return WSET (decode_window (window), redisplay_end_trigger, value); } DEFUN ("window-edges", Fwindow_edges, Swindow_edges, 0, 1, 0, @@ -785,7 +779,7 @@ static void calc_absolute_offset (struct window *w, int *add_x, int *add_y) { - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); *add_y = f->top_pos; #ifdef FRAME_MENUBAR_HEIGHT *add_y += FRAME_MENUBAR_HEIGHT (f); @@ -1095,7 +1089,7 @@ CHECK_LIVE_WINDOW (window); w = XWINDOW (window); - f = XFRAME (WVAR (w, frame)); + f = XFRAME (WGET (w, frame)); CHECK_CONS (coordinates); lx = Fcar (coordinates); ly = Fcdr (coordinates); @@ -1275,9 +1269,9 @@ register struct window *w = decode_window (window); if (w == XWINDOW (selected_window) - && current_buffer == XBUFFER (WVAR (w, buffer))) + && current_buffer == XBUFFER (WGET (w, buffer))) return Fpoint (); - return Fmarker_position (WVAR (w, pointm)); + return Fmarker_position (WGET (w, pointm)); } DEFUN ("window-start", Fwindow_start, Swindow_start, 0, 1, 0, @@ -1286,7 +1280,7 @@ This is updated by redisplay or by calling `set-window-start'. */) (Lisp_Object window) { - return Fmarker_position (WVAR (decode_window (window), start)); + return Fmarker_position (WGET (decode_window (window), start)); } /* This is text temporarily removed from the doc string below. @@ -1317,7 +1311,7 @@ Lisp_Object buf; struct buffer *b; - buf = WVAR (w, buffer); + buf = WGET (w, buffer); CHECK_BUFFER (buf); b = XBUFFER (buf); @@ -1326,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 (WVAR (w, window_end_valid))) + if (NILP (WGET (w, window_end_valid))) return Qnil; #endif if (! NILP (update) - && ! (! NILP (WVAR (w, window_end_valid)) + && ! (! NILP (WGET (w, window_end_valid)) && w->last_modified >= BUF_MODIFF (b) && w->last_overlay_modified >= BUF_OVERLAY_MODIFF (b)) && !noninteractive) @@ -1354,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 (WVAR (w, start))->charpos < BEGV) + if (XMARKER (WGET (w, start))->charpos < BEGV) SET_TEXT_POS (startp, BEGV, BEGV_BYTE); - else if (XMARKER (WVAR (w, start))->charpos > ZV) + else if (XMARKER (WGET (w, start))->charpos > ZV) SET_TEXT_POS (startp, ZV, ZV_BYTE); else - SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start)); + SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start)); itdata = bidi_shelve_cache (); start_display (&it, w, startp); @@ -1373,7 +1367,7 @@ set_buffer_internal (old_buffer); } else - XSETINT (value, BUF_Z (b) - XFASTINT (WVAR (w, window_end_pos))); + XSETINT (value, BUF_Z (b) - XFASTINT (WGET (w, window_end_pos))); return value; } @@ -1387,10 +1381,10 @@ CHECK_NUMBER_COERCE_MARKER (pos); if (w == XWINDOW (selected_window) - && XBUFFER (WVAR (w, buffer)) == current_buffer) + && XBUFFER (WGET (w, buffer)) == current_buffer) Fgoto_char (pos); else - set_marker_restricted (WVAR (w, pointm), pos, WVAR (w, buffer)); + set_marker_restricted (WGET (w, pointm), pos, WGET (w, buffer)); /* We have to make sure that redisplay updates the window to show the new value of point. */ @@ -1410,7 +1404,7 @@ register struct window *w = decode_window (window); CHECK_NUMBER_COERCE_MARKER (pos); - set_marker_restricted (WVAR (w, start), pos, WVAR (w, buffer)); + set_marker_restricted (WGET (w, start), pos, WGET (w, buffer)); /* this is not right, but much easier than doing what is right. */ w->start_at_line_beg = 0; if (NILP (noforce)) @@ -1452,8 +1446,8 @@ int x, y; w = decode_window (window); - buf = XBUFFER (WVAR (w, buffer)); - SET_TEXT_POS_FROM_MARKER (top, WVAR (w, start)); + buf = XBUFFER (WGET (w, buffer)); + SET_TEXT_POS_FROM_MARKER (top, WGET (w, start)); if (EQ (pos, Qt)) posint = -1; @@ -1465,7 +1459,7 @@ else if (w == XWINDOW (selected_window)) posint = PT; else - posint = XMARKER (WVAR (w, pointm))->charpos; + posint = XMARKER (WGET (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. */ @@ -1522,11 +1516,11 @@ if (noninteractive || w->pseudo_window_p) return Qnil; - CHECK_BUFFER (WVAR (w, buffer)); - b = XBUFFER (WVAR (w, buffer)); + CHECK_BUFFER (WGET (w, buffer)); + b = XBUFFER (WGET (w, buffer)); /* Fail if current matrix is not up-to-date. */ - if (NILP (WVAR (w, window_end_valid)) + if (NILP (WGET (w, window_end_valid)) || current_buffer->clip_changed || current_buffer->prevent_redisplay_optimizations_p || w->last_modified < BUF_MODIFF (b) @@ -1619,7 +1613,7 @@ is the value returned by `window-dedicated-p' is t. */) (Lisp_Object window) { - return WVAR (decode_window (window), dedicated); + return WGET (decode_window (window), dedicated); } DEFUN ("set-window-dedicated-p", Fset_window_dedicated_p, @@ -1643,10 +1637,7 @@ window, it also makes sure that the window is no more dedicated. */) (Lisp_Object window, Lisp_Object flag) { - register struct window *w = decode_window (window); - - WVAR (w, dedicated) = flag; - return WVAR (w, dedicated); + return WSET (decode_window (window), dedicated, flag); } DEFUN ("window-prev-buffers", Fwindow_prev_buffers, Swindow_prev_buffers, @@ -1659,7 +1650,7 @@ window for that buffer, and POS is a window-specific point value. */) (Lisp_Object window) { - return WVAR (decode_window (window), prev_buffers); + return WGET (decode_window (window), prev_buffers); } DEFUN ("set-window-prev-buffers", Fset_window_prev_buffers, @@ -1672,7 +1663,7 @@ window for that buffer, and POS is a window-specific point value. */) (Lisp_Object window, Lisp_Object prev_buffers) { - return WVAR (decode_window (window), prev_buffers) = prev_buffers; + return WSET (decode_window (window), prev_buffers, prev_buffers); } DEFUN ("window-next-buffers", Fwindow_next_buffers, Swindow_next_buffers, @@ -1681,7 +1672,7 @@ WINDOW must be a live window and defaults to the selected one. */) (Lisp_Object window) { - return WVAR (decode_window (window), next_buffers); + return WGET (decode_window (window), next_buffers); } DEFUN ("set-window-next-buffers", Fset_window_next_buffers, @@ -1691,7 +1682,7 @@ NEXT-BUFFERS should be a list of buffers. */) (Lisp_Object window, Lisp_Object next_buffers) { - return WVAR (decode_window (window), next_buffers) = next_buffers; + return WSET (decode_window (window), next_buffers, next_buffers); } DEFUN ("window-parameters", Fwindow_parameters, Swindow_parameters, @@ -1701,7 +1692,7 @@ elements of the form (PARAMETER . VALUE). */) (Lisp_Object window) { - return Fcopy_alist (WVAR (decode_any_window (window), window_parameters)); + return Fcopy_alist (WGET (decode_any_window (window), window_parameters)); } DEFUN ("window-parameter", Fwindow_parameter, Swindow_parameter, @@ -1712,7 +1703,7 @@ { Lisp_Object result; - result = Fassq (parameter, WVAR (decode_any_window (window), + result = Fassq (parameter, WGET (decode_any_window (window), window_parameters)); return CDR_SAFE (result); } @@ -1726,10 +1717,10 @@ register struct window *w = decode_any_window (window); Lisp_Object old_alist_elt; - old_alist_elt = Fassq (parameter, WVAR (w, window_parameters)); + old_alist_elt = Fassq (parameter, WGET (w, window_parameters)); if (NILP (old_alist_elt)) - WVAR (w, window_parameters) - = Fcons (Fcons (parameter, value), WVAR (w, window_parameters)); + WSET (w, window_parameters, + Fcons (Fcons (parameter, value), WGET (w, window_parameters))); else Fsetcdr (old_alist_elt, value); return value; @@ -1741,7 +1732,7 @@ WINDOW defaults to the selected window. */) (Lisp_Object window) { - return WVAR (decode_window (window), display_table); + return WGET (decode_window (window), display_table); } /* Get the display table for use on window W. This is either W's @@ -1754,11 +1745,11 @@ { struct Lisp_Char_Table *dp = NULL; - if (DISP_TABLE_P (WVAR (w, display_table))) - dp = XCHAR_TABLE (WVAR (w, display_table)); - else if (BUFFERP (WVAR (w, buffer))) + if (DISP_TABLE_P (WGET (w, display_table))) + dp = XCHAR_TABLE (WGET (w, display_table)); + else if (BUFFERP (WGET (w, buffer))) { - struct buffer *b = XBUFFER (WVAR (w, buffer)); + struct buffer *b = XBUFFER (WGET (w, buffer)); if (DISP_TABLE_P (BVAR (b, display_table))) dp = XCHAR_TABLE (BVAR (b, display_table)); @@ -1773,11 +1764,7 @@ doc: /* Set WINDOW's display-table to TABLE. */) (register Lisp_Object window, Lisp_Object table) { - register struct window *w; - - w = decode_window (window); - WVAR (w, display_table) = table; - return table; + return WSET (decode_window (window), display_table, table); } /* Record info on buffer window W is displaying @@ -1788,14 +1775,14 @@ Lisp_Object buf; struct buffer *b; - buf = WVAR (w, buffer); + buf = WGET (w, buffer); b = XBUFFER (buf); - if (b != XMARKER (WVAR (w, pointm))->buffer) + if (b != XMARKER (WGET (w, pointm))->buffer) abort (); #if 0 if (w == XWINDOW (selected_window) - || ! EQ (buf, WVAR (XWINDOW (selected_window), buffer))) + || ! EQ (buf, WGET (XWINDOW (selected_window), buffer))) /* Do this except when the selected window's buffer is being removed from some other window. */ #endif @@ -1806,22 +1793,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 (WVAR (w, start)); + b->last_window_start = marker_position (WGET (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, WVAR (XWINDOW (selected_window), buffer)) + if (! EQ (buf, WGET (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, WVAR (XWINDOW (BVAR (b, last_selected_window)), buffer)))) + && EQ (buf, WGET (XWINDOW (BVAR (b, last_selected_window)), buffer)))) temp_set_point_both (b, clip_to_bounds (BUF_BEGV (b), - XMARKER (WVAR (w, pointm))->charpos, + XMARKER (WGET (w, pointm))->charpos, BUF_ZV (b)), clip_to_bounds (BUF_BEGV_BYTE (b), - marker_byte_position (WVAR (w, pointm)), + marker_byte_position (WGET (w, pointm)), BUF_ZV_BYTE (b))); if (WINDOWP (BVAR (b, last_selected_window)) @@ -1840,19 +1827,19 @@ /* 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 (WVAR (o, frame))))) - FSET (XFRAME (WVAR (o, frame)), root_window, new); + if (EQ (old, FRAME_ROOT_WINDOW (XFRAME (WGET (o, frame))))) + FSET (XFRAME (WGET (o, frame)), root_window, new); - if (setflag) - { - WVAR (n, left_col) = WVAR (o, left_col); - WVAR (n, top_line) = WVAR (o, top_line); - WVAR (n, total_cols) = WVAR (o, total_cols); - WVAR (n, total_lines) = WVAR (o, total_lines); - WVAR (n, normal_cols) = WVAR (o, normal_cols); - WVAR (o, normal_cols) = make_float (1.0); - WVAR (n, normal_lines) = WVAR (o, normal_lines); - WVAR (o, normal_lines) = make_float (1.0); + 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 (o, normal_cols, make_float (1.0)); + WSET (n, normal_lines, WGET (o, normal_lines)); + WSET (o, normal_lines, make_float (1.0)); n->desired_matrix = n->current_matrix = 0; n->vscroll = 0; memset (&n->cursor, 0, sizeof (n->cursor)); @@ -1862,27 +1849,30 @@ n->phys_cursor_width = -1; n->must_be_updated_p = 0; n->pseudo_window_p = 0; - XSETFASTINT (WVAR (n, window_end_vpos), 0); - XSETFASTINT (WVAR (n, window_end_pos), 0); - WVAR (n, window_end_valid) = Qnil; + WSET (n, window_end_vpos, make_number (0)); + WSET (n, window_end_pos, make_number (0)); + WSET (n, window_end_valid, Qnil); n->frozen_window_start_p = 0; } - WVAR (n, next) = tem = WVAR (o, next); - if (!NILP (tem)) - WVAR (XWINDOW (tem), prev) = new; - - WVAR (n, prev) = tem = WVAR (o, prev); - if (!NILP (tem)) - WVAR (XWINDOW (tem), next) = new; - - WVAR (n, parent) = tem = WVAR (o, parent); + tem = WGET (o, next); + WSET (n, next, tem); + if (!NILP (tem)) + WSET (XWINDOW (tem), prev, new); + + tem = WGET (o, prev); + WSET (n, prev, tem); + if (!NILP (tem)) + WSET (XWINDOW (tem), next, new); + + tem = WGET (o, parent); + WSET (n, parent, tem); if (!NILP (tem)) { - if (EQ (WVAR (XWINDOW (tem), vchild), old)) - WVAR (XWINDOW (tem), vchild) = new; - if (EQ (WVAR (XWINDOW (tem), hchild), old)) - WVAR (XWINDOW (tem), hchild) = new; + if (EQ (WGET (XWINDOW (tem), vchild), old)) + WSET (XWINDOW (tem), vchild, new); + if (EQ (WGET (XWINDOW (tem), hchild), old)) + WSET (XWINDOW (tem), hchild, new); } } @@ -1898,64 +1888,65 @@ int horflag; w = XWINDOW (window); - parent = WVAR (w, parent); - if (!NILP (parent) && NILP (WVAR (w, combination_limit))) + parent = WGET (w, parent); + if (!NILP (parent) && NILP (WGET (w, combination_limit))) { p = XWINDOW (parent); - if (((!NILP (WVAR (p, vchild)) && !NILP (WVAR (w, vchild))) - || (!NILP (WVAR (p, hchild)) && !NILP (WVAR (w, hchild))))) + if (((!NILP (WGET (p, vchild)) && !NILP (WGET (w, vchild))) + || (!NILP (WGET (p, hchild)) && !NILP (WGET (w, hchild))))) /* WINDOW and PARENT are both either a vertical or a horizontal combination. */ { - horflag = NILP (WVAR (w, vchild)); - child = horflag ? WVAR (w, hchild) : WVAR (w, vchild); + horflag = NILP (WGET (w, vchild)); + child = horflag ? WGET (w, hchild) : WGET (w, vchild); c = XWINDOW (child); /* Splice WINDOW's children into its parent's children and assign new normal sizes. */ - if (NILP (WVAR (w, prev))) + if (NILP (WGET (w, prev))) if (horflag) - WVAR (p, hchild) = child; + WSET (p, hchild, child); else - WVAR (p, vchild) = child; + WSET (p, vchild, child); else { - WVAR (c, prev) = WVAR (w, prev); - WVAR (XWINDOW (WVAR (w, prev)), next) = child; + WSET (c, prev, WGET (w, prev)); + WSET (XWINDOW (WGET (w, prev)), next, child); } while (c) { - WVAR (c, parent) = parent; + WSET (c, parent, parent); if (horflag) - WVAR (c, normal_cols) - = make_float (XFLOATINT (WVAR (c, total_cols)) - / XFLOATINT (WVAR (p, total_cols))); + WSET (c, normal_cols, + make_float (XFLOATINT (WGET (c, total_cols)) + / XFLOATINT (WGET (p, total_cols)))); else - WVAR (c, normal_lines) - = make_float (XFLOATINT (WVAR (c, total_lines)) - / XFLOATINT (WVAR (p, total_lines))); + WSET (c, normal_lines, + make_float (XFLOATINT (WGET (c, total_lines)) + / XFLOATINT (WGET (p, total_lines)))); - if (NILP (WVAR (c, next))) + if (NILP (WGET (c, next))) { - if (!NILP (WVAR (w, next))) + if (!NILP (WGET (w, next))) { - WVAR (c, next) = WVAR (w, next); - WVAR (XWINDOW (WVAR (c, next)), prev) = child; + WSET (c, next, WGET (w, next)); + WSET (XWINDOW (WGET (c, next)), prev, child); } c = 0; } else { - child = WVAR (c, next); + child = WGET (c, next); c = XWINDOW (child); } } /* WINDOW can be deleted now. */ - WVAR (w, vchild) = WVAR (w, hchild) = Qnil; + WSET (w, vchild, Qnil); + WSET (w, hchild, Qnil); } } } @@ -2038,10 +2029,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 (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); int candidate_p = 1; - if (!BUFFERP (WVAR (w, buffer))) + if (!BUFFERP (WGET (w, buffer))) candidate_p = 0; else if (MINI_WINDOW_P (w) && (EQ (minibuf, Qlambda) @@ -2056,13 +2047,13 @@ else if (NILP (all_frames)) { eassert (WINDOWP (owindow)); - candidate_p = EQ (WVAR (w, frame), WVAR (XWINDOW (owindow), frame)); + candidate_p = EQ (WGET (w, frame), WGET (XWINDOW (owindow), frame)); } else if (EQ (all_frames, Qvisible)) { FRAME_SAMPLE_VISIBILITY (f); candidate_p = FRAME_VISIBLE_P (f) - && (FRAME_TERMINAL (XFRAME (WVAR (w, frame))) + && (FRAME_TERMINAL (XFRAME (WGET (w, frame))) == FRAME_TERMINAL (XFRAME (selected_frame))); } @@ -2081,15 +2072,15 @@ && !f->output_data.x->has_been_visible) #endif ) - && (FRAME_TERMINAL (XFRAME (WVAR (w, frame))) + && (FRAME_TERMINAL (XFRAME (WGET (w, frame))) == FRAME_TERMINAL (XFRAME (selected_frame))); } else if (WINDOWP (all_frames)) candidate_p = (EQ (FRAME_MINIBUF_WINDOW (f), all_frames) - || EQ (WVAR (XWINDOW (all_frames), frame), WVAR (w, frame)) - || EQ (WVAR (XWINDOW (all_frames), frame), FRAME_FOCUS_FRAME (f))); + || EQ (WGET (XWINDOW (all_frames), frame), WGET (w, frame)) + || EQ (WGET (XWINDOW (all_frames), frame), FRAME_FOCUS_FRAME (f))); else if (FRAMEP (all_frames)) - candidate_p = EQ (all_frames, WVAR (w, frame)); + candidate_p = EQ (all_frames, WGET (w, frame)); return candidate_p; } @@ -2122,7 +2113,7 @@ if (NILP (*all_frames)) *all_frames = (!EQ (*minibuf, Qlambda) - ? FRAME_MINIBUF_WINDOW (XFRAME (WVAR (XWINDOW (*window), frame))) + ? FRAME_MINIBUF_WINDOW (XFRAME (WGET (XWINDOW (*window), frame))) : Qnil); else if (EQ (*all_frames, Qvisible)) ; @@ -2148,7 +2139,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, WVAR (XWINDOW (window), frame))) + && !EQ (all_frames, WGET (XWINDOW (window), frame))) return Fframe_first_window (all_frames); if (next_p) @@ -2328,7 +2319,7 @@ if (NILP (frame)) frame = selected_frame; - if (!EQ (frame, WVAR (XWINDOW (window), frame))) + if (!EQ (frame, WGET (XWINDOW (window), frame))) error ("Window is on a different frame"); return window_list_1 (window, minibuf, frame); @@ -2449,7 +2440,7 @@ switch (type) { case GET_BUFFER_WINDOW: - if (EQ (WVAR (w, buffer), obj) + if (EQ (WGET (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)) @@ -2457,7 +2448,7 @@ if (EQ (window, selected_window)) /* Preferably return the selected window. */ RETURN_UNGCPRO (window); - else if (EQ (WVAR (XWINDOW (window), frame), selected_frame) + else if (EQ (WGET (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). */ @@ -2473,25 +2464,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 (WVAR (w, buffer), obj)) + if (EQ (WGET (w, buffer), obj)) { /* Undedicate WINDOW. */ - WVAR (w, dedicated) = Qnil; + 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 (WVAR (w, buffer)), 0, 0); + (window, other_buffer_safely (WGET (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 (WVAR (w, buffer)) == current_buffer) - Fset_buffer (WVAR (w, buffer)); + && XBUFFER (WGET (w, buffer)) == current_buffer) + Fset_buffer (WGET (w, buffer)); } break; case REDISPLAY_BUFFER_WINDOWS: - if (EQ (WVAR (w, buffer), obj)) + if (EQ (WGET (w, buffer), obj)) { mark_window_display_accurate (window, 0); w->update_mode_line = 1; @@ -2503,8 +2494,8 @@ /* Check for a window that has a killed buffer. */ case CHECK_ALL_WINDOWS: - if (! NILP (WVAR (w, buffer)) - && NILP (BVAR (XBUFFER (WVAR (w, buffer)), name))) + if (! NILP (WGET (w, buffer)) + && NILP (BVAR (XBUFFER (WGET (w, buffer)), name))) abort (); break; @@ -2591,7 +2582,7 @@ w = decode_any_window (window); XSETWINDOW (window, w); - f = XFRAME (WVAR (w, frame)); + f = XFRAME (WGET (w, frame)); if (NILP (root)) /* ROOT is the frame's root window. */ @@ -2603,12 +2594,12 @@ /* ROOT must be an ancestor of WINDOW. */ { r = decode_any_window (root); - pwindow = WVAR (XWINDOW (window), parent); + pwindow = WGET (XWINDOW (window), parent); while (!NILP (pwindow)) if (EQ (pwindow, root)) break; else - pwindow = WVAR (XWINDOW (pwindow), parent); + pwindow = WGET (XWINDOW (pwindow), parent); if (!EQ (pwindow, root)) error ("Specified root is not an ancestor of specified window"); } @@ -2622,15 +2613,15 @@ else if (MINI_WINDOW_P (w)) /* && top > 0) */ error ("Can't expand minibuffer to full frame"); - if (!NILP (WVAR (w, buffer))) + if (!NILP (WGET (w, buffer))) { - startpos = marker_position (WVAR (w, start)); + startpos = marker_position (WGET (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, WVAR (w, frame))) + if (EQ (selected_frame, WGET (w, frame))) Fselect_window (window, Qnil); else FSET (f, selected_window, window); @@ -2647,7 +2638,7 @@ { pwindow = swindow; while (!NILP (pwindow) && !EQ (window, pwindow)) - pwindow = WVAR (XWINDOW (pwindow), parent); + pwindow = WGET (XWINDOW (pwindow), parent); if (EQ (window, pwindow)) /* If WINDOW is an ancestor of SWINDOW, then SWINDOW is ok @@ -2660,7 +2651,7 @@ if (!EQ (swindow, FRAME_SELECTED_WINDOW (f))) { - if (EQ (selected_frame, WVAR (w, frame))) + if (EQ (selected_frame, WGET (w, frame))) Fselect_window (swindow, Qnil); else FSET (f, selected_window, swindow); @@ -2693,12 +2684,12 @@ FRAME_WINDOW_SIZES_CHANGED (f) = 1; resize_failed = 0; - if (NILP (WVAR (w, buffer))) + if (NILP (WGET (w, buffer))) { /* Resize child windows vertically. */ - XSETINT (delta, XINT (WVAR (r, total_lines)) - - XINT (WVAR (w, total_lines))); - WVAR (w, top_line) = WVAR (r, top_line); + XSETINT (delta, XINT (WGET (r, total_lines)) + - XINT (WGET (w, total_lines))); + WSET (w, top_line, WGET (r, top_line)); resize_root_window (window, delta, Qnil, Qnil); if (window_resize_check (w, 0)) window_resize_apply (w, 0); @@ -2714,10 +2705,10 @@ /* Resize child windows horizontally. */ if (!resize_failed) { - WVAR (w, left_col) = WVAR (r, left_col); - XSETINT (delta, XINT (WVAR (r, total_cols)) - - XINT (WVAR (w, total_cols))); - WVAR (w, left_col) = WVAR (r, left_col); + 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)); resize_root_window (window, delta, Qt, Qnil); if (window_resize_check (w, 1)) window_resize_apply (w, 1); @@ -2740,43 +2731,43 @@ } /* Cleanly unlink WINDOW from window-tree. */ - if (!NILP (WVAR (w, prev))) + if (!NILP (WGET (w, prev))) /* Get SIBLING above (on the left of) WINDOW. */ { - sibling = WVAR (w, prev); + sibling = WGET (w, prev); s = XWINDOW (sibling); - WVAR (s, next) = WVAR (w, next); - if (!NILP (WVAR (s, next))) - WVAR (XWINDOW (WVAR (s, next)), prev) = sibling; + WSET (s, next, WGET (w, next)); + if (!NILP (WGET (s, next))) + WSET (XWINDOW (WGET (s, next)), prev, sibling); } else /* Get SIBLING below (on the right of) WINDOW. */ { - sibling = WVAR (w, next); + sibling = WGET (w, next); s = XWINDOW (sibling); - WVAR (s, prev) = Qnil; - if (!NILP (WVAR (XWINDOW (WVAR (w, parent)), vchild))) - WVAR (XWINDOW (WVAR (w, parent)), vchild) = sibling; + WSET (s, prev, Qnil); + if (!NILP (WGET (XWINDOW (WGET (w, parent)), vchild))) + WSET (XWINDOW (WGET (w, parent)), vchild, sibling); else - WVAR (XWINDOW (WVAR (w, parent)), hchild) = sibling; + WSET (XWINDOW (WGET (w, parent)), hchild, sibling); } /* Delete ROOT and all child windows of ROOT. */ - if (!NILP (WVAR (r, vchild))) + if (!NILP (WGET (r, vchild))) { - delete_all_child_windows (WVAR (r, vchild)); - WVAR (r, vchild) = Qnil; + delete_all_child_windows (WGET (r, vchild)); + WSET (r, vchild, Qnil); } - else if (!NILP (WVAR (r, hchild))) + else if (!NILP (WGET (r, hchild))) { - delete_all_child_windows (WVAR (r, hchild)); - WVAR (r, hchild) = Qnil; + delete_all_child_windows (WGET (r, hchild)); + WSET (r, hchild, Qnil); } replace_window (root, window, 1); /* This must become SWINDOW anyway ....... */ - if (!NILP (WVAR (w, buffer)) && !resize_failed) + if (!NILP (WGET (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 @@ -2785,19 +2776,19 @@ 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 (WVAR (w, buffer))) - && startpos <= BUF_ZV (XBUFFER (WVAR (w, buffer)))) + && startpos >= BUF_BEGV (XBUFFER (WGET (w, buffer))) + && startpos <= BUF_ZV (XBUFFER (WGET (w, buffer)))) { struct position pos; struct buffer *obuf = current_buffer; - Fset_buffer (WVAR (w, buffer)); + Fset_buffer (WGET (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 (WVAR (w, start), WVAR (w, buffer), pos.bufpos, pos.bytepos); - WVAR (w, window_end_valid) = Qnil; + set_marker_both (WGET (w, start), WGET (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'); /* We need to do this, so that the window-scroll-functions @@ -2887,13 +2878,15 @@ if (WINDOW_RIGHT_MARGIN_COLS (w) > 0) { if (WINDOW_LEFT_MARGIN_COLS (w) > 0) - WVAR (w, left_margin_cols) = WVAR (w, right_margin_cols) - = make_number (margin_cols/2); + { + WSET (w, left_margin_cols, make_number (margin_cols / 2)); + WSET (w, right_margin_cols, make_number (margin_cols / 2)); + } else - WVAR (w, right_margin_cols) = make_number (margin_cols); + WSET (w, right_margin_cols, make_number (margin_cols)); } else - WVAR (w, left_margin_cols) = make_number (margin_cols); + WSET (w, left_margin_cols, make_number (margin_cols)); return 1; } @@ -2991,9 +2984,9 @@ struct window *w = XWINDOW (window); struct buffer *b = XBUFFER (buffer); ptrdiff_t count = SPECPDL_INDEX (); - int samebuf = EQ (buffer, WVAR (w, buffer)); + int samebuf = EQ (buffer, WGET (w, buffer)); - WVAR (w, buffer) = buffer; + WSET (w, buffer, buffer); if (EQ (window, selected_window)) BVAR (b, last_selected_window) = window; @@ -3006,10 +2999,10 @@ XSETINT (BVAR (b, display_count), XINT (BVAR (b, display_count)) + 1); BVAR (b, display_time) = Fcurrent_time (); - XSETFASTINT (WVAR (w, window_end_pos), 0); - XSETFASTINT (WVAR (w, window_end_vpos), 0); + WSET (w, window_end_pos, make_number (0)); + WSET (w, window_end_vpos, make_number (0)); memset (&w->last_cursor, 0, sizeof w->last_cursor); - WVAR (w, window_end_valid) = Qnil; + WSET (w, window_end_valid, Qnil); if (!(keep_margins_p && samebuf)) { /* If we're not actually changing the buffer, don't reset hscroll and vscroll. This case happens for example when called from @@ -3021,8 +3014,8 @@ whenever we resize the frame. */ w->hscroll = w->min_hscroll = 0; w->vscroll = 0; - set_marker_both (WVAR (w, pointm), buffer, BUF_PT (b), BUF_PT_BYTE (b)); - set_marker_restricted (WVAR (w, start), + set_marker_both (WGET (w, pointm), buffer, BUF_PT (b), BUF_PT_BYTE (b)); + set_marker_restricted (WGET (w, start), make_number (b->last_window_start), buffer); w->start_at_line_beg = 0; @@ -3043,7 +3036,7 @@ Fset_buffer (buffer); } - XMARKER (WVAR (w, pointm))->insertion_type = !NILP (Vwindow_point_insertion_type); + XMARKER (WGET (w, pointm))->insertion_type = !NILP (Vwindow_point_insertion_type); if (!keep_margins_p) { @@ -3051,10 +3044,11 @@ /* This may call adjust_window_margins three times, so temporarily disable window margins. */ - Lisp_Object save_left = WVAR (w, left_margin_cols); - Lisp_Object save_right = WVAR (w, right_margin_cols); + Lisp_Object save_left = WGET (w, left_margin_cols); + Lisp_Object save_right = WGET (w, right_margin_cols); - WVAR (w, left_margin_cols) = WVAR (w, right_margin_cols) = Qnil; + WSET (w, left_margin_cols, Qnil); + WSET (w, right_margin_cols, Qnil); Fset_window_fringes (window, BVAR (b, left_fringe_width), BVAR (b, right_fringe_width), @@ -3064,8 +3058,8 @@ BVAR (b, scroll_bar_width), BVAR (b, vertical_scroll_bar_type), Qnil); - WVAR (w, left_margin_cols) = save_left; - WVAR (w, right_margin_cols) = save_right; + WSET (w, left_margin_cols, save_left); + WSET (w, right_margin_cols, save_right); Fset_window_margins (window, BVAR (b, left_margin_cols), BVAR (b, right_margin_cols)); @@ -3075,7 +3069,7 @@ { if (! NILP (Vwindow_scroll_functions)) run_hook_with_args_2 (Qwindow_scroll_functions, window, - Fmarker_position (WVAR (w, start))); + Fmarker_position (WGET (w, start))); run_window_configuration_change_hook (XFRAME (WINDOW_FRAME (w))); } @@ -3109,7 +3103,7 @@ if (NILP (BVAR (XBUFFER (buffer), name))) error ("Attempt to display deleted buffer"); - tem = WVAR (w, buffer); + tem = WGET (w, buffer); if (NILP (tem)) error ("Window is deleted"); else if (!EQ (tem, Qt)) @@ -3117,14 +3111,14 @@ { if (!EQ (tem, buffer)) { - if (EQ (WVAR (w, dedicated), Qt)) + if (EQ (WGET (w, dedicated), Qt)) /* WINDOW is strongly dedicated to its buffer, signal an error. */ error ("Window is dedicated to `%s'", SDATA (BVAR (XBUFFER (tem), name))); else /* WINDOW is weakly dedicated to its buffer, reset dedication. */ - WVAR (w, dedicated) = Qnil; + WSET (w, dedicated, Qnil); call1 (Qrecord_window_buffer, window); } @@ -3163,8 +3157,8 @@ struct window *w = XWINDOW (object); mark_window_display_accurate (object, 0); w->update_mode_line = 1; - if (BUFFERP (WVAR (w, buffer))) - XBUFFER (WVAR (w, buffer))->prevent_redisplay_optimizations_p = 1; + if (BUFFERP (WGET (w, buffer))) + XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1; ++update_mode_lines; return Qt; } @@ -3209,14 +3203,14 @@ { window = display_buffer (buf, Qnil, Qnil); - if (!EQ (WVAR (XWINDOW (window), frame), selected_frame)) + if (!EQ (WGET (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 (WVAR (w, start), buf, BEG, BEG); - set_marker_restricted_both (WVAR (w, pointm), buf, BEG, BEG); + set_marker_restricted_both (WGET (w, start), buf, BEG, BEG); + set_marker_restricted_both (WGET (w, pointm), buf, BEG, BEG); /* Run temp-buffer-show-hook, with the chosen window selected and its buffer current. */ @@ -3233,7 +3227,7 @@ record_unwind_protect (Fset_buffer, prev_buffer); record_unwind_protect (select_window_norecord, prev_window); Fselect_window (window, Qt); - Fset_buffer (WVAR (w, buffer)); + Fset_buffer (WGET (w, buffer)); Frun_hooks (1, &Qtemp_buffer_show_hook); unbind_to (count, Qnil); } @@ -3270,17 +3264,17 @@ replace_window (window, parent, 1); - WVAR (o, next) = Qnil; - WVAR (o, prev) = Qnil; - WVAR (o, parent) = parent; + WSET (o, next, Qnil); + WSET (o, prev, Qnil); + WSET (o, parent, parent); - WVAR (p, hchild) = horflag ? window : Qnil; - WVAR (p, vchild) = horflag ? Qnil : window; - WVAR (p, start) = Qnil; - WVAR (p, pointm) = Qnil; - WVAR (p, buffer) = Qnil; - WVAR (p, combination_limit) = Qnil; - WVAR (p, window_parameters) = Qnil; + WSET (p, hchild, horflag ? window : Qnil); + WSET (p, vchild, horflag ? Qnil : window); + WSET (p, start, Qnil); + WSET (p, pointm, Qnil); + WSET (p, buffer, Qnil); + WSET (p, combination_limit, Qnil); + WSET (p, window_parameters, Qnil); } /* Make new window from scratch. */ @@ -3293,19 +3287,19 @@ w = allocate_window (); /* Initialize Lisp data. Note that allocate_window initializes all Lisp data to nil, so do it only for slots which should not be nil. */ - XSETFASTINT (WVAR (w, left_col), 0); - XSETFASTINT (WVAR (w, top_line), 0); - XSETFASTINT (WVAR (w, total_lines), 0); - XSETFASTINT (WVAR (w, total_cols), 0); - WVAR (w, normal_lines) = make_float (1.0); - WVAR (w, normal_cols) = make_float (1.0); - XSETFASTINT (WVAR (w, new_total), 0); - XSETFASTINT (WVAR (w, new_normal), 0); - WVAR (w, start) = Fmake_marker (); - WVAR (w, pointm) = Fmake_marker (); - WVAR (w, vertical_scroll_bar_type) = Qt; - XSETFASTINT (WVAR (w, window_end_pos), 0); - XSETFASTINT (WVAR (w, window_end_vpos), 0); + WSET (w, left_col, make_number (0)); + WSET (w, top_line, make_number (0)); + WSET (w, total_lines, make_number (0)); + WSET (w, total_cols, make_number (0)); + WSET (w, normal_lines, make_float (1.0)); + WSET (w, normal_cols, make_float (1.0)); + WSET (w, new_total, make_number (0)); + WSET (w, new_normal, make_number (0)); + WSET (w, start, Fmake_marker ()); + WSET (w, pointm, Fmake_marker ()); + WSET (w, vertical_scroll_bar_type, Qt); + WSET (w, window_end_pos, make_number (0)); + WSET (w, window_end_vpos, make_number (0)); /* Initialize non-Lisp data. Note that allocate_window zeroes out all non-Lisp data, so do it only for slots which should not be zero. */ @@ -3335,11 +3329,11 @@ CHECK_NUMBER (size); if (NILP (add)) - XSETINT (WVAR (w, new_total), XINT (size)); + WSET (w, new_total, size); else - XSETINT (WVAR (w, new_total), XINT (WVAR (w, new_total)) + XINT (size)); + WSET (w, new_total, make_number (XINT (WGET (w, new_total)) + XINT (size))); - return WVAR (w, new_total); + return WGET (w, new_total); } DEFUN ("set-window-new-normal", Fset_window_new_normal, Sset_window_new_normal, 1, 2, 0, @@ -3349,10 +3343,7 @@ Note: This function does not operate on any child windows of WINDOW. */) (Lisp_Object window, Lisp_Object size) { - struct window *w = decode_any_window (window); - - WVAR (w, new_normal) = size; - return WVAR (w, new_normal); + return WSET (decode_any_window (window), new_normal, size); } /* Return 1 if setting w->total_lines (w->total_cols if HORFLAG is @@ -3367,19 +3358,19 @@ { struct window *c; - if (!NILP (WVAR (w, vchild))) + if (!NILP (WGET (w, vchild))) /* W is a vertical combination. */ { - c = XWINDOW (WVAR (w, vchild)); + c = XWINDOW (WGET (w, vchild)); if (horflag) /* All child windows of W must have the same width as W. */ { while (c) { - if ((XINT (WVAR (c, new_total)) != XINT (WVAR (w, new_total))) + if ((XINT (WGET (c, new_total)) != XINT (WGET (w, new_total))) || !window_resize_check (c, horflag)) return 0; - c = NILP (WVAR (c, next)) ? 0 : XWINDOW (WVAR (c, next)); + c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next)); } return 1; } @@ -3392,16 +3383,16 @@ { if (!window_resize_check (c, horflag)) return 0; - sum_of_sizes = sum_of_sizes + XINT (WVAR (c, new_total)); - c = NILP (WVAR (c, next)) ? 0 : XWINDOW (WVAR (c, next)); + sum_of_sizes = sum_of_sizes + XINT (WGET (c, new_total)); + c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next)); } - return (sum_of_sizes == XINT (WVAR (w, new_total))); + return (sum_of_sizes == XINT (WGET (w, new_total))); } } - else if (!NILP (WVAR (w, hchild))) + else if (!NILP (WGET (w, hchild))) /* W is a horizontal combination. */ { - c = XWINDOW (WVAR (w, hchild)); + c = XWINDOW (WGET (w, hchild)); if (horflag) /* The sum of the widths of the child windows of W must equal W's width. */ @@ -3411,20 +3402,20 @@ { if (!window_resize_check (c, horflag)) return 0; - sum_of_sizes = sum_of_sizes + XINT (WVAR (c, new_total)); - c = NILP (WVAR (c, next)) ? 0 : XWINDOW (WVAR (c, next)); + sum_of_sizes = sum_of_sizes + XINT (WGET (c, new_total)); + c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next)); } - return (sum_of_sizes == XINT (WVAR (w, new_total))); + return (sum_of_sizes == XINT (WGET (w, new_total))); } else /* All child windows of W must have the same height as W. */ { while (c) { - if ((XINT (WVAR (c, new_total)) != XINT (WVAR (w, new_total))) + if ((XINT (WGET (c, new_total)) != XINT (WGET (w, new_total))) || !window_resize_check (c, horflag)) return 0; - c = NILP (WVAR (c, next)) ? 0 : XWINDOW (WVAR (c, next)); + c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next)); } return 1; } @@ -3433,7 +3424,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 (WVAR (w, new_total)) >= (horflag ? 2 : 1); + return XINT (WGET (w, new_total)) >= (horflag ? 2 : 1); } /* Set w->total_lines (w->total_cols if HORIZONTAL is non-zero) to @@ -3453,51 +3444,51 @@ parent window has been set *before*. */ if (horflag) { - WVAR (w, total_cols) = WVAR (w, new_total); - if (NUMBERP (WVAR (w, new_normal))) - WVAR (w, normal_cols) = WVAR (w, new_normal); + WSET (w, total_cols, WGET (w, new_total)); + if (NUMBERP (WGET (w, new_normal))) + WSET (w, normal_cols, WGET (w, new_normal)); - pos = XINT (WVAR (w, left_col)); + pos = XINT (WGET (w, left_col)); } else { - WVAR (w, total_lines) = WVAR (w, new_total); - if (NUMBERP (WVAR (w, new_normal))) - WVAR (w, normal_lines) = WVAR (w, new_normal); + WSET (w, total_lines, WGET (w, new_total)); + if (NUMBERP (WGET (w, new_normal))) + WSET (w, normal_lines, WGET (w, new_normal)); - pos = XINT (WVAR (w, top_line)); + pos = XINT (WGET (w, top_line)); } - if (!NILP (WVAR (w, vchild))) + if (!NILP (WGET (w, vchild))) /* W is a vertical combination. */ { - c = XWINDOW (WVAR (w, vchild)); + c = XWINDOW (WGET (w, vchild)); while (c) { if (horflag) - XSETFASTINT (WVAR (c, left_col), pos); + WSET (c, left_col, make_number (pos)); else - XSETFASTINT (WVAR (c, top_line), pos); + WSET (c, top_line, make_number (pos)); window_resize_apply (c, horflag); if (!horflag) - pos = pos + XINT (WVAR (c, total_lines)); - c = NILP (WVAR (c, next)) ? 0 : XWINDOW (WVAR (c, next)); + pos = pos + XINT (WGET (c, total_lines)); + c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next)); } } - else if (!NILP (WVAR (w, hchild))) + else if (!NILP (WGET (w, hchild))) /* W is a horizontal combination. */ { - c = XWINDOW (WVAR (w, hchild)); + c = XWINDOW (WGET (w, hchild)); while (c) { if (horflag) - XSETFASTINT (WVAR (c, left_col), pos); + WSET (c, left_col, make_number (pos)); else - XSETFASTINT (WVAR (c, top_line), pos); + WSET (c, top_line, make_number (pos)); window_resize_apply (c, horflag); if (horflag) - pos = pos + XINT (WVAR (c, total_cols)); - c = NILP (WVAR (c, next)) ? 0 : XWINDOW (WVAR (c, next)); + pos = pos + XINT (WGET (c, total_cols)); + c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next)); } } @@ -3533,8 +3524,8 @@ r = XWINDOW (FRAME_ROOT_WINDOW (f)); if (!window_resize_check (r, horflag) - || ! EQ (WVAR (r, new_total), - (horflag ? WVAR (r, total_cols) : WVAR (r, total_lines)))) + || ! EQ (WGET (r, new_total), + (horflag ? WGET (r, total_cols) : WGET (r, total_lines)))) return Qnil; BLOCK_INPUT; @@ -3574,39 +3565,39 @@ - ((FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f)) ? 1 : 0))); - XSETFASTINT (WVAR (r, top_line), FRAME_TOP_MARGIN (f)); - if (NILP (WVAR (r, vchild)) && NILP (WVAR (r, hchild))) + WSET (r, top_line, make_number (FRAME_TOP_MARGIN (f))); + if (NILP (WGET (r, vchild)) && NILP (WGET (r, hchild))) /* For a leaf root window just set the size. */ if (horflag) - XSETFASTINT (WVAR (r, total_cols), new_size); + WSET (r, total_cols, make_number (new_size)); else - XSETFASTINT (WVAR (r, total_lines), new_size); + WSET (r, total_lines, make_number (new_size)); else { /* old_size is the old size of the frame's root window. */ - int old_size = XFASTINT (horflag ? WVAR (r, total_cols) - : WVAR (r, total_lines)); + int old_size = XFASTINT (horflag ? WGET (r, total_cols) + : WGET (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 (WVAR (r, new_total))) + && new_size == XINT (WGET (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 (WVAR (r, new_total))) + && new_size == XINT (WGET (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 (WVAR (r, new_total))) + && new_size == XINT (WGET (r, new_total))) window_resize_apply (r, horflag); else { @@ -3615,9 +3606,9 @@ root = FGET (f, selected_window); Fdelete_other_windows_internal (root, Qnil); if (horflag) - XSETFASTINT (WVAR (XWINDOW (root), total_cols), new_size); + WSET (XWINDOW (root), total_cols, make_number (new_size)); else - XSETFASTINT (WVAR (XWINDOW (root), total_lines), new_size); + WSET (XWINDOW (root), total_lines, make_number (new_size)); } } } @@ -3627,13 +3618,13 @@ { m = XWINDOW (mini); if (horflag) - XSETFASTINT (WVAR (m, total_cols), size); + WSET (m, total_cols, make_number (size)); else { /* Are we sure we always want 1 line here? */ - XSETFASTINT (WVAR (m, total_lines), 1); - XSETFASTINT (WVAR (m, top_line), XINT (WVAR (r, top_line)) - + XINT (WVAR (r, total_lines))); + WSET (m, total_lines, make_number (1)); + WSET (m, top_line, + make_number (XINT (WGET (r, top_line)) + XINT (WGET (r, total_lines)))); } } } @@ -3689,10 +3680,10 @@ parent, or OLD is ortho-combined. */ combination_limit = !NILP (Vwindow_combination_limit) - || NILP (WVAR (o, parent)) + || NILP (WGET (o, parent)) || NILP (horflag - ? (WVAR (XWINDOW (WVAR (o, parent)), hchild)) - : (WVAR (XWINDOW (WVAR (o, parent)), vchild))); + ? (WGET (XWINDOW (WGET (o, parent)), hchild)) + : (WGET (XWINDOW (WGET (o, parent)), vchild))); /* We need a live reference window to initialize some parameters. */ if (WINDOW_LIVE_P (old)) @@ -3712,24 +3703,24 @@ /* `window-combination-resize' non-nil means try to resize OLD's siblings proportionally. */ { - p = XWINDOW (WVAR (o, parent)); + p = XWINDOW (WGET (o, parent)); /* Temporarily pretend we split the parent window. */ - XSETINT (WVAR (p, new_total), - XINT (horflag ? WVAR (p, total_cols) : WVAR (p, total_lines)) - - XINT (total_size)); + WSET (p, new_total, + make_number (XINT (horflag ? WGET (p, total_cols) : WGET (p, total_lines)) + - XINT (total_size))); if (!window_resize_check (p, horflag)) error ("Window sizes don't fit"); else /* Undo the temporary pretension. */ - WVAR (p, new_total) - = horflag ? WVAR (p, total_cols) : WVAR (p, total_lines); + WSET (p, new_total, + horflag ? WGET (p, total_cols) : WGET (p, total_lines)); } else { if (!window_resize_check (o, horflag)) error ("Resizing old window failed"); - else if (XINT (total_size) + XINT (WVAR (o, new_total)) - != XINT (horflag ? WVAR (o, total_cols) : WVAR (o, total_lines))) + else if (XINT (total_size) + XINT (WGET (o, new_total)) + != XINT (horflag ? WGET (o, total_cols) : WGET (o, total_lines))) error ("Sum of sizes of old and new window don't fit"); } @@ -3740,94 +3731,95 @@ by make_parent_window and we need it below for assigning it to p->new_normal. */ Lisp_Object new_normal - = horflag ? WVAR (o, normal_cols) : WVAR (o, normal_lines); + = horflag ? WGET (o, normal_cols) : WGET (o, normal_lines); make_parent_window (old, horflag); - p = XWINDOW (WVAR (o, parent)); + p = XWINDOW (WGET (o, parent)); /* Store value of `window-combination-limit' in new parent's combination_limit slot. */ - WVAR (p, combination_limit) = Vwindow_combination_limit; + WSET (p, combination_limit, Vwindow_combination_limit); /* These get applied below. */ - WVAR (p, new_total) - = horflag ? WVAR (o, total_cols) : WVAR (o, total_lines); - WVAR (p, new_normal) = new_normal; + WSET (p, new_total, + horflag ? WGET (o, total_cols) : WGET (o, total_lines)); + WSET (p, new_normal, new_normal); } else - p = XWINDOW (WVAR (o, parent)); + p = XWINDOW (WGET (o, parent)); windows_or_buffers_changed++; FRAME_WINDOW_SIZES_CHANGED (f) = 1; new = make_window (); n = XWINDOW (new); - WVAR (n, frame) = frame; - WVAR (n, parent) = WVAR (o, parent); - WVAR (n, vchild) = WVAR (n, hchild) = Qnil; + WSET (n, frame, frame); + WSET (n, parent, WGET (o, parent)); + WSET (n, vchild, Qnil); + WSET (n, hchild, Qnil); if (EQ (side, Qabove) || EQ (side, Qleft)) { - WVAR (n, prev) = WVAR (o, prev); - if (NILP (WVAR (n, prev))) + WSET (n, prev, WGET (o, prev)); + if (NILP (WGET (n, prev))) if (horflag) - WVAR (p, hchild) = new; + WSET (p, hchild, new); else - WVAR (p, vchild) = new; + WSET (p, vchild, new); else - WVAR (XWINDOW (WVAR (n, prev)), next) = new; - WVAR (n, next) = old; - WVAR (o, prev) = new; + WSET (XWINDOW (WGET (n, prev)), next, new); + WSET (n, next, old); + WSET (o, prev, new); } else { - WVAR (n, next) = WVAR (o, next); - if (!NILP (WVAR (n, next))) - WVAR (XWINDOW (WVAR (n, next)), prev) = new; - WVAR (n, prev) = old; - WVAR (o, next) = new; + WSET (n, next, WGET (o, next)); + if (!NILP (WGET (n, next))) + WSET (XWINDOW (WGET (n, next)), prev, new); + WSET (n, prev, old); + WSET (o, next, new); } - WVAR (n, buffer) = Qt; - WVAR (n, window_end_valid) = Qnil; + WSET (n, buffer, Qt); + WSET (n, window_end_valid, Qnil); memset (&n->last_cursor, 0, sizeof n->last_cursor); /* Get special geometry settings from reference window. */ - WVAR (n, left_margin_cols) = WVAR (r, left_margin_cols); - WVAR (n, right_margin_cols) = WVAR (r, right_margin_cols); - WVAR (n, left_fringe_width) = WVAR (r, left_fringe_width); - WVAR (n, right_fringe_width) = WVAR (r, right_fringe_width); + 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)); n->fringes_outside_margins = r->fringes_outside_margins; - WVAR (n, scroll_bar_width) = WVAR (r, scroll_bar_width); - WVAR (n, vertical_scroll_bar_type) = WVAR (r, vertical_scroll_bar_type); + WSET (n, scroll_bar_width, WGET (r, scroll_bar_width)); + WSET (n, vertical_scroll_bar_type, WGET (r, vertical_scroll_bar_type)); /* Directly assign orthogonal coordinates and sizes. */ if (horflag) { - WVAR (n, top_line) = WVAR (o, top_line); - WVAR (n, total_lines) = WVAR (o, total_lines); + WSET (n, top_line, WGET (o, top_line)); + WSET (n, total_lines, WGET (o, total_lines)); } else { - WVAR (n, left_col) = WVAR (o, left_col); - WVAR (n, total_cols) = WVAR (o, total_cols); + WSET (n, left_col, WGET (o, left_col)); + WSET (n, total_cols, WGET (o, total_cols)); } /* Iso-coordinates and sizes are assigned by window_resize_apply, get them ready here. */ - WVAR (n, new_total) = total_size; - WVAR (n, new_normal) = normal_size; + WSET (n, new_total, total_size); + WSET (n, new_normal, normal_size); BLOCK_INPUT; window_resize_apply (p, horflag); adjust_glyphs (f); /* Set buffer of NEW to buffer of reference window. Don't run any hooks. */ - set_window_buffer (new, WVAR (r, buffer), 0, 1); + set_window_buffer (new, WGET (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 (WVAR (n, start))); + Fmarker_position (WGET (n, start))); /* Return NEW. */ return new; } @@ -3847,22 +3839,22 @@ w = decode_any_window (window); XSETWINDOW (window, w); - if (NILP (WVAR (w, buffer)) - && NILP (WVAR (w, hchild)) && NILP (WVAR (w, vchild))) + if (NILP (WGET (w, buffer)) + && NILP (WGET (w, hchild)) && NILP (WGET (w, vchild))) /* It's a no-op to delete an already deleted window. */ return Qnil; - parent = WVAR (w, parent); + parent = WGET (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 (WVAR (w, prev)) && NILP (WVAR (w, next))) + else if (NILP (WGET (w, prev)) && NILP (WGET (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 (WVAR (p, vchild)); + horflag = NILP (WGET (p, vchild)); frame = WINDOW_FRAME (w); f = XFRAME (frame); @@ -3871,33 +3863,33 @@ r = XWINDOW (root); /* Unlink WINDOW from window tree. */ - if (NILP (WVAR (w, prev))) + if (NILP (WGET (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 = WVAR (w, next); + sibling = WGET (w, next); s = XWINDOW (sibling); - WVAR (s, prev) = Qnil; + WSET (s, prev, Qnil); if (horflag) - WVAR (p, hchild) = sibling; + WSET (p, hchild, sibling); else - WVAR (p, vchild) = sibling; + WSET (p, vchild, sibling); } else /* Get SIBLING above (on the left of) WINDOW. */ { - sibling = WVAR (w, prev); + sibling = WGET (w, prev); s = XWINDOW (sibling); - WVAR (s, next) = WVAR (w, next); - if (!NILP (WVAR (s, next))) - WVAR (XWINDOW (WVAR (s, next)), prev) = sibling; + WSET (s, next, WGET (w, next)); + if (!NILP (WGET (s, next))) + WSET (XWINDOW (WGET (s, next)), prev, sibling); } if (window_resize_check (r, horflag) - && EQ (WVAR (r, new_total), - (horflag ? WVAR (r, total_cols) : WVAR (r, total_lines)))) + && EQ (WGET (r, new_total), + (horflag ? WGET (r, total_cols) : WGET (r, total_lines)))) /* We can delete WINDOW now. */ { @@ -3919,28 +3911,28 @@ Vwindow_list = Qnil; FRAME_WINDOW_SIZES_CHANGED (f) = 1; - WVAR (w, next) = Qnil; /* Don't delete w->next too. */ + WSET (w, next, Qnil); /* Don't delete w->next too. */ free_window_matrices (w); - if (!NILP (WVAR (w, vchild))) - { - delete_all_child_windows (WVAR (w, vchild)); - WVAR (w, vchild) = Qnil; - } - else if (!NILP (WVAR (w, hchild))) - { - delete_all_child_windows (WVAR (w, hchild)); - WVAR (w, hchild) = Qnil; - } - else if (!NILP (WVAR (w, buffer))) + if (!NILP (WGET (w, vchild))) + { + delete_all_child_windows (WGET (w, vchild)); + WSET (w, vchild, Qnil); + } + else if (!NILP (WGET (w, hchild))) + { + delete_all_child_windows (WGET (w, hchild)); + WSET (w, hchild, Qnil); + } + else if (!NILP (WGET (w, buffer))) { unshow_buffer (w); - unchain_marker (XMARKER (WVAR (w, pointm))); - unchain_marker (XMARKER (WVAR (w, start))); - WVAR (w, buffer) = Qnil; + unchain_marker (XMARKER (WGET (w, pointm))); + unchain_marker (XMARKER (WGET (w, start))); + WSET (w, buffer, Qnil); } - if (NILP (WVAR (s, prev)) && NILP (WVAR (s, next))) + if (NILP (WGET (s, prev)) && NILP (WGET (s, next))) /* A matrjoshka where SIBLING has become the only child of PARENT. */ { @@ -3948,10 +3940,11 @@ replace_window (parent, sibling, 0); /* Have SIBLING inherit the following three slot values from PARENT (the combination_limit slot is not inherited). */ - WVAR (s, normal_cols) = WVAR (p, normal_cols); - WVAR (s, normal_lines) = WVAR (p, normal_lines); + WSET (s, normal_cols, WGET (p, normal_cols)); + WSET (s, normal_lines, WGET (p, normal_lines)); /* Mark PARENT as deleted. */ - WVAR (p, vchild) = WVAR (p, hchild) = Qnil; + WSET (p, vchild, Qnil); + WSET (p, hchild, Qnil); /* Try to merge SIBLING into its new parent. */ recombine_windows (sibling); } @@ -3978,7 +3971,7 @@ /* Now look whether `get-mru-window' gets us something. */ mru_window = call1 (Qget_mru_window, frame); if (WINDOW_LIVE_P (mru_window) - && EQ (WVAR (XWINDOW (mru_window), frame), frame)) + && EQ (WGET (XWINDOW (mru_window), frame), frame)) new_selected_window = mru_window; /* If all ended up well, we now promote the mru window. */ @@ -3998,17 +3991,17 @@ { if (before_sibling) { - WVAR (s, prev) = window; + WSET (s, prev, window); if (horflag) - WVAR (p, hchild) = window; + WSET (p, hchild, window); else - WVAR (p, vchild) = window; + WSET (p, vchild, window); } else { - WVAR (s, next) = window; - if (!NILP (WVAR (w, next))) - WVAR (XWINDOW (WVAR (w, next)), prev) = window; + WSET (s, next, window); + if (!NILP (WGET (w, next))) + WSET (XWINDOW (WGET (w, next)), prev, window); } error ("Deletion failed"); } @@ -4025,7 +4018,7 @@ void grow_mini_window (struct window *w, int delta) { - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); struct window *r; Lisp_Object root, value; @@ -4042,9 +4035,10 @@ window_resize_apply (r, 0); /* Grow the mini-window. */ - XSETFASTINT (WVAR (w, top_line), - XFASTINT (WVAR (r, top_line)) + XFASTINT (WVAR (r, total_lines))); - XSETFASTINT (WVAR (w, total_lines), XFASTINT (WVAR (w, total_lines)) - XINT (value)); + WSET (w, top_line, + make_number (XFASTINT (WGET (r, top_line)) + XFASTINT (WGET (r, total_lines)))); + WSET (w, total_lines, + make_number (XFASTINT (WGET (w, total_lines)) - XINT (value))); w->last_modified = 0; w->last_overlay_modified = 0; @@ -4058,14 +4052,14 @@ void shrink_mini_window (struct window *w) { - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); struct window *r; Lisp_Object root, value; EMACS_INT size; eassert (MINI_WINDOW_P (w)); - size = XINT (WVAR (w, total_lines)); + size = XINT (WGET (w, total_lines)); if (size > 1) { root = FRAME_ROOT_WINDOW (f); @@ -4078,9 +4072,9 @@ window_resize_apply (r, 0); /* Shrink the mini-window. */ - XSETFASTINT (WVAR (w, top_line), XFASTINT (WVAR (r, top_line)) - + XFASTINT (WVAR (r, total_lines))); - XSETFASTINT (WVAR (w, total_lines), 1); + WSET (w, top_line, + make_number (XFASTINT (WGET (r, top_line)) + XFASTINT (WGET (r, total_lines)))); + WSET (w, total_lines, make_number (1)); w->last_modified = 0; w->last_overlay_modified = 0; @@ -4105,25 +4099,25 @@ int height; CHECK_WINDOW (window); - f = XFRAME (WVAR (w, frame)); + f = XFRAME (WGET (w, frame)); - if (!EQ (FRAME_MINIBUF_WINDOW (XFRAME (WVAR (w, frame))), window)) + if (!EQ (FRAME_MINIBUF_WINDOW (XFRAME (WGET (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 (WVAR (r, total_lines)) + XINT (WVAR (w, total_lines)); + height = XINT (WGET (r, total_lines)) + XINT (WGET (w, total_lines)); if (window_resize_check (r, 0) - && XINT (WVAR (w, new_total)) > 0 - && height == XINT (WVAR (r, new_total)) + XINT (WVAR (w, new_total))) + && XINT (WGET (w, new_total)) > 0 + && height == XINT (WGET (r, new_total)) + XINT (WGET (w, new_total))) { BLOCK_INPUT; window_resize_apply (r, 0); - WVAR (w, total_lines) = WVAR (w, new_total); - XSETFASTINT (WVAR (w, top_line), - XINT (WVAR (r, top_line)) + XINT (WVAR (r, total_lines))); + WSET (w, total_lines, WGET (w, new_total)); + WSET (w, top_line, + make_number (XINT (WGET (r, top_line)) + XINT (WGET (r, total_lines)))); windows_or_buffers_changed++; FRAME_WINDOW_SIZES_CHANGED (f) = 1; @@ -4146,14 +4140,14 @@ { while (w) { - if (!NILP (WVAR (w, hchild))) - mark_window_cursors_off (XWINDOW (WVAR (w, hchild))); - else if (!NILP (WVAR (w, vchild))) - mark_window_cursors_off (XWINDOW (WVAR (w, vchild))); + 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))); else w->phys_cursor_on_p = 0; - w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); + w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); } } @@ -4163,15 +4157,15 @@ int window_internal_height (struct window *w) { - int ht = XFASTINT (WVAR (w, total_lines)); + int ht = XFASTINT (WGET (w, total_lines)); if (!MINI_WINDOW_P (w)) { - if (!NILP (WVAR (w, parent)) - || !NILP (WVAR (w, vchild)) - || !NILP (WVAR (w, hchild)) - || !NILP (WVAR (w, next)) - || !NILP (WVAR (w, prev)) + if (!NILP (WGET (w, parent)) + || !NILP (WGET (w, vchild)) + || !NILP (WGET (w, hchild)) + || !NILP (WGET (w, next)) + || !NILP (WGET (w, prev)) || WINDOW_WANTS_MODELINE_P (w)) --ht; @@ -4201,7 +4195,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 (WVAR (XWINDOW (window), frame)))) + if (FRAME_WINDOW_P (XFRAME (WGET (XWINDOW (window), frame)))) window_scroll_pixel_based (window, n, whole, noerror); else window_scroll_line_based (window, n, whole, noerror); @@ -4226,7 +4220,7 @@ int x, y, rtop, rbot, rowh, vpos; void *itdata = NULL; - SET_TEXT_POS_FROM_MARKER (start, WVAR (w, start)); + SET_TEXT_POS_FROM_MARKER (start, WGET (w, start)); /* Scrolling a minibuffer window via scroll bar when the echo area shows long text sometimes resets the minibuffer contents behind our backs. */ @@ -4307,8 +4301,8 @@ spos = XINT (Fline_beginning_position (Qnil)); else spos = min (XINT (Fline_end_position (Qnil)) + 1, ZV); - set_marker_restricted (WVAR (w, start), make_number (spos), - WVAR (w, buffer)); + set_marker_restricted (WGET (w, start), make_number (spos), + WGET (w, buffer)); w->start_at_line_beg = 1; w->update_mode_line = 1; w->last_modified = 0; @@ -4432,7 +4426,7 @@ /* If control gets here, then we vscrolled. */ - XBUFFER (WVAR (w, buffer))->prevent_redisplay_optimizations_p = 1; + XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1; /* Don't try to change the window start below. */ vscrolled = 1; @@ -4452,9 +4446,9 @@ } /* Set the window start, and set up the window for redisplay. */ - set_marker_restricted (WVAR (w, start), make_number (pos), - WVAR (w, buffer)); - bytepos = XMARKER (WVAR (w, start))->bytepos; + set_marker_restricted (WGET (w, start), make_number (pos), + WGET (w, buffer)); + bytepos = XMARKER (WGET (w, start))->bytepos; w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n'); w->update_mode_line = 1; w->last_modified = 0; @@ -4473,7 +4467,7 @@ even if there is a header line. */ this_scroll_margin = max (0, scroll_margin); this_scroll_margin - = min (this_scroll_margin, XFASTINT (WVAR (w, total_lines)) / 4); + = min (this_scroll_margin, XFASTINT (WGET (w, total_lines)) / 4); this_scroll_margin *= FRAME_LINE_HEIGHT (it.f); if (n > 0) @@ -4547,7 +4541,7 @@ ; else if (window_scroll_pixel_based_preserve_y >= 0) { - SET_TEXT_POS_FROM_MARKER (start, WVAR (w, start)); + SET_TEXT_POS_FROM_MARKER (start, WGET (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 @@ -4601,7 +4595,7 @@ if (whole) n *= max (1, ht - next_screen_context_lines); - startpos = marker_position (WVAR (w, start)); + startpos = marker_position (WGET (w, start)); if (!NILP (Vscroll_preserve_screen_position)) { @@ -4652,9 +4646,9 @@ { /* Don't use a scroll margin that is negative or too large. */ int this_scroll_margin = - max (0, min (scroll_margin, XINT (WVAR (w, total_lines)) / 4)); + max (0, min (scroll_margin, XINT (WGET (w, total_lines)) / 4)); - set_marker_restricted_both (WVAR (w, start), WVAR (w, buffer), pos, pos_byte); + set_marker_restricted_both (WGET (w, start), WGET (w, buffer), pos, pos_byte); w->start_at_line_beg = !NILP (bolp); w->update_mode_line = 1; w->last_modified = 0; @@ -4748,10 +4742,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 (WVAR (XWINDOW (selected_window), buffer)) != current_buffer) + if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) != current_buffer) { record_unwind_protect (save_excursion_restore, save_excursion_save ()); - Fset_buffer (WVAR (XWINDOW (selected_window), buffer)); + Fset_buffer (WGET (XWINDOW (selected_window), buffer)); /* Make redisplay consider other windows than just selected_window. */ ++windows_or_buffers_changed; @@ -4866,8 +4860,8 @@ record_unwind_protect (save_excursion_restore, save_excursion_save ()); ++windows_or_buffers_changed; - Fset_buffer (WVAR (w, buffer)); - SET_PT (marker_position (WVAR (w, pointm))); + Fset_buffer (WGET (w, buffer)); + SET_PT (marker_position (WGET (w, pointm))); if (NILP (arg)) window_scroll (window, 1, 1, 1); @@ -4881,7 +4875,7 @@ window_scroll (window, XINT (arg), 0, 1); } - set_marker_both (WVAR (w, pointm), Qnil, PT, PT_BYTE); + set_marker_both (WGET (w, pointm), Qnil, PT, PT_BYTE); unbind_to (count, Qnil); return Qnil; @@ -4959,10 +4953,10 @@ int bottom_y; void *itdata = NULL; - if (XBUFFER (WVAR (w, buffer)) != current_buffer) + if (XBUFFER (WGET (w, buffer)) != current_buffer) { old_buffer = current_buffer; - set_buffer_internal (XBUFFER (WVAR (w, buffer))); + set_buffer_internal (XBUFFER (WGET (w, buffer))); } else old_buffer = NULL; @@ -4970,12 +4964,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 (WVAR (w, start))->charpos < BEGV) + if (XMARKER (WGET (w, start))->charpos < BEGV) SET_TEXT_POS (start, BEGV, BEGV_BYTE); - else if (XMARKER (WVAR (w, start))->charpos > ZV) + else if (XMARKER (WGET (w, start))->charpos > ZV) SET_TEXT_POS (start, ZV, ZV_BYTE); else - SET_TEXT_POS_FROM_MARKER (start, WVAR (w, start)); + SET_TEXT_POS_FROM_MARKER (start, WGET (w, start)); itdata = bidi_shelve_cache (); start_display (&it, w, start); @@ -4989,7 +4983,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 (WVAR (w, frame)))) + if (! FRAME_WINDOW_P (XFRAME (WGET (w, frame)))) height++; /* Add in empty lines at the bottom of the window. */ @@ -5024,7 +5018,7 @@ (register Lisp_Object arg) { struct window *w = XWINDOW (selected_window); - struct buffer *buf = XBUFFER (WVAR (w, buffer)); + struct buffer *buf = XBUFFER (WGET (w, buffer)); struct buffer *obuf = current_buffer; int center_p = 0; ptrdiff_t charpos, bytepos; @@ -5068,12 +5062,12 @@ /* Do this after making BUF current in case scroll_margin is buffer-local. */ this_scroll_margin = - max (0, min (scroll_margin, XFASTINT (WVAR (w, total_lines)) / 4)); + max (0, min (scroll_margin, XFASTINT (WGET (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 (WVAR (w, frame)))) + if (FRAME_WINDOW_P (XFRAME (WGET (w, frame)))) { if (center_p) { @@ -5190,8 +5184,8 @@ } /* Set the new window start. */ - set_marker_both (WVAR (w, start), WVAR (w, buffer), charpos, bytepos); - WVAR (w, window_end_valid) = Qnil; + set_marker_both (WGET (w, start), WGET (w, buffer), charpos, bytepos); + WSET (w, window_end_valid, Qnil); w->optional_new_start = 1; @@ -5213,7 +5207,7 @@ { struct window *w = decode_window (window); int pixel_height = window_box_height (w); - int line_height = pixel_height / FRAME_LINE_HEIGHT (XFRAME (WVAR (w, frame))); + int line_height = pixel_height / FRAME_LINE_HEIGHT (XFRAME (WGET (w, frame))); return make_number (line_height); } @@ -5234,24 +5228,24 @@ int this_scroll_margin; #endif - if (!(BUFFERP (WVAR (w, buffer)) - && XBUFFER (WVAR (w, buffer)) == current_buffer)) + if (!(BUFFERP (WGET (w, buffer)) + && XBUFFER (WGET (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 (WVAR (w, start)); + start = marker_position (WGET (w, start)); if (start < BEGV || start > ZV) { int height = window_internal_height (w); Fvertical_motion (make_number (- (height / 2)), window); - set_marker_both (WVAR (w, start), WVAR (w, buffer), PT, PT_BYTE); + set_marker_both (WGET (w, start), WGET (w, buffer), PT, PT_BYTE); w->start_at_line_beg = !NILP (Fbolp ()); w->force_start = 1; } else - Fgoto_char (WVAR (w, start)); + Fgoto_char (WGET (w, start)); lines = displayed_window_lines (w); @@ -5355,7 +5349,7 @@ data = (struct save_window_data *) XVECTOR (config); saved_windows = XVECTOR (data->saved_windows); - return WVAR (XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window), frame); + return WGET (XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window), frame); } DEFUN ("set-window-configuration", Fset_window_configuration, @@ -5397,11 +5391,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 (WVAR (XWINDOW (data->current_window), buffer), new_current_buffer) + if (EQ (WGET (XWINDOW (data->current_window), buffer), new_current_buffer) && WINDOWP (selected_window) - && EQ (WVAR (XWINDOW (selected_window), buffer), new_current_buffer) + && EQ (WGET (XWINDOW (selected_window), buffer), new_current_buffer) && !EQ (selected_window, data->current_window)) - old_point = XMARKER (WVAR (XWINDOW (data->current_window), pointm))->charpos; + old_point = XMARKER (WGET (XWINDOW (data->current_window), pointm))->charpos; else old_point = PT; else @@ -5413,15 +5407,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 (WVAR (XWINDOW (data->current_window), buffer), new_current_buffer) + if (EQ (WGET (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 (WVAR (XWINDOW (data->current_window), pointm))->charpos; + old_point = XMARKER (WGET (XWINDOW (data->current_window), pointm))->charpos; else old_point = BUF_PT (XBUFFER (new_current_buffer)); } - frame = WVAR (XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window), frame); + frame = WGET (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. @@ -5474,13 +5468,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 (WVAR (XWINDOW (selected_window), buffer))) + if (! NILP (WGET (XWINDOW (selected_window), buffer))) { w = XWINDOW (selected_window); - set_marker_both (WVAR (w, pointm), - WVAR (w, buffer), - BUF_PT (XBUFFER (WVAR (w, buffer))), - BUF_PT_BYTE (XBUFFER (WVAR (w, buffer)))); + set_marker_both (WGET (w, pointm), + WGET (w, buffer), + BUF_PT (XBUFFER (WGET (w, buffer))), + BUF_PT_BYTE (XBUFFER (WGET (w, buffer)))); } windows_or_buffers_changed++; @@ -5509,60 +5503,60 @@ p = SAVED_WINDOW_N (saved_windows, k); window = p->window; w = XWINDOW (window); - WVAR (w, next) = Qnil; + WSET (w, next, Qnil); if (!NILP (p->parent)) - WVAR (w, parent) = SAVED_WINDOW_N (saved_windows, - XFASTINT (p->parent))->window; + WSET (w, parent, SAVED_WINDOW_N (saved_windows, + XFASTINT (p->parent))->window); else - WVAR (w, parent) = Qnil; + WSET (w, parent, Qnil); if (!NILP (p->prev)) { - WVAR (w, prev) = SAVED_WINDOW_N (saved_windows, - XFASTINT (p->prev))->window; - WVAR (XWINDOW (WVAR (w, prev)), next) = p->window; + WSET (w, prev, SAVED_WINDOW_N (saved_windows, + XFASTINT (p->prev))->window); + WSET (XWINDOW (WGET (w, prev)), next, p->window); } else { - WVAR (w, prev) = Qnil; - if (!NILP (WVAR (w, parent))) + WSET (w, prev, Qnil); + if (!NILP (WGET (w, parent))) { - if (EQ (p->total_cols, WVAR (XWINDOW (WVAR (w, parent)), total_cols))) + if (EQ (p->total_cols, WGET (XWINDOW (WGET (w, parent)), total_cols))) { - WVAR (XWINDOW (WVAR (w, parent)), vchild) = p->window; - WVAR (XWINDOW (WVAR (w, parent)), hchild) = Qnil; + WSET (XWINDOW (WGET (w, parent)), vchild, p->window); + WSET (XWINDOW (WGET (w, parent)), hchild, Qnil); } else { - WVAR (XWINDOW (WVAR (w, parent)), hchild) = p->window; - WVAR (XWINDOW (WVAR (w, parent)), vchild) = Qnil; + WSET (XWINDOW (WGET (w, parent)), hchild, p->window); + WSET (XWINDOW (WGET (w, parent)), vchild, Qnil); } } } /* If we squirreled away the buffer in the window's height, restore it now. */ - if (BUFFERP (WVAR (w, total_lines))) - WVAR (w, buffer) = WVAR (w, total_lines); - WVAR (w, left_col) = p->left_col; - WVAR (w, top_line) = p->top_line; - WVAR (w, total_cols) = p->total_cols; - WVAR (w, total_lines) = p->total_lines; - WVAR (w, normal_cols) = p->normal_cols; - WVAR (w, normal_lines) = p->normal_lines; + if (BUFFERP (WGET (w, total_lines))) + WSET (w, buffer, WGET (w, total_lines)); + WSET (w, left_col, p->left_col); + WSET (w, top_line, p->top_line); + WSET (w, total_cols, p->total_cols); + WSET (w, total_lines, p->total_lines); + WSET (w, normal_cols, p->normal_cols); + WSET (w, normal_lines, p->normal_lines); w->hscroll = XFASTINT (p->hscroll); w->min_hscroll = XFASTINT (p->min_hscroll); - WVAR (w, display_table) = p->display_table; - WVAR (w, left_margin_cols) = p->left_margin_cols; - WVAR (w, right_margin_cols) = p->right_margin_cols; - WVAR (w, left_fringe_width) = p->left_fringe_width; - WVAR (w, right_fringe_width) = p->right_fringe_width; + WSET (w, display_table, p->display_table); + WSET (w, left_margin_cols, p->left_margin_cols); + WSET (w, right_margin_cols, p->right_margin_cols); + WSET (w, left_fringe_width, p->left_fringe_width); + WSET (w, right_fringe_width, p->right_fringe_width); w->fringes_outside_margins = !NILP (p->fringes_outside_margins); - WVAR (w, scroll_bar_width) = p->scroll_bar_width; - WVAR (w, vertical_scroll_bar_type) = p->vertical_scroll_bar_type; - WVAR (w, dedicated) = p->dedicated; - WVAR (w, combination_limit) = p->combination_limit; + WSET (w, scroll_bar_width, p->scroll_bar_width); + WSET (w, vertical_scroll_bar_type, p->vertical_scroll_bar_type); + WSET (w, dedicated, p->dedicated); + WSET (w, combination_limit, p->combination_limit); /* Restore any window parameters that have been saved. Parameters that have not been saved are left alone. */ for (tem = p->window_parameters; CONSP (tem); tem = XCDR (tem)) @@ -5572,7 +5566,7 @@ { if (NILP (XCDR (pers))) { - par = Fassq (XCAR (pers), WVAR (w, window_parameters)); + par = Fassq (XCAR (pers), WGET (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 @@ -5591,50 +5585,50 @@ /* Reinstall the saved buffer and pointers into it. */ if (NILP (p->buffer)) /* An internal window. */ - WVAR (w, buffer) = p->buffer; + WSET (w, buffer, p->buffer); else if (!NILP (BVAR (XBUFFER (p->buffer), name))) /* If saved buffer is alive, install it. */ { - WVAR (w, buffer) = p->buffer; - w->start_at_line_beg = !NILP (p->start_at_line_beg); - set_marker_restricted (WVAR (w, start), p->start, WVAR (w, buffer)); - set_marker_restricted (WVAR (w, pointm), p->pointm, - WVAR (w, buffer)); - Fset_marker (BVAR (XBUFFER (WVAR (w, buffer)), mark), - p->mark, WVAR (w, buffer)); + 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)); - /* 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 (WVAR (w, pointm)); - } - else if (!NILP (WVAR (w, buffer)) - && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), name))) - /* Keep window's old buffer; make sure the markers are - real. */ - { - /* Set window markers at start of visible range. */ - if (XMARKER (WVAR (w, start))->buffer == 0) - set_marker_restricted (WVAR (w, start), make_number (0), - WVAR (w, buffer)); - if (XMARKER (WVAR (w, pointm))->buffer == 0) - set_marker_restricted_both - (WVAR (w, pointm), WVAR (w, buffer), - BUF_PT (XBUFFER (WVAR (w, buffer))), - BUF_PT_BYTE (XBUFFER (WVAR (w, buffer)))); - w->start_at_line_beg = 1; - } - else if (STRINGP (auto_buffer_name = - Fwindow_parameter (window, Qauto_buffer_name)) - && SCHARS (auto_buffer_name) != 0 - && !NILP (WVAR (w, buffer) = Fget_buffer_create (auto_buffer_name))) - { - set_marker_restricted (WVAR (w, start), - make_number (0), WVAR (w, buffer)); - set_marker_restricted (WVAR (w, pointm), - make_number (0), WVAR (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)); + } + else if (!NILP (WGET (w, buffer)) + && !NILP (BVAR (XBUFFER (WGET (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) + set_marker_restricted_both + (WGET (w, pointm), WGET (w, buffer), + BUF_PT (XBUFFER (WGET (w, buffer))), + BUF_PT_BYTE (XBUFFER (WGET (w, buffer)))); + w->start_at_line_beg = 1; + } + else if (STRINGP (auto_buffer_name = + Fwindow_parameter (window, Qauto_buffer_name)) + && 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)); w->start_at_line_beg = 1; } else @@ -5644,36 +5638,36 @@ avoid showing an unimportant buffer and, if necessary, to recreate *scratch* in the course (part of Juanma's bs-show scenario from March 2011). */ - WVAR (w, buffer) = other_buffer_safely (Fcurrent_buffer ()); + WSET (w, buffer, other_buffer_safely (Fcurrent_buffer ())); /* This will set the markers to beginning of visible range. */ - set_marker_restricted (WVAR (w, start), - make_number (0), WVAR (w, buffer)); - set_marker_restricted (WVAR (w, pointm), - make_number (0), WVAR (w, buffer)); + set_marker_restricted (WGET (w, start), + make_number (0), WGET (w, buffer)); + set_marker_restricted (WGET (w, pointm), + make_number (0), WGET (w, buffer)); w->start_at_line_beg = 1; - if (!NILP (WVAR (w, dedicated))) + if (!NILP (WGET (w, dedicated))) /* Record this window as dead. */ dead_windows = Fcons (window, dead_windows); /* Make sure window is no more dedicated. */ - WVAR (w, dedicated) = Qnil; + WSET (w, dedicated, Qnil); } } 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 (WVAR (XWINDOW (data->current_window), buffer), new_current_buffer)) - set_marker_restricted (WVAR (XWINDOW (data->current_window), pointm), + if (EQ (WGET (XWINDOW (data->current_window), buffer), new_current_buffer)) + set_marker_restricted (WGET (XWINDOW (data->current_window), pointm), make_number (old_point), - WVAR (XWINDOW (data->current_window), buffer)); + WGET (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 (WVAR (XWINDOW (selected_window), buffer)), last_selected_window) + BVAR (XBUFFER (WGET (XWINDOW (selected_window), buffer)), last_selected_window) = selected_window; if (NILP (data->focus_frame) @@ -5700,14 +5694,14 @@ /* Now, free glyph matrices in windows that were not reused. */ for (i = n = 0; i < n_leaf_windows; ++i) { - if (NILP (WVAR (leaf_windows[i], buffer))) + if (NILP (WGET (leaf_windows[i], buffer))) { /* Assert it's not reused as a combination. */ - eassert (NILP (WVAR (leaf_windows[i], hchild)) - && NILP (WVAR (leaf_windows[i], vchild))); + eassert (NILP (WGET (leaf_windows[i], hchild)) + && NILP (WGET (leaf_windows[i], vchild))); free_window_matrices (leaf_windows[i]); } - else if (EQ (WVAR (leaf_windows[i], buffer), new_current_buffer)) + else if (EQ (WGET (leaf_windows[i], buffer), new_current_buffer)) ++n; } @@ -5752,28 +5746,28 @@ w = XWINDOW (window); - if (!NILP (WVAR (w, next))) + if (!NILP (WGET (w, next))) /* Delete WINDOW's siblings (we traverse postorderly). */ - delete_all_child_windows (WVAR (w, next)); - - WVAR (w, total_lines) = WVAR (w, buffer); /* See Fset_window_configuration for excuse. */ - - if (!NILP (WVAR (w, vchild))) - { - delete_all_child_windows (WVAR (w, vchild)); - WVAR (w, vchild) = Qnil; - } - else if (!NILP (WVAR (w, hchild))) - { - delete_all_child_windows (WVAR (w, hchild)); - WVAR (w, hchild) = Qnil; - } - else if (!NILP (WVAR (w, buffer))) + 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 (WGET (w, vchild)); + WSET (w, vchild, Qnil); + } + else if (!NILP (WGET (w, hchild))) + { + delete_all_child_windows (WGET (w, hchild)); + WSET (w, hchild, Qnil); + } + else if (!NILP (WGET (w, buffer))) { unshow_buffer (w); - unchain_marker (XMARKER (WVAR (w, pointm))); - unchain_marker (XMARKER (WVAR (w, start))); - WVAR (w, buffer) = Qnil; + unchain_marker (XMARKER (WGET (w, pointm))); + unchain_marker (XMARKER (WGET (w, start))); + WSET (w, buffer, Qnil); } Vwindow_list = Qnil; @@ -5783,12 +5777,12 @@ count_windows (register struct window *window) { register int count = 1; - if (!NILP (WVAR (window, next))) - count += count_windows (XWINDOW (WVAR (window, next))); - if (!NILP (WVAR (window, vchild))) - count += count_windows (XWINDOW (WVAR (window, vchild))); - if (!NILP (WVAR (window, hchild))) - count += count_windows (XWINDOW (WVAR (window, hchild))); + 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))); return count; } @@ -5800,14 +5794,14 @@ { while (w) { - if (!NILP (WVAR (w, hchild))) - i = get_leaf_windows (XWINDOW (WVAR (w, hchild)), flat, i); - else if (!NILP (WVAR (w, vchild))) - i = get_leaf_windows (XWINDOW (WVAR (w, vchild)), flat, i); + 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); else flat[i++] = w; - w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); + w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); } return i; @@ -5860,32 +5854,32 @@ register struct window *w; register Lisp_Object tem, pers, par; - for (;!NILP (window); window = WVAR (w, next)) + for (;!NILP (window); window = WGET (w, next)) { p = SAVED_WINDOW_N (vector, i); w = XWINDOW (window); - XSETFASTINT (WVAR (w, temslot), i); i++; + WSET (w, temslot, make_number (i)); i++; p->window = window; - p->buffer = WVAR (w, buffer); - p->left_col = WVAR (w, left_col); - p->top_line = WVAR (w, top_line); - p->total_cols = WVAR (w, total_cols); - p->total_lines = WVAR (w, total_lines); - p->normal_cols = WVAR (w, normal_cols); - p->normal_lines = WVAR (w, normal_lines); + 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); XSETFASTINT (p->hscroll, w->hscroll); XSETFASTINT (p->min_hscroll, w->min_hscroll); - p->display_table = WVAR (w, display_table); - p->left_margin_cols = WVAR (w, left_margin_cols); - p->right_margin_cols = WVAR (w, right_margin_cols); - p->left_fringe_width = WVAR (w, left_fringe_width); - p->right_fringe_width = WVAR (w, right_fringe_width); + 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->fringes_outside_margins = w->fringes_outside_margins ? Qt : Qnil; - p->scroll_bar_width = WVAR (w, scroll_bar_width); - p->vertical_scroll_bar_type = WVAR (w, vertical_scroll_bar_type); - p->dedicated = WVAR (w, dedicated); - p->combination_limit = WVAR (w, combination_limit); + 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->window_parameters = Qnil; if (!NILP (Vwindow_persistent_parameters)) @@ -5918,7 +5912,7 @@ /* Save values for persistent window parameters. */ if (CONSP (pers) && !NILP (XCDR (pers))) { - par = Fassq (XCAR (pers), WVAR (w, window_parameters)); + par = Fassq (XCAR (pers), WGET (w, window_parameters)); if (NILP (par)) /* If the window has no value for the parameter, make one. */ @@ -5934,24 +5928,24 @@ } } - if (!NILP (WVAR (w, buffer))) + if (!NILP (WGET (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 (WVAR (w, buffer)), - BUF_PT (XBUFFER (WVAR (w, buffer))), - BUF_PT_BYTE (XBUFFER (WVAR (w, buffer)))); + p->pointm = build_marker (XBUFFER (WGET (w, buffer)), + BUF_PT (XBUFFER (WGET (w, buffer))), + BUF_PT_BYTE (XBUFFER (WGET (w, buffer)))); else - p->pointm = Fcopy_marker (WVAR (w, pointm), Qnil); + p->pointm = Fcopy_marker (WGET (w, pointm), Qnil); XMARKER (p->pointm)->insertion_type = !NILP (Vwindow_point_insertion_type); - p->start = Fcopy_marker (WVAR (w, start), Qnil); + p->start = Fcopy_marker (WGET (w, start), Qnil); p->start_at_line_beg = w->start_at_line_beg ? Qt : Qnil; - tem = BVAR (XBUFFER (WVAR (w, buffer)), mark); + tem = BVAR (XBUFFER (WGET (w, buffer)), mark); p->mark = Fcopy_marker (tem, Qnil); } else @@ -5962,20 +5956,20 @@ p->start_at_line_beg = Qnil; } - if (NILP (WVAR (w, parent))) + if (NILP (WGET (w, parent))) p->parent = Qnil; else - p->parent = WVAR (XWINDOW (WVAR (w, parent)), temslot); + p->parent = WGET (XWINDOW (WGET (w, parent)), temslot); - if (NILP (WVAR (w, prev))) + if (NILP (WGET (w, prev))) p->prev = Qnil; else - p->prev = WVAR (XWINDOW (WVAR (w, prev)), temslot); + p->prev = WGET (XWINDOW (WGET (w, prev)), temslot); - if (!NILP (WVAR (w, vchild))) - i = save_window_save (WVAR (w, vchild), vector, i); - if (!NILP (WVAR (w, hchild))) - i = save_window_save (WVAR (w, hchild), vector, i); + 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); } return i; @@ -6064,11 +6058,11 @@ right_width = Qnil; } - if (!EQ (WVAR (w, left_margin_cols), left_width) - || !EQ (WVAR (w, right_margin_cols), right_width)) + if (!EQ (WGET (w, left_margin_cols), left_width) + || !EQ (WGET (w, right_margin_cols), right_width)) { - WVAR (w, left_margin_cols) = left_width; - WVAR (w, right_margin_cols) = right_width; + WSET (w, left_margin_cols, left_width); + WSET (w, right_margin_cols, right_width); adjust_window_margins (w); @@ -6090,7 +6084,7 @@ (Lisp_Object window) { struct window *w = decode_window (window); - return Fcons (WVAR (w, left_margin_cols), WVAR (w, right_margin_cols)); + return Fcons (WGET (w, left_margin_cols), WGET (w, right_margin_cols)); } @@ -6124,18 +6118,18 @@ /* Do nothing on a tty. */ if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) - && (!EQ (WVAR (w, left_fringe_width), left_width) - || !EQ (WVAR (w, right_fringe_width), right_width) + && (!EQ (WGET (w, left_fringe_width), left_width) + || !EQ (WGET (w, right_fringe_width), right_width) || w->fringes_outside_margins != outside)) { - WVAR (w, left_fringe_width) = left_width; - WVAR (w, right_fringe_width) = right_width; + WSET (w, left_fringe_width, left_width); + WSET (w, right_fringe_width, right_width); w->fringes_outside_margins = outside; adjust_window_margins (w); clear_glyph_matrix (w->current_matrix); - WVAR (w, window_end_valid) = Qnil; + WSET (w, window_end_valid, Qnil); ++windows_or_buffers_changed; adjust_glyphs (XFRAME (WINDOW_FRAME (w))); @@ -6195,16 +6189,16 @@ || EQ (vertical_type, Qt))) error ("Invalid type of vertical scroll bar"); - if (!EQ (WVAR (w, scroll_bar_width), width) - || !EQ (WVAR (w, vertical_scroll_bar_type), vertical_type)) + if (!EQ (WGET (w, scroll_bar_width), width) + || !EQ (WGET (w, vertical_scroll_bar_type), vertical_type)) { - WVAR (w, scroll_bar_width) = width; - WVAR (w, vertical_scroll_bar_type) = vertical_type; + WSET (w, scroll_bar_width, width); + WSET (w, vertical_scroll_bar_type, vertical_type); adjust_window_margins (w); clear_glyph_matrix (w->current_matrix); - WVAR (w, window_end_valid) = Qnil; + WSET (w, window_end_valid, Qnil); ++windows_or_buffers_changed; adjust_glyphs (XFRAME (WINDOW_FRAME (w))); @@ -6228,7 +6222,7 @@ ? WINDOW_CONFIG_SCROLL_BAR_WIDTH (w) : WINDOW_SCROLL_BAR_AREA_WIDTH (w))), Fcons (make_number (WINDOW_SCROLL_BAR_COLS (w)), - Fcons (WVAR (w, vertical_scroll_bar_type), + Fcons (WGET (w, vertical_scroll_bar_type), Fcons (Qnil, Qnil)))); } @@ -6254,7 +6248,7 @@ else CHECK_WINDOW (window); w = XWINDOW (window); - f = XFRAME (WVAR (w, frame)); + f = XFRAME (WGET (w, frame)); if (FRAME_WINDOW_P (f)) result = (NILP (pixels_p) @@ -6288,7 +6282,7 @@ CHECK_NUMBER_OR_FLOAT (vscroll); w = XWINDOW (window); - f = XFRAME (WVAR (w, frame)); + f = XFRAME (WGET (w, frame)); if (FRAME_WINDOW_P (f)) { @@ -6307,7 +6301,7 @@ adjust_glyphs (f); /* Prevent redisplay shortcuts. */ - XBUFFER (WVAR (w, buffer))->prevent_redisplay_optimizations_p = 1; + XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1; } } @@ -6341,14 +6335,14 @@ for (cont = 1; w && cont;) { - if (!NILP (WVAR (w, hchild))) - cont = foreach_window_1 (XWINDOW (WVAR (w, hchild)), fn, user_data); - else if (!NILP (WVAR (w, vchild))) - cont = foreach_window_1 (XWINDOW (WVAR (w, vchild)), fn, user_data); + 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); else cont = fn (w, user_data); - w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); + w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); } return cont; === modified file 'src/window.h' --- src/window.h 2012-08-06 05:27:54 +0000 +++ src/window.h 2012-08-06 10:24:26 +0000 @@ -86,9 +86,15 @@ int hpos, vpos; }; -/* Most code should use this macro to access Lisp fields in struct window. */ - -#define WVAR(w, field) ((w)->INTERNAL_FIELD (field)) +/* 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)) struct window { @@ -396,13 +402,13 @@ This includes scroll bars and fringes. */ #define WINDOW_TOTAL_COLS(W) \ - (XFASTINT (WVAR (W, total_cols))) + (XFASTINT (WGET (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 (WVAR (W, total_lines))) + (XFASTINT (WGET (W, total_lines))) /* Return the total pixel width of window W. */ @@ -430,7 +436,7 @@ This includes a left-hand scroll bar, if any. */ #define WINDOW_LEFT_EDGE_COL(W) \ - (XFASTINT (WVAR (W, left_col))) + (XFASTINT (WGET (W, left_col))) /* Return the canonical frame column before which window W ends. This includes a right-hand scroll bar, if any. */ @@ -442,7 +448,7 @@ This includes a header line, if any. */ #define WINDOW_TOP_EDGE_LINE(W) \ - (XFASTINT (WVAR (W, top_line))) + (XFASTINT (WGET (W, top_line))) /* Return the canonical frame line before which window W ends. This includes a mode line, if any. */ @@ -547,31 +553,31 @@ /* Width of left margin area in columns. */ #define WINDOW_LEFT_MARGIN_COLS(W) \ - (NILP (WVAR (W, left_margin_cols)) \ + (NILP (WGET (W, left_margin_cols)) \ ? 0 \ - : XINT (WVAR (W, left_margin_cols))) + : XINT (WGET (W, left_margin_cols))) /* Width of right marginal area in columns. */ #define WINDOW_RIGHT_MARGIN_COLS(W) \ - (NILP (WVAR (W, right_margin_cols)) \ + (NILP (WGET (W, right_margin_cols)) \ ? 0 \ - : XINT (WVAR (W, right_margin_cols))) + : XINT (WGET (W, right_margin_cols))) /* Width of left margin area in pixels. */ #define WINDOW_LEFT_MARGIN_WIDTH(W) \ - (NILP (WVAR (W, left_margin_cols)) \ + (NILP (WGET (W, left_margin_cols)) \ ? 0 \ - : (XINT (WVAR (W, left_margin_cols)) \ + : (XINT (WGET (W, left_margin_cols)) \ * WINDOW_FRAME_COLUMN_WIDTH (W))) /* Width of right marginal area in pixels. */ #define WINDOW_RIGHT_MARGIN_WIDTH(W) \ - (NILP (WVAR (W, right_margin_cols)) \ + (NILP (WGET (W, right_margin_cols)) \ ? 0 \ - : (XINT (WVAR (W, right_margin_cols)) \ + : (XINT (WGET (W, right_margin_cols)) \ * WINDOW_FRAME_COLUMN_WIDTH (W))) /* Total width of fringes reserved for drawing truncation bitmaps, @@ -581,8 +587,8 @@ able to split windows horizontally nicely. */ #define WINDOW_FRINGE_COLS(W) \ - ((INTEGERP (WVAR (W, left_fringe_width)) \ - || INTEGERP (WVAR (W, right_fringe_width))) \ + ((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) \ @@ -604,13 +610,13 @@ /* Pixel-width of the left and right fringe. */ #define WINDOW_LEFT_FRINGE_WIDTH(W) \ - (INTEGERP (WVAR (W, left_fringe_width)) \ - ? XFASTINT (WVAR (W, left_fringe_width)) \ + (INTEGERP (WGET (W, left_fringe_width)) \ + ? XFASTINT (WGET (W, left_fringe_width)) \ : FRAME_LEFT_FRINGE_WIDTH (WINDOW_XFRAME (W))) #define WINDOW_RIGHT_FRINGE_WIDTH(W) \ - (INTEGERP (WVAR (W, right_fringe_width)) \ - ? XFASTINT (WVAR (W, right_fringe_width)) \ + (INTEGERP (WGET (W, right_fringe_width)) \ + ? XFASTINT (WGET (W, right_fringe_width)) \ : FRAME_RIGHT_FRINGE_WIDTH (WINDOW_XFRAME (W))) /* Total width of fringes in pixels. */ @@ -627,36 +633,36 @@ and which side they are on. */ #define WINDOW_VERTICAL_SCROLL_BAR_TYPE(w) \ - (EQ (WVAR (w, vertical_scroll_bar_type), Qt) \ + (EQ (WGET (w, vertical_scroll_bar_type), Qt) \ ? FRAME_VERTICAL_SCROLL_BAR_TYPE (WINDOW_XFRAME (w)) \ - : EQ (WVAR (w, vertical_scroll_bar_type), Qleft) \ + : EQ (WGET (w, vertical_scroll_bar_type), Qleft) \ ? vertical_scroll_bar_left \ - : EQ (WVAR (w, vertical_scroll_bar_type), Qright) \ + : EQ (WGET (w, vertical_scroll_bar_type), Qright) \ ? vertical_scroll_bar_right \ : vertical_scroll_bar_none) \ #define WINDOW_HAS_VERTICAL_SCROLL_BAR(w) \ - (EQ (WVAR (w, vertical_scroll_bar_type), Qt) \ + (EQ (WGET (w, vertical_scroll_bar_type), Qt) \ ? FRAME_HAS_VERTICAL_SCROLL_BARS (WINDOW_XFRAME (w)) \ - : !NILP (WVAR (w, vertical_scroll_bar_type))) + : !NILP (WGET (w, vertical_scroll_bar_type))) #define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT(w) \ - (EQ (WVAR (w, vertical_scroll_bar_type), Qt) \ + (EQ (WGET (w, vertical_scroll_bar_type), Qt) \ ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (WINDOW_XFRAME (w)) \ - : EQ (WVAR (w, vertical_scroll_bar_type), Qleft)) + : EQ (WGET (w, vertical_scroll_bar_type), Qleft)) #define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT(w) \ - (EQ (WVAR (w, vertical_scroll_bar_type), Qt) \ + (EQ (WGET (w, vertical_scroll_bar_type), Qt) \ ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (WINDOW_XFRAME (w))\ - : EQ (WVAR (w, vertical_scroll_bar_type), Qright)) + : EQ (WGET (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 (WVAR (w, scroll_bar_width)) \ - ? XFASTINT (WVAR (w, scroll_bar_width)) \ + (INTEGERP (WGET (w, scroll_bar_width)) \ + ? XFASTINT (WGET (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. @@ -664,8 +670,8 @@ this is still nonzero. */ #define WINDOW_CONFIG_SCROLL_BAR_COLS(w) \ - (INTEGERP (WVAR (w, scroll_bar_width)) \ - ? ((XFASTINT (WVAR (w, scroll_bar_width)) \ + (INTEGERP (WGET (w, scroll_bar_width)) \ + ? ((XFASTINT (WGET (w, scroll_bar_width)) \ + WINDOW_FRAME_COLUMN_WIDTH (w) - 1) \ / WINDOW_FRAME_COLUMN_WIDTH (w)) \ : FRAME_CONFIG_SCROLL_BAR_COLS (WINDOW_XFRAME (w))) @@ -887,9 +893,8 @@ /* Value is non-zero if WINDOW is a live window. */ -#define WINDOW_LIVE_P(WINDOW) \ - (WINDOWP ((WINDOW)) && !NILP (WVAR (XWINDOW ((WINDOW)), buffer))) - +#define WINDOW_LIVE_P(WINDOW) \ + (WINDOWP (WINDOW) && !NILP (WGET (XWINDOW (WINDOW), buffer))) /* These used to be in lisp.h. */ === modified file 'src/xdisp.c' --- src/xdisp.c 2012-08-06 05:27:54 +0000 +++ src/xdisp.c 2012-08-06 10:24:26 +0000 @@ -984,7 +984,7 @@ int window_box_width (struct window *w, int area) { - int cols = XFASTINT (WVAR (w, total_cols)); + int cols = XFASTINT (WGET (w, total_cols)); int pixels = 0; if (!w->pseudo_window_p) @@ -993,22 +993,22 @@ if (area == TEXT_AREA) { - if (INTEGERP (WVAR (w, left_margin_cols))) - cols -= XFASTINT (WVAR (w, left_margin_cols)); - if (INTEGERP (WVAR (w, right_margin_cols))) - cols -= XFASTINT (WVAR (w, right_margin_cols)); + 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)); pixels = -WINDOW_TOTAL_FRINGE_WIDTH (w); } else if (area == LEFT_MARGIN_AREA) { - cols = (INTEGERP (WVAR (w, left_margin_cols)) - ? XFASTINT (WVAR (w, left_margin_cols)) : 0); + cols = (INTEGERP (WGET (w, left_margin_cols)) + ? XFASTINT (WGET (w, left_margin_cols)) : 0); pixels = 0; } else if (area == RIGHT_MARGIN_AREA) { - cols = (INTEGERP (WVAR (w, right_margin_cols)) - ? XFASTINT (WVAR (w, right_margin_cols)) : 0); + cols = (INTEGERP (WGET (w, right_margin_cols)) + ? XFASTINT (WGET (w, right_margin_cols)) : 0); pixels = 0; } } @@ -1023,7 +1023,7 @@ int window_box_height (struct window *w) { - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (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 (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (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 (WVAR (w, buffer)) != current_buffer) + if (XBUFFER (WGET (w, buffer)) != current_buffer) { old_buffer = current_buffer; - set_buffer_internal_1 (XBUFFER (WVAR (w, buffer))); + set_buffer_internal_1 (XBUFFER (WGET (w, buffer))); } - SET_TEXT_POS_FROM_MARKER (top, WVAR (w, start)); + SET_TEXT_POS_FROM_MARKER (top, WGET (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 (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (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 (WVAR (w, window_end_valid))) + && !NILP (WGET (w, window_end_valid))) { struct glyph_row *row; eassert ((row = MATRIX_ROW (w->current_matrix, - XFASTINT (WVAR (w, window_end_vpos))), + XFASTINT (WGET (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 (WVAR (w, frame)), base_face_id); + = lookup_basic_face (XFRAME (WGET (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 (WVAR (w, frame)); + it->f = XFRAME (WGET (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 (WVAR (w, redisplay_end_trigger)) - && XMARKER (WVAR (w, redisplay_end_trigger))->buffer != 0) + if (MARKERP (WGET (w, redisplay_end_trigger)) + && XMARKER (WGET (w, redisplay_end_trigger))->buffer != 0) it->redisplay_end_trigger_charpos - = marker_position (WVAR (w, redisplay_end_trigger)); - else if (INTEGERP (WVAR (w, redisplay_end_trigger))) + = marker_position (WGET (w, redisplay_end_trigger)); + else if (INTEGERP (WGET (w, redisplay_end_trigger))) it->redisplay_end_trigger_charpos = - clip_to_bounds (PTRDIFF_MIN, XINT (WVAR (w, redisplay_end_trigger)), PTRDIFF_MAX); + clip_to_bounds (PTRDIFF_MIN, XINT (WGET (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 = WVAR (it->w, buffer); + object = WGET (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) ? WVAR (it->w, buffer) : object; + it->object = NILP (object) ? WGET (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) ? WVAR (it->w, buffer) : object; + it->object = NILP (object) ? WGET (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 = WVAR (it->w, buffer); + it->object = WGET (it->w, buffer); break; case GET_FROM_STRING: it->object = it->string; @@ -5798,7 +5798,7 @@ else { it->method = GET_FROM_BUFFER; - it->object = WVAR (it->w, buffer); + it->object = WGET (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 = WVAR (it->w, buffer); + it->object = WGET (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 = WVAR (it->w, buffer); + it->object = WGET (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 = WVAR (it->w, buffer); + it->object = WGET (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 = WVAR (it->w, buffer); + it->object = WGET (it->w, buffer); it->position = it->current.pos; /* Normally we return the character found above, except when we @@ -7981,7 +7981,7 @@ /* Since we are *trying* to run these functions, don't try to run them again, even if they get an error. */ - WVAR (it->w, redisplay_end_trigger) = Qnil; + WSET (it->w, redisplay_end_trigger, Qnil); Frun_hook_with_args (3, args); /* Notice if it changed the face of the character we are on. */ @@ -8030,7 +8030,7 @@ return 0; } it->position = it->current.pos; - it->object = WVAR (it->w, buffer); + it->object = WGET (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 (WVAR (it->w, window_end_vpos))) + && it->vpos < XFASTINT (WGET (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 = WVAR (XWINDOW (mini_window), frame); + frame = WGET (XWINDOW (mini_window), frame); f = XFRAME (frame); FRAME_SAMPLE_VISIBILITY (f); @@ -9969,8 +9969,8 @@ set_buffer_internal_1 (XBUFFER (buffer)); if (w) { - WVAR (w, buffer) = buffer; - set_marker_both (WVAR (w, pointm), buffer, BEG, BEG_BYTE); + WSET (w, buffer, buffer); + set_marker_both (WGET (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, WVAR (w, buffer)); ++i; - ASET (vector, i, make_number (XMARKER (WVAR (w, pointm))->charpos)); ++i; - ASET (vector, i, make_number (XMARKER (WVAR (w, pointm))->bytepos)); ++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; } else { @@ -10054,8 +10054,8 @@ charpos = AREF (vector, 5); bytepos = AREF (vector, 6); - WVAR (w, buffer) = buffer; - set_marker_both (WVAR (w, pointm), buffer, + WSET (w, buffer, buffer); + set_marker_both (WGET (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, WVAR (w, start)); + SET_TEXT_POS_FROM_MARKER (start, WGET (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 (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); int window_height_changed_p = 0; eassert (MINI_WINDOW_P (w)); /* By default, start display at the beginning. */ - set_marker_both (WVAR (w, start), WVAR (w, buffer), - BUF_BEGV (XBUFFER (WVAR (w, buffer))), - BUF_BEGV_BYTE (XBUFFER (WVAR (w, buffer)))); + set_marker_both (WGET (w, start), WGET (w, buffer), + BUF_BEGV (XBUFFER (WGET (w, buffer))), + BUF_BEGV_BYTE (XBUFFER (WGET (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 (WVAR (w, buffer))) + if (current_buffer != XBUFFER (WGET (w, buffer))) { old_current_buffer = current_buffer; - set_buffer_internal (XBUFFER (WVAR (w, buffer))); + set_buffer_internal (XBUFFER (WGET (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 (WVAR (w, start), start); + SET_MARKER_FROM_TEXT_POS (WGET (w, start), start); if (EQ (Vresize_mini_windows, Qgrow_only)) { @@ -11053,7 +11053,7 @@ Fselect_window (FGET (f, selected_window), Qt); set_buffer_internal_1 - (XBUFFER (WVAR (XWINDOW (FGET (f, selected_window)), buffer))); + (XBUFFER (WGET (XWINDOW (FGET (f, selected_window)), buffer))); fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format; mode_line_target = MODE_LINE_TITLE; @@ -11173,7 +11173,7 @@ && FRAME_NS_P (f)) ns_set_doc_edited (f, Fbuffer_modified_p - (WVAR (XWINDOW (FGET (f, selected_window)), buffer))); + (WGET (XWINDOW (FGET (f, selected_window)), buffer))); #endif UNGCPRO; } @@ -11238,19 +11238,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 (WVAR (w, buffer))) - < BUF_MODIFF (XBUFFER (WVAR (w, buffer)))) + || ((BUF_SAVE_MODIFF (XBUFFER (WGET (w, buffer))) + < BUF_MODIFF (XBUFFER (WGET (w, buffer)))) != w->last_had_star) || ((!NILP (Vtransient_mark_mode) - && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), mark_active))) - != !NILP (WVAR (w, region_showing)))) + && !NILP (BVAR (XBUFFER (WGET (w, buffer)), mark_active))) + != !NILP (WGET (w, region_showing)))) { struct buffer *prev = current_buffer; ptrdiff_t count = SPECPDL_INDEX (); specbind (Qinhibit_menubar_update, Qt); - set_buffer_internal_1 (XBUFFER (WVAR (w, buffer))); + set_buffer_internal_1 (XBUFFER (WGET (w, buffer))); if (save_match_data) record_unwind_save_match_data (); if (NILP (Voverriding_local_map_menu_flag)) @@ -11436,12 +11436,12 @@ if (windows_or_buffers_changed || w->update_mode_line || update_mode_lines - || ((BUF_SAVE_MODIFF (XBUFFER (WVAR (w, buffer))) - < BUF_MODIFF (XBUFFER (WVAR (w, buffer)))) + || ((BUF_SAVE_MODIFF (XBUFFER (WGET (w, buffer))) + < BUF_MODIFF (XBUFFER (WGET (w, buffer)))) != w->last_had_star) || ((!NILP (Vtransient_mark_mode) - && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), mark_active))) - != !NILP (WVAR (w, region_showing)))) + && !NILP (BVAR (XBUFFER (WGET (w, buffer)), mark_active))) + != !NILP (WGET (w, region_showing)))) { struct buffer *prev = current_buffer; ptrdiff_t count = SPECPDL_INDEX (); @@ -11452,7 +11452,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 (WVAR (w, buffer))); + set_buffer_internal_1 (XBUFFER (WGET (w, buffer))); /* Save match data, if we must. */ if (save_match_data) @@ -12323,10 +12323,10 @@ { struct window *w = XWINDOW (window); - if (WINDOWP (WVAR (w, hchild))) - hscrolled_p |= hscroll_window_tree (WVAR (w, hchild)); - else if (WINDOWP (WVAR (w, vchild))) - hscrolled_p |= hscroll_window_tree (WVAR (w, vchild)); + 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)); else if (w->cursor.vpos >= 0) { int h_margin; @@ -12346,7 +12346,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, WVAR (w, buffer))) + if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, WGET (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 +12381,13 @@ /* Find point in a display of infinite width. */ saved_current_buffer = current_buffer; - current_buffer = XBUFFER (WVAR (w, buffer)); + current_buffer = XBUFFER (WGET (w, buffer)); if (w == XWINDOW (selected_window)) pt = PT; else { - pt = marker_position (WVAR (w, pointm)); + pt = marker_position (WGET (w, pointm)); pt = max (BEGV, pt); pt = min (ZV, pt); } @@ -12438,14 +12438,14 @@ redisplay. */ if (w->hscroll != hscroll) { - XBUFFER (WVAR (w, buffer))->prevent_redisplay_optimizations_p = 1; + XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1; w->hscroll = hscroll; hscrolled_p = 1; } } } - window = WVAR (w, next); + window = WGET (w, next); } /* Value is non-zero if hscroll of any leaf window has been changed. */ @@ -12527,9 +12527,9 @@ if (trace_redisplay_p) fprintf (stderr, "%p (%s): %s\n", w, - ((BUFFERP (WVAR (w, buffer)) - && STRINGP (BVAR (XBUFFER (WVAR (w, buffer)), name))) - ? SSDATA (BVAR (XBUFFER (WVAR (w, buffer)), name)) + ((BUFFERP (WGET (w, buffer)) + && STRINGP (BVAR (XBUFFER (WGET (w, buffer)), name))) + ? SSDATA (BVAR (XBUFFER (WGET (w, buffer)), name)) : "no buffer"), method + len); } @@ -12594,8 +12594,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 (WVAR (w, buffer)), bidi_display_reordering)) - && NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_paragraph_direction))) + if (!NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering)) + && NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_paragraph_direction))) unchanged_p = 0; } @@ -12807,7 +12807,7 @@ reconsider_clip_changes (struct window *w, struct buffer *b) { if (b->clip_changed - && !NILP (WVAR (w, window_end_valid)) + && !NILP (WGET (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 +12819,20 @@ b->clip_changed has already been set to 1, we can skip this check. */ if (!b->clip_changed - && BUFFERP (WVAR (w, buffer)) && !NILP (WVAR (w, window_end_valid))) + && BUFFERP (WGET (w, buffer)) && !NILP (WGET (w, window_end_valid))) { ptrdiff_t pt; if (w == XWINDOW (selected_window)) pt = PT; else - pt = marker_position (WVAR (w, pointm)); + pt = marker_position (WGET (w, pointm)); - if ((w->current_matrix->buffer != XBUFFER (WVAR (w, buffer)) + if ((w->current_matrix->buffer != XBUFFER (WGET (w, buffer)) || pt != w->last_point) && check_point_in_composition (w->current_matrix->buffer, w->last_point, - XBUFFER (WVAR (w, buffer)), pt)) + XBUFFER (WGET (w, buffer)), pt)) b->clip_changed = 1; } } @@ -12915,7 +12915,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 (WVAR (w, frame)); + fr = XFRAME (WGET (w, frame)); sf = SELECTED_FRAME (); if (!fr->glyphs_initialized_p) @@ -13051,18 +13051,18 @@ specbind (Qinhibit_point_motion_hooks, Qt); /* If %c is in the mode line, update it if needed. */ - if (!NILP (WVAR (w, column_number_displayed)) + if (!NILP (WGET (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 (WVAR (w, column_number_displayed)) != current_column ())) + && (XFASTINT (WGET (w, column_number_displayed)) != current_column ())) w->update_mode_line = 1; unbind_to (count1, Qnil); - FRAME_SCROLL_BOTTOM_VPOS (XFRAME (WVAR (w, frame))) = -1; + FRAME_SCROLL_BOTTOM_VPOS (XFRAME (WGET (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 +13146,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 (WVAR (w, buffer)), mark_active))) - != !NILP (WVAR (w, region_showing))) - || (!NILP (WVAR (w, region_showing)) - && !EQ (WVAR (w, region_showing), - Fmarker_position (BVAR (XBUFFER (WVAR (w, buffer)), mark))))) + && !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))))) CHARPOS (this_line_start_pos) = 0; /* Optimize the case that only the line containing the cursor in the @@ -13164,11 +13164,11 @@ && !w->update_mode_line && !current_buffer->clip_changed && !current_buffer->prevent_redisplay_optimizations_p - && FRAME_VISIBLE_P (XFRAME (WVAR (w, frame))) - && !FRAME_OBSCURED_P (XFRAME (WVAR (w, frame))) + && FRAME_VISIBLE_P (XFRAME (WGET (w, frame))) + && !FRAME_OBSCURED_P (XFRAME (WGET (w, frame))) /* Make sure recorded data applies to current buffer, etc. */ && this_line_buffer == current_buffer - && current_buffer == XBUFFER (WVAR (w, buffer)) + && current_buffer == XBUFFER (WGET (w, buffer)) && !w->force_start && !w->optional_new_start /* Point must be on the line that we have info recorded about. */ @@ -13266,13 +13266,13 @@ adjusted. */ if ((it.glyph_row - 1)->displays_text_p) { - if (XFASTINT (WVAR (w, window_end_vpos)) < this_line_vpos) - XSETINT (WVAR (w, window_end_vpos), this_line_vpos); + if (XFASTINT (WGET (w, window_end_vpos)) < this_line_vpos) + WSET (w, window_end_vpos, make_number (this_line_vpos)); } - else if (XFASTINT (WVAR (w, window_end_vpos)) == this_line_vpos + else if (XFASTINT (WGET (w, window_end_vpos)) == this_line_vpos && this_line_vpos > 0) - XSETINT (WVAR (w, window_end_vpos), this_line_vpos - 1); - WVAR (w, window_end_valid) = Qnil; + WSET (w, window_end_vpos, make_number (this_line_vpos - 1)); + WSET (w, window_end_valid, Qnil); /* Update hint: No need to try to scroll in update_window. */ w->desired_matrix->no_scrolling_p = 1; @@ -13318,7 +13318,7 @@ && (EQ (selected_window, BVAR (current_buffer, last_selected_window)) || highlight_nonselected_windows) - && NILP (WVAR (w, region_showing)) + && NILP (WGET (w, region_showing)) && NILP (Vshow_trailing_whitespace) && !cursor_in_echo_area) { @@ -13479,7 +13479,7 @@ Lisp_Object mini_window = FRAME_MINIBUF_WINDOW (sf); struct frame *mini_frame; - displayed_buffer = XBUFFER (WVAR (XWINDOW (selected_window), buffer)); + displayed_buffer = XBUFFER (WGET (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 +13545,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 (WVAR (w, frame)))) + && !FRAME_WINDOW_P (XFRAME (WGET (w, frame)))) update_mode_lines = 1; } else @@ -13703,9 +13703,9 @@ static void mark_window_display_accurate_1 (struct window *w, int accurate_p) { - if (BUFFERP (WVAR (w, buffer))) + if (BUFFERP (WGET (w, buffer))) { - struct buffer *b = XBUFFER (WVAR (w, buffer)); + struct buffer *b = XBUFFER (WGET (w, buffer)); w->last_modified = accurate_p ? BUF_MODIFF(b) : 0; w->last_overlay_modified = accurate_p ? BUF_OVERLAY_MODIFF(b) : 0; @@ -13732,13 +13732,13 @@ if (w == XWINDOW (selected_window)) w->last_point = BUF_PT (b); else - w->last_point = XMARKER (WVAR (w, pointm))->charpos; + w->last_point = XMARKER (WGET (w, pointm))->charpos; } } if (accurate_p) { - WVAR (w, window_end_valid) = WVAR (w, buffer); + WSET (w, window_end_valid, WGET (w, buffer)); w->update_mode_line = 0; } } @@ -13754,15 +13754,15 @@ { struct window *w; - for (; !NILP (window); window = WVAR (w, next)) + for (; !NILP (window); window = WGET (w, next)) { w = XWINDOW (window); mark_window_display_accurate_1 (w, accurate_p); - if (!NILP (WVAR (w, vchild))) - mark_window_display_accurate (WVAR (w, vchild), accurate_p); - if (!NILP (WVAR (w, hchild))) - mark_window_display_accurate (WVAR (w, hchild), 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 (accurate_p) @@ -13822,13 +13822,13 @@ { struct window *w = XWINDOW (window); - if (!NILP (WVAR (w, hchild))) - redisplay_windows (WVAR (w, hchild)); - else if (!NILP (WVAR (w, vchild))) - redisplay_windows (WVAR (w, vchild)); - else if (!NILP (WVAR (w, buffer))) + 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))) { - displayed_buffer = XBUFFER (WVAR (w, buffer)); + displayed_buffer = XBUFFER (WGET (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 +13836,7 @@ redisplay_window_error); } - window = WVAR (w, next); + window = WGET (w, next); } } @@ -14470,7 +14470,7 @@ && !MATRIX_ROW_CONTINUATION_LINE_P (row) && row->x == 0) { - this_line_buffer = XBUFFER (WVAR (w, buffer)); + this_line_buffer = XBUFFER (WGET (w, buffer)); CHARPOS (this_line_start_pos) = MATRIX_ROW_START_CHARPOS (row) + delta; @@ -14504,19 +14504,19 @@ run_window_scroll_functions (Lisp_Object window, struct text_pos startp) { struct window *w = XWINDOW (window); - SET_MARKER_FROM_TEXT_POS (WVAR (w, start), startp); + SET_MARKER_FROM_TEXT_POS (WGET (w, start), startp); - if (current_buffer != XBUFFER (WVAR (w, buffer))) + if (current_buffer != XBUFFER (WGET (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, WVAR (w, start)); + SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start)); /* In case the hook functions switch buffers. */ - if (current_buffer != XBUFFER (WVAR (w, buffer))) - set_buffer_internal_1 (XBUFFER (WVAR (w, buffer))); + if (current_buffer != XBUFFER (WGET (w, buffer))) + set_buffer_internal_1 (XBUFFER (WGET (w, buffer))); } return startp; @@ -14606,7 +14606,7 @@ int temp_scroll_step, int last_line_misfit) { struct window *w = XWINDOW (window); - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); struct text_pos pos, startp; struct it it; int this_scroll_margin, scroll_max, rc, height; @@ -14620,7 +14620,7 @@ debug_method_add (w, "try_scrolling"); #endif - SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start)); + SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start)); /* Compute scroll margin height in pixels. We scroll when point is within this distance from the top or bottom of the window. */ @@ -14846,7 +14846,7 @@ if (!just_this_one_p || current_buffer->clip_changed || BEG_UNCHANGED < CHARPOS (startp)) - WVAR (w, base_line_number) = Qnil; + WSET (w, base_line_number, Qnil); /* If cursor ends up on a partially visible line, treat that as being off the bottom of the screen. */ @@ -14881,7 +14881,7 @@ struct text_pos pos, start_pos; int window_start_changed_p = 0; - SET_TEXT_POS_FROM_MARKER (start_pos, WVAR (w, start)); + SET_TEXT_POS_FROM_MARKER (start_pos, WGET (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 +14929,7 @@ } /* Set the window start there. */ - SET_MARKER_FROM_TEXT_POS (WVAR (w, start), pos); + SET_MARKER_FROM_TEXT_POS (WGET (w, start), pos); window_start_changed_p = 1; } } @@ -14965,7 +14965,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_step) { struct window *w = XWINDOW (window); - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); int rc = CURSOR_MOVEMENT_CANNOT_BE_USED; #ifdef GLYPH_DEBUG @@ -14996,7 +14996,7 @@ set the cursor. */ && !(!NILP (Vtransient_mark_mode) && !NILP (BVAR (current_buffer, mark_active))) - && NILP (WVAR (w, region_showing)) + && NILP (WGET (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 +15010,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 (WVAR (w, window_end_vpos)) - && XFASTINT (WVAR (w, window_end_vpos)) < w->current_matrix->nrows + && INTEGERP (WGET (w, window_end_vpos)) + && XFASTINT (WGET (w, window_end_vpos)) < w->current_matrix->nrows && (FRAME_WINDOW_P (f) || !overlay_arrow_in_current_buffer_p ())) { @@ -15148,7 +15148,7 @@ must_scroll = 1; } else if (rc != CURSOR_MOVEMENT_SUCCESS - && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering))) + && !NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering))) { struct glyph_row *row1; @@ -15211,7 +15211,7 @@ else if (scroll_p) rc = CURSOR_MOVEMENT_MUST_SCROLL; else if (rc != CURSOR_MOVEMENT_SUCCESS - && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering))) + && !NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering))) { /* With bidi-reordered rows, there could be more than one candidate row whose start and end positions @@ -15318,12 +15318,12 @@ || (w == XWINDOW (minibuf_window) && NILP (echo_area_buffer[0]))) { - struct buffer *buf = XBUFFER (WVAR (w, buffer)); + struct buffer *buf = XBUFFER (WGET (w, buffer)); whole = BUF_ZV (buf) - BUF_BEGV (buf); - start = marker_position (WVAR (w, start)) - BUF_BEGV (buf); + start = marker_position (WGET (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 (WVAR (w, window_end_pos)) - BUF_BEGV (buf); + end = BUF_Z (buf) - XFASTINT (WGET (w, window_end_pos)) - BUF_BEGV (buf); if (end < start) end = start; @@ -15334,8 +15334,8 @@ start = end = whole = 0; /* Indicate what this scroll bar ought to be displaying now. */ - if (FRAME_TERMINAL (XFRAME (WVAR (w, frame)))->set_vertical_scroll_bar_hook) - (*FRAME_TERMINAL (XFRAME (WVAR (w, frame)))->set_vertical_scroll_bar_hook) + if (FRAME_TERMINAL (XFRAME (WGET (w, frame)))->set_vertical_scroll_bar_hook) + (*FRAME_TERMINAL (XFRAME (WGET (w, frame)))->set_vertical_scroll_bar_hook) (w, end - start, whole, start); } @@ -15351,8 +15351,8 @@ redisplay_window (Lisp_Object window, int just_this_one_p) { struct window *w = XWINDOW (window); - struct frame *f = XFRAME (WVAR (w, frame)); - struct buffer *buffer = XBUFFER (WVAR (w, buffer)); + struct frame *f = XFRAME (WGET (w, frame)); + struct buffer *buffer = XBUFFER (WGET (w, buffer)); struct buffer *old = current_buffer; struct text_pos lpoint, opoint, startp; int update_mode_line; @@ -15375,7 +15375,7 @@ opoint = lpoint; /* W must be a leaf window here. */ - eassert (!NILP (WVAR (w, buffer))); + eassert (!NILP (WGET (w, buffer))); #ifdef GLYPH_DEBUG *w->desired_matrix->method = 0; #endif @@ -15405,10 +15405,10 @@ else if ((w != XWINDOW (minibuf_window) || minibuf_level == 0) /* When buffer is nonempty, redisplay window normally. */ - && BUF_Z (XBUFFER (WVAR (w, buffer))) == BUF_BEG (XBUFFER (WVAR (w, buffer))) + && BUF_Z (XBUFFER (WGET (w, buffer))) == BUF_BEG (XBUFFER (WGET (w, buffer))) /* Quail displays non-mini buffers in minibuffer window. In that case, redisplay the window normally. */ - && !NILP (Fmemq (WVAR (w, buffer), Vminibuffer_list))) + && !NILP (Fmemq (WGET (w, buffer), Vminibuffer_list))) { /* W is a mini-buffer window, but it's not active, so clear it. */ @@ -15430,10 +15430,10 @@ value. */ /* Really select the buffer, for the sake of buffer-local variables. */ - set_buffer_internal_1 (XBUFFER (WVAR (w, buffer))); + set_buffer_internal_1 (XBUFFER (WGET (w, buffer))); current_matrix_up_to_date_p - = (!NILP (WVAR (w, window_end_valid)) + = (!NILP (WGET (w, window_end_valid)) && !current_buffer->clip_changed && !current_buffer->prevent_redisplay_optimizations_p && w->last_modified >= MODIFF @@ -15457,7 +15457,7 @@ specbind (Qinhibit_point_motion_hooks, Qt); buffer_unchanged_p - = (!NILP (WVAR (w, window_end_valid)) + = (!NILP (WGET (w, window_end_valid)) && !current_buffer->clip_changed && w->last_modified >= MODIFF && w->last_overlay_modified >= OVERLAY_MODIFF); @@ -15468,10 +15468,10 @@ { /* If window starts on a continuation line, maybe adjust the window start in case the window's width changed. */ - if (XMARKER (WVAR (w, start))->buffer == current_buffer) + if (XMARKER (WGET (w, start))->buffer == current_buffer) compute_window_start_on_continuation_line (w); - WVAR (w, window_end_valid) = Qnil; + WSET (w, window_end_valid, Qnil); } /* Some sanity checks. */ @@ -15482,13 +15482,13 @@ abort (); /* If %c is in mode line, update it if needed. */ - if (!NILP (WVAR (w, column_number_displayed)) + if (!NILP (WGET (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 (WVAR (w, column_number_displayed)) != current_column ())) + && (XFASTINT (WGET (w, column_number_displayed)) != current_column ())) update_mode_line = 1; /* Count number of windows showing the selected buffer. An indirect @@ -15497,7 +15497,7 @@ { struct buffer *current_base, *window_base; current_base = current_buffer; - window_base = XBUFFER (WVAR (XWINDOW (selected_window), buffer)); + window_base = XBUFFER (WGET (XWINDOW (selected_window), buffer)); if (current_base->base_buffer) current_base = current_base->base_buffer; if (window_base->base_buffer) @@ -15510,19 +15510,19 @@ window, set up appropriate value. */ if (!EQ (window, selected_window)) { - ptrdiff_t new_pt = XMARKER (WVAR (w, pointm))->charpos; - ptrdiff_t new_pt_byte = marker_byte_position (WVAR (w, pointm)); + ptrdiff_t new_pt = XMARKER (WGET (w, pointm))->charpos; + ptrdiff_t new_pt_byte = marker_byte_position (WGET (w, pointm)); if (new_pt < BEGV) { new_pt = BEGV; new_pt_byte = BEGV_BYTE; - set_marker_both (WVAR (w, pointm), Qnil, BEGV, BEGV_BYTE); + set_marker_both (WGET (w, pointm), Qnil, BEGV, BEGV_BYTE); } else if (new_pt > (ZV - 1)) { new_pt = ZV; new_pt_byte = ZV_BYTE; - set_marker_both (WVAR (w, pointm), Qnil, ZV, ZV_BYTE); + set_marker_both (WGET (w, pointm), Qnil, ZV, ZV_BYTE); } /* We don't use SET_PT so that the point-motion hooks don't run. */ @@ -15549,10 +15549,10 @@ } /* If window-start is screwed up, choose a new one. */ - if (XMARKER (WVAR (w, start))->buffer != current_buffer) + if (XMARKER (WGET (w, start))->buffer != current_buffer) goto recenter; - SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start)); + SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start)); /* If someone specified a new starting point but did not insist, check whether it can be used. */ @@ -15582,11 +15582,11 @@ w->force_start = 0; w->vscroll = 0; - WVAR (w, window_end_valid) = Qnil; + WSET (w, window_end_valid, Qnil); /* Forget any recorded base line for line number display. */ if (!buffer_unchanged_p) - WVAR (w, base_line_number) = Qnil; + WSET (w, base_line_number, Qnil); /* Redisplay the mode line. Select the buffer properly for that. Also, run the hook window-scroll-functions @@ -15651,7 +15651,7 @@ MATRIX_ROW_START_BYTEPOS (row)); if (w != XWINDOW (selected_window)) - set_marker_both (WVAR (w, pointm), Qnil, PT, PT_BYTE); + set_marker_both (WGET (w, pointm), Qnil, PT, PT_BYTE); else if (current_buffer == old) SET_TEXT_POS (lpoint, PT, PT_BYTE); @@ -15753,7 +15753,7 @@ sets it. So, we need to check the return value of compute_window_start_on_continuation_line. (See also bug#197). */ - && XMARKER (WVAR (w, start))->buffer == current_buffer + && XMARKER (WGET (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 +15764,7 @@ && pos_visible_p (w, PT, &d1, &d2, &d3, &d4, &d5, &d6)) { w->force_start = 1; - SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start)); + SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start)); goto force_start; } @@ -15800,7 +15800,7 @@ || current_buffer->clip_changed || BEG_UNCHANGED < CHARPOS (startp)) /* Forget any recorded base line for line number display. */ - WVAR (w, base_line_number) = Qnil; + WSET (w, base_line_number, Qnil); if (!cursor_row_fully_visible_p (w, 1, 0)) { @@ -15871,7 +15871,7 @@ /* Forget any previously recorded base line for line number display. */ if (!buffer_unchanged_p) - WVAR (w, base_line_number) = Qnil; + WSET (w, base_line_number, Qnil); /* Determine the window start relative to point. */ init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID); @@ -15974,7 +15974,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 (WVAR (w, start), Qnil, IT_CHARPOS (it), IT_BYTEPOS (it)); + set_marker_both (WGET (w, start), Qnil, IT_CHARPOS (it), IT_BYTEPOS (it)); /* Run scroll hooks. */ startp = run_window_scroll_functions (window, it.current.pos); @@ -16005,8 +16005,8 @@ line.) */ if (w->cursor.vpos < 0) { - if (!NILP (WVAR (w, window_end_valid)) - && PT >= Z - XFASTINT (WVAR (w, window_end_pos))) + if (!NILP (WGET (w, window_end_valid)) + && PT >= Z - XFASTINT (WGET (w, window_end_pos))) { clear_glyph_matrix (w->desired_matrix); move_it_by_lines (&it, 1); @@ -16078,7 +16078,7 @@ done: - SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start)); + SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start)); w->start_at_line_beg = (CHARPOS (startp) == BEGV || FETCH_BYTE (BYTEPOS (startp) - 1) == '\n'); @@ -16092,10 +16092,10 @@ && !FRAME_WINDOW_P (f) && !WINDOW_FULL_WIDTH_P (w)) /* Line number to display. */ - || INTEGERP (WVAR (w, base_line_pos)) + || INTEGERP (WGET (w, base_line_pos)) /* Column number is displayed and different from the one displayed. */ - || (!NILP (WVAR (w, column_number_displayed)) - && (XFASTINT (WVAR (w, column_number_displayed)) != current_column ()))) + || (!NILP (WGET (w, column_number_displayed)) + && (XFASTINT (WGET (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,10 +16127,10 @@ } if (!line_number_displayed - && !BUFFERP (WVAR (w, base_line_pos))) + && !BUFFERP (WGET (w, base_line_pos))) { - WVAR (w, base_line_pos) = Qnil; - WVAR (w, base_line_number) = Qnil; + WSET (w, base_line_pos, Qnil); + WSET (w, base_line_number, Qnil); } finish_menu_bars: @@ -16243,10 +16243,10 @@ struct window *w = XWINDOW (window); struct it it; struct glyph_row *last_text_row = NULL; - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); /* Make POS the new window start. */ - set_marker_both (WVAR (w, start), Qnil, CHARPOS (pos), BYTEPOS (pos)); + set_marker_both (WGET (w, start), Qnil, CHARPOS (pos), BYTEPOS (pos)); /* Mark cursor position as unknown. No overlay arrow seen. */ w->cursor.vpos = -1; @@ -16295,7 +16295,7 @@ } /* If bottom moved off end of frame, change mode line percentage. */ - if (XFASTINT (WVAR (w, window_end_pos)) <= 0 + if (XFASTINT (WGET (w, window_end_pos)) <= 0 && Z != IT_CHARPOS (it)) w->update_mode_line = 1; @@ -16307,23 +16307,23 @@ eassert (MATRIX_ROW_DISPLAYS_TEXT_P (last_text_row)); w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); - WVAR (w, window_end_pos) - = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)); - WVAR (w, window_end_vpos) - = make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix)); + WSET (w, window_end_pos, + 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))); eassert (MATRIX_ROW (w->desired_matrix, - XFASTINT (WVAR (w, window_end_vpos)))->displays_text_p); + XFASTINT (WGET (w, window_end_vpos)))->displays_text_p); } else { w->window_end_bytepos = Z_BYTE - ZV_BYTE; - WVAR (w, window_end_pos) = make_number (Z - ZV); - WVAR (w, window_end_vpos) = make_number (0); + WSET (w, window_end_pos, make_number (Z - ZV)); + WSET (w, window_end_vpos, make_number (0)); } /* But that is not valid info until redisplay finishes. */ - WVAR (w, window_end_valid) = Qnil; + WSET (w, window_end_valid, Qnil); return 1; } @@ -16341,7 +16341,7 @@ static int try_window_reusing_current_matrix (struct window *w) { - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); struct glyph_row *bottom_row; struct it it; struct run run; @@ -16368,7 +16368,7 @@ /* Can't do this if region may have changed. */ if ((!NILP (Vtransient_mark_mode) && !NILP (BVAR (current_buffer, mark_active))) - || !NILP (WVAR (w, region_showing)) + || !NILP (WGET (w, region_showing)) || !NILP (Vshow_trailing_whitespace)) return 0; @@ -16385,7 +16385,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, WVAR (w, start)); + SET_TEXT_POS_FROM_MARKER (new_start, WGET (w, start)); start = start_row->minpos; start_vpos = MATRIX_ROW_VPOS (start_row, w->current_matrix); @@ -16547,29 +16547,28 @@ { w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_reused_text_row); - WVAR (w, window_end_pos) - = make_number (Z - MATRIX_ROW_END_CHARPOS (last_reused_text_row)); - WVAR (w, window_end_vpos) - = make_number (MATRIX_ROW_VPOS (last_reused_text_row, - w->current_matrix)); + WSET (w, window_end_pos, + 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))); } else if (last_text_row) { w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); - WVAR (w, window_end_pos) - = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)); - WVAR (w, window_end_vpos) - = make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix)); + WSET (w, window_end_pos, + 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))); } else { /* This window must be completely empty. */ w->window_end_bytepos = Z_BYTE - ZV_BYTE; - WVAR (w, window_end_pos) = make_number (Z - ZV); - WVAR (w, window_end_vpos) = make_number (0); + WSET (w, window_end_pos, make_number (Z - ZV)); + WSET (w, window_end_vpos, make_number (0)); } - WVAR (w, window_end_valid) = Qnil; + WSET (w, window_end_valid, Qnil); /* Update hint: don't try scrolling again in update_window. */ w->desired_matrix->no_scrolling_p = 1; @@ -16723,7 +16722,7 @@ /* Can't use this optimization with bidi-reordered glyph rows, unless cursor is already at point. */ - if (!NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering))) + if (!NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering))) { if (!(w->cursor.hpos >= 0 && w->cursor.hpos < row->used[TEXT_AREA] @@ -16750,18 +16749,18 @@ { w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); - WVAR (w, window_end_pos) - = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)); - WVAR (w, window_end_vpos) - = make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix)); + WSET (w, window_end_pos, + 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))); } else { - WVAR (w, window_end_vpos) - = make_number (XFASTINT (WVAR (w, window_end_vpos)) - nrows_scrolled); + WSET (w, window_end_vpos, + make_number (XFASTINT (WGET (w, window_end_vpos)) - nrows_scrolled)); } - WVAR (w, window_end_valid) = Qnil; + WSET (w, window_end_valid, Qnil); w->desired_matrix->no_scrolling_p = 1; #ifdef GLYPH_DEBUG @@ -16894,16 +16893,16 @@ /* Display must not have been paused, otherwise the current matrix is not up to date. */ - eassert (!NILP (WVAR (w, window_end_valid))); + eassert (!NILP (WGET (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 (WVAR (w, window_end_pos)) >= END_UNCHANGED) + if (XFASTINT (WGET (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 (WVAR (w, window_end_vpos))); + row = MATRIX_ROW (w->current_matrix, XFASTINT (WGET (w, window_end_vpos))); /* If matrix is entirely empty, no unchanged row exists. */ if (MATRIX_ROW_DISPLAYS_TEXT_P (row)) @@ -16914,7 +16913,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 (WVAR (w, window_end_pos)); + MATRIX_ROW_END_CHARPOS (row) + XFASTINT (WGET (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; @@ -16962,12 +16961,12 @@ static void sync_frame_with_window_matrix_rows (struct window *w) { - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (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 (WVAR (w, hchild)) && NILP (WVAR (w, vchild))); + eassert (NILP (WGET (w, hchild)) && NILP (WGET (w, vchild))); eassert (WINDOW_FULL_WIDTH_P (w)); eassert (!FRAME_WINDOW_P (f)); @@ -17009,7 +17008,7 @@ { struct glyph_row *row = start; struct glyph_row *best_row = NULL; - ptrdiff_t mindif = BUF_ZV (XBUFFER (WVAR (w, buffer))) + 1; + ptrdiff_t mindif = BUF_ZV (XBUFFER (WGET (w, buffer))) + 1; int last_y; /* If we happen to start on a header-line, skip that. */ @@ -17045,7 +17044,7 @@ { struct glyph *g; - if (NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering)) + if (NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering)) || (!best_row && !row->continued_p)) return row; /* In bidi-reordered rows, there could be several rows @@ -17114,7 +17113,7 @@ static int try_window_id (struct window *w) { - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (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; @@ -17148,7 +17147,7 @@ #define GIVE_UP(X) return 0 #endif - SET_TEXT_POS_FROM_MARKER (start, WVAR (w, start)); + SET_TEXT_POS_FROM_MARKER (start, WGET (w, start)); /* Don't use this for mini-windows because these can show messages and mini-buffers, and we don't handle that here. */ @@ -17186,7 +17185,7 @@ GIVE_UP (7); /* Verify that display wasn't paused. */ - if (NILP (WVAR (w, window_end_valid))) + if (NILP (WGET (w, window_end_valid))) GIVE_UP (8); /* Can't use this if highlighting a region because a cursor movement @@ -17200,7 +17199,7 @@ GIVE_UP (11); /* Likewise if showing a region. */ - if (!NILP (WVAR (w, region_showing))) + if (!NILP (WGET (w, region_showing))) GIVE_UP (10); /* Can't use this if overlay arrow position and/or string have @@ -17212,7 +17211,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 (WVAR (w, buffer)), word_wrap))) + if (!NILP (BVAR (XBUFFER (WGET (w, buffer)), word_wrap))) GIVE_UP (21); /* Under bidi reordering, adding or deleting a character in the @@ -17223,8 +17222,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 (WVAR (w, buffer)), bidi_display_reordering)) - && NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_paragraph_direction))) + if (!NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering)) + && NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_paragraph_direction))) GIVE_UP (22); /* Make sure beg_unchanged and end_unchanged are up to date. Do it @@ -17250,7 +17249,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 (WVAR (w, window_end_vpos))); + row = MATRIX_ROW (w->current_matrix, XFASTINT (WGET (w, window_end_vpos))); if (MATRIX_ROW_DISPLAYS_TEXT_P (row) && ((last_changed_charpos < CHARPOS (start) && CHARPOS (start) == BEGV) @@ -17262,7 +17261,7 @@ /* Compute how many chars/bytes have been added to or removed from the buffer. */ - Z_old = MATRIX_ROW_END_CHARPOS (row) + XFASTINT (WVAR (w, window_end_pos)); + Z_old = MATRIX_ROW_END_CHARPOS (row) + XFASTINT (WGET (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; @@ -17333,8 +17332,8 @@ { /* We have to compute the window end anew since text could have been added/removed after it. */ - WVAR (w, window_end_pos) - = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); + WSET (w, window_end_pos, + make_number (Z - MATRIX_ROW_END_CHARPOS (row))); w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); @@ -17369,7 +17368,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 (WVAR (w, window_end_vpos))); + row = MATRIX_ROW (current_matrix, XFASTINT (WGET (w, window_end_vpos))); if (MATRIX_ROW_START_CHARPOS (row) == MATRIX_ROW_END_CHARPOS (row)) GIVE_UP (20); @@ -17712,7 +17711,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 (WVAR (w, window_end_vpos)) + dvpos; + int last_vpos = XFASTINT (WGET (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. */ @@ -17768,21 +17767,21 @@ first_unchanged_at_end_row); eassert (row && MATRIX_ROW_DISPLAYS_TEXT_P (row)); - WVAR (w, window_end_pos) = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); + WSET (w, window_end_pos, make_number (Z - MATRIX_ROW_END_CHARPOS (row))); w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); - WVAR (w, window_end_vpos) - = make_number (MATRIX_ROW_VPOS (row, w->current_matrix)); + WSET (w, window_end_vpos, + 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) { - WVAR (w, window_end_pos) - = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row_at_end)); + WSET (w, window_end_pos, + 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); - WVAR (w, window_end_vpos) - = make_number (MATRIX_ROW_VPOS (last_text_row_at_end, desired_matrix)); + WSET (w, window_end_vpos, + 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,12 +17790,12 @@ /* We have displayed either to the end of the window or at the end of the window, i.e. the last row with text is to be found in the desired matrix. */ - WVAR (w, window_end_pos) - = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)); + WSET (w, window_end_pos, + make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row))); w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); - WVAR (w, window_end_vpos) - = make_number (MATRIX_ROW_VPOS (last_text_row, desired_matrix)); + WSET (w, window_end_vpos, + make_number (MATRIX_ROW_VPOS (last_text_row, desired_matrix))); eassert (w->window_end_bytepos >= 0); } else if (first_unchanged_at_end_row == NULL @@ -17806,7 +17805,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 (WVAR (w, window_end_vpos)); + int vpos = XFASTINT (WGET (w, window_end_vpos)); struct glyph_row *current_row = current_matrix->rows + vpos; struct glyph_row *desired_row = desired_matrix->rows + vpos; @@ -17824,8 +17823,8 @@ } eassert (row != NULL); - WVAR (w, window_end_vpos) = make_number (vpos + 1); - WVAR (w, window_end_pos) = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); + WSET (w, window_end_vpos, make_number (vpos + 1)); + WSET (w, window_end_pos, make_number (Z - MATRIX_ROW_END_CHARPOS (row))); w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); eassert (w->window_end_bytepos >= 0); IF_DEBUG (debug_method_add (w, "C")); @@ -17833,11 +17832,11 @@ else abort (); - IF_DEBUG (debug_end_pos = XFASTINT (WVAR (w, window_end_pos)); - debug_end_vpos = XFASTINT (WVAR (w, window_end_vpos))); + IF_DEBUG (debug_end_pos = XFASTINT (WGET (w, window_end_pos)); + debug_end_vpos = XFASTINT (WGET (w, window_end_vpos))); /* Record that display has not been completed. */ - WVAR (w, window_end_valid) = Qnil; + WSET (w, window_end_valid, Qnil); w->desired_matrix->no_scrolling_p = 1; return 3; @@ -18067,7 +18066,7 @@ (Lisp_Object glyphs) { struct window *w = XWINDOW (selected_window); - struct buffer *buffer = XBUFFER (WVAR (w, buffer)); + struct buffer *buffer = XBUFFER (WGET (w, buffer)); fprintf (stderr, "PT = %"pI"d, BEGV = %"pI"d. ZV = %"pI"d\n", BUF_PT (buffer), BUF_BEGV (buffer), BUF_ZV (buffer)); @@ -18173,7 +18172,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 (WVAR (w, buffer)); + struct buffer *buffer = XBUFFER (WGET (w, buffer)); struct buffer *old = current_buffer; const unsigned char *arrow_string = SDATA (overlay_arrow_string); int arrow_len = SCHARS (overlay_arrow_string); @@ -19250,7 +19249,7 @@ } /* Is IT->w showing the region? */ - WVAR (it->w, region_showing) = it->region_beg_charpos > 0 ? Qt : Qnil; + WSET (it->w, region_showing, it->region_beg_charpos > 0 ? Qt : Qnil); /* Clear the result glyph row and enable it. */ prepare_desired_row (row); @@ -19365,7 +19364,7 @@ row->glyphs[TEXT_AREA]->charpos = -1; row->displays_text_p = 0; - if (!NILP (BVAR (XBUFFER (WVAR (it->w, buffer)), indicate_empty_lines)) + if (!NILP (BVAR (XBUFFER (WGET (it->w, buffer)), indicate_empty_lines)) && (!MINI_WINDOW_P (it->w) || (minibuf_level && EQ (it->window, minibuf_window)))) row->indicate_empty_line_p = 1; @@ -20188,12 +20187,12 @@ { struct window *w = XWINDOW (window); - if (WINDOWP (WVAR (w, hchild))) - nwindows += redisplay_mode_lines (WVAR (w, hchild), force); - else if (WINDOWP (WVAR (w, vchild))) - nwindows += redisplay_mode_lines (WVAR (w, vchild), force); + 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); else if (force - || FRAME_GARBAGED_P (XFRAME (WVAR (w, frame))) + || FRAME_GARBAGED_P (XFRAME (WGET (w, frame))) || !MATRIX_MODE_LINE_ROW (w->current_matrix)->enabled_p) { struct text_pos lpoint; @@ -20201,7 +20200,7 @@ /* Set the window's buffer for the mode line display. */ SET_TEXT_POS (lpoint, PT, PT_BYTE); - set_buffer_internal_1 (XBUFFER (WVAR (w, buffer))); + set_buffer_internal_1 (XBUFFER (WGET (w, buffer))); /* Point refers normally to the selected window. For any other window, set up appropriate value. */ @@ -20209,7 +20208,7 @@ { struct text_pos pt; - SET_TEXT_POS_FROM_MARKER (pt, WVAR (w, pointm)); + SET_TEXT_POS_FROM_MARKER (pt, WGET (w, pointm)); if (CHARPOS (pt) < BEGV) TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); else if (CHARPOS (pt) > (ZV - 1)) @@ -20231,7 +20230,7 @@ TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint)); } - window = WVAR (w, next); + window = WGET (w, next); } return nwindows; @@ -20248,13 +20247,13 @@ int n = 0; old_selected_frame = selected_frame; - selected_frame = WVAR (w, frame); + selected_frame = WGET (w, frame); old_selected_window = selected_window; XSETWINDOW (selected_window, w); /* These will be set while the mode line specs are processed. */ line_number_displayed = 0; - WVAR (w, column_number_displayed) = Qnil; + WSET (w, column_number_displayed, Qnil); if (WINDOW_WANTS_MODELINE_P (w)) { @@ -20984,7 +20983,7 @@ w = XWINDOW (window); if (NILP (buffer)) - buffer = WVAR (w, buffer); + buffer = WGET (w, buffer); CHECK_BUFFER (buffer); /* Make formatting the modeline a non-op when noninteractive, otherwise @@ -21390,7 +21389,7 @@ else { ptrdiff_t col = current_column (); - WVAR (w, column_number_displayed) = make_number (col); + WSET (w, column_number_displayed, make_number (col)); pint2str (decode_mode_spec_buf, field_width, col); return decode_mode_spec_buf; } @@ -21443,33 +21442,33 @@ if (mode_line_target == MODE_LINE_TITLE) return ""; - startpos = XMARKER (WVAR (w, start))->charpos; - startpos_byte = marker_byte_position (WVAR (w, start)); + startpos = XMARKER (WGET (w, start))->charpos; + startpos_byte = marker_byte_position (WGET (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 (WVAR (w, base_line_pos), WVAR (w, buffer))) + if (EQ (WGET (w, base_line_pos), WGET (w, buffer))) goto no_value; /* But do forget it, if the window shows a different buffer now. */ - else if (BUFFERP (WVAR (w, base_line_pos))) - WVAR (w, base_line_pos) = Qnil; + else if (BUFFERP (WGET (w, base_line_pos))) + WSET (w, base_line_pos, Qnil); /* If the buffer is very big, don't waste time. */ if (INTEGERP (Vline_number_display_limit) && BUF_ZV (b) - BUF_BEGV (b) > XINT (Vline_number_display_limit)) { - WVAR (w, base_line_pos) = Qnil; - WVAR (w, base_line_number) = Qnil; + WSET (w, base_line_pos, Qnil); + WSET (w, base_line_number, Qnil); goto no_value; } - if (INTEGERP (WVAR (w, base_line_number)) - && INTEGERP (WVAR (w, base_line_pos)) - && XFASTINT (WVAR (w, base_line_pos)) <= startpos) + if (INTEGERP (WGET (w, base_line_number)) + && INTEGERP (WGET (w, base_line_pos)) + && XFASTINT (WGET (w, base_line_pos)) <= startpos) { - line = XFASTINT (WVAR (w, base_line_number)); - linepos = XFASTINT (WVAR (w, base_line_pos)); + line = XFASTINT (WGET (w, base_line_number)); + linepos = XFASTINT (WGET (w, base_line_pos)); linepos_byte = buf_charpos_to_bytepos (b, linepos); } else @@ -21492,8 +21491,8 @@ go back past it. */ if (startpos == BUF_BEGV (b)) { - WVAR (w, base_line_number) = make_number (topline); - WVAR (w, base_line_pos) = make_number (BUF_BEGV (b)); + WSET (w, base_line_number, make_number (topline)); + WSET (w, base_line_pos, make_number (BUF_BEGV (b))); } else if (nlines < height + 25 || nlines > height * 3 + 50 || linepos == BUF_BEGV (b)) @@ -21519,13 +21518,13 @@ give up on line numbers for this window. */ if (position == limit_byte && limit == startpos - distance) { - WVAR (w, base_line_pos) = WVAR (w, buffer); - WVAR (w, base_line_number) = Qnil; + WSET (w, base_line_pos, WGET (w, buffer)); + WSET (w, base_line_number, Qnil); goto no_value; } - WVAR (w, base_line_number) = make_number (topline - nlines); - WVAR (w, base_line_pos) = make_number (BYTE_TO_CHAR (position)); + WSET (w, base_line_number, make_number (topline - nlines)); + WSET (w, base_line_pos, make_number (BYTE_TO_CHAR (position))); } /* Now count lines from the start pos to point. */ @@ -21563,10 +21562,10 @@ case 'p': { - ptrdiff_t pos = marker_position (WVAR (w, start)); + ptrdiff_t pos = marker_position (WGET (w, start)); ptrdiff_t total = BUF_ZV (b) - BUF_BEGV (b); - if (XFASTINT (WVAR (w, window_end_pos)) <= BUF_Z (b) - BUF_ZV (b)) + if (XFASTINT (WGET (w, window_end_pos)) <= BUF_Z (b) - BUF_ZV (b)) { if (pos <= BUF_BEGV (b)) return "All"; @@ -21594,8 +21593,8 @@ /* Display percentage of size above the bottom of the screen. */ case 'P': { - ptrdiff_t toppos = marker_position (WVAR (w, start)); - ptrdiff_t botpos = BUF_Z (b) - XFASTINT (WVAR (w, window_end_pos)); + ptrdiff_t toppos = marker_position (WGET (w, start)); + ptrdiff_t botpos = BUF_Z (b) - XFASTINT (WGET (w, window_end_pos)); ptrdiff_t total = BUF_ZV (b) - BUF_BEGV (b); if (botpos >= BUF_ZV (b)) @@ -22302,7 +22301,7 @@ return OK_PIXELS (WINDOW_SCROLL_BAR_AREA_WIDTH (it->w)); } - prop = buffer_local_value_1 (prop, WVAR (it->w, buffer)); + prop = buffer_local_value_1 (prop, WGET (it->w, buffer)); if (EQ (prop, Qunbound)) prop = Qnil; } @@ -22354,7 +22353,7 @@ return OK_PIXELS (pixels); } - car = buffer_local_value_1 (car, WVAR (it->w, buffer)); + car = buffer_local_value_1 (car, WGET (it->w, buffer)); if (EQ (car, Qunbound)) car = Qnil; } @@ -22435,7 +22434,7 @@ { memset (s, 0, sizeof *s); s->w = w; - s->f = XFRAME (WVAR (w, frame)); + s->f = XFRAME (WGET (w, frame)); #ifdef HAVE_NTGUI s->hdc = hdc; #endif @@ -22767,7 +22766,7 @@ int voffset; int glyph_not_available_p; - eassert (s->f == XFRAME (WVAR (s->w, frame))); + eassert (s->f == XFRAME (WGET (s->w, frame))); eassert (s->nchars == 0); eassert (start >= 0 && end > start); @@ -24162,7 +24161,7 @@ int n = width; if (!STRINGP (object)) - object = WVAR (it->w, buffer); + object = WGET (it->w, buffer); #ifdef HAVE_WINDOW_SYSTEM if (FRAME_WINDOW_P (it->f)) append_stretch_glyph (it, object, width, height, ascent); @@ -25389,7 +25388,7 @@ int from_x, from_y, to_y; eassert (updated_window && updated_row); - f = XFRAME (WVAR (w, frame)); + f = XFRAME (WGET (w, frame)); if (updated_row->full_width_p) max_x = WINDOW_TOTAL_WIDTH (w); @@ -25547,8 +25546,8 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width, int *active_cursor) { - struct frame *f = XFRAME (WVAR (w, frame)); - struct buffer *b = XBUFFER (WVAR (w, buffer)); + struct frame *f = XFRAME (WGET (w, frame)); + struct buffer *b = XBUFFER (WGET (w, buffer)); int cursor_type = DEFAULT_CURSOR; Lisp_Object alt_cursor; int non_selected = 0; @@ -25859,7 +25858,7 @@ void erase_phys_cursor (struct window *w) { - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); int hpos = w->phys_cursor.hpos; int vpos = w->phys_cursor.vpos; @@ -25978,7 +25977,7 @@ display_and_set_cursor (struct window *w, int on, int hpos, int vpos, int x, int y) { - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); int new_cursor_type; int new_cursor_width; int active_cursor; @@ -26099,14 +26098,14 @@ { while (w) { - if (!NILP (WVAR (w, hchild))) - update_cursor_in_window_tree (XWINDOW (WVAR (w, hchild)), on_p); - else if (!NILP (WVAR (w, vchild))) - update_cursor_in_window_tree (XWINDOW (WVAR (w, vchild)), on_p); + 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); else update_window_cursor (w, on_p); - w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); + w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); } } @@ -26130,7 +26129,7 @@ void x_clear_cursor (struct window *w) { - if (FRAME_VISIBLE_P (XFRAME (WVAR (w, frame))) && w->phys_cursor_on_p) + if (FRAME_VISIBLE_P (XFRAME (WGET (w, frame))) && w->phys_cursor_on_p) update_window_cursor (w, 0); } @@ -26144,7 +26143,7 @@ enum draw_glyphs_face draw) { #ifdef HAVE_WINDOW_SYSTEM - if (FRAME_WINDOW_P (XFRAME (WVAR (w, frame)))) + if (FRAME_WINDOW_P (XFRAME (WGET (w, frame)))) { draw_glyphs (w, start_x, row, TEXT_AREA, start_hpos, end_hpos, draw, 0); return; @@ -26315,7 +26314,7 @@ static int coords_in_mouse_face_p (struct window *w, int hpos, int vpos) { - Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WVAR (w, frame))); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WGET (w, frame))); /* Quickly resolve the easy cases. */ if (!(WINDOWP (hlinfo->mouse_face_window) @@ -26567,7 +26566,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 (WVAR (w, window_end_vpos))); + r1 = MATRIX_ROW (w->current_matrix, XFASTINT (WGET (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)) @@ -26589,7 +26588,7 @@ } if (r2 == NULL) { - r2 = MATRIX_ROW (w->current_matrix, XFASTINT (WVAR (w, window_end_vpos))); + r2 = MATRIX_ROW (w->current_matrix, XFASTINT (WGET (w, window_end_vpos))); hlinfo->mouse_face_past_end = 1; } else if (!NILP (after_string)) @@ -26597,7 +26596,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 (WVAR (w, window_end_vpos))); + = MATRIX_ROW (w->current_matrix, XFASTINT (WGET (w, window_end_vpos))); for (next = r2 + 1; next <= last @@ -27262,7 +27261,7 @@ enum window_part area) { struct window *w = XWINDOW (window); - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); #ifdef HAVE_WINDOW_SYSTEM Display_Info *dpyinfo; @@ -27346,7 +27345,7 @@ { help_echo_string = help; XSETWINDOW (help_echo_window, w); - help_echo_object = WVAR (w, buffer); + help_echo_object = WGET (w, buffer); help_echo_pos = charpos; } } @@ -27382,7 +27381,7 @@ { Lisp_Object default_help = buffer_local_value_1 (Qmode_line_default_help_echo, - WVAR (w, buffer)); + WGET (w, buffer)); if (STRINGP (default_help)) { @@ -27663,9 +27662,9 @@ /* Are we in a window whose display is up to date? And verify the buffer's text has not changed. */ - b = XBUFFER (WVAR (w, buffer)); + b = XBUFFER (WGET (w, buffer)); if (part == ON_TEXT - && EQ (WVAR (w, window_end_valid), WVAR (w, buffer)) + && EQ (WGET (w, window_end_valid), WGET (w, buffer)) && w->last_modified == BUF_MODIFF (b) && w->last_overlay_modified == BUF_OVERLAY_MODIFF (b)) { @@ -27872,8 +27871,8 @@ if (pos > 0) { mouse_face = get_char_property_and_overlay - (make_number (pos), Qmouse_face, WVAR (w, buffer), &overlay); - buffer = WVAR (w, buffer); + (make_number (pos), Qmouse_face, WGET (w, buffer), &overlay); + buffer = WGET (w, buffer); disp_string = object; } } @@ -27899,12 +27898,12 @@ is the smallest. */ Lisp_Object lim1 = NILP (BVAR (XBUFFER (buffer), bidi_display_reordering)) - ? Fmarker_position (WVAR (w, start)) + ? Fmarker_position (WGET (w, start)) : Qnil; Lisp_Object lim2 = NILP (BVAR (XBUFFER (buffer), bidi_display_reordering)) ? make_number (BUF_Z (XBUFFER (buffer)) - - XFASTINT (WVAR (w, window_end_pos))) + - XFASTINT (WGET (w, window_end_pos))) : Qnil; if (NILP (overlay)) @@ -27986,11 +27985,11 @@ if (p > 0) { help = Fget_char_property (make_number (p), - Qhelp_echo, WVAR (w, buffer)); + Qhelp_echo, WGET (w, buffer)); if (!NILP (help)) { charpos = p; - obj = WVAR (w, buffer); + obj = WGET (w, buffer); } } } @@ -28041,7 +28040,7 @@ ptrdiff_t p = string_buffer_position (obj, start); if (p > 0) pointer = Fget_char_property (make_number (p), - Qpointer, WVAR (w, buffer)); + Qpointer, WGET (w, buffer)); } } else if (BUFFERP (obj) @@ -28079,7 +28078,7 @@ void x_clear_window_mouse_face (struct window *w) { - Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WVAR (w, frame))); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WGET (w, frame))); Lisp_Object window; BLOCK_INPUT; @@ -28101,7 +28100,7 @@ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); window = hlinfo->mouse_face_window; - if (! NILP (window) && XFRAME (WVAR (XWINDOW (window), frame)) == f) + if (! NILP (window) && XFRAME (WGET (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; @@ -28295,7 +28294,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 (WVAR (w, frame)))) + if (FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (WGET (w, frame)))) return; if (!WINDOW_RIGHTMOST_P (w) @@ -28335,7 +28334,7 @@ static int expose_window (struct window *w, XRectangle *fr) { - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); XRectangle wr, r; int mouse_face_overwritten_p = 0; @@ -28476,21 +28475,21 @@ static int expose_window_tree (struct window *w, XRectangle *r) { - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); int mouse_face_overwritten_p = 0; while (w && !FRAME_GARBAGED_P (f)) { - if (!NILP (WVAR (w, hchild))) - mouse_face_overwritten_p - |= expose_window_tree (XWINDOW (WVAR (w, hchild)), r); - else if (!NILP (WVAR (w, vchild))) - mouse_face_overwritten_p - |= expose_window_tree (XWINDOW (WVAR (w, vchild)), r); + 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); else mouse_face_overwritten_p |= expose_window (w, r); - w = NILP (WVAR (w, next)) ? NULL : XWINDOW (WVAR (w, next)); + w = NILP (WGET (w, next)) ? NULL : XWINDOW (WGET (w, next)); } return mouse_face_overwritten_p; @@ -29282,7 +29281,7 @@ if (!noninteractive) { struct window *m = XWINDOW (minibuf_window); - Lisp_Object frame = WVAR (m, frame); + Lisp_Object frame = WGET (m, frame); struct frame *f = XFRAME (frame); Lisp_Object root = FRAME_ROOT_WINDOW (f); struct window *r = XWINDOW (root); @@ -29290,12 +29289,12 @@ echo_area_window = minibuf_window; - XSETFASTINT (WVAR (r, top_line), FRAME_TOP_MARGIN (f)); - XSETFASTINT (WVAR (r, total_lines), FRAME_LINES (f) - 1 - FRAME_TOP_MARGIN (f)); - XSETFASTINT (WVAR (r, total_cols), FRAME_COLS (f)); - XSETFASTINT (WVAR (m, top_line), FRAME_LINES (f) - 1); - XSETFASTINT (WVAR (m, total_lines), 1); - XSETFASTINT (WVAR (m, total_cols), FRAME_COLS (f)); + WSET (r, top_line, make_number (FRAME_TOP_MARGIN (f))); + WSET (r, total_lines, make_number (FRAME_LINES (f) - 1 - FRAME_TOP_MARGIN (f))); + WSET (r, total_cols, make_number (FRAME_COLS (f))); + WSET (m, top_line, make_number (FRAME_LINES (f) - 1)); + WSET (m, total_lines, make_number (1)); + WSET (m, total_cols, make_number (FRAME_COLS (f))); scratch_glyph_row.glyphs[TEXT_AREA] = scratch_glyphs; scratch_glyph_row.glyphs[TEXT_AREA + 1] === modified file 'src/xfaces.c' --- src/xfaces.c 2012-08-06 05:27:54 +0000 +++ src/xfaces.c 2012-08-06 10:24:26 +0000 @@ -6033,7 +6033,7 @@ ptrdiff_t *endptr, ptrdiff_t limit, int mouse, int base_face_id) { - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); Lisp_Object attrs[LFACE_VECTOR_SIZE]; Lisp_Object prop, position; ptrdiff_t i, noverlays; @@ -6055,9 +6055,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, WVAR (w, buffer)); + prop = Fget_text_property (position, propname, WGET (w, buffer)); XSETFASTINT (limit1, (limit < endpos ? limit : endpos)); - end = Fnext_single_property_change (position, propname, WVAR (w, buffer), limit1); + end = Fnext_single_property_change (position, propname, WGET (w, buffer), limit1); if (INTEGERP (end)) endpos = XINT (end); @@ -6143,7 +6143,7 @@ ptrdiff_t *endptr, ptrdiff_t limit, int mouse, Lisp_Object overlay) { - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); Lisp_Object attrs[LFACE_VECTOR_SIZE]; Lisp_Object prop, position; ptrdiff_t endpos; @@ -6163,9 +6163,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, WVAR (w, buffer)); + prop = Fget_text_property (position, propname, WGET (w, buffer)); XSETFASTINT (limit1, (limit < endpos ? limit : endpos)); - end = Fnext_single_property_change (position, propname, WVAR (w, buffer), limit1); + end = Fnext_single_property_change (position, propname, WGET (w, buffer), limit1); if (INTEGERP (end)) endpos = XINT (end); === modified file 'src/xfns.c' --- src/xfns.c 2012-08-06 05:27:54 +0000 +++ src/xfns.c 2012-08-06 10:24:26 +0000 @@ -2260,7 +2260,7 @@ void xic_set_preeditarea (struct window *w, int x, int y) { - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); XVaNestedList attr; XPoint spot; @@ -5069,28 +5069,29 @@ /* Set up the frame's root window. */ w = XWINDOW (FRAME_ROOT_WINDOW (f)); - WVAR (w, left_col) = WVAR (w, top_line) = make_number (0); + WSET (w, left_col, make_number (0)); + WSET (w, top_line, make_number (0)); if (CONSP (Vx_max_tooltip_size) && RANGED_INTEGERP (1, XCAR (Vx_max_tooltip_size), INT_MAX) && RANGED_INTEGERP (1, XCDR (Vx_max_tooltip_size), INT_MAX)) { - WVAR (w, total_cols) = XCAR (Vx_max_tooltip_size); - WVAR (w, total_lines) = XCDR (Vx_max_tooltip_size); + WSET (w, total_cols, XCAR (Vx_max_tooltip_size)); + WSET (w, total_lines, XCDR (Vx_max_tooltip_size)); } else { - WVAR (w, total_cols) = make_number (80); - WVAR (w, total_lines) = make_number (40); + WSET (w, total_cols, make_number (80)); + WSET (w, total_lines, make_number (40)); } - FRAME_TOTAL_COLS (f) = XINT (WVAR (w, total_cols)); + FRAME_TOTAL_COLS (f) = XINT (WGET (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 (WVAR (XWINDOW (FRAME_ROOT_WINDOW (f)), buffer))); + set_buffer_internal_1 (XBUFFER (WGET (XWINDOW (FRAME_ROOT_WINDOW (f)), buffer))); BVAR (current_buffer, truncate_lines) = Qnil; clear_glyph_matrix (w->desired_matrix); clear_glyph_matrix (w->current_matrix); @@ -5151,7 +5152,7 @@ /* w->total_cols and FRAME_TOTAL_COLS want the width in columns, not in pixels. */ width /= WINDOW_FRAME_COLUMN_WIDTH (w); - WVAR (w, total_cols) = make_number (width); + WSET (w, total_cols, make_number (width)); FRAME_TOTAL_COLS (f) = width; adjust_glyphs (f); clear_glyph_matrix (w->desired_matrix); === modified file 'src/xmenu.c' --- src/xmenu.c 2012-08-06 05:27:54 +0000 +++ src/xmenu.c 2012-08-06 10:24:26 +0000 @@ -985,7 +985,7 @@ if (! menubar_widget) previous_menu_items_used = 0; - buffer = WVAR (XWINDOW (FRAME_SELECTED_WINDOW (f)), buffer); + buffer = WGET (XWINDOW (FRAME_SELECTED_WINDOW (f)), buffer); specbind (Qinhibit_quit, Qt); /* Don't let the debugger step into this code because it is not reentrant. */ @@ -2575,7 +2575,7 @@ /* Detect if a dialog or menu has been posted. MSDOS has its own implementation on msdos.c. */ -int +int ATTRIBUTE_CONST popup_activated (void) { return popup_activated_flag; === modified file 'src/xterm.c' --- src/xterm.c 2012-08-06 05:27:54 +0000 +++ src/xterm.c 2012-08-06 10:24:26 +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 (WVAR (w, frame))); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WGET (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 (WVAR (w, frame)), + && (f = XFRAME (WGET (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 (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (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 (WVAR (w, vertical_scroll_bar))->dragging)) + if (!NILP (XSCROLL_BAR (WGET (w, vertical_scroll_bar))->dragging)) { - XSCROLL_BAR (WVAR (w, vertical_scroll_bar))->dragging = Qnil; + XSCROLL_BAR (WGET (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 (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); ptrdiff_t i; BLOCK_INPUT; @@ -4353,7 +4353,7 @@ ievent->timestamp = CurrentTime; #else ievent->timestamp = - XtLastTimestampProcessed (FRAME_X_DISPLAY (XFRAME (WVAR (w, frame)))); + XtLastTimestampProcessed (FRAME_X_DISPLAY (XFRAME (WGET (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 (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); struct scroll_bar *bar = ALLOCATE_PSEUDOVECTOR (struct scroll_bar, x_window, PVEC_OTHER); Lisp_Object barobj; @@ -5182,7 +5182,7 @@ #endif /* Dissociate this scroll bar from its window. */ - WVAR (XWINDOW (bar->window), vertical_scroll_bar) = Qnil; + WSET (XWINDOW (bar->window), vertical_scroll_bar, Qnil); UNBLOCK_INPUT; } @@ -5196,7 +5196,8 @@ static void XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int position) { - struct frame *f = XFRAME (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); + Lisp_Object barobj; struct scroll_bar *bar; int top, height, left, sb_left, width, sb_width; int window_y, window_height; @@ -5247,7 +5248,7 @@ #endif /* Does the scroll bar exist yet? */ - if (NILP (WVAR (w, vertical_scroll_bar))) + if (NILP (WGET (w, vertical_scroll_bar))) { if (width > 0 && height > 0) { @@ -5270,7 +5271,7 @@ /* It may just need to be moved and resized. */ unsigned int mask = 0; - bar = XSCROLL_BAR (WVAR (w, vertical_scroll_bar)); + bar = XSCROLL_BAR (WGET (w, vertical_scroll_bar)); BLOCK_INPUT; @@ -5394,7 +5395,8 @@ } #endif /* not USE_TOOLKIT_SCROLL_BARS */ - XSETVECTOR (WVAR (w, vertical_scroll_bar), bar); + XSETVECTOR (barobj, bar); + WSET (w, vertical_scroll_bar, barobj); } @@ -5439,10 +5441,10 @@ Lisp_Object barobj; /* We can't redeem this window's scroll bar if it doesn't have one. */ - if (NILP (WVAR (window, vertical_scroll_bar))) + if (NILP (WGET (window, vertical_scroll_bar))) abort (); - bar = XSCROLL_BAR (WVAR (window, vertical_scroll_bar)); + bar = XSCROLL_BAR (WGET (window, vertical_scroll_bar)); /* Unlink it from the condemned list. */ f = XFRAME (WINDOW_FRAME (window)); @@ -5450,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), WVAR (window, vertical_scroll_bar))) + if (EQ (FRAME_SCROLL_BARS (f), WGET (window, vertical_scroll_bar))) /* It's not condemned. Everything's fine. */ return; else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), - WVAR (window, vertical_scroll_bar))) + WGET (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 @@ -5614,7 +5616,7 @@ static void x_scroll_bar_note_movement (struct scroll_bar *bar, XEvent *event) { - FRAME_PTR f = XFRAME (WVAR (XWINDOW (bar->window), frame)); + FRAME_PTR f = XFRAME (WGET (XWINDOW (bar->window), frame)); last_mouse_movement_time = event->xmotion.time; @@ -6788,8 +6790,8 @@ create event iff we don't leave the selected frame. */ && (focus_follows_mouse - || (EQ (WVAR (XWINDOW (window), frame), - WVAR (XWINDOW (selected_window), frame))))) + || (EQ (WGET (XWINDOW (window), frame), + WGET (XWINDOW (selected_window), frame))))) { inev.ie.kind = SELECT_WINDOW_EVENT; inev.ie.frame_or_window = window; @@ -7338,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 (WVAR (w, frame)); + struct frame *f = XFRAME (WGET (w, frame)); struct glyph *cursor_glyph; /* If cursor is out of bounds, don't draw garbage. This can happen ------------------------------------------------------------ revno: 109464 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2012-08-06 13:28:17 +0400 message: Fix Windows build errors introduced after converting to FGET and FSET. * w32term.c (x_frame_rehighlight, x_scroll_bar_create): (w32_condemn_scroll_bars, w32_redeem_scroll_bar): (w32_judge_scroll_bars): Change to use FSET. Reported by Andy Moreton . diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-06 08:32:49 +0000 +++ src/ChangeLog 2012-08-06 09:28:17 +0000 @@ -1,5 +1,13 @@ 2012-08-06 Dmitry Antipov + Fix Windows build errors introduced after converting to FGET and FSET. + * w32term.c (x_frame_rehighlight, x_scroll_bar_create): + (w32_condemn_scroll_bars, w32_redeem_scroll_bar): + (w32_judge_scroll_bars): Change to use FSET. + Reported by Andy Moreton . + +2012-08-06 Dmitry Antipov + Fix replacement typo. * window.c (replace_window): Set root_window instead of selected_window. This fixes a total window subsystem === modified file 'src/w32term.c' --- src/w32term.c 2012-08-06 05:27:54 +0000 +++ src/w32term.c 2012-08-06 09:28:17 +0000 @@ -2972,7 +2972,7 @@ : dpyinfo->w32_focus_frame); if (! FRAME_LIVE_P (dpyinfo->x_highlight_frame)) { - FRAME_FOCUS_FRAME (dpyinfo->w32_focus_frame) = Qnil; + FSET (dpyinfo->w32_focus_frame, focus_frame, Qnil); dpyinfo->x_highlight_frame = dpyinfo->w32_focus_frame; } } @@ -3612,6 +3612,7 @@ SCROLLINFO si; struct scroll_bar *bar = XSCROLL_BAR (Fmake_vector (make_number (SCROLL_BAR_VEC_SIZE), Qnil)); + Lisp_Object barobj; BLOCK_INPUT; @@ -3644,7 +3645,8 @@ /* Add bar to its frame's list of scroll bars. */ bar->next = FRAME_SCROLL_BARS (f); bar->prev = Qnil; - XSETVECTOR (FRAME_SCROLL_BARS (f), bar); + XSETVECTOR (barobj, bar); + FSET (f, scroll_bars, barobj); if (! NILP (bar->next)) XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar); @@ -3829,12 +3831,12 @@ { Lisp_Object bar; bar = FRAME_SCROLL_BARS (frame); - FRAME_SCROLL_BARS (frame) = XSCROLL_BAR (bar)->next; + FSET (frame, scroll_bars, XSCROLL_BAR (bar)->next); XSCROLL_BAR (bar)->next = FRAME_CONDEMNED_SCROLL_BARS (frame); XSCROLL_BAR (bar)->prev = Qnil; if (! NILP (FRAME_CONDEMNED_SCROLL_BARS (frame))) XSCROLL_BAR (FRAME_CONDEMNED_SCROLL_BARS (frame))->prev = bar; - FRAME_CONDEMNED_SCROLL_BARS (frame) = bar; + FSET (frame, condemned_scroll_bars, bar); } } @@ -3846,6 +3848,7 @@ w32_redeem_scroll_bar (struct window *window) { struct scroll_bar *bar; + Lisp_Object barobj; struct frame *f; /* We can't redeem this window's scroll bar if it doesn't have one. */ @@ -3865,7 +3868,7 @@ return; else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), WVAR (window, vertical_scroll_bar))) - FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next; + FSET (f, condemned_scroll_bars, bar->next); else /* If its prev pointer is nil, it must be at the front of one or the other! */ @@ -3879,7 +3882,8 @@ bar->next = FRAME_SCROLL_BARS (f); bar->prev = Qnil; - XSETVECTOR (FRAME_SCROLL_BARS (f), bar); + XSETVECTOR (barobj, bar); + FSET (f, scroll_bars, barobj); if (! NILP (bar->next)) XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar); } @@ -3896,7 +3900,7 @@ /* Clear out the condemned list now so we won't try to process any more events on the hapless scroll bars. */ - FRAME_CONDEMNED_SCROLL_BARS (f) = Qnil; + FSET (f, condemned_scroll_bars, Qnil); for (; ! NILP (bar); bar = next) { ------------------------------------------------------------ revno: 109463 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2012-08-06 12:32:49 +0400 message: Fix replacement typo. * window.c (replace_window): Set root_window instead of selected_window. This fixes a total window subsystem malfunction reported by Bastien Guerry . diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-06 07:37:26 +0000 +++ src/ChangeLog 2012-08-06 08:32:49 +0000 @@ -1,3 +1,10 @@ +2012-08-06 Dmitry Antipov + + Fix replacement typo. + * window.c (replace_window): Set root_window instead of + selected_window. This fixes a total window subsystem + malfunction reported by Bastien Guerry . + 2012-08-06 Glenn Morris * lisp.mk (lisp): Add language/persian.elc. === modified file 'src/window.c' --- src/window.c 2012-08-06 05:27:54 +0000 +++ src/window.c 2012-08-06 08:32:49 +0000 @@ -1841,7 +1841,7 @@ /* 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 (WVAR (o, frame))))) - FSET (XFRAME (WVAR (o, frame)), selected_window, new); + FSET (XFRAME (WVAR (o, frame)), root_window, new); if (setflag) { ------------------------------------------------------------ revno: 109462 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-06 00:37:26 -0700 message: * src/lisp.mk (lisp): Add language/persian.elc. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-06 05:27:54 +0000 +++ src/ChangeLog 2012-08-06 07:37:26 +0000 @@ -1,3 +1,7 @@ +2012-08-06 Glenn Morris + + * lisp.mk (lisp): Add language/persian.elc. + 2012-08-06 Dmitry Antipov Separate read and write access to Lisp_Object slots of struct frame. === modified file 'src/lisp.mk' --- src/lisp.mk 2012-06-27 07:47:56 +0000 +++ src/lisp.mk 2012-08-06 07:37:26 +0000 @@ -95,6 +95,7 @@ $(lispsource)/language/japanese.elc \ $(lispsource)/language/korean.elc \ $(lispsource)/language/lao.elc \ + $(lispsource)/language/persian.elc \ $(lispsource)/language/tai-viet.elc \ $(lispsource)/language/thai.elc \ $(lispsource)/language/tibetan.elc \ ------------------------------------------------------------ revno: 109461 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-06 00:36:35 -0700 message: Add NEWS for language/persian.el. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-08-06 05:33:39 +0000 +++ etc/NEWS 2012-08-06 07:36:35 +0000 @@ -110,6 +110,10 @@ *** Images displayed via ImageMagick now support transparency and the :background image spec property. +** Internationalization changes + +*** Added language support for Persian. + ** Face underlining can now use a wave. See the "Face Attributes" section of the Elisp manual. ------------------------------------------------------------ revno: 109460 fixes bug: http://debbugs.gnu.org/11812 author: Mohsen BANAN committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-06 00:34:35 -0700 message: * leim/quail/persian.el: Add some mappings. (farsi-isiri-9147, farsi-transliterate-banan): Doc fixes. diff: === modified file 'leim/ChangeLog' --- leim/ChangeLog 2012-07-30 16:20:35 +0000 +++ leim/ChangeLog 2012-08-06 07:34:35 +0000 @@ -1,3 +1,8 @@ +2012-08-06 Mohsen BANAN + + * quail/persian.el: Add some mappings. (Bug#11812) + (farsi-isiri-9147, farsi-transliterate-banan): Doc fixes. + 2012-07-30 Paul Eggert Update .PHONY listings in makefiles. === modified file 'leim/quail/persian.el' --- leim/quail/persian.el 2012-03-12 22:35:55 +0000 +++ leim/quail/persian.el 2012-08-06 07:34:35 +0000 @@ -1,9 +1,9 @@ ;;; persian.el --- Quail package for inputting Persian/Farsi keyboard -*- coding: utf-8;-*- -;; Copyright (C) 2011-2012 Free Software Foundation, Inc. +;; Copyright (C) 2011-2012 Free Software Foundation, Inc. -;; Author: Mohsen BANAN -;; http://mohsen.1.banan.byname.net/contact +;; Author: Mohsen BANAN +;; X-URL: http://mohsen.1.banan.byname.net/contact ;; Keywords: multilingual, input method, Farsi, Persian, keyboard @@ -31,7 +31,7 @@ ;; ;; At this time, the following input methods are specified: ;; -;; - (farsi-isiri-9149) Persian Keyboard based on Islamic Republic of Iran's ISIR-9147 +;; - (farsi-isiri-9149) Persian Keyboard based on Islamic Republic of Iran's ISIRI-9147 ;; - (farsi-transliterate-banan) An intuitive transliteration keyboard for Farsi ;; ;; Additional documentation for these input methods can be found at: @@ -50,18 +50,26 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; The keyboard mapping defined here is based on: +;; فنّاوریِ اطلاعات - چیدمان حروف و علائم فارسی بر صفحه کلید رایانه +;; استاندارد ملی ایران ۹۱۴۷ − چاپ اول ;; ;; Institute of Standards and Industrial Research of Iran ;; Information Technology – Layout of Persian Letters and Symbols ;; on Computer Keyboards ;; ISIRI 9147 -- 1st edition -;; http://www.isiri.org/UserStd/DownloadStd.aspx?id=9147 -;; -;; The specification is also republished at -;; http://www.farsiweb.ir/wiki/Image:Isiri-9147.pdf -;; and various other sites. -;; -;; ISIRI-6219 is also relevant. +;; Published at: http://www.isiri.org/portal/files/std/9147.pdf +;; Re-Published at: http://www.persoarabic.org/Repub/fpf-isiri-9147 +;; +;; +;; Specification of Iran's Persian Character Set is also relevant: +;; فنّاوریِ اطلاعات -- تبادل و شیوه‌ی نمایش اطلاعاتِ فارسی بر اساس یونی کُد +;; استاندارد ملی ایران ۶۲۱۹ −− نسخهی نهایی +;; +;; Institute of Standards and Industrial Research of Iran +;; Information Technology – Persian Information Interchange and Display Mechanism, using Unicode +;; ISIRI-6219 Final Version +;; Published at: http://www.isiri.org/portal/files/std/6219.htm +;; Re-Published at: http://www.persoarabic.org/Repub/fpf-isiri-6219 ;; ;; Layers 1, 2 and 3 of ISIRI-9147 are fully implemented with the ;; exception of the Backslash, Alt-Backslash, Shift-Space and @@ -92,10 +100,10 @@ (quail-define-package - "farsi-isiri-9147" "Farsi" " ف" nil "Farsi input method. - -Based on ISIRI-9147 Layout of Persian Letters and Symbols on Computer Keyboards. -" nil t t t t nil nil nil nil nil t) + "farsi-isiri-9147" "Persian" " ف" nil + "Farsi keyboard based on ISIRI-9147. + See http://www.persoarabic.org/PLPC/120036 for additional documentation." + nil t t t t nil nil nil nil nil t) ;; Note: the rows of keys below are enclosed in Left-To-Right Override ;; embedding, to prevent them from being reordered by the Emacs @@ -305,11 +313,11 @@ ;; ;; For some persian characters there are multiple ways of inputting ;; the same character. For example both ``i'' and ``y'' produce ی. -;; For یک ``yk'', ``y'' is more natural and for این ``ain'', ``i'' is more natural. +;; For یک ``yk'', ``y'' is more natural and for این ``ain'', ``i'' is more natural. ;; ;; The more frequently used keys are mapped to lower case. The less frequently used letter moves to -;; upper case. For example: ``s'' is س and ``S'' is ص. ``h'' is ح and ``H'' -;; is ه. +;; upper case. For example: ``s'' is س and ``S'' is ص. ``h'' is ه and ``H'' +;; is ح. ;; ;; Multi-character input is based on \, &, and / prefix ;; characters. The letter 'h' is used as a postfix for the following two character mappings: @@ -317,29 +325,30 @@ ;; ;; ;; Prefix letter \ is used for two character inputs when an alternate form of a letter -;; is desired for example \% is: ‌÷ when % is: ٪. +;; is desired for example '\-' is: '÷' when '-' is: '-'. ;; ;; Prefix letter & is used for multi-character inputs when special characters are ;; desired based on their abbreviate name. For example you can enter ‎ to enter the ;; ``LEFT-TO-RIGHT MARK'' character. ;; -;; Prefix letter / is used to provide two characters. / is: ``ZERO WIDTH NON-JOINER'' +;; Prefix letter / is used to provide two characters. / is: ``ZERO WIDTH NON-JOINER'' ;; and // is /. ;; ;; The letter 'h' is used in a number of two character postfix mappings, ;; for example ``sh'' ش. So if you need the sequence of ``s'' and ``h'' you -;; need to repeat the ``s''. For example: سحر = 's' 's' 'h' 'r'. +;; need to repeat the ``s''. For example: سهم = 's' 's' 'h' 'm'. ;; (quail-define-package - "farsi-transliterate-banan" "Farsi" "ب" t + "farsi-transliterate-banan" "Persian" "ب" t "Intuitive transliteration keyboard layout for persian/farsi. -" nil t t t t nil nil nil nil nil t) + See http://www.persoarabic.org/PLPC/120036 for additional documentation." + nil t t t t nil nil nil nil nil t) (quail-define-rules -;;;;;;;;;;; isiri-6219 Table 5 -- جدول ۵ - حروِفِ اصلیِ فارسی +;;;;;;;;;;; isiri-6219 Table 5 -- جدول ۵ - حروِفِ اصلیِ فارسی ("W" ?ء) ;; hamzeh ("A" ?آ) ;; U+0622 & ARABIC LETTER ALEF WITH MADDA ABOVE & الف با کلاه ("a" ?ا) ;; U+0627 & ARABIC LETTER ALEF & الف @@ -352,7 +361,8 @@ ("cc" ?ث) ("j" ?ج) ("ch" ?چ) - ("h" ?ح) + ("H" ?ح) + ("hh" ?ح) ("kh" ?خ) ("d" ?د) ("Z" ?ذ) @@ -370,6 +380,9 @@ ("X" ?ظ) ("w" ?ع) ("q" ?غ) + ("G" ?غ) + ("Gh" ?غ) + ("GG" ?غ) ("f" ?ف) ("Q" ?ق) ("gh" ?ق) @@ -383,13 +396,13 @@ ("v" ?و) ("u" ?و) ("V" ?ؤ) - ("H" ?ه) + ("h" ?ه) ("y" ?ی) ("i" ?ی) ("I" ?ئ) -;;;;;;;;;;; isiri-6219 Table 6 -- جدول ۶ - حروِفِ عربی +;;;;;;;;;;; isiri-6219 Table 6 -- جدول ۶ - حروِفِ عربی ("F" ?إ) ("D" ?\u0671) ;; (ucs-insert #x0671)ٱ named: حرفِ الفِ وصل ("K" ?ك) ;; Arabic kaf @@ -416,8 +429,8 @@ ("+" ?\u002B) ;; (ucs-insert #x002B)+ named: علامتِ به‌اضافه ("-" ?\u2212) ;; (ucs-insert #x2212)− named: علامتِ منها ("\\*" ?\u00D7) ;; (ucs-insert #x00D7)× named: علامتِ ضرب - ("\\%" ?\u007F) ;; (ucs-insert #x00F7)÷ named: علامتِ تقسیم - ("<" ?\u003C) ;; (ucs-insert #x003C)< named: علامتِ کوچکتر + ("\\-" ?\u00F7) ;; (ucs-insert #x00F7)÷ named: علامتِ تقسیم + ("<" ?\u003C) ;; (ucs-insert #x003C)< named: علامتِ کوچکتر ("=" ?\u003D) ;; (ucs-insert #x003D)= named: علامتِ مساوی (">" ?\u003E) ;; (ucs-insert #x003E)> named: علامتِ بزرگتر @@ -425,24 +438,25 @@ ;;;;;;;;;;; isiri-6219 Table 2 -- جدول ۲ - علائم نقطه گذاریِ مشترک ;;; Space ("." ?.) ;; - (":" ?\u003A) ;; (ucs-insert #x003A): named: - ("!" ?\u0021) ;; (ucs-insert #x0021)! named: - ("\\." ?\u2026) ;; (ucs-insert #x2026)… named: - ("\\-" ?\u2010) ;; (ucs-insert #x2010)‐ named: - ("-" ?\u002D) ;; (ucs-insert #x002D)- named: + (":" ?\u003A) ;; (ucs-insert #x003A): named: + ("!" ?\u0021) ;; (ucs-insert #x0021)! named: + ("\\." ?\u2026) ;; (ucs-insert #x2026)… named: + ("\\-" ?\u2010) ;; (ucs-insert #x2010)‐ named: + ("-" ?\u002D) ;; (ucs-insert #x002D)- named: ("|" ?|) ;;("\\\\" ?\) ("//" ?/) - ("*" ?\u002A) ;; (ucs-insert #x002A)* named: - ("(" ?\u0028) ;; (ucs-insert #x0028)( named: - (")" ?\u0029) ;; (ucs-insert #x0029)) named: - ("[" ?\u005B) ;; (ucs-insert #x005B)[ named: - ("[" ?\u005D) ;; (ucs-insert #x005D)] named: - ("{" ?\u007B) ;; (ucs-insert #x007B){ named: - ("}" ?\u007D) ;; (ucs-insert #x007D)} named: - ("\\<" ?\u00AB) ;; (ucs-insert #x00AB)« named: - ("\\>" ?\u00BB) ;; (ucs-insert #x00BB)» named: - + ("*" ?\u002A) ;; (ucs-insert #x002A)* named: + ("(" ?\u0028) ;; (ucs-insert #x0028)( named: + (")" ?\u0029) ;; (ucs-insert #x0029)) named: + ("[" ?\u005B) ;; (ucs-insert #x005B)[ named: + ("[" ?\u005D) ;; (ucs-insert #x005D)] named: + ("{" ?\u007B) ;; (ucs-insert #x007B){ named: + ("}" ?\u007D) ;; (ucs-insert #x007D)} named: + ("\\<" ?\u00AB) ;; (ucs-insert #x00AB)« named: + ("\\>" ?\u00BB) ;; (ucs-insert #x00BB)» named: + ("N" ?\u00AB) ;; (ucs-insert #x00AB)« named: + ("M" ?\u00BB) ;; (ucs-insert #x00BB)» named: ;;;;;;;;;;; isiri-6219 Table 3 -- جدول ۳ - علائم نقطه گذاریِ فارسی ("," ?،) ;; farsi @@ -455,9 +469,9 @@ ;; LF ;; CR ("‌" ?\u200C) ;; (ucs-insert #x200C)‌ named: فاصله‌ی مجازی - ("/" ?\u200C) ;; + ("/" ?\u200C) ;; ("‍" ?\u200D) ;; (ucs-insert #x200D)‍ named: اتصالِ مجازی - ("J" ?\u200D) ;; + ("J" ?\u200D) ;; ("‎" ?\u200E) ;; (ucs-insert #x200E)‎ named: نشانه‌ی چپ‌به‌راست ("‏" ?\u200F) ;; (ucs-insert #x200F)‏ named: نشانه‌ی راست‌به‌چپ ("&ls;" ?\u2028) ;; (ucs-insert #x2028)
 named: جداکننده‌ی سطرها @@ -468,7 +482,7 @@ ("&lro;" ?\u202D) ;; (ucs-insert #x202D) named: زیرمتنِ اکیداً چپ‌به‌راست ("&rlo;" ?\u202D) ;; (ucs-insert #x202E) named: زیرمتنِ اکیداً راست‌به‌چپ ("&bom;" ?\uFEFF) ;; (ucs-insert #xFEFF) named: نشانه‌ی ترتیبِ بایت‌ها - + ;;;;;;;;;;; isiri-6219 Table 7 -- جدول ۷ - نشانه‌هایِ فارسی ("^" ?َ) ;; zbar ;; زبر فارسى @@ -481,12 +495,12 @@ ("@" ?ْ) ;; ساکن فارسى ("U" ?\u0653) ;; (ucs-insert #x0653)ٓ named: مدِ فارسی ("`" ?ٔ) ;; همزه فارسى بالا - ("C" ?\u0655) ;; (ucs-insert #x0655)ٕ named: همزه فارسى پایین + ("C" ?\u0655) ;; (ucs-insert #x0655)ٕ named: همزه فارسى پایین ("$" ?\u0670) ;; (ucs-insert #x0670)ٰ named: الفِ مقصوره‌ی فارسی ;;;;;;;;;;; isiri-6219 Table 8 - Forbidden Characters -- جدول ۸ - نویسه‌هایِ ممنوع -;; ;; he ye (ucs-insert 1728) kills emacs-24.0.90 +;; ;; he ye (ucs-insert 1728) (ucs-insert #x06c0) kills emacs-24.0.90 ;; arabic digits 0-9 @@ -496,7 +510,7 @@ ("\\~" ?~) ("\\@" ?@) ("\\#" ?#) - ("\\$" ?\uFDFC) ;; (ucs-insert #xFDFC)﷼ named: + ("\\$" ?\uFDFC) ;; (ucs-insert #xFDFC)﷼ named: ("\\^" ?^) ("\\1" ?1) ("\\2" ?2) ------------------------------------------------------------ revno: 109459 fixes bug: http://debbugs.gnu.org/11812 author: Mohsen BANAN committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-06 00:31:31 -0700 message: * lisp/language/persian.el: New file. * lisp/loadup.el: Add language/persian.el. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-06 07:10:27 +0000 +++ lisp/ChangeLog 2012-08-06 07:31:31 +0000 @@ -1,3 +1,8 @@ +2012-08-06 Mohsen BANAN + + * language/persian.el: New file. (Bug#11812) + * loadup.el: Add language/persian.el. + 2012-08-06 Chong Yidong * window.el (window--maybe-raise-frame): New function. === added file 'lisp/language/persian.el' --- lisp/language/persian.el 1970-01-01 00:00:00 +0000 +++ lisp/language/persian.el 2012-08-06 07:31:31 +0000 @@ -0,0 +1,62 @@ +;;; persian.el --- support for Persian -*- coding: utf-8;-*- + +;; Copyright (C) 2012 Free Software Foundation, Inc. + +;; Author: Mohsen BANAN +;; X-URL: http://mohsen.1.banan.byname.net/contact + +;; Keywords: multilingual, Farsi, Persian + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; For Persian, the character set ISO8859-6 is supported. (Same as Arabic) + +;;; Code: + +(define-coding-system 'iso-8859-6 + "ISO-8859-6 based encoding (MIME:ISO-8859-6)." + :coding-type 'charset + :mnemonic ?6 + :charset-list '(iso-8859-6) + :mime-charset 'iso-8859-6) + +(define-coding-system 'windows-1256 + "windows-1256 (Arabic) encoding (MIME: WINDOWS-1256)" + :coding-type 'charset + :mnemonic ?A + :charset-list '(windows-1256) + :mime-charset 'windows-1256) + +(define-coding-system-alias 'cp1256 'windows-1256) + +(set-language-info-alist + "Persian" '((charset unicode) + (coding-system utf-8 iso-8859-6 windows-1256) + (coding-priority utf-8 iso-8859-6 windows-1256) + (input-method . "farsi-transliterate-banan") + (sample-text . "Persian فارسی") + (documentation . "Bidirectional editing is supported."))) + +(set-char-table-range + composition-function-table + '(#x600 . #x6FF) + (list ["[\u0600-\u06FF]+" 0 font-shape-gstring])) + +(provide 'persian) + +;;; persian.el ends here === modified file 'lisp/loadup.el' --- lisp/loadup.el 2012-07-13 16:50:21 +0000 +++ lisp/loadup.el 2012-08-06 07:31:31 +0000 @@ -159,6 +159,7 @@ (load "language/japanese") (load "language/korean") (load "language/lao") +(load "language/persian") (load "language/tai-viet") (load "language/thai") (load "language/tibetan") ------------------------------------------------------------ revno: 109458 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-08-06 00:10:27 -0700 message: * lisp/eshell/esh-ext.el (eshell/addpath): Use mapconcat. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-06 05:33:39 +0000 +++ lisp/ChangeLog 2012-08-06 07:10:27 +0000 @@ -21,7 +21,7 @@ 2012-08-06 Glenn Morris - * eshell/esh-ext.el (eshell/addpath): Use dolist. + * eshell/esh-ext.el (eshell/addpath): Use dolist and mapconcat. Do less getting and setting of environment variables. 2012-08-05 Chong Yidong === modified file 'lisp/eshell/esh-ext.el' --- lisp/eshell/esh-ext.el 2012-08-06 01:23:37 +0000 +++ lisp/eshell/esh-ext.el 2012-08-06 07:10:27 +0000 @@ -226,12 +226,12 @@ Adds the given PATH to $PATH.") (if args (progn - (setq eshell-path-env (getenv "PATH")) - (dolist (dir (if prepend (nreverse args) args)) - (setq eshell-path-env - (if prepend - (concat dir path-separator eshell-path-env) - (concat eshell-path-env path-separator dir)))) + (setq eshell-path-env (getenv "PATH") + args (mapconcat 'identity args path-separator) + eshell-path-env + (if prepend + (concat args path-separator eshell-path-env) + (concat eshell-path-env path-separator args))) (setenv "PATH" eshell-path-env)) (dolist (dir (parse-colon-path (getenv "PATH"))) (eshell-printn dir))))) ------------------------------------------------------------ revno: 109457 fixes bug: http://debbugs.gnu.org/12139 committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-08-06 13:33:39 +0800 message: Add inhibit-switch-frame parameter for display-buffer, and use it in occur-edit. * replace.el (occur-after-change-function): Avoid losing focus by using the inhibit-switch-frame display action option. * window.el (window--maybe-raise-frame): New function. (window--display-buffer): Split off from here. (display-buffer-reuse-window, display-buffer-pop-up-frame) (display-buffer-pop-up-window, display-buffer-use-some-window): Obey an inhibit-switch-frame action alist entry. (display-buffer): Update doc. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-08-05 13:30:15 +0000 +++ etc/NEWS 2012-08-06 05:33:39 +0000 @@ -565,9 +565,14 @@ ** New error type and new function `user-error'. Doesn't trigger the debugger. -** The functions get-lru-window, get-mru-window and get-largest-window +** Window changes + +*** The functions get-lru-window, get-mru-window and get-largest-window now accept a third argument to avoid choosing the selected window. +*** New display action alist `inhibit-switch-frame', if non-nil, tells +display action functions to avoid changing which frame is selected. + ** Completion *** New function `completion-table-with-quoting' to handle completion === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-06 03:27:43 +0000 +++ lisp/ChangeLog 2012-08-06 05:33:39 +0000 @@ -1,3 +1,15 @@ +2012-08-06 Chong Yidong + + * window.el (window--maybe-raise-frame): New function. + (window--display-buffer): Split off from here. + (display-buffer-reuse-window, display-buffer-pop-up-frame) + (display-buffer-pop-up-window, display-buffer-use-some-window): + Obey an inhibit-switch-frame action alist entry. + (display-buffer): Update doc. + + * replace.el (occur-after-change-function): Avoid losing focus by + using the inhibit-switch-frame display parameter (Bug#12139). + 2012-08-06 Fabián Ezequiel Gallina Make internal shell process buffer names start with space. === modified file 'lisp/replace.el' --- lisp/replace.el 2012-08-02 16:54:42 +0000 +++ lisp/replace.el 2012-08-06 05:33:39 +0000 @@ -912,7 +912,9 @@ (line-number-at-pos (window-start)))) (readonly (with-current-buffer buf buffer-read-only)) (win (or (get-buffer-window buf) - (display-buffer buf t))) + (display-buffer buf + '(nil (inhibit-same-window . t) + (inhibit-switch-frame . t))))) (line-end (line-end-position)) (text (save-excursion (goto-char (next-single-property-change === modified file 'lisp/window.el' --- lisp/window.el 2012-07-31 08:36:32 +0000 +++ lisp/window.el 2012-08-06 05:33:39 +0000 @@ -4602,27 +4602,26 @@ `window-dedicated-p' to DEDICATED if non-nil. Return WINDOW if BUFFER and WINDOW are live." (when (and (buffer-live-p buffer) (window-live-p window)) - (let* ((frame (window-frame window)) - (visible (frame-visible-p frame))) - (unless (eq buffer (window-buffer window)) - (set-window-dedicated-p window nil) - (display-buffer-record-window type window buffer) - (set-window-buffer window buffer) - (when dedicated - (set-window-dedicated-p window dedicated)) - (when (memq type '(window frame)) - (set-window-prev-buffers window nil))) - - (unless (or (not visible) - ;; Assume the selected frame is already visible enough. - (eq frame (selected-frame)) - ;; Assume the frame from which we invoked the minibuffer - ;; is visible. - (and (minibuffer-window-active-p (selected-window)) - (eq frame (window-frame (minibuffer-selected-window))))) - (raise-frame frame)) - - window))) + (unless (eq buffer (window-buffer window)) + (set-window-dedicated-p window nil) + (display-buffer-record-window type window buffer) + (set-window-buffer window buffer) + (when dedicated + (set-window-dedicated-p window dedicated)) + (when (memq type '(window frame)) + (set-window-prev-buffers window nil))) + window)) + +(defun window--maybe-raise-frame (frame) + (let ((visible (frame-visible-p frame))) + (unless (or (not visible) + ;; Assume the selected frame is already visible enough. + (eq frame (selected-frame)) + ;; Assume the frame from which we invoked the + ;; minibuffer is visible. + (and (minibuffer-window-active-p (selected-window)) + (eq frame (window-frame (minibuffer-selected-window))))) + (raise-frame frame)))) ;; FIXME: Not implemented. ;; FIXME: By the way, there could be more levels of dedication: @@ -4771,6 +4770,10 @@ `inhibit-same-window' -- A non-nil value prevents the same window from being used for display. + `inhibit-switch-frame' -- A non-nil value prevents any other + frame from being raised or selected, + even if the window is displayed there. + `reusable-frames' -- Value specifies frame(s) to search for a window that already displays the buffer. See `display-buffer-reuse-window'. @@ -4872,7 +4875,11 @@ If ALIST contains no `reusable-frames' entry, search just the selected frame if `display-buffer-reuse-frames' and `pop-up-frames' are both nil; search all frames on the current -terminal if either of those variables is non-nil." +terminal if either of those variables is non-nil. + +If ALIST has a non-nil `inhibit-switch-frame' entry, then in the +event that a window on another frame is chosen, avoid raising +that frame." (let* ((alist-entry (assq 'reusable-frames alist)) (frames (cond (alist-entry (cdr alist-entry)) ((if (eq pop-up-frames 'graphic-only) @@ -4887,8 +4894,10 @@ (car (delq (selected-window) (get-buffer-window-list buffer 'nomini frames)))))) - (when window - (window--display-buffer buffer window 'reuse)))) + (when (window-live-p window) + (prog1 (window--display-buffer buffer window 'reuse) + (unless (cdr (assq 'inhibit-switch-frame alist)) + (window--maybe-raise-frame (window-frame window))))))) (defun display-buffer--special-action (buffer) "Return special display action for BUFFER, if any. @@ -4905,23 +4914,32 @@ (funcall special-display-function buffer ',(if (listp pars) pars))))))))) -(defun display-buffer-pop-up-frame (buffer _alist) +(defun display-buffer-pop-up-frame (buffer alist) "Display BUFFER in a new frame. This works by calling `pop-up-frame-function'. If successful, -return the window used; otherwise return nil." +return the window used; otherwise return nil. + +If ALIST has a non-nil `inhibit-switch-frame' entry, avoid +raising the new frame." (let ((fun pop-up-frame-function) frame window) (when (and fun (setq frame (funcall fun)) (setq window (frame-selected-window frame))) - (window--display-buffer - buffer window 'frame display-buffer-mark-dedicated)))) + (prog1 (window--display-buffer buffer window + 'frame display-buffer-mark-dedicated) + (unless (cdr (assq 'inhibit-switch-frame alist)) + (window--maybe-raise-frame frame)))))) -(defun display-buffer-pop-up-window (buffer _alist) +(defun display-buffer-pop-up-window (buffer alist) "Display BUFFER by popping up a new window. The new window is created on the selected frame, or in `last-nonminibuffer-frame' if no windows can be created there. -If successful, return the new window; otherwise return nil." +If successful, return the new window; otherwise return nil. + +If ALIST has a non-nil `inhibit-switch-frame' entry, then in the +event that the new window is created on another frame, avoid +raising the frame." (let ((frame (or (window--frame-usable-p (selected-frame)) (window--frame-usable-p (last-nonminibuffer-frame)))) window) @@ -4937,8 +4955,10 @@ (get-largest-window frame t)) (window--try-to-split-window (get-lru-window frame t))))) - (window--display-buffer - buffer window 'window display-buffer-mark-dedicated)))) + (prog1 (window--display-buffer buffer window + 'window display-buffer-mark-dedicated) + (unless (cdr (assq 'inhibit-switch-frame alist)) + (window--maybe-raise-frame (window-frame window))))))) (defun display-buffer--maybe-pop-up-frame-or-window (buffer alist) "Try displaying BUFFER based on `pop-up-frames' or `pop-up-windows'. @@ -4958,7 +4978,11 @@ (defun display-buffer-use-some-window (buffer alist) "Display BUFFER in an existing window. Search for a usable window, set that window to the buffer, and -return the window. If no suitable window is found, return nil." +return the window. If no suitable window is found, return nil. + +If ALIST has a non-nil `inhibit-switch-frame' entry, then in the +event that a window in another frame is chosen, avoid raising +that frame." (let* ((not-this-window (cdr (assq 'inhibit-same-window alist))) (frame (or (window--frame-usable-p (selected-frame)) (window--frame-usable-p (last-nonminibuffer-frame)))) @@ -4975,9 +4999,11 @@ (eq window (selected-window))) window)) (get-largest-window 0 not-this-window)))) - (when window + (when (window-live-p window) (window--even-window-heights window) - (window--display-buffer buffer window 'reuse)))) + (prog1 (window--display-buffer buffer window 'reuse) + (unless (cdr (assq 'inhibit-switch-frame alist)) + (window--maybe-raise-frame (window-frame window))))))) ;;; Display + selection commands: (defun pop-to-buffer (buffer &optional action norecord) ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.