------------------------------------------------------------ revno: 114667 committer: Paul Eggert branch nick: trunk timestamp: Mon 2013-10-14 23:36:43 -0700 message: Space after comma in ChangeLogs. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-10-15 02:45:03 +0000 +++ src/ChangeLog 2013-10-15 06:36:43 +0000 @@ -761,7 +761,7 @@ * alloc.c (USE_VALGRIND): New macro; on by default when ENABLE_CHECKING. - (mark_maybe_object,mark_maybe_pointer) + (mark_maybe_object, mark_maybe_pointer) [USE_VALGRIND]: Mark conservatively-scanned regions valid for valgrind purposes. (valgrind_p) [USE_VALGRIND]: New variable. @@ -789,15 +789,15 @@ 2013-09-22 Daniel Colascione * data.c (Qbool_vector_p): New symbol. - (bool_vector_spare_mask,popcount_size_t_generic) - (popcount_size_t_msc,popcount_size_t_gcc) + (bool_vector_spare_mask, popcount_size_t_generic) + (popcount_size_t_msc, popcount_size_t_gcc) (popcount_size_t) (bool_vector_binop_driver) - (count_trailing_zero_bits,size_t_to_host_endian) + (count_trailing_zero_bits, size_t_to_host_endian) (Fbool_vector_exclusive_or) (Fbool_vector_union) - (Fbool_vector_intersection,Fbool_vector_set_difference) - (Fbool_vector_subsetp,Fbool_vector_not) + (Fbool_vector_intersection, Fbool_vector_set_difference) + (Fbool_vector_subsetp, Fbool_vector_not) (Fbool_vector_count_matches) (Fbool_vector_count_matches_at): New functions. (syms_of_data): Intern new symbol, functions. @@ -806,11 +806,11 @@ which performs redundant initialization and argument checking, just call allocate_vector ourselves. Make sure we clear any terminating padding to zero. - (vector_nbytes,sweep_vectors): Use bool_vector_payload_bytes + (vector_nbytes, sweep_vectors): Use bool_vector_payload_bytes instead of open-coding the size calculation. (vroundup_ct): New macro. (vroundup): Assume argument >= 0; invoke vroundup_ct. - * casetab.c (shuffle,set_identity): Change lint_assume to assume. + * casetab.c (shuffle, set_identity): Change lint_assume to assume. * composite.c (composition_gstring_put_cache): Change lint_assume to assume. * conf_post.h (assume): New macro. @@ -821,8 +821,8 @@ * image.c (gif_load): Change lint_assume to assume. * lisp.h (eassert_and_assume): New macro. (Qbool_vector_p): Declare. - (CHECK_BOOL_VECTOR,ROUNDUP,BITS_PER_SIZE_T): New macros. - (swap16,swap32,swap64): New inline functions. + (CHECK_BOOL_VECTOR, ROUNDUP, BITS_PER_SIZE_T): New macros. + (swap16, swap32, swap64): New inline functions. * macfont.c (macfont_shape): Change lint_assume to assume. * ralloc.c: Rename ROUNDUP to PAGE_ROUNDUP throughout. * xsettings.c (parse_settings): Use new swap16 and @@ -2008,7 +2008,7 @@ in update_window_end_hook and draw_window_cursor functions. (display_and_set_cursor, x_update_cursor): Adjust prototypes. * nsterm.m (ns_update_window_end, ns_draw_window_cursor): - * w32term.c (x_update_window_end,w32_draw_window_cursor): + * w32term.c (x_update_window_end, w32_draw_window_cursor): * xterm.c (x_update_window_end, x_draw_window_cursor): * xdisp.c (display_and_set_cursor, update_window_cursor) (update_cursor_in_window_tree, x_update_cursor): Use bool and === modified file 'test/ChangeLog' --- test/ChangeLog 2013-10-14 01:51:20 +0000 +++ test/ChangeLog 2013-10-15 06:36:43 +0000 @@ -94,11 +94,11 @@ * automated/data-test.el: (bool-vector-count-matches-all-0-nil) (bool-vector-count-matches-all-0-t) - (bool-vector-count-matches-1-il,bool-vector-count-matches-1-t) - (bool-vector-count-matches-at,bool-vector-intersection-op) - (bool-vector-union-op,bool-vector-xor-op) + (bool-vector-count-matches-1-il, bool-vector-count-matches-1-t) + (bool-vector-count-matches-at, bool-vector-intersection-op) + (bool-vector-union-op, bool-vector-xor-op) (bool-vector-set-difference-op) - (bool-vector-change-detection,bool-vector-not): New tests. + (bool-vector-change-detection, bool-vector-not): New tests. (mock-bool-vector-count-matches-at) (test-bool-vector-bv-from-hex-string) (test-bool-vector-to-hex-string) ------------------------------------------------------------ revno: 114666 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2013-10-15 06:45:03 +0400 message: * nsterm.h (struct ns_display_info): Remove set-but-unused member image_cache (image caches are per-terminal anyway). (FRAME_X_IMAGE_CACHE): Remove. * nsterm.m (ns_initialize_display_info): Adjust user. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-10-14 16:23:10 +0000 +++ src/ChangeLog 2013-10-15 02:45:03 +0000 @@ -1,3 +1,10 @@ +2013-10-15 Dmitry Antipov + + * nsterm.h (struct ns_display_info): Remove set-but-unused + member image_cache (image caches are per-terminal anyway). + (FRAME_X_IMAGE_CACHE): Remove. + * nsterm.m (ns_initialize_display_info): Adjust user. + 2013-10-14 Eli Zaretskii * w32proc.c: Include mingw_time.h. === modified file 'src/nsterm.h' --- src/nsterm.h 2013-10-08 17:49:20 +0000 +++ src/nsterm.h 2013-10-15 02:45:03 +0000 @@ -569,8 +569,6 @@ ptrdiff_t bitmaps_size; ptrdiff_t bitmaps_last; - struct image_cache *image_cache; - struct ns_color_table *color_table; /* DPI resolution of this screen */ @@ -714,8 +712,6 @@ #define FRAME_FOREGROUND_COLOR(f) ((f)->output_data.ns->foreground_color) #define FRAME_BACKGROUND_COLOR(f) ((f)->output_data.ns->background_color) -#define FRAME_X_IMAGE_CACHE(F) FRAME_DISPLAY_INFO ((F))->image_cache - #define NS_FACE_FOREGROUND(f) ((f)->foreground) #define NS_FACE_BACKGROUND(f) ((f)->background) #define FRAME_NS_TITLEBAR_HEIGHT(f) ((f)->output_data.ns->titlebar_height) === modified file 'src/nsterm.m' --- src/nsterm.m 2013-10-14 12:19:21 +0000 +++ src/nsterm.m 2013-10-15 02:45:03 +0000 @@ -3975,7 +3975,6 @@ && ![NSCalibratedWhiteColorSpace isEqualToString: NSColorSpaceFromDepth (depth)]; dpyinfo->n_planes = NSBitsPerPixelFromDepth (depth); - dpyinfo->image_cache = make_image_cache (); dpyinfo->color_table = xmalloc (sizeof *dpyinfo->color_table); dpyinfo->color_table->colors = NULL; dpyinfo->root_window = 42; /* a placeholder.. */ ------------------------------------------------------------ revno: 114665 committer: Dmitry Gutov branch nick: trunk timestamp: Tue 2013-10-15 04:21:22 +0300 message: * indent/ruby.rb: Fix an example, remove wrong example, and add two more. diff: === modified file 'test/indent/ruby.rb' --- test/indent/ruby.rb 2013-10-14 01:51:20 +0000 +++ test/indent/ruby.rb 2013-10-15 01:21:22 +0000 @@ -182,16 +182,21 @@ end method !arg1, - arg2 + arg2 method [], arg2 -method {:a => 1, :b => 2}, - arg2 - method :foo, :bar method (a + b), c + +it "is a method call with block" do + foo +end + +it("is too!") { + bar +} ------------------------------------------------------------ revno: 114664 committer: Xue Fuqiao branch nick: trunk timestamp: Tue 2013-10-15 06:25:14 +0800 message: * doc/misc/cl.texi (Argument Lists): Add indexes for &key and &aux. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2013-10-07 12:48:18 +0000 +++ doc/misc/ChangeLog 2013-10-14 22:25:14 +0000 @@ -1,3 +1,7 @@ +2013-10-14 Xue Fuqiao + + * cl.texi (Argument Lists): Add indexes for &key and &aux. + 2013-10-07 Michael Albinus * trampver.texi: Update release number. === modified file 'doc/misc/cl.texi' --- doc/misc/cl.texi 2013-08-07 07:01:54 +0000 +++ doc/misc/cl.texi 2013-10-14 22:25:14 +0000 @@ -273,6 +273,8 @@ @node Argument Lists @section Argument Lists +@cindex &key +@cindex &aux @noindent Emacs Lisp's notation for argument lists of functions is a subset of ------------------------------------------------------------ revno: 114663 committer: Xue Fuqiao branch nick: trunk timestamp: Tue 2013-10-15 06:20:52 +0800 message: Comment diff: === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2013-10-05 15:06:17 +0000 +++ doc/lispref/display.texi 2013-10-14 22:20:52 +0000 @@ -611,6 +611,9 @@ @code{condition-case}, the user won't see the error message; it could show the message to the user by reporting it as a warning.) +@c FIXME: Why use ‘(bytecomp)’ instead of ‘'bytecomp’ or simply +@c ‘bytecomp’ here? The parens are part of ‘warning-type-format’ but +@c not part of the warning type. --xfq @cindex warning type Each warning has a @dfn{warning type} to classify it. The type is a list of symbols. The first symbol should be the custom group that you ------------------------------------------------------------ revno: 114662 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15580 author: Dima Kogan committer: Stefan Monnier branch nick: trunk timestamp: Mon 2013-10-14 15:20:29 -0400 message: * lisp/progmodes/subword.el (subword-capitalize): Be careful when the search for [[:alpha:]] fails. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-10-14 15:37:12 +0000 +++ lisp/ChangeLog 2013-10-14 19:20:29 +0000 @@ -1,3 +1,8 @@ +2013-10-14 Dima Kogan (tiny change) + + * progmodes/subword.el (subword-capitalize): Be careful when + the search for [[:alpha:]] fails (bug#15580). + 2013-10-14 Eli Zaretskii * menu-bar.el (tty-menu-navigation-map): Bind shifted mouse clicks @@ -5,8 +10,8 @@ 2013-10-14 Dmitry Gutov - * progmodes/ruby-mode.el (ruby-smie--args-separator-p): Handle - methods ending with `?' and `!'. + * progmodes/ruby-mode.el (ruby-smie--args-separator-p): + Handle methods ending with `?' and `!'. 2013-10-14 Akinori MUSHA @@ -41,8 +46,8 @@ Fix indentation/fontification of Java enum with "implements"/generic. - * progmodes/cc-engine.el (c-backward-over-enum-header): Extracted - from the three other places and enhanced to handle generics. + * progmodes/cc-engine.el (c-backward-over-enum-header): + Extracted from the three other places and enhanced to handle generics. (c-inside-bracelist-p): Uses new function above. * progmodes/cc-fonts.el (c-font-lock-declarations): Uses new function above. @@ -230,8 +235,8 @@ * tooltip.el (tooltip-mode): Don't error out on TTYs. - * menu-bar.el (popup-menu, popup-menu-normalize-position): Moved - here from mouse.el. + * menu-bar.el (popup-menu, popup-menu-normalize-position): + Move here from mouse.el. (popup-menu): Support menu-bar navigation on TTYs using C-f/C-b and arrow keys. (tty-menu-navigation-map): New map for TTY menu navigation. === modified file 'lisp/progmodes/subword.el' --- lisp/progmodes/subword.el 2013-07-22 16:25:32 +0000 +++ lisp/progmodes/subword.el 2013-10-14 19:20:29 +0000 @@ -257,24 +257,25 @@ See the command `subword-mode' for a description of subwords. Optional argument ARG is the same as for `capitalize-word'." (interactive "p") - (let ((count (abs arg)) - (start (point)) - (advance (if (< arg 0) nil t))) - (dotimes (i count) - (if advance - (progn (re-search-forward - (concat "[[:alpha:]]") - nil t) - (goto-char (match-beginning 0))) - (subword-backward)) - (let* ((p (point)) - (pp (1+ p)) - (np (subword-forward))) - (upcase-region p pp) - (downcase-region pp np) - (goto-char (if advance np p)))) - (unless advance - (goto-char start)))) + (catch 'search-failed + (let ((count (abs arg)) + (start (point)) + (advance (>= arg 0))) + + (dotimes (i count) + (if advance + (progn + (search-forward "[[:alpha:]]") + (goto-char (match-beginning 0))) + (subword-backward)) + (let* ((p (point)) + (pp (1+ p)) + (np (subword-forward))) + (upcase-region p pp) + (downcase-region pp np) + (goto-char (if advance np p)))) + (unless advance + (goto-char start))))) ------------------------------------------------------------ revno: 114661 committer: Eli Zaretskii branch nick: trunk timestamp: Mon 2013-10-14 19:23:10 +0300 message: Attempt to fix time_t related problems with MinGW 4.0 runtime. nt/inc/mingw_time.h: New file. nt/inc/ms-w32.h: Include mingw_time.h instead of doing its job. src/w32proc.c: Include mingw_time.h. src/w32.c: Include mingw_time.h. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2013-10-12 13:11:14 +0000 +++ nt/ChangeLog 2013-10-14 16:23:10 +0000 @@ -1,3 +1,9 @@ +2013-10-14 Eli Zaretskii + + * inc/mingw_time.h: New file. + + * inc/ms-w32.h: Include mingw_time.h instead of doing its job. + 2013-10-12 Eli Zaretskii * inc/dirent.h (struct dirent) [__MINGW_MAJOR_VERSION >= 4]: Make === added file 'nt/inc/mingw_time.h' --- nt/inc/mingw_time.h 1970-01-01 00:00:00 +0000 +++ nt/inc/mingw_time.h 2013-10-14 16:23:10 +0000 @@ -0,0 +1,32 @@ +/* Fix issues related to MinGW 4.x handling of time data types. */ + +#ifndef _MINGW_TIME_H +#define _MINGW_TIME_H + +/* The @#$%^&! MinGW developers stopped updating the values of + __MINGW32_VERSION, __MINGW32_MAJOR_VERSION, and + __MINGW32_MINOR_VERSION values in v4.x of the runtime, to + "discourage its uses". So the values of those macros can no longer + be trusted, and we need the workaround below, to have a single set + of macros we can trust. (The .17 minor version is arbitrary.) */ +#ifdef __MINGW32__ +#include <_mingw.h> +#endif +/* MinGW64 doesn't have this problem, and does not define + __MINGW_VERSION. */ +#ifndef __MINGW64_VERSION_MAJOR +# ifndef __MINGW_VERSION +# define __MINGW_VERSION 3.17 +# undef __MINGW_MAJOR_VERSION +# define __MINGW_MAJOR_VERSION 3 +# undef __MINGW_MINOR_VERSION +# define __MINGW_MINOR_VERSION 17 +# undef __MINGW_PATCHLEVEL +# define __MINGW_PATCHLEVEL 0 +# endif +#endif +#if __MINGW_MAJOR_VERSION >= 4 +# define _USE_32BIT_TIME_T +#endif + +#endif === modified file 'nt/inc/ms-w32.h' --- nt/inc/ms-w32.h 2013-10-12 13:11:14 +0000 +++ nt/inc/ms-w32.h 2013-10-14 16:23:10 +0000 @@ -24,31 +24,7 @@ #define WINDOWSNT #endif -/* The @#$%^&! MinGW developers stopped updating the values of - __MINGW32_VERSION, __MINGW32_MAJOR_VERSION, and - __MINGW32_MINOR_VERSION values in v4.x of the runtime, to - "discourage its uses". So the values of those macros can no longer - be trusted, and we need the workaround below, to have a single set - of macros we can trust. (The .17 minor version is arbitrary.) */ -#ifdef __MINGW32__ -#include <_mingw.h> -#endif -/* MinGW64 doesn't have this problem, and does not define - __MINGW_VERSION. */ -#ifndef __MINGW64_VERSION_MAJOR -# ifndef __MINGW_VERSION -# define __MINGW_VERSION 3.17 -# undef __MINGW_MAJOR_VERSION -# define __MINGW_MAJOR_VERSION 3 -# undef __MINGW_MINOR_VERSION -# define __MINGW_MINOR_VERSION 17 -# undef __MINGW_PATCHLEVEL -# define __MINGW_PATCHLEVEL 0 -# endif -#endif -#if __MINGW_MAJOR_VERSION >= 4 -# define _USE_32BIT_TIME_T -#endif +#include /* #undef const */ === modified file 'src/ChangeLog' --- src/ChangeLog 2013-10-14 15:37:12 +0000 +++ src/ChangeLog 2013-10-14 16:23:10 +0000 @@ -1,5 +1,9 @@ 2013-10-14 Eli Zaretskii + * w32proc.c: Include mingw_time.h. + + * w32.c: Include mingw_time.h. + Implement scrolling of TTY menus when the screen is too short. * term.c (tty_menu_display): Accept an additional argument, the === modified file 'src/w32.c' --- src/w32.c 2013-08-29 15:32:04 +0000 +++ src/w32.c 2013-10-14 16:23:10 +0000 @@ -19,6 +19,8 @@ /* Geoff Voelker (voelker@cs.washington.edu) 7-29-94 */ + +#include #include /* for offsetof */ #include #include === modified file 'src/w32proc.c' --- src/w32proc.c 2013-09-11 17:31:29 +0000 +++ src/w32proc.c 2013-10-14 16:23:10 +0000 @@ -21,6 +21,7 @@ Adapted from alarm.c by Tim Fleehart */ +#include #include #include #include ------------------------------------------------------------ revno: 114660 committer: Eli Zaretskii branch nick: trunk timestamp: Mon 2013-10-14 18:37:12 +0300 message: Implement scrolling of TTY menus when the screen is too short. src/term.c (tty_menu_display): Accept an additional argument, the menu item from which to start displaying the menu. Account for the value of Y when limiting the menu to the number of available screen lines. (mi_result): New enumeration. (read_menu_input): Return enumerated value. When the y coordinate hits min_y or max_y, return scroll indication instead of wrapping around the menu. (tty_menu_activate): Handle the scrolling indications from read_menu_input. Compute the first menu item to display and pass it to tty_menu_display. lisp/menu-bar.el (tty-menu-navigation-map): Bind shifted mouse clicks to commands that scroll the menu. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-10-14 01:51:20 +0000 +++ lisp/ChangeLog 2013-10-14 15:37:12 +0000 @@ -1,3 +1,8 @@ +2013-10-14 Eli Zaretskii + + * menu-bar.el (tty-menu-navigation-map): Bind shifted mouse clicks + to commands that scroll the menu. + 2013-10-14 Dmitry Gutov * progmodes/ruby-mode.el (ruby-smie--args-separator-p): Handle === modified file 'lisp/menu-bar.el' --- lisp/menu-bar.el 2013-10-13 05:20:15 +0000 +++ lisp/menu-bar.el 2013-10-14 15:37:12 +0000 @@ -2341,20 +2341,26 @@ (define-key map [linefeed] 'tty-menu-select) (define-key map [down-mouse-1] 'tty-menu-select) (define-key map [drag-mouse-1] 'tty-menu-select) + ;; The following 4 bindings are for those whose text-mode mouse + ;; lack the wheel. + (define-key map [S-down-mouse-1] 'tty-menu-next-item) + (define-key map [S-drag-mouse-1] 'tty-menu-next-item) + (define-key map [S-down-mouse-2] 'tty-menu-prev-item) + (define-key map [S-drag-mouse-2] 'tty-menu-prev-item) (define-key map [mode-line drag-mouse-1] 'tty-menu-select) (define-key map [mode-line down-mouse-1] 'tty-menu-select) (define-key map [header-line mouse-1] 'tty-menu-select) (define-key map [header-line drag-mouse-1] 'tty-menu-select) (define-key map [header-line down-mouse-1] 'tty-menu-select) + ;; The mouse events must be bound to tty-menu-ignore, otherwise + ;; the initial mouse click will select and immediately pop down + ;; the menu. (define-key map [mode-line mouse-1] 'tty-menu-ignore) (define-key map [mode-line mouse-2] 'tty-menu-ignore) (define-key map [mode-line mouse-3] 'tty-menu-ignore) (define-key map [mode-line C-mouse-1] 'tty-menu-ignore) (define-key map [mode-line C-mouse-2] 'tty-menu-ignore) (define-key map [mode-line C-mouse-3] 'tty-menu-ignore) - ;; The mouse events must be bound to tty-menu-ignore, otherwise - ;; the initial mouse click will select and immediately pop down - ;; the menu. (define-key map [mouse-1] 'tty-menu-ignore) (define-key map [C-mouse-1] 'tty-menu-ignore) (define-key map [C-mouse-2] 'tty-menu-ignore) === modified file 'src/ChangeLog' --- src/ChangeLog 2013-10-14 12:19:21 +0000 +++ src/ChangeLog 2013-10-14 15:37:12 +0000 @@ -1,3 +1,19 @@ +2013-10-14 Eli Zaretskii + + Implement scrolling of TTY menus when the screen is too short. + + * term.c (tty_menu_display): Accept an additional argument, the + menu item from which to start displaying the menu. Account for + the value of Y when limiting the menu to the number of available + screen lines. + (mi_result): New enumeration. + (read_menu_input): Return enumerated value. When the y coordinate + hits min_y or max_y, return scroll indication instead of wrapping + around the menu. + (tty_menu_activate): Handle the scrolling indications from + read_menu_input. Compute the first menu item to display and pass + it to tty_menu_display. + 2013-10-14 Dmitry Antipov * termhooks.h (FRAME_MUST_WRITE_SPACES, FRAME_LINE_INS_DEL_OK) === modified file 'src/term.c' --- src/term.c 2013-10-14 12:19:21 +0000 +++ src/term.c 2013-10-14 15:37:12 +0000 @@ -2781,10 +2781,10 @@ However, unlike on MSDOS, where the menu text is drawn directly to the display video memory, on a TTY we use display_string (see display_tty_menu_item in xdisp.c) to put the glyphs produced from - the menu items directly into the frame's 'desired_matrix' glyph - matrix, and then call update_frame_with_menu to deliver the results - to the glass. The previous contents of the screen, in the form of - the current_matrix, is stashed away, and used to restore screen + the menu items into the frame's 'desired_matrix' glyph matrix, and + then call update_frame_with_menu to deliver the results to the + glass. The previous contents of the screen, in the form of the + current_matrix, is stashed away, and used to restore screen contents when the menu selection changes or when the final selection is made and the menu should be popped down. @@ -2911,11 +2911,12 @@ } } -/* Display MENU at (X,Y) using FACES. */ +/* Display MENU at (X,Y) using FACES, starting with FIRST_ITEM + (zero-based). */ static void tty_menu_display (tty_menu *menu, int x, int y, int pn, int *faces, - int mx, int my, int disp_help) + int mx, int my, int first_item, int disp_help) { int i, face, width, enabled, mousehere, row, col; struct frame *sf = SELECTED_FRAME (); @@ -2923,7 +2924,7 @@ /* Don't try to display more menu items than the console can display using the available screen lines. Exclude the echo area line, as it will be overwritten by the help-echo anyway. */ - int max_items = min (menu->count, FRAME_LINES (sf) - 1); + int max_items = min (menu->count - first_item, FRAME_LINES (sf) - 1 - y); menu_help_message = NULL; @@ -2933,11 +2934,12 @@ for (i = 0; i < max_items; i++) { int max_width = width + 2; /* +2 for padding blanks on each side */ + int j = i + first_item; - if (menu->submenu[i]) + if (menu->submenu[j]) max_width += 2; /* for displaying " >" after the item */ enabled - = (!menu->submenu[i] && menu->panenumber[i]) || (menu->submenu[i]); + = (!menu->submenu[j] && menu->panenumber[j]) || (menu->submenu[j]); mousehere = (y + i == my && x <= mx && mx < x + max_width); face = faces[enabled + mousehere * 2]; /* Display the menu help string for the i-th menu item even if @@ -2945,12 +2947,12 @@ code does. */ if (disp_help && enabled + mousehere * 2 >= 2) { - menu_help_message = menu->help_text[i]; + menu_help_message = menu->help_text[j]; menu_help_paneno = pn - 1; - menu_help_itemno = i; + menu_help_itemno = j; } - display_tty_menu_item (menu->text[i], max_width, face, x, y + i, - menu->submenu[i] != NULL); + display_tty_menu_item (menu->text[j], max_width, face, x, y + i, + menu->submenu[j] != NULL); } update_frame_with_menu (sf); cursor_to (sf, row, col); @@ -3124,14 +3126,20 @@ update_frame_with_menu (f); } +typedef enum { + MI_QUIT_MENU = -1, + MI_CONTINUE = 0, + MI_ITEM_SELECTED = 1, + MI_NEXT_ITEM = 2, + MI_PREV_ITEM = 3, + MI_SCROLL_FORWARD = 4, + MI_SCROLL_BACK = 5 +} mi_result; + /* Read user input and return X and Y coordinates where that input - puts us. We only consider mouse movement and click events and - keyboard movement commands; the rest are ignored. - - Value is -1 if C-g was pressed, 1 if an item was selected, 2 or 3 - if we need to move to the next or previous menu-bar menu, zero - otherwise. */ -static int + puts us. We only consider mouse movement and click events, and + keyboard movement commands; the rest are ignored. */ +static mi_result read_menu_input (struct frame *sf, int *x, int *y, int min_y, int max_y, bool *first_time) { @@ -3144,7 +3152,7 @@ { Lisp_Object cmd; int usable_input = 1; - int st = 0; + mi_result st = MI_CONTINUE; struct tty_display_info *tty = FRAME_TTY (sf); Lisp_Object saved_mouse_tracking = do_mouse_tracking; @@ -3160,42 +3168,42 @@ do_mouse_tracking = saved_mouse_tracking; if (EQ (cmd, Qt) || EQ (cmd, Qtty_menu_exit)) - return -1; + return MI_QUIT_MENU; if (EQ (cmd, Qtty_menu_mouse_movement)) mouse_get_xy (x, y); else if (EQ (cmd, Qtty_menu_next_menu)) { usable_input = 0; - st = 2; + st = MI_NEXT_ITEM; } else if (EQ (cmd, Qtty_menu_prev_menu)) { usable_input = 0; - st = 3; + st = MI_PREV_ITEM; } else if (EQ (cmd, Qtty_menu_next_item)) { if (*y < max_y) *y += 1; else - *y = min_y; + st = MI_SCROLL_FORWARD; } else if (EQ (cmd, Qtty_menu_prev_item)) { if (*y > min_y) *y -= 1; else - *y = max_y; + st = MI_SCROLL_BACK; } else if (EQ (cmd, Qtty_menu_select)) - st = 1; + st = MI_ITEM_SELECTED; else if (!EQ (cmd, Qtty_menu_ignore)) usable_input = 0; if (usable_input) sf->mouse_moved = 1; return st; } - return 0; + return MI_CONTINUE; } /* Display menu, wait for user's response, and return that response. */ @@ -3214,6 +3222,7 @@ struct tty_display_info *tty = FRAME_TTY (sf); bool first_time; Lisp_Object selectface; + int first_item = 0; /* Don't allow non-positive x0 and y0, lest the menu will wrap around the display. */ @@ -3265,7 +3274,7 @@ want to interpret them as zero-based column and row coordinates, and also because we want the first item of the menu, not its title, to appear at x0,y0. */ - tty_menu_display (menu, x0 - 1, y0 - 1, 1, title_faces, x0 - 1, y0 - 1, 0); + tty_menu_display (menu, x0 - 1, y0 - 1, 1, title_faces, x0 - 1, y0 - 1, 0, 0); /* Turn off the cursor. Otherwise it shows through the menu panes, which is ugly. */ @@ -3292,7 +3301,7 @@ leave = 0; while (!leave) { - int input_status; + mi_result input_status; int min_y = state[0].y; int max_y = min (min_y + state[0].menu->count, FRAME_LINES (sf) - 1) - 1; @@ -3300,36 +3309,59 @@ if (input_status) { leave = 1; - if (input_status == -1) + switch (input_status) { + case MI_QUIT_MENU: /* Remove the last help-echo, so that it doesn't re-appear after "Quit". */ show_help_echo (Qnil, Qnil, Qnil, Qnil); result = TTYM_NO_SELECT; - } - else if (input_status == 2) - { + break; + case MI_NEXT_ITEM: if (kbd_navigation) result = TTYM_NEXT; else leave = 0; - } - else if (input_status == 3) - { + break; + case MI_PREV_ITEM: if (kbd_navigation) result = TTYM_PREV; else leave = 0; + break; + case MI_SCROLL_FORWARD: + if (y - min_y == state[0].menu->count - 1 - first_item) + { + y = min_y; + first_item = 0; + } + else + first_item++; + leave = 0; + break; + case MI_SCROLL_BACK: + if (first_item == 0) + { + y = max_y; + first_item = state[0].menu->count - 1 - (y - min_y); + } + else + first_item--; + leave = 0; + break; + default: + /* MI_ITEM_SELECTED is handled below, so nothing to do. */ + break; } } - if (sf->mouse_moved && input_status != -1) + if (sf->mouse_moved && input_status != MI_QUIT_MENU) { sf->mouse_moved = 0; result = TTYM_IA_SELECT; for (i = 0; i < statecount; i++) if (state[i].x <= x && x < state[i].x + state[i].menu->width + 2) { - int dy = y - state[i].y; + int dy = y - state[i].y + first_item; if (0 <= dy && dy < state[i].menu->count) { if (!state[i].menu->submenu[dy]) @@ -3358,7 +3390,7 @@ state[i].x, state[i].y, state[i].pane, - faces, x, y, 1); + faces, x, y, first_item, 1); state[statecount].menu = state[i].menu->submenu[dy]; state[statecount].pane = state[i].menu->panenumber[dy]; state[statecount].screen_behind @@ -3374,7 +3406,7 @@ state[statecount - 1].x, state[statecount - 1].y, state[statecount - 1].pane, - faces, x, y, 1); + faces, x, y, first_item, 1); tty_hide_cursor (tty); fflush (tty->output); } ------------------------------------------------------------ revno: 114659 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2013-10-14 16:19:21 +0400 message: * termhooks.h (FRAME_MUST_WRITE_SPACES, FRAME_LINE_INS_DEL_OK) (FRAME_CHAR_INS_DEL_OK, FRAME_SCROLL_REGION_OK) (FRAME_SCROLL_REGION_COST, FRAME_MEMORY_BELOW_FRAME): Adjust to match the change described below. (struct terminal): Move must_write_spaces, line_ins_del_ok, char_ins_del_ok, scroll_region_ok, scroll_region_cost and memory_below_frame members to... * termchar.h (struct tty_display_info): ...here because they're relevant only on TTYs. Prefer unsigned bitfield where appropriate. * term.c (init_tty): * nsterm.m (ns_create_terminal): * w32term.c (w32_create_terminal): * xterm.c (x_create_terminal): Adjust users. * dispnew.c (line_hash_code, line_draw_cost): Pass frame arg to filter out non-TTY frames. Adjust comment. (scrolling): Adjust user. Prefer eassert for debugging check. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-10-14 10:55:24 +0000 +++ src/ChangeLog 2013-10-14 12:19:21 +0000 @@ -1,5 +1,24 @@ 2013-10-14 Dmitry Antipov + * termhooks.h (FRAME_MUST_WRITE_SPACES, FRAME_LINE_INS_DEL_OK) + (FRAME_CHAR_INS_DEL_OK, FRAME_SCROLL_REGION_OK) + (FRAME_SCROLL_REGION_COST, FRAME_MEMORY_BELOW_FRAME): + Adjust to match the change described below. + (struct terminal): Move must_write_spaces, line_ins_del_ok, + char_ins_del_ok, scroll_region_ok, scroll_region_cost and + memory_below_frame members to... + * termchar.h (struct tty_display_info): ...here because they're + relevant only on TTYs. Prefer unsigned bitfield where appropriate. + * term.c (init_tty): + * nsterm.m (ns_create_terminal): + * w32term.c (w32_create_terminal): + * xterm.c (x_create_terminal): Adjust users. + * dispnew.c (line_hash_code, line_draw_cost): Pass frame arg + to filter out non-TTY frames. Adjust comment. + (scrolling): Adjust user. Prefer eassert for debugging check. + +2013-10-14 Dmitry Antipov + * xfaces.c (PT_PER_INCH): Remove unused macro. * termhooks.h (struct terminal): Remove set-but-unused member fast_clear_end_of_line. === modified file 'src/dispnew.c' --- src/dispnew.c 2013-10-11 15:42:06 +0000 +++ src/dispnew.c 2013-10-14 12:19:21 +0000 @@ -1070,10 +1070,11 @@ } -/* Return a hash code for glyph row ROW. */ +/* Return a hash code for glyph row ROW, which may + be from current or desired matrix of frame F. */ static int -line_hash_code (struct glyph_row *row) +line_hash_code (struct frame *f, struct glyph_row *row) { int hash = 0; @@ -1086,7 +1087,7 @@ { int c = glyph->u.ch; int face_id = glyph->face_id; - if (FRAME_MUST_WRITE_SPACES (SELECTED_FRAME ())) /* XXX Is SELECTED_FRAME OK here? */ + if (FRAME_MUST_WRITE_SPACES (f)) c -= SPACEGLYPH; hash = (((hash << 4) + (hash >> 24)) & 0x0fffffff) + c; hash = (((hash << 4) + (hash >> 24)) & 0x0fffffff) + face_id; @@ -1101,12 +1102,13 @@ } -/* Return the cost of drawing line VPOS in MATRIX. The cost equals - the number of characters in the line. If must_write_spaces is - zero, leading and trailing spaces are ignored. */ +/* Return the cost of drawing line VPOS in MATRIX, which may + be current or desired matrix of frame F. The cost equals + the number of characters in the line. If must_write_spaces + is zero, leading and trailing spaces are ignored. */ static int -line_draw_cost (struct glyph_matrix *matrix, int vpos) +line_draw_cost (struct frame *f, struct glyph_matrix *matrix, int vpos) { struct glyph_row *row = matrix->rows + vpos; struct glyph *beg = row->glyphs[TEXT_AREA]; @@ -1116,7 +1118,7 @@ ptrdiff_t glyph_table_len = GLYPH_TABLE_LENGTH; /* Ignore trailing and leading spaces if we can. */ - if (!FRAME_MUST_WRITE_SPACES (SELECTED_FRAME ())) /* XXX Is SELECTED_FRAME OK here? */ + if (!FRAME_MUST_WRITE_SPACES (f)) { /* Skip from the end over trailing spaces. */ while (end > beg && CHAR_GLYPH_SPACE_P (*(end - 1))) @@ -4595,8 +4597,7 @@ struct glyph_matrix *current_matrix = frame->current_matrix; struct glyph_matrix *desired_matrix = frame->desired_matrix; - if (!current_matrix) - emacs_abort (); + eassert (current_matrix); /* Compute hash codes of all the lines. Also calculate number of changed lines, number of unchanged lines at the beginning, and @@ -4609,7 +4610,7 @@ /* Give up on this scrolling if some old lines are not enabled. */ if (!MATRIX_ROW_ENABLED_P (current_matrix, i)) return 0; - old_hash[i] = line_hash_code (MATRIX_ROW (current_matrix, i)); + old_hash[i] = line_hash_code (frame, MATRIX_ROW (current_matrix, i)); if (! MATRIX_ROW_ENABLED_P (desired_matrix, i)) { /* This line cannot be redrawn, so don't let scrolling mess it. */ @@ -4619,8 +4620,8 @@ } else { - new_hash[i] = line_hash_code (MATRIX_ROW (desired_matrix, i)); - draw_cost[i] = line_draw_cost (desired_matrix, i); + new_hash[i] = line_hash_code (frame, MATRIX_ROW (desired_matrix, i)); + draw_cost[i] = line_draw_cost (frame, desired_matrix, i); } if (old_hash[i] != new_hash[i]) @@ -4630,7 +4631,7 @@ } else if (i == unchanged_at_top) unchanged_at_top++; - old_draw_cost[i] = line_draw_cost (current_matrix, i); + old_draw_cost[i] = line_draw_cost (frame, current_matrix, i); } /* If changed lines are few, don't allow preemption, don't scroll. */ === modified file 'src/nsterm.m' --- src/nsterm.m 2013-10-14 10:55:24 +0000 +++ src/nsterm.m 2013-10-14 12:19:21 +0000 @@ -4091,11 +4091,6 @@ terminal->delete_frame_hook = x_destroy_window; terminal->delete_terminal_hook = ns_delete_terminal; - terminal->scroll_region_ok = 1; - terminal->char_ins_del_ok = 1; - terminal->line_ins_del_ok = 1; - terminal->memory_below_frame = 0; - return terminal; } === modified file 'src/term.c' --- src/term.c 2013-10-14 10:55:24 +0000 +++ src/term.c 2013-10-14 12:19:21 +0000 @@ -4203,9 +4203,9 @@ /* Since we make MagicWrap terminals look like AutoWrap, we need to have the former flag imply the latter. */ AutoWrap (tty) = MagicWrap (tty) || tgetflag ("am"); - terminal->memory_below_frame = tgetflag ("db"); + tty->memory_below_frame = tgetflag ("db"); tty->TF_hazeltine = tgetflag ("hz"); - terminal->must_write_spaces = tgetflag ("in"); + tty->must_write_spaces = tgetflag ("in"); tty->meta_key = tgetflag ("km") || tgetflag ("MT"); tty->TF_insmode_motion = tgetflag ("mi"); tty->TF_standout_motion = tgetflag ("ms"); @@ -4225,7 +4225,7 @@ tty->specified_window = height; FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none; - terminal->char_ins_del_ok = 1; + tty->char_ins_del_ok = 1; baud_rate = 19200; } #else /* MSDOS */ @@ -4238,7 +4238,7 @@ get_tty_size (fileno (tty->input), &width, &height); FrameCols (tty) = width; FrameRows (tty) = height; - terminal->char_ins_del_ok = 0; + tty->char_ins_del_ok = 0; init_baud_rate (fileno (tty->input)); } #endif /* MSDOS */ @@ -4257,12 +4257,12 @@ tty->delete_in_insert_mode = 1; UseTabs (tty) = 0; - terminal->scroll_region_ok = 0; + tty->scroll_region_ok = 0; /* Seems to insert lines when it's not supposed to, messing up the display. In doing a trace, it didn't seem to be called much, so I don't think we're losing anything by turning it off. */ - terminal->line_ins_del_ok = 0; + tty->line_ins_del_ok = 0; tty->TN_max_colors = 16; /* Must be non-zero for tty-display-color-p. */ #endif /* DOS_NT */ @@ -4393,17 +4393,17 @@ UseTabs (tty) = tabs_safe_p (fileno (tty->input)) && TabWidth (tty) == 8; - terminal->scroll_region_ok + tty->scroll_region_ok = (tty->Wcm->cm_abs && (tty->TS_set_window || tty->TS_set_scroll_region || tty->TS_set_scroll_region_1)); - terminal->line_ins_del_ok + tty->line_ins_del_ok = (((tty->TS_ins_line || tty->TS_ins_multi_lines) && (tty->TS_del_line || tty->TS_del_multi_lines)) - || (terminal->scroll_region_ok + || (tty->scroll_region_ok && tty->TS_fwd_scroll && tty->TS_rev_scroll)); - terminal->char_ins_del_ok + tty->char_ins_del_ok = ((tty->TS_ins_char || tty->TS_insert_mode || tty->TS_pad_inserted_char || tty->TS_ins_multi_chars) && (tty->TS_del_char || tty->TS_del_multi_chars)); === modified file 'src/termchar.h' --- src/termchar.h 2013-09-26 07:37:16 +0000 +++ src/termchar.h 2013-10-14 12:19:21 +0000 @@ -197,6 +197,25 @@ /* Non-zero means we are displaying a TTY menu on this tty. */ unsigned showing_menu : 1; + + /* Nonzero means spaces in the text must actually be output; + can't just skip over some columns to leave them blank. */ + unsigned must_write_spaces : 1; + + /* Nonzero if TTY can insert and delete lines. */ + unsigned line_ins_del_ok : 1; + + /* Nonzero if TTY can insert and delete chars. */ + unsigned char_ins_del_ok : 1; + + /* Nonzero if TTY supports setting the scroll window. */ + unsigned scroll_region_ok : 1; + + /* Nonzero if TTY remembers lines scrolled off bottom. */ + unsigned memory_below_frame : 1; + + /* Cost of setting the scroll window, measured in characters. */ + int scroll_region_cost; }; /* A chain of structures for all tty devices currently in use. */ === modified file 'src/termhooks.h' --- src/termhooks.h 2013-10-14 10:55:24 +0000 +++ src/termhooks.h 2013-10-14 12:19:21 +0000 @@ -402,21 +402,6 @@ the function `set-keyboard-coding-system'. */ struct coding_system *keyboard_coding; - /* Terminal characteristics. */ - /* XXX Are these really used on non-termcap displays? */ - - int must_write_spaces; /* Nonzero means spaces in the text must - actually be output; can't just skip over - some columns to leave them blank. */ - int line_ins_del_ok; /* Terminal can insert and delete lines. */ - int char_ins_del_ok; /* Terminal can insert and delete chars. */ - int scroll_region_ok; /* Terminal supports setting the scroll - window. */ - int scroll_region_cost; /* Cost of setting the scroll window, - measured in characters. */ - int memory_below_frame; /* Terminal remembers lines scrolled - off bottom. */ - /* Window-based redisplay interface for this device (0 for tty devices). */ struct redisplay_interface *rif; @@ -617,12 +602,12 @@ /* Chain of all terminal devices currently in use. */ extern struct terminal *terminal_list; -#define FRAME_MUST_WRITE_SPACES(f) ((f)->terminal->must_write_spaces) -#define FRAME_LINE_INS_DEL_OK(f) ((f)->terminal->line_ins_del_ok) -#define FRAME_CHAR_INS_DEL_OK(f) ((f)->terminal->char_ins_del_ok) -#define FRAME_SCROLL_REGION_OK(f) ((f)->terminal->scroll_region_ok) -#define FRAME_SCROLL_REGION_COST(f) ((f)->terminal->scroll_region_cost) -#define FRAME_MEMORY_BELOW_FRAME(f) ((f)->terminal->memory_below_frame) +#define FRAME_MUST_WRITE_SPACES(f) (FRAME_TTY (f)->must_write_spaces) +#define FRAME_LINE_INS_DEL_OK(f) (FRAME_TTY (f)->line_ins_del_ok) +#define FRAME_CHAR_INS_DEL_OK(f) (FRAME_TTY (f)->char_ins_del_ok) +#define FRAME_SCROLL_REGION_OK(f) (FRAME_TTY (f)->scroll_region_ok) +#define FRAME_SCROLL_REGION_COST(f) (FRAME_TTY (f)->scroll_region_cost) +#define FRAME_MEMORY_BELOW_FRAME(f) (FRAME_TTY (f)->memory_below_frame) #define FRAME_TERMINAL_CODING(f) ((f)->terminal->terminal_coding) #define FRAME_KEYBOARD_CODING(f) ((f)->terminal->keyboard_coding) === modified file 'src/w32term.c' --- src/w32term.c 2013-10-14 10:55:24 +0000 +++ src/w32term.c 2013-10-14 12:19:21 +0000 @@ -6252,11 +6252,6 @@ terminal->delete_terminal_hook = x_delete_terminal; terminal->rif = &w32_redisplay_interface; - terminal->scroll_region_ok = 1; /* We'll scroll partial frames. */ - terminal->char_ins_del_ok = 1; - terminal->line_ins_del_ok = 1; /* We'll just blt 'em. */ - terminal->memory_below_frame = 0; /* We don't remember what scrolls - off the bottom. */ /* We don't yet support separate terminals on W32, so don't try to share keyboards between virtual terminals that are on the same physical === modified file 'src/xterm.c' --- src/xterm.c 2013-10-14 10:55:24 +0000 +++ src/xterm.c 2013-10-14 12:19:21 +0000 @@ -10509,11 +10509,6 @@ terminal->delete_terminal_hook = x_delete_terminal; terminal->rif = &x_redisplay_interface; - terminal->scroll_region_ok = 1; /* We'll scroll partial frames. */ - terminal->char_ins_del_ok = 1; - terminal->line_ins_del_ok = 1; /* We'll just blt 'em. */ - terminal->memory_below_frame = 0; /* We don't remember what scrolls - off the bottom. */ return terminal; } ------------------------------------------------------------ revno: 114658 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2013-10-14 14:55:24 +0400 message: * xfaces.c (PT_PER_INCH): Remove unused macro. * termhooks.h (struct terminal): Remove set-but-unused member fast_clear_end_of_line. (FRAME_FAST_CLEAR_END_OF_LINE): Remove. * nsterm.m (ns_create_terminal): * term.c (init_tty): * w32term.c (w32_create_terminal): * xterm.c (x_create_terminal): Adjust users. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-10-14 07:12:49 +0000 +++ src/ChangeLog 2013-10-14 10:55:24 +0000 @@ -1,3 +1,14 @@ +2013-10-14 Dmitry Antipov + + * xfaces.c (PT_PER_INCH): Remove unused macro. + * termhooks.h (struct terminal): Remove set-but-unused + member fast_clear_end_of_line. + (FRAME_FAST_CLEAR_END_OF_LINE): Remove. + * nsterm.m (ns_create_terminal): + * term.c (init_tty): + * w32term.c (w32_create_terminal): + * xterm.c (x_create_terminal): Adjust users. + 2013-10-14 Paul Eggert * lisp.h (bool_vector_size): New function. === modified file 'src/nsterm.m' --- src/nsterm.m 2013-10-10 06:48:42 +0000 +++ src/nsterm.m 2013-10-14 10:55:24 +0000 @@ -4094,7 +4094,6 @@ terminal->scroll_region_ok = 1; terminal->char_ins_del_ok = 1; terminal->line_ins_del_ok = 1; - terminal->fast_clear_end_of_line = 1; terminal->memory_below_frame = 0; return terminal; === modified file 'src/term.c' --- src/term.c 2013-10-11 15:30:21 +0000 +++ src/term.c 2013-10-14 10:55:24 +0000 @@ -4408,8 +4408,6 @@ || tty->TS_pad_inserted_char || tty->TS_ins_multi_chars) && (tty->TS_del_char || tty->TS_del_multi_chars)); - terminal->fast_clear_end_of_line = tty->TS_clr_line != 0; - init_baud_rate (fileno (tty->input)); #endif /* not DOS_NT */ === modified file 'src/termhooks.h' --- src/termhooks.h 2013-09-26 07:37:16 +0000 +++ src/termhooks.h 2013-10-14 10:55:24 +0000 @@ -408,8 +408,6 @@ int must_write_spaces; /* Nonzero means spaces in the text must actually be output; can't just skip over some columns to leave them blank. */ - int fast_clear_end_of_line; /* Nonzero means terminal has a `ce' string. */ - int line_ins_del_ok; /* Terminal can insert and delete lines. */ int char_ins_del_ok; /* Terminal can insert and delete chars. */ int scroll_region_ok; /* Terminal supports setting the scroll @@ -620,7 +618,6 @@ extern struct terminal *terminal_list; #define FRAME_MUST_WRITE_SPACES(f) ((f)->terminal->must_write_spaces) -#define FRAME_FAST_CLEAR_END_OF_LINE(f) ((f)->terminal->fast_clear_end_of_line) #define FRAME_LINE_INS_DEL_OK(f) ((f)->terminal->line_ins_del_ok) #define FRAME_CHAR_INS_DEL_OK(f) ((f)->terminal->char_ins_del_ok) #define FRAME_SCROLL_REGION_OK(f) ((f)->terminal->scroll_region_ok) === modified file 'src/w32term.c' --- src/w32term.c 2013-10-10 06:48:42 +0000 +++ src/w32term.c 2013-10-14 10:55:24 +0000 @@ -6255,7 +6255,6 @@ terminal->scroll_region_ok = 1; /* We'll scroll partial frames. */ terminal->char_ins_del_ok = 1; terminal->line_ins_del_ok = 1; /* We'll just blt 'em. */ - terminal->fast_clear_end_of_line = 1; /* X does this well. */ terminal->memory_below_frame = 0; /* We don't remember what scrolls off the bottom. */ === modified file 'src/xfaces.c' --- src/xfaces.c 2013-10-09 14:53:13 +0000 +++ src/xfaces.c 2013-10-14 10:55:24 +0000 @@ -231,11 +231,6 @@ #ifdef HAVE_NS #define GCGraphicsExposures 0 #endif /* HAVE_NS */ - -/* Number of pt per inch (from the TeXbook). */ - -#define PT_PER_INCH 72.27 - #endif /* HAVE_WINDOW_SYSTEM */ #include "buffer.h" === modified file 'src/xterm.c' --- src/xterm.c 2013-10-10 06:48:42 +0000 +++ src/xterm.c 2013-10-14 10:55:24 +0000 @@ -10512,7 +10512,6 @@ terminal->scroll_region_ok = 1; /* We'll scroll partial frames. */ terminal->char_ins_del_ok = 1; terminal->line_ins_del_ok = 1; /* We'll just blt 'em. */ - terminal->fast_clear_end_of_line = 1; /* X does this well. */ terminal->memory_below_frame = 0; /* We don't remember what scrolls off the bottom. */ ------------------------------------------------------------ revno: 114657 committer: Glenn Morris branch nick: trunk timestamp: Mon 2013-10-14 06:17:44 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/configure' --- autogen/configure 2013-10-13 10:19:27 +0000 +++ autogen/configure 2013-10-14 10:17:44 +0000 @@ -9004,10 +9004,10 @@ if test "x$GCC" = "xyes"; then C_SWITCH_MACHINE="-fno-common" else - as_fn_error "What gives? Fix me if DEC Unix supports ELF now." "$LINENO" 5 + as_fn_error "Non-GCC compilers are not supported." "$LINENO" 5 fi else - UNEXEC_OBJ=unexalpha.o + as_fn_error "Non-ELF systems are not supported since Emacs 24.1." "$LINENO" 5 fi ;; esac ------------------------------------------------------------ revno: 114656 committer: Paul Eggert branch nick: trunk timestamp: Mon 2013-10-14 00:12:49 -0700 message: * lisp.h (bool_vector_size): New function. All uses of XBOOL_VECTOR (x)->size changed to bool_vector_size (x). * data.c (bool_vector_spare_mask, bool_vector_binop_driver) (Fbool_vector_not, Fbool_vector_count_matches_at): Remove uses of 'eassume' that should no longer be needed, because they are subsumed by the 'eassume' in bool_vector_size. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-10-13 00:28:30 +0000 +++ src/ChangeLog 2013-10-14 07:12:49 +0000 @@ -1,3 +1,12 @@ +2013-10-14 Paul Eggert + + * lisp.h (bool_vector_size): New function. + All uses of XBOOL_VECTOR (x)->size changed to bool_vector_size (x). + * data.c (bool_vector_spare_mask, bool_vector_binop_driver) + (Fbool_vector_not, Fbool_vector_count_matches_at): + Remove uses of 'eassume' that should no longer be needed, + because they are subsumed by the 'eassume' in bool_vector_size. + 2013-10-12 Eli Zaretskii * image.c (GIFLIB_MAJOR, GIFLIB_MINOR, GIFLIB_RELEASE): Move back === modified file 'src/category.h' --- src/category.h 2013-09-20 15:34:36 +0000 +++ src/category.h 2013-10-14 07:12:49 +0000 @@ -63,7 +63,7 @@ #define XCATEGORY_SET XBOOL_VECTOR #define CATEGORY_SET_P(x) \ - (BOOL_VECTOR_P (x) && XBOOL_VECTOR (x)->size == 128) + (BOOL_VECTOR_P (x) && bool_vector_size (x) == 128) /* Return a new empty category set. */ #define MAKE_CATEGORY_SET (Fmake_bool_vector (make_number (128), Qnil)) === modified file 'src/data.c' --- src/data.c 2013-10-11 06:32:29 +0000 +++ src/data.c 2013-10-14 07:12:49 +0000 @@ -2130,7 +2130,7 @@ { int val; - if (idxval < 0 || idxval >= XBOOL_VECTOR (array)->size) + if (idxval < 0 || idxval >= bool_vector_size (array)) args_out_of_range (array, idx); val = (unsigned char) XBOOL_VECTOR (array)->data[idxval / BOOL_VECTOR_BITS_PER_CHAR]; @@ -2180,7 +2180,7 @@ { int val; - if (idxval < 0 || idxval >= XBOOL_VECTOR (array)->size) + if (idxval < 0 || idxval >= bool_vector_size (array)) args_out_of_range (array, idx); val = (unsigned char) XBOOL_VECTOR (array)->data[idxval / BOOL_VECTOR_BITS_PER_CHAR]; @@ -2969,7 +2969,6 @@ static bits_word bool_vector_spare_mask (ptrdiff_t nr_bits) { - eassume (nr_bits > 0); return (((bits_word) 1) << (nr_bits % BITS_PER_BITS_WORD)) - 1; } @@ -3005,8 +3004,7 @@ CHECK_BOOL_VECTOR (op1); CHECK_BOOL_VECTOR (op2); - nr_bits = min (XBOOL_VECTOR (op1)->size, - XBOOL_VECTOR (op2)->size); + nr_bits = min (bool_vector_size (op1), bool_vector_size (op2)); if (NILP (dest)) { @@ -3016,10 +3014,9 @@ else { CHECK_BOOL_VECTOR (dest); - nr_bits = min (nr_bits, XBOOL_VECTOR (dest)->size); + nr_bits = min (nr_bits, bool_vector_size (dest)); } - eassume (nr_bits >= 0); nr_words = ROUNDUP (nr_bits, BITS_PER_BITS_WORD) / BITS_PER_BITS_WORD; adata = (bits_word *) XBOOL_VECTOR (dest)->data; @@ -3172,21 +3169,19 @@ bits_word mword; CHECK_BOOL_VECTOR (a); - nr_bits = XBOOL_VECTOR (a)->size; + nr_bits = bool_vector_size (a); if (NILP (b)) b = Fmake_bool_vector (make_number (nr_bits), Qnil); else { CHECK_BOOL_VECTOR (b); - nr_bits = min (nr_bits, XBOOL_VECTOR (b)->size); + nr_bits = min (nr_bits, bool_vector_size (b)); } bdata = (bits_word *) XBOOL_VECTOR (b)->data; adata = (bits_word *) XBOOL_VECTOR (a)->data; - eassume (nr_bits >= 0); - for (i = 0; i < nr_bits / BITS_PER_BITS_WORD; i++) bdata[i] = ~adata[i]; @@ -3215,13 +3210,11 @@ CHECK_BOOL_VECTOR (a); - nr_bits = XBOOL_VECTOR (a)->size; + nr_bits = bool_vector_size (a); count = 0; match = NILP (b) ? -1 : 0; adata = (bits_word *) XBOOL_VECTOR (a)->data; - eassume (nr_bits >= 0); - for (i = 0; i < nr_bits / BITS_PER_BITS_WORD; ++i) count += popcount_bits_word (adata[i] ^ match); @@ -3256,13 +3249,12 @@ CHECK_BOOL_VECTOR (a); CHECK_NATNUM (i); - nr_bits = XBOOL_VECTOR (a)->size; + nr_bits = bool_vector_size (a); if (XFASTINT (i) > nr_bits) /* Allow one past the end for convenience */ args_out_of_range (a, i); adata = (bits_word *) XBOOL_VECTOR (a)->data; - eassume (nr_bits >= 0); nr_words = ROUNDUP (nr_bits, BITS_PER_BITS_WORD) / BITS_PER_BITS_WORD; pos = XFASTINT (i) / BITS_PER_BITS_WORD; === modified file 'src/fns.c' --- src/fns.c 2013-10-09 22:39:57 +0000 +++ src/fns.c 2013-10-14 07:12:49 +0000 @@ -114,7 +114,7 @@ else if (CHAR_TABLE_P (sequence)) XSETFASTINT (val, MAX_CHAR); else if (BOOL_VECTOR_P (sequence)) - XSETFASTINT (val, XBOOL_VECTOR (sequence)->size); + XSETFASTINT (val, bool_vector_size (sequence)); else if (COMPILEDP (sequence)) XSETFASTINT (val, ASIZE (sequence) & PSEUDOVECTOR_SIZE_MASK); else if (CONSP (sequence)) @@ -437,7 +437,7 @@ { Lisp_Object val; ptrdiff_t size_in_chars - = ((XBOOL_VECTOR (arg)->size + BOOL_VECTOR_BITS_PER_CHAR - 1) + = ((bool_vector_size (arg) + BOOL_VECTOR_BITS_PER_CHAR - 1) / BOOL_VECTOR_BITS_PER_CHAR); val = Fmake_bool_vector (Flength (arg), Qnil); @@ -540,7 +540,7 @@ if (! ASCII_CHAR_P (c) && ! CHAR_BYTE8_P (c)) some_multibyte = 1; } - else if (BOOL_VECTOR_P (this) && XBOOL_VECTOR (this)->size > 0) + else if (BOOL_VECTOR_P (this) && bool_vector_size (this) > 0) wrong_type_argument (Qintegerp, Faref (this, make_number (0))); else if (CONSP (this)) for (; CONSP (this); this = XCDR (this)) @@ -2070,11 +2070,11 @@ /* Boolvectors are compared much like strings. */ if (BOOL_VECTOR_P (o1)) { - if (XBOOL_VECTOR (o1)->size != XBOOL_VECTOR (o2)->size) + EMACS_INT size = bool_vector_size (o1); + if (size != bool_vector_size (o2)) return 0; if (memcmp (XBOOL_VECTOR (o1)->data, XBOOL_VECTOR (o2)->data, - ((XBOOL_VECTOR (o1)->size - + BOOL_VECTOR_BITS_PER_CHAR - 1) + ((size + BOOL_VECTOR_BITS_PER_CHAR - 1) / BOOL_VECTOR_BITS_PER_CHAR))) return 0; return 1; @@ -2166,10 +2166,9 @@ } else if (BOOL_VECTOR_P (array)) { - register unsigned char *p = XBOOL_VECTOR (array)->data; - size = - ((XBOOL_VECTOR (array)->size + BOOL_VECTOR_BITS_PER_CHAR - 1) - / BOOL_VECTOR_BITS_PER_CHAR); + unsigned char *p = XBOOL_VECTOR (array)->data; + size = ((bool_vector_size (array) + BOOL_VECTOR_BITS_PER_CHAR - 1) + / BOOL_VECTOR_BITS_PER_CHAR); if (size) { @@ -4188,11 +4187,12 @@ static EMACS_UINT sxhash_bool_vector (Lisp_Object vec) { - EMACS_UINT hash = XBOOL_VECTOR (vec)->size; + EMACS_INT size = bool_vector_size (vec); + EMACS_UINT hash = size; int i, n; n = min (SXHASH_MAX_LEN, - ((XBOOL_VECTOR (vec)->size + BOOL_VECTOR_BITS_PER_CHAR - 1) + ((size + BOOL_VECTOR_BITS_PER_CHAR - 1) / BOOL_VECTOR_BITS_PER_CHAR)); for (i = 0; i < n; ++i) hash = sxhash_combine (hash, XBOOL_VECTOR (vec)->data[i]); === modified file 'src/image.c' --- src/image.c 2013-10-12 08:48:31 +0000 +++ src/image.c 2013-10-14 07:12:49 +0000 @@ -2456,7 +2456,7 @@ } else if (BOOL_VECTOR_P (elt)) { - if (XBOOL_VECTOR (elt)->size < width) + if (bool_vector_size (elt) < width) return 0; } else @@ -2471,7 +2471,7 @@ } else if (BOOL_VECTOR_P (data)) { - if (XBOOL_VECTOR (data)->size / height < width) + if (bool_vector_size (data) / height < width) return 0; } else === modified file 'src/lisp.h' --- src/lisp.h 2013-10-11 06:32:29 +0000 +++ src/lisp.h 2013-10-14 07:12:49 +0000 @@ -1184,6 +1184,14 @@ unsigned char data[FLEXIBLE_ARRAY_MEMBER]; }; +INLINE EMACS_INT +bool_vector_size (Lisp_Object a) +{ + EMACS_INT size = XBOOL_VECTOR (a)->size; + eassume (0 <= size); + return size; +} + /* Some handy constants for calculating sizes and offsets, mostly of vectorlike objects. */ === modified file 'src/print.c' --- src/print.c 2013-09-03 13:29:38 +0000 +++ src/print.c 2013-10-14 07:12:49 +0000 @@ -1704,15 +1704,14 @@ int len; unsigned char c; struct gcpro gcpro1; - ptrdiff_t size_in_chars - = ((XBOOL_VECTOR (obj)->size + BOOL_VECTOR_BITS_PER_CHAR - 1) - / BOOL_VECTOR_BITS_PER_CHAR); - + EMACS_INT size = bool_vector_size (obj); + ptrdiff_t size_in_chars = ((size + BOOL_VECTOR_BITS_PER_CHAR - 1) + / BOOL_VECTOR_BITS_PER_CHAR); GCPRO1 (obj); PRINTCHAR ('#'); PRINTCHAR ('&'); - len = sprintf (buf, "%"pI"d", XBOOL_VECTOR (obj)->size); + len = sprintf (buf, "%"pI"d", size); strout (buf, len, len, printcharfun); PRINTCHAR ('\"');