------------------------------------------------------------ revno: 115281 fixes bug: http://debbugs.gnu.org/15913 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2013-11-29 10:53:50 +0200 message: More thorough fix of bug #15913 with mouse-highlight on MS-Windows. src/xdisp.c (clear_mouse_face): Don't invalidate the entire mouse-highlight info, just signal frame_up_to_date_hook that mouse highlight needs to be redisplayed. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-29 05:25:25 +0000 +++ src/ChangeLog 2013-11-29 08:53:50 +0000 @@ -1,3 +1,9 @@ +2013-11-29 Eli Zaretskii + + * xdisp.c (clear_mouse_face): Don't invalidate the entire + mouse-highlight info, just signal frame_up_to_date_hook that mouse + highlight needs to be redisplayed. (Bug#15913) + 2013-11-29 Paul Eggert Fix minor problems found by static checking. === modified file 'src/xdisp.c' --- src/xdisp.c 2013-11-29 05:25:25 +0000 +++ src/xdisp.c 2013-11-29 08:53:50 +0000 @@ -26883,7 +26883,10 @@ cleared = 1; } - reset_mouse_highlight (hlinfo); + hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; + hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; + hlinfo->mouse_face_window = Qnil; + hlinfo->mouse_face_overlay = Qnil; return cleared; } ------------------------------------------------------------ revno: 115280 committer: Paul Eggert branch nick: trunk timestamp: Thu 2013-11-28 21:25:25 -0800 message: Fix minor problems found by static checking. * buffer.h (struct buffer_text, struct buffer): * frame.h (struct frame): * window.h (struct window): Avoid 'bool foo : 1;', as it's not portable to pre-C99 compilers, as described in ../lib/stdbool.in.h. Use 'unsigned foo : 1;' instead. * menu.c (syms_of_menu): Define x-popup-dialog, removing a no-longer-valid use of HAVE_MENUS. * xdisp.c (propagate_buffer_redisplay): Now static. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-29 01:22:40 +0000 +++ src/ChangeLog 2013-11-29 05:25:25 +0000 @@ -1,3 +1,15 @@ +2013-11-29 Paul Eggert + + Fix minor problems found by static checking. + * buffer.h (struct buffer_text, struct buffer): + * frame.h (struct frame): + * window.h (struct window): + Avoid 'bool foo : 1;', as it's not portable to pre-C99 compilers, + as described in ../lib/stdbool.in.h. Use 'unsigned foo : 1;' instead. + * menu.c (syms_of_menu): Define x-popup-dialog, removing a + no-longer-valid use of HAVE_MENUS. + * xdisp.c (propagate_buffer_redisplay): Now static. + 2013-11-29 Stefan Monnier * xmenu.c (Fmenu_or_popup_active_p): === modified file 'src/buffer.h' --- src/buffer.h 2013-11-28 22:43:09 +0000 +++ src/buffer.h 2013-11-29 05:25:25 +0000 @@ -475,10 +475,10 @@ /* Usually 0. Temporarily set to 1 in decode_coding_gap to prevent Fgarbage_collect from shrinking the gap and losing not-yet-decoded bytes. */ - bool inhibit_shrinking : 1; + unsigned inhibit_shrinking : 1; /* True if it needs to be redisplayed. */ - bool redisplay : 1; + unsigned redisplay : 1; }; /* Most code should use this macro to access Lisp fields in struct buffer. */ @@ -849,10 +849,10 @@ /* Non-zero means don't use redisplay optimizations for displaying this buffer. */ - bool prevent_redisplay_optimizations_p : 1; + unsigned prevent_redisplay_optimizations_p : 1; /* Non-zero whenever the narrowing is changed in this buffer. */ - bool clip_changed : 1; + unsigned clip_changed : 1; /* List of overlays that end at or before the current center, in order of end-position. */ === modified file 'src/frame.h' --- src/frame.h 2013-11-28 22:43:09 +0000 +++ src/frame.h 2013-11-29 05:25:25 +0000 @@ -178,44 +178,44 @@ /* 1 means that glyphs on this frame have been initialized so it can be used for output. */ - bool glyphs_initialized_p : 1; + unsigned glyphs_initialized_p : 1; /* Set to non-zero in change_frame_size when size of frame changed Clear the frame in clear_garbaged_frames if set. */ - bool resized_p : 1; + unsigned resized_p : 1; /* Set to non-zero if the default face for the frame has been realized. Reset to zero whenever the default face changes. Used to see the difference between a font change and face change. */ - bool default_face_done_p : 1; + unsigned default_face_done_p : 1; /* Set to non-zero if this frame has already been hscrolled during current redisplay. */ - bool already_hscrolled_p : 1; + unsigned already_hscrolled_p : 1; /* Set to non-zero when current redisplay has updated frame. */ - bool updated_p : 1; + unsigned updated_p : 1; #if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS) /* Set to non-zero to minimize tool-bar height even when auto-resize-tool-bar is set to grow-only. */ - bool minimize_tool_bar_window_p : 1; + unsigned minimize_tool_bar_window_p : 1; #endif #if defined (USE_GTK) || defined (HAVE_NS) /* Nonzero means using a tool bar that comes from the toolkit. */ - bool external_tool_bar : 1; + unsigned external_tool_bar : 1; #endif /* Nonzero means that fonts have been loaded since the last glyph matrix adjustments. */ - bool fonts_changed : 1; + unsigned fonts_changed : 1; /* Nonzero means that cursor type has been changed. */ - bool cursor_type_changed : 1; + unsigned cursor_type_changed : 1; /* True if it needs to be redisplayed. */ - bool redisplay : 1; + unsigned redisplay : 1; /* Margin at the top of the frame. Used to display the tool-bar. */ int tool_bar_lines; @@ -330,7 +330,7 @@ #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \ || defined (HAVE_NS) || defined (USE_GTK) /* Nonzero means using a menu bar that comes from the X toolkit. */ - bool external_menu_bar : 1; + unsigned external_menu_bar : 1; #endif /* Next two bitfields are mutually exclusive. They might both be @@ -349,43 +349,43 @@ /* Nonzero if the frame is currently iconified. Do not set this directly, use SET_FRAME_ICONIFIED instead. */ - bool iconified : 1; + unsigned iconified : 1; /* Nonzero if this frame should be redrawn. */ - bool garbaged : 1; + unsigned garbaged : 1; /* 0 means, if this frame has just one window, show no modeline for that window. */ - bool wants_modeline : 1; + unsigned wants_modeline : 1; /* Non-0 means raise this frame to the top of the heap when selected. */ - bool auto_raise : 1; + unsigned auto_raise : 1; /* Non-0 means lower this frame to the bottom of the stack when left. */ - bool auto_lower : 1; + unsigned auto_lower : 1; /* True if frame's root window can't be split. */ - bool no_split : 1; + unsigned no_split : 1; /* If this is set, then Emacs won't change the frame name to indicate the current buffer, etcetera. If the user explicitly sets the frame name, this gets set. If the user sets the name to Qnil, this is cleared. */ - bool explicit_name : 1; + unsigned explicit_name : 1; /* Nonzero if size of some window on this frame has changed. */ - bool window_sizes_changed : 1; + unsigned window_sizes_changed : 1; /* Nonzero if the mouse has moved on this display device since the last time we checked. */ - bool mouse_moved : 1; + unsigned mouse_moved : 1; /* Nonzero means that the pointer is invisible. */ - bool pointer_invisible : 1; + unsigned pointer_invisible : 1; /* Nonzero means that all windows except mini-window and selected window on this frame have frozen window starts. */ - bool frozen_window_starts : 1; + unsigned frozen_window_starts : 1; /* Nonzero if we should actually display the scroll bars on this frame. */ enum vertical_scroll_bar_type vertical_scroll_bar_type; === modified file 'src/menu.c' --- src/menu.c 2013-11-29 01:22:40 +0000 +++ src/menu.c 2013-11-29 05:25:25 +0000 @@ -1606,9 +1606,6 @@ menu_items_inuse = Qnil; defsubr (&Sx_popup_menu); - -#ifdef HAVE_MENUS defsubr (&Sx_popup_dialog); -#endif defsubr (&Smenu_bar_menu_at_x_y); } === modified file 'src/window.h' --- src/window.h 2013-11-28 22:43:09 +0000 +++ src/window.h 2013-11-29 05:25:25 +0000 @@ -282,63 +282,63 @@ int window_end_vpos; /* Non-zero if this window is a minibuffer window. */ - bool mini : 1; + unsigned mini : 1; /* Meaningful only if contents is a window, non-zero if this internal window is used in horizontal combination. */ - bool horizontal : 1; + unsigned horizontal : 1; /* Non-zero means must regenerate mode line of this window. */ - bool update_mode_line : 1; + unsigned update_mode_line : 1; /* Non-nil if the buffer was "modified" when the window was last updated. */ - bool last_had_star : 1; + unsigned last_had_star : 1; /* Non-zero means current value of `start' was the beginning of a line when it was chosen. */ - bool start_at_line_beg : 1; + unsigned start_at_line_beg : 1; /* Non-zero means next redisplay must use the value of start set up for it in advance. Set by scrolling commands. */ - bool force_start : 1; + unsigned force_start : 1; /* Non-zero means we have explicitly changed the value of start, but that the next redisplay is not obliged to use the new value. This is used in Fdelete_other_windows to force a call to Vwindow_scroll_functions; also by Frecenter with argument. */ - bool optional_new_start : 1; + unsigned optional_new_start : 1; /* Non-zero means the cursor is currently displayed. This can be set to zero by functions overpainting the cursor image. */ - bool phys_cursor_on_p : 1; + unsigned phys_cursor_on_p : 1; /* 0 means cursor is logically on, 1 means it's off. Used for blinking cursor. */ - bool cursor_off_p : 1; + unsigned cursor_off_p : 1; /* Value of cursor_off_p as of the last redisplay. */ - bool last_cursor_off_p : 1; + unsigned last_cursor_off_p : 1; /* 1 means desired matrix has been build and window must be updated in update_frame. */ - bool must_be_updated_p : 1; + unsigned must_be_updated_p : 1; /* Flag indicating that this window is not a real one. Currently only used for menu bar windows of frames. */ - bool pseudo_window_p : 1; + unsigned pseudo_window_p : 1; /* Non-zero means fringes are drawn outside display margins. Otherwise draw them between margin areas and text. */ - bool fringes_outside_margins : 1; + unsigned fringes_outside_margins : 1; /* Nonzero if window_end_pos and window_end_vpos are truly valid. This is zero if nontrivial redisplay is preempted since in that case the frame image that window_end_pos did not get onto the frame. */ - bool window_end_valid : 1; + unsigned window_end_valid : 1; /* True if it needs to be redisplayed. */ - bool redisplay : 1; + unsigned redisplay : 1; /* Amount by which lines of this window are scrolled in y-direction (smooth scrolling). */ @@ -347,7 +347,7 @@ /* Z_BYTE - buffer position of the last glyph in the current matrix of W. Should be nonnegative, and only valid if window_end_valid is nonzero. */ ptrdiff_t window_end_bytepos; -}; + }; /* Most code should use these functions to set Lisp fields in struct window. */ === modified file 'src/xdisp.c' --- src/xdisp.c 2013-11-29 01:22:40 +0000 +++ src/xdisp.c 2013-11-29 05:25:25 +0000 @@ -610,25 +610,29 @@ /* Functions to mark elements as needing redisplay. */ enum { REDISPLAY_SOME = 2}; /* Arbitrary choice. */ -void redisplay_other_windows (void) +void +redisplay_other_windows (void) { if (!windows_or_buffers_changed) windows_or_buffers_changed = REDISPLAY_SOME; } -void wset_redisplay (struct window *w) +void +wset_redisplay (struct window *w) { redisplay_other_windows (); w->redisplay = true; } -void fset_redisplay (struct frame *f) +void +fset_redisplay (struct frame *f) { redisplay_other_windows (); f->redisplay = true; } -void bset_redisplay (struct buffer *b) +void +bset_redisplay (struct buffer *b) { int count = buffer_window_count (b); if (count > 0) @@ -643,7 +647,8 @@ } } -extern void bset_update_mode_line (struct buffer *b) +void +bset_update_mode_line (struct buffer *b) { if (!update_mode_lines) update_mode_lines = REDISPLAY_SOME; @@ -11201,11 +11206,10 @@ prepare_menu_bars (void) { bool all_windows = windows_or_buffers_changed || update_mode_lines; - bool some_windows - = (windows_or_buffers_changed == 0 - || windows_or_buffers_changed == REDISPLAY_SOME) - && (update_mode_lines == 0 - || update_mode_lines == REDISPLAY_SOME); + bool some_windows = ((windows_or_buffers_changed == 0 + || windows_or_buffers_changed == REDISPLAY_SOME) + && (update_mode_lines == 0 + || update_mode_lines == REDISPLAY_SOME)); struct gcpro gcpro1, gcpro2; Lisp_Object tooltip_frame; @@ -12922,7 +12926,8 @@ } } -void propagate_buffer_redisplay (void) +static void +propagate_buffer_redisplay (void) { /* Resetting b->text->redisplay is problematic! We can't just reset it in the case that some window that displays it has not been redisplayed; and such a window can stay ------------------------------------------------------------ revno: 115279 fixes bug: http://debbugs.gnu.org/14029 author: Andreas Politz committer: Dmitry Gutov branch nick: trunk timestamp: Fri 2013-11-29 05:38:20 +0200 message: * doc/lispref/modes.texi (Imenu): Make it clear that sub-alist is the cdr. * lisp/imenu.el (imenu--subalist-p): Don't error on non-conses and allow non-lambda lists as functions. (imenu--in-alist): Don't recurse into non-subalists. (imenu): Don't pass function itself as an argument. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-11-27 06:15:06 +0000 +++ doc/lispref/ChangeLog 2013-11-29 03:38:20 +0000 @@ -1,3 +1,8 @@ +2013-11-29 Andreas Politz + + * modes.texi (Imenu): Make it clear that sub-alist is the cdr + (Bug#14029). + 2013-11-27 Glenn Morris * loading.texi (Library Search): === modified file 'doc/lispref/modes.texi' --- doc/lispref/modes.texi 2013-08-17 11:14:10 +0000 +++ doc/lispref/modes.texi 2013-11-29 03:38:20 +0000 @@ -2483,7 +2483,7 @@ A nested sub-alist element looks like this: @example -(@var{menu-title} @var{sub-alist}) +(@var{menu-title} . @var{sub-alist}) @end example It creates the submenu @var{menu-title} specified by @var{sub-alist}. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-29 02:03:39 +0000 +++ lisp/ChangeLog 2013-11-29 03:38:20 +0000 @@ -1,3 +1,9 @@ +2013-11-29 Andreas Politz + * imenu.el (imenu--subalist-p): Don't error on non-conses and + allow non-lambda lists as functions. + (imenu--in-alist): Don't recurse into non-subalists. + (imenu): Don't pass function itself as an argument (Bug#14029). + 2013-11-29 Stefan Monnier * progmodes/python.el (python-mode-map): Remove binding for ":". === modified file 'lisp/imenu.el' --- lisp/imenu.el 2013-11-24 21:23:47 +0000 +++ lisp/imenu.el 2013-11-29 03:38:20 +0000 @@ -293,8 +293,10 @@ (defun imenu--subalist-p (item) - (and (consp (cdr item)) (listp (cadr item)) - (not (eq (car (cadr item)) 'lambda)))) + (and (consp item) + (consp (cdr item)) + (listp (cadr item)) + (not (functionp (cadr item))))) (defmacro imenu-progress-message (_prevpos &optional _relpos _reverse) "Macro to display a progress message. @@ -645,9 +647,11 @@ ;; (INDEX-NAME (INDEX-NAME . INDEX-POSITION) ...) ;; while a bottom-level element looks like ;; (INDEX-NAME . INDEX-POSITION) + ;; or + ;; (INDEX-NAME INDEX-POSITION FUNCTION ARGUMENTS...) ;; We are only interested in the bottom-level elements, so we need to - ;; recurse if TAIL is a list. - (cond ((listp tail) + ;; recurse if TAIL is a nested ALIST. + (cond ((imenu--subalist-p elt) (if (setq res (imenu--in-alist str tail)) (setq alist nil))) ((if imenu-name-lookup-function @@ -1033,8 +1037,8 @@ (nth 2 index-item) imenu-default-goto-function)) (position (if is-special-item (cadr index-item) (cdr index-item))) - (rest (if is-special-item (cddr index-item)))) - (apply function (car index-item) position rest)) + (args (if is-special-item (cdr (cddr index-item))))) + (apply function (car index-item) position args)) (run-hooks 'imenu-after-jump-hook))) (provide 'imenu) ------------------------------------------------------------ revno: 115278 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-11-28 21:03:39 -0500 message: * lisp/progmodes/python.el (python-mode-map): Remove binding for ":". (python-indent-electric-colon): Remove command. (python-indent-post-self-insert-function): Integrate the previous code of python-indent-electric-colon. Make it conditional on electric-indent-mode. (python-mode): Add ?: to electric-indent-chars. Move python-indent-post-self-insert-function to the end of post-self-insert-hook. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-28 22:43:09 +0000 +++ lisp/ChangeLog 2013-11-29 02:03:39 +0000 @@ -1,3 +1,14 @@ +2013-11-29 Stefan Monnier + + * progmodes/python.el (python-mode-map): Remove binding for ":". + (python-indent-electric-colon): Remove command. + (python-indent-post-self-insert-function): Integrate the previous code + of python-indent-electric-colon. Make it conditional on + electric-indent-mode. + (python-mode): Add ?: to electric-indent-chars. + Move python-indent-post-self-insert-function to the end of + post-self-insert-hook. + 2013-11-28 Stefan Monnier * doc-view.el (doc-view-goto-page): Update mode-line. === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2013-11-26 03:15:49 +0000 +++ lisp/progmodes/python.el 2013-11-29 02:03:39 +0000 @@ -40,9 +40,9 @@ ;; Indentation: Automatic indentation with indentation cycling is ;; provided, it allows you to navigate different available levels of -;; indentation by hitting several times. Also when inserting a -;; colon the `python-indent-electric-colon' command is invoked and -;; causes the current line to be dedented automatically if needed. +;; indentation by hitting several times. Also electric-indent-mode +;; is supported such that when inserting a colon the current line is +;; dedented automatically if needed. ;; Movement: `beginning-of-defun' and `end-of-defun' functions are ;; properly implemented. There are also specialized @@ -248,7 +248,6 @@ (define-key map (kbd "") 'python-indent-dedent-line) (define-key map "\C-c<" 'python-indent-shift-left) (define-key map "\C-c>" 'python-indent-shift-right) - (define-key map ":" 'python-indent-electric-colon) ;; Skeletons (define-key map "\C-c\C-tc" 'python-skeleton-class) (define-key map "\C-c\C-td" 'python-skeleton-def) @@ -1058,48 +1057,43 @@ (list (region-beginning) (region-end) current-prefix-arg) (list (line-beginning-position) (line-end-position) current-prefix-arg))) (let ((deactivate-mark nil)) - (if count - (setq count (prefix-numeric-value count)) - (setq count python-indent-offset)) + (setq count (if count (prefix-numeric-value count) + python-indent-offset)) (indent-rigidly start end count))) -(defun python-indent-electric-colon (arg) - "Insert a colon and maybe de-indent the current line. -With numeric ARG, just insert that many colons. With -\\[universal-argument], just insert a single colon." - (interactive "*P") - (self-insert-command (if (not (integerp arg)) 1 arg)) - (when (and (not arg) - (eolp) - (not (equal ?: (char-after (- (point-marker) 2)))) - (not (python-syntax-comment-or-string-p))) - (let ((indentation (current-indentation)) - (calculated-indentation (python-indent-calculate-indentation))) - (python-info-closing-block-message) - (when (> indentation calculated-indentation) - (save-excursion - (indent-line-to calculated-indentation) - (when (not (python-info-closing-block-message)) - (indent-line-to indentation))))))) -(put 'python-indent-electric-colon 'delete-selection t) - (defun python-indent-post-self-insert-function () - "Adjust closing paren line indentation after a char is added. + "Adjust indentation after insertion of some characters. This function is intended to be added to the `post-self-insert-hook.' If a line renders a paren alone, after adding a char before it, the line will be re-indented automatically if needed." - (when (and (eq (char-before) last-command-event) - (not (bolp)) - (memq (char-after) '(?\) ?\] ?\}))) - (save-excursion - (goto-char (line-beginning-position)) - ;; If after going to the beginning of line the point - ;; is still inside a paren it's ok to do the trick - (when (python-syntax-context 'paren) - (let ((indentation (python-indent-calculate-indentation))) - (when (< (current-indentation) indentation) - (indent-line-to indentation))))))) + (when (and electric-indent-mode + (eq (char-before) last-command-event)) + (cond + ((and (not (bolp)) + (memq (char-after) '(?\) ?\] ?\}))) + (save-excursion + (goto-char (line-beginning-position)) + ;; If after going to the beginning of line the point + ;; is still inside a paren it's ok to do the trick + (when (python-syntax-context 'paren) + (let ((indentation (python-indent-calculate-indentation))) + (when (< (current-indentation) indentation) + (indent-line-to indentation)))))) + ((and (eq ?: last-command-event) + (memq ?: electric-indent-chars) + (not current-prefix-arg) + (eolp) + (not (equal ?: (char-before (1- (point))))) + (not (python-syntax-comment-or-string-p))) + (let ((indentation (current-indentation)) + (calculated-indentation (python-indent-calculate-indentation))) + (python-info-closing-block-message) + (when (> indentation calculated-indentation) + (save-excursion + (indent-line-to calculated-indentation) + (when (not (python-info-closing-block-message)) + (indent-line-to indentation))))))))) ;;; Navigation @@ -3619,6 +3613,7 @@ (set (make-local-variable 'indent-region-function) #'python-indent-region) ;; Because indentation is not redundant, we cannot safely reindent code. (setq-local electric-indent-inhibit t) + (setq-local electric-indent-chars (cons ?: electric-indent-chars)) ;; Add """ ... """ pairing to electric-pair-mode. (add-hook 'post-self-insert-hook @@ -3626,7 +3621,7 @@ (set (make-local-variable 'paragraph-start) "\\s-*$") (set (make-local-variable 'fill-paragraph-function) - 'python-fill-paragraph) + #'python-fill-paragraph) (set (make-local-variable 'beginning-of-defun-function) #'python-nav-beginning-of-defun) @@ -3634,10 +3629,10 @@ #'python-nav-end-of-defun) (add-hook 'completion-at-point-functions - 'python-completion-complete-at-point nil 'local) + #'python-completion-complete-at-point nil 'local) (add-hook 'post-self-insert-hook - 'python-indent-post-self-insert-function nil 'local) + #'python-indent-post-self-insert-function 'append 'local) (set (make-local-variable 'imenu-create-index-function) #'python-imenu-create-index) ------------------------------------------------------------ revno: 115277 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-11-28 20:22:40 -0500 message: * configure.ac (HAVE_MENUS): Remove. * src/xmenu.c (Fmenu_or_popup_active_p): * src/window.c (Fset_window_configuration): * src/menu.c (Fx_popup_menu, Fx_popup_dialog): * src/keyboard.c (record_menu_key, read_char_x_menu_prompt): * src/fns.c (Fyes_or_no_p): * src/editfns.c (Fmessage_box, Fmessage_or_box): * src/alloc.c (make_save_ptr_ptr): * src/xdisp.c, src/w32menu.c, src/term.c, src/xterm.h, src/xterm.c: Remove HAVE_MENUS. diff: === modified file 'ChangeLog' --- ChangeLog 2013-11-28 23:50:09 +0000 +++ ChangeLog 2013-11-29 01:22:40 +0000 @@ -1,3 +1,7 @@ +2013-11-29 Stefan Monnier + + * configure.ac (HAVE_MENUS): Remove. + 2013-11-28 Glenn Morris * configure.ac (PATH_SEP): Replace with pre-existing SEPCHAR. === modified file 'configure.ac' --- configure.ac 2013-11-28 23:50:09 +0000 +++ configure.ac 2013-11-29 01:22:40 +0000 @@ -1866,9 +1866,6 @@ fi fi -### We always support menus. -HAVE_MENUS=yes - # Does the opsystem file prohibit the use of the GNU malloc? # Assume not, until told otherwise. GNU_MALLOC=yes @@ -4620,8 +4617,7 @@ fi AC_SUBST(LIBX_OTHER) -if test "$HAVE_GTK" = yes || - test "$HAVE_MENUS" != yes || test "$HAVE_X11" != yes; then +if test "$HAVE_GTK" = yes || test "$HAVE_X11" != yes; then LIBXMENU= elif test "$USE_X_TOOLKIT" = none; then LIBXMENU='$(oldXMenudir)/libXMenu11.a' @@ -4630,11 +4626,6 @@ fi AC_SUBST(LIBXMENU) -if test "${HAVE_MENUS}" = "yes" ; then - AC_DEFINE(HAVE_MENUS, 1, - [Define to 1 if you have mouse menus. (This is supported in all configurations, but the option to specify it remains.)]) -fi - if test "${GNU_MALLOC}" = "yes" ; then AC_DEFINE(GNU_MALLOC, 1, [Define to 1 if you want to use the GNU memory allocator.]) === modified file 'nt/inc/ms-w32.h' --- nt/inc/ms-w32.h 2013-10-14 16:23:10 +0000 +++ nt/inc/ms-w32.h 2013-11-29 01:22:40 +0000 @@ -156,9 +156,6 @@ # ifndef HAVE_WINDOW_SYSTEM # define HAVE_WINDOW_SYSTEM 1 # endif -# ifndef HAVE_MENUS -# define HAVE_MENUS 1 -# endif #endif /* Get some redefinitions in place. */ @@ -176,7 +173,7 @@ extern struct tm * sys_localtime (const time_t *); /* MinGW64 uses a 2-argument _setjmp, and setjmp is a macro defined to supply the 2nd arg correctly, so don't use _setjmp directly in that - case. */ + case. */ #undef HAVE__SETJMP #endif === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-29 01:14:01 +0000 +++ src/ChangeLog 2013-11-29 01:22:40 +0000 @@ -1,5 +1,14 @@ 2013-11-29 Stefan Monnier + * xmenu.c (Fmenu_or_popup_active_p): + * window.c (Fset_window_configuration): + * menu.c (Fx_popup_menu, Fx_popup_dialog): + * keyboard.c (record_menu_key, read_char_x_menu_prompt): + * fns.c (Fyes_or_no_p): + * editfns.c (Fmessage_box, Fmessage_or_box): + * alloc.c (make_save_ptr_ptr): + * xdisp.c, w32menu.c, term.c, xterm.h, xterm.c: Remove HAVE_MENUS. + * window.c (Fset_window_configuration): Move select_window later. 2013-11-28 Stefan Monnier === modified file 'src/alloc.c' --- src/alloc.c 2013-11-28 22:43:09 +0000 +++ src/alloc.c 2013-11-29 01:22:40 +0000 @@ -3477,7 +3477,7 @@ return val; } -#if defined HAVE_MENUS && ! (defined USE_X_TOOLKIT || defined USE_GTK) +#if ! (defined USE_X_TOOLKIT || defined USE_GTK) Lisp_Object make_save_ptr_ptr (void *a, void *b) { === modified file 'src/editfns.c' --- src/editfns.c 2013-11-24 18:28:33 +0000 +++ src/editfns.c 2013-11-29 01:22:40 +0000 @@ -3473,7 +3473,6 @@ else { Lisp_Object val = Fformat (nargs, args); -#ifdef HAVE_MENUS Lisp_Object pane, menu; struct gcpro gcpro1; @@ -3482,9 +3481,6 @@ menu = Fcons (val, pane); Fx_popup_dialog (Qt, menu, Qt); UNGCPRO; -#else /* !HAVE_MENUS */ - message3 (val); -#endif return val; } } @@ -3503,11 +3499,9 @@ usage: (message-or-box FORMAT-STRING &rest ARGS) */) (ptrdiff_t nargs, Lisp_Object *args) { -#ifdef HAVE_MENUS if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) && use_dialog_box) return Fmessage_box (nargs, args); -#endif return Fmessage (nargs, args); } === modified file 'src/fns.c' --- src/fns.c 2013-11-14 02:39:28 +0000 +++ src/fns.c 2013-11-29 01:22:40 +0000 @@ -35,11 +35,9 @@ #include "frame.h" #include "window.h" #include "blockinput.h" -#ifdef HAVE_MENUS #if defined (HAVE_X_WINDOWS) #include "xterm.h" #endif -#endif /* HAVE_MENUS */ Lisp_Object Qstring_lessp; static Lisp_Object Qprovide, Qrequire; @@ -2416,7 +2414,6 @@ CHECK_STRING (prompt); -#ifdef HAVE_MENUS if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) && use_dialog_box) { @@ -2430,7 +2427,6 @@ UNGCPRO; return obj; } -#endif /* HAVE_MENUS */ args[0] = prompt; args[1] = build_string ("(yes or no) "); === modified file 'src/keyboard.c' --- src/keyboard.c 2013-11-24 18:28:33 +0000 +++ src/keyboard.c 2013-11-29 01:22:40 +0000 @@ -3222,8 +3222,6 @@ RETURN_UNGCPRO (c); } -#ifdef HAVE_MENUS - /* Record a key that came from a mouse menu. Record it for echoing, for this-command-keys, and so on. */ @@ -3254,13 +3252,11 @@ /* Record this character as part of the current key. */ add_command_key (c); - /* Re-reading in the middle of a command */ + /* Re-reading in the middle of a command. */ last_input_event = c; num_input_events++; } -#endif /* HAVE_MENUS */ - /* Return true if should recognize C as "the help character". */ static bool @@ -8359,7 +8355,6 @@ if (! menu_prompting) return Qnil; -#ifdef HAVE_MENUS /* If we got to this point via a mouse click, use a real menu for mouse selection. */ if (EVENT_HAS_PARAMETERS (prev_event) @@ -8405,7 +8400,6 @@ *used_mouse_menu = 1; return value; } -#endif /* HAVE_MENUS */ return Qnil ; } === modified file 'src/menu.c' --- src/menu.c 2013-10-16 15:07:36 +0000 +++ src/menu.c 2013-11-29 01:22:40 +0000 @@ -1178,7 +1178,6 @@ keybinding equivalents, but we don't do that any more anyway. */ return Qnil; -#ifdef HAVE_MENUS { bool get_current_pos_p = 0; @@ -1315,7 +1314,6 @@ XSETFRAME (Vmenu_updating_frame, f); } -#endif /* HAVE_MENUS */ /* Now parse the lisp menus. */ record_unwind_protect_void (unuse_menu_items); @@ -1398,7 +1396,6 @@ unbind_to (specpdl_count, Qnil); -#ifdef HAVE_MENUS #ifdef HAVE_WINDOW_SYSTEM /* Hide a previous tip, if any. */ if (!FRAME_TERMCAP_P (f)) @@ -1460,16 +1457,12 @@ FRAME_DISPLAY_INFO (f)->grabbed = 0; #endif -#endif /* HAVE_MENUS */ - UNGCPRO; if (error_name) error ("%s", error_name); return selection; } -#ifdef HAVE_MENUS - DEFUN ("x-popup-dialog", Fx_popup_dialog, Sx_popup_dialog, 2, 3, 0, doc: /* Pop up a dialog box and return user's selection. POSITION specifies which frame to use. @@ -1605,8 +1598,6 @@ } } -#endif /* HAVE_MENUS */ - void syms_of_menu (void) { === modified file 'src/term.c' --- src/term.c 2013-11-06 00:14:56 +0000 +++ src/term.c 2013-11-29 01:22:40 +0000 @@ -2739,7 +2739,7 @@ Menus ***********************************************************************/ -#if defined (HAVE_MENUS) && !defined (MSDOS) +#if !defined (MSDOS) /* TTY menu implementation and main ideas are borrowed from msdos.c. @@ -3816,7 +3816,7 @@ return entry; } -#endif /* HAVE_MENUS && !MSDOS */ +#endif /* !MSDOS */ #ifndef MSDOS @@ -3825,7 +3825,7 @@ ***********************************************************************/ /* Initialize the tty-dependent part of frame F. The frame must - already have its device initialized. */ + already have its device initialized. */ void create_tty_output (struct frame *f) @@ -3839,7 +3839,7 @@ f->output_data.tty = t; } -/* Delete frame F's face cache, and its tty-dependent part. */ +/* Delete frame F's face cache, and its tty-dependent part. */ static void tty_free_frame_resources (struct frame *f) @@ -3854,7 +3854,7 @@ #else /* MSDOS */ -/* Delete frame F's face cache. */ +/* Delete frame F's face cache. */ static void tty_free_frame_resources (struct frame *f) === modified file 'src/w32menu.c' --- src/w32menu.c 2013-11-04 06:09:03 +0000 +++ src/w32menu.c 2013-11-29 01:22:40 +0000 @@ -114,7 +114,6 @@ void w32_free_menu_strings (HWND); -#ifdef HAVE_MENUS #ifdef HAVE_DIALOGS Lisp_Object w32_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents) @@ -1602,21 +1601,15 @@ current_popup_menu = NULL; } -#endif /* HAVE_MENUS */ - /* The following is used by delayed window autoselection. */ DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0, doc: /* Return t if a menu or popup dialog is active on selected frame. */) (void) { -#ifdef HAVE_MENUS struct frame *f; f = SELECTED_FRAME (); return (f->output_data.w32->menubar_active > 0) ? Qt : Qnil; -#else - return Qnil; -#endif /* HAVE_MENUS */ } void === modified file 'src/window.c' --- src/window.c 2013-11-29 01:14:01 +0000 +++ src/window.c 2013-11-29 01:22:40 +0000 @@ -5554,7 +5554,6 @@ || data->frame_cols != previous_frame_cols) change_frame_size (f, data->frame_lines, data->frame_cols, 0, 0, 0); -#ifdef HAVE_MENUS if (data->frame_menu_bar_lines != previous_frame_menu_bar_lines) { @@ -5567,7 +5566,6 @@ set_menu_bar_lines (f, make_number (data->frame_menu_bar_lines), make_number (0)); } -#endif #ifdef HAVE_WINDOW_SYSTEM if (data->frame_tool_bar_lines != previous_frame_tool_bar_lines) @@ -5752,7 +5750,6 @@ || previous_frame_cols != FRAME_COLS (f)) change_frame_size (f, previous_frame_lines, previous_frame_cols, 0, 0, 0); -#ifdef HAVE_MENUS if (previous_frame_menu_bar_lines != FRAME_MENU_BAR_LINES (f)) { #ifdef HAVE_WINDOW_SYSTEM @@ -5765,7 +5762,6 @@ set_menu_bar_lines (f, make_number (previous_frame_menu_bar_lines), make_number (0)); } -#endif #ifdef HAVE_WINDOW_SYSTEM if (previous_frame_tool_bar_lines != FRAME_TOOL_BAR_LINES (f)) x_set_tool_bar_lines (f, make_number (previous_frame_tool_bar_lines), @@ -5799,7 +5795,7 @@ /* This `select_window' calls record_buffer which calls Fdelq which invokes QUIT, so we do it here at the end rather than earlier, to minimize the risk of interrupting the Fset_window_configuration - in an inconsistent state (e.g. before frame-focus redirection is + in an inconsistent state (e.g. before frame-focus redirection is canceled). */ select_window (data->current_window, Qnil, 1); BVAR (XBUFFER (XWINDOW (selected_window)->contents), === modified file 'src/xdisp.c' --- src/xdisp.c 2013-11-28 22:43:09 +0000 +++ src/xdisp.c 2013-11-29 01:22:40 +0000 @@ -20603,7 +20603,6 @@ compute_line_metrics (&it); } -#ifdef HAVE_MENUS /* Deep copy of a glyph row, including the glyphs. */ static void deep_copy_glyph_row (struct glyph_row *to, struct glyph_row *from) @@ -20725,7 +20724,6 @@ row->full_width_p = saved_width; row->reversed_p = saved_reversed; } -#endif /* HAVE_MENUS */ /*********************************************************************** Mode Line === modified file 'src/xmenu.c' --- src/xmenu.c 2013-11-04 06:09:03 +0000 +++ src/xmenu.c 2013-11-29 01:22:40 +0000 @@ -2440,11 +2440,7 @@ doc: /* Return t if a menu or popup dialog is active. */) (void) { -#ifdef HAVE_MENUS return (popup_activated ()) ? Qt : Qnil; -#else - return Qnil; -#endif /* HAVE_MENUS */ } void === modified file 'src/xterm.c' --- src/xterm.c 2013-11-28 22:43:09 +0000 +++ src/xterm.c 2013-11-29 01:22:40 +0000 @@ -3528,7 +3528,7 @@ } -#if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK +#if !defined USE_X_TOOLKIT && !defined USE_GTK /* Handle an event saying the mouse has moved out of an Emacs frame. */ void === modified file 'src/xterm.h' --- src/xterm.h 2013-10-29 05:55:25 +0000 +++ src/xterm.h 2013-11-29 01:22:40 +0000 @@ -949,7 +949,7 @@ extern bool x_alloc_nearest_color (struct frame *, Colormap, XColor *); extern void x_query_color (struct frame *f, XColor *); extern void x_clear_area (Display *, Window, int, int, int, int); -#if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK +#if !defined USE_X_TOOLKIT && !defined USE_GTK extern void x_mouse_leave (struct x_display_info *); #endif @@ -963,7 +963,7 @@ extern void x_set_sticky (struct frame *, Lisp_Object, Lisp_Object); extern void x_wait_for_event (struct frame *, int); -/* Defined in xselect.c */ +/* Defined in xselect.c. */ extern void x_handle_property_notify (const XPropertyEvent *); extern void x_handle_selection_notify (const XSelectionEvent *); ------------------------------------------------------------ revno: 115276 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-11-28 20:14:01 -0500 message: * src/window.c (Fset_window_configuration): Move select_window later. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-28 22:43:09 +0000 +++ src/ChangeLog 2013-11-29 01:14:01 +0000 @@ -1,3 +1,7 @@ +2013-11-29 Stefan Monnier + + * window.c (Fset_window_configuration): Move select_window later. + 2013-11-28 Stefan Monnier Refine redisplay optimizations to only redisplay *some* frames/windows === modified file 'src/window.c' --- src/window.c 2013-11-28 22:43:09 +0000 +++ src/window.c 2013-11-29 01:14:01 +0000 @@ -5742,14 +5742,6 @@ make_number (old_point), XWINDOW (data->current_window)->contents); - /* In the following call to `select-window', prevent "swapping out - point" in the old selected window using the buffer that has - been restored into it. We already swapped out that point from - that window's old buffer. */ - select_window (data->current_window, Qnil, 1); - BVAR (XBUFFER (XWINDOW (selected_window)->contents), last_selected_window) - = selected_window; - if (NILP (data->focus_frame) || (FRAMEP (data->focus_frame) && FRAME_LIVE_P (XFRAME (data->focus_frame)))) @@ -5800,6 +5792,20 @@ delete_deletable_window (window); } + /* In the following call to `select-window', prevent "swapping out + point" in the old selected window using the buffer that has + been restored into it. We already swapped out that point from + that window's old buffer. */ + /* This `select_window' calls record_buffer which calls Fdelq which + invokes QUIT, so we do it here at the end rather than earlier, + to minimize the risk of interrupting the Fset_window_configuration + in an inconsistent state (e.g. before frame-focus redirection is + canceled). */ + select_window (data->current_window, Qnil, 1); + BVAR (XBUFFER (XWINDOW (selected_window)->contents), + last_selected_window) + = selected_window; + /* Fselect_window will have made f the selected frame, so we reselect the proper frame here. Fhandle_switch_frame will change the selected window too, but that doesn't make the call to ------------------------------------------------------------ revno: 115275 committer: Glenn Morris branch nick: trunk timestamp: Thu 2013-11-28 15:50:09 -0800 message: Replace PATH_SEP with pre-existing SEPCHAR. * configure.ac: * test/automated/Makefile.in: Use SEPCHAR in place of PATH_SEP. diff: === modified file 'ChangeLog' --- ChangeLog 2013-11-28 17:45:26 +0000 +++ ChangeLog 2013-11-28 23:50:09 +0000 @@ -1,3 +1,7 @@ +2013-11-28 Glenn Morris + + * configure.ac (PATH_SEP): Replace with pre-existing SEPCHAR. + 2013-11-28 Eli Zaretskii * GNUmakefile (Makefile): Don't use $(CFG). === modified file 'configure.ac' --- configure.ac 2013-11-28 17:35:13 +0000 +++ configure.ac 2013-11-28 23:50:09 +0000 @@ -923,22 +923,6 @@ LN_S="ln" fi -dnl This is for MinGW, and is used in test/automated/Makefile.in. -dnl The MSYS Bash has heuristics for replacing ':' with ';' when it -dnl decides that a command-line argument to be passed to a MinGW program -dnl is a PATH-style list of directories. But that heuristics plays it -dnl safe, and only does the replacement when it is _absolutely_ sure it -dnl sees a colon-seperated list of file names; e.g. ":." is left alone, -dnl which breaks in-tree builds. So we do this manually instead. -dnl Note that we cannot rely on PATH_SEPARATOR, as that one will always -dnl be computed as ':' in MSYS Bash. -if test "$opsys" = "mingw32"; then - PATH_SEP=';' -else - PATH_SEP=':' -fi -AC_SUBST(PATH_SEP) - AC_PATH_PROG(INSTALL_INFO, install-info, :, $PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin) dnl Don't use GZIP, which is used by gzip for additional parameters. @@ -3851,12 +3835,22 @@ AC_DEFINE(NULL_DEVICE, ["/dev/null"]) fi -AH_TEMPLATE(SEPCHAR, [Character that separates PATH elements.]) if test "${opsys}" = "mingw32"; then - AC_DEFINE(SEPCHAR, [';']) + SEPCHAR=';' else - AC_DEFINE(SEPCHAR, [':']) + SEPCHAR=':' fi +AC_DEFINE_UNQUOTED(SEPCHAR, ['$SEPCHAR'], [Character that separates PATH elements.]) +dnl This is for MinGW, and is used in test/automated/Makefile.in. +dnl The MSYS Bash has heuristics for replacing ':' with ';' when it +dnl decides that a command-line argument to be passed to a MinGW program +dnl is a PATH-style list of directories. But that heuristics plays it +dnl safe, and only does the replacement when it is _absolutely_ sure it +dnl sees a colon-seperated list of file names; e.g. ":." is left alone, +dnl which breaks in-tree builds. So we do this manually instead. +dnl Note that we cannot rely on PATH_SEPARATOR, as that one will always +dnl be computed as ':' in MSYS Bash. +AC_SUBST(SEPCHAR) dnl Everybody supports this, except MS-DOS. AC_DEFINE(subprocesses, 1, [Define to enable asynchronous subprocesses.]) === modified file 'test/ChangeLog' --- test/ChangeLog 2013-11-28 17:35:13 +0000 +++ test/ChangeLog 2013-11-28 23:50:09 +0000 @@ -1,3 +1,7 @@ +2013-11-28 Glenn Morris + + * automated/Makefile.in (SEPCHAR): Use in place of PATH_SEP. + 2013-11-28 Eli Zaretskii * automated/Makefile.in (PATH_SEP): Set this instead of === modified file 'test/automated/Makefile.in' --- test/automated/Makefile.in 2013-11-28 17:35:13 +0000 +++ test/automated/Makefile.in 2013-11-28 23:50:09 +0000 @@ -22,7 +22,7 @@ srcdir = @srcdir@ VPATH = $(srcdir) -PATH_SEP = @PATH_SEP@ +SEPCHAR = @SEPCHAR@ # Empty for all systems except MinGW, where xargs needs an explicit # limitation. @@ -36,7 +36,7 @@ # Command line flags for Emacs. # Apparently MSYS bash would convert "-L :" to "-L ;" anyway, # but we might as well be explicit. -EMACSOPT = -batch --no-site-file --no-site-lisp -L "$(PATH_SEP)$(srcdir)" +EMACSOPT = -batch --no-site-file --no-site-lisp -L "$(SEPCHAR)$(srcdir)" # Extra flags to pass to the byte compiler. BYTE_COMPILE_EXTRA_FLAGS = ------------------------------------------------------------ revno: 115274 committer: Glenn Morris branch nick: trunk timestamp: Thu 2013-11-28 15:34:15 -0800 message: Robustify previous leim/Makefile.in change diff: === modified file 'leim/Makefile.in' --- leim/Makefile.in 2013-11-28 20:31:55 +0000 +++ leim/Makefile.in 2013-11-28 23:34:15 +0000 @@ -132,7 +132,7 @@ rm -f $@ ${RUN_EMACS} -l international/quail \ --eval "(update-leim-list-file (unmsys--file-name \"${leimdir}\"))" - sed -n -e '/^[^;]/p' -e 's/;inc/;/p' < ${srcdir}/leim-ext.el >> $@ + sed -n -e '/^[^;]/p' -e 's/^;\(;*\)inc /;\1 /p' < ${srcdir}/leim-ext.el >> $@ ${leimdir}/ja-dic/ja-dic.el: $(srcdir)/SKK-DIC/SKK-JISYO.L @$(MKDIR_P) $(leimdir)/ja-dic ------------------------------------------------------------ revno: 115273 author: Jan Tatarik committer: Katsumi Yamaoka branch nick: trunk timestamp: Thu 2013-11-28 23:33:52 +0000 message: lisp/gnus/gnus-icalendar.el: bugfix and improvements diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-11-27 06:39:37 +0000 +++ lisp/gnus/ChangeLog 2013-11-28 23:33:52 +0000 @@ -1,3 +1,12 @@ +2013-11-28 Jan Tatarik + + * gnus-icalendar.el (gnus-icalendar-event-from-ical) + (gnus-icalendar-event->org-entry) + (gnus-icalendar--update-org-event) + (gnus-icalendar-event->gnus-calendar): Distinguish between + required/optional/non-participant attendee status. Fix bug causing + the first required event participant to be omitted. + 2013-11-27 Katsumi Yamaoka * gnus-art.el (article-de-quoted-unreadable) === modified file 'lisp/gnus/gnus-icalendar.el' --- lisp/gnus/gnus-icalendar.el 2013-11-21 22:55:59 +0000 +++ lisp/gnus/gnus-icalendar.el 2013-11-28 23:33:52 +0000 @@ -92,10 +92,10 @@ :accessor gnus-icalendar-event:rsvp :initform nil :type (or null boolean)) - (participation-required :initarg :participation-required - :accessor gnus-icalendar-event:participation-required - :initform t - :type (or null boolean)) + (participation-type :initarg :participation-type + :accessor gnus-icalendar-event:participation-type + :initform 'non-participant + :type (or null t)) (req-participants :initarg :req-participants :accessor gnus-icalendar-event:req-participants :initform nil @@ -196,15 +196,18 @@ (attendee (when attendee-name-or-email (gnus-icalendar-event--find-attendee ical attendee-name-or-email))) (attendee-names (gnus-icalendar-event--get-attendee-names ical)) + (role (plist-get (cadr attendee) 'ROLE)) + (participation-type (pcase role + ("REQ-PARTICIPANT" 'required) + ("OPT-PARTICIPANT" 'optional) + (_ 'non-participant))) (args (list :method method :organizer organizer :start-time (gnus-icalendar-event--decode-datefield event 'DTSTART) :end-time (gnus-icalendar-event--decode-datefield event 'DTEND) - :rsvp (string= (plist-get (cadr attendee) 'RSVP) - "TRUE") - :participation-required (string= (plist-get (cadr attendee) 'ROLE) - "REQ-PARTICIPANT") - :req-participants (cdar attendee-names) + :rsvp (string= (plist-get (cadr attendee) 'RSVP) "TRUE") + :participation-type participation-type + :req-participants (car attendee-names) :opt-participants (cadr attendee-names))) (event-class (cond ((string= method "REQUEST") 'gnus-icalendar-event-request) @@ -451,7 +454,7 @@ ("DT" . ,(gnus-icalendar-event:org-timestamp event)) ("ORGANIZER" . ,(gnus-icalendar-event:organizer event)) ("LOCATION" . ,(gnus-icalendar-event:location event)) - ("PARTICIPATION_REQUIRED" . ,(when (gnus-icalendar-event:participation-required event) "t")) + ("PARTICIPATION_TYPE" . ,(symbol-name (gnus-icalendar-event:participation-type event))) ("REQ_PARTICIPANTS" . ,(gnus-icalendar--format-participant-list (gnus-icalendar-event:req-participants event))) ("OPT_PARTICIPANTS" . ,(gnus-icalendar--format-participant-list (gnus-icalendar-event:opt-participants event))) ("RRULE" . ,(gnus-icalendar-event:recur event)) @@ -513,7 +516,7 @@ (when file (with-current-buffer (find-file-noselect file) (with-slots (uid summary description organizer location recur - participation-required req-participants opt-participants) event + participation-type req-participants opt-participants) event (let ((event-pos (org-find-entry-with-id uid))) (when event-pos (goto-char event-pos) @@ -555,7 +558,7 @@ (org-entry-put event-pos "DT" (gnus-icalendar-event:org-timestamp event)) (org-entry-put event-pos "ORGANIZER" organizer) (org-entry-put event-pos "LOCATION" location) - (org-entry-put event-pos "PARTICIPATION_REQUIRED" (when participation-required "t")) + (org-entry-put event-pos "PARTICIPATION_TYPE" (symbol-name participation-type)) (org-entry-put event-pos "REQ_PARTICIPANTS" (gnus-icalendar--format-participant-list req-participants)) (org-entry-put event-pos "OPT_PARTICIPANTS" (gnus-icalendar--format-participant-list opt-participants)) (org-entry-put event-pos "RRULE" recur) @@ -691,12 +694,14 @@ (cadr x)))) (with-slots (organizer summary description location recur uid - method rsvp participation-required) event + method rsvp participation-type) event (let ((headers `(("Summary" ,summary) ("Location" ,(or location "")) ("Time" ,(gnus-icalendar-event:org-timestamp event)) ("Organizer" ,organizer) - ("Attendance" ,(if participation-required "Required" "Optional")) + ("Attendance" ,(if (eq participation-type 'non-participant) + "You are not listed as an attendee" + (capitalize (symbol-name participation-type)))) ("Method" ,method)))) (when (and (not (gnus-icalendar-event-reply-p event)) rsvp) ------------------------------------------------------------ revno: 115272 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-11-28 17:43:09 -0500 message: Refine redisplay optimizations to only redisplay *some* frames/windows rather than all of them. * src/xdisp.c (REDISPLAY_SOME): New constant. (redisplay_other_windows, wset_redisplay, fset_redisplay) (bset_redisplay, bset_update_mode_line): New functions. (message_dolog): Use bset_redisplay. (clear_garbaged_frames): Use fset_redisplay. (echo_area_display): Use wset_redisplay. (buffer_shared_and_changed): Remove. (prepare_menu_bars): Call Vpre_redisplay_function before updating frame titles. Compute the actual set of windows redisplayed. Don't update frame titles and menu bars for frames that don't need to be redisplayed. (propagate_buffer_redisplay): New function. (AINC): New macro. (redisplay_internal): Use it. Be more selective in the set of windows we redisplay. Propagate windows_or_buffers_changed to update_mode_lines a bit later to simplify the code. (mark_window_display_accurate_1): Reset window and buffer's `redisplay' flag. (redisplay_window): Do nothing if neither the window nor the buffer nor the frame needs redisplay. * src/window.h (struct window): Add `redisplay' field. (wset_redisplay, fset_redisplay, bset_redisplay, bset_update_mode_line) (redisplay_other_windows, window_list): New declarations. * src/window.c (select_window, Fset_window_start): Use wset_redisplay. (window_list): Not static any more. (grow_mini_window, shrink_mini_window): Use fset_redisplay. * src/minibuf.c (read_minibuf_unwind): Don't redisplay everything. * src/insdel.c (prepare_to_modify_buffer_1): Use bset_redisplay. * src/frame.c (Fmake_frame_visible): Don't redisplay everything. * src/frame.h (struct frame): Add `redisplay' field. Move `external_menu_bar' bitfield next to other bit-fields. (SET_FRAME_GARBAGED): Use fset_redisplay. (SET_FRAME_VISIBLE): Don't garbage the frame; Use redisplay_other_windows. * src/buffer.h (struct buffer): Add `redisplay' field. * src/buffer.c (Fforce_mode_line_update): Pay attention to the `all' flag. (modify_overlay): Use bset_redisplay. * src/alloc.c (gc_sweep): Don't unmark strings while sweeping symbols. * lisp/doc-view.el (doc-view-goto-page): Update mode-line. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-28 01:49:25 +0000 +++ lisp/ChangeLog 2013-11-28 22:43:09 +0000 @@ -1,5 +1,7 @@ 2013-11-28 Stefan Monnier + * doc-view.el (doc-view-goto-page): Update mode-line. + * vc/vc-dispatcher.el (vc-log-edit): Setup the Summary&Author headers. 2013-11-27 Glenn Morris @@ -531,8 +533,8 @@ * progmodes/ruby-mode.el: Improve encoding comment handling. (ruby-encoding-magic-comment-style): New option. (ruby-custom-encoding-magic-comment-template): New option. - (ruby--insert-coding-comment, ruby--detect-encoding): New - functions extracted from `ruby-mode-set-encoding'. + (ruby--insert-coding-comment, ruby--detect-encoding): + New functions extracted from `ruby-mode-set-encoding'. (ruby-mode-set-encoding): Use `ruby-encoding-magic-comment-style' to control the style of the auto-inserted encoding comment. === modified file 'lisp/doc-view.el' --- lisp/doc-view.el 2013-09-27 06:46:49 +0000 +++ lisp/doc-view.el 2013-11-28 22:43:09 +0000 @@ -499,6 +499,7 @@ ;; how many pages will be available. (null doc-view--current-converter-processes)) (setq page len))) + (force-mode-line-update) ;To update `current-page'. (setf (doc-view-current-page) page (doc-view-current-info) (concat === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-28 19:40:15 +0000 +++ src/ChangeLog 2013-11-28 22:43:09 +0000 @@ -1,3 +1,46 @@ +2013-11-28 Stefan Monnier + + Refine redisplay optimizations to only redisplay *some* frames/windows + rather than all of them. + * xdisp.c (REDISPLAY_SOME): New constant. + (redisplay_other_windows, wset_redisplay, fset_redisplay) + (bset_redisplay, bset_update_mode_line): New functions. + (message_dolog): Use bset_redisplay. + (clear_garbaged_frames): Use fset_redisplay. + (echo_area_display): Use wset_redisplay. + (buffer_shared_and_changed): Remove. + (prepare_menu_bars): Call Vpre_redisplay_function before updating + frame titles. Compute the actual set of windows redisplayed. + Don't update frame titles and menu bars for frames that don't need to + be redisplayed. + (propagate_buffer_redisplay): New function. + (AINC): New macro. + (redisplay_internal): Use it. Be more selective in the set of windows + we redisplay. Propagate windows_or_buffers_changed to + update_mode_lines a bit later to simplify the code. + (mark_window_display_accurate_1): Reset window and buffer's + `redisplay' flag. + (redisplay_window): Do nothing if neither the window nor the buffer nor + the frame needs redisplay. + * window.h (struct window): Add `redisplay' field. + (wset_redisplay, fset_redisplay, bset_redisplay, bset_update_mode_line) + (redisplay_other_windows, window_list): New declarations. + * window.c (select_window, Fset_window_start): Use wset_redisplay. + (window_list): Not static any more. + (grow_mini_window, shrink_mini_window): Use fset_redisplay. + * minibuf.c (read_minibuf_unwind): Don't redisplay everything. + * insdel.c (prepare_to_modify_buffer_1): Use bset_redisplay. + * frame.c (Fmake_frame_visible): Don't redisplay everything. + * frame.h (struct frame): Add `redisplay' field. + Move `external_menu_bar' bitfield next to other bit-fields. + (SET_FRAME_GARBAGED): Use fset_redisplay. + (SET_FRAME_VISIBLE): Don't garbage the frame; + Use redisplay_other_windows. + * buffer.h (struct buffer): Add `redisplay' field. + * buffer.c (Fforce_mode_line_update): Pay attention to the `all' flag. + (modify_overlay): Use bset_redisplay. + * alloc.c (gc_sweep): Don't unmark strings while sweeping symbols. + 2013-11-28 Eli Zaretskii Support w32 file notifications in batch mode. @@ -6,11 +49,9 @@ handle_file_notifications to store file notification events in the input queue. (Bug#15933) - * w32notify.c (send_notifications): Handle FRAME_INITIAL frames as - well. + * w32notify.c (send_notifications): Handle FRAME_INITIAL frames as well. - * w32inevt.c (handle_file_notifications): Now external, not - static. + * w32inevt.c (handle_file_notifications): Now external, not static. * w32term.h (handle_file_notifications): Provide prototype. @@ -209,8 +250,8 @@ * insdel.c (invalidate_buffer_caches): New function, consolidated from part of prepare_to_modify_buffer. (insert_from_gap, prepare_to_modify_buffer): - * coding.c (code_convert_region, code_convert_string): Call - invalidate_buffer_caches. (Bug#15841) + * coding.c (code_convert_region, code_convert_string): + Call invalidate_buffer_caches. (Bug#15841) * lisp.h (invalidate_buffer_caches): Add prototype. === modified file 'src/alloc.c' --- src/alloc.c 2013-11-21 06:46:59 +0000 +++ src/alloc.c 2013-11-28 22:43:09 +0000 @@ -6291,7 +6291,7 @@ -/* Sweep: find all structures not marked, and free them. */ +/* Sweep: find all structures not marked, and free them. */ static void gc_sweep (void) @@ -6303,7 +6303,7 @@ sweep_strings (); check_string_bytes (!noninteractive); - /* Put all unmarked conses on free list */ + /* Put all unmarked conses on free list. */ { register struct cons_block *cblk; struct cons_block **cprev = &cons_block; @@ -6380,7 +6380,7 @@ total_free_conses = num_free; } - /* Put all unmarked floats on free list */ + /* Put all unmarked floats on free list. */ { register struct float_block *fblk; struct float_block **fprev = &float_block; @@ -6426,7 +6426,7 @@ total_free_floats = num_free; } - /* Put all unmarked intervals on free list */ + /* Put all unmarked intervals on free list. */ { register struct interval_block *iblk; struct interval_block **iprev = &interval_block; @@ -6475,7 +6475,7 @@ total_free_intervals = num_free; } - /* Put all unmarked symbols on free list */ + /* Put all unmarked symbols on free list. */ { register struct symbol_block *sblk; struct symbol_block **sprev = &symbol_block; @@ -6512,7 +6512,7 @@ { ++num_used; if (!pure_p) - UNMARK_STRING (XSTRING (sym->s.name)); + eassert (!STRING_MARKED_P (XSTRING (sym->s.name))); sym->s.gcmarkbit = 0; } } === modified file 'src/buffer.c' --- src/buffer.c 2013-11-12 01:24:04 +0000 +++ src/buffer.c 2013-11-28 22:43:09 +0000 @@ -1336,10 +1336,16 @@ menu bar menus and the frame title. */) (Lisp_Object all) { - if (!NILP (all) || buffer_window_count (current_buffer)) + if (!NILP (all)) { update_mode_lines = 10; - current_buffer->prevent_redisplay_optimizations_p = 1; + /* FIXME: This can't be right. */ + current_buffer->prevent_redisplay_optimizations_p = true; + } + else if (buffer_window_count (current_buffer)) + { + bset_update_mode_line (current_buffer); + current_buffer->prevent_redisplay_optimizations_p = true; } return all; } @@ -3895,17 +3901,7 @@ BUF_COMPUTE_UNCHANGED (buf, start, end); - /* If BUF is visible, consider updating the display if ... */ - if (buffer_window_count (buf) > 0) - { - /* ... it's visible in other window than selected, */ - if (buf != XBUFFER (XWINDOW (selected_window)->contents)) - windows_or_buffers_changed = 11; - /* ... or if we modify an overlay at the end of the buffer - and so we cannot be sure that window end is still valid. */ - else if (end >= ZV && start <= ZV) - windows_or_buffers_changed = 12; - } + bset_redisplay (buf); ++BUF_OVERLAY_MODIFF (buf); } === modified file 'src/buffer.h' --- src/buffer.h 2013-11-17 07:51:24 +0000 +++ src/buffer.h 2013-11-28 22:43:09 +0000 @@ -475,7 +475,10 @@ /* Usually 0. Temporarily set to 1 in decode_coding_gap to prevent Fgarbage_collect from shrinking the gap and losing not-yet-decoded bytes. */ - bool inhibit_shrinking; + bool inhibit_shrinking : 1; + + /* True if it needs to be redisplayed. */ + bool redisplay : 1; }; /* Most code should use this macro to access Lisp fields in struct buffer. */ @@ -846,10 +849,10 @@ /* Non-zero means don't use redisplay optimizations for displaying this buffer. */ - unsigned prevent_redisplay_optimizations_p : 1; + bool prevent_redisplay_optimizations_p : 1; /* Non-zero whenever the narrowing is changed in this buffer. */ - unsigned clip_changed : 1; + bool clip_changed : 1; /* List of overlays that end at or before the current center, in order of end-position. */ === modified file 'src/frame.c' --- src/frame.c 2013-11-25 02:41:02 +0000 +++ src/frame.c 2013-11-28 22:43:09 +0000 @@ -339,11 +339,12 @@ non-Lisp data, so do it only for slots which should not be zero. To avoid subtle bugs and for the sake of readability, it's better to initialize enum members explicitly even if their values are zero. */ - f->wants_modeline = 1; - f->garbaged = 1; + f->wants_modeline = true; + f->redisplay = true; + f->garbaged = true; f->vertical_scroll_bar_type = vertical_scroll_bar_none; - f->column_width = 1; /* !FRAME_WINDOW_P value */ - f->line_height = 1; /* !FRAME_WINDOW_P value */ + f->column_width = 1; /* !FRAME_WINDOW_P value. */ + f->line_height = 1; /* !FRAME_WINDOW_P value. */ #ifdef HAVE_WINDOW_SYSTEM f->want_fullscreen = FULLSCREEN_NONE; #endif @@ -785,9 +786,6 @@ if (sf == XFRAME (frame)) return frame; - /* This is too greedy; it causes inappropriate focus redirection - that's hard to get rid of. */ -#if 0 /* If a frame's focus has been redirected toward the currently selected frame, we should change the redirection to point to the newly selected frame. This means that if the focus is redirected @@ -795,6 +793,9 @@ can use `other-window' to switch between all the frames using that minibuffer frame, and the focus redirection will follow us around. */ +#if 0 + /* This is too greedy; it causes inappropriate focus redirection + that's hard to get rid of. */ if (track) { Lisp_Object tail; @@ -1681,7 +1682,7 @@ make_frame_visible_1 (f->root_window); /* Make menu bar update for the Buffers and Frames menus. */ - windows_or_buffers_changed = 15; + /* windows_or_buffers_changed = 15; FIXME: Why? */ XSETFRAME (frame, f); return frame; === modified file 'src/frame.h' --- src/frame.h 2013-10-08 17:49:20 +0000 +++ src/frame.h 2013-11-28 22:43:09 +0000 @@ -178,41 +178,44 @@ /* 1 means that glyphs on this frame have been initialized so it can be used for output. */ - unsigned glyphs_initialized_p : 1; + bool glyphs_initialized_p : 1; /* Set to non-zero in change_frame_size when size of frame changed Clear the frame in clear_garbaged_frames if set. */ - unsigned resized_p : 1; + bool resized_p : 1; /* Set to non-zero if the default face for the frame has been realized. Reset to zero whenever the default face changes. Used to see the difference between a font change and face change. */ - unsigned default_face_done_p : 1; + bool default_face_done_p : 1; /* Set to non-zero if this frame has already been hscrolled during current redisplay. */ - unsigned already_hscrolled_p : 1; + bool already_hscrolled_p : 1; /* Set to non-zero when current redisplay has updated frame. */ - unsigned updated_p : 1; + bool updated_p : 1; #if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS) /* Set to non-zero to minimize tool-bar height even when auto-resize-tool-bar is set to grow-only. */ - unsigned minimize_tool_bar_window_p : 1; + bool minimize_tool_bar_window_p : 1; #endif #if defined (USE_GTK) || defined (HAVE_NS) /* Nonzero means using a tool bar that comes from the toolkit. */ - unsigned external_tool_bar : 1; + bool external_tool_bar : 1; #endif /* Nonzero means that fonts have been loaded since the last glyph matrix adjustments. */ - unsigned fonts_changed : 1; + bool fonts_changed : 1; /* Nonzero means that cursor type has been changed. */ - unsigned cursor_type_changed : 1; + bool cursor_type_changed : 1; + + /* True if it needs to be redisplayed. */ + bool redisplay : 1; /* Margin at the top of the frame. Used to display the tool-bar. */ int tool_bar_lines; @@ -220,17 +223,17 @@ int n_tool_bar_rows; int n_tool_bar_items; - /* A buffer for decode_mode_line. */ + /* A buffer for decode_mode_line. */ char *decode_mode_spec_buffer; - /* See do_line_insertion_deletion_costs for info on these arrays. */ - /* Cost of inserting 1 line on this frame */ + /* See do_line_insertion_deletion_costs for info on these arrays. */ + /* Cost of inserting 1 line on this frame. */ int *insert_line_cost; - /* Cost of deleting 1 line on this frame */ + /* Cost of deleting 1 line on this frame. */ int *delete_line_cost; - /* Cost of inserting n lines on this frame */ + /* Cost of inserting n lines on this frame. */ int *insert_n_lines_cost; - /* Cost of deleting n lines on this frame */ + /* Cost of deleting n lines on this frame. */ int *delete_n_lines_cost; /* Size of this frame, excluding fringes, scroll bars etc., @@ -252,7 +255,7 @@ int pixel_height, pixel_width; /* These many pixels are the difference between the outer window (i.e. the - left and top of the window manager decoration) and FRAME_X_WINDOW. */ + left and top of the window manager decoration) and FRAME_X_WINDOW. */ int x_pixels_diff, y_pixels_diff; /* This is the gravity value for the specified window position. */ @@ -281,23 +284,23 @@ enum output_method output_method; /* The terminal device that this frame uses. If this is NULL, then - the frame has been deleted. */ + the frame has been deleted. */ struct terminal *terminal; /* Device-dependent, frame-local auxiliary data used for displaying the contents. When the frame is deleted, this data is deleted as - well. */ + well. */ union output_data { - struct tty_output *tty; /* termchar.h */ - struct x_output *x; /* xterm.h */ - struct w32_output *w32; /* w32term.h */ - struct ns_output *ns; /* nsterm.h */ + struct tty_output *tty; /* From termchar.h. */ + struct x_output *x; /* From xterm.h. */ + struct w32_output *w32; /* From w32term.h. */ + struct ns_output *ns; /* From nsterm.h. */ intptr_t nothing; } output_data; - /* List of font-drivers available on the frame. */ + /* List of font-drivers available on the frame. */ struct font_driver_list *font_driver_list; /* List of data specific to font-driver and frame, but common to faces. */ @@ -313,80 +316,76 @@ /* The extra width (in pixels) currently allotted for fringes. */ int left_fringe_width, right_fringe_width; - /* See FULLSCREEN_ enum below */ + /* See FULLSCREEN_ enum below. */ enum fullscreen_type want_fullscreen; /* Number of lines of menu bar. */ int menu_bar_lines; -#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \ - || defined (HAVE_NS) || defined (USE_GTK) - /* Nonzero means using a menu bar that comes from the X toolkit. */ - unsigned int external_menu_bar : 1; -#endif - #if defined (HAVE_X_WINDOWS) /* Used by x_wait_for_event when watching for an X event on this frame. */ int wait_event_type; #endif +#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \ + || defined (HAVE_NS) || defined (USE_GTK) + /* Nonzero means using a menu bar that comes from the X toolkit. */ + bool external_menu_bar : 1; +#endif + /* Next two bitfields are mutually exclusive. They might both be zero if the frame has been made invisible without an icon. */ /* Nonzero if the frame is currently displayed; we check it to see if we should bother updating the frame's contents. - Note that, since invisible frames aren't updated, whenever a - frame becomes visible again, it must be marked as garbaged. - On ttys and on Windows NT/9X, to avoid wasting effort updating visible frames that are actually completely obscured by other windows on the display, we bend the meaning of visible slightly: if equal to 2, then the frame is obscured - we still consider it to be "visible" as seen from lisp, but we don't bother - updating it. We must take care to garbage the frame when it - ceases to be obscured though. See SET_FRAME_VISIBLE below. */ + updating it. */ unsigned visible : 2; /* Nonzero if the frame is currently iconified. Do not set this directly, use SET_FRAME_ICONIFIED instead. */ - unsigned iconified : 1; + bool iconified : 1; /* Nonzero if this frame should be redrawn. */ - unsigned garbaged : 1; + bool garbaged : 1; /* 0 means, if this frame has just one window, show no modeline for that window. */ - unsigned wants_modeline : 1; + bool wants_modeline : 1; /* Non-0 means raise this frame to the top of the heap when selected. */ - unsigned auto_raise : 1; + bool auto_raise : 1; /* Non-0 means lower this frame to the bottom of the stack when left. */ - unsigned auto_lower : 1; + bool auto_lower : 1; /* True if frame's root window can't be split. */ - unsigned no_split : 1; + bool no_split : 1; /* If this is set, then Emacs won't change the frame name to indicate the current buffer, etcetera. If the user explicitly sets the frame name, this gets set. If the user sets the name to Qnil, this is cleared. */ - unsigned explicit_name : 1; + bool explicit_name : 1; /* Nonzero if size of some window on this frame has changed. */ - unsigned window_sizes_changed : 1; + bool window_sizes_changed : 1; /* Nonzero if the mouse has moved on this display device since the last time we checked. */ - unsigned mouse_moved :1; + bool mouse_moved : 1; - /* Nonzero means that the pointer is invisible. */ - unsigned pointer_invisible :1; + /* Nonzero means that the pointer is invisible. */ + bool pointer_invisible : 1; /* Nonzero means that all windows except mini-window and selected window on this frame have frozen window starts. */ - unsigned frozen_window_starts : 1; + bool frozen_window_starts : 1; /* Nonzero if we should actually display the scroll bars on this frame. */ enum vertical_scroll_bar_type vertical_scroll_bar_type; @@ -720,7 +719,8 @@ #define FRAME_ICONIFIED_P(f) (f)->iconified /* Mark frame F as currently garbaged. */ -#define SET_FRAME_GARBAGED(f) (frame_garbaged = 1, f->garbaged = 1) +#define SET_FRAME_GARBAGED(f) \ + (frame_garbaged = true, fset_redisplay (f), f->garbaged = true) /* Nonzero if frame F is currently garbaged. */ #define FRAME_GARBAGED_P(f) (f)->garbaged @@ -911,11 +911,14 @@ } \ } while (0) -/* Set visibility of frame F, marking F as garbaged if needed. */ +/* Set visibility of frame F. + We call redisplay_other_windows to make sure the frame gets redisplayed + if some changes were applied to it while it wasn't visible (and hence + wasn't redisplayed). */ -#define SET_FRAME_VISIBLE(f, v) \ - (((f)->visible == 0 || ((f)->visible == 2)) \ - && ((v) == 1) ? SET_FRAME_GARBAGED (f) : 0, \ +#define SET_FRAME_VISIBLE(f, v) \ + (((f)->visible == 0 || ((f)->visible == 2)) && ((v) == 1) \ + ? redisplay_other_windows () : 0, \ (f)->visible = (eassert (0 <= (v) && (v) <= 2), (v))) /* Set iconify of frame F. */ === modified file 'src/insdel.c' --- src/insdel.c 2013-11-18 16:29:49 +0000 +++ src/insdel.c 2013-11-28 22:43:09 +0000 @@ -1804,11 +1804,7 @@ if (!NILP (BVAR (current_buffer, read_only))) Fbarf_if_buffer_read_only (); - /* If we're modifying the buffer other than shown in a selected window, - let redisplay consider other windows if this buffer is visible. */ - if (XBUFFER (XWINDOW (selected_window)->contents) != current_buffer - && buffer_window_count (current_buffer)) - windows_or_buffers_changed = 20; + bset_redisplay (current_buffer); if (buffer_intervals (current_buffer)) { === modified file 'src/minibuf.c' --- src/minibuf.c 2013-11-15 06:52:40 +0000 +++ src/minibuf.c 2013-11-28 22:43:09 +0000 @@ -865,9 +865,6 @@ if (minibuf_level == 0) resize_mini_window (XWINDOW (window), 0); - /* Enforce full redisplay. FIXME: make it more selective. */ - windows_or_buffers_changed = 22; - /* In case the previous minibuffer displayed in this miniwindow is dead, we may keep displaying this buffer (tho it's inactive), so reset it, to make sure we don't leave around bindings and stuff which only === modified file 'src/window.c' --- src/window.c 2013-11-27 07:44:48 +0000 +++ src/window.c 2013-11-28 22:43:09 +0000 @@ -60,7 +60,6 @@ static void window_scroll (Lisp_Object, EMACS_INT, bool, int); static void window_scroll_pixel_based (Lisp_Object, int, bool, int); static void window_scroll_line_based (Lisp_Object, int, bool, int); -static Lisp_Object window_list (void); static int add_window_to_list (struct window *, void *); static Lisp_Object next_window (Lisp_Object, Lisp_Object, Lisp_Object, int); @@ -482,6 +481,12 @@ record_buffer before returning here. */ goto record_and_return; + if (NILP (norecord)) + /* Mark the window for redisplay since the selected-window has a different + mode-line. */ + wset_redisplay (XWINDOW (selected_window)); + else + redisplay_other_windows (); sf = SELECTED_FRAME (); if (XFRAME (WINDOW_FRAME (w)) != sf) { @@ -500,7 +505,8 @@ select_window_1 (window, inhibit_point_swap); bset_last_selected_window (XBUFFER (w->contents), window); - windows_or_buffers_changed = 24; + if (NILP (norecord)) + wset_redisplay (w); record_and_return: /* record_buffer can run QUIT, so make sure it is run only after we have @@ -1577,8 +1583,7 @@ /* Bug#15957. */ w->window_end_valid = 0; if (w != XWINDOW (selected_window)) - /* Enforce full redisplay. FIXME: make it more selective. */ - windows_or_buffers_changed = 26; + wset_redisplay (w); return pos; } @@ -2139,7 +2144,7 @@ Vwindow_list is a list, return that list. Otherwise, build a new list, cache it in Vwindow_list, and return that. */ -static Lisp_Object +Lisp_Object window_list (void) { if (!CONSP (Vwindow_list)) @@ -4138,8 +4143,9 @@ /* Grow the mini-window. */ w->top_line = r->top_line + r->total_lines; w->total_lines -= XINT (value); - /* Enforce full redisplay. FIXME: make it more selective. */ - windows_or_buffers_changed = 34; + /* Enforce full redisplay of the frame. */ + /* FIXME: Shouldn't window--resize-root-window-vertically do it? */ + fset_redisplay (f); adjust_frame_glyphs (f); unblock_input (); } @@ -4172,8 +4178,9 @@ /* Shrink the mini-window. */ w->top_line = r->top_line + r->total_lines; w->total_lines = 1; - /* Enforce full redisplay. FIXME: make it more selective. */ - windows_or_buffers_changed = 35; + /* Enforce full redisplay of the frame. */ + /* FIXME: Shouldn't window--resize-root-window-vertically do it? */ + fset_redisplay (f); adjust_frame_glyphs (f); unblock_input (); } === modified file 'src/window.h' --- src/window.h 2013-10-29 16:11:50 +0000 +++ src/window.h 2013-11-28 22:43:09 +0000 @@ -282,60 +282,63 @@ int window_end_vpos; /* Non-zero if this window is a minibuffer window. */ - unsigned mini : 1; + bool mini : 1; /* Meaningful only if contents is a window, non-zero if this internal window is used in horizontal combination. */ - unsigned horizontal : 1; + bool horizontal : 1; /* Non-zero means must regenerate mode line of this window. */ - unsigned update_mode_line : 1; + bool update_mode_line : 1; /* Non-nil if the buffer was "modified" when the window was last updated. */ - unsigned last_had_star : 1; + bool last_had_star : 1; /* Non-zero means current value of `start' was the beginning of a line when it was chosen. */ - unsigned start_at_line_beg : 1; + bool start_at_line_beg : 1; /* Non-zero means next redisplay must use the value of start set up for it in advance. Set by scrolling commands. */ - unsigned force_start : 1; + bool force_start : 1; /* Non-zero means we have explicitly changed the value of start, but that the next redisplay is not obliged to use the new value. This is used in Fdelete_other_windows to force a call to Vwindow_scroll_functions; also by Frecenter with argument. */ - unsigned optional_new_start : 1; + bool optional_new_start : 1; /* Non-zero means the cursor is currently displayed. This can be set to zero by functions overpainting the cursor image. */ - unsigned phys_cursor_on_p : 1; + bool phys_cursor_on_p : 1; /* 0 means cursor is logically on, 1 means it's off. Used for blinking cursor. */ - unsigned cursor_off_p : 1; + bool cursor_off_p : 1; /* Value of cursor_off_p as of the last redisplay. */ - unsigned last_cursor_off_p : 1; + bool last_cursor_off_p : 1; /* 1 means desired matrix has been build and window must be updated in update_frame. */ - unsigned must_be_updated_p : 1; + bool must_be_updated_p : 1; /* Flag indicating that this window is not a real one. Currently only used for menu bar windows of frames. */ - unsigned pseudo_window_p : 1; + bool pseudo_window_p : 1; /* Non-zero means fringes are drawn outside display margins. Otherwise draw them between margin areas and text. */ - unsigned fringes_outside_margins : 1; + bool fringes_outside_margins : 1; /* Nonzero if window_end_pos and window_end_vpos are truly valid. This is zero if nontrivial redisplay is preempted since in that case the frame image that window_end_pos did not get onto the frame. */ - unsigned window_end_valid : 1; + bool window_end_valid : 1; + + /* True if it needs to be redisplayed. */ + bool redisplay : 1; /* Amount by which lines of this window are scrolled in y-direction (smooth scrolling). */ @@ -900,15 +903,32 @@ extern EMACS_INT minibuf_level; -/* true if we should redraw the mode lines on the next redisplay. */ +/* Non-zero if we should redraw the mode lines on the next redisplay. + Usually set to a unique small integer so we can track the main causes of + full redisplays in `redisplay--mode-lines-cause'. */ extern int update_mode_lines; /* Nonzero if window sizes or contents have changed since last - redisplay that finished. */ + redisplay that finished. Usually set to a unique small integer so + we can track the main causes of full redisplays in + `redisplay--all-windows-cause'. */ extern int windows_or_buffers_changed; +/* The main redisplay routine usually only redisplays the selected-window, + so when something's changed elsewhere, we call one of the functions below + to indicate which other windows might also need to be redisplayed. */ + +extern void wset_redisplay (struct window *w); +extern void fset_redisplay (struct frame *f); +extern void bset_redisplay (struct buffer *b); +extern void bset_update_mode_line (struct buffer *b); +/* Call this to tell redisplay to look for other windows than selected-window + that need to be redisplayed. Calling one of the *set_redisplay functions + above already does it, so it's only needed in unusual cases. */ +extern void redisplay_other_windows (void); + /* If *ROWS or *COLS are too small a size for FRAME, set them to the minimum allowable size. */ @@ -942,6 +962,7 @@ extern Lisp_Object Qwindow_live_p; extern Lisp_Object Vwindow_list; +extern Lisp_Object window_list (void); extern struct window *decode_live_window (Lisp_Object); extern struct window *decode_any_window (Lisp_Object); extern bool compare_window_configurations (Lisp_Object, Lisp_Object, bool); === modified file 'src/xdisp.c' --- src/xdisp.c 2013-11-14 17:43:49 +0000 +++ src/xdisp.c 2013-11-28 22:43:09 +0000 @@ -502,12 +502,20 @@ static bool message_enable_multibyte; -/* Nonzero if we should redraw the mode lines on the next redisplay. */ +/* Nonzero if we should redraw the mode lines on the next redisplay. + If it has value REDISPLAY_SOME, then only redisplay the mode lines where + the `redisplay' bit has been set. Otherwise, redisplay all mode lines + (the number used is then only used to track down the cause for this + full-redisplay). */ int update_mode_lines; -/* Nonzero if window sizes or contents have changed since last - redisplay that finished. */ +/* Nonzero if window sizes or contents other than selected-window have changed + since last redisplay that finished. + If it has value REDISPLAY_SOME, then only redisplay the windows where + the `redisplay' bit has been set. Otherwise, redisplay all windows + (the number used is then only used to track down the cause for this + full-redisplay). */ int windows_or_buffers_changed; @@ -599,6 +607,49 @@ CACHE = NULL; \ } while (0) +/* Functions to mark elements as needing redisplay. */ +enum { REDISPLAY_SOME = 2}; /* Arbitrary choice. */ + +void redisplay_other_windows (void) +{ + if (!windows_or_buffers_changed) + windows_or_buffers_changed = REDISPLAY_SOME; +} + +void wset_redisplay (struct window *w) +{ + redisplay_other_windows (); + w->redisplay = true; +} + +void fset_redisplay (struct frame *f) +{ + redisplay_other_windows (); + f->redisplay = true; +} + +void bset_redisplay (struct buffer *b) +{ + int count = buffer_window_count (b); + if (count > 0) + { + /* ... it's visible in other window than selected, */ + if (count > 1 || b != XBUFFER (XWINDOW (selected_window)->contents)) + redisplay_other_windows (); + /* Even if we don't set windows_or_buffers_changed, do set `redisplay' + so that if we later set windows_or_buffers_changed, this buffer will + not be omitted. */ + b->text->redisplay = true; + } +} + +extern void bset_update_mode_line (struct buffer *b) +{ + if (!update_mode_lines) + update_mode_lines = REDISPLAY_SOME; + b->text->redisplay = true; +} + #ifdef GLYPH_DEBUG /* Non-zero means print traces of redisplay if compiled with @@ -9468,7 +9519,6 @@ ptrdiff_t point_at_end = 0; ptrdiff_t zv_at_end = 0; Lisp_Object old_deactivate_mark; - bool shown; struct gcpro gcpro1; old_deactivate_mark = Vdeactivate_mark; @@ -9482,8 +9532,8 @@ Fset_buffer (Fget_buffer_create (Vmessages_buffer_name)); - if (newbuffer && - !NILP (Ffboundp (intern ("messages-buffer-mode")))) + if (newbuffer + && !NILP (Ffboundp (intern ("messages-buffer-mode")))) call0 (intern ("messages-buffer-mode")); } @@ -9625,18 +9675,17 @@ unchain_marker (XMARKER (oldbegv)); unchain_marker (XMARKER (oldzv)); - shown = buffer_window_count (current_buffer) > 0; - set_buffer_internal (oldbuf); /* We called insert_1_both above with its 5th argument (PREPARE) zero, which prevents insert_1_both from calling prepare_to_modify_buffer, which in turns prevents us from incrementing windows_or_buffers_changed even if *Messages* is - shown in some window. So we must manually incrementing + shown in some window. So we must manually set windows_or_buffers_changed here to make up for that. */ - if (shown) - windows_or_buffers_changed = 41; - else windows_or_buffers_changed = old_windows_or_buffers_changed; + bset_redisplay (current_buffer); + + set_buffer_internal (oldbuf); + message_log_need_newline = !nlflag; Vdeactivate_mark = old_deactivate_mark; } @@ -10325,15 +10374,8 @@ && WINDOWP (echo_area_window)) { struct window *w = XWINDOW (echo_area_window); - int resized_p; - Lisp_Object resize_exactly; - - if (minibuf_level == 0) - resize_exactly = Qt; - else - resize_exactly = Qnil; - - resized_p = with_echo_area_buffer (w, 0, resize_mini_window_1, + Lisp_Object resize_exactly = (minibuf_level == 0 ? Qt : Qnil); + int resized_p = with_echo_area_buffer (w, 0, resize_mini_window_1, (intptr_t) w, resize_exactly); if (resized_p) { @@ -10714,7 +10756,6 @@ if (frame_garbaged) { Lisp_Object tail, frame; - int changed_count = 0; FOR_EACH_FRAME (tail, frame) { @@ -10726,15 +10767,13 @@ redraw_frame (f); else clear_current_matrices (f); - changed_count++; - f->garbaged = 0; - f->resized_p = 0; + fset_redisplay (f); + f->garbaged = false; + f->resized_p = false; } } - frame_garbaged = 0; - if (changed_count) - windows_or_buffers_changed = 43; + frame_garbaged = false; } } @@ -10822,11 +10861,11 @@ redisplay displays the minibuffer, so that the cursor will be replaced with what the minibuffer wants. */ if (cursor_in_echo_area) - windows_or_buffers_changed = 45; + wset_redisplay (XWINDOW (mini_window)); } } else if (!EQ (mini_window, selected_window)) - windows_or_buffers_changed = 46; + wset_redisplay (XWINDOW (mini_window)); /* Last displayed message is now the current message. */ echo_area_buffer[1] = echo_area_buffer[0]; @@ -10842,16 +10881,6 @@ return window_height_changed_p; } -/* Nonzero if the current window's buffer is shown in more than one - window and was modified since last redisplay. */ - -static int -buffer_shared_and_changed (void) -{ - return (buffer_window_count (current_buffer) > 1 - && UNCHANGED_MODIFIED < MODIFF); -} - /* Nonzero if W's buffer was changed but not saved. */ static int @@ -11171,9 +11200,13 @@ static void prepare_menu_bars (void) { - int all_windows; + bool all_windows = windows_or_buffers_changed || update_mode_lines; + bool some_windows + = (windows_or_buffers_changed == 0 + || windows_or_buffers_changed == REDISPLAY_SOME) + && (update_mode_lines == 0 + || update_mode_lines == REDISPLAY_SOME); struct gcpro gcpro1, gcpro2; - struct frame *f; Lisp_Object tooltip_frame; #ifdef HAVE_WINDOW_SYSTEM @@ -11182,17 +11215,45 @@ tooltip_frame = Qnil; #endif + if (FUNCTIONP (Vpre_redisplay_function)) + { + Lisp_Object windows = all_windows ? Qt : Qnil; + if (all_windows && some_windows) + { + Lisp_Object ws = window_list (); + for (windows = Qnil; CONSP (ws); ws = XCDR (ws)) + { + Lisp_Object this = XCAR (ws); + struct window *w = XWINDOW (this); + if (w->redisplay + || XFRAME (w->frame)->redisplay + || XBUFFER (w->contents)->text->redisplay) + { + windows = Fcons (this, windows); + } + } + } + safe_call1 (Vpre_redisplay_function, windows); + } + /* Update all frame titles based on their buffer names, etc. We do this before the menu bars so that the buffer-menu will show the up-to-date frame titles. */ #ifdef HAVE_WINDOW_SYSTEM - if (windows_or_buffers_changed || update_mode_lines) + if (all_windows) { Lisp_Object tail, frame; FOR_EACH_FRAME (tail, frame) { - f = XFRAME (frame); + struct frame *f = XFRAME (frame); + struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (f)); + if (some_windows + && !f->redisplay + && !w->redisplay + && !XBUFFER (w->contents)->text->redisplay) + continue; + if (!EQ (frame, tooltip_frame) && (FRAME_ICONIFIED_P (f) || FRAME_VISIBLE_P (f) == 1 @@ -11213,12 +11274,6 @@ /* Update the menu bar item lists, if appropriate. This has to be done before any actual redisplay or generation of display lines. */ - all_windows = (update_mode_lines - || buffer_shared_and_changed () - || windows_or_buffers_changed); - - if (FUNCTIONP (Vpre_redisplay_function)) - safe_call1 (Vpre_redisplay_function, all_windows ? Qt : Qnil); if (all_windows) { @@ -11232,12 +11287,19 @@ FOR_EACH_FRAME (tail, frame) { - f = XFRAME (frame); + struct frame *f = XFRAME (frame); + struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (f)); /* Ignore tooltip frame. */ if (EQ (frame, tooltip_frame)) continue; + if (some_windows + && !f->redisplay + && !w->redisplay + && !XBUFFER (w->contents)->text->redisplay) + continue; + /* If a window on this frame changed size, report that to the user and clear the size-change flag. */ if (FRAME_WINDOW_SIZES_CHANGED (f)) @@ -12860,6 +12922,27 @@ } } +void propagate_buffer_redisplay (void) +{ /* Resetting b->text->redisplay is problematic! + We can't just reset it in the case that some window that displays + it has not been redisplayed; and such a window can stay + unredisplayed for a long time if it's currently invisible. + But we do want to reset it at the end of redisplay otherwise + its displayed windows will keep being redisplayed over and over + again. + So we copy all b->text->redisplay flags up to their windows here, + such that mark_window_display_accurate can safely reset + b->text->redisplay. */ + Lisp_Object ws = window_list (); + for (; CONSP (ws); ws = XCDR (ws)) + { + struct window *thisw = XWINDOW (XCAR (ws)); + struct buffer *thisb = XBUFFER (thisw->contents); + if (thisb->text->redisplay) + thisw->redisplay = true; + } +} + #define STOP_POLLING \ do { if (! polling_stopped_here) stop_polling (); \ polling_stopped_here = 1; } while (0) @@ -12956,7 +13039,6 @@ /* Since frames on a single ASCII terminal share the same display area, displaying a different frame means redisplay the whole thing. */ - windows_or_buffers_changed = 48; SET_FRAME_GARBAGED (sf); #ifndef DOS_NT set_tty_color_mode (FRAME_TTY (sf), sf); @@ -13005,9 +13087,6 @@ if (NILP (Vmemory_full)) prepare_menu_bars (); - if (windows_or_buffers_changed && !update_mode_lines) - update_mode_lines = 32; - reconsider_clip_changes (w); /* In most cases selected window displays current buffer. */ @@ -13016,27 +13095,12 @@ { /* Detect case that we need to write or remove a star in the mode line. */ if ((SAVE_MODIFF < MODIFF) != w->last_had_star) - { w->update_mode_line = 1; - if (buffer_shared_and_changed ()) - update_mode_lines = 33; - } if (mode_line_update_needed (w)) w->update_mode_line = 1; } - consider_all_windows_p = (update_mode_lines - || buffer_shared_and_changed ()); - - /* If specs for an arrow have changed, do thorough redisplay - to ensure we remove any arrow that should no longer exist. */ - if (overlay_arrows_changed_p ()) - { - consider_all_windows_p = true; - windows_or_buffers_changed = 49; - } - /* Normally the message* functions will have already displayed and updated the echo area, but the frame may have been trashed, or the update may have been preempted, so display the echo area @@ -13066,8 +13130,6 @@ if (window_height_changed_p) { - consider_all_windows_p = true; - update_mode_lines = 34; windows_or_buffers_changed = 50; /* If window configuration was changed, frames may have been @@ -13083,13 +13145,6 @@ /* Resized active mini-window to fit the size of what it is showing if its contents might have changed. */ must_finish = 1; - /* FIXME: this causes all frames to be updated, which seems unnecessary - since only the current frame needs to be considered. This function - needs to be rewritten with two variables, consider_all_windows and - consider_all_frames. */ - consider_all_windows_p = true; - windows_or_buffers_changed = 51; - update_mode_lines = 35; /* If window configuration was changed, frames may have been marked garbaged. Clear them or we will experience @@ -13097,23 +13152,29 @@ clear_garbaged_frames (); } - if (VECTORP (Vredisplay__all_windows_cause) - && windows_or_buffers_changed >= 0 - && windows_or_buffers_changed < ASIZE (Vredisplay__all_windows_cause) - && INTEGERP (AREF (Vredisplay__all_windows_cause, - windows_or_buffers_changed))) - ASET (Vredisplay__all_windows_cause, windows_or_buffers_changed, - make_number (1 + XINT (AREF (Vredisplay__all_windows_cause, - windows_or_buffers_changed)))); - - if (VECTORP (Vredisplay__mode_lines_cause) - && update_mode_lines >= 0 - && update_mode_lines < ASIZE (Vredisplay__mode_lines_cause) - && INTEGERP (AREF (Vredisplay__mode_lines_cause, - update_mode_lines))) - ASET (Vredisplay__mode_lines_cause, update_mode_lines, - make_number (1 + XINT (AREF (Vredisplay__mode_lines_cause, - update_mode_lines)))); + if (windows_or_buffers_changed && !update_mode_lines) + /* Code that sets windows_or_buffers_changed doesn't distinguish whether + only the windows's contents needs to be refreshed, or whether the + mode-lines also need a refresh. */ + update_mode_lines = (windows_or_buffers_changed == REDISPLAY_SOME + ? REDISPLAY_SOME : 32); + + /* If specs for an arrow have changed, do thorough redisplay + to ensure we remove any arrow that should no longer exist. */ + if (overlay_arrows_changed_p ()) + /* Apparently, this is the only case where we update other windows, + without updating other mode-lines. */ + windows_or_buffers_changed = 49; + + consider_all_windows_p = (update_mode_lines + || windows_or_buffers_changed); + +#define AINC(a,i) \ + if (VECTORP (a) && i >= 0 && i < ASIZE (a) && INTEGERP (AREF (a, i))) \ + ASET (a, i, make_number (1 + XINT (AREF (a, i)))) + + AINC (Vredisplay__all_windows_cause, windows_or_buffers_changed); + AINC (Vredisplay__mode_lines_cause, update_mode_lines); /* Optimize the case that only the line containing the cursor in the selected window has changed. Variables starting with this_ are @@ -13330,6 +13391,8 @@ FOR_EACH_FRAME (tail, frame) XFRAME (frame)->updated_p = 0; + propagate_buffer_redisplay (); + FOR_EACH_FRAME (tail, frame) { struct frame *f = XFRAME (frame); @@ -13344,9 +13407,12 @@ if (FRAME_WINDOW_P (f) || FRAME_TERMCAP_P (f) || f == sf) { + bool gcscrollbars + /* Only GC scollbars when we redisplay the whole frame. */ + = f->redisplay || windows_or_buffers_changed != REDISPLAY_SOME; /* Mark all the scroll bars to be removed; we'll redeem the ones we want when we redisplay their windows. */ - if (FRAME_TERMINAL (f)->condemn_scroll_bars_hook) + if (gcscrollbars && FRAME_TERMINAL (f)->condemn_scroll_bars_hook) FRAME_TERMINAL (f)->condemn_scroll_bars_hook (f); if (FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f)) @@ -13358,7 +13424,7 @@ /* Any scroll bars which redisplay_windows should have nuked should now go away. */ - if (FRAME_TERMINAL (f)->judge_scroll_bars_hook) + if (gcscrollbars && FRAME_TERMINAL (f)->judge_scroll_bars_hook) FRAME_TERMINAL (f)->judge_scroll_bars_hook (f); if (FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f)) @@ -13413,6 +13479,7 @@ struct frame *f = XFRAME (frame); if (f->updated_p) { + f->redisplay = false; mark_window_display_accurate (f->root_window, 1); if (FRAME_TERMINAL (f)->frame_up_to_date_hook) FRAME_TERMINAL (f)->frame_up_to_date_hook (f); @@ -13502,6 +13569,11 @@ { /* This has already been done above if consider_all_windows_p is set. */ + if (XBUFFER (w->contents)->text->redisplay + && buffer_window_count (XBUFFER (w->contents)) > 1) + /* This can happen if b->text->redisplay was set during + jit-lock. */ + propagate_buffer_redisplay (); mark_window_display_accurate_1 (w, 1); /* Say overlay arrows are up to date. */ @@ -13535,12 +13607,7 @@ FOR_EACH_FRAME (tail, frame) { - int this_is_visible = 0; - if (XFRAME (frame)->visible) - this_is_visible = 1; - - if (this_is_visible) new_count++; } @@ -13639,8 +13706,13 @@ if (accurate_p) { - b->clip_changed = 0; - b->prevent_redisplay_optimizations_p = 0; + b->clip_changed = false; + b->prevent_redisplay_optimizations_p = false; + eassert (buffer_window_count (b) > 0); + /* Resetting b->text->redisplay is problematic! + In order to make it safer to do it here, redisplay_internal must + have copied all b->text->redisplay to their respective windows. */ + b->text->redisplay = false; BUF_UNCHANGED_MODIFIED (b) = BUF_MODIFF (b); BUF_OVERLAY_UNCHANGED_MODIFIED (b) = BUF_OVERLAY_MODIFF (b); @@ -13659,9 +13731,11 @@ else w->last_point = marker_position (w->pointm); - w->window_end_valid = 1; - w->update_mode_line = 0; + w->window_end_valid = true; + w->update_mode_line = false; } + + w->redisplay = !accurate_p; } @@ -14314,9 +14388,9 @@ occlude point. Only set w->cursor if we found a better approximation to the cursor position than we have from previously examined candidate rows belonging to the same continued line. */ - if (/* we already have a candidate row */ + if (/* We already have a candidate row. */ w->cursor.vpos >= 0 - /* that candidate is not the row we are processing */ + /* That candidate is not the row we are processing. */ && MATRIX_ROW (matrix, w->cursor.vpos) != row /* Make sure cursor.vpos specifies a row whose start and end charpos occlude point, and it is valid candidate for being a @@ -14327,30 +14401,30 @@ && pt_old <= MATRIX_ROW_END_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos)) && cursor_row_p (MATRIX_ROW (matrix, w->cursor.vpos))) { - struct glyph *g1 = - MATRIX_ROW_GLYPH_START (matrix, w->cursor.vpos) + w->cursor.hpos; + struct glyph *g1 + = MATRIX_ROW_GLYPH_START (matrix, w->cursor.vpos) + w->cursor.hpos; /* Don't consider glyphs that are outside TEXT_AREA. */ if (!(row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end)) return 0; /* Keep the candidate whose buffer position is the closest to point or has the `cursor' property. */ - if (/* previous candidate is a glyph in TEXT_AREA of that row */ + if (/* Previous candidate is a glyph in TEXT_AREA of that row. */ w->cursor.hpos >= 0 && w->cursor.hpos < MATRIX_ROW_USED (matrix, w->cursor.vpos) && ((BUFFERP (g1->object) - && (g1->charpos == pt_old /* an exact match always wins */ + && (g1->charpos == pt_old /* An exact match always wins. */ || (BUFFERP (glyph->object) && eabs (g1->charpos - pt_old) < eabs (glyph->charpos - pt_old)))) - /* previous candidate is a glyph from a string that has - a non-nil `cursor' property */ + /* Previous candidate is a glyph from a string that has + a non-nil `cursor' property. */ || (STRINGP (g1->object) && (!NILP (Fget_char_property (make_number (g1->charpos), Qcursor, g1->object)) - /* previous candidate is from the same display + /* Previous candidate is from the same display string as this one, and the display string - came from a text property */ + came from a text property. */ || (EQ (g1->object, glyph->object) && string_from_text_prop) /* this candidate is from newline and its @@ -15329,6 +15403,16 @@ *w->desired_matrix->method = 0; #endif + if (!just_this_one_p + && (update_mode_lines == REDISPLAY_SOME + || update_mode_lines == 0) + && (windows_or_buffers_changed == REDISPLAY_SOME + || windows_or_buffers_changed == 0) + && !w->redisplay + && !f->redisplay + && !buffer->text->redisplay) + return; + /* Make sure that both W's markers are valid. */ eassert (XMARKER (w->start)->buffer == buffer); eassert (XMARKER (w->pointm)->buffer == buffer); === modified file 'src/xterm.c' --- src/xterm.c 2013-11-24 18:28:33 +0000 +++ src/xterm.c 2013-11-28 22:43:09 +0000 @@ -6202,7 +6202,7 @@ SET_FRAME_GARBAGED (f); /* Check if fullscreen was specified before we where mapped the - first time, i.e. from the command line. */ + first time, i.e. from the command line. */ if (!f->output_data.x->has_been_visible) x_check_fullscreen (f); ------------------------------------------------------------ revno: 115271 committer: Glenn Morris branch nick: trunk timestamp: Thu 2013-11-28 12:31:55 -0800 message: * leim/leim-ext.el: Change method for getting comments in the output to one that does not fool lisp/compile-main's no-byte-compile test. * leim/Makefile.in (${leimdir}/leim-list.el): Adapt for this. diff: === modified file 'leim/ChangeLog' --- leim/ChangeLog 2013-11-27 18:29:28 +0000 +++ leim/ChangeLog 2013-11-28 20:31:55 +0000 @@ -1,3 +1,9 @@ +2013-11-28 Glenn Morris + + * Makefile.in (${leimdir}/leim-list.el): + * leim-ext.el: Change method for getting comments in the output + to one that does not fool lisp/compile-main's no-byte-compile test. + 2013-11-27 Glenn Morris * Makefile.in (bootstrap-clean): No need to delete .elc, === modified file 'leim/Makefile.in' --- leim/Makefile.in 2013-11-27 18:29:28 +0000 +++ leim/Makefile.in 2013-11-28 20:31:55 +0000 @@ -132,7 +132,7 @@ rm -f $@ ${RUN_EMACS} -l international/quail \ --eval "(update-leim-list-file (unmsys--file-name \"${leimdir}\"))" - sed -n '/^[^;]/ p' < ${srcdir}/leim-ext.el >> $@ + sed -n -e '/^[^;]/p' -e 's/;inc/;/p' < ${srcdir}/leim-ext.el >> $@ ${leimdir}/ja-dic/ja-dic.el: $(srcdir)/SKK-DIC/SKK-JISYO.L @$(MKDIR_P) $(leimdir)/ja-dic === modified file 'leim/leim-ext.el' --- leim/leim-ext.el 2013-11-27 06:15:06 +0000 +++ leim/leim-ext.el 2013-11-28 20:31:55 +0000 @@ -76,16 +76,17 @@ 'hangul390-input-method "Input method: korean-hangul390 (mode line indicator:한390)\n\nHangul 3-Bulsik 390 input method.") -;; Following lines are indented so that Makefile adds them to output. +;; Following lines are marked such that Makefile adds them to output. ;; leim-list-header adds "coding: utf-8"; we could move that here, ;; unless others are using that stuff to generate their own leim files. - - ;; Local Variables: - ;; no-byte-compile: t - ;; version-control: never - ;; no-update-autoloads: t - ;; End: - - ;;; leim-list.el ends here +;; TODO? Better to add leim-list-footer? + +;;inc Local Variables: +;;inc no-byte-compile: t +;;inc version-control: never +;;inc no-update-autoloads: t +;;inc End: + +;;;inc leim-list.el ends here ;;; leim-ext.el ends here ------------------------------------------------------------ revno: 115270 committer: Glenn Morris branch nick: trunk timestamp: Thu 2013-11-28 12:21:55 -0800 message: * unidata-gen.el (unidata-gen-files): Disable autoloads in generated files. diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2013-11-27 18:25:44 +0000 +++ admin/ChangeLog 2013-11-28 20:21:55 +0000 @@ -1,3 +1,8 @@ +2013-11-28 Glenn Morris + + * unidata/unidata-gen.el (unidata-gen-files): + Disable autoloads in generated files. + 2013-11-27 Glenn Morris * unidata/Makefile.in (all, install, clean, bootstrap-clean) === modified file 'admin/unidata/unidata-gen.el' --- admin/unidata/unidata-gen.el 2013-11-11 00:50:52 +0000 +++ admin/unidata/unidata-gen.el 2013-11-28 20:21:55 +0000 @@ -1241,6 +1241,7 @@ ";; coding: utf-8\n" ";; version-control: never\n" ";; no-byte-compile: t\n" + ";; no-update-autoloads: t\n" ";; End:\n\n" (format ";; %s ends here\n" basename))) (write-file file) @@ -1250,6 +1251,7 @@ ";; coding: utf-8\n" ";; version-control: never\n" ";; no-byte-compile: t\n" + ";; no-update-autoloads: t\n" ";; End:\n\n" (format ";; %s ends here\n" (file-name-nondirectory charprop-file)))))) ------------------------------------------------------------ revno: 115269 fixes bug: http://debbugs.gnu.org/15933 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2013-11-28 21:40:15 +0200 message: Fix bug #15933 with crashes in file-notify-tests on MS-Windows. Support w32 file notifications in batch mode. src/w32proc.c (sys_select): Don't wait on interrupt_handle if it is invalid (which happens in batch mode). If non-interactive, call handle_file_notifications to store file notification events in the input queue. src/w32notify.c (send_notifications): Handle FRAME_INITIAL frames as well. src/w32inevt.c (handle_file_notifications): Now external, not static. src/w32term.h (handle_file_notifications): Provide prototype. src/emacs.c (main) [HAVE_W32NOTIFY]: When non-interactive, call init_crit, since init_display, which does that otherwise, is not called. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-27 18:25:44 +0000 +++ src/ChangeLog 2013-11-28 19:40:15 +0000 @@ -1,3 +1,23 @@ +2013-11-28 Eli Zaretskii + + Support w32 file notifications in batch mode. + * w32proc.c (sys_select): Don't wait on interrupt_handle if it is + invalid (which happens in batch mode). If non-interactive, call + handle_file_notifications to store file notification events in the + input queue. (Bug#15933) + + * w32notify.c (send_notifications): Handle FRAME_INITIAL frames as + well. + + * w32inevt.c (handle_file_notifications): Now external, not + static. + + * w32term.h (handle_file_notifications): Provide prototype. + + * emacs.c (main) [HAVE_W32NOTIFY]: When non-interactive, call + init_crit, since init_display, which does that otherwise, is not + called. + 2013-11-27 Glenn Morris * Makefile.in ($(lispsource)/international/charprop.el): New. === modified file 'src/emacs.c' --- src/emacs.c 2013-11-23 01:55:16 +0000 +++ src/emacs.c 2013-11-28 19:40:15 +0000 @@ -1517,6 +1517,10 @@ init_keyboard (); /* This too must precede init_sys_modes. */ if (!noninteractive) init_display (); /* Determine terminal type. Calls init_sys_modes. */ +#if HAVE_W32NOTIFY + else + init_crit (); /* w32notify.c needs this in batch mode. */ +#endif /* HAVE_W32NOTIFY */ init_xdisp (); #ifdef HAVE_WINDOW_SYSTEM init_fringe (); === modified file 'src/w32inevt.c' --- src/w32inevt.c 2013-11-05 07:44:14 +0000 +++ src/w32inevt.c 2013-11-28 19:40:15 +0000 @@ -608,7 +608,7 @@ } #if HAVE_W32NOTIFY -static int +int handle_file_notifications (struct input_event *hold_quit) { BYTE *p = file_notifications; @@ -676,7 +676,7 @@ return nevents; } #else /* !HAVE_W32NOTIFY */ -static int +int handle_file_notifications (struct input_event *hold_quit) { return 0; === modified file 'src/w32notify.c' --- src/w32notify.c 2013-11-27 16:03:02 +0000 +++ src/w32notify.c 2013-11-28 19:40:15 +0000 @@ -163,7 +163,12 @@ && PostThreadMessage (dwMainThreadId, WM_EMACS_FILENOTIFY, 0, 0)) || (FRAME_W32_P (f) && PostMessage (FRAME_W32_WINDOW (f), - WM_EMACS_FILENOTIFY, 0, 0))) + WM_EMACS_FILENOTIFY, 0, 0)) + /* When we are running in batch mode, there's no one to + send a message, so we just signal the data is + available and hope sys_select will be called soon and + will read the data. */ + || (FRAME_INITIAL_P (f) && noninteractive)) notification_buffer_in_use = 1; done = 1; } === modified file 'src/w32proc.c' --- src/w32proc.c 2013-10-14 16:23:10 +0000 +++ src/w32proc.c 2013-11-28 19:40:15 +0000 @@ -1960,12 +1960,17 @@ FD_ZERO (rfds); nr = 0; - /* Always wait on interrupt_handle, to detect C-g (quit). */ - wait_hnd[0] = interrupt_handle; - fdindex[0] = -1; + /* If interrupt_handle is available and valid, always wait on it, to + detect C-g (quit). */ + nh = 0; + if (interrupt_handle && interrupt_handle != INVALID_HANDLE_VALUE) + { + wait_hnd[0] = interrupt_handle; + fdindex[0] = -1; + nh++; + } /* Build a list of pipe handles to wait on. */ - nh = 1; for (i = 0; i < nfds; i++) if (FD_ISSET (i, &orfds)) { @@ -1986,6 +1991,11 @@ FD_SET (i, rfds); return 1; } + else if (noninteractive) + { + if (handle_file_notifications (NULL)) + return 1; + } } else { @@ -2086,6 +2096,11 @@ { if (timeout) Sleep (timeout_ms); + if (noninteractive) + { + if (handle_file_notifications (NULL)) + return 1; + } return 0; } @@ -2112,6 +2127,11 @@ } else if (active == WAIT_TIMEOUT) { + if (noninteractive) + { + if (handle_file_notifications (NULL)) + return 1; + } return 0; } else if (active >= WAIT_OBJECT_0 @@ -2218,6 +2238,12 @@ break; } while (active < nh + nc); + if (noninteractive) + { + if (handle_file_notifications (NULL)) + nr++; + } + /* If no input has arrived and timeout hasn't expired, wait again. */ if (nr == 0) { === modified file 'src/w32term.h' --- src/w32term.h 2013-10-29 05:55:25 +0000 +++ src/w32term.h 2013-11-28 19:40:15 +0000 @@ -680,6 +680,7 @@ extern void *notifications_desc; extern Lisp_Object w32_get_watch_object (void *); extern Lisp_Object lispy_file_action (DWORD); +extern int handle_file_notifications (struct input_event *); extern void w32_initialize_display_info (Lisp_Object); extern void initialize_w32_display (struct terminal *, int *, int *); ------------------------------------------------------------ revno: 115268 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2013-11-28 19:45:26 +0200 message: Remove left-overs from using nt/mingw-cfg.site as a CONFIG_SITE file. GNUmakefile (Makefile): Don't use $(CFG). (CFG): Don't compute. diff: === modified file 'ChangeLog' --- ChangeLog 2013-11-28 17:35:13 +0000 +++ ChangeLog 2013-11-28 17:45:26 +0000 @@ -1,5 +1,8 @@ 2013-11-28 Eli Zaretskii + * GNUmakefile (Makefile): Don't use $(CFG). + (CFG): Don't compute. + * configure.ac (PATH_SEP): Set and AC_SUBST. 2013-11-27 Paul Eggert === modified file 'GNUmakefile' --- GNUmakefile 2013-11-05 07:54:03 +0000 +++ GNUmakefile 2013-11-28 17:45:26 +0000 @@ -32,12 +32,6 @@ # run "configure" by hand. But run autogen.sh first, if the source # was checked out directly from the repository. -ifneq ($(MSYSTEM),) -CFG = CONFIG_SITE=$(CURDIR)/nt/mingw-cfg.site -else -CFG = -endif - # If a Makefile already exists, just use it. ifeq ($(wildcard Makefile),Makefile) @@ -75,7 +69,7 @@ Makefile: configure @echo >&2 'There seems to be no Makefile in this directory.' @echo >&2 'Running ./configure ...' - $(CFG) ./configure + ./configure @echo >&2 'Makefile built.' endif ------------------------------------------------------------ revno: 115267 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2013-11-28 19:35:13 +0200 message: Fix the test suite on Windows. configure.ac (PATH_SEP): Set and AC_SUBST. test/automated/Makefile.in (PATH_SEP): Set this instead of PATH_SEPARATOR. (EMACSOPT): Use $(PATH_SEP). diff: === modified file 'ChangeLog' --- ChangeLog 2013-11-27 23:58:03 +0000 +++ ChangeLog 2013-11-28 17:35:13 +0000 @@ -1,3 +1,7 @@ +2013-11-28 Eli Zaretskii + + * configure.ac (PATH_SEP): Set and AC_SUBST. + 2013-11-27 Paul Eggert Merge from gnulib, incorporating: === modified file 'configure.ac' --- configure.ac 2013-11-27 06:15:06 +0000 +++ configure.ac 2013-11-28 17:35:13 +0000 @@ -923,6 +923,22 @@ LN_S="ln" fi +dnl This is for MinGW, and is used in test/automated/Makefile.in. +dnl The MSYS Bash has heuristics for replacing ':' with ';' when it +dnl decides that a command-line argument to be passed to a MinGW program +dnl is a PATH-style list of directories. But that heuristics plays it +dnl safe, and only does the replacement when it is _absolutely_ sure it +dnl sees a colon-seperated list of file names; e.g. ":." is left alone, +dnl which breaks in-tree builds. So we do this manually instead. +dnl Note that we cannot rely on PATH_SEPARATOR, as that one will always +dnl be computed as ':' in MSYS Bash. +if test "$opsys" = "mingw32"; then + PATH_SEP=';' +else + PATH_SEP=':' +fi +AC_SUBST(PATH_SEP) + AC_PATH_PROG(INSTALL_INFO, install-info, :, $PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin) dnl Don't use GZIP, which is used by gzip for additional parameters. === modified file 'test/ChangeLog' --- test/ChangeLog 2013-11-28 16:14:13 +0000 +++ test/ChangeLog 2013-11-28 17:35:13 +0000 @@ -1,3 +1,9 @@ +2013-11-28 Eli Zaretskii + + * automated/Makefile.in (PATH_SEP): Set this instead of + PATH_SEPARATOR. + (EMACSOPT): Use $(PATH_SEP). + 2013-11-28 Michael Albinus * automated/file-notify-tests.el (auto-revert-stop-on-user-input): === modified file 'test/automated/Makefile.in' --- test/automated/Makefile.in 2013-11-23 01:55:16 +0000 +++ test/automated/Makefile.in 2013-11-28 17:35:13 +0000 @@ -22,7 +22,7 @@ srcdir = @srcdir@ VPATH = $(srcdir) -PATH_SEPARATOR = @PATH_SEPARATOR@ +PATH_SEP = @PATH_SEP@ # Empty for all systems except MinGW, where xargs needs an explicit # limitation. @@ -36,7 +36,7 @@ # Command line flags for Emacs. # Apparently MSYS bash would convert "-L :" to "-L ;" anyway, # but we might as well be explicit. -EMACSOPT = -batch --no-site-file --no-site-lisp -L "$(PATH_SEPARATOR)$(srcdir)" +EMACSOPT = -batch --no-site-file --no-site-lisp -L "$(PATH_SEP)$(srcdir)" # Extra flags to pass to the byte compiler. BYTE_COMPILE_EXTRA_FLAGS = ------------------------------------------------------------ revno: 115266 committer: Michael Albinus branch nick: trunk timestamp: Thu 2013-11-28 17:14:13 +0100 message: * automated/file-notify-tests.el (auto-revert-stop-on-user-input): Set to nil. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2013-11-27 14:23:32 +0000 +++ test/ChangeLog 2013-11-28 16:14:13 +0000 @@ -1,3 +1,8 @@ +2013-11-28 Michael Albinus + + * automated/file-notify-tests.el (auto-revert-stop-on-user-input): + Set to nil. + 2013-11-27 Michael Albinus * automated/file-notify-tests.el === modified file 'test/automated/file-notify-tests.el' --- test/automated/file-notify-tests.el 2013-11-27 14:23:32 +0000 +++ test/automated/file-notify-tests.el 2013-11-28 16:14:13 +0000 @@ -232,9 +232,10 @@ (file-notify--deftest-remote file-notify-test02-events "Check file creation/removal notifications for remote files.") -;; autorevert runs only in interactive mode. (defvar auto-revert-remote-files) -(setq auto-revert-remote-files t) +(defvar auto-revert-stop-on-user-input) +(setq auto-revert-remote-files t + auto-revert-stop-on-user-input nil) (require 'autorevert) (ert-deftest file-notify-test03-autorevert () ------------------------------------------------------------ revno: 115265 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-11-27 20:49:25 -0500 message: * lisp/vc/vc-dispatcher.el (vc-log-edit): Setup the Summary&Author headers. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-27 18:25:44 +0000 +++ lisp/ChangeLog 2013-11-28 01:49:25 +0000 @@ -1,3 +1,7 @@ +2013-11-28 Stefan Monnier + + * vc/vc-dispatcher.el (vc-log-edit): Setup the Summary&Author headers. + 2013-11-27 Glenn Morris * international/charprop.el, international/uni-bidi.el: === modified file 'lisp/vc/vc-dispatcher.el' --- lisp/vc/vc-dispatcher.el 2013-09-12 06:58:57 +0000 +++ lisp/vc/vc-dispatcher.el 2013-11-28 01:49:25 +0000 @@ -596,7 +596,7 @@ (setq default-directory (buffer-local-value 'default-directory vc-parent-buffer)) (log-edit 'vc-finish-logentry - nil + t `((log-edit-listfun . (lambda () ;; FIXME: Should expand the list ;; for directories.