Now on revision 109457. ------------------------------------------------------------ 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) ------------------------------------------------------------ revno: 109456 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2012-08-06 09:27:54 +0400 message: Separate read and write access to Lisp_Object slots of struct frame. * frame.h (FGET, FSET): New macros similar to AREF and ASET. * 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-05 21:44:21 +0000 +++ src/ChangeLog 2012-08-06 05:27:54 +0000 @@ -1,3 +1,12 @@ +2012-08-06 Dmitry Antipov + + Separate read and write access to Lisp_Object slots of struct frame. + * frame.h (FGET, FSET): New macros similar to AREF and ASET. + * 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-05 Andreas Schwab * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT. === modified file 'src/buffer.c' --- src/buffer.c 2012-08-05 15:47:28 +0000 +++ src/buffer.c 2012-08-06 05:27:54 +0000 @@ -193,9 +193,9 @@ Lisp_Object args[3]; CHECK_FRAME (frame); - framelist = Fcopy_sequence (FVAR (XFRAME (frame), buffer_list)); + framelist = Fcopy_sequence (FGET (XFRAME (frame), buffer_list)); prevlist = Fnreverse (Fcopy_sequence - (FVAR (XFRAME (frame), buried_buffer_list))); + (FGET (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 = FVAR (XFRAME (frame), buffer_list); + tail = FGET (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. */ - FVAR (f, buffer_list) = Fcons (buffer, Fdelq (buffer, FVAR (f, buffer_list))); - FVAR (f, buried_buffer_list) = Fdelq (buffer, FVAR (f, buried_buffer_list)); + FSET (f, buffer_list, Fcons (buffer, Fdelq (buffer, FGET (f, buffer_list)))); + FSET (f, buried_buffer_list, Fdelq (buffer, FGET (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. */ - FVAR (f, buffer_list) = Fdelq (buffer, FVAR (f, buffer_list)); - FVAR (f, buried_buffer_list) - = Fcons (buffer, Fdelq (buffer, FVAR (f, buried_buffer_list))); + FSET (f, buffer_list, Fdelq (buffer, FGET (f, buffer_list))); + FSET (f, buried_buffer_list, + Fcons (buffer, Fdelq (buffer, FGET (f, buried_buffer_list)))); /* Run buffer-list-update-hook. */ if (!NILP (Vrun_hooks)) === modified file 'src/data.c' --- src/data.c 2012-08-03 23:36:11 +0000 +++ src/data.c 2012-08-06 05:27:54 +0000 @@ -1006,7 +1006,8 @@ XSETSYMBOL (var, symbol); if (blv->frame_local) { - tem1 = assq_no_quit (var, FVAR (XFRAME (selected_frame), param_alist)); + tem1 = assq_no_quit (var, FGET (XFRAME (selected_frame), + param_alist)); blv->where = selected_frame; } else @@ -1179,7 +1180,7 @@ XSETSYMBOL (symbol, sym); /* May have changed via aliasing. */ tem1 = Fassq (symbol, (blv->frame_local - ? FVAR (XFRAME (where), param_alist) + ? FGET (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-02 07:31:34 +0000 +++ src/dispnew.c 2012-08-06 05:27:54 +0000 @@ -844,12 +844,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 (FVAR (f, menu_bar_window))) - clear_glyph_matrix (XWINDOW (FVAR (f, menu_bar_window))->current_matrix); + if (WINDOWP (FGET (f, menu_bar_window))) + clear_glyph_matrix (XWINDOW (FGET (f, menu_bar_window))->current_matrix); /* Clear the matrix of the tool-bar window, if any. */ - if (WINDOWP (FVAR (f, tool_bar_window))) - clear_glyph_matrix (XWINDOW (FVAR (f, tool_bar_window))->current_matrix); + if (WINDOWP (FGET (f, tool_bar_window))) + clear_glyph_matrix (XWINDOW (FGET (f, tool_bar_window))->current_matrix); /* Clear current window matrices. */ eassert (WINDOWP (FRAME_ROOT_WINDOW (f))); @@ -865,11 +865,11 @@ if (f->desired_matrix) clear_glyph_matrix (f->desired_matrix); - if (WINDOWP (FVAR (f, menu_bar_window))) - clear_glyph_matrix (XWINDOW (FVAR (f, menu_bar_window))->desired_matrix); + if (WINDOWP (FGET (f, menu_bar_window))) + clear_glyph_matrix (XWINDOW (FGET (f, menu_bar_window))->desired_matrix); - if (WINDOWP (FVAR (f, tool_bar_window))) - clear_glyph_matrix (XWINDOW (FVAR (f, tool_bar_window))->desired_matrix); + if (WINDOWP (FGET (f, tool_bar_window))) + clear_glyph_matrix (XWINDOW (FGET (f, tool_bar_window))->desired_matrix); /* Do it for window matrices. */ eassert (WINDOWP (FRAME_ROOT_WINDOW (f))); @@ -1904,7 +1904,7 @@ adjust_frame_glyphs_initially (void) { struct frame *sf = SELECTED_FRAME (); - struct window *root = XWINDOW (FVAR (sf, root_window)); + struct window *root = XWINDOW (FGET (sf, root_window)); struct window *mini = XWINDOW (WVAR (root, next)); int frame_lines = FRAME_LINES (sf); int frame_cols = FRAME_COLS (sf); @@ -2187,15 +2187,15 @@ { /* Allocate a dummy window if not already done. */ struct window *w; - if (NILP (FVAR (f, menu_bar_window))) + if (NILP (FGET (f, menu_bar_window))) { - FVAR (f, menu_bar_window) = make_window (); - w = XWINDOW (FVAR (f, menu_bar_window)); + FSET (f, menu_bar_window, make_window ()); + w = XWINDOW (FGET (f, menu_bar_window)); XSETFRAME (WVAR (w, frame), f); w->pseudo_window_p = 1; } else - w = XWINDOW (FVAR (f, menu_bar_window)); + w = XWINDOW (FGET (f, menu_bar_window)); /* Set window dimensions to frame dimensions and allocate or adjust glyph matrices of W. */ @@ -2213,15 +2213,15 @@ /* 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 (FVAR (f, tool_bar_window))) + if (NILP (FGET (f, tool_bar_window))) { - FVAR (f, tool_bar_window) = make_window (); - w = XWINDOW (FVAR (f, tool_bar_window)); + FSET (f, tool_bar_window, make_window ()); + w = XWINDOW (FGET (f, tool_bar_window)); XSETFRAME (WVAR (w, frame), f); w->pseudo_window_p = 1; } else - w = XWINDOW (FVAR (f, tool_bar_window)); + w = XWINDOW (FGET (f, tool_bar_window)); XSETFASTINT (WVAR (w, top_line), FRAME_MENU_BAR_LINES (f)); XSETFASTINT (WVAR (w, left_col), 0); @@ -2281,28 +2281,28 @@ f->glyphs_initialized_p = 0; /* Release window sub-matrices. */ - if (!NILP (FVAR (f, root_window))) - free_window_matrices (XWINDOW (FVAR (f, root_window))); + if (!NILP (FGET (f, root_window))) + free_window_matrices (XWINDOW (FGET (f, root_window))); /* Free the dummy window for menu bars without X toolkit and its glyph matrices. */ - if (!NILP (FVAR (f, menu_bar_window))) + if (!NILP (FGET (f, menu_bar_window))) { - struct window *w = XWINDOW (FVAR (f, menu_bar_window)); + struct window *w = XWINDOW (FGET (f, menu_bar_window)); free_glyph_matrix (w->desired_matrix); free_glyph_matrix (w->current_matrix); w->desired_matrix = w->current_matrix = NULL; - FVAR (f, menu_bar_window) = Qnil; + FSET (f, menu_bar_window, Qnil); } /* Free the tool bar window and its glyph matrices. */ - if (!NILP (FVAR (f, tool_bar_window))) + if (!NILP (FGET (f, tool_bar_window))) { - struct window *w = XWINDOW (FVAR (f, tool_bar_window)); + struct window *w = XWINDOW (FGET (f, tool_bar_window)); free_glyph_matrix (w->desired_matrix); free_glyph_matrix (w->current_matrix); w->desired_matrix = w->current_matrix = NULL; - FVAR (f, tool_bar_window) = Qnil; + FSET (f, tool_bar_window, Qnil); } /* Release frame glyph matrices. Reset fields to zero in @@ -2725,7 +2725,7 @@ /* If we are called on frame matrices, perform analogous operations for window matrices. */ if (frame_matrix_frame) - mirror_make_current (XWINDOW (FVAR (frame_matrix_frame, root_window)), row); + mirror_make_current (XWINDOW (FGET (frame_matrix_frame, root_window)), row); } @@ -2823,7 +2823,7 @@ /* Do the same for window matrices, if MATRIX is a frame matrix. */ if (frame_matrix_frame) - mirror_line_dance (XWINDOW (FVAR (frame_matrix_frame, root_window)), + mirror_line_dance (XWINDOW (FGET (frame_matrix_frame, root_window)), unchanged_at_top, nlines, copy_from, retained_p); } @@ -3186,7 +3186,7 @@ { /* 1 means display has been paused because of pending input. */ int paused_p; - struct window *root_window = XWINDOW (FVAR (f, root_window)); + struct window *root_window = XWINDOW (FGET (f, root_window)); if (redisplay_dont_pause) force_p = 1; @@ -3221,13 +3221,13 @@ /* Update the menu bar on X frames that don't have toolkit support. */ - if (WINDOWP (FVAR (f, menu_bar_window))) - update_window (XWINDOW (FVAR (f, menu_bar_window)), 1); + if (WINDOWP (FGET (f, menu_bar_window))) + update_window (XWINDOW (FGET (f, menu_bar_window)), 1); /* Update the tool-bar window, if present. */ - if (WINDOWP (FVAR (f, tool_bar_window))) + if (WINDOWP (FGET (f, tool_bar_window))) { - struct window *w = XWINDOW (FVAR (f, tool_bar_window)); + struct window *w = XWINDOW (FGET (f, tool_bar_window)); /* Update tool-bar window. */ if (w->must_be_updated_p) @@ -3239,10 +3239,10 @@ /* Swap tool-bar strings. We swap because we want to reuse strings. */ - tem = FVAR (f, current_tool_bar_string); - FVAR (f, current_tool_bar_string) = FVAR (f, - desired_tool_bar_string); - FVAR (f, desired_tool_bar_string) = tem; + tem = FGET (f, current_tool_bar_string); + FSET (f, current_tool_bar_string, + FGET (f, desired_tool_bar_string)); + FSET (f, desired_tool_bar_string, tem); } } @@ -5764,8 +5764,8 @@ if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f)) FrameCols (FRAME_TTY (f)) = newwidth; - if (WINDOWP (FVAR (f, tool_bar_window))) - XSETFASTINT (WVAR (XWINDOW (FVAR (f, tool_bar_window)), total_cols), newwidth); + if (WINDOWP (FGET (f, tool_bar_window))) + XSETFASTINT (WVAR (XWINDOW (FGET (f, tool_bar_window)), total_cols), newwidth); } FRAME_LINES (f) = newheight; @@ -6089,7 +6089,7 @@ goto changed; if (vecp == end) goto changed; - if (!EQ (*vecp++, FVAR (XFRAME (frame), name))) + if (!EQ (*vecp++, FGET (XFRAME (frame), name))) goto changed; } /* Check that the buffer info matches. */ @@ -6146,7 +6146,7 @@ FOR_EACH_FRAME (tail, frame) { *vecp++ = frame; - *vecp++ = FVAR (XFRAME (frame), name); + *vecp++ = FGET (XFRAME (frame), name); } for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) { === modified file 'src/dosfns.c' --- src/dosfns.c 2012-07-31 12:36:19 +0000 +++ src/dosfns.c 2012-08-06 05:27:54 +0000 @@ -468,15 +468,15 @@ x_set_title (struct frame *f, Lisp_Object name) { /* Don't change the title if it's already NAME. */ - if (EQ (name, FVAR (f, title))) + if (EQ (name, FGET (f, title))) return; update_mode_lines = 1; - FVAR (f, title) = name; + FSET (f, title, name); if (NILP (name)) - name = FVAR (f, name); + name = FGET (f, name); if (FRAME_MSDOS_P (f)) { === modified file 'src/eval.c' --- src/eval.c 2012-08-05 15:47:28 +0000 +++ src/eval.c 2012-08-06 05:27:54 +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, FVAR (XFRAME (where), param_alist)))) + : !NILP (Fassq (symbol, FGET (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-05 15:47:28 +0000 +++ src/fontset.c 2012-08-06 05:27:54 +0000 @@ -2118,7 +2118,7 @@ if (FRAME_LIVE_P (f)) ASET (vec, 1, Fcons (FONTSET_NAME (FONTSET_BASE (fontset)), - FVAR (f, name))); + FGET (f, name))); else ASET (vec, 1, Fcons (FONTSET_NAME (FONTSET_BASE (fontset)), Qnil)); === modified file 'src/frame.c' --- src/frame.c 2012-08-05 07:45:12 +0000 +++ src/frame.c 2012-08-06 05:27:54 +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 (FVAR (f, root_window), nlines - olines); + set_menu_bar_lines_1 (FGET (f, root_window), nlines - olines); adjust_glyphs (f); } } @@ -269,7 +269,7 @@ /* Initialize Lisp data. Note that allocate_frame initializes all Lisp data to nil, so do it only for slots which should not be nil. */ - FVAR (f, tool_bar_position) = Qtop; + FSET (f, tool_bar_position, Qtop); /* Initialize non-Lisp data. Note that allocate_frame zeroes out all non-Lisp data, so do it only for slots which should not be zero. @@ -293,13 +293,13 @@ WVAR (XWINDOW (mini_window), prev) = root_window; XWINDOW (mini_window)->mini = 1; WVAR (XWINDOW (mini_window), frame) = frame; - FVAR (f, minibuffer_window) = mini_window; + FSET (f, minibuffer_window, mini_window); } else { mini_window = Qnil; WVAR (XWINDOW (root_window), next) = Qnil; - FVAR (f, minibuffer_window) = Qnil; + FSET (f, minibuffer_window, Qnil); } WVAR (XWINDOW (root_window), frame) = frame; @@ -339,7 +339,7 @@ etc. Running Lisp functions at this point surely ends in a SEGV. */ set_window_buffer (root_window, buf, 0, 0); - FVAR (f, buffer_list) = Fcons (buf, Qnil); + FSET (f, buffer_list, Fcons (buf, Qnil)); } if (mini_p) @@ -352,11 +352,11 @@ 0, 0); } - FVAR (f, root_window) = root_window; - FVAR (f, selected_window) = root_window; + FSET (f, root_window, root_window); + FSET (f, selected_window, root_window); /* Make sure this window seems more recently used than a newly-created, never-selected window. */ - XWINDOW (FVAR (f, selected_window))->use_time = ++window_select_count; + XWINDOW (FGET (f, selected_window))->use_time = ++window_select_count; return f; } @@ -398,11 +398,11 @@ UNGCPRO; } - mini_window = FVAR (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)), - minibuffer_window); + mini_window = FGET (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)), + minibuffer_window); } - FVAR (f, minibuffer_window) = mini_window; + FSET (f, minibuffer_window, mini_window); /* Make the chosen minibuffer window display the proper minibuffer, unless it is already showing a minibuffer. */ @@ -437,7 +437,7 @@ Avoid infinite looping on the window chain by marking next pointer as nil. */ - mini_window = FVAR (f, minibuffer_window) = FVAR (f, root_window); + 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; @@ -478,7 +478,7 @@ Vframe_list = Fcons (frame, Vframe_list); tty_frame_count = 1; - FVAR (f, name) = build_pure_c_string ("F1"); + FSET (f, name, build_pure_c_string ("F1")); f->visible = 1; f->async_visible = 1; @@ -519,7 +519,7 @@ XSETFRAME (frame, f); Vframe_list = Fcons (frame, Vframe_list); - FVAR (f, name) = make_formatted_string (name, "F%"pMd, ++tty_frame_count); + FSET (f, name, make_formatted_string (name, "F%"pMd, ++tty_frame_count)); f->visible = 1; /* FRAME_SET_VISIBLE wd set frame_garbaged. */ f->async_visible = 1; /* Don't let visible be cleared later. */ @@ -570,7 +570,7 @@ result = Fassq (parameter, supplied_parms); if (NILP (result)) - result = Fassq (parameter, FVAR (XFRAME (selected_frame), param_alist)); + result = Fassq (parameter, FGET (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. */ - FVAR (f, face_alist) = Fcopy_alist (FVAR (sf, face_alist)); + FSET (f, face_alist, Fcopy_alist (FGET (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 = FVAR (f, face_alist); CONSP (tem); tem = XCDR (tem)) + for (tem = FGET (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 (FVAR (XFRAME (frame), selected_window), norecord); + Fselect_window (FGET (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 (FVAR (f, minibuffer_window), minibuf_window)) + if (EQ (FGET (f, minibuffer_window), minibuf_window)) { - Fset_window_buffer (FVAR (sf, minibuffer_window), + Fset_window_buffer (FGET (sf, minibuffer_window), WVAR (XWINDOW (minibuf_window), buffer), Qnil); - minibuf_window = FVAR (sf, minibuffer_window); + minibuf_window = FGET (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 (FVAR (f, minibuffer_window), echo_area_window)) - echo_area_window = FVAR (sf, minibuffer_window); + if (EQ (FGET (f, minibuffer_window), echo_area_window)) + echo_area_window = FGET (sf, minibuffer_window); /* Clear any X selections for this frame. */ #ifdef HAVE_X_WINDOWS @@ -1273,8 +1273,8 @@ /* Mark all the windows that used to be on FRAME as deleted, and then remove the reference to them. */ - delete_all_child_windows (FVAR (f, root_window)); - FVAR (f, root_window) = Qnil; + delete_all_child_windows (FGET (f, root_window)); + FSET (f, root_window, Qnil); Vframe_list = Fdelq (frame, Vframe_list); FRAME_SET_VISIBLE (f, 0); @@ -1283,7 +1283,7 @@ garbage collection. The frame object itself may not be garbage collected until much later, because recent_keys and other data structures can still refer to it. */ - FVAR (f, menu_bar_vector) = Qnil; + FSET (f, menu_bar_vector, Qnil); free_font_driver_list (f); xfree (f->namebuf); @@ -1656,7 +1656,7 @@ } #endif - make_frame_visible_1 (FVAR (XFRAME (frame), root_window)); + make_frame_visible_1 (FGET (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 (FVAR (XFRAME (frame), minibuffer_window), minibuf_window)) + if (EQ (FGET (XFRAME (frame), minibuffer_window), minibuf_window)) { struct frame *sf = XFRAME (selected_frame); - Fset_window_buffer (FVAR (sf, minibuffer_window), + Fset_window_buffer (FGET (sf, minibuffer_window), WVAR (XWINDOW (minibuf_window), buffer), Qnil); - minibuf_window = FVAR (sf, minibuffer_window); + minibuf_window = FGET (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 (FVAR (XFRAME (frame), minibuffer_window), minibuf_window)) + if (EQ (FGET (XFRAME (frame), minibuffer_window), minibuf_window)) { struct frame *sf = XFRAME (selected_frame); - Fset_window_buffer (FVAR (sf, minibuffer_window), + Fset_window_buffer (FGET (sf, minibuffer_window), WVAR (XWINDOW (minibuf_window), buffer), Qnil); - minibuf_window = FVAR (sf, minibuffer_window); + minibuf_window = FGET (sf, minibuffer_window); } /* I think this should be done with a hook. */ @@ -1907,7 +1907,7 @@ f = XFRAME (frame); - FVAR (f, focus_frame) = focus_frame; + FSET (f, focus_frame, focus_frame); if (FRAME_TERMINAL (f)->frame_rehighlight_hook) (*FRAME_TERMINAL (f)->frame_rehighlight_hook) (f); @@ -1940,7 +1940,7 @@ { register Lisp_Object tem; - tem = Fassq (prop, FVAR (frame, param_alist)); + tem = Fassq (prop, FGET (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 FVAR (XFRAME (frame), buffer_predicate); + return FGET (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 FVAR (XFRAME (frame), buffer_list); + return FGET (XFRAME (frame), buffer_list); } /* Discard BUFFER from the buffer-list and buried-buffer-list of each frame. */ @@ -1972,10 +1972,10 @@ FOR_EACH_FRAME (tail, frame) { - FVAR (XFRAME (frame), buffer_list) - = Fdelq (buffer, FVAR (XFRAME (frame), buffer_list)); - FVAR (XFRAME (frame), buried_buffer_list) - = Fdelq (buffer, FVAR (XFRAME (frame), buried_buffer_list)); + FSET (XFRAME (frame), buffer_list, + Fdelq (buffer, FGET (XFRAME (frame), buffer_list))); + FSET (XFRAME (frame), buried_buffer_list, + Fdelq (buffer, FGET (XFRAME (frame), buried_buffer_list))); } } @@ -2023,8 +2023,8 @@ /* Check for no change needed in this very common case before we do any consing. */ - if (frame_name_fnn_p (SSDATA (FVAR (f, name)), - SBYTES (FVAR (f, name)))) + if (frame_name_fnn_p (SSDATA (FGET (f, name)), + SBYTES (FGET (f, name)))) return; name = make_formatted_string (namebuf, "F%"pMd, ++tty_frame_count); @@ -2034,7 +2034,7 @@ CHECK_STRING (name); /* Don't change the name if it's already NAME. */ - if (! NILP (Fstring_equal (name, FVAR (f, name)))) + if (! NILP (Fstring_equal (name, FGET (f, name)))) return; /* Don't allow the user to set the frame name to F, so it @@ -2043,7 +2043,7 @@ error ("Frame names of the form F are usurped by Emacs"); } - FVAR (f, name) = name; + FSET (f, name, name); update_mode_lines = 1; } @@ -2060,7 +2060,7 @@ for (; CONSP (val); val = XCDR (val)) if (!NILP (Fbuffer_live_p (XCAR (val)))) list = Fcons (XCAR (val), list); - FVAR (f, buffer_list) = Fnreverse (list); + FSET (f, buffer_list, Fnreverse (list)); return; } if (EQ (prop, Qburied_buffer_list)) @@ -2069,7 +2069,7 @@ for (; CONSP (val); val = XCDR (val)) if (!NILP (Fbuffer_live_p (XCAR (val)))) list = Fcons (XCAR (val), list); - FVAR (f, buried_buffer_list) = Fnreverse (list); + FSET (f, buried_buffer_list, Fnreverse (list)); return; } @@ -2104,9 +2104,9 @@ FRAME_TTY (f)->previous_frame = NULL; /* Update the frame parameter alist. */ - old_alist_elt = Fassq (prop, FVAR (f, param_alist)); + old_alist_elt = Fassq (prop, FGET (f, param_alist)); if (EQ (old_alist_elt, Qnil)) - FVAR (f, param_alist) = Fcons (Fcons (prop, val), FVAR (f, param_alist)); + FSET (f, param_alist, Fcons (Fcons (prop, val), FGET (f, param_alist))); else Fsetcdr (old_alist_elt, val); @@ -2114,7 +2114,7 @@ in addition to the alist. */ if (EQ (prop, Qbuffer_predicate)) - FVAR (f, buffer_predicate) = val; + FSET (f, buffer_predicate, val); if (! FRAME_WINDOW_P (f)) { @@ -2130,11 +2130,11 @@ error ("Surrogate minibuffer windows must be minibuffer windows"); if ((FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f)) - && !EQ (val, FVAR (f, minibuffer_window))) + && !EQ (val, FGET (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. */ - FVAR (f, minibuffer_window) = val; + FSET (f, minibuffer_window, val); } } @@ -2159,7 +2159,7 @@ if (!FRAME_LIVE_P (f)) return Qnil; - alist = Fcopy_alist (FVAR (f, param_alist)); + alist = Fcopy_alist (FGET (f, param_alist)); GCPRO1 (alist); if (!FRAME_WINDOW_P (f)) @@ -2205,7 +2205,7 @@ : FRAME_W32_P (f) ? "w32term" :"tty")); } - store_in_alist (&alist, Qname, FVAR (f, name)); + store_in_alist (&alist, Qname, FGET (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 +2218,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, - FVAR (XFRAME (frame), buried_buffer_list)); + FGET (XFRAME (frame), buried_buffer_list)); /* I think this should be done with a hook. */ #ifdef HAVE_WINDOW_SYSTEM @@ -2259,7 +2259,7 @@ { /* Avoid consing in frequent cases. */ if (EQ (parameter, Qname)) - value = FVAR (f, name); + value = FGET (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 +2267,7 @@ else if (EQ (parameter, Qbackground_color) || EQ (parameter, Qforeground_color)) { - value = Fassq (parameter, FVAR (f, param_alist)); + value = Fassq (parameter, FGET (f, param_alist)); if (CONSP (value)) { value = XCDR (value); @@ -2305,7 +2305,7 @@ } else if (EQ (parameter, Qdisplay_type) || EQ (parameter, Qbackground_mode)) - value = Fcdr (Fassq (parameter, FVAR (f, param_alist))); + value = Fcdr (Fassq (parameter, FGET (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 +2891,14 @@ if (! TYPE_RANGED_INTEGERP (int, icon_left)) { icon_left_no_change = 1; - icon_left = Fcdr (Fassq (Qicon_left, FVAR (f, param_alist))); + icon_left = Fcdr (Fassq (Qicon_left, FGET (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, FVAR (f, param_alist))); + icon_top = Fcdr (Fassq (Qicon_top, FGET (f, param_alist))); if (NILP (icon_top)) XSETINT (icon_top, 0); } @@ -3058,7 +3058,7 @@ store_in_alist (alistptr, Qouter_window_id, make_formatted_string (buf, "%lu", w)); #endif - store_in_alist (alistptr, Qicon_name, FVAR (f, icon_name)); + store_in_alist (alistptr, Qicon_name, FGET (f, icon_name)); FRAME_SAMPLE_VISIBILITY (f); store_in_alist (alistptr, Qvisibility, (FRAME_VISIBLE_P (f) ? Qt @@ -3072,7 +3072,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, FVAR (f, tool_bar_position)); + store_in_alist (alistptr, Qtool_bar_position, FGET (f, tool_bar_position)); } @@ -3132,7 +3132,7 @@ signal_error ("Invalid screen-gamma", new_value); /* Apply the new gamma value to the frame background. */ - bgcolor = Fassq (Qbackground_color, FVAR (f, param_alist)); + bgcolor = Fassq (Qbackground_color, FGET (f, param_alist)); if (CONSP (bgcolor) && (bgcolor = XCDR (bgcolor), STRINGP (bgcolor))) { Lisp_Object parm_index = Fget (Qbackground_color, Qx_frame_parameter); @@ -3461,7 +3461,7 @@ { Lisp_Object tem; - tem = assq_no_quit (Qicon_type, FVAR (f, param_alist)); + tem = assq_no_quit (Qicon_type, FGET (f, param_alist)); if (CONSP (tem)) return XCDR (tem); else === modified file 'src/frame.h' --- src/frame.h 2012-08-01 05:11:36 +0000 +++ src/frame.h 2012-08-06 05:27:54 +0000 @@ -80,9 +80,15 @@ struct font_driver_list; -/* Most code should use this macro to access Lisp fields in struct frame. */ - -#define FVAR(frame, field) ((frame)->INTERNAL_FIELD (field)) +/* 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)) struct frame { @@ -640,13 +646,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) FVAR (f, minibuffer_window) +#define FRAME_MINIBUF_WINDOW(f) FGET (f, minibuffer_window) /* The root window of the window tree of frame F. */ -#define FRAME_ROOT_WINDOW(f) FVAR (f, root_window) +#define FRAME_ROOT_WINDOW(f) FGET (f, root_window) /* The currently selected window of the window tree of frame F. */ -#define FRAME_SELECTED_WINDOW(f) FVAR (f, selected_window) +#define FRAME_SELECTED_WINDOW(f) FGET (f, selected_window) #define FRAME_INSERT_COST(f) (f)->insert_line_cost #define FRAME_DELETE_COST(f) (f)->delete_line_cost @@ -654,7 +660,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) FVAR (f, focus_frame) +#define FRAME_FOCUS_FRAME(f) FGET (f, focus_frame) /* Nonzero if frame F supports scroll bars. If this is zero, then it is impossible to enable scroll bars @@ -755,10 +761,10 @@ /* Nonzero if frame F has scroll bars. */ -#define FRAME_SCROLL_BARS(f) (FVAR (f, scroll_bars)) +#define FRAME_SCROLL_BARS(f) (FGET (f, scroll_bars)) -#define FRAME_CONDEMNED_SCROLL_BARS(f) (FVAR (f, condemned_scroll_bars)) -#define FRAME_MENU_BAR_ITEMS(f) (FVAR (f, menu_bar_items)) +#define FRAME_CONDEMNED_SCROLL_BARS(f) (FGET (f, condemned_scroll_bars)) +#define FRAME_MENU_BAR_ITEMS(f) (FGET (f, menu_bar_items)) #define FRAME_COST_BAUD_RATE(f) ((f)->cost_calculation_baud_rate) #define FRAME_DESIRED_CURSOR(f) ((f)->desired_cursor) === modified file 'src/fringe.c' --- src/fringe.c 2012-08-01 05:11:36 +0000 +++ src/fringe.c 2012-08-06 05:27:54 +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, FVAR (f, param_alist)); - Lisp_Object right_fringe = Fassq (Qright_fringe, FVAR (f, param_alist)); + Lisp_Object left_fringe = Fassq (Qleft_fringe, FGET (f, param_alist)); + Lisp_Object right_fringe = Fassq (Qright_fringe, FGET (f, param_alist)); int left_fringe_width, right_fringe_width; if (!NILP (left_fringe)) === modified file 'src/gtkutil.c' --- src/gtkutil.c 2012-07-31 12:36:19 +0000 +++ src/gtkutil.c 2012-08-06 05:27:54 +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 (FVAR (f, title))) - title = SSDATA (ENCODE_UTF_8 (FVAR (f, title))); - else if (! NILP (FVAR (f, name))) - title = SSDATA (ENCODE_UTF_8 (FVAR (f, name))); + 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 (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 = FVAR (f, menu_bar_vector); + cl_data->menu_bar_vector = FGET (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 = FVAR (f, menu_bar_vector); + cl_data->menu_bar_vector = FGET (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 (FVAR (f, tool_bar_items))) + if (! f || ! f->n_tool_bar_items || NILP (FGET (f, tool_bar_items))) return; idx *= TOOL_BAR_ITEM_NSLOTS; - key = AREF (FVAR (f, tool_bar_items), idx + TOOL_BAR_ITEM_KEY); + key = AREF (FGET (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 (FVAR (f, tool_bar_items))) + if (! f || ! f->n_tool_bar_items || NILP (FGET (f, tool_bar_items))) return FALSE; if (event->type == GDK_ENTER_NOTIFY) { idx *= TOOL_BAR_ITEM_NSLOTS; - help = AREF (FVAR (f, tool_bar_items), idx + TOOL_BAR_ITEM_HELP); + help = AREF (FGET (f, tool_bar_items), idx + TOOL_BAR_ITEM_HELP); if (NILP (help)) - help = AREF (FVAR (f, tool_bar_items), idx + TOOL_BAR_ITEM_CAPTION); + help = AREF (FGET (f, tool_bar_items), idx + TOOL_BAR_ITEM_CAPTION); } else help = Qnil; @@ -4223,7 +4223,7 @@ } -#define PROP(IDX) AREF (FVAR (f, tool_bar_items), i * TOOL_BAR_ITEM_NSLOTS + (IDX)) +#define PROP(IDX) AREF (FGET (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, FVAR (f, tool_bar_position)); + xg_pack_tool_bar (f, FGET (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-03 23:36:11 +0000 +++ src/minibuf.c 2012-08-06 05:27:54 +0000 @@ -102,14 +102,14 @@ { if (FRAMEP (selected_frame) && FRAME_LIVE_P (XFRAME (selected_frame)) - && !EQ (minibuf_window, FVAR (XFRAME (selected_frame), minibuffer_window))) + && !EQ (minibuf_window, FGET (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 (FVAR (sf, minibuffer_window))) + if (NILP (FGET (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 = WVAR (XWINDOW (minibuf_window), buffer); if (BUFFERP (buffer)) - Fset_window_buffer (FVAR (sf, minibuffer_window), buffer, Qnil); - minibuf_window = FVAR (sf, minibuffer_window); + Fset_window_buffer (FGET (sf, minibuffer_window), buffer, Qnil); + minibuf_window = FGET (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-05 15:47:28 +0000 +++ src/msdos.c 2012-08-06 05:27:54 +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 (FVAR (f, selected_window)); - frame_desired_cursor = Fcdr (Fassq (Qcursor_type, FVAR (f, param_alist))); + sw = XWINDOW (FGET (f, selected_window)); + frame_desired_cursor = Fcdr (Fassq (Qcursor_type, FGET (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, FVAR (f, param_alist))), Qt); + int reverse = EQ (Fcdr (Fassq (Qreverse, FGET (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-01 20:15:30 +0000 +++ src/nsfns.m 2012-08-06 05:27:54 +0000 @@ -448,16 +448,16 @@ else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil)) return; - FVAR (f, icon_name) = arg; + FSET (f, icon_name, arg); if (NILP (arg)) { - if (!NILP (FVAR (f, title))) - arg = FVAR (f, title); + if (!NILP (FGET (f, title))) + arg = FGET (f, title); else /* explicit name and no icon-name -> explicit_name */ if (f->explicit_name) - arg = FVAR (f, name); + arg = FGET (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 (FVAR (f, icon_name))) + if (!STRINGP (FGET (f, icon_name))) encoded_icon_name = encoded_name; else - encoded_icon_name = ENCODE_UTF_8 (FVAR (f, icon_name)); + encoded_icon_name = ENCODE_UTF_8 (FGET (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, FVAR (f, name)))) + if (! NILP (Fstring_equal (name, FGET (f, name)))) return; - FVAR (f, name) = name; + FSET (f, name, name); /* title overrides explicit name */ - if (! NILP (FVAR (f, title))) - name = FVAR (f, title); + if (! NILP (FGET (f, title))) + name = FGET (f, title); ns_set_name_internal (f, name); } @@ -586,15 +586,15 @@ { NSTRACE (x_set_title); /* Don't change the title if it's already NAME. */ - if (EQ (name, FVAR (f, title))) + if (EQ (name, FGET (f, title))) return; update_mode_lines = 1; - FVAR (f, title) = name; + FSET (f, title, name); if (NILP (name)) - name = FVAR (f, name); + name = FGET (f, name); else CHECK_STRING (name); @@ -607,7 +607,7 @@ { NSView *view; Lisp_Object name, filename; - Lisp_Object buf = WVAR (XWINDOW (FVAR (f, selected_window)), buffer); + Lisp_Object buf = WVAR (XWINDOW (FGET (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 (FVAR (f, title)) || ns_in_resize) + if (f->explicit_name || ! NILP (FGET (f, title)) || ns_in_resize) return; BLOCK_INPUT; @@ -677,7 +677,7 @@ [[view window] setRepresentedFilename: fstr]; [[view window] setTitle: str]; - FVAR (f, name) = name; + FSET (f, name, name); } [pool release]; @@ -690,7 +690,7 @@ { NSView *view = FRAME_NS_VIEW (f); NSAutoreleasePool *pool; - if (!MINI_WINDOW_P (XWINDOW (FVAR (f, selected_window)))) + if (!MINI_WINDOW_P (XWINDOW (FGET (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 (FVAR (f, name))] + && [[NSString stringWithUTF8String: SSDATA (FGET (f, name))] isEqualToString: [(NSImage *)f->output_data.ns->miniimage name]]) { [pool release]; @@ -785,7 +785,7 @@ return; } - tem = assq_no_quit (Qicon_type, FVAR (f, param_alist)); + tem = assq_no_quit (Qicon_type, FGET (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 (FVAR (f, name))[0] == '/') + if (SYMBOLP (elt) && EQ (elt, Qt) && SSDATA (FGET (f, name))[0] == '/') { NSString *str - = [NSString stringWithUTF8String: SSDATA (FVAR (f, name))]; + = [NSString stringWithUTF8String: SSDATA (FGET (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), FVAR (f, name)) >= 0) + fast_string_match (XCAR (elt), FGET (f, name)) >= 0) { image = [EmacsImage allocInitFromFile: XCDR (elt)]; if (image == nil) @@ -1205,11 +1205,11 @@ FRAME_FONTSET (f) = -1; - FVAR (f, icon_name) = x_get_arg (dpyinfo, parms, Qicon_name, - "iconName", "Title", - RES_TYPE_STRING); - if (! STRINGP (FVAR (f, icon_name))) - FVAR (f, icon_name) = Qnil; + FSET (f, icon_name, x_get_arg (dpyinfo, parms, Qicon_name, + "iconName", "Title", + RES_TYPE_STRING)); + if (! STRINGP (FGET (f, icon_name))) + FSET (f, icon_name, Qnil); FRAME_NS_DISPLAY_INFO (f) = dpyinfo; @@ -1232,12 +1232,12 @@ be set. */ if (EQ (name, Qunbound) || NILP (name) || ! STRINGP (name)) { - FVAR (f, name) = build_string ([ns_app_name UTF8String]); + FSET (f, name, build_string ([ns_app_name UTF8String])); f->explicit_name = 0; } else { - FVAR (f, name) = name; + FSET (f, name, name); f->explicit_name = 1; specbind (Qx_resource_name, name); } @@ -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)))) - FVAR (f, param_alist) = Fcons (XCAR (tem), FVAR (f, param_alist)); + FSET (f, param_alist, Fcons (XCAR (tem), FGET (f, param_alist))); UNGCPRO; === modified file 'src/nsmenu.m' --- src/nsmenu.m 2012-08-01 20:51:44 +0000 +++ src/nsmenu.m 2012-08-06 05:27:54 +0000 @@ -222,13 +222,13 @@ /* Save the frame's previous menu bar contents data */ if (previous_menu_items_used) - memcpy (previous_items, aref_addr (FVAR (f, menu_bar_vector), 0), + memcpy (previous_items, aref_addr (FGET (f, menu_bar_vector), 0), previous_menu_items_used * sizeof (Lisp_Object)); /* parse stage 1: extract from lisp */ save_menu_items (); - menu_items = FVAR (f, menu_bar_vector); + menu_items = FGET (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); @@ -341,7 +341,7 @@ } /* The menu items are different, so store them in the frame */ /* FIXME: this is not correct for single-submenu case */ - FVAR (f, menu_bar_vector) = menu_items; + FSET (f, menu_bar_vector, menu_items); f->menu_bar_items_used = menu_items_used; /* Calls restore_menu_items, etc., as they were outside */ @@ -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 (FVAR (f, tool_bar_items), \ +#define TOOLPROP(IDX) AREF (FGET (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-02 04:06:38 +0000 +++ src/nsterm.m 2012-08-06 05:27:54 +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 (FVAR (f, root_window))); + mark_window_cursors_off (XWINDOW (FGET (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 (FVAR (f, tool_bar_window)) - && w == XWINDOW (FVAR (f, tool_bar_window))) + if (WINDOWP (FGET (f, tool_bar_window)) + && w == XWINDOW (FGET (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 = FVAR (f, name); + tem = FGET (f, name); name = [NSString stringWithUTF8String: NILP (tem) ? "Emacs" : SSDATA (tem)]; [win setTitle: name]; @@ -5558,7 +5558,7 @@ #endif FRAME_TOOLBAR_HEIGHT (f) = 0; - tem = FVAR (f, icon_name); + tem = FGET (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, - FVAR (emacsframe, menu_bar_vector), + FGET (emacsframe, menu_bar_vector), (void *)tag); } @@ -5773,8 +5773,8 @@ emacs_event->kind = TOOL_BAR_EVENT; /* XSETINT (emacs_event->code, 0); */ - emacs_event->arg = AREF (FVAR (emacsframe, tool_bar_items), - idx + TOOL_BAR_ITEM_KEY); + emacs_event->arg = AREF (FGET (emacsframe, tool_bar_items), + idx + TOOL_BAR_ITEM_KEY); emacs_event->modifiers = EV_MODIFIERS (theEvent); EV_TRAILER (theEvent); return self; @@ -6062,7 +6062,7 @@ Lisp_Object str = Qnil; struct frame *f = SELECTED_FRAME (); struct buffer *curbuf - = XBUFFER (WVAR (XWINDOW (FVAR (f, selected_window)), buffer)); + = XBUFFER (WVAR (XWINDOW (FGET (f, selected_window)), buffer)); if ([attribute isEqualToString:NSAccessibilityRoleAttribute]) return NSAccessibilityTextFieldRole; === modified file 'src/print.c' --- src/print.c 2012-08-03 23:36:11 +0000 +++ src/print.c 2012-08-06 05:27:54 +0000 @@ -1896,7 +1896,7 @@ else if (FRAMEP (obj)) { int len; - Lisp_Object frame_name = FVAR (XFRAME (obj), name); + Lisp_Object frame_name = FGET (XFRAME (obj), name); strout ((FRAME_LIVE_P (XFRAME (obj)) ? "#output_data.w32->icon_bitmap != 0) @@ -1498,11 +1498,11 @@ BLOCK_INPUT; result = x_text_icon (f, - SSDATA ((!NILP (FVAR (f, icon_name)) - ? FVAR (f, icon_name) - : !NILP (FVAR (f, title)) - ? FVAR (f, title) - : FVAR (f, name)))); + SSDATA ((!NILP (FGET (f, icon_name)) + ? FGET (f, icon_name) + : !NILP (FGET (f, title)) + ? FGET (f, title) + : FGET (f, name)))); if (result) { @@ -1631,8 +1631,8 @@ } UNBLOCK_INPUT; - if (WINDOWP (FVAR (f, tool_bar_window))) - clear_glyph_matrix (XWINDOW (FVAR (f, tool_bar_window))->current_matrix); + if (WINDOWP (FGET (f, tool_bar_window))) + clear_glyph_matrix (XWINDOW (FGET (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 (FVAR (f, name)))) + SDATA (FGET (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, FVAR (f, name)))) + if (! NILP (Fstring_equal (name, FGET (f, name)))) return; - FVAR (f, name) = name; + FSET (f, name, name); /* For setting the frame title, the title parameter should override the name parameter. */ - if (! NILP (FVAR (f, title))) - name = FVAR (f, title); + if (! NILP (FGET (f, title))) + name = FGET (f, title); if (FRAME_W32_WINDOW (f)) { @@ -1728,15 +1728,15 @@ 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, FVAR (f, title))) + if (EQ (name, FGET (f, title))) return; update_mode_lines = 1; - FVAR (f, title) = name; + FSET (f, title, name); if (NILP (name)) - name = FVAR (f, name); + name = FGET (f, name); if (FRAME_W32_WINDOW (f)) { @@ -3896,8 +3896,8 @@ int explicit = f->explicit_name; f->explicit_name = 0; - name = FVAR (f, name); - FVAR (f, name) = Qnil; + name = FGET (f, name); + FSET (f, name, Qnil); x_set_name (f, name, explicit); } @@ -3944,9 +3944,9 @@ ? IconicState : NormalState)); - x_text_icon (f, SSDATA ((!NILP (FVAR (f, icon_name)) - ? FVAR (f, icon_name) - : FVAR (f, name)))); + x_text_icon (f, SSDATA ((!NILP (FGET (f, icon_name)) + ? FGET (f, icon_name) + : FGET (f, name)))); #endif UNBLOCK_INPUT; @@ -4146,11 +4146,11 @@ f->output_data.w32 = xzalloc (sizeof (struct w32_output)); FRAME_FONTSET (f) = -1; - FVAR (f, icon_name) - = x_get_arg (dpyinfo, parameters, Qicon_name, "iconName", "Title", - RES_TYPE_STRING); - if (! STRINGP (FVAR (f, icon_name))) - FVAR (f, icon_name) = Qnil; + FSET (f, icon_name, + x_get_arg (dpyinfo, parameters, Qicon_name, "iconName", "Title", + RES_TYPE_STRING)); + if (! STRINGP (FGET (f, icon_name))) + FSET (f, icon_name, Qnil); /* FRAME_W32_DISPLAY_INFO (f) = dpyinfo; */ @@ -4179,12 +4179,12 @@ be set. */ if (EQ (name, Qunbound) || NILP (name)) { - FVAR (f, name) = build_string (dpyinfo->w32_id_name); + FSET (f, name, build_string (dpyinfo->w32_id_name)); f->explicit_name = 0; } else { - FVAR (f, name) = name; + FSET (f, name, name); f->explicit_name = 1; /* use the frame's title when getting resources for this frame. */ specbind (Qx_resource_name, name); @@ -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)))) - FVAR (f, param_alist) = Fcons (XCAR (tem), FVAR (f, param_alist)); + FSET (f, param_alist, Fcons (XCAR (tem), FGET (f, param_alist))); UNGCPRO; @@ -5231,7 +5231,7 @@ f->output_data.w32 = xzalloc (sizeof (struct w32_output)); FRAME_FONTSET (f) = -1; - FVAR (f, icon_name) = Qnil; + FSET (f, icon_name, Qnil); #ifdef GLYPH_DEBUG image_cache_refcount = @@ -5246,12 +5246,12 @@ be set. */ if (EQ (name, Qunbound) || NILP (name)) { - FVAR (f, name) = build_string (dpyinfo->w32_id_name); + FSET (f, name, build_string (dpyinfo->w32_id_name)); f->explicit_name = 0; } else { - FVAR (f, name) = name; + FSET (f, name, name); f->explicit_name = 1; /* use the frame's title when getting resources for this frame. */ specbind (Qx_resource_name, name); === modified file 'src/w32menu.c' --- src/w32menu.c 2012-08-05 15:47:28 +0000 +++ src/w32menu.c 2012-08-06 05:27:54 +0000 @@ -277,7 +277,7 @@ return; entry = Qnil; subprefix_stack = (Lisp_Object *) alloca (f->menu_bar_items_used * word_size); - vector = FVAR (f, menu_bar_vector); + vector = FGET (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 (FVAR (f, menu_bar_vector))->contents, + memcpy (previous_items, XVECTOR (FGET (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 = FVAR (f, menu_bar_vector); + menu_items = FGET (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)); @@ -500,7 +500,7 @@ return; } - FVAR (f, menu_bar_vector) = menu_items; + FSET (f, menu_bar_vector, menu_items); f->menu_bar_items_used = menu_items_used; /* This undoes save_menu_items. */ === modified file 'src/w32term.c' --- src/w32term.c 2012-08-01 05:11:36 +0000 +++ src/w32term.c 2012-08-06 05:27:54 +0000 @@ -4189,7 +4189,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 (FVAR (f, name)))); + SDATA (FGET (f, name)))); } else if (f->async_visible != 1) { @@ -4198,7 +4198,7 @@ f->async_iconified = 0; SET_FRAME_GARBAGED (f); DebPrint (("frame %p (%s) reexposed by WM_PAINT\n", f, - SDATA (FVAR (f, name)))); + SDATA (FGET (f, name)))); /* WM_PAINT serves as MapNotify as well, so report visibility changes properly. */ @@ -4254,7 +4254,7 @@ if (f && !f->iconified) { if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) - && !EQ (FVAR (f, tool_bar_window), hlinfo->mouse_face_window)) + && !EQ (FGET (f, tool_bar_window), hlinfo->mouse_face_window)) { clear_mouse_face (hlinfo); hlinfo->mouse_face_hidden = 1; @@ -4279,7 +4279,7 @@ if (f && !f->iconified) { if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) - && !EQ (FVAR (f, tool_bar_window), hlinfo->mouse_face_window)) + && !EQ (FGET (f, tool_bar_window), hlinfo->mouse_face_window)) { clear_mouse_face (hlinfo); hlinfo->mouse_face_hidden = 1; @@ -4357,7 +4357,7 @@ if (f && !f->iconified) { if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) - && !EQ (FVAR (f, tool_bar_window), hlinfo->mouse_face_window)) + && !EQ (FGET (f, tool_bar_window), hlinfo->mouse_face_window)) { clear_mouse_face (hlinfo); hlinfo->mouse_face_hidden = 1; @@ -4481,8 +4481,8 @@ construct_mouse_click (&inev, &msg, f); /* Is this in the tool-bar? */ - if (WINDOWP (FVAR (f, tool_bar_window)) - && WINDOW_TOTAL_LINES (XWINDOW (FVAR (f, tool_bar_window)))) + if (WINDOWP (FGET (f, tool_bar_window)) + && WINDOW_TOTAL_LINES (XWINDOW (FGET (f, tool_bar_window)))) { Lisp_Object window; int x = XFASTINT (inev.x); @@ -4490,7 +4490,7 @@ window = window_from_coordinates (f, x, y, 0, 1); - if (EQ (window, FVAR (f, tool_bar_window))) + if (EQ (window, FGET (f, tool_bar_window))) { w32_handle_tool_bar_click (f, &inev); tool_bar_p = 1; @@ -4935,7 +4935,7 @@ if (!FRAME_OBSCURED_P (f)) { DebPrint (("frame %p (%s) obscured\n", f, - SDATA (FVAR (f, name)))); + SDATA (FGET (f, name)))); } } else @@ -4947,7 +4947,7 @@ { SET_FRAME_GARBAGED (f); DebPrint (("obscured frame %p (%s) found to be visible\n", f, - SDATA (FVAR (f, name)))); + SDATA (FGET (f, name)))); /* Force a redisplay sooner or later. */ record_asynch_buffer_change (); @@ -5595,7 +5595,7 @@ SET_FRAME_GARBAGED (f); /* If cursor was outside the new size, mark it as off. */ - mark_window_cursors_off (XWINDOW (FVAR (f, root_window))); + mark_window_cursors_off (XWINDOW (FGET (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-05 15:47:28 +0000 +++ src/window.c 2012-08-06 05:27:54 +0000 @@ -191,13 +191,13 @@ Lisp_Object window; if (NILP (frame_or_window)) - window = FVAR (SELECTED_FRAME (), root_window); + window = FGET (SELECTED_FRAME (), root_window); else if (WINDOWP (frame_or_window)) - window = FVAR (XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window))), root_window); + window = FGET (XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window))), root_window); else { CHECK_LIVE_FRAME (frame_or_window); - window = FVAR (XFRAME (frame_or_window), root_window); + window = FGET (XFRAME (frame_or_window), root_window); } return window; @@ -235,13 +235,13 @@ Lisp_Object window; if (NILP (frame_or_window)) - window = FVAR (SELECTED_FRAME (), root_window); + window = FGET (SELECTED_FRAME (), root_window); else if (WINDOWP (frame_or_window)) - window = FVAR (XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window))), root_window); + window = FGET (XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window))), root_window); else { CHECK_LIVE_FRAME (frame_or_window); - window = FVAR (XFRAME (frame_or_window), root_window); + window = FGET (XFRAME (frame_or_window), root_window); } while (NILP (WVAR (XWINDOW (window), buffer))) @@ -269,14 +269,14 @@ Lisp_Object window; if (NILP (frame_or_window)) - window = FVAR (SELECTED_FRAME (), selected_window); + window = FGET (SELECTED_FRAME (), selected_window); else if (WINDOWP (frame_or_window)) - window = FVAR (XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window))), + window = FGET (XFRAME (WINDOW_FRAME (XWINDOW (frame_or_window))), selected_window); else { CHECK_LIVE_FRAME (frame_or_window); - window = FVAR (XFRAME (frame_or_window), selected_window); + window = FGET (XFRAME (frame_or_window), selected_window); } return window; @@ -304,7 +304,7 @@ if (EQ (frame, selected_frame)) return Fselect_window (window, norecord); else - return FVAR (XFRAME (frame), selected_window) = window; + return FSET (XFRAME (frame), selected_window, window); } DEFUN ("selected-window", Fselected_window, Sselected_window, 0, 0, 0, @@ -347,7 +347,7 @@ sf = SELECTED_FRAME (); if (XFRAME (WINDOW_FRAME (w)) != sf) { - FVAR (XFRAME (WINDOW_FRAME (w)), selected_window) = window; + FSET (XFRAME (WINDOW_FRAME (w)), selected_window, window); /* Use this rather than Fhandle_switch_frame so that FRAME_FOCUS_FRAME is moved appropriately as we move around in the state where a minibuffer in a separate @@ -358,7 +358,7 @@ return window; } else - FVAR (sf, selected_window) = window; + FSET (sf, selected_window, window); /* Store the current buffer's actual point into the old selected window. It belongs to that window, @@ -1220,13 +1220,13 @@ bar exists. */ if (NILP (window) && tool_bar_p - && WINDOWP (FVAR (f, tool_bar_window)) - && WINDOW_TOTAL_LINES (XWINDOW (FVAR (f, tool_bar_window))) > 0 - && (coordinates_in_window (XWINDOW (FVAR (f, tool_bar_window)), x, y) + && 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) != ON_NOTHING)) { *part = ON_TEXT; - window = FVAR (f, tool_bar_window); + window = FGET (f, tool_bar_window); } return window; @@ -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))))) - FRAME_ROOT_WINDOW (XFRAME (WVAR (o, frame))) = new; + FSET (XFRAME (WVAR (o, frame)), selected_window, new); if (setflag) { @@ -2323,7 +2323,7 @@ (Lisp_Object frame, Lisp_Object minibuf, Lisp_Object window) { if (NILP (window)) - window = FRAMEP (frame) ? FVAR (XFRAME (frame), selected_window) : selected_window; + window = FRAMEP (frame) ? FGET (XFRAME (frame), selected_window) : selected_window; CHECK_WINDOW (window); if (NILP (frame)) frame = selected_frame; @@ -2633,7 +2633,7 @@ if (EQ (selected_frame, WVAR (w, frame))) Fselect_window (window, Qnil); else - FRAME_SELECTED_WINDOW (f) = window; + FSET (f, selected_window, window); } } else @@ -2663,7 +2663,7 @@ if (EQ (selected_frame, WVAR (w, frame))) Fselect_window (swindow, Qnil); else - FRAME_SELECTED_WINDOW (f) = swindow; + FSET (f, selected_window, swindow); } } @@ -3562,9 +3562,9 @@ void resize_frame_windows (struct frame *f, int size, int horflag) { - Lisp_Object root = FVAR (f, root_window); + Lisp_Object root = FGET (f, root_window); struct window *r = XWINDOW (root); - Lisp_Object mini = FVAR (f, minibuffer_window); + Lisp_Object mini = FGET (f, minibuffer_window); struct window *m; /* new_size is the new size of the frame's root window. */ int new_size = (horflag @@ -3612,7 +3612,7 @@ { /* We lost. Delete all windows but the frame's selected one. */ - root = FVAR (f, selected_window); + root = FGET (f, selected_window); Fdelete_other_windows_internal (root, Qnil); if (horflag) XSETFASTINT (WVAR (XWINDOW (root), total_cols), new_size); @@ -3971,7 +3971,7 @@ if (EQ (FRAME_SELECTED_WINDOW (f), selected_window)) Fselect_window (new_selected_window, Qt); else - FRAME_SELECTED_WINDOW (f) = new_selected_window; + FSET (f, selected_window, new_selected_window); UNBLOCK_INPUT; @@ -3985,7 +3985,7 @@ if (EQ (FRAME_SELECTED_WINDOW (f), selected_window)) Fselect_window (new_selected_window, Qnil); else - FRAME_SELECTED_WINDOW (f) = new_selected_window; + FSET (f, selected_window, new_selected_window); } else UNBLOCK_INPUT; @@ -5660,7 +5660,7 @@ } } - FRAME_ROOT_WINDOW (f) = data->root_window; + 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)) @@ -6490,8 +6490,8 @@ struct frame *f = make_initial_frame (); XSETFRAME (selected_frame, f); Vterminal_frame = selected_frame; - minibuf_window = FVAR (f, minibuffer_window); - selected_window = FVAR (f, selected_window); + minibuf_window = FGET (f, minibuffer_window); + selected_window = FGET (f, selected_window); last_nonminibuf_frame = f; window_initialized = 1; === modified file 'src/window.h' --- src/window.h 2012-08-01 05:11:36 +0000 +++ src/window.h 2012-08-06 05:27:54 +0000 @@ -468,14 +468,14 @@ /* 1 if W is a menu bar window. */ #define WINDOW_MENU_BAR_P(W) \ - (WINDOWP (FVAR (WINDOW_XFRAME (W), menu_bar_window)) \ - && (W) == XWINDOW (FVAR (WINDOW_XFRAME (W), menu_bar_window))) + (WINDOWP (FGET (WINDOW_XFRAME (W), menu_bar_window)) \ + && (W) == XWINDOW (FGET (WINDOW_XFRAME (W), menu_bar_window))) /* 1 if W is a tool bar window. */ #define WINDOW_TOOL_BAR_P(W) \ - (WINDOWP (FVAR (WINDOW_XFRAME (W), tool_bar_window)) \ - && (W) == XWINDOW (FVAR (WINDOW_XFRAME (W), tool_bar_window))) + (WINDOWP (FGET (WINDOW_XFRAME (W), tool_bar_window)) \ + && (W) == XWINDOW (FGET (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-05 15:47:28 +0000 +++ src/xdisp.c 2012-08-06 05:27:54 +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, FVAR (target_frame, selected_window)); + ASET (vector, 8, FGET (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 (FVAR (f, selected_window), Qt); + Fselect_window (FGET (f, selected_window), Qt); set_buffer_internal_1 - (XBUFFER (WVAR (XWINDOW (FVAR (f, selected_window)), buffer))); + (XBUFFER (WVAR (XWINDOW (FGET (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 (FVAR (f, selected_window)), -1, -1, + init_iterator (&it, XWINDOW (FGET (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 (FVAR (f, name)) - || SBYTES (FVAR (f, name)) != len - || memcmp (title, SDATA (FVAR (f, name)), len) != 0) + if (! STRINGP (FGET (f, name)) + || SBYTES (FGET (f, name)) != len + || memcmp (title, SDATA (FGET (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 - (WVAR (XWINDOW (FVAR (f, selected_window)), buffer))); + (WVAR (XWINDOW (FGET (f, selected_window)), buffer))); #endif UNGCPRO; } @@ -11275,7 +11275,7 @@ } XSETFRAME (Vmenu_updating_frame, f); - 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))); /* Redisplay the menu bar in case we changed it. */ #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \ @@ -11414,8 +11414,8 @@ #if defined (USE_GTK) || defined (HAVE_NS) int do_update = FRAME_EXTERNAL_TOOL_BAR (f); #else - int do_update = WINDOWP (FVAR (f, tool_bar_window)) - && WINDOW_TOTAL_LINES (XWINDOW (FVAR (f, tool_bar_window))) > 0; + int do_update = WINDOWP (FGET (f, tool_bar_window)) + && WINDOW_TOTAL_LINES (XWINDOW (FGET (f, tool_bar_window))) > 0; #endif if (do_update) @@ -11477,18 +11477,18 @@ /* Build desired tool-bar items from keymaps. */ new_tool_bar - = tool_bar_items (Fcopy_sequence (FVAR (f, tool_bar_items)), + = tool_bar_items (Fcopy_sequence (FGET (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, FVAR (f, tool_bar_items)))) + || NILP (Fequal (new_tool_bar, FGET (f, tool_bar_items)))) { /* Redisplay that happens asynchronously due to an expose event may access f->tool_bar_items. Make sure we update both variables within BLOCK_INPUT so no such event interrupts. */ BLOCK_INPUT; - FVAR (f, tool_bar_items) = new_tool_bar; + FSET (f, tool_bar_items, new_tool_bar); f->n_tool_bar_items = new_n_tool_bar; w->update_mode_line = 1; UNBLOCK_INPUT; @@ -11521,22 +11521,22 @@ Otherwise, make a new string. */ /* The size of the string we might be able to reuse. */ - size = (STRINGP (FVAR (f, desired_tool_bar_string)) - ? SCHARS (FVAR (f, desired_tool_bar_string)) + size = (STRINGP (FGET (f, desired_tool_bar_string)) + ? SCHARS (FGET (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 (FVAR (f, desired_tool_bar_string))) - FVAR (f, desired_tool_bar_string) - = Fmake_string (make_number (size_needed), make_number (' ')); + if (size < size_needed || NILP (FGET (f, desired_tool_bar_string))) + FSET (f, desired_tool_bar_string, + 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, FVAR (f, desired_tool_bar_string)); + props, FGET (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 (FVAR (f, tool_bar_items), i * TOOL_BAR_ITEM_NSLOTS + (IDX)) + AREF (FGET (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 (FVAR (f, desired_tool_bar_string)); + end = SCHARS (FGET (f, desired_tool_bar_string)); else end = i + 1; Fadd_text_properties (make_number (i), make_number (end), - props, FVAR (f, desired_tool_bar_string)); + props, FGET (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 (FVAR (f, tool_bar_window)); + struct window *w = XWINDOW (FGET (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, FVAR (f, desired_tool_bar_string), 0, 0, 0, -1); + reseat_to_string (&it, NULL, FGET (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 (FVAR (f, tool_bar_window)) - && (w = XWINDOW (FVAR (f, tool_bar_window)), + if (WINDOWP (FGET (f, tool_bar_window)) + && (w = XWINDOW (FGET (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 (FVAR (f, tool_bar_window)) - || (w = XWINDOW (FVAR (f, tool_bar_window)), + if (!WINDOWP (FGET (f, tool_bar_window)) + || (w = XWINDOW (FGET (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, FVAR (f, desired_tool_bar_string), 0, 0, 0, -1); + reseat_to_string (&it, NULL, FGET (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 (FVAR (f, current_tool_bar_string)), glyph->charpos); + charpos = min (SCHARS (FGET (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, FVAR (f, current_tool_bar_string)); + Qmenu_item, FGET (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 (FVAR (f, tool_bar_window)); + struct window *w = XWINDOW (FGET (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 (FVAR (f, tool_bar_window), hlinfo->mouse_face_window) + if (EQ (FGET (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 (FVAR (f, tool_bar_window)); + struct window *w = XWINDOW (FGET (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 (FVAR (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_ENABLED_P); + enabled_p = AREF (FGET (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 (FVAR (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_KEY); + key = AREF (FGET (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 = FVAR (f, tool_bar_window); + Lisp_Object window = FGET (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 (FVAR (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_ENABLED_P); + enabled_p = AREF (FGET (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 (FVAR (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_HELP); + help_echo_string = AREF (FGET (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_HELP); if (NILP (help_echo_string)) - help_echo_string = AREF (FVAR (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_CAPTION); + help_echo_string = AREF (FGET (f, tool_bar_items), prop_idx + TOOL_BAR_ITEM_CAPTION); } #endif /* HAVE_WINDOW_SYSTEM */ @@ -12854,7 +12854,7 @@ selected_frame = frame; do { - for (tail = FVAR (XFRAME (frame), param_alist); + for (tail = FGET (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 (FVAR (f, root_window))) + if (hscroll_windows (FGET (f, root_window))) goto retry; } @@ -13441,7 +13441,7 @@ STOP_POLLING; /* Update the display. */ - set_window_update_flags (XWINDOW (FVAR (f, root_window)), 1); + set_window_update_flags (XWINDOW (FGET (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 (FVAR (XFRAME (selected_frame), selected_window), + eassert (EQ (FGET (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 (FVAR (f, root_window), 1); + mark_window_display_accurate (FGET (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 (FVAR (f, tool_bar_window)) + if (WINDOWP (FGET (f, tool_bar_window)) && (FRAME_TOOL_BAR_LINES (f) > 0 || !NILP (Vauto_resize_tool_bars)) && redisplay_tool_bar (f)) @@ -18119,7 +18119,7 @@ (Lisp_Object row, Lisp_Object glyphs) { struct frame *sf = SELECTED_FRAME (); - struct glyph_matrix *m = XWINDOW (FVAR (sf, tool_bar_window))->current_matrix; + struct glyph_matrix *m = XWINDOW (FGET (sf, tool_bar_window))->current_matrix; EMACS_INT vpos; CHECK_NUMBER (row); @@ -20104,8 +20104,8 @@ /* Menu bar lines are displayed in the desired matrix of the dummy window menu_bar_window. */ struct window *menu_w; - eassert (WINDOWP (FVAR (f, menu_bar_window))); - menu_w = XWINDOW (FVAR (f, menu_bar_window)); + eassert (WINDOWP (FGET (f, menu_bar_window))); + menu_w = XWINDOW (FGET (f, menu_bar_window)); init_iterator (&it, menu_w, -1, -1, menu_w->desired_matrix->rows, MENU_FACE_ID); it.first_visible_x = 0; @@ -21409,10 +21409,10 @@ case 'F': /* %F displays the frame name. */ - if (!NILP (FVAR (f, title))) - return SSDATA (FVAR (f, title)); + if (!NILP (FGET (f, title))) + return SSDATA (FGET (f, title)); if (f->explicit_name || ! FRAME_WINDOW_P (f)) - return SSDATA (FVAR (f, name)); + return SSDATA (FGET (f, name)); return "Emacs"; case 'f': @@ -25576,7 +25576,7 @@ } /* Detect a nonselected window or nonselected frame. */ - else if (w != XWINDOW (FVAR (f, selected_window)) + else if (w != XWINDOW (FGET (f, selected_window)) || f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame) { *active_cursor = 0; @@ -26118,7 +26118,7 @@ void x_update_cursor (struct frame *f, int on_p) { - update_cursor_in_window_tree (XWINDOW (FVAR (f, root_window)), on_p); + update_cursor_in_window_tree (XWINDOW (FGET (f, root_window)), on_p); } @@ -26277,7 +26277,7 @@ if (FRAME_WINDOW_P (f)) { if (draw == DRAW_NORMAL_TEXT - && !EQ (hlinfo->mouse_face_window, FVAR (f, tool_bar_window))) + && !EQ (hlinfo->mouse_face_window, FGET (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); @@ -27633,7 +27633,7 @@ #ifdef HAVE_WINDOW_SYSTEM /* Handle tool-bar window differently since it doesn't display a buffer. */ - if (EQ (window, FVAR (f, tool_bar_window))) + if (EQ (window, FGET (f, tool_bar_window))) { note_tool_bar_highlight (f, x, y); return; @@ -28543,18 +28543,18 @@ } TRACE ((stderr, "(%d, %d, %d, %d)\n", r.x, r.y, r.width, r.height)); - mouse_face_overwritten_p = expose_window_tree (XWINDOW (FVAR (f, root_window)), &r); + mouse_face_overwritten_p = expose_window_tree (XWINDOW (FGET (f, root_window)), &r); - if (WINDOWP (FVAR (f, tool_bar_window))) + if (WINDOWP (FGET (f, tool_bar_window))) mouse_face_overwritten_p - |= expose_window (XWINDOW (FVAR (f, tool_bar_window)), &r); + |= expose_window (XWINDOW (FGET (f, tool_bar_window)), &r); #ifdef HAVE_X_WINDOWS #ifndef MSDOS #ifndef USE_X_TOOLKIT - if (WINDOWP (FVAR (f, menu_bar_window))) + if (WINDOWP (FGET (f, menu_bar_window))) mouse_face_overwritten_p - |= expose_window (XWINDOW (FVAR (f, menu_bar_window)), &r); + |= expose_window (XWINDOW (FGET (f, menu_bar_window)), &r); #endif /* not USE_X_TOOLKIT */ #endif #endif === modified file 'src/xfaces.c' --- src/xfaces.c 2012-08-05 15:47:28 +0000 +++ src/xfaces.c 2012-08-06 05:27:54 +0000 @@ -2053,7 +2053,7 @@ Lisp_Object lface; if (f) - lface = assq_no_quit (face_name, FVAR (f, face_alist)); + lface = assq_no_quit (face_name, FGET (f, face_alist)); else lface = assq_no_quit (face_name, Vface_new_frame_defaults); @@ -2680,8 +2680,8 @@ lface = Fmake_vector (make_number (LFACE_VECTOR_SIZE), Qunspecified); ASET (lface, 0, Qface); - FVAR (f, face_alist) = Fcons (Fcons (face, lface), FVAR (f, - face_alist)); + FSET (f, face_alist, + Fcons (Fcons (face, lface), FGET (f, face_alist))); } else for (i = 1; i < LFACE_VECTOR_SIZE; ++i) @@ -3360,7 +3360,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 (FVAR (f, face_alist))) + if (NILP (FGET (f, face_alist))) return; if (EQ (param, Qforeground_color)) @@ -4046,7 +4046,7 @@ (Lisp_Object frame) { struct frame *f = frame_or_selected_frame (frame, 0); - return FVAR (f, face_alist); + return FGET (f, face_alist); } @@ -4337,7 +4337,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 (FVAR (f, root_window))) + if (WINDOWP (FGET (f, root_window))) { clear_current_matrices (f); ++windows_or_buffers_changed; @@ -5110,7 +5110,7 @@ { frame = XCAR (fl_tail); if (!NILP (Fequal (Fcdr (Fassq (Qdisplay, - FVAR (XFRAME (frame), param_alist))), + FGET (XFRAME (frame), param_alist))), display))) break; } @@ -5406,7 +5406,7 @@ { /* This function is called so early that colors are not yet set in the frame parameter list. */ - Lisp_Object color = Fassq (Qforeground_color, FVAR (f, param_alist)); + Lisp_Object color = Fassq (Qforeground_color, FGET (f, param_alist)); if (CONSP (color) && STRINGP (XCDR (color))) ASET (lface, LFACE_FOREGROUND_INDEX, XCDR (color)); @@ -5422,7 +5422,7 @@ { /* This function is called so early that colors are not yet set in the frame parameter list. */ - Lisp_Object color = Fassq (Qbackground_color, FVAR (f, param_alist)); + Lisp_Object color = Fassq (Qbackground_color, FGET (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-04 14:36:36 +0000 +++ src/xfns.c 2012-08-06 05:27:54 +0000 @@ -665,7 +665,7 @@ #ifdef USE_GTK if (xg_change_toolbar_position (f, new_value)) - FVAR (f, tool_bar_position) = new_value; + FSET (f, tool_bar_position, new_value); #endif } @@ -1123,9 +1123,9 @@ BLOCK_INPUT; if (NILP (arg)) result = x_text_icon (f, - SSDATA ((!NILP (FVAR (f, icon_name)) - ? FVAR (f, icon_name) - : FVAR (f, name)))); + SSDATA ((!NILP (FGET (f, icon_name)) + ? FGET (f, icon_name) + : FGET (f, name)))); else result = x_bitmap_icon (f, arg); @@ -1152,7 +1152,7 @@ else if (!NILP (arg) || NILP (oldval)) return; - FVAR (f, icon_name) = arg; + FSET (f, icon_name, arg); if (f->output_data.x->icon_bitmap != 0) return; @@ -1160,11 +1160,11 @@ BLOCK_INPUT; result = x_text_icon (f, - SSDATA ((!NILP (FVAR (f, icon_name)) - ? FVAR (f, icon_name) - : !NILP (FVAR (f, title)) - ? FVAR (f, title) - : FVAR (f, name)))); + SSDATA ((!NILP (FGET (f, icon_name)) + ? FGET (f, icon_name) + : !NILP (FGET (f, title)) + ? FGET (f, title) + : FGET (f, name)))); if (result) { @@ -1253,8 +1253,8 @@ UNBLOCK_INPUT; } - if (nlines == 0 && WINDOWP (FVAR (f, menu_bar_window))) - clear_glyph_matrix (XWINDOW (FVAR (f, menu_bar_window))->current_matrix); + if (nlines == 0 && WINDOWP (FGET (f, menu_bar_window))) + clear_glyph_matrix (XWINDOW (FGET (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 (FVAR (f, tool_bar_window))) - clear_glyph_matrix (XWINDOW (FVAR (f, tool_bar_window))->current_matrix); + if (WINDOWP (FGET (f, tool_bar_window))) + clear_glyph_matrix (XWINDOW (FGET (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 (FVAR (f, icon_name))) + if (!STRINGP (FGET (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 (FVAR (f, icon_name), coding_system, 0, + icon.value = x_encode_text (FGET (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 (FVAR (f, icon_name)); + encoded_icon_name = ENCODE_UTF_8 (FGET (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 (FVAR (f, name)))) + SSDATA (FGET (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, FVAR (f, name)))) + if (! NILP (Fstring_equal (name, FGET (f, name)))) return; - FVAR (f, name) = name; + FSET (f, name, name); /* For setting the frame title, the title parameter should override the name parameter. */ - if (! NILP (FVAR (f, title))) - name = FVAR (f, title); + if (! NILP (FGET (f, title))) + name = FGET (f, title); x_set_name_internal (f, name); } @@ -1678,15 +1678,15 @@ 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, FVAR (f, title))) + if (EQ (name, FGET (f, title))) return; update_mode_lines = 1; - FVAR (f, title) = name; + FSET (f, title, name); if (NILP (name)) - name = FVAR (f, name); + name = FGET (f, name); else CHECK_STRING (name); @@ -2571,8 +2571,8 @@ int explicit = f->explicit_name; f->explicit_name = 0; - name = FVAR (f, name); - FVAR (f, name) = Qnil; + name = FGET (f, name); + FSET (f, name, Qnil); x_set_name (f, name, explicit); } @@ -2714,8 +2714,8 @@ int explicit = f->explicit_name; f->explicit_name = 0; - name = FVAR (f, name); - FVAR (f, name) = Qnil; + name = FGET (f, name); + FSET (f, name, Qnil); x_set_name (f, name, explicit); } @@ -2791,9 +2791,9 @@ : NormalState)); #endif - x_text_icon (f, SSDATA ((!NILP (FVAR (f, icon_name)) - ? FVAR (f, icon_name) - : FVAR (f, name)))); + x_text_icon (f, SSDATA ((!NILP (FGET (f, icon_name)) + ? FGET (f, icon_name) + : FGET (f, name)))); UNBLOCK_INPUT; } @@ -3135,11 +3135,11 @@ f->output_data.x->scroll_bar_bottom_shadow_pixel = -1; #endif /* USE_TOOLKIT_SCROLL_BARS */ - FVAR (f, icon_name) - = x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title", - RES_TYPE_STRING); - if (! STRINGP (FVAR (f, icon_name))) - FVAR (f, icon_name) = Qnil; + FSET (f, icon_name, + x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title", + RES_TYPE_STRING)); + if (! STRINGP (FGET (f, icon_name))) + FSET (f, icon_name, Qnil); FRAME_X_DISPLAY_INFO (f) = dpyinfo; @@ -3196,12 +3196,12 @@ be set. */ if (EQ (name, Qunbound) || NILP (name)) { - FVAR (f, name) = build_string (dpyinfo->x_id_name); + FSET (f, name, build_string (dpyinfo->x_id_name)); f->explicit_name = 0; } else { - FVAR (f, name) = name; + FSET (f, name, name); f->explicit_name = 1; /* use the frame's title when getting resources for this frame. */ specbind (Qx_resource_name, name); @@ -3340,7 +3340,7 @@ x_default_parameter (f, parms, Qfullscreen, Qnil, "fullscreen", "Fullscreen", RES_TYPE_SYMBOL); x_default_parameter (f, parms, Qtool_bar_position, - FVAR (f, tool_bar_position), 0, 0, RES_TYPE_SYMBOL); + FGET (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)))) - FVAR (f, param_alist) = Fcons (XCAR (tem), FVAR (f, param_alist)); + FSET (f, param_alist, Fcons (XCAR (tem), FGET (f, param_alist))); UNGCPRO; @@ -4621,7 +4621,7 @@ f->output_data.x->scroll_bar_top_shadow_pixel = -1; f->output_data.x->scroll_bar_bottom_shadow_pixel = -1; #endif /* USE_TOOLKIT_SCROLL_BARS */ - FVAR (f, icon_name) = Qnil; + FSET (f, icon_name, Qnil); FRAME_X_DISPLAY_INFO (f) = dpyinfo; f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; f->output_data.x->explicit_parent = 0; @@ -4663,12 +4663,12 @@ be set. */ if (EQ (name, Qunbound) || NILP (name)) { - FVAR (f, name) = build_string (dpyinfo->x_id_name); + FSET (f, name, build_string (dpyinfo->x_id_name)); f->explicit_name = 0; } else { - FVAR (f, name) = name; + FSET (f, name, name); f->explicit_name = 1; /* use the frame's title when getting resources for this frame. */ specbind (Qx_resource_name, name); === modified file 'src/xmenu.c' --- src/xmenu.c 2012-08-05 15:47:28 +0000 +++ src/xmenu.c 2012-08-06 05:27:54 +0000 @@ -835,7 +835,7 @@ if (!f) return; find_and_call_menu_selection (f, f->menu_bar_items_used, - FVAR (f, menu_bar_vector), client_data); + FGET (f, menu_bar_vector), client_data); } #endif /* not USE_GTK */ @@ -1008,20 +1008,20 @@ 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))); items = FRAME_MENU_BAR_ITEMS (f); /* Save the frame's previous menu bar contents data. */ if (previous_menu_items_used) - memcpy (previous_items, XVECTOR (FVAR (f, menu_bar_vector))->contents, + memcpy (previous_items, XVECTOR (FGET (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 = FVAR (f, menu_bar_vector); + menu_items = FGET (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); @@ -1100,7 +1100,7 @@ } /* The menu items are different, so store them in the frame. */ - FVAR (f, menu_bar_vector) = menu_items; + FSET (f, menu_bar_vector, menu_items); f->menu_bar_items_used = menu_items_used; /* This undoes save_menu_items. */ @@ -1283,7 +1283,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); } === modified file 'src/xterm.c' --- src/xterm.c 2012-08-03 23:36:11 +0000 +++ src/xterm.c 2012-08-06 05:27:54 +0000 @@ -3585,7 +3585,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; } } @@ -4957,6 +4957,7 @@ struct frame *f = XFRAME (WVAR (w, frame)); struct scroll_bar *bar = ALLOCATE_PSEUDOVECTOR (struct scroll_bar, x_window, PVEC_OTHER); + Lisp_Object barobj; BLOCK_INPUT; @@ -5017,7 +5018,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); @@ -5416,12 +5418,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); } } @@ -5434,6 +5436,7 @@ { struct scroll_bar *bar; struct frame *f; + 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))) @@ -5452,7 +5455,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! */ @@ -5466,7 +5469,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); } @@ -5483,7 +5487,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) { @@ -6357,7 +6361,7 @@ mouse highlighting. */ if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) && (f == 0 - || !EQ (FVAR (f, tool_bar_window), hlinfo->mouse_face_window))) + || !EQ (FGET (f, tool_bar_window), hlinfo->mouse_face_window))) { clear_mouse_face (hlinfo); hlinfo->mouse_face_hidden = 1; @@ -6904,15 +6908,15 @@ if (f) { /* Is this in the tool-bar? */ - if (WINDOWP (FVAR (f, tool_bar_window)) - && WINDOW_TOTAL_LINES (XWINDOW (FVAR (f, tool_bar_window)))) + if (WINDOWP (FGET (f, tool_bar_window)) + && WINDOW_TOTAL_LINES (XWINDOW (FGET (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, FVAR (f, tool_bar_window)); + tool_bar_p = EQ (window, FGET (f, tool_bar_window)); if (tool_bar_p && event.xbutton.button < 4) { @@ -7503,7 +7507,7 @@ } #ifdef HAVE_X_I18N - if (w == XWINDOW (FVAR (f, selected_window))) + if (w == XWINDOW (FGET (f, selected_window))) if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMPreeditPosition)) xic_set_preeditarea (w, x, y); #endif @@ -8154,7 +8158,7 @@ xic_set_statusarea (f); if (FRAME_XIC_STYLE (f) & XIMPreeditPosition) { - struct window *w = XWINDOW (FVAR (f, selected_window)); + struct window *w = XWINDOW (FGET (f, selected_window)); xic_set_preeditarea (w, w->cursor.x, w->cursor.y); } } @@ -8942,7 +8946,7 @@ #endif /* not USE_GTK */ /* If cursor was outside the new size, mark it as off. */ - mark_window_cursors_off (XWINDOW (FVAR (f, root_window))); + mark_window_cursors_off (XWINDOW (FGET (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: 109455 committer: Fabián Ezequiel Gallina branch nick: trunk timestamp: Mon 2012-08-06 00:27:43 -0300 message: Make internal shell process buffer names start with space. * progmodes/python.el (python-shell-make-comint): Add optional argument INTERNAL. (run-python-internal): Use it. (python-shell-internal-get-or-create-process): Check for new internal buffer names. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-06 01:23:37 +0000 +++ lisp/ChangeLog 2012-08-06 03:27:43 +0000 @@ -1,3 +1,12 @@ +2012-08-06 Fabián Ezequiel Gallina + + Make internal shell process buffer names start with space. + * progmodes/python.el (python-shell-make-comint): Add optional + argument INTERNAL. + (run-python-internal): Use it. + (python-shell-internal-get-or-create-process): Check for new + internal buffer names. + 2012-08-06 Glenn Morris * eshell/esh-ext.el (eshell/addpath): Use dolist. === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2012-07-31 23:43:31 +0000 +++ lisp/progmodes/python.el 2012-08-06 03:27:43 +0000 @@ -1546,26 +1546,34 @@ python-syntax-propertize-function)) (compilation-shell-minor-mode 1)) -(defun python-shell-make-comint (cmd proc-name &optional pop) +(defun python-shell-make-comint (cmd proc-name &optional pop internal) "Create a python shell comint buffer. CMD is the python command to be executed and PROC-NAME is the process name the comint buffer will get. After the comint buffer -is created the `inferior-python-mode' is activated. If POP is -non-nil the buffer is shown." +is created the `inferior-python-mode' is activated. When +optional argument POP is non-nil the buffer is shown. When +optional argument INTERNAL is non-nil this process is run on a +buffer with a name that starts with a space, following the Emacs +convention for temporary/internal buffers, and also makes sure +the user is not queried for confirmation when the process is +killed." (save-excursion - (let* ((proc-buffer-name (format "*%s*" proc-name)) + (let* ((proc-buffer-name + (format (if (not internal) "*%s*" " *%s*") proc-name)) (process-environment (python-shell-calculate-process-environment)) (exec-path (python-shell-calculate-exec-path))) (when (not (comint-check-proc proc-buffer-name)) (let* ((cmdlist (split-string-and-unquote cmd)) - (buffer (apply 'make-comint proc-name (car cmdlist) nil - (cdr cmdlist))) - (current-buffer (current-buffer))) + (buffer (apply #'make-comint-in-buffer proc-name proc-buffer-name + (car cmdlist) nil (cdr cmdlist))) + (current-buffer (current-buffer)) + (process (get-buffer-process buffer))) (with-current-buffer buffer (inferior-python-mode) (python-util-clone-local-variables current-buffer)) - (accept-process-output (get-buffer-process buffer)))) - (and pop (pop-to-buffer proc-buffer-name t)) + (accept-process-output process) + (and pop (pop-to-buffer buffer t)) + (and internal (set-process-query-on-exit-flag process nil)))) proc-buffer-name))) ;;;###autoload @@ -1611,11 +1619,10 @@ startup." (let ((python-shell-enable-font-lock nil) (inferior-python-mode-hook nil)) - (set-process-query-on-exit-flag - (get-buffer-process - (python-shell-make-comint - (python-shell-parse-command) - (python-shell-internal-get-process-name))) nil))) + (get-buffer-process + (python-shell-make-comint + (python-shell-parse-command) + (python-shell-internal-get-process-name) nil t)))) (defun python-shell-get-process () "Get inferior Python process for current buffer and return it." @@ -1662,7 +1669,7 @@ (defun python-shell-internal-get-or-create-process () "Get or create an inferior Internal Python process." (let* ((proc-name (python-shell-internal-get-process-name)) - (proc-buffer-name (format "*%s*" proc-name))) + (proc-buffer-name (format " *%s*" proc-name))) (when (not (process-live-p proc-name)) (run-python-internal) (setq python-shell-internal-buffer proc-buffer-name) ------------------------------------------------------------ revno: 109454 committer: Glenn Morris branch nick: trunk timestamp: Sun 2012-08-05 18:23:37 -0700 message: Tweak previous esh-ext.el change * lisp/eshell/esh-ext.el (eshell/addpath): Use dolist. Do less getting and setting of environment variables. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-05 14:22:05 +0000 +++ lisp/ChangeLog 2012-08-06 01:23:37 +0000 @@ -1,3 +1,8 @@ +2012-08-06 Glenn Morris + + * eshell/esh-ext.el (eshell/addpath): Use dolist. + Do less getting and setting of environment variables. + 2012-08-05 Chong Yidong * proced.el (proced): Add substitution string to docstring to === modified file 'lisp/eshell/esh-ext.el' --- lisp/eshell/esh-ext.el 2012-08-05 05:24:50 +0000 +++ lisp/eshell/esh-ext.el 2012-08-06 01:23:37 +0000 @@ -226,21 +226,15 @@ Adds the given PATH to $PATH.") (if args (progn - (if prepend - (setq args (nreverse args))) - (while args - (setenv "PATH" - (if prepend - (concat (car args) path-separator - (getenv "PATH")) - (concat (getenv "PATH") path-separator - (car args)))) - (setq args (cdr args))) - (setq eshell-path-env (getenv "PATH"))) - (let ((paths (parse-colon-path (getenv "PATH")))) - (while paths - (eshell-printn (car paths)) - (setq paths (cdr paths))))))) + (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)))) + (setenv "PATH" eshell-path-env)) + (dolist (dir (parse-colon-path (getenv "PATH"))) + (eshell-printn dir))))) (put 'eshell/addpath 'eshell-no-numeric-conversions t) ------------------------------------------------------------ revno: 109453 committer: Julien Danjou branch nick: trunk timestamp: Mon 2012-08-06 02:15:34 +0200 message: erc-match: add option to exclude server buffer * erc-match.el (erc-match-exclude-server-buffer) (erc-match-message): Add new option to exclude server buffer from matching. diff: === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2012-07-21 11:08:32 +0000 +++ lisp/erc/ChangeLog 2012-08-06 00:15:34 +0000 @@ -1,3 +1,9 @@ +2012-08-06 Julien Danjou + + * erc-match.el (erc-match-exclude-server-buffer) + (erc-match-message): Add new option to exclude server buffer from + matching. + 2012-07-21 Julien Danjou * erc-notifications.el: New file. === modified file 'lisp/erc/erc-match.el' --- lisp/erc/erc-match.el 2012-06-08 16:39:49 +0000 +++ lisp/erc/erc-match.el 2012-08-06 00:15:34 +0000 @@ -232,6 +232,14 @@ :group 'erc-match :type 'hook) +(defcustom erc-match-exclude-server-buffer nil + "If true, don't perform match on the server buffer; this is +useful for excluding all the things like MOTDs from the server +and other miscellaneous functions." + :group 'erc-match + :version "24.2" + :type 'boolean) + ;; Internal variables: ;; This is exactly the same as erc-button-syntax-table. Should we @@ -449,7 +457,9 @@ (+ 2 nick-end) (point-min)) (point-max)))) - (when vector + (when (and vector + (not (and erc-track-exclude-server-buffer + (erc-server-buffer-p)))) (mapc (lambda (match-type) (goto-char (point-min)) ------------------------------------------------------------ revno: 109452 author: Julien Danjou committer: Katsumi Yamaoka branch nick: trunk timestamp: Sun 2012-08-05 22:02:24 +0000 message: gnus-demon.el (gnus-demon-add-handler, gnus-demon-remove-handler): Add autoload diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-07-31 01:39:58 +0000 +++ lisp/gnus/ChangeLog 2012-08-05 22:02:24 +0000 @@ -1,3 +1,8 @@ +2012-08-05 Julien Danjou + + * gnus-demon.el (gnus-demon-add-handler, gnus-demon-remove-handler): + Add autoload. + 2012-07-31 Katsumi Yamaoka * gnus.el (gnus-valid-select-methods): Fix custom type. === modified file 'lisp/gnus/gnus-demon.el' --- lisp/gnus/gnus-demon.el 2012-06-26 22:52:31 +0000 +++ lisp/gnus/gnus-demon.el 2012-08-05 22:02:24 +0000 @@ -77,6 +77,7 @@ ;;; 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. @@ -85,6 +86,7 @@ (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: 109451 committer: Andreas Schwab branch nick: emacs timestamp: Sun 2012-08-05 23:44:21 +0200 message: Ignore stamp-h.in diff: === modified file 'src/.gitignore' --- src/.gitignore 2011-01-15 23:16:57 +0000 +++ src/.gitignore 2012-08-05 21:44:21 +0000 @@ -2,6 +2,7 @@ config.h epaths.h stamp_BLD +stamp-h.in oo/ oo-spd/ ------------------------------------------------------------ revno: 109450 committer: Andreas Schwab branch nick: emacs timestamp: Sun 2012-08-05 23:44:21 +0200 message: * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-05 15:47:28 +0000 +++ src/ChangeLog 2012-08-05 21:44:21 +0000 @@ -1,3 +1,7 @@ +2012-08-05 Andreas Schwab + + * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT. + 2012-08-05 Dmitry Antipov Generalize common compile-time constants. === modified file 'src/emacs.c' --- src/emacs.c 2012-08-05 07:45:12 +0000 +++ src/emacs.c 2012-08-05 21:44:21 +0000 @@ -2242,8 +2242,8 @@ { const char *path, *p; Lisp_Object lpath, element, tem; +#ifdef WINDOWSNT int defaulted = 0; -#ifdef WINDOWSNT const char *emacs_dir = egetenv ("emacs_dir"); static const char *emacs_dir_env = "%emacs_dir%/"; const size_t emacs_dir_len = strlen (emacs_dir_env); @@ -2259,7 +2259,9 @@ if (!path) { path = defalt; +#ifdef WINDOWSNT defaulted = 1; +#endif } #ifdef DOS_NT /* Ensure values from the environment use the proper directory separator. */ ------------------------------------------------------------ revno: 109449 committer: Dmitry Antipov branch nick: trunk timestamp: Sun 2012-08-05 19:47:28 +0400 message: Generalize common compile-time constants. * lisp.h (header_size, bool_header_size, word_size): Now here. (struct Lisp_Vector): Add comment. (struct Lisp_Bool_Vector): Move up to define handy constants. (VECSIZE, PSEUDOVECSIZE): Simplify. (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation. * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c: * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c: * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c: * xfont.c, xmenu.c: Use word_size where appropriate. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-05 13:30:15 +0000 +++ src/ChangeLog 2012-08-05 15:47:28 +0000 @@ -1,3 +1,16 @@ +2012-08-05 Dmitry Antipov + + Generalize common compile-time constants. + * lisp.h (header_size, bool_header_size, word_size): Now here. + (struct Lisp_Vector): Add comment. + (struct Lisp_Bool_Vector): Move up to define handy constants. + (VECSIZE, PSEUDOVECSIZE): Simplify. + (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation. + * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c: + * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c: + * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c: + * xfont.c, xmenu.c: Use word_size where appropriate. + 2012-08-05 Lawrence Mitchell * search.c (Freplace_match): Treat \? in the replacement text === modified file 'src/alloc.c' --- src/alloc.c 2012-08-03 23:36:11 +0000 +++ src/alloc.c 2012-08-05 15:47:28 +0000 @@ -155,7 +155,7 @@ /* Default value of gc_cons_threshold (see below). */ -#define GC_DEFAULT_THRESHOLD (100000 * sizeof (Lisp_Object)) +#define GC_DEFAULT_THRESHOLD (100000 * word_size) /* Global variables. */ struct emacs_globals globals; @@ -278,14 +278,6 @@ static void free_misc (Lisp_Object); extern Lisp_Object which_symbols (Lisp_Object, EMACS_INT) EXTERNALLY_VISIBLE; -/* Handy constants for vectorlike objects. */ -enum - { - header_size = offsetof (struct Lisp_Vector, contents), - bool_header_size = offsetof (struct Lisp_Bool_Vector, data), - word_size = sizeof (Lisp_Object) - }; - /* When scanning the C stack for live Lisp objects, Emacs keeps track of what memory allocated via lisp_malloc is intended for what purpose. This enumeration specifies the type of memory. */ @@ -2810,9 +2802,9 @@ Lisp_Object val, *objp; /* Change to SAFE_ALLOCA if you hit this eassert. */ - eassert (count <= MAX_ALLOCA / sizeof (Lisp_Object)); + eassert (count <= MAX_ALLOCA / word_size); - objp = alloca (count * sizeof (Lisp_Object)); + objp = alloca (count * word_size); objp[0] = arg; va_start (ap, arg); for (i = 1; i < count; i++) === modified file 'src/buffer.c' --- src/buffer.c 2012-08-02 07:31:34 +0000 +++ src/buffer.c 2012-08-05 15:47:28 +0000 @@ -99,7 +99,7 @@ /* Maximum length of an overlay vector. */ #define OVERLAY_COUNT_MAX \ ((ptrdiff_t) min (MOST_POSITIVE_FIXNUM, \ - min (PTRDIFF_MAX, SIZE_MAX) / sizeof (Lisp_Object))) + min (PTRDIFF_MAX, SIZE_MAX) / word_size)) /* Flags indicating which built-in buffer-local variables are permanent locals. */ @@ -4267,7 +4267,7 @@ ptrdiff_t i; memcpy (copy, XVECTOR (last_overlay_modification_hooks)->contents, - size * sizeof (Lisp_Object)); + size * word_size); gcpro1.var = copy; gcpro1.nvars = size; @@ -4886,8 +4886,7 @@ sure that this is still correct. Otherwise, mark_vectorlike may not trace all Lisp_Objects in buffer_defaults and buffer_local_symbols. */ const int pvecsize - = (offsetof (struct buffer, own_text) - sizeof (struct vectorlike_header)) - / sizeof (Lisp_Object); + = (offsetof (struct buffer, own_text) - header_size) / word_size; memset (buffer_permanent_local_flags, 0, sizeof buffer_permanent_local_flags); @@ -4972,7 +4971,7 @@ The local flag bits are in the local_var_flags slot of the buffer. */ /* Nothing can work if this isn't true */ - { verify (sizeof (EMACS_INT) == sizeof (Lisp_Object)); } + { verify (sizeof (EMACS_INT) == word_size); } /* 0 means not a lisp var, -1 means always local, else mask */ memset (&buffer_local_flags, 0, sizeof buffer_local_flags); === modified file 'src/buffer.h' --- src/buffer.h 2012-08-02 07:31:34 +0000 +++ src/buffer.h 2012-08-05 15:47:28 +0000 @@ -1029,7 +1029,7 @@ #define FOR_EACH_PER_BUFFER_OBJECT_AT(offset) \ for (offset = PER_BUFFER_VAR_OFFSET (name); \ offset <= PER_BUFFER_VAR_OFFSET (cursor_in_non_selected_windows); \ - offset += sizeof (Lisp_Object)) + offset += word_size) /* Return the index of buffer-local variable VAR. Each per-buffer variable has an index > 0 associated with it, except when it always === modified file 'src/bytecode.c' --- src/bytecode.c 2012-08-01 07:57:09 +0000 +++ src/bytecode.c 2012-08-05 15:47:28 +0000 @@ -536,7 +536,7 @@ stack.byte_string = bytestr; stack.pc = stack.byte_string_start = SDATA (bytestr); stack.constants = vector; - if (MAX_ALLOCA / sizeof (Lisp_Object) <= XFASTINT (maxdepth)) + if (MAX_ALLOCA / word_size <= XFASTINT (maxdepth)) memory_full (SIZE_MAX); top = alloca ((XFASTINT (maxdepth) + 1) * sizeof *top); #if BYTE_MAINTAIN_TOP === modified file 'src/callint.c' --- src/callint.c 2012-07-27 09:24:34 +0000 +++ src/callint.c 2012-08-05 15:47:28 +0000 @@ -465,7 +465,7 @@ } if (min (MOST_POSITIVE_FIXNUM, - min (PTRDIFF_MAX, SIZE_MAX) / sizeof (Lisp_Object)) + min (PTRDIFF_MAX, SIZE_MAX) / word_size) < nargs) memory_full (SIZE_MAX); === modified file 'src/eval.c' --- src/eval.c 2012-08-01 07:57:09 +0000 +++ src/eval.c 2012-08-05 15:47:28 +0000 @@ -2301,7 +2301,7 @@ gcpro1.nvars = 1 + numargs; } - memcpy (funcall_args, args, nargs * sizeof (Lisp_Object)); + memcpy (funcall_args, args, nargs * word_size); /* Spread the last arg we got. Its first element goes in the slot that it used to occupy, hence this value of I. */ i = nargs - 1; @@ -2794,7 +2794,7 @@ { internal_args = alloca (XSUBR (fun)->max_args * sizeof *internal_args); - memcpy (internal_args, args + 1, numargs * sizeof (Lisp_Object)); + memcpy (internal_args, args + 1, numargs * word_size); for (i = numargs; i < XSUBR (fun)->max_args; i++) internal_args[i] = Qnil; } === modified file 'src/fns.c' --- src/fns.c 2012-08-03 23:36:11 +0000 +++ src/fns.c 2012-08-05 15:47:28 +0000 @@ -3569,7 +3569,7 @@ /* An upper bound on the size of a hash table index. It must fit in ptrdiff_t and be a valid Emacs fixnum. */ #define INDEX_SIZE_BOUND \ - ((ptrdiff_t) min (MOST_POSITIVE_FIXNUM, PTRDIFF_MAX / sizeof (Lisp_Object))) + ((ptrdiff_t) min (MOST_POSITIVE_FIXNUM, PTRDIFF_MAX / word_size)) /* Create and initialize a new hash table. === modified file 'src/font.c' --- src/font.c 2012-08-03 23:36:11 +0000 +++ src/font.c 2012-08-05 15:47:28 +0000 @@ -2138,7 +2138,7 @@ font_vconcat_entity_vectors (Lisp_Object list) { int nargs = XINT (Flength (list)); - Lisp_Object *args = alloca (sizeof (Lisp_Object) * nargs); + Lisp_Object *args = alloca (word_size * nargs); int i; for (i = 0; i < nargs; i++, list = XCDR (list)) === modified file 'src/fontset.c' --- src/fontset.c 2012-08-01 05:11:36 +0000 +++ src/fontset.c 2012-08-05 15:47:28 +0000 @@ -429,7 +429,7 @@ } if (score_changed) - qsort (XVECTOR (vec)->contents, size, sizeof (Lisp_Object), + qsort (XVECTOR (vec)->contents, size, word_size, fontset_compare_rfontdef); XSETCAR (font_group, make_number (charset_ordered_list_tick)); } @@ -1893,7 +1893,7 @@ /* Recode fontsets realized on FRAME from the base fontset FONTSET in the table `realized'. */ - realized[0] = alloca (sizeof (Lisp_Object) * ASIZE (Vfontset_table)); + realized[0] = alloca (word_size * ASIZE (Vfontset_table)); for (i = j = 0; i < ASIZE (Vfontset_table); i++) { elt = FONTSET_FROM_ID (i); @@ -1904,7 +1904,7 @@ } realized[0][j] = Qnil; - realized[1] = alloca (sizeof (Lisp_Object) * ASIZE (Vfontset_table)); + realized[1] = alloca (word_size * ASIZE (Vfontset_table)); for (i = j = 0; ! NILP (realized[0][i]); i++) { elt = FONTSET_DEFAULT (realized[0][i]); === modified file 'src/keyboard.c' --- src/keyboard.c 2012-08-03 23:36:11 +0000 +++ src/keyboard.c 2012-08-05 15:47:28 +0000 @@ -7527,7 +7527,7 @@ if (end > i + 4) memmove (aref_addr (menu_bar_items_vector, i), aref_addr (menu_bar_items_vector, i + 4), - (end - i - 4) * sizeof (Lisp_Object)); + (end - i - 4) * word_size); ASET (menu_bar_items_vector, end - 4, tem0); ASET (menu_bar_items_vector, end - 3, tem1); ASET (menu_bar_items_vector, end - 2, tem2); @@ -7577,7 +7577,7 @@ if (menu_bar_items_index > i + 4) memmove (aref_addr (menu_bar_items_vector, i), aref_addr (menu_bar_items_vector, i + 4), - (menu_bar_items_index - i - 4) * sizeof (Lisp_Object)); + (menu_bar_items_index - i - 4) * word_size); menu_bar_items_index -= 4; } } @@ -8082,7 +8082,7 @@ if (ntool_bar_items > i + TOOL_BAR_ITEM_NSLOTS) memmove (v, v + TOOL_BAR_ITEM_NSLOTS, ((ntool_bar_items - i - TOOL_BAR_ITEM_NSLOTS) - * sizeof (Lisp_Object))); + * word_size)); ntool_bar_items -= TOOL_BAR_ITEM_NSLOTS; break; } @@ -10425,9 +10425,9 @@ { val = Fvector (NUM_RECENT_KEYS, keys); memcpy (XVECTOR (val)->contents, keys + recent_keys_index, - (NUM_RECENT_KEYS - recent_keys_index) * sizeof (Lisp_Object)); + (NUM_RECENT_KEYS - recent_keys_index) * word_size); memcpy (XVECTOR (val)->contents + NUM_RECENT_KEYS - recent_keys_index, - keys, recent_keys_index * sizeof (Lisp_Object)); + keys, recent_keys_index * word_size); return val; } } === modified file 'src/keymap.c' --- src/keymap.c 2012-08-03 23:36:11 +0000 +++ src/keymap.c 2012-08-05 15:47:28 +0000 @@ -2069,7 +2069,7 @@ size += XINT (Flength (prefix)); /* This has one extra element at the end that we don't pass to Fconcat. */ - if (min (PTRDIFF_MAX, SIZE_MAX) / sizeof (Lisp_Object) / 4 < size) + if (min (PTRDIFF_MAX, SIZE_MAX) / word_size / 4 < size) memory_full (SIZE_MAX); SAFE_ALLOCA_LISP (args, size * 4); === modified file 'src/lisp.h' --- src/lisp.h 2012-08-04 00:52:10 +0000 +++ src/lisp.h 2012-08-05 15:47:28 +0000 @@ -824,25 +824,49 @@ } next; }; +/* Regular vector is just a header plus array of Lisp_Objects. */ + struct Lisp_Vector { struct vectorlike_header header; Lisp_Object contents[1]; }; +/* A boolvector is a kind of vectorlike, with contents are like a string. */ + +struct Lisp_Bool_Vector + { + /* HEADER.SIZE is the vector's size field. It doesn't have the real size, + just the subtype information. */ + struct vectorlike_header header; + /* This is the size in bits. */ + EMACS_INT size; + /* This contains the actual bits, packed into bytes. */ + unsigned char data[1]; + }; + +/* Some handy constants for calculating sizes + and offsets, mostly of vectorlike objects. */ + +enum + { + header_size = offsetof (struct Lisp_Vector, contents), + bool_header_size = offsetof (struct Lisp_Bool_Vector, data), + word_size = sizeof (Lisp_Object) + }; + /* If a struct is made to look like a vector, this macro returns the length of the shortest vector that would hold that struct. */ -#define VECSIZE(type) ((sizeof (type) \ - - offsetof (struct Lisp_Vector, contents[0]) \ - + sizeof (Lisp_Object) - 1) /* Round up. */ \ - / sizeof (Lisp_Object)) + +#define VECSIZE(type) \ + ((sizeof (type) - header_size + word_size - 1) / word_size) /* Like VECSIZE, but used when the pseudo-vector has non-Lisp_Object fields at the end and we need to compute the number of Lisp_Object fields (the ones that the GC needs to trace). */ -#define PSEUDOVECSIZE(type, nonlispfield) \ - ((offsetof (type, nonlispfield) - offsetof (struct Lisp_Vector, contents[0])) \ - / sizeof (Lisp_Object)) + +#define PSEUDOVECSIZE(type, nonlispfield) \ + ((offsetof (type, nonlispfield) - header_size) / word_size) /* A char-table is a kind of vectorlike, with contents are like a vector but with a few other slots. For some purposes, it makes @@ -978,18 +1002,6 @@ Lisp_Object contents[1]; }; -/* A boolvector is a kind of vectorlike, with contents are like a string. */ -struct Lisp_Bool_Vector - { - /* HEADER.SIZE is the vector's size field. It doesn't have the real size, - just the subtype information. */ - struct vectorlike_header header; - /* This is the size in bits. */ - EMACS_INT size; - /* This contains the actual bits, packed into bytes. */ - unsigned char data[1]; - }; - /* This structure describes a built-in function. It is generated by the DEFUN macro only. defsubr makes it into a Lisp object. @@ -3483,21 +3495,21 @@ /* SAFE_ALLOCA_LISP allocates an array of Lisp_Objects. */ -#define SAFE_ALLOCA_LISP(buf, nelt) \ - do { \ - if ((nelt) < MAX_ALLOCA / sizeof (Lisp_Object)) \ - buf = alloca ((nelt) * sizeof (Lisp_Object)); \ - else if ((nelt) < min (PTRDIFF_MAX, SIZE_MAX) / sizeof (Lisp_Object)) \ - { \ - Lisp_Object arg_; \ - buf = xmalloc ((nelt) * sizeof (Lisp_Object)); \ - arg_ = make_save_value (buf, nelt); \ - XSAVE_VALUE (arg_)->dogc = 1; \ - sa_must_free = 1; \ - record_unwind_protect (safe_alloca_unwind, arg_); \ - } \ - else \ - memory_full (SIZE_MAX); \ +#define SAFE_ALLOCA_LISP(buf, nelt) \ + do { \ + if ((nelt) < MAX_ALLOCA / word_size) \ + buf = alloca ((nelt) * word_size); \ + else if ((nelt) < min (PTRDIFF_MAX, SIZE_MAX) / word_size) \ + { \ + Lisp_Object arg_; \ + buf = xmalloc ((nelt) * word_size); \ + arg_ = make_save_value (buf, nelt); \ + XSAVE_VALUE (arg_)->dogc = 1; \ + sa_must_free = 1; \ + record_unwind_protect (safe_alloca_unwind, arg_); \ + } \ + else \ + memory_full (SIZE_MAX); \ } while (0) === modified file 'src/macros.c' --- src/macros.c 2012-08-03 23:36:11 +0000 +++ src/macros.c 2012-08-05 15:47:28 +0000 @@ -63,7 +63,7 @@ if (!current_kboard->kbd_macro_buffer) { - current_kboard->kbd_macro_buffer = xmalloc (30 * sizeof (Lisp_Object)); + current_kboard->kbd_macro_buffer = xmalloc (30 * word_size); current_kboard->kbd_macro_bufsize = 30; } update_mode_lines++; @@ -73,7 +73,7 @@ { current_kboard->kbd_macro_buffer = xrealloc (current_kboard->kbd_macro_buffer, - 30 * sizeof (Lisp_Object)); + 30 * word_size); current_kboard->kbd_macro_bufsize = 30; } current_kboard->kbd_macro_ptr = current_kboard->kbd_macro_buffer; === modified file 'src/menu.c' --- src/menu.c 2012-08-03 23:36:11 +0000 +++ src/menu.c 2012-08-05 15:47:28 +0000 @@ -976,7 +976,7 @@ prefix = entry = Qnil; i = 0; - subprefix_stack = alloca (menu_items_used * sizeof (Lisp_Object)); + subprefix_stack = alloca (menu_items_used * word_size); while (i < menu_items_used) { === modified file 'src/msdos.c' --- src/msdos.c 2012-08-04 08:58:33 +0000 +++ src/msdos.c 2012-08-05 15:47:28 +0000 @@ -1594,9 +1594,9 @@ Lisp_Object tail; int i, j, length = XINT (Flength (alist)); Lisp_Object *parms - = (Lisp_Object *) alloca (length * sizeof (Lisp_Object)); + = (Lisp_Object *) alloca (length * word_size); Lisp_Object *values - = (Lisp_Object *) alloca (length * sizeof (Lisp_Object)); + = (Lisp_Object *) alloca (length * word_size); /* Do we have to reverse the foreground and background colors? */ int reverse = EQ (Fcdr (Fassq (Qreverse, FVAR (f, param_alist))), Qt); int redraw = 0, fg_set = 0, bg_set = 0; @@ -2435,9 +2435,9 @@ { val = Fvector (NUM_RECENT_DOSKEYS, keys); memcpy (XVECTOR (val)->contents, keys + recent_doskeys_index, - (NUM_RECENT_DOSKEYS - recent_doskeys_index) * sizeof (Lisp_Object)); + (NUM_RECENT_DOSKEYS - recent_doskeys_index) * word_size); memcpy (XVECTOR (val)->contents + NUM_RECENT_DOSKEYS - recent_doskeys_index, - keys, recent_doskeys_index * sizeof (Lisp_Object)); + keys, recent_doskeys_index * word_size); return val; } } === modified file 'src/w32menu.c' --- src/w32menu.c 2012-08-03 23:36:11 +0000 +++ src/w32menu.c 2012-08-05 15:47:28 +0000 @@ -276,7 +276,7 @@ if (!f) return; entry = Qnil; - subprefix_stack = (Lisp_Object *) alloca (f->menu_bar_items_used * sizeof (Lisp_Object)); + subprefix_stack = (Lisp_Object *) alloca (f->menu_bar_items_used * word_size); vector = FVAR (f, menu_bar_vector); prefix = Qnil; i = 0; @@ -387,7 +387,7 @@ int previous_menu_items_used = f->menu_bar_items_used; Lisp_Object *previous_items = (Lisp_Object *) alloca (previous_menu_items_used - * sizeof (Lisp_Object)); + * word_size); /* If we are making a new widget, its contents are empty, do always reinitialize them. */ @@ -420,7 +420,7 @@ /* Save the frame's previous menu bar contents data. */ if (previous_menu_items_used) memcpy (previous_items, XVECTOR (FVAR (f, menu_bar_vector))->contents, - previous_menu_items_used * sizeof (Lisp_Object)); + previous_menu_items_used * word_size); /* Fill in menu_items with the current menu bar contents. This can evaluate Lisp code. */ @@ -665,7 +665,7 @@ widget_value **submenu_stack = (widget_value **) alloca (menu_items_used * sizeof (widget_value *)); Lisp_Object *subprefix_stack - = (Lisp_Object *) alloca (menu_items_used * sizeof (Lisp_Object)); + = (Lisp_Object *) alloca (menu_items_used * word_size); int submenu_depth = 0; int first_pane; === modified file 'src/w32term.h' --- src/w32term.h 2012-07-30 17:07:33 +0000 +++ src/w32term.h 2012-08-05 15:47:28 +0000 @@ -429,7 +429,7 @@ #define SCROLL_BAR_VEC_SIZE \ ((sizeof (struct scroll_bar) \ - sizeof (EMACS_INT) - sizeof (struct Lisp_Vector *)) \ - / sizeof (Lisp_Object)) + / word_size) /* Turning a lisp vector value into a pointer to a struct scroll_bar. */ #define XSCROLL_BAR(vec) ((struct scroll_bar *) XVECTOR (vec)) === modified file 'src/window.c' --- src/window.c 2012-08-01 05:11:36 +0000 +++ src/window.c 2012-08-05 15:47:28 +0000 @@ -3263,7 +3263,7 @@ p = allocate_window (); memcpy ((char *) p + sizeof (struct vectorlike_header), (char *) o + sizeof (struct vectorlike_header), - sizeof (Lisp_Object) * VECSIZE (struct window)); + word_size * VECSIZE (struct window)); XSETWINDOW (parent, p); p->sequence_number = ++sequence_number; === modified file 'src/xdisp.c' --- src/xdisp.c 2012-08-03 23:36:11 +0000 +++ src/xdisp.c 2012-08-05 15:47:28 +0000 @@ -2420,7 +2420,7 @@ ptrdiff_t i; ptrdiff_t count = SPECPDL_INDEX (); struct gcpro gcpro1; - Lisp_Object *args = alloca (nargs * sizeof (Lisp_Object)); + Lisp_Object *args = alloca (nargs * word_size); args[0] = func; va_start (ap, func); === modified file 'src/xfaces.c' --- src/xfaces.c 2012-08-03 23:36:11 +0000 +++ src/xfaces.c 2012-08-05 15:47:28 +0000 @@ -1657,7 +1657,7 @@ vec = Fvconcat (ndrivers, drivers); nfonts = ASIZE (vec); - qsort (XVECTOR (vec)->contents, nfonts, sizeof (Lisp_Object), + qsort (XVECTOR (vec)->contents, nfonts, word_size, compare_fonts_by_sort_order); result = Qnil; @@ -2768,7 +2768,7 @@ } memcpy (XVECTOR (copy)->contents, XVECTOR (lface)->contents, - LFACE_VECTOR_SIZE * sizeof (Lisp_Object)); + LFACE_VECTOR_SIZE * word_size); /* Changing a named face means that all realized faces depending on that face are invalid. Since we cannot tell which realized faces === modified file 'src/xfont.c' --- src/xfont.c 2012-08-03 23:36:11 +0000 +++ src/xfont.c 2012-08-05 15:47:28 +0000 @@ -464,11 +464,11 @@ continue; } if (memcmp (props, aref_addr (entity, FONT_FOUNDRY_INDEX), - sizeof (Lisp_Object) * 7) + word_size * 7) || ! EQ (AREF (entity, FONT_SPACING_INDEX), props[7])) { memcpy (props, aref_addr (entity, FONT_FOUNDRY_INDEX), - sizeof (Lisp_Object) * 7); + word_size * 7); props[7] = AREF (entity, FONT_SPACING_INDEX); scripts = xfont_supported_scripts (display, indices[i], xfont_scratch_props, encoding); === modified file 'src/xmenu.c' --- src/xmenu.c 2012-08-01 20:51:44 +0000 +++ src/xmenu.c 2012-08-05 15:47:28 +0000 @@ -1015,7 +1015,7 @@ /* Save the frame's previous menu bar contents data. */ if (previous_menu_items_used) memcpy (previous_items, XVECTOR (FVAR (f, menu_bar_vector))->contents, - previous_menu_items_used * sizeof (Lisp_Object)); + previous_menu_items_used * word_size); /* Fill in menu_items with the current menu bar contents. This can evaluate Lisp code. */ ------------------------------------------------------------ revno: 109448 fixes bug: http://debbugs.gnu.org/1768 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-08-05 22:22:05 +0800 message: Tweak proced docstring to trigger autoloading. * lisp/proced.el (proced): Add substitution string to docstring to trigger autoloading of the proced library on C-h f. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-05 14:14:54 +0000 +++ lisp/ChangeLog 2012-08-05 14:22:05 +0000 @@ -1,5 +1,8 @@ 2012-08-05 Chong Yidong + * proced.el (proced): Add substitution string to docstring to + trigger autoloading of the proced library on C-h f (Bug#1768). + * emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Don't show defvars which have no second argument (Bug#8638). === modified file 'lisp/proced.el' --- lisp/proced.el 2012-06-22 21:17:42 +0000 +++ lisp/proced.el 2012-08-05 14:22:05 +0000 @@ -659,11 +659,14 @@ ;;;###autoload (defun proced (&optional arg) "Generate a listing of UNIX system processes. -If invoked with optional ARG the window displaying the process -information will be displayed but not selected. -Runs the normal hook `proced-post-display-hook'. - -See `proced-mode' for a description of features available in Proced buffers." +\\ +If invoked with optional ARG, do not select the window displaying +the process information. + +This function runs the normal hook `proced-post-display-hook'. + +See `proced-mode' for a description of features available in +Proced buffers." (interactive "P") (unless proced-available (error "Proced is not available on this system")) ------------------------------------------------------------ revno: 109447 fixes bug: http://debbugs.gnu.org/8638 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-08-05 22:14:54 +0800 message: In Imenu, don't show defvars with no second argument. * lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Don't show defvars which have no second argument. * lisp/imenu.el (imenu-generic-expression): Move documentation here from imenu--generic-function. (imenu--generic-function): Refer to imenu-generic-expression. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-05 08:52:45 +0000 +++ lisp/ChangeLog 2012-08-05 14:14:54 +0000 @@ -1,3 +1,12 @@ +2012-08-05 Chong Yidong + + * emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Don't + show defvars which have no second argument (Bug#8638). + + * imenu.el (imenu-generic-expression): Move documentation here + from imenu--generic-function. + (imenu--generic-function): Refer to imenu-generic-expression. + 2012-08-05 Vegard Øye (tiny change) * emulation/viper-init.el (viper-deflocalvar): Add docstring and === modified file 'lisp/emacs-lisp/lisp-mode.el' --- lisp/emacs-lisp/lisp-mode.el 2012-07-26 01:27:33 +0000 +++ lisp/emacs-lisp/lisp-mode.el 2012-08-05 14:14:54 +0000 @@ -117,10 +117,15 @@ (purecopy (concat "^\\s-*(" (eval-when-compile (regexp-opt - '("defvar" "defconst" "defconstant" "defcustom" + '("defconst" "defconstant" "defcustom" "defparameter" "define-symbol-macro") t)) "\\s-+\\(\\(\\sw\\|\\s_\\)+\\)")) 2) + ;; For `defvar', we ignore (defvar FOO) constructs. + (list (purecopy "Variables") + (purecopy (concat "^\\s-*(defvar\\s-+\\(\\(\\sw\\|\\s_\\)+\\)" + "[[:space:]\n]+[^)]")) + 1) (list (purecopy "Types") (purecopy (concat "^\\s-*(" (eval-when-compile === modified file 'lisp/imenu.el' --- lisp/imenu.el 2012-07-10 11:51:54 +0000 +++ lisp/imenu.el 2012-08-05 14:14:54 +0000 @@ -187,16 +187,39 @@ ;;;###autoload (defvar imenu-generic-expression nil - "The regex pattern to use for creating a buffer index. + "List of definition matchers for creating an Imenu index. +Each element of this list should have the form + + (MENU-TITLE REGEXP INDEX [FUNCTION] [ARGUMENTS...]) + +MENU-TITLE should be nil (in which case the matches for this +element are put in the top level of the buffer index) or a +string (which specifies the title of a submenu into which the +matches are put). +REGEXP is a regular expression matching a definition construct +which is to be displayed in the menu. REGEXP may also be a +function, called without arguments. It is expected to search +backwards. It must return true and set `match-data' if it finds +another element. +INDEX is an integer specifying which subexpression of REGEXP +matches the definition's name; this subexpression is displayed as +the menu item. +FUNCTION, if present, specifies a function to call when the index +item is selected by the user. This function is called with +arguments consisting of the item name, the buffer position, and +the ARGUMENTS. + +The variable `imenu-case-fold-search' determines whether or not +the regexp matches are case sensitive, and `imenu-syntax-alist' +can be used to alter the syntax table for the search. If non-nil this pattern is passed to `imenu--generic-function' to -create a buffer index. Look there for the documentation of this -pattern's structure. +create a buffer index. -For example, see the value of `fortran-imenu-generic-expression' used by -`fortran-mode' with `imenu-syntax-alist' set locally to give the -characters which normally have \"symbol\" syntax \"word\" syntax -during matching.") +For example, see the value of `fortran-imenu-generic-expression' +used by `fortran-mode' with `imenu-syntax-alist' set locally to +give the characters which normally have \"symbol\" syntax +\"word\" syntax during matching.") ;;;###autoload(put 'imenu-generic-expression 'risky-local-variable t) ;;;###autoload @@ -694,46 +717,16 @@ ;; so it needs to be careful never to loop! (defun imenu--generic-function (patterns) "Return an index alist of the current buffer based on PATTERNS. - -PATTERNS is an alist with elements that look like this: - (MENU-TITLE REGEXP INDEX) -or like this: - (MENU-TITLE REGEXP INDEX FUNCTION ARGUMENTS...) -with zero or more ARGUMENTS. The former format creates a simple -element in the index alist when it matches; the latter creates a -special element of the form (INDEX-NAME POSITION-MARKER FUNCTION -ARGUMENTS...) with FUNCTION and ARGUMENTS copied from PATTERNS. - -MENU-TITLE is a string used as the title for the submenu or nil -if the entries are not nested. - -REGEXP is a regexp that should match a construct in the buffer -that is to be displayed in the menu; i.e., function or variable -definitions, etc. It contains a substring which is the name to -appear in the menu. See the info section on Regexps for more -information. REGEXP may also be a function, called without -arguments. It is expected to search backwards. It shall return -true and set `match-data' if it finds another element. - -INDEX points to the substring in REGEXP that contains the -name (of the function, variable or type) that is to appear in the -menu. - -The variable `imenu-case-fold-search' determines whether or not the -regexp matches are case sensitive, and `imenu-syntax-alist' can be -used to alter the syntax table for the search. - -See `lisp-imenu-generic-expression' for an example of PATTERNS. - -Returns an index of the current buffer as an alist. The elements in -the alist look like: +PATTERNS should be an alist which has the same form as +`imenu-generic-expression'. + +The return value is an alist of the form (INDEX-NAME . INDEX-POSITION) -or like: +or (INDEX-NAME INDEX-POSITION FUNCTION ARGUMENTS...) -They may also be nested index alists like: +The return value may also consist of nested index alists like: (INDEX-NAME . INDEX-ALIST) depending on PATTERNS." - (let ((index-alist (list 'dummy)) (case-fold-search (if (or (local-variable-p 'imenu-case-fold-search) (not (local-variable-p 'font-lock-defaults))) ------------------------------------------------------------ revno: 109446 fixes bug: http://debbugs.gnu.org/8161 author: Lawrence Mitchell committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-08-05 21:30:15 +0800 message: * search.c (Freplace_match): Treat \? in the replacement text literally. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-08-03 10:23:30 +0000 +++ etc/NEWS 2012-08-05 13:30:15 +0000 @@ -482,6 +482,10 @@ * Incompatible Lisp Changes in Emacs 24.2 +** If the NEWTEXT arg to `replace-match' contains a substring "\?", +that substring is inserted literally even if the LITERAL arg is +non-nil, instead of causing an error to be signaled. + +++ ** Docstrings starting with `*' no longer indicate user options. Only variables defined using `defcustom' are considered user options. === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-05 07:45:12 +0000 +++ src/ChangeLog 2012-08-05 13:30:15 +0000 @@ -1,3 +1,8 @@ +2012-08-05 Lawrence Mitchell + + * search.c (Freplace_match): Treat \? in the replacement text + literally (Bug#8161). + 2012-08-05 Chong Yidong * term.c (Vsuspend_tty_functions, Vresume_tty_functions): === modified file 'src/search.c' --- src/search.c 2012-07-27 09:24:34 +0000 +++ src/search.c 2012-08-05 13:30:15 +0000 @@ -2226,6 +2226,9 @@ `\\N' means substitute what matched the Nth `\\(...\\)'. If Nth parens didn't match, substitute nothing. `\\\\' means insert one `\\'. + `\\?' is treated literally + (for compatibility with `query-replace-regexp'). + Any other character following `\\' signals an error. Case conversion does not apply to these substitutions. FIXEDCASE and LITERAL are optional arguments. @@ -2428,7 +2431,7 @@ } else if (c == '\\') delbackslash = 1; - else + else if (c != '?') error ("Invalid use of `\\' in replacement text"); } if (substart >= 0) ------------------------------------------------------------ revno: 109445 committer: Michael Albinus branch nick: trunk timestamp: Sun 2012-08-05 14:53:48 +0200 message: * INSTALL: Explain, how to disable D-Bus at all. (Bug#12112) diff: === modified file 'ChangeLog' --- ChangeLog 2012-08-05 05:00:52 +0000 +++ ChangeLog 2012-08-05 12:53:48 +0000 @@ -1,3 +1,7 @@ +2012-08-05 Michael Albinus + + * INSTALL: Explain, how to disable D-Bus at all. (Bug#12112) + 2012-08-05 Ulrich Müller * configure.ac: Disable paxctl if binaries don't have a === modified file 'INSTALL' --- INSTALL 2012-07-31 07:15:11 +0000 +++ INSTALL 2012-08-05 12:53:48 +0000 @@ -280,6 +280,12 @@ `--with-pkg-config-prog=PATH' where PATH is the pathname to pkg-config. Note that GTK version 2.6 or newer is required for Emacs. +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'. + 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 POP3 are not supported. For Kerberos-authenticated POP add ------------------------------------------------------------ revno: 109444 committer: Glenn Morris branch nick: trunk timestamp: Sun 2012-08-05 06:19:01 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/configure' --- autogen/configure 2012-08-04 10:17:29 +0000 +++ autogen/configure 2012-08-05 10:19:01 +0000 @@ -7870,6 +7870,29 @@ fi + if test "X$PAXCTL" != X; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether binaries have a PT_PAX_FLAGS header" >&5 +$as_echo_n "checking whether binaries have a PT_PAX_FLAGS header... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if $PAXCTL -v conftest$EXEEXT >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; PAXCTL=""; fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi fi ## Need makeinfo >= 4.7 (?) to build the manuals. ------------------------------------------------------------ revno: 109443 fixes bug: http://debbugs.gnu.org/7774 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-08-05 17:24:55 +0800 message: Manual fixes for frame-background-mode. * doc/custom.texi (Face Customization): Move discussion of face inheritance here, from Faces section. * doc/display.texi (Faces): Document frame-background-mode. * doc/lispref/display.texi (Defining Faces): Move documentation of frame-background-mode to the Emacs manual (Bug#7774). diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2012-07-28 15:12:12 +0000 +++ doc/emacs/ChangeLog 2012-08-05 09:24:55 +0000 @@ -1,3 +1,10 @@ +2012-08-05 Chong Yidong + + * display.texi (Faces): Document frame-background-mode (Bug#7774). + + * custom.texi (Face Customization): Move discussion of face + inheritance here, from Faces section. + 2012-07-21 Eli Zaretskii * frames.texi (Mouse Commands): Fix the description of mouse-2. === modified file 'doc/emacs/custom.texi' --- doc/emacs/custom.texi 2012-07-13 14:25:59 +0000 +++ doc/emacs/custom.texi 2012-08-05 09:24:55 +0000 @@ -450,11 +450,14 @@ specify any special value for the attribute. You can activate a checkbox to specify or unspecify its attribute. - Most faces only specify a few attributes (in the above example, -@code{font-lock-comment-face} only specifies the foreground color). -Emacs has a special face, @code{default}, whose attributes are all -specified; it determines the attributes left unspecified by other -faces. + A face does not have to specify every single attribute; in fact, +most faces only specify a few attributes. In the above example, +@code{font-lock-comment-face} only specifies the foreground color. +Any unspecified attribute is taken from the special face named +@code{default}, whose attributes are all specified. The +@code{default} face is the face used to display any text that does not +have an explicitly-assigned face; furthermore, its background color +attribute serves as the background color of the frame. The @samp{Hide Unused Attributes} button, at the end of the attribute list, hides the unspecified attributes of the face. When === modified file 'doc/emacs/display.texi' --- doc/emacs/display.texi 2012-06-17 05:13:40 +0000 +++ doc/emacs/display.texi 2012-08-05 09:24:55 +0000 @@ -475,18 +475,26 @@ prompts for a regular expression, and displays only faces with names matching that regular expression (@pxref{Regexps}). +@vindex frame-background-mode It's possible for a given face to look different in different frames. For instance, some text terminals do not support all face attributes, particularly font, height, and width, and some support a -limited range of colors. +limited range of colors. In addition, most Emacs faces are defined so +that their attributes are different on light and dark frame +backgrounds, for reasons of legibility. By default, Emacs +automatically chooses which set of face attributes to display on each +frame, based on the frame's current background color. However, you +can override this by giving the variable @code{frame-background-mode} +a non-@code{nil} value. A value of @code{dark} makes Emacs treat all +frames as if they have a dark background, whereas a value of +@code{light} makes it treat all frames as if they have a light +background. @cindex background color @cindex default face - You can customize a face to alter its appearance, and save those -changes for future Emacs sessions. @xref{Face Customization}. A face -does not have to specify every single attribute; often it inherits -most attributes from another face. Any ultimately unspecified -attribute is taken from the face named @code{default}. + You can customize a face to alter its attributes, and save those +customizations for future Emacs sessions. @xref{Face Customization}, +for details. The @code{default} face is the default for displaying text, and all of its attributes are specified. Its background color is also used as === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-08-04 14:33:00 +0000 +++ doc/lispref/ChangeLog 2012-08-05 09:24:55 +0000 @@ -1,3 +1,8 @@ +2012-08-05 Chong Yidong + + * display.texi (Defining Faces): Move documentation of + frame-background-mode to the Emacs manual (Bug#7774). + 2012-08-04 Chong Yidong * syntax.texi (Syntax Basics): Rearrange the text for clarity. === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2012-07-15 00:52:16 +0000 +++ doc/lispref/display.texi 2012-08-05 09:24:55 +0000 @@ -2040,14 +2040,6 @@ specify a face to use. In the vast majority of cases, this is not necessary; it is preferable to simply use faces directly. -@defopt frame-background-mode -This option, if non-@code{nil}, specifies the background type to use for -interpreting face definitions. If it is @code{dark}, then Emacs treats -all frames as if they had a dark background, regardless of their actual -background colors. If it is @code{light}, then Emacs treats all frames -as if they had a light background. -@end defopt - @node Face Attributes @subsection Face Attributes @cindex face attributes ------------------------------------------------------------ revno: 109442 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-08-05 16:52:45 +0800 message: Mark last change as tiny. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-05 08:51:59 +0000 +++ lisp/ChangeLog 2012-08-05 08:52:45 +0000 @@ -1,4 +1,4 @@ -2012-08-05 Vegard Øye +2012-08-05 Vegard Øye (tiny change) * emulation/viper-init.el (viper-deflocalvar): Add docstring and indentation declaration. ------------------------------------------------------------ revno: 109441 fixes bug: http://debbugs.gnu.org/7025 author: Vegard Øye committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-08-05 16:51:59 +0800 message: Add declares for viper-deflocalvar and viper-loop. * lisp/emulation/viper-init.el (viper-deflocalvar): Add docstring and indentation declaration. (viper-loop): Add indentation declaration. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-05 08:41:12 +0000 +++ lisp/ChangeLog 2012-08-05 08:51:59 +0000 @@ -1,3 +1,9 @@ +2012-08-05 Vegard Øye + + * emulation/viper-init.el (viper-deflocalvar): Add docstring and + indentation declaration. + (viper-loop): Add indentation declaration (Bug#7025). + 2012-08-05 Chong Yidong * help-fns.el (describe-variable): Add hyperlink for === modified file 'lisp/emulation/viper-init.el' --- lisp/emulation/viper-init.el 2012-07-29 07:16:45 +0000 +++ lisp/emulation/viper-init.el 2012-08-05 08:51:59 +0000 @@ -96,6 +96,10 @@ ;;; Macros (defmacro viper-deflocalvar (var default-value &optional documentation) + "Define VAR as a buffer-local variable. +DEFAULT-VALUE is the default value, and DOCUMENTATION is the +docstring. The variable becomes buffer-local whenever set." + (declare (indent defun)) `(progn (defvar ,var ,default-value ,(format "%s\n\(buffer local\)" documentation)) @@ -103,6 +107,7 @@ ;; (viper-loop COUNT BODY) Execute BODY COUNT times. (defmacro viper-loop (count &rest body) + (declare (indent defun)) `(let ((count ,count)) (while (> count 0) ,@body ------------------------------------------------------------ revno: 109440 fixes bug: http://debbugs.gnu.org/6644 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-08-05 16:41:12 +0800 message: Improvements to local-variable reporting in `describe-variable'. * lisp/help-fns.el (describe-variable): Add hyperlink for directory-local variables files. Improve buffer-local and permanent-local reporting; suggested by MON KEY. * lisp/help-mode.el (help-dir-local-var-def): New button type. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-05 07:45:12 +0000 +++ lisp/ChangeLog 2012-08-05 08:41:12 +0000 @@ -1,5 +1,11 @@ 2012-08-05 Chong Yidong + * help-fns.el (describe-variable): Add hyperlink for + directory-local variables files. Improve buffer-local and + permanent-local reporting; suggested by MON KEY (Bug#6644). + + * help-mode.el (help-dir-local-var-def): New button type. + * files.el (kill-buffer-hook): Provide a defvar. 2012-08-05 Glenn Morris === modified file 'lisp/help-fns.el' --- lisp/help-fns.el 2012-07-26 01:27:33 +0000 +++ lisp/help-fns.el 2012-08-05 08:41:12 +0000 @@ -713,6 +713,7 @@ (message "You did not specify a variable") (save-excursion (let ((valvoid (not (with-current-buffer buffer (boundp variable)))) + (permanent-local (get variable 'permanent-local)) val val-start-pos locus) ;; Extract the value before setting up the output buffer, ;; in case `buffer' *is* the output buffer. @@ -752,7 +753,6 @@ (princ "value is ") (let ((from (point)) (line-beg (line-beginning-position)) - ;; (print-rep (let ((print-quoted t)) (prin1-to-string val)))) @@ -780,9 +780,7 @@ (when locus (cond ((bufferp locus) - (princ (format "%socal in buffer %s; " - (if (get variable 'permanent-local) - "Permanently l" "L") + (princ (format "Local in buffer %s; " (buffer-name)))) ((framep locus) (princ (format "It is a frame-local variable; "))) @@ -792,20 +790,22 @@ (princ (format "It is local to %S" locus)))) (if (not (default-boundp variable)) (princ "globally void") - (let ((val (default-value variable))) + (let ((global-val (default-value variable))) (with-current-buffer standard-output (princ "global value is ") - (terpri) - ;; Fixme: pp can take an age if you happen to - ;; ask for a very large expression. We should - ;; probably print it raw once and check it's a - ;; sensible size before prettyprinting. -- fx - (let ((from (point))) - (pp val) - ;; See previous comment for this function. - ;; (help-xref-on-pp from (point)) - (if (< (point) (+ from 20)) - (delete-region (1- from) from)))))) + (if (eq val global-val) + (princ "the same.") + (terpri) + ;; Fixme: pp can take an age if you happen to + ;; ask for a very large expression. We should + ;; probably print it raw once and check it's a + ;; sensible size before prettyprinting. -- fx + (let ((from (point))) + (pp global-val) + ;; See previous comment for this function. + ;; (help-xref-on-pp from (point)) + (if (< (point) (+ from 20)) + (delete-region (1- from) from))))))) (terpri)) ;; If the value is large, move it to the end. @@ -846,18 +846,26 @@ alias 'variable-documentation)) (error (format "Doc not found: %S" err)))) (extra-line nil)) - ;; Add a note for variables that have been make-var-buffer-local. - (when (and (local-variable-if-set-p variable) - (or (not (local-variable-p variable)) - (with-temp-buffer - (local-variable-if-set-p variable)))) + + ;; Mention if it's a local variable. + (cond + ((and (local-variable-if-set-p variable) + (or (not (local-variable-p variable)) + (with-temp-buffer + (local-variable-if-set-p variable)))) (setq extra-line t) (princ " Automatically becomes ") - (if (get variable 'permanent-local) + (if permanent-local (princ "permanently ")) (princ "buffer-local when set.\n")) + ((not permanent-local)) + ((bufferp locus) + (princ " This variable's buffer-local value is permanent.\n")) + (t + (princ " This variable's value is permanent \ +if it is given a local binding.\n"))) - ;; Mention if it's an alias + ;; Mention if it's an alias. (unless (eq alias variable) (setq extra-line t) (princ (format " This variable is an alias for `%s'.\n" alias))) @@ -879,9 +887,11 @@ (not (file-remote-p (buffer-file-name))) (dir-locals-find-file (buffer-file-name)))) - (type "file")) - (princ " This variable is a directory local variable") - (when file + (dir-file t)) + (princ " This variable's value is directory-local") + (if (null file) + (princ ".\n") + (princ ", set ") (if (consp file) ; result from cache ;; If the cache element has an mtime, we ;; assume it came from a file. @@ -889,21 +899,27 @@ (setq file (expand-file-name dir-locals-file (car file))) ;; Otherwise, assume it was set directly. - (setq type "directory"))) - (princ (format "\n from the %s \"%s\"" type file))) - (princ ".\n")) - (princ " This variable is a file local variable.\n"))) + (setq dir-file nil))) + (princ (if dir-file + "by the file\n `" + "for the directory\n `")) + (with-current-buffer standard-output + (insert-text-button + file 'type 'help-dir-local-var-def + 'help-args (list variable file))) + (princ "'.\n"))) + (princ " This variable's value is file-local.\n"))) (when (memq variable ignored-local-variables) (setq extra-line t) - (princ " This variable is ignored when used as a file local \ + (princ " This variable is ignored as a file-local \ variable.\n")) ;; Can be both risky and safe, eg auto-fill-function. (when (risky-local-variable-p variable) (setq extra-line t) - (princ " This variable is potentially risky when used as a \ -file local variable.\n") + (princ " This variable may be risky if used as a \ +file-local variable.\n") (when (assq variable safe-local-variable-values) (princ " However, you have added it to \ `safe-local-variable-values'.\n"))) === modified file 'lisp/help-mode.el' --- lisp/help-mode.el 2012-07-13 07:06:09 +0000 +++ lisp/help-mode.el 2012-08-05 08:41:12 +0000 @@ -265,6 +265,15 @@ :supertype 'help-xref 'help-function 'customize-create-theme 'help-echo (purecopy "mouse-2, RET: edit this theme file")) + +(define-button-type 'help-dir-local-var-def + :supertype 'help-xref + 'help-function (lambda (var &optional file) + ;; FIXME: this should go to the point where the + ;; local variable was defined. + (find-file file)) + 'help-echo (purecopy "mouse-2, RET: open directory-local variables file")) + (defvar bookmark-make-record-function) ------------------------------------------------------------ revno: 109439 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-08-05 15:45:12 +0800 message: Docfix for kill-buffer-hook and others. * lisp/files.el (kill-buffer-hook): Provide a defvar. * src/term.c (Vsuspend_tty_functions, Vresume_tty_functions): * src/frame.c (Vdelete_frame_functions): * src/emacs.c (Vkill_emacs_hook): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-05 05:24:50 +0000 +++ lisp/ChangeLog 2012-08-05 07:45:12 +0000 @@ -1,3 +1,7 @@ +2012-08-05 Chong Yidong + + * files.el (kill-buffer-hook): Provide a defvar. + 2012-08-05 Glenn Morris * eshell/esh-ext.el (eshell/addpath): === modified file 'lisp/files.el' --- lisp/files.el 2012-08-05 03:03:31 +0000 +++ lisp/files.el 2012-08-05 07:45:12 +0000 @@ -1514,7 +1514,11 @@ (other-window 1) (find-alternate-file filename wildcards)))) -(defvar kill-buffer-hook) ; from buffer.c +;; Defined and used in buffer.c, but not as a DEFVAR_LISP. +(defvar kill-buffer-hook nil + "Hook run when a buffer is killed. +The buffer being killed is current while the hook is running. +See `kill-buffer'.") (defun find-alternate-file (filename &optional wildcards) "Find file FILENAME, select its buffer, kill previous buffer. === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-04 14:36:36 +0000 +++ src/ChangeLog 2012-08-05 07:45:12 +0000 @@ -1,3 +1,9 @@ +2012-08-05 Chong Yidong + + * term.c (Vsuspend_tty_functions, Vresume_tty_functions): + * frame.c (Vdelete_frame_functions): + * emacs.c (Vkill_emacs_hook): Doc fix. + 2012-08-04 Eli Zaretskii * xfns.c (x_set_menu_bar_lines): Fix compilation error in === modified file 'src/emacs.c' --- src/emacs.c 2012-08-04 14:17:10 +0000 +++ src/emacs.c 2012-08-05 07:45:12 +0000 @@ -2424,7 +2424,7 @@ doc: /* Non-nil means Emacs is running without interactive terminal. */); DEFVAR_LISP ("kill-emacs-hook", Vkill_emacs_hook, - doc: /* Hook to be run when `kill-emacs' is called. + doc: /* Hook run when `kill-emacs' is called. Since `kill-emacs' may be invoked when the terminal is disconnected (or in other similar situations), functions placed on this hook should not expect to be able to interact with the user. To ask for confirmation, === modified file 'src/frame.c' --- src/frame.c 2012-08-03 23:36:11 +0000 +++ src/frame.c 2012-08-05 07:45:12 +0000 @@ -4351,7 +4351,7 @@ Vmake_pointer_invisible = Qt; DEFVAR_LISP ("delete-frame-functions", Vdelete_frame_functions, - doc: /* Functions to be run before deleting a frame. + doc: /* Functions run before deleting a frame. The functions are run with one arg, the frame to be deleted. See `delete-frame'. === modified file 'src/term.c' --- src/term.c 2012-07-31 12:36:19 +0000 +++ src/term.c 2012-08-05 07:45:12 +0000 @@ -3571,14 +3571,14 @@ #endif DEFVAR_LISP ("suspend-tty-functions", Vsuspend_tty_functions, - doc: /* Functions to be run after suspending a tty. + doc: /* Functions run after suspending a tty. The functions are run with one argument, the terminal object to be suspended. See `suspend-tty'. */); Vsuspend_tty_functions = Qnil; DEFVAR_LISP ("resume-tty-functions", Vresume_tty_functions, - doc: /* Functions to be run after resuming a tty. + doc: /* Functions run after resuming a tty. The functions are run with one argument, the terminal object that was revived. See `resume-tty'. */); Vresume_tty_functions = Qnil; ------------------------------------------------------------ revno: 109438 fixes bug: http://debbugs.gnu.org/12013 committer: Glenn Morris branch nick: trunk timestamp: Sat 2012-08-04 22:24:50 -0700 message: * lisp/eshell/esh-ext.el (eshell/addpath): Also update eshell-path-env. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-05 04:19:21 +0000 +++ lisp/ChangeLog 2012-08-05 05:24:50 +0000 @@ -1,7 +1,11 @@ +2012-08-05 Glenn Morris + + * eshell/esh-ext.el (eshell/addpath): + Also update eshell-path-env. (Bug#12013) + 2012-08-05 Chong Yidong - * wdired.el (wdired-mode, wdired-change-to-wdired-mode): Doc - fixes. + * wdired.el (wdired-mode, wdired-change-to-wdired-mode): Doc fixes. * fringe.el (fringe-styles): Add docstring. (fringe--check-mode): New function. === modified file 'lisp/eshell/esh-ext.el' --- lisp/eshell/esh-ext.el 2012-07-11 23:13:41 +0000 +++ lisp/eshell/esh-ext.el 2012-08-05 05:24:50 +0000 @@ -235,7 +235,8 @@ (getenv "PATH")) (concat (getenv "PATH") path-separator (car args)))) - (setq args (cdr args)))) + (setq args (cdr args))) + (setq eshell-path-env (getenv "PATH"))) (let ((paths (parse-colon-path (getenv "PATH")))) (while paths (eshell-printn (car paths))