------------------------------------------------------------ revno: 114680 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15580 author: Dima Kogan committer: Stefan Monnier branch nick: trunk timestamp: Tue 2013-10-15 23:02:40 -0400 message: * lisp/progmodes/subword.el (subword-capitalize): Fix Stefan's mess. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-10-16 01:38:12 +0000 +++ lisp/ChangeLog 2013-10-16 03:02:40 +0000 @@ -1,3 +1,8 @@ +2013-10-16 Dima Kogan (tiny change) + + * progmodes/subword.el (subword-capitalize): Fix Stefan's mess + (bug#15580). + 2013-10-16 Glenn Morris * ansi-color.el (ansi-color-drop-regexp): === modified file 'lisp/progmodes/subword.el' --- lisp/progmodes/subword.el 2013-10-14 19:20:29 +0000 +++ lisp/progmodes/subword.el 2013-10-16 03:02:40 +0000 @@ -257,25 +257,26 @@ See the command `subword-mode' for a description of subwords. Optional argument ARG is the same as for `capitalize-word'." (interactive "p") - (catch 'search-failed - (let ((count (abs arg)) - (start (point)) - (advance (>= arg 0))) + (condition-case nil + (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))))) + (dotimes (i count) + (if advance + (progn + (re-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))) + (search-failed nil))) ------------------------------------------------------------ revno: 114679 fixes bug: http://debbugs.gnu.org/15617 committer: Glenn Morris branch nick: trunk timestamp: Tue 2013-10-15 18:38:12 -0700 message: * ansi-color.el (ansi-color-drop-regexp): Add 1J, 1K, 2K. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-10-16 01:33:16 +0000 +++ lisp/ChangeLog 2013-10-16 01:38:12 +0000 @@ -1,5 +1,8 @@ 2013-10-16 Glenn Morris + * ansi-color.el (ansi-color-drop-regexp): + Add 1J, 1K, 2K. (Bug#15617) + * files.el (hack-local-variables--warned-lexical): New. (hack-local-variables): Warn about misplaced lexical-binding. (Bug#15616) === modified file 'lisp/ansi-color.el' --- lisp/ansi-color.el 2013-07-24 03:49:24 +0000 +++ lisp/ansi-color.el 2013-10-16 01:38:12 +0000 @@ -153,7 +153,7 @@ "Regexp that matches SGR control sequences.") (defconst ansi-color-drop-regexp - "\033\\[\\([ABCDsuK]\\|2J\\|=[0-9]+[hI]\\|[0-9;]*[Hf]\\)" + "\033\\[\\([ABCDsuK]\\|[12][JK]\\|=[0-9]+[hI]\\|[0-9;]*[Hf]\\)" "Regexp that matches ANSI control sequences to silently drop.") (defconst ansi-color-parameter-regexp "\\([0-9]*\\)[m;]" ------------------------------------------------------------ revno: 114678 fixes bug: http://debbugs.gnu.org/15616 committer: Glenn Morris branch nick: trunk timestamp: Tue 2013-10-15 18:33:16 -0700 message: * files.el (hack-local-variables): Warn about misplaced lexical-binding. (hack-local-variables--warned-lexical): New. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-10-16 01:30:55 +0000 +++ lisp/ChangeLog 2013-10-16 01:33:16 +0000 @@ -1,5 +1,9 @@ 2013-10-16 Glenn Morris + * files.el (hack-local-variables--warned-lexical): New. + (hack-local-variables): + Warn about misplaced lexical-binding. (Bug#15616) + * net/eww.el (eww-render): Always set eww-current-url, and update header line. (Bug#15622) (eww-display-html): ... Rather than just doing it here. === modified file 'lisp/files.el' --- lisp/files.el 2013-09-22 12:23:20 +0000 +++ lisp/files.el 2013-10-16 01:33:16 +0000 @@ -3154,6 +3154,9 @@ (assq-delete-all (car elt) file-local-variables-alist))) (push elt file-local-variables-alist))))) +;; TODO? Warn once per file rather than once per session? +(defvar hack-local-variables--warned-lexical nil) + (defun hack-local-variables (&optional mode-only) "Parse and put into effect this buffer's local variables spec. Uses `hack-local-variables-apply' to apply the variables. @@ -3275,13 +3278,18 @@ "-minor\\'" (setq val2 (downcase (symbol-name val))))) (setq result (intern (concat val2 "-mode")))) - (unless (eq var 'coding) - (condition-case nil - (push (cons (if (eq var 'eval) - 'eval - (indirect-variable var)) - val) result) - (error nil))))) + (cond ((eq var 'coding)) + ((eq var 'lexical-binding) + (unless hack-local-variables--warned-lexical + (setq hack-local-variables--warned-lexical t) + (display-warning :warning + "Specify `lexical-binding' on the first line, not at the end"))) + (t + (ignore-errors + (push (cons (if (eq var 'eval) + 'eval + (indirect-variable var)) + val) result)))))) (forward-line 1)))))))) ;; Now we've read all the local variables. ;; If MODE-ONLY is non-nil, return whether the mode was specified. ------------------------------------------------------------ revno: 114677 fixes bug: http://debbugs.gnu.org/15622 committer: Glenn Morris branch nick: trunk timestamp: Tue 2013-10-15 18:30:55 -0700 message: * net/eww.el (eww-render): Always set eww-current-url, and update header line. (eww-display-html): ... Rather than just doing it here. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-10-15 18:40:22 +0000 +++ lisp/ChangeLog 2013-10-16 01:30:55 +0000 @@ -1,3 +1,9 @@ +2013-10-16 Glenn Morris + + * net/eww.el (eww-render): Always set eww-current-url, + and update header line. (Bug#15622) + (eww-display-html): ... Rather than just doing it here. + 2013-10-15 Eli Zaretskii * menu-bar.el (tty-menu-navigation-map): Bind mouse wheels to TTY === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-09-18 04:48:55 +0000 +++ lisp/net/eww.el 2013-10-16 01:30:55 +0000 @@ -160,7 +160,9 @@ (eww-display-image)) (t (eww-display-raw))) - (setq eww-history-position 0) + (setq eww-current-url url + eww-history-position 0) + (eww-update-header-line-format) (cond (point (goto-char point)) @@ -212,8 +214,6 @@ 'base (list (cons 'href url)) (libxml-parse-html-region (point) (point-max))))) (eww-setup-buffer) - (setq eww-current-url url) - (eww-update-header-line-format) (let ((inhibit-read-only t) (after-change-functions nil) (shr-width nil) @@ -266,6 +266,8 @@ (setq header-line-format (replace-regexp-in-string "%" "%%" + ;; FIXME? Title can be blank. Default to, eg, last component + ;; of url? (format-spec eww-header-line-format `((?u . ,eww-current-url) (?t . ,eww-current-title))))) @@ -369,6 +371,7 @@ "Mode for browsing the web. \\{eww-mode-map}" + ;; FIXME? This seems a strange default. (set (make-local-variable 'eww-current-url) 'author) (set (make-local-variable 'browse-url-browser-function) 'eww-browse-url) (set (make-local-variable 'after-change-functions) 'eww-process-text-input) ------------------------------------------------------------ revno: 114676 committer: Dmitry Gutov branch nick: trunk timestamp: Wed 2013-10-16 04:21:06 +0400 message: * etc/NEWS: improve wording. diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-10-16 00:17:38 +0000 +++ etc/NEWS 2013-10-16 00:21:06 +0000 @@ -556,8 +556,8 @@ ** Package *** The format of `archive-contents' files, generated by package -repositories, has changed to allow a new (fifth) element, containing -an associative list with extra properties. +repositories, has changed to allow a new (fifth) element in the data +vectors, containing an associative list with extra properties. *** `describe-package' buffer uses the `:url' extra property to display a `Homepage' header, if it's present. ------------------------------------------------------------ revno: 114675 committer: Dmitry Gutov branch nick: trunk timestamp: Wed 2013-10-16 04:17:38 +0400 message: * etc/NEWS: Mention the homepage-related changes in package.el. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2013-10-07 03:34:26 +0000 +++ etc/ChangeLog 2013-10-16 00:17:38 +0000 @@ -1,3 +1,7 @@ +2013-10-16 Dmitry Gutov + + * NEWS: Mention the homepage-related changes in package.el. + 2013-10-07 Leo Liu * NEWS: Mention new feature of register commands. === modified file 'etc/NEWS' --- etc/NEWS 2013-10-13 12:14:28 +0000 +++ etc/NEWS 2013-10-16 00:17:38 +0000 @@ -553,6 +553,15 @@ Tramp-using variants can still be used by enabling the eshell-tramp module. +** Package + +*** The format of `archive-contents' files, generated by package +repositories, has changed to allow a new (fifth) element, containing +an associative list with extra properties. + +*** `describe-package' buffer uses the `:url' extra property to +display a `Homepage' header, if it's present. + ** New term.el option `term-suppress-hard-newline'. ** Obsolete packages: ------------------------------------------------------------ revno: 114674 committer: Paul Eggert branch nick: trunk timestamp: Tue 2013-10-15 14:03:00 -0700 message: * print.c (print_object): Print " ..." when truncating bool vectors. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-10-15 18:38:26 +0000 +++ src/ChangeLog 2013-10-15 21:03:00 +0000 @@ -1,3 +1,7 @@ +2013-10-15 Paul Eggert + + * print.c (print_object): Print " ..." when truncating bool vectors. + 2013-10-15 Eli Zaretskii * w32inevt.c (do_mouse_event): Support mouse wheel and all the 5 === modified file 'src/print.c' --- src/print.c 2013-10-14 07:12:49 +0000 +++ src/print.c 2013-10-15 21:03:00 +0000 @@ -1707,6 +1707,7 @@ EMACS_INT size = bool_vector_size (obj); ptrdiff_t size_in_chars = ((size + BOOL_VECTOR_BITS_PER_CHAR - 1) / BOOL_VECTOR_BITS_PER_CHAR); + ptrdiff_t real_size_in_chars = size_in_chars; GCPRO1 (obj); PRINTCHAR ('#'); @@ -1751,6 +1752,9 @@ PRINTCHAR (c); } } + + if (size_in_chars < real_size_in_chars) + strout (" ...", 4, 4, printcharfun); PRINTCHAR ('\"'); UNGCPRO; ------------------------------------------------------------ revno: 114673 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2013-10-15 21:40:22 +0300 message: Support mouse wheel in TTY menus. lisp/menu-bar.el (tty-menu-navigation-map): Bind mouse wheels to TTY menu navigations commands. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-10-14 19:20:29 +0000 +++ lisp/ChangeLog 2013-10-15 18:40:22 +0000 @@ -1,3 +1,8 @@ +2013-10-15 Eli Zaretskii + + * menu-bar.el (tty-menu-navigation-map): Bind mouse wheels to TTY + menu navigations commands. + 2013-10-14 Dima Kogan (tiny change) * progmodes/subword.el (subword-capitalize): Be careful when === modified file 'lisp/menu-bar.el' --- lisp/menu-bar.el 2013-10-14 15:37:12 +0000 +++ lisp/menu-bar.el 2013-10-15 18:40:22 +0000 @@ -2341,6 +2341,10 @@ (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) + (define-key map [wheel-down] 'tty-menu-next-item) + (define-key map [wheel-up] 'tty-menu-prev-item) + (define-key map [wheel-left] 'tty-menu-prev-menu) + (define-key map [wheel-right] 'tty-menu-next-menu) ;; 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) ------------------------------------------------------------ revno: 114672 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2013-10-15 21:38:26 +0300 message: Support mouse wheel on MS-Windows text-mode console. src/w32inevt.c (do_mouse_event): Support mouse wheel and all the 5 standard mouse buttons. src/termhooks.h (struct input_event): Remove incorrect commentary. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-10-15 16:38:36 +0000 +++ src/ChangeLog 2013-10-15 18:38:26 +0000 @@ -1,3 +1,10 @@ +2013-10-15 Eli Zaretskii + + * w32inevt.c (do_mouse_event): Support mouse wheel and all the 5 + standard mouse buttons. + + * termhooks.h (struct input_event): Remove incorrect commentary. + 2013-10-15 Paul Eggert Disallow bool vector operations on mixed-length operands. === modified file 'src/termhooks.h' --- src/termhooks.h 2013-10-14 12:19:21 +0000 +++ src/termhooks.h 2013-10-15 18:38:26 +0000 @@ -243,7 +243,6 @@ For a mouse event, this is the button number. For a HELP_EVENT, this is the position within the object (stored in ARG below) where the help was found. */ - /* In WindowsNT, for a mouse wheel event, this is the delta. */ ptrdiff_t code; enum scroll_bar_part part; === modified file 'src/w32inevt.c' --- src/w32inevt.c 2013-09-21 14:53:04 +0000 +++ src/w32inevt.c 2013-10-15 18:38:26 +0000 @@ -30,6 +30,9 @@ #ifndef MOUSE_MOVED #define MOUSE_MOVED 1 #endif +#ifndef MOUSE_HWHEELED +#define MOUSE_HWHEELED 8 +#endif #include "lisp.h" #include "keyboard.h" @@ -438,16 +441,16 @@ next - Leftmost+1 next - Leftmost+2... - Assume emacs likes three button mice, so + For the 3 standard buttons, we have: Left == 0 Middle == 1 Right == 2 Others increase from there. */ -#define NUM_TRANSLATED_MOUSE_BUTTONS 3 +#define NUM_TRANSLATED_MOUSE_BUTTONS 5 static int emacs_button_translation[NUM_TRANSLATED_MOUSE_BUTTONS] = { - 0, 2, 1 + 0, 2, 1, 3, 4 }; static int @@ -456,100 +459,127 @@ { static DWORD button_state = 0; static Lisp_Object last_mouse_window; - DWORD but_change, mask; + DWORD but_change, mask, flags = event->dwEventFlags; int i; - if (event->dwEventFlags == MOUSE_MOVED) + switch (flags) { - struct frame *f = SELECTED_FRAME (); - Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); - int mx = event->dwMousePosition.X, my = event->dwMousePosition.Y; - - mouse_moved_to (mx, my); - - if (f->mouse_moved) - { - if (hlinfo->mouse_face_hidden) - { - hlinfo->mouse_face_hidden = 0; - clear_mouse_face (hlinfo); - } - - /* Generate SELECT_WINDOW_EVENTs when needed. */ - if (!NILP (Vmouse_autoselect_window)) - { - Lisp_Object mouse_window = window_from_coordinates (f, mx, my, - 0, 0); - /* A window will be selected only when it is not - selected now, and the last mouse movement event was - not in it. A minibuffer window will be selected iff - it is active. */ - if (WINDOWP (mouse_window) - && !EQ (mouse_window, last_mouse_window) - && !EQ (mouse_window, selected_window)) - { - struct input_event event; - - EVENT_INIT (event); - event.kind = SELECT_WINDOW_EVENT; - event.frame_or_window = mouse_window; - event.arg = Qnil; - event.timestamp = movement_time; - kbd_buffer_store_event (&event); - } - last_mouse_window = mouse_window; - } - else - last_mouse_window = Qnil; - - previous_help_echo_string = help_echo_string; - help_echo_string = help_echo_object = help_echo_window = Qnil; - help_echo_pos = -1; - note_mouse_highlight (f, mx, my); - /* If the contents of the global variable help_echo has - changed (inside note_mouse_highlight), generate a HELP_EVENT. */ - if (!NILP (help_echo_string) || !NILP (previous_help_echo_string)) - gen_help_event (help_echo_string, selected_frame, help_echo_window, - help_echo_object, help_echo_pos); - } - return 0; + case MOUSE_MOVED: + { + struct frame *f = get_frame (); + Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); + int mx = event->dwMousePosition.X, my = event->dwMousePosition.Y; + + mouse_moved_to (mx, my); + + if (f->mouse_moved) + { + if (hlinfo->mouse_face_hidden) + { + hlinfo->mouse_face_hidden = 0; + clear_mouse_face (hlinfo); + } + + /* Generate SELECT_WINDOW_EVENTs when needed. */ + if (!NILP (Vmouse_autoselect_window)) + { + Lisp_Object mouse_window = window_from_coordinates (f, mx, my, + 0, 0); + /* A window will be selected only when it is not + selected now, and the last mouse movement event was + not in it. A minibuffer window will be selected iff + it is active. */ + if (WINDOWP (mouse_window) + && !EQ (mouse_window, last_mouse_window) + && !EQ (mouse_window, selected_window)) + { + struct input_event event; + + EVENT_INIT (event); + event.kind = SELECT_WINDOW_EVENT; + event.frame_or_window = mouse_window; + event.arg = Qnil; + event.timestamp = movement_time; + kbd_buffer_store_event (&event); + } + last_mouse_window = mouse_window; + } + else + last_mouse_window = Qnil; + + previous_help_echo_string = help_echo_string; + help_echo_string = help_echo_object = help_echo_window = Qnil; + help_echo_pos = -1; + note_mouse_highlight (f, mx, my); + /* If the contents of the global variable help_echo has + changed (inside note_mouse_highlight), generate a HELP_EVENT. */ + if (!NILP (help_echo_string) || !NILP (previous_help_echo_string)) + gen_help_event (help_echo_string, selected_frame, + help_echo_window, help_echo_object, + help_echo_pos); + } + /* We alread called kbd_buffer_store_event, so indicate the + the caller it shouldn't. */ + return 0; + } + case MOUSE_WHEELED: + case MOUSE_HWHEELED: + { + struct frame *f = get_frame (); + int mx = event->dwMousePosition.X, my = event->dwMousePosition.Y; + bool down_p = (event->dwButtonState & 0x10000000) != 0; + + emacs_ev->kind = + flags == MOUSE_HWHEELED ? HORIZ_WHEEL_EVENT : WHEEL_EVENT; + emacs_ev->code = 0; + emacs_ev->modifiers = down_p ? down_modifier : up_modifier; + emacs_ev->modifiers |= + w32_kbd_mods_to_emacs (event->dwControlKeyState, 0); + XSETINT (emacs_ev->x, mx); + XSETINT (emacs_ev->y, my); + XSETFRAME (emacs_ev->frame_or_window, f); + emacs_ev->arg = Qnil; + emacs_ev->timestamp = GetTickCount (); + return 1; + } + case DOUBLE_CLICK: + default: /* mouse pressed or released */ + /* It looks like the console code sends us a button-release + mouse event with dwButtonState == 0 when a window is + activated and when the mouse is first clicked. Ignore this + case. */ + if (event->dwButtonState == button_state) + return 0; + + emacs_ev->kind = MOUSE_CLICK_EVENT; + + /* Find out what button has changed state since the last button + event. */ + but_change = button_state ^ event->dwButtonState; + mask = 1; + for (i = 0; mask; i++, mask <<= 1) + if (but_change & mask) + { + if (i < NUM_TRANSLATED_MOUSE_BUTTONS) + emacs_ev->code = emacs_button_translation[i]; + else + emacs_ev->code = i; + break; + } + + button_state = event->dwButtonState; + emacs_ev->modifiers = + w32_kbd_mods_to_emacs (event->dwControlKeyState, 0) + | ((event->dwButtonState & mask) ? down_modifier : up_modifier); + + XSETFASTINT (emacs_ev->x, event->dwMousePosition.X); + XSETFASTINT (emacs_ev->y, event->dwMousePosition.Y); + XSETFRAME (emacs_ev->frame_or_window, get_frame ()); + emacs_ev->arg = Qnil; + emacs_ev->timestamp = GetTickCount (); + + return 1; } - - /* It looks like the console code sends us a mouse event with - dwButtonState == 0 when a window is activated. Ignore this case. */ - if (event->dwButtonState == button_state) - return 0; - - emacs_ev->kind = MOUSE_CLICK_EVENT; - - /* Find out what button has changed state since the last button event. */ - but_change = button_state ^ event->dwButtonState; - mask = 1; - for (i = 0; mask; i++, mask <<= 1) - if (but_change & mask) - { - if (i < NUM_TRANSLATED_MOUSE_BUTTONS) - emacs_ev->code = emacs_button_translation[i]; - else - emacs_ev->code = i; - break; - } - - button_state = event->dwButtonState; - emacs_ev->timestamp = GetTickCount (); - emacs_ev->modifiers = w32_kbd_mods_to_emacs (event->dwControlKeyState, 0) | - ((event->dwButtonState & mask) ? down_modifier : up_modifier); - - XSETFASTINT (emacs_ev->x, event->dwMousePosition.X); - XSETFASTINT (emacs_ev->y, event->dwMousePosition.Y); -/* for Mule 2.2 (Based on Emacs 19.28 */ -#ifdef MULE - XSET (emacs_ev->frame_or_window, Lisp_Frame, get_frame ()); -#else - XSETFRAME (emacs_ev->frame_or_window, get_frame ()); -#endif - - return 1; } static void ------------------------------------------------------------ revno: 114671 author: Paul Eggert committer: Paul Eggert branch nick: trunk timestamp: Tue 2013-10-15 09:38:36 -0700 message: Disallow bool vector operations on mixed-length operands. The old behavior left garbage in the result vector sometimes, and didn't seem to be useful. * data.c (Qwrong_length_argument): New static var. (wrong_length_argument): New function. (bool_vector_binop_driver): Check that args agree in length. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-10-15 13:57:37 +0000 +++ src/ChangeLog 2013-10-15 16:38:36 +0000 @@ -1,5 +1,12 @@ 2013-10-15 Paul Eggert + Disallow bool vector operations on mixed-length operands. + The old behavior left garbage in the result vector sometimes, + and didn't seem to be useful. + * data.c (Qwrong_length_argument): New static var. + (wrong_length_argument): New function. + (bool_vector_binop_driver): Check that args agree in length. + * keyboard.c, keyboard.h (all_kboards): Now static. 2013-10-15 Xue Fuqiao === modified file 'src/data.c' --- src/data.c 2013-10-14 07:12:49 +0000 +++ src/data.c 2013-10-15 16:38:36 +0000 @@ -41,6 +41,7 @@ static Lisp_Object Qsubr; Lisp_Object Qerror_conditions, Qerror_message, Qtop_level; Lisp_Object Qerror, Quser_error, Qquit, Qargs_out_of_range; +static Lisp_Object Qwrong_length_argument; static Lisp_Object Qwrong_type_argument; Lisp_Object Qvoid_variable, Qvoid_function; static Lisp_Object Qcyclic_function_indirection; @@ -179,6 +180,18 @@ blv->valcell = val; } +static _Noreturn void +wrong_length_argument (Lisp_Object a1, Lisp_Object a2, Lisp_Object a3) +{ + Lisp_Object size1 = make_number (bool_vector_size (a1)); + Lisp_Object size2 = make_number (bool_vector_size (a2)); + if (NILP (a3)) + xsignal2 (Qwrong_length_argument, size1, size2); + else + xsignal3 (Qwrong_length_argument, size1, size2, + make_number (bool_vector_size (a3))); +} + Lisp_Object wrong_type_argument (register Lisp_Object predicate, register Lisp_Object value) { @@ -3004,7 +3017,9 @@ CHECK_BOOL_VECTOR (op1); CHECK_BOOL_VECTOR (op2); - nr_bits = min (bool_vector_size (op1), bool_vector_size (op2)); + nr_bits = bool_vector_size (op1); + if (bool_vector_size (op2) != nr_bits) + wrong_length_argument (op1, op2, dest); if (NILP (dest)) { @@ -3014,7 +3029,8 @@ else { CHECK_BOOL_VECTOR (dest); - nr_bits = min (nr_bits, bool_vector_size (dest)); + if (bool_vector_size (dest) != nr_bits) + wrong_length_argument (op1, op2, dest); } nr_words = ROUNDUP (nr_bits, BITS_PER_BITS_WORD) / BITS_PER_BITS_WORD; @@ -3103,11 +3119,10 @@ DEFUN ("bool-vector-exclusive-or", Fbool_vector_exclusive_or, Sbool_vector_exclusive_or, 2, 3, 0, - doc: /* Compute C = A ^ B, bitwise exclusive or. -A, B, and C must be bool vectors. If C is nil, allocate a new bool -vector in which to store the result. Return the destination vector if -it changed or nil otherwise. */ - ) + doc: /* Return A ^ B, bitwise exclusive or. +If optional third argument C is given, store result into C. +A, B, and C must be bool vectors of the same length. +Return the destination vector if it changed or nil otherwise. */) (Lisp_Object a, Lisp_Object b, Lisp_Object c) { return bool_vector_binop_driver (a, b, c, bool_vector_exclusive_or); @@ -3115,10 +3130,10 @@ DEFUN ("bool-vector-union", Fbool_vector_union, Sbool_vector_union, 2, 3, 0, - doc: /* Compute C = A | B, bitwise or. -A, B, and C must be bool vectors. If C is nil, allocate a new bool -vector in which to store the result. Return the destination vector if -it changed or nil otherwise. */) + doc: /* Return A | B, bitwise or. +If optional third argument C is given, store result into C. +A, B, and C must be bool vectors of the same length. +Return the destination vector if it changed or nil otherwise. */) (Lisp_Object a, Lisp_Object b, Lisp_Object c) { return bool_vector_binop_driver (a, b, c, bool_vector_union); @@ -3126,10 +3141,10 @@ DEFUN ("bool-vector-intersection", Fbool_vector_intersection, Sbool_vector_intersection, 2, 3, 0, - doc: /* Compute C = A & B, bitwise and. -A, B, and C must be bool vectors. If C is nil, allocate a new bool -vector in which to store the result. Return the destination vector if -it changed or nil otherwise. */) + doc: /* Return A & B, bitwise and. +If optional third argument C is given, store result into C. +A, B, and C must be bool vectors of the same length. +Return the destination vector if it changed or nil otherwise. */) (Lisp_Object a, Lisp_Object b, Lisp_Object c) { return bool_vector_binop_driver (a, b, c, bool_vector_intersection); @@ -3137,10 +3152,10 @@ DEFUN ("bool-vector-set-difference", Fbool_vector_set_difference, Sbool_vector_set_difference, 2, 3, 0, - doc: /* Compute C = A &~ B, set difference. -A, B, and C must be bool vectors. If C is nil, allocate a new bool -vector in which to store the result. Return the destination vector if -it changed or nil otherwise. */) + doc: /* Return A &~ B, set difference. +If optional third argument C is given, store result into C. +A, B, and C must be bool vectors of the same length. +Return the destination vector if it changed or nil otherwise. */) (Lisp_Object a, Lisp_Object b, Lisp_Object c) { return bool_vector_binop_driver (a, b, c, bool_vector_set_difference); @@ -3157,9 +3172,9 @@ DEFUN ("bool-vector-not", Fbool_vector_not, Sbool_vector_not, 1, 2, 0, - doc: /* Compute B = ~A. -B must be a bool vector. A must be a bool vector or nil. -If A is nil, allocate a new bool vector in which to store the result. + doc: /* Compute ~A, set complement. +If optional second argument B is given, store result into B. +A and B must be bool vectors of the same length. Return the destination vector. */) (Lisp_Object a, Lisp_Object b) { @@ -3176,7 +3191,8 @@ else { CHECK_BOOL_VECTOR (b); - nr_bits = min (nr_bits, bool_vector_size (b)); + if (bool_vector_size (b) != nr_bits) + wrong_length_argument (a, b, Qnil); } bdata = (bits_word *) XBOOL_VECTOR (b)->data; @@ -3323,6 +3339,7 @@ DEFSYM (Qerror, "error"); DEFSYM (Quser_error, "user-error"); DEFSYM (Qquit, "quit"); + DEFSYM (Qwrong_length_argument, "wrong-length-argument"); DEFSYM (Qwrong_type_argument, "wrong-type-argument"); DEFSYM (Qargs_out_of_range, "args-out-of-range"); DEFSYM (Qvoid_function, "void-function"); @@ -3397,6 +3414,7 @@ PUT_ERROR (Qquit, Qnil, "Quit"); PUT_ERROR (Quser_error, error_tail, ""); + PUT_ERROR (Qwrong_length_argument, error_tail, "Wrong length argument"); PUT_ERROR (Qwrong_type_argument, error_tail, "Wrong type argument"); PUT_ERROR (Qargs_out_of_range, error_tail, "Args out of range"); PUT_ERROR (Qvoid_function, error_tail, ------------------------------------------------------------ revno: 114670 committer: Paul Eggert branch nick: trunk timestamp: Tue 2013-10-15 06:57:37 -0700 message: * keyboard.c, keyboard.h (all_kboards): Now static. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-10-15 12:47:57 +0000 +++ src/ChangeLog 2013-10-15 13:57:37 +0000 @@ -1,3 +1,7 @@ +2013-10-15 Paul Eggert + + * keyboard.c, keyboard.h (all_kboards): Now static. + 2013-10-15 Xue Fuqiao * buffer.c (syms_of_buffer) : Add usage === modified file 'src/keyboard.c' --- src/keyboard.c 2013-10-10 10:06:17 +0000 +++ src/keyboard.c 2013-10-15 13:57:37 +0000 @@ -82,7 +82,7 @@ KBOARD *initial_kboard; KBOARD *current_kboard; -KBOARD *all_kboards; +static KBOARD *all_kboards; /* True in the single-kboard state, false in the any-kboard state. */ static bool single_kboard; === modified file 'src/keyboard.h' --- src/keyboard.h 2013-10-10 10:06:17 +0000 +++ src/keyboard.h 2013-10-15 13:57:37 +0000 @@ -227,9 +227,6 @@ right now considering input. We can consider input from another kboard, but doing so requires throwing to wrong_kboard_jmpbuf. */ extern KBOARD *current_kboard; - -/* A list of all kboard objects, linked through next_kboard. */ -extern KBOARD *all_kboards; /* Total number of times read_char has returned, modulo UINTMAX_MAX + 1. */ extern uintmax_t num_input_events; ------------------------------------------------------------ revno: 114669 committer: Xue Fuqiao branch nick: trunk timestamp: Tue 2013-10-15 20:47:57 +0800 message: Add usage note of buffer-invisibility-spec. * src/buffer.c (syms_of_buffer) : Add usage note from the lispref. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-10-15 06:36:43 +0000 +++ src/ChangeLog 2013-10-15 12:47:57 +0000 @@ -1,3 +1,8 @@ +2013-10-15 Xue Fuqiao + + * buffer.c (syms_of_buffer) : Add usage + note from the lispref. + 2013-10-15 Dmitry Antipov * nsterm.h (struct ns_display_info): Remove set-but-unused === modified file 'src/buffer.c' --- src/buffer.c 2013-09-24 06:43:20 +0000 +++ src/buffer.c 2013-10-15 12:47:57 +0000 @@ -6190,7 +6190,9 @@ property is an element in that list (or is a list with members in common). If an element is a cons cell of the form (PROP . ELLIPSIS), then characters with property value PROP are invisible, -and they have an ellipsis as well if ELLIPSIS is non-nil. */); +and they have an ellipsis as well if ELLIPSIS is non-nil. +Setting this variable is very fast, much faster than scanning all the +text in the buffer looking for properties to change. */); DEFVAR_PER_BUFFER ("buffer-display-count", &BVAR (current_buffer, display_count), Qintegerp, ------------------------------------------------------------ revno: 114668 committer: Xue Fuqiao branch nick: trunk timestamp: Tue 2013-10-15 16:43:56 +0800 message: * doc/lispref/display.texi (Warning Basics): Mention the ‘*Warnings*’ buffer. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-10-13 00:31:19 +0000 +++ doc/lispref/ChangeLog 2013-10-15 08:43:56 +0000 @@ -1,3 +1,7 @@ +2013-10-15 Xue Fuqiao + + * display.texi (Warning Basics): Mention the ‘*Warnings*’ buffer. + 2013-10-13 Glenn Morris * intro.texi (Acknowledgments): Use accented form of some names. === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2013-10-14 22:20:52 +0000 +++ doc/lispref/display.texi 2013-10-15 08:43:56 +0000 @@ -633,8 +633,8 @@ @defun lwarn type level message &rest args This function reports a warning using the value of @code{(format -@var{message} @var{args}...)} as the message. In other respects it is -equivalent to @code{display-warning}. +@var{message} @var{args}...)} as the message in the @file{*Warnings*} +buffer. In other respects it is equivalent to @code{display-warning}. @end defun @defun warn message &rest args ------------------------------------------------------------ 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)