Now on revision 114141. ------------------------------------------------------------ revno: 114141 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2013-09-05 10:25:12 +0400 message: Make --without-x compatible with --enable-gcc-warnings. * configure.ac: If both --without-x and --enable-gcc-warnings are specified, use -Wno-unused-variable, -Wno-unused-but-set-variable and -Wno-unused-but-set-parameter. * src/font.c (register_font_driver): Move check under HAVE_WINDOW_SYSTEM. * src/font.h (struct font_driver): Move draw, get_bitmap and free_bitmap members under HAVE_WINDOW_SYSTEM. * src/keyboard.c (make_lispy_focus_out): Likewise. (record_menu_key): Move under HAVE_MENUS. * src/xdisp.c (toplevel): Move hourglass_shown_p, hourglass_atimer and THIN_SPACE_WIDTH under HAVE_WINDOW_SYSTEM. (syms_of_xdisp): Adjust user. (window_box_edges): Define only if HAVE_WINDOW_SYSTEM. (start_hourglass, cancel_hourglass): * src/xfaces.c (toplevel): Likewise with PT_PER_INCH, clear_font_table_count, CLEAR_FONT_TABLE_COUNT and CLEAR_FONT_TABLE_NFONTS. (set_font_frame_param, clear_face_gcs, realize_non_ascii_face): Declare only if HAVE_WINDOW_SYSTEM. (lface_same_font_attributes_p, clear_face_gcs): Define only if HAVE_WINDOW_SYSTEM. diff: === modified file 'ChangeLog' --- ChangeLog 2013-09-04 06:45:44 +0000 +++ ChangeLog 2013-09-05 06:25:12 +0000 @@ -1,3 +1,10 @@ +2013-09-05 Dmitry Antipov + + Make --without-x compatible with --enable-gcc-warnings. + * configure.ac: If both --without-x and --enable-gcc-warnings are + specified, use -Wno-unused-variable, -Wno-unused-but-set-variable + and -Wno-unused-but-set-parameter. + 2013-09-04 Paul Eggert Makefile improvements. === modified file 'configure.ac' --- configure.ac 2013-09-02 07:01:53 +0000 +++ configure.ac 2013-09-05 06:25:12 +0000 @@ -1775,6 +1775,13 @@ ## $window_system is now set to the window system we will ## ultimately use. +if test "$window_system" = none && test "$gl_gcc_warnings" = yes; then + # Too many warnings for now. + gl_WARN_ADD([-Wno-unused-variable]) + gl_WARN_ADD([-Wno-unused-but-set-variable]) + gl_WARN_ADD([-Wno-unused-but-set-parameter]) +fi + term_header= HAVE_X_WINDOWS=no HAVE_X11=no === modified file 'src/ChangeLog' --- src/ChangeLog 2013-09-05 03:51:37 +0000 +++ src/ChangeLog 2013-09-05 06:25:12 +0000 @@ -1,5 +1,26 @@ 2013-09-05 Dmitry Antipov + Make --without-x compatible with --enable-gcc-warnings. + * font.c (register_font_driver): Move check under HAVE_WINDOW_SYSTEM. + * font.h (struct font_driver): Move draw, get_bitmap and free_bitmap + members under HAVE_WINDOW_SYSTEM. + * keyboard.c (make_lispy_focus_out): Likewise. + (record_menu_key): Move under HAVE_MENUS. + * xdisp.c (toplevel): Move hourglass_shown_p, hourglass_atimer and + THIN_SPACE_WIDTH under HAVE_WINDOW_SYSTEM. + (syms_of_xdisp): Adjust user. + (window_box_edges): Define only if HAVE_WINDOW_SYSTEM. + (start_hourglass, cancel_hourglass): + * xfaces.c (toplevel): Likewise with PT_PER_INCH, + clear_font_table_count, CLEAR_FONT_TABLE_COUNT + and CLEAR_FONT_TABLE_NFONTS. + (set_font_frame_param, clear_face_gcs, realize_non_ascii_face): + Declare only if HAVE_WINDOW_SYSTEM. + (lface_same_font_attributes_p, clear_face_gcs): Define only + if HAVE_WINDOW_SYSTEM. + +2013-09-05 Dmitry Antipov + * frame.c (check_minibuf_window): Update 'frame' with frame pointer. * xterm.c (x_scroll_bar_handle_click) [!USE_TOOLKIT_SCROLL_BARS]: Don't pass C integer to XINT (tiny fix for 2013-09-03 change). === modified file 'src/font.c' --- src/font.c 2013-08-13 08:18:11 +0000 +++ src/font.c 2013-09-05 06:25:12 +0000 @@ -3379,9 +3379,11 @@ struct font_driver_list *root = f ? f->font_driver_list : font_driver_list; struct font_driver_list *prev, *list; +#ifdef HAVE_WINDOW_SYSTEM if (f && ! driver->draw) error ("Unusable font driver for a frame: %s", SDATA (SYMBOL_NAME (driver->type))); +#endif /* HAVE_WINDOW_SYSTEM */ for (prev = NULL, list = root; list; prev = list, list = list->next) if (EQ (list->driver->type, driver->type)) === modified file 'src/font.h' --- src/font.h 2013-08-30 12:17:44 +0000 +++ src/font.h 2013-09-05 06:25:12 +0000 @@ -575,6 +575,8 @@ unsigned *code, int nglyphs, struct font_metrics *metrics); +#ifdef HAVE_WINDOW_SYSTEM + /* Optional. Draw glyphs between FROM and TO of S->char2b at (X Y) pixel position of frame F with S->FACE and S->GC. If WITH_BACKGROUND, @@ -595,6 +597,8 @@ Free bitmap data in BITMAP. */ void (*free_bitmap) (struct font *font, struct font_bitmap *bitmap); +#endif /* HAVE_WINDOW_SYSTEM */ + /* Optional. Return an outline data for glyph-code CODE of FONT. The format of the outline data depends on the font-driver. */ === modified file 'src/keyboard.c' --- src/keyboard.c 2013-09-04 20:32:22 +0000 +++ src/keyboard.c 2013-09-05 06:25:12 +0000 @@ -422,7 +422,9 @@ Lisp_Object *, ptrdiff_t); static Lisp_Object make_lispy_switch_frame (Lisp_Object); static Lisp_Object make_lispy_focus_in (Lisp_Object); +#ifdef HAVE_WINDOW_SYSTEM static Lisp_Object make_lispy_focus_out (Lisp_Object); +#endif /* HAVE_WINDOW_SYSTEM */ static bool help_char_p (Lisp_Object); static void save_getcjmp (sys_jmp_buf); static void restore_getcjmp (sys_jmp_buf); @@ -3210,6 +3212,8 @@ 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. */ @@ -3245,6 +3249,8 @@ num_input_events++; } +#endif /* HAVE_MENUS */ + /* Return true if should recognize C as "the help character". */ static bool @@ -6069,12 +6075,17 @@ { return list2 (Qfocus_in, frame); } + +#ifdef HAVE_WINDOW_SYSTEM + static Lisp_Object make_lispy_focus_out (Lisp_Object frame) { return list2 (Qfocus_out, frame); } - + +#endif /* HAVE_WINDOW_SYSTEM */ + /* Manipulating modifiers. */ /* Parse the name of SYMBOL, and return the set of modifiers it contains. === modified file 'src/xdisp.c' --- src/xdisp.c 2013-09-01 16:21:48 +0000 +++ src/xdisp.c 2013-09-05 06:25:12 +0000 @@ -760,6 +760,8 @@ /* Platform-independent portion of hourglass implementation. */ +#ifdef HAVE_WINDOW_SYSTEM + /* Non-zero means an hourglass cursor is currently shown. */ int hourglass_shown_p; @@ -767,6 +769,8 @@ an hourglass cursor on all frames. */ struct atimer *hourglass_atimer; +#endif /* HAVE_WINDOW_SYSTEM */ + /* Name of the face used to display glyphless characters. */ Lisp_Object Qglyphless_char; @@ -776,14 +780,17 @@ /* Method symbols for Vglyphless_char_display. */ static Lisp_Object Qhex_code, Qempty_box, Qthin_space, Qzero_width; -/* Default pixel width of `thin-space' display method. */ -#define THIN_SPACE_WIDTH 1 - /* Default number of seconds to wait before displaying an hourglass cursor. */ #define DEFAULT_HOURGLASS_DELAY 1 - +#ifdef HAVE_WINDOW_SYSTEM + +/* Default pixel width of `thin-space' display method. */ +#define THIN_SPACE_WIDTH 1 + +#endif /* HAVE_WINDOW_SYSTEM */ + /* Function prototypes. */ static void setup_for_ellipsis (struct it *, int); @@ -1145,6 +1152,7 @@ } } +#ifdef HAVE_WINDOW_SYSTEM /* Get the bounding box of the display area AREA of window W, without mode lines and both fringes of the window. Return in *TOP_LEFT_X @@ -1163,8 +1171,8 @@ *bottom_right_y += *top_left_y; } +#endif /* HAVE_WINDOW_SYSTEM */ - /*********************************************************************** Utilities ***********************************************************************/ @@ -29643,8 +29651,10 @@ doc: /* Seconds to wait before displaying an hourglass pointer when Emacs is busy. */); Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY); +#ifdef HAVE_WINDOW_SYSTEM hourglass_atimer = NULL; hourglass_shown_p = 0; +#endif /* HAVE_WINDOW_SYSTEM */ DEFSYM (Qglyphless_char, "glyphless-char"); DEFSYM (Qhex_code, "hex-code"); @@ -29731,13 +29741,14 @@ help_echo_showing_p = 0; } +#ifdef HAVE_WINDOW_SYSTEM + /* Platform-independent portion of hourglass implementation. */ /* Cancel a currently active hourglass timer, and start a new one. */ void start_hourglass (void) { -#if defined (HAVE_WINDOW_SYSTEM) struct timespec delay; cancel_hourglass (); @@ -29762,7 +29773,6 @@ hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay, show_hourglass, NULL); -#endif } @@ -29771,7 +29781,6 @@ void cancel_hourglass (void) { -#if defined (HAVE_WINDOW_SYSTEM) if (hourglass_atimer) { cancel_atimer (hourglass_atimer); @@ -29780,5 +29789,6 @@ if (hourglass_shown_p) hide_hourglass (); -#endif } + +#endif /* HAVE_WINDOW_SYSTEM */ === modified file 'src/xfaces.c' --- src/xfaces.c 2013-08-26 21:31:50 +0000 +++ src/xfaces.c 2013-09-05 06:25:12 +0000 @@ -238,6 +238,11 @@ #define FRAME_X_DISPLAY_INFO FRAME_NS_DISPLAY_INFO #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" @@ -272,10 +277,6 @@ #include -/* Number of pt per inch (from the TeXbook). */ - -#define PT_PER_INCH 72.27 - /* Non-zero if face attribute ATTR is unspecified. */ #define UNSPECIFIEDP(ATTR) EQ ((ATTR), Qunspecified) @@ -396,6 +397,8 @@ static Lisp_Object Qtty_color_alist; +#ifdef HAVE_WINDOW_SYSTEM + /* Counter for calls to clear_face_cache. If this counter reaches CLEAR_FONT_TABLE_COUNT, and a frame has more than CLEAR_FONT_TABLE_NFONTS load, unused fonts are freed. */ @@ -404,6 +407,8 @@ #define CLEAR_FONT_TABLE_COUNT 100 #define CLEAR_FONT_TABLE_NFONTS 10 +#endif /* HAVE_WINDOW_SYSTEM */ + /* Non-zero means face attributes have been changed since the last redisplay. Used in redisplay_internal. */ @@ -434,29 +439,27 @@ static int menu_face_changed_default; - -/* Function prototypes. */ - -struct table_entry; struct named_merge_point; -static void set_font_frame_param (Lisp_Object, Lisp_Object); static struct face *realize_face (struct face_cache *, Lisp_Object *, int); -static struct face *realize_non_ascii_face (struct frame *, Lisp_Object, - struct face *); static struct face *realize_x_face (struct face_cache *, Lisp_Object *); static struct face *realize_tty_face (struct face_cache *, Lisp_Object *); static bool realize_basic_faces (struct frame *); static bool realize_default_face (struct frame *); static void realize_named_face (struct frame *, Lisp_Object, int); static struct face_cache *make_face_cache (struct frame *); -static void clear_face_gcs (struct face_cache *); static void free_face_cache (struct face_cache *); static int merge_face_ref (struct frame *, Lisp_Object, Lisp_Object *, int, struct named_merge_point *); - +#ifdef HAVE_WINDOW_SYSTEM +static void set_font_frame_param (Lisp_Object, Lisp_Object); +static void clear_face_gcs (struct face_cache *); +static struct face *realize_non_ascii_face (struct frame *, Lisp_Object, + struct face *); +#endif /* HAVE_WINDOW_SYSTEM */ + /*********************************************************************** Utilities ***********************************************************************/ @@ -3983,6 +3986,7 @@ ^ XHASH (v[LFACE_HEIGHT_INDEX])); } +#ifdef HAVE_WINDOW_SYSTEM /* Return non-zero if LFACE1 and LFACE2 specify the same font (without considering charsets/registries). They do if they specify the same @@ -4011,8 +4015,8 @@ ); } +#endif /* HAVE_WINDOW_SYSTEM */ - /*********************************************************************** Realized Faces ***********************************************************************/ @@ -4171,6 +4175,7 @@ return c; } +#ifdef HAVE_WINDOW_SYSTEM /* Clear out all graphics contexts for all realized faces, except for the basic faces. This should be done from time to time just to avoid @@ -4181,7 +4186,6 @@ { if (c && FRAME_WINDOW_P (c->f)) { -#ifdef HAVE_WINDOW_SYSTEM int i; for (i = BASIC_FACE_ID_SENTINEL; i < c->used; ++i) { @@ -4196,10 +4200,10 @@ unblock_input (); } } -#endif /* HAVE_WINDOW_SYSTEM */ } } +#endif /* HAVE_WINDOW_SYSTEM */ /* Free all realized faces in face cache C, including basic faces. C may be null. If faces are freed, make sure the frame's current ------------------------------------------------------------ revno: 114140 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2013-09-05 07:51:37 +0400 message: * frame.c (check_minibuf_window): Update 'frame' with frame pointer. * xterm.c (x_scroll_bar_handle_click) [!USE_TOOLKIT_SCROLL_BARS]: Don't pass C integer to XINT (tiny fix for 2013-09-03 change). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-09-05 02:27:13 +0000 +++ src/ChangeLog 2013-09-05 03:51:37 +0000 @@ -1,3 +1,9 @@ +2013-09-05 Dmitry Antipov + + * frame.c (check_minibuf_window): Update 'frame' with frame pointer. + * xterm.c (x_scroll_bar_handle_click) [!USE_TOOLKIT_SCROLL_BARS]: + Don't pass C integer to XINT (tiny fix for 2013-09-03 change). + 2013-09-05 Stefan Monnier * cmds.c (Fself_insert_command): Don't pass a non-integer to XINT. === modified file 'src/frame.c' --- src/frame.c 2013-09-02 17:23:26 +0000 +++ src/frame.c 2013-09-05 03:51:37 +0000 @@ -1133,6 +1133,8 @@ { struct frame *f = decode_live_frame (frame); + XSETFRAME (frame, f); + if (WINDOWP (minibuf_window) && EQ (f->minibuffer_window, minibuf_window)) { Lisp_Object frames, this, window = make_number (0); === modified file 'src/xterm.c' --- src/xterm.c 2013-09-04 04:02:56 +0000 +++ src/xterm.c 2013-09-05 03:51:37 +0000 @@ -5473,7 +5473,7 @@ /* If the user has released the handle, set it to its final position. */ if (event->type == ButtonRelease && bar->dragging != -1) { - int new_start = y - XINT (bar->dragging); + int new_start = y - bar->dragging; int new_end = new_start + bar->end - bar->start; x_scroll_bar_set_handle (bar, new_start, new_end, 0); ------------------------------------------------------------ revno: 114139 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-09-04 23:46:34 -0400 message: * lisp/subr.el (pop): Use `car-safe'. * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Remove hack to detect unused `pop' return value. * lisp/emacs-lisp/advice.el (defadvice): Add indent rule. * lisp/international/mule-cmds.el: Require CL. (find-coding-systems-for-charsets): Avoid add-to-list. (sanitize-coding-system-list): New function, extracted from select-safe-coding-system-interactively. (select-safe-coding-system-interactively): Use it. (read-input-method-name): Accept symbols for `default'. * lisp/progmodes/python.el (python-nav-beginning-of-block): Remove unused var `block-regexp'. (python-nav--forward-sexp): Remove unused var `re-search-fn'. (python-fill-string): Remove unused var `marker'. (python-skeleton-add-menu-items): Remove unused var `items'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-05 03:30:07 +0000 +++ lisp/ChangeLog 2013-09-05 03:46:34 +0000 @@ -1,3 +1,24 @@ +2013-09-05 Stefan Monnier + + * subr.el (pop): Use `car-safe'. + * emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Remove hack + to detect unused `pop' return value. + + * progmodes/python.el (python-nav-beginning-of-block): Remove unused + var `block-regexp'. + (python-nav--forward-sexp): Remove unused var `re-search-fn'. + (python-fill-string): Remove unused var `marker'. + (python-skeleton-add-menu-items): Remove unused var `items'. + + * international/mule-cmds.el: Require CL. + (find-coding-systems-for-charsets): Avoid add-to-list. + (sanitize-coding-system-list): New function, extracted from + select-safe-coding-system-interactively. + (select-safe-coding-system-interactively): Use it. + (read-input-method-name): Accept symbols for `default'. + + * emacs-lisp/advice.el (defadvice): Add indent rule. + 2013-09-05 Daniel Hackney * dired-x.el: === modified file 'lisp/emacs-lisp/advice.el' --- lisp/emacs-lisp/advice.el 2013-08-04 20:18:11 +0000 +++ lisp/emacs-lisp/advice.el 2013-09-05 03:46:34 +0000 @@ -3190,7 +3190,7 @@ usage: (defadvice FUNCTION (CLASS NAME [POSITION] [ARGLIST] FLAG...) [DOCSTRING] [INTERACTIVE-FORM] BODY...)" - (declare (doc-string 3) + (declare (doc-string 3) (indent 2) (debug (&define name ;; thing being advised. (name ;; class is [&or "before" "around" "after" ;; "activation" "deactivation"] === modified file 'lisp/emacs-lisp/byte-opt.el' --- lisp/emacs-lisp/byte-opt.el 2013-06-14 02:31:28 +0000 +++ lisp/emacs-lisp/byte-opt.el 2013-09-05 03:46:34 +0000 @@ -533,18 +533,6 @@ ((and for-effect (setq tmp (get fn 'side-effect-free)) (or byte-compile-delete-errors (eq tmp 'error-free) - ;; Detect the expansion of (pop foo). - ;; There is no need to compile the call to `car' there. - (and (eq fn 'car) - (eq (car-safe (cadr form)) 'prog1) - (let ((var (cadr (cadr form))) - (last (nth 2 (cadr form)))) - (and (symbolp var) - (null (nthcdr 3 (cadr form))) - (eq (car-safe last) 'setq) - (eq (cadr last) var) - (eq (car-safe (nth 2 last)) 'cdr) - (eq (cadr (nth 2 last)) var)))) (progn (byte-compile-warn "value returned from %s is unused" (prin1-to-string form)) === modified file 'lisp/international/mule-cmds.el' --- lisp/international/mule-cmds.el 2013-08-08 23:59:14 +0000 +++ lisp/international/mule-cmds.el 2013-09-05 03:46:34 +0000 @@ -30,6 +30,8 @@ ;;; Code: +(eval-when-compile (require 'cl-lib)) + (defvar dos-codepage) (autoload 'widget-value "wid-edit") @@ -548,7 +550,7 @@ (coding-system-charset-list cs))) (charsets charsets)) (if (coding-system-get cs :ascii-compatible-p) - (add-to-list 'cs-charsets 'ascii)) + (cl-pushnew 'ascii cs-charsets)) (if (catch 'ok (when cs-charsets (while charsets @@ -636,6 +638,36 @@ function `select-safe-coding-system' (which see). This variable overrides that argument.") +(defun sanitize-coding-system-list (codings) + "Return a list of coding systems presumably more user-friendly than CODINGS." + ;; Change each safe coding system to the corresponding + ;; mime-charset name if it is also a coding system. Such a name + ;; is more friendly to users. + (setq codings + (mapcar (lambda (cs) + (let ((mime-charset (coding-system-get cs 'mime-charset))) + (if (and mime-charset (coding-system-p mime-charset) + (coding-system-equal cs mime-charset)) + mime-charset cs))) + codings)) + + ;; Don't offer variations with locking shift, which you + ;; basically never want. + (let (l) + (dolist (elt codings (setq codings (nreverse l))) + (unless (or (eq 'coding-category-iso-7-else + (coding-system-category elt)) + (eq 'coding-category-iso-8-else + (coding-system-category elt))) + (push elt l)))) + + ;; Remove raw-text, emacs-mule and no-conversion unless nothing + ;; else is available. + (or (delq 'raw-text + (delq 'emacs-mule + (delq 'no-conversion (copy-sequence codings)))) + codings)) + (defun select-safe-coding-system-interactively (from to codings unsafe &optional rejected default) "Select interactively a coding system for the region FROM ... TO. @@ -667,35 +699,7 @@ from to coding 11))))) unsafe))) - ;; Change each safe coding system to the corresponding - ;; mime-charset name if it is also a coding system. Such a name - ;; is more friendly to users. - (let ((l codings) - mime-charset) - (while l - (setq mime-charset (coding-system-get (car l) :mime-charset)) - (if (and mime-charset (coding-system-p mime-charset) - (coding-system-equal (car l) mime-charset)) - (setcar l mime-charset)) - (setq l (cdr l)))) - - ;; Don't offer variations with locking shift, which you - ;; basically never want. - (let (l) - (dolist (elt codings (setq codings (nreverse l))) - (unless (or (eq 'coding-category-iso-7-else - (coding-system-category elt)) - (eq 'coding-category-iso-8-else - (coding-system-category elt))) - (push elt l)))) - - ;; Remove raw-text, emacs-mule and no-conversion unless nothing - ;; else is available. - (setq codings - (or (delq 'raw-text - (delq 'emacs-mule - (delq 'no-conversion codings))) - '(raw-text emacs-mule no-conversion))) + (setq codings (sanitize-coding-system-list codings)) (let ((window-configuration (current-window-configuration)) (bufname (buffer-name)) @@ -1421,7 +1425,9 @@ ;; buffer local. (input-method (completing-read prompt input-method-alist nil t nil 'input-method-history - default))) + (if (and default (symbolp default)) + (symbol-name default) + default)))) (if (and input-method (symbolp input-method)) (setq input-method (symbol-name input-method))) (if (> (length input-method) 0) === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2013-09-02 13:56:03 +0000 +++ lisp/progmodes/python.el 2013-09-05 03:46:34 +0000 @@ -1327,9 +1327,7 @@ (defun python-nav-beginning-of-block () "Move to start of current block." (interactive "^") - (let ((starting-pos (point)) - (block-regexp (python-rx - line-start (* whitespace) block-start))) + (let ((starting-pos (point))) (if (progn (python-nav-beginning-of-statement) (looking-at (python-rx block-start))) @@ -1422,9 +1420,6 @@ (let* ((forward-p (if (> dir 0) (and (setq dir 1) t) (and (setq dir -1) nil))) - (re-search-fn (if forward-p - 're-search-forward - 're-search-backward)) (context-type (python-syntax-context-type))) (cond ((memq context-type '(string comment)) @@ -2666,8 +2661,7 @@ (defun python-fill-string (&optional justify) "String fill function for `python-fill-paragraph'. JUSTIFY should be used (if applicable) as in `fill-paragraph'." - (let* ((marker (point-marker)) - (str-start-pos + (let* ((str-start-pos (set-marker (make-marker) (or (python-syntax-context 'string) @@ -2733,7 +2727,7 @@ ;; Again indent only if a newline is added. (indent-according-to-mode))))) t) -(defun python-fill-decorator (&optional justify) +(defun python-fill-decorator (&optional _justify) "Decorator fill function for `python-fill-paragraph'. JUSTIFY should be used (if applicable) as in `fill-paragraph'." t) @@ -2895,8 +2889,7 @@ (defun python-skeleton-add-menu-items () "Add menu items to Python->Skeletons menu." - (let ((skeletons (sort python-skeleton-available 'string<)) - (items)) + (let ((skeletons (sort python-skeleton-available 'string<))) (dolist (skeleton skeletons) (easy-menu-add-item nil '("Python" "Skeletons") @@ -2984,7 +2977,7 @@ (let ((process-environment (python-shell-calculate-process-environment)) (exec-path (python-shell-calculate-exec-path))) (compilation-start command nil - (lambda (mode-name) + (lambda (_modename) (format python-check-buffer-name command))))) @@ -3095,7 +3088,7 @@ "Return imenu label for parent node using TYPE and NAME." (format "%s..." (python-imenu-format-item-label type name))) -(defun python-imenu-format-parent-item-jump-label (type name) +(defun python-imenu-format-parent-item-jump-label (type _name) "Return imenu label for parent node jump using TYPE and NAME." (if (string= type "class") "*class definition*" @@ -3209,7 +3202,7 @@ (cons name (cdar pos)) (python-imenu-create-flat-index (cddr item) name)))))) (or alist - (let* ((fn (lambda (type name) name)) + (let* ((fn (lambda (_type name) name)) (python-imenu-format-item-label-function fn) (python-imenu-format-parent-item-label-function fn) (python-imenu-format-parent-item-jump-label-function fn)) @@ -3614,7 +3607,7 @@ (add-to-list 'hs-special-modes-alist `(python-mode "^\\s-*\\(?:def\\|class\\)\\>" nil "#" - ,(lambda (arg) + ,(lambda (_arg) (python-nav-end-of-defun)) nil)) (set (make-local-variable 'mode-require-final-newline) t) === modified file 'lisp/subr.el' --- lisp/subr.el 2013-08-09 21:22:44 +0000 +++ lisp/subr.el 2013-09-05 03:46:34 +0000 @@ -170,12 +170,16 @@ If the value is nil, `pop' returns nil but does not actually change the list." (declare (debug (gv-place))) - (list 'car - (if (symbolp place) - ;; So we can use `pop' in the bootstrap before `gv' can be used. - (list 'prog1 place (list 'setq place (list 'cdr place))) - (gv-letplace (getter setter) place - `(prog1 ,getter ,(funcall setter `(cdr ,getter))))))) + ;; We use `car-safe' here instead of `car' because the behavior is the same + ;; (if it's not a cons cell, the `cdr' would have signaled an error already), + ;; but `car-safe' is total, so the byte-compiler can safely remove it if the + ;; result is not used. + `(car-safe + ,(if (symbolp place) + ;; So we can use `pop' in the bootstrap before `gv' can be used. + (list 'prog1 place (list 'setq place (list 'cdr place))) + (gv-letplace (getter setter) place + `(prog1 ,getter ,(funcall setter `(cdr ,getter))))))) (defmacro when (cond &rest body) "If COND yields non-nil, do BODY, else return nil. ------------------------------------------------------------ revno: 114138 author: Daniel Hackney committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-09-04 23:30:07 -0400 message: * lisp/dired-x.el: * lisp/net/ange-ftp.el: * lisp/net/browse-url.el: * lisp/net/dbus.el: * lisp/net/eudc.el: * lisp/net/eudcb-ldap.el: * lisp/net/eww.el: * lisp/net/imap.el: * lisp/printing.el: * lisp/vc/ediff-diff.el: * lisp/vc/ediff-init.el: * lisp/vc/ediff-merg.el: * lisp/vc/ediff-mult.el: * lisp/vc/ediff-util.el: * lisp/vc/ediff-wind.el: * lisp/vc/ediff.el: * lisp/vc/emerge.el: * lisp/vc/pcvs.el: * vc/vc-annotate.el: Prefix unused arguments with `_' to silence byte compiler. Remove some unused let-bound variables. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-05 03:05:44 +0000 +++ lisp/ChangeLog 2013-09-05 03:30:07 +0000 @@ -1,3 +1,26 @@ +2013-09-05 Daniel Hackney + + * dired-x.el: + * net/ange-ftp.el: + * net/browse-url.el: + * net/dbus.el: + * net/eudc.el: + * net/eudcb-ldap.el: + * net/eww.el: + * net/imap.el: + * printing.el: + * vc/ediff-diff.el: + * vc/ediff-init.el: + * vc/ediff-merg.el: + * vc/ediff-mult.el: + * vc/ediff-util.el: + * vc/ediff-wind.el: + * vc/ediff.el: + * vc/emerge.el: + * vc/pcvs.el: + * vc/vc-annotate.el: Prefix unused arguments with `_' to silence + byte compiler. Remove some unused let-bound variables. + 2013-09-05 Stefan Monnier * emacs-lisp/cconv.el: Use `car-safe' rather than `car' to access === modified file 'lisp/dired-x.el' --- lisp/dired-x.el 2013-07-25 07:10:56 +0000 +++ lisp/dired-x.el 2013-09-05 03:30:07 +0000 @@ -1185,7 +1185,7 @@ (setq count (1+ count) start (1+ start))) ;; ... and prepend a "../" for each slash found: - (dotimes (_n count) + (dotimes (n count) (setq name1 (concat "../" name1))))) (make-symbolic-link (directory-file-name name1) ; must not link to foo/ === modified file 'lisp/net/ange-ftp.el' --- lisp/net/ange-ftp.el 2013-08-16 07:18:17 +0000 +++ lisp/net/ange-ftp.el 2013-09-05 03:30:07 +0000 @@ -3733,7 +3733,7 @@ ;; next part of copying routine. (defun ange-ftp-cf1 (result line filename newname binary msg - f-parsed f-host f-user f-name f-abbr + f-parsed f-host f-user _f-name f-abbr t-parsed t-host t-user t-name t-abbr temp1 temp2 cont nowait) (if line @@ -3835,7 +3835,7 @@ (defun ange-ftp-copy-file (filename newname &optional ok-if-already-exists keep-date preserve-uid-gid - preserve-selinux-context) + _preserve-selinux-context) (interactive "fCopy file: \nFCopy %s to file: \np") (ange-ftp-copy-file-internal filename newname @@ -4200,7 +4200,7 @@ (while (and tryfiles (not copy)) (catch 'ftp-error (let ((ange-ftp-waiting-flag t)) - (condition-case error + (condition-case _error (setq copy (ange-ftp-file-local-copy (car tryfiles))) (ftp-error nil)))) (setq tryfiles (cdr tryfiles))) @@ -4214,7 +4214,7 @@ (ange-ftp-real-load file noerror nomessage nosuffix))) ;; Calculate default-unhandled-directory for a given ange-ftp buffer. -(defun ange-ftp-unhandled-file-name-directory (filename) +(defun ange-ftp-unhandled-file-name-directory (_filename) nil) @@ -4605,7 +4605,6 @@ (defun ange-ftp-shell-command (command &optional output-buffer error-buffer) (let* ((parsed (ange-ftp-ftp-name default-directory)) (host (nth 0 parsed)) - (user (nth 1 parsed)) (name (nth 2 parsed))) (if (not parsed) (ange-ftp-real-shell-command command output-buffer error-buffer) @@ -5176,7 +5175,7 @@ ;; versions left. If not, then delete the ;; root entry. (maphash - (lambda (key val) + (lambda (key _val) (and (string-match regexp key) (setq versions t))) files) @@ -5358,7 +5357,7 @@ ;; compressed files. Instead, we turn "FILE.TYPE" into ;; "FILE.TYPE-Z". Hope that this is a reasonable thing to do. -(defun ange-ftp-vms-make-compressed-filename (name &optional reverse) +(defun ange-ftp-vms-make-compressed-filename (name &optional _reverse) (cond ((string-match "-Z;[0-9]+\\'" name) (list nil (substring name 0 (match-beginning 0)))) @@ -5399,7 +5398,7 @@ ;; (cons '(vms . ange-ftp-dired-vms-ls-trim) ;; ange-ftp-dired-ls-trim-alist))) -(defun ange-ftp-vms-sans-version (name &rest args) +(defun ange-ftp-vms-sans-version (name &rest _args) (save-match-data (if (string-match ";[0-9]+\\'" name) (substring name 0 (match-beginning 0)) @@ -5920,7 +5919,7 @@ ;; (cons '(cms . ange-ftp-dired-cms-move-to-end-of-filename) ;; ange-ftp-dired-move-to-end-of-filename-alist))) -(defun ange-ftp-cms-make-compressed-filename (name &optional reverse) +(defun ange-ftp-cms-make-compressed-filename (name &optional _reverse) (if (string-match "-Z\\'" name) (list nil (substring name 0 -2)) (list t (concat name "-Z")))) === modified file 'lisp/net/browse-url.el' --- lisp/net/browse-url.el 2013-07-31 06:52:26 +0000 +++ lisp/net/browse-url.el 2013-09-05 03:30:07 +0000 @@ -868,7 +868,7 @@ (defvar dos-windows-version) (declare-function w32-shell-execute "w32fns.c") ;; Defined in C. -(defun browse-url-default-windows-browser (url &optional new-window) +(defun browse-url-default-windows-browser (url &optional _new-window) (interactive (browse-url-interactive-arg "URL: ")) (cond ((eq system-type 'ms-dos) (if dos-windows-version @@ -878,7 +878,7 @@ (call-process "cygstart" nil nil nil url)) (t (w32-shell-execute "open" url)))) -(defun browse-url-default-macosx-browser (url &optional new-window) +(defun browse-url-default-macosx-browser (url &optional _new-window) (interactive (browse-url-interactive-arg "URL: ")) (start-process (concat "open " url) nil "open" url)) @@ -933,7 +933,7 @@ ((executable-find browse-url-xterm-program) 'browse-url-text-xterm) ((locate-library "w3") 'browse-url-w3) (t - (lambda (&rest ignore) (error "No usable browser found")))) + (lambda (&rest _ignore) (error "No usable browser found")))) url args)) (defun browse-url-can-use-xdg-open () @@ -1163,7 +1163,7 @@ (append browse-url-firefox-startup-arguments (list url)))))) ;;;###autoload -(defun browse-url-chromium (url &optional new-window) +(defun browse-url-chromium (url &optional _new-window) "Ask the Chromium WWW browser to load URL. Default to the URL around or before point. The strings in variable `browse-url-chromium-arguments' are also passed to @@ -1272,7 +1272,7 @@ (defvar url-handler-regexp) ;;;###autoload -(defun browse-url-emacs (url &optional new-window) +(defun browse-url-emacs (url &optional _new-window) "Ask Emacs to load URL into a buffer and show it in another window." (interactive (browse-url-interactive-arg "URL: ")) (require 'url-handlers) @@ -1413,7 +1413,7 @@ (w3-fetch url))) ;;;###autoload -(defun browse-url-w3-gnudoit (url &optional new-window) +(defun browse-url-w3-gnudoit (url &optional _new-window) ;; new-window ignored "Ask another Emacs running gnuserv to load the URL using the W3 browser. The `browse-url-gnudoit-program' program is used with options given by @@ -1428,7 +1428,7 @@ ;; --- Lynx in an xterm --- ;;;###autoload -(defun browse-url-text-xterm (url &optional new-window) +(defun browse-url-text-xterm (url &optional _new-window) ;; new-window ignored "Ask a text browser to load URL. URL defaults to the URL around or before point. @@ -1492,7 +1492,7 @@ (get-buffer-process buf) ;; Don't leave around a dead one (especially because of its ;; munged keymap.) - (lambda (process event) + (lambda (process _event) (if (not (memq (process-status process) '(run stop))) (let ((buf (process-buffer process))) (if buf (kill-buffer buf))))))) @@ -1565,7 +1565,7 @@ ;; --- Random browser --- ;;;###autoload -(defun browse-url-generic (url &optional new-window) +(defun browse-url-generic (url &optional _new-window) ;; new-window ignored "Ask the WWW browser defined by `browse-url-generic-program' to load URL. Default to the URL around or before point. A fresh copy of the @@ -1580,7 +1580,7 @@ (append browse-url-generic-args (list url)))) ;;;###autoload -(defun browse-url-kde (url &optional new-window) +(defun browse-url-kde (url &optional _new-window) "Ask the KDE WWW browser to load URL. Default to the URL around or before point." (interactive (browse-url-interactive-arg "KDE URL: ")) === modified file 'lisp/net/dbus.el' --- lisp/net/dbus.el 2013-05-28 06:49:19 +0000 +++ lisp/net/dbus.el 2013-09-05 03:30:07 +0000 @@ -1609,7 +1609,6 @@ It will be registered for all objects created by `dbus-register-method'." (let* ((last-input-event last-input-event) (bus (dbus-event-bus-name last-input-event)) - (service (dbus-event-service-name last-input-event)) (path (dbus-event-path-name last-input-event))) ;; "GetManagedObjects" returns "a{oa{sa{sv}}}". (let (interfaces result) @@ -1625,8 +1624,7 @@ ;; Check all registered object paths. (maphash (lambda (key val) - (let ((object (or (nth 2 (car-safe val)) "")) - (interface (nth 2 key))) + (let ((object (or (nth 2 (car-safe val)) ""))) (when (and (equal (butlast key 2) (list :method bus)) (string-prefix-p path object)) (dolist (interface (cons (nth 2 key) interfaces)) === modified file 'lisp/net/eudc.el' --- lisp/net/eudc.el 2013-03-05 17:13:01 +0000 +++ lisp/net/eudc.el 2013-09-05 03:30:07 +0000 @@ -518,12 +518,12 @@ precords)) (insert "\n") (widget-create 'push-button - :notify (lambda (&rest ignore) + :notify (lambda (&rest _ignore) (eudc-query-form)) "New query") (widget-insert " ") (widget-create 'push-button - :notify (lambda (&rest ignore) + :notify (lambda (&rest _ignore) (kill-this-buffer)) "Quit") (eudc-mode) @@ -995,17 +995,17 @@ fields) (widget-insert "\n\n") (widget-create 'push-button - :notify (lambda (&rest ignore) + :notify (lambda (&rest _ignore) (eudc-process-form)) "Query Server") (widget-insert " ") (widget-create 'push-button - :notify (lambda (&rest ignore) + :notify (lambda (&rest _ignore) (eudc-query-form)) "Reset Form") (widget-insert " ") (widget-create 'push-button - :notify (lambda (&rest ignore) + :notify (lambda (&rest _ignore) (kill-this-buffer)) "Quit") (goto-char pt) === modified file 'lisp/net/eudcb-ldap.el' --- lisp/net/eudcb-ldap.el 2013-03-05 17:13:01 +0000 +++ lisp/net/eudcb-ldap.el 2013-09-05 03:30:07 +0000 @@ -136,7 +136,7 @@ result)) final-result)) -(defun eudc-ldap-get-field-list (dummy &optional objectclass) +(defun eudc-ldap-get-field-list (_dummy &optional objectclass) "Return a list of valid attribute names for the current server. OBJECTCLASS is the LDAP object class for which the valid attribute names are returned. Default to `person'" === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-09-03 19:49:54 +0000 +++ lisp/net/eww.el 2013-09-05 03:30:07 +0000 @@ -381,7 +381,7 @@ eww-history)) ;;;###autoload -(defun eww-browse-url (url &optional new-window) +(defun eww-browse-url (url &optional _new-window) (when (and (equal major-mode 'eww-mode) eww-current-url) (eww-save-history)) === modified file 'lisp/net/imap.el' --- lisp/net/imap.el 2013-01-01 09:11:05 +0000 +++ lisp/net/imap.el 2013-09-05 03:30:07 +0000 @@ -139,7 +139,7 @@ (eval-when-compile (require 'cl)) (eval-and-compile ;; For Emacs <22.2 and XEmacs. - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))) + (unless (fboundp 'declare-function) (defmacro declare-function (&rest _r))) (autoload 'starttls-open-stream "starttls") (autoload 'starttls-negotiate "starttls") (autoload 'sasl-find-mechanism "sasl") @@ -661,7 +661,7 @@ nil))))) done)) -(defun imap-ssl-p (buffer) +(defun imap-ssl-p (_buffer) nil) (defun imap-ssl-open (name buffer server port) @@ -711,7 +711,7 @@ (message "imap: Opening SSL connection with `%s'...failed" cmd) nil))) -(defun imap-tls-p (buffer) +(defun imap-tls-p (_buffer) nil) (defun imap-tls-open (name buffer server port) @@ -738,7 +738,7 @@ (when (memq (process-status process) '(open run)) process)))) -(defun imap-network-p (buffer) +(defun imap-network-p (_buffer) t) (defun imap-network-open (name buffer server port) @@ -757,7 +757,7 @@ (when (memq (process-status process) '(open run)) process)))) -(defun imap-shell-p (buffer) +(defun imap-shell-p (_buffer) nil) (defun imap-shell-open (name buffer server port) @@ -881,10 +881,10 @@ ;; passwd nil)))) ret))) -(defun imap-gssapi-auth-p (buffer) +(defun imap-gssapi-auth-p (_buffer) (eq imap-stream 'gssapi)) -(defun imap-gssapi-auth (buffer) +(defun imap-gssapi-auth (_buffer) (message "imap: Authenticating using GSSAPI...%s" (if (eq imap-stream 'gssapi) "done" "failed")) (eq imap-stream 'gssapi)) @@ -893,7 +893,7 @@ (and (imap-capability 'AUTH=KERBEROS_V4 buffer) (eq imap-stream 'kerberos4))) -(defun imap-kerberos4-auth (buffer) +(defun imap-kerberos4-auth (_buffer) (message "imap: Authenticating using Kerberos 4...%s" (if (eq imap-stream 'kerberos4) "done" "failed")) (eq imap-stream 'kerberos4)) @@ -947,7 +947,7 @@ (imap-quote-specials passwd) "\"")))))) -(defun imap-anonymous-p (buffer) +(defun imap-anonymous-p (_buffer) t) (defun imap-anonymous-auth (buffer) @@ -1838,7 +1838,7 @@ (and (imap-fetch-safe '("*" . "*:*") "UID") (list (imap-mailbox-get-1 'uidvalidity mailbox) (apply 'max (imap-message-map - (lambda (uid prop) uid) 'UID)))) + (lambda (uid _prop) uid) 'UID)))) (if old-mailbox (imap-mailbox-select old-mailbox (eq state 'examine)) (imap-mailbox-unselect))))))) @@ -1884,7 +1884,7 @@ (and (imap-fetch-safe '("*" . "*:*") "UID") (list (imap-mailbox-get-1 'uidvalidity mailbox) (apply 'max (imap-message-map - (lambda (uid prop) uid) 'UID)))) + (lambda (uid _prop) uid) 'UID)))) (if old-mailbox (imap-mailbox-select old-mailbox (eq state 'examine)) (imap-mailbox-unselect))))))) @@ -1893,7 +1893,7 @@ (with-current-buffer (or buffer (current-buffer)) (imap-message-appenduid-1 (imap-utf7-encode mailbox)))) -(defun imap-message-append (mailbox article &optional flags date-time buffer) +(defun imap-message-append (mailbox article &optional _flags _date-time buffer) "Append ARTICLE (a buffer) to MAILBOX on server in BUFFER. FLAGS and DATE-TIME is currently not used. Return a cons holding uidvalidity of MAILBOX and UID the newly created article got, or nil === modified file 'lisp/printing.el' --- lisp/printing.el 2013-07-24 07:16:25 +0000 +++ lisp/printing.el 2013-09-05 03:30:07 +0000 @@ -4627,21 +4627,21 @@ ;;;###autoload -(defun pr-customize (&rest ignore) +(defun pr-customize (&rest _ignore) "Customization of the `printing' group." (interactive) (customize-group 'printing)) ;;;###autoload -(defun lpr-customize (&rest ignore) +(defun lpr-customize (&rest _ignore) "Customization of the `lpr' group." (interactive) (customize-group 'lpr)) ;;;###autoload -(defun pr-help (&rest ignore) +(defun pr-help (&rest _ignore) "Help for the printing package." (interactive) (pr-show-setup pr-help-message "*Printing Help*")) @@ -4675,21 +4675,21 @@ ;;;###autoload -(defun pr-show-ps-setup (&rest ignore) +(defun pr-show-ps-setup (&rest _ignore) "Show current ps-print settings." (interactive) (pr-show-setup (ps-setup) "*PS Setup*")) ;;;###autoload -(defun pr-show-pr-setup (&rest ignore) +(defun pr-show-pr-setup (&rest _ignore) "Show current printing settings." (interactive) (pr-show-setup (pr-setup) "*PR Setup*")) ;;;###autoload -(defun pr-show-lpr-setup (&rest ignore) +(defun pr-show-lpr-setup (&rest _ignore) "Show current lpr settings." (interactive) (pr-show-setup (lpr-setup) "*LPR Setup*")) @@ -6125,7 +6125,7 @@ (pr-insert-checkbox "\n " 'pr-i-region - #'(lambda (widget &rest ignore) + #'(lambda (widget &rest _ignore) (let ((region-p (pr-interface-save (ps-mark-active-p)))) (cond ((null (widget-value widget)) ; widget is nil @@ -6146,7 +6146,7 @@ (pr-insert-checkbox " " 'pr-i-mode - #'(lambda (widget &rest ignore) + #'(lambda (widget &rest _ignore) (let ((mode-p (pr-interface-save (pr-mode-alist-p)))) (cond @@ -6182,7 +6182,7 @@ (widget-create 'regexp :size 58 :format "\n File Regexp : %v\n" - :notify (lambda (widget &rest ignore) + :notify (lambda (widget &rest _ignore) (setq pr-i-regexp (widget-value widget))) pr-i-regexp) ;; 1b. Directory: List Directory Entry @@ -6222,7 +6222,7 @@ (pr-insert-checkbox " " 'pr-i-despool - #'(lambda (widget &rest ignore) + #'(lambda (widget &rest _ignore) (if pr-spool-p (setq pr-i-despool (not pr-i-despool)) (ding) @@ -6259,7 +6259,7 @@ 'integer :size 3 :format "\n N-Up : %v" - :notify (lambda (widget &rest ignore) + :notify (lambda (widget &rest _ignore) (let ((value (if (string= (widget-apply widget :value-get) "") 0 (widget-value widget)))) @@ -6288,7 +6288,7 @@ ;; 4. Settings: ;; 4. Settings: Landscape Auto Region Verbose (pr-insert-checkbox "\n\n " 'ps-landscape-mode - #'(lambda (&rest ignore) + #'(lambda (&rest _ignore) (setq ps-landscape-mode (not ps-landscape-mode) pr-file-landscape ps-landscape-mode)) " Landscape ") @@ -6310,7 +6310,7 @@ (pr-insert-toggle 'ps-zebra-stripes " Zebra Stripes") (pr-insert-checkbox " " 'pr-spool-p - #'(lambda (&rest ignore) + #'(lambda (&rest _ignore) (setq pr-spool-p (not pr-spool-p)) (unless pr-spool-p (setq pr-i-despool nil) @@ -6320,7 +6320,7 @@ ;; 4. Settings: Duplex Print with faces (pr-insert-checkbox "\n " 'ps-spool-duplex - #'(lambda (&rest ignore) + #'(lambda (&rest _ignore) (setq ps-spool-duplex (not ps-spool-duplex) pr-file-duplex ps-spool-duplex)) " Duplex ") @@ -6329,7 +6329,7 @@ ;; 4. Settings: Tumble Print via Ghostscript (pr-insert-checkbox "\n " 'ps-spool-tumble - #'(lambda (&rest ignore) + #'(lambda (&rest _ignore) (setq ps-spool-tumble (not ps-spool-tumble) pr-file-tumble ps-spool-tumble)) " Tumble ") @@ -6352,7 +6352,7 @@ ;; 5. Customize: (pr-insert-italic "\n\nCustomize : " 2 11) (pr-insert-button 'pr-customize "printing" " ") - (pr-insert-button #'(lambda (&rest ignore) (ps-print-customize)) + (pr-insert-button #'(lambda (&rest _ignore) (ps-print-customize)) "ps-print" " ") (pr-insert-button 'lpr-customize "lpr")) @@ -6374,7 +6374,7 @@ (pr-insert-button 'pr-kill-help "Kill All Printing Help Buffer")) -(defun pr-kill-help (&rest ignore) +(defun pr-kill-help (&rest _ignore) "Kill all printing help buffer." (interactive) (let ((help '("*Printing Interface Help*" "*Printing Help*" @@ -6388,20 +6388,20 @@ (recenter (- (window-height) 2))) -(defun pr-interface-quit (&rest ignore) +(defun pr-interface-quit (&rest _ignore) "Kill the printing buffer interface and quit." (interactive) (kill-buffer pr-buffer-name) (set-window-configuration pr-i-window-configuration)) -(defun pr-interface-help (&rest ignore) +(defun pr-interface-help (&rest _ignore) "printing buffer interface help." (interactive) (pr-show-setup pr-interface-help-message "*Printing Interface Help*")) -(defun pr-interface-txt-print (&rest ignore) +(defun pr-interface-txt-print (&rest _ignore) "Print using lpr package." (interactive) (condition-case data @@ -6433,7 +6433,7 @@ (message "%s" (error-message-string data))))) -(defun pr-interface-printify (&rest ignore) +(defun pr-interface-printify (&rest _ignore) "Printify a buffer." (interactive) (condition-case data @@ -6458,7 +6458,7 @@ (message "%s" (error-message-string data))))) -(defun pr-interface-ps-print (&rest ignore) +(defun pr-interface-ps-print (&rest _ignore) "Print using ps-print package." (interactive) (pr-interface-ps 'pr-despool-ps-print 'pr-ps-directory-ps-print @@ -6467,7 +6467,7 @@ 'pr-ps-buffer-ps-print)) -(defun pr-interface-preview (&rest ignore) +(defun pr-interface-preview (&rest _ignore) "Preview a PostScript file." (interactive) (pr-interface-ps 'pr-despool-preview 'pr-ps-directory-preview @@ -6548,7 +6548,7 @@ (error "Please specify be a readable directory"))) -(defun pr-interface-directory (widget &rest ignore) +(defun pr-interface-directory (widget &rest _ignore) (and pr-buffer-verbose (message "You can use M-TAB or ESC TAB for file completion")) (let ((dir (widget-value widget))) @@ -6557,7 +6557,7 @@ (setq pr-i-directory dir)))) -(defun pr-interface-infile (widget &rest ignore) +(defun pr-interface-infile (widget &rest _ignore) (and pr-buffer-verbose (message "You can use M-TAB or ESC TAB for file completion")) (let ((file (widget-value widget))) @@ -6566,7 +6566,7 @@ (setq pr-i-ps-file file)))) -(defun pr-interface-outfile (widget &rest ignore) +(defun pr-interface-outfile (widget &rest _ignore) (setq pr-i-answer-yes nil) (and pr-buffer-verbose (message "You can use M-TAB or ESC TAB for file completion")) @@ -6602,7 +6602,7 @@ (defun pr-insert-toggle (var-sym label) (widget-create 'checkbox - :notify `(lambda (&rest ignore) + :notify `(lambda (&rest _ignore) (setq ,var-sym (not ,var-sym))) (symbol-value var-sym)) (widget-insert label)) @@ -6623,7 +6623,7 @@ :format "%v" :inline t :value ,var-sym - :notify (lambda (widget &rest ignore) + :notify (lambda (widget &rest _ignore) (setq ,var-sym (widget-value widget)) ,@body) :void '(choice-item :format "%[%t%]" @@ -6639,7 +6639,7 @@ 'radio-button :format " %[%v%]" :value (eq ,var-sym (quote ,sym)) - :notify (lambda (&rest ignore) + :notify (lambda (&rest _ignore) (setq ,var-sym (quote ,sym)) (pr-update-radio-button (quote ,var-sym))))))) (put var-sym 'pr-widget-list (cons (cons wid sym) wid-list)))) === modified file 'lisp/vc/ediff-diff.el' --- lisp/vc/ediff-diff.el 2013-05-23 07:10:05 +0000 +++ lisp/vc/ediff-diff.el 2013-09-05 03:30:07 +0000 @@ -211,7 +211,7 @@ ;; ediff-setup-diff-regions is called via a funcall to ;; ediff-setup-diff-regions-function, which can also have the value ;; ediff-setup-diff-regions3, which takes 4 arguments. -(defun ediff-setup-diff-regions (file-A file-B file-C) +(defun ediff-setup-diff-regions (file-A file-B _file-C) ;; looking for '-c', '-i', '-u', or 'c', 'i', 'u' among clustered non-long options (if (string-match "^-[ciu]\\| -[ciu]\\|\\(^\\| \\)-[^- ]+[ciu]" ediff-diff-options) @@ -1223,7 +1223,7 @@ ;; like shell-command-sentinel but doesn't print an exit status message ;; we do this because diff always exits with status 1, if diffs are found ;; so shell-command-sentinel displays a confusing message to the user -(defun ediff-process-sentinel (process signal) +(defun ediff-process-sentinel (process _signal) (if (and (memq (process-status process) '(exit signal)) (buffer-name (process-buffer process))) (progn === modified file 'lisp/vc/ediff-init.el' --- lisp/vc/ediff-init.el 2013-01-01 09:11:05 +0000 +++ lisp/vc/ediff-init.el 2013-09-05 03:30:07 +0000 @@ -810,7 +810,7 @@ (ediff-overlay-put extent 'face face) (ediff-overlay-put extent 'help-echo 'ediff-region-help-echo)) -(defun ediff-region-help-echo (extent-or-window &optional overlay point) +(defun ediff-region-help-echo (extent-or-window &optional overlay _point) (unless overlay (setq overlay extent-or-window)) (let ((is-current (ediff-overlay-get overlay 'ediff)) @@ -1768,7 +1768,7 @@ (or n (setq n ediff-current-difference)) (and (>= n 0) (< n ediff-number-of-differences))) -(defsubst ediff-show-all-diffs (n) +(defsubst ediff-show-all-diffs (_n) "Don't skip difference regions." nil) === modified file 'lisp/vc/ediff-merg.el' --- lisp/vc/ediff-merg.el 2013-05-23 07:10:05 +0000 +++ lisp/vc/ediff-merg.el 2013-09-05 03:30:07 +0000 @@ -92,6 +92,8 @@ ) (make-variable-buffer-local 'ediff-skip-merge-regions-that-differ-from-default) +(defvar state-of-merge) ; dynamic var + ;; check if there is no clash between the ancestor and one of the variants. ;; if it is not a merge job then return true (defun ediff-merge-region-is-non-clash (n) @@ -351,8 +353,6 @@ (reverse delim-regs-list) ))) -(defvar state-of-merge) ; dynamic var - ;; Check if the non-preferred merge has been modified since originally set. ;; This affects only the regions that are marked as default-A/B or combined. ;; If PREFERS-TOO is non-nil, then look at the regions marked as prefers-A/B as === modified file 'lisp/vc/ediff-mult.el' --- lisp/vc/ediff-mult.el 2013-05-23 07:10:05 +0000 +++ lisp/vc/ediff-mult.el 2013-09-05 03:30:07 +0000 @@ -1115,7 +1115,7 @@ (setq overl (if (featurep 'xemacs) (map-extents - (lambda (ext maparg) + (lambda (ext _maparg) (if (and (ediff-overlay-get ext 'ediff-meta-info) (eq (ediff-overlay-get ext 'ediff-meta-session-number) @@ -1444,7 +1444,7 @@ ;; argument is ignored -(defun ediff-redraw-registry-buffer (&optional ignore) +(defun ediff-redraw-registry-buffer (&optional _ignore) (ediff-with-current-buffer ediff-registry-buffer (let ((point (point)) elt bufAname bufBname bufCname cur-diff total-diffs pt === modified file 'lisp/vc/ediff-util.el' --- lisp/vc/ediff-util.el 2013-08-05 14:26:57 +0000 +++ lisp/vc/ediff-util.el 2013-09-05 03:30:07 +0000 @@ -40,7 +40,7 @@ (defvar ediff-after-quit-hook-internal nil) (eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) + (unless (fboundp 'declare-function) (defmacro declare-function (&rest _r)))) ;; end pacifier @@ -1602,7 +1602,7 @@ ;;BEG, END show the region to be positioned. ;;JOB-NAME holds ediff-job-name. The ediff-windows job positions regions ;;differently. -(defun ediff-position-region (beg end pos job-name) +(defun ediff-position-region (beg end pos _job-name) (if (> end (point-max)) (setq end (point-max))) (if ediff-windows-job @@ -1685,7 +1685,7 @@ 'ediff-get-lines-to-region-start) ((eq op 'scroll-up) 'ediff-get-lines-to-region-end) - (t (lambda (a b c) 0)))) + (t (lambda (_a _b _c) 0)))) (max-lines (max (funcall func 'A n ctl-buf) (funcall func 'B n ctl-buf) (if (ediff-buffer-live-p ediff-buffer-C) === modified file 'lisp/vc/ediff-wind.el' --- lisp/vc/ediff-wind.el 2013-08-05 14:26:57 +0000 +++ lisp/vc/ediff-wind.el 2013-09-05 03:30:07 +0000 @@ -40,7 +40,7 @@ ;; declare-function does not exist in XEmacs (eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) + (unless (fboundp 'declare-function) (defmacro declare-function (&rest _r)))) (require 'ediff-init) (require 'ediff-help) @@ -280,7 +280,7 @@ ;;; Functions -(defun ediff-get-window-by-clicking (wind prev-wind wind-number) +(defun ediff-get-window-by-clicking (_wind _prev-wind wind-number) (let (event) (message "Select windows by clicking. Please click on Window %d " wind-number) @@ -289,9 +289,9 @@ (beep 1)) (message "Please click on Window %d " wind-number)) (ediff-read-event) ; discard event - (setq wind (if (featurep 'xemacs) - (event-window event) - (posn-window (event-start event)))))) + (if (featurep 'xemacs) + (event-window event) + (posn-window (event-start event))))) ;; Select the lowest window on the frame. === modified file 'lisp/vc/ediff.el' --- lisp/vc/ediff.el 2013-08-05 10:35:55 +0000 +++ lisp/vc/ediff.el 2013-09-05 03:30:07 +0000 @@ -114,7 +114,7 @@ ;; Compiler pacifier (eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) + (unless (fboundp 'declare-function) (defmacro declare-function (&rest _r)))) (require 'ediff-util) ;; end pacifier === modified file 'lisp/vc/emerge.el' --- lisp/vc/emerge.el 2013-08-05 14:26:57 +0000 +++ lisp/vc/emerge.el 2013-09-05 03:30:07 +0000 @@ -849,7 +849,7 @@ ;;; Functions to start Emerge on files ;;;###autoload -(defun emerge-files (arg file-A file-B file-out &optional startup-hooks +(defun emerge-files (_arg file-A file-B file-out &optional startup-hooks quit-hooks) "Run Emerge on two files." (interactive @@ -869,7 +869,7 @@ file-out)) ;;;###autoload -(defun emerge-files-with-ancestor (arg file-A file-B file-ancestor file-out +(defun emerge-files-with-ancestor (_arg file-A file-B file-ancestor file-out &optional startup-hooks quit-hooks) "Run Emerge on two files, giving another file as the ancestor." (interactive @@ -1063,7 +1063,7 @@ quit-hooks))) (defun emerge-revisions-internal (file revision-A revision-B &optional - startup-hooks quit-hooks output-file) + startup-hooks quit-hooks _output-file) (let ((buffer-A (get-buffer-create (format "%s,%s" file revision-A))) (buffer-B (get-buffer-create (format "%s,%s" file revision-B))) (emerge-file-A (emerge-make-temp-file "A")) === modified file 'lisp/vc/pcvs.el' --- lisp/vc/pcvs.el 2013-07-30 00:25:31 +0000 +++ lisp/vc/pcvs.el 2013-09-05 03:30:07 +0000 @@ -648,7 +648,7 @@ done)))) -(defun cvs-sentinel (proc msg) +(defun cvs-sentinel (proc _msg) "Sentinel for the cvs update process. This is responsible for parsing the output from the cvs update when it is finished." @@ -981,7 +981,7 @@ ;;;; (defun-cvs-mode (cvs-mode-revert-buffer . SIMPLE) - (&optional ignore-auto noconfirm) + (&optional _ignore-auto _noconfirm) "Rerun `cvs-examine' on the current directory with the default flags." (interactive) (cvs-examine default-directory t)) @@ -995,7 +995,7 @@ (read-directory-name prompt nil default-directory nil))) ;;;###autoload -(defun cvs-quickdir (dir &optional flags noshow) +(defun cvs-quickdir (dir &optional _flags noshow) "Open a *cvs* buffer on DIR without running cvs. With a prefix argument, prompt for a directory to use. A prefix arg >8 (ex: \\[universal-argument] \\[universal-argument]), ------------------------------------------------------------ revno: 114137 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14883 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-09-04 23:05:44 -0400 message: * lisp/emacs-lisp/cconv.el: Use `car-safe' rather than `car' to access a "ref-cell", since it gets better optimized. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-05 00:12:36 +0000 +++ lisp/ChangeLog 2013-09-05 03:05:44 +0000 @@ -1,3 +1,8 @@ +2013-09-05 Stefan Monnier + + * emacs-lisp/cconv.el: Use `car-safe' rather than `car' to access + a "ref-cell", since it gets better optimized (bug#14883). + 2013-09-05 Glenn Morris * progmodes/cc-awk.el (c-forward-sws): Declare. === modified file 'lisp/emacs-lisp/cconv.el' --- lisp/emacs-lisp/cconv.el 2013-08-28 01:33:31 +0000 +++ lisp/emacs-lisp/cconv.el 2013-09-05 03:05:44 +0000 @@ -55,7 +55,7 @@ ;; ;; If a variable is mutated (updated by setq), and it is used in a closure ;; we wrap its definition with list: (list val) and we also replace -;; var => (car var) wherever this variable is used, and also +;; var => (car-safe var) wherever this variable is used, and also ;; (setq var value) => (setcar var value) where it is updated. ;; ;; If defun argument is closure mutable, we letbind it and wrap it's @@ -211,9 +211,9 @@ ;; If `fv' is a variable that's wrapped in a cons-cell, ;; we want to put the cons-cell itself in the closure, ;; rather than just a copy of its current content. - (`(car ,iexp . ,_) + (`(car-safe ,iexp . ,_) (push iexp envector) - (push `(,fv . (car (internal-get-closed-var ,i))) new-env)) + (push `(,fv . (car-safe (internal-get-closed-var ,i))) new-env)) (_ (push exp envector) (push `(,fv . (internal-get-closed-var ,i)) new-env)))) @@ -224,7 +224,7 @@ (dolist (arg args) (if (not (member (cons (list arg) parentform) cconv-captured+mutated)) (if (assq arg new-env) (push `(,arg) new-env)) - (push `(,arg . (car ,arg)) new-env) + (push `(,arg . (car-safe ,arg)) new-env) (push `(,arg (list ,arg)) letbind))) (setq body-new (mapcar (lambda (form) @@ -254,7 +254,7 @@ used to get its value. This is used for variables that are copied into closures, moved into cons cells, ... ENV is a list where each entry takes the shape either: - (VAR . (car EXP)): VAR has been moved into the car of a cons-cell, and EXP + (VAR . (car-safe EXP)): VAR has been moved into the car of a cons-cell, and EXP is an expression that evaluates to this cons-cell. (VAR . (internal-get-closed-var N)): VAR has been copied into the closure environment's Nth slot. @@ -320,9 +320,9 @@ (push `(,var . (apply-partially ,var . ,fvs)) new-env) (dolist (fv fvs) (cl-pushnew fv new-extend) - (if (and (eq 'car (car-safe (cdr (assq fv env)))) + (if (and (eq 'car-safe (car-safe (cdr (assq fv env)))) (not (memq fv funargs))) - (push `(,fv . (car ,fv)) funcbody-env))) + (push `(,fv . (car-safe ,fv)) funcbody-env))) `(function (lambda ,funcvars . ,(mapcar (lambda (form) (cconv-convert @@ -332,7 +332,7 @@ ;; Check if it needs to be turned into a "ref-cell". ((member (cons binder form) cconv-captured+mutated) ;; Declared variable is mutated and captured. - (push `(,var . (car ,var)) new-env) + (push `(,var . (car-safe ,var)) new-env) `(list ,(cconv-convert value env extend))) ;; Normal default case. @@ -448,7 +448,7 @@ (value (cconv-convert (pop forms) env extend))) (push (pcase sym-new ((pred symbolp) `(setq ,sym-new ,value)) - (`(car ,iexp) `(setcar ,iexp ,value)) + (`(car-safe ,iexp) `(setcar ,iexp ,value)) ;; This "should never happen", but for variables which are ;; mutated+captured+unused, we may end up trying to `setq' ;; on a closed-over variable, so just drop the setq. @@ -472,7 +472,7 @@ ,@(mapcar (lambda (fv) (let ((exp (or (cdr (assq fv env)) fv))) (pcase exp - (`(car ,iexp . ,_) iexp) + (`(car-safe ,iexp . ,_) iexp) (_ exp)))) fvs) ,@(mapcar (lambda (arg) === modified file 'lisp/vc/vc-dispatcher.el' --- lisp/vc/vc-dispatcher.el 2013-09-04 21:09:42 +0000 +++ lisp/vc/vc-dispatcher.el 2013-09-05 03:05:44 +0000 @@ -224,8 +224,7 @@ "Eval CODE when the current buffer's process is done. If the current buffer has no process, just evaluate CODE. Else, add CODE to the process' sentinel. -CODE can be either a function of no arguments, or an expression -to evaluate." +CODE should be a function of no arguments." (let ((proc (get-buffer-process (current-buffer)))) (cond ;; If there's no background process, just execute the code. ------------------------------------------------------------ revno: 114136 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-09-04 22:27:13 -0400 message: * src/cmds.c (Fself_insert_command): Don't pass a non-integer to XINT. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-09-04 22:34:04 +0000 +++ src/ChangeLog 2013-09-05 02:27:13 +0000 @@ -1,3 +1,7 @@ +2013-09-05 Stefan Monnier + + * cmds.c (Fself_insert_command): Don't pass a non-integer to XINT. + 2013-09-04 Paul Eggert * alloc.c (make_event_array): First arg is now ptrdiff_t, not int. === modified file 'src/cmds.c' --- src/cmds.c 2013-08-29 07:03:18 +0000 +++ src/cmds.c 2013-09-05 02:27:13 +0000 @@ -304,7 +304,7 @@ /* Barf if the key that invoked this was not a character. */ if (!CHARACTERP (last_command_event)) bitch_at_user (); - { + else { int character = translate_char (Vtranslation_table_for_input, XINT (last_command_event)); int val = internal_self_insert (character, XFASTINT (n)); ------------------------------------------------------------ revno: 114135 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-04 20:22:45 -0400 message: * semantic/fw.el (semantic-make-local-hook): Simplify by dropping Emacs <= 20. diff: === modified file 'lisp/cedet/ChangeLog' --- lisp/cedet/ChangeLog 2013-07-29 20:26:19 +0000 +++ lisp/cedet/ChangeLog 2013-09-05 00:22:45 +0000 @@ -1,3 +1,8 @@ +2013-09-05 Glenn Morris + + * semantic/fw.el (semantic-make-local-hook): + Simplify by dropping Emacs <= 20. + 2013-07-29 David Engster * lisp/cedet/cedet.el (cedet-packages): Remove speedbar since its === modified file 'lisp/cedet/semantic/fw.el' --- lisp/cedet/semantic/fw.el 2013-01-02 16:13:04 +0000 +++ lisp/cedet/semantic/fw.el 2013-09-05 00:22:45 +0000 @@ -123,8 +123,7 @@ (defalias 'semantic-make-local-hook - (if (and (not (featurep 'xemacs)) - (>= emacs-major-version 21)) + (if (featurep 'emacs) #'identity #'make-local-hook)) (defalias 'semantic-mode-line-update ------------------------------------------------------------ revno: 114134 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-04 20:12:36 -0400 message: * lisp/progmodes/cc-awk.el (c-forward-sws): Declare. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-04 23:55:08 +0000 +++ lisp/ChangeLog 2013-09-05 00:12:36 +0000 @@ -1,3 +1,7 @@ +2013-09-05 Glenn Morris + + * progmodes/cc-awk.el (c-forward-sws): Declare. + 2013-09-04 Glenn Morris * generic-x.el [rul-generic-mode]: Require cc-mode. === modified file 'lisp/progmodes/cc-awk.el' --- lisp/progmodes/cc-awk.el 2013-08-25 10:09:56 +0000 +++ lisp/progmodes/cc-awk.el 2013-09-05 00:12:36 +0000 @@ -61,6 +61,7 @@ (cc-bytecomp-defun c-backward-token-1) (cc-bytecomp-defun c-beginning-of-statement-1) (cc-bytecomp-defun c-backward-sws) +(cc-bytecomp-defun c-forward-sws) (defvar awk-mode-syntax-table (let ((st (make-syntax-table))) ------------------------------------------------------------ revno: 114133 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-04 19:55:08 -0400 message: rul-generic-mode-syntax-table fix for recent cc-mode changes * lisp/generic-x.el [rul-generic-mode]: Require cc-mode. (c++-mode-syntax-table): Declare. (rul-generic-mode-syntax-table): Init in the defvar. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-04 20:56:54 +0000 +++ lisp/ChangeLog 2013-09-04 23:55:08 +0000 @@ -1,3 +1,9 @@ +2013-09-04 Glenn Morris + + * generic-x.el [rul-generic-mode]: Require cc-mode. + (c++-mode-syntax-table): Declare. + (rul-generic-mode-syntax-table): Init in the defvar. + 2013-09-04 Stefan Monnier * autorevert.el (auto-revert-notify-handler): Explicitly ignore === modified file 'lisp/generic-x.el' --- lisp/generic-x.el 2013-08-07 22:42:44 +0000 +++ lisp/generic-x.el 2013-09-04 23:55:08 +0000 @@ -1283,18 +1283,22 @@ "WIN32SMINOR") "Function argument constants used in InstallShield 3 and 5.")) -(defvar rul-generic-mode-syntax-table nil +;; c++-mode-syntax-table used to be autoloaded, with an initial nil value. +;; This file did not load cc-mode, and therefore rul-generic-mode-syntax-table +;; would have different values according to whether or not cc-mode +;; happened to be loaded before this file was. +(require 'cc-mode) +(defvar c++-mode-syntax-table) + +(defvar rul-generic-mode-syntax-table + (let ((table (make-syntax-table c++-mode-syntax-table))) + (modify-syntax-entry ?\r "> b" table) + (modify-syntax-entry ?\n "> b" table) + (modify-syntax-entry ?/ ". 124b" table) + (modify-syntax-entry ?* ". 23" table) + table) "Syntax table to use in `rul-generic-mode' buffers.") -(setq rul-generic-mode-syntax-table - (make-syntax-table c++-mode-syntax-table)) - -(modify-syntax-entry ?\r "> b" rul-generic-mode-syntax-table) -(modify-syntax-entry ?\n "> b" rul-generic-mode-syntax-table) - -(modify-syntax-entry ?/ ". 124b" rul-generic-mode-syntax-table) -(modify-syntax-entry ?* ". 23" rul-generic-mode-syntax-table) - ;; here manually instead (defun generic-rul-mode-setup-function () (make-local-variable 'parse-sexp-ignore-comments) ------------------------------------------------------------ revno: 114132 committer: Paul Eggert branch nick: trunk timestamp: Wed 2013-09-04 15:34:04 -0700 message: * alloc.c (make_event_array): First arg is now ptrdiff_t, not int. This fixes a type error on hosts where ptrdiff_t is wider than int. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-09-04 20:32:22 +0000 +++ src/ChangeLog 2013-09-04 22:34:04 +0000 @@ -1,3 +1,8 @@ +2013-09-04 Paul Eggert + + * alloc.c (make_event_array): First arg is now ptrdiff_t, not int. + This fixes a type error on hosts where ptrdiff_t is wider than int. + 2013-09-04 Stefan Monnier * keyboard.c (read_key_sequence_vs): New function. === modified file 'src/alloc.c' --- src/alloc.c 2013-08-29 11:22:28 +0000 +++ src/alloc.c 2013-09-04 22:34:04 +0000 @@ -3527,9 +3527,9 @@ Any number of arguments, even zero arguments, are allowed. */ Lisp_Object -make_event_array (register int nargs, Lisp_Object *args) +make_event_array (ptrdiff_t nargs, Lisp_Object *args) { - int i; + ptrdiff_t i; for (i = 0; i < nargs; i++) /* The things that fit in a string === modified file 'src/lisp.h' --- src/lisp.h 2013-09-03 19:49:54 +0000 +++ src/lisp.h 2013-09-04 22:34:04 +0000 @@ -3463,7 +3463,7 @@ } extern Lisp_Object make_multibyte_string (const char *, ptrdiff_t, ptrdiff_t); -extern Lisp_Object make_event_array (int, Lisp_Object *); +extern Lisp_Object make_event_array (ptrdiff_t, Lisp_Object *); extern Lisp_Object make_uninit_string (EMACS_INT); extern Lisp_Object make_uninit_multibyte_string (EMACS_INT, EMACS_INT); extern Lisp_Object make_string_from_bytes (const char *, ptrdiff_t, ptrdiff_t); ------------------------------------------------------------ revno: 114131 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-09-04 17:09:42 -0400 message: * lisp/vc/vc-dispatcher.el (vc-run-delayed): New macro. (vc-do-command, vc-set-async-update): * lisp/vc/vc-mtn.el (vc-mtn-dir-status): * lisp/vc/vc-hg.el (vc-hg-dir-status, vc-hg-dir-status-files) (vc-hg-pull, vc-hg-merge-branch): * lisp/vc/vc-git.el (vc-git-dir-status-goto-stage, vc-git-pull) (vc-git-merge-branch): * lisp/vc/vc-cvs.el (vc-cvs-print-log, vc-cvs-dir-status) (vc-cvs-dir-status-files): * lisp/vc/vc-bzr.el (vc-bzr-pull, vc-bzr-merge-branch, vc-bzr-dir-status) (vc-bzr-dir-status-files): * lisp/vc/vc-arch.el (vc-arch-dir-status): Use vc-run-delayed. * lisp/vc/vc-annotate.el: Use lexical-binding. (vc-annotate-display-select, vc-annotate): Use vc-run-delayed. (vc-sentinel-movepoint): Declare. (vc-annotate): Don't use `goto-line'. * lisp/vc/vc.el (vc-diff-internal): Prefer a closure to `(lambda...). (vc-diff-internal, vc-log-internal-common): Use vc-run-delayed. (vc-sentinel-movepoint): Declare. * lisp/vc/vc-svn.el: Use lexical-binding. (vc-svn-dir-status, vc-svn-dir-status-files): Use vc-run-delayed. * lisp/vc/vc-sccs.el: * lisp/vc/vc-rcs.el: Use lexical-binding. diff: === modified file 'lisp/vc/vc-annotate.el' --- lisp/vc/vc-annotate.el 2013-01-01 09:11:05 +0000 +++ lisp/vc/vc-annotate.el 2013-09-04 21:09:42 +0000 @@ -1,4 +1,4 @@ -;;; vc-annotate.el --- VC Annotate Support +;;; vc-annotate.el --- VC Annotate Support -*- lexical-binding: t -*- ;; Copyright (C) 1997-1998, 2000-2013 Free Software Foundation, Inc. @@ -306,9 +306,9 @@ (vc-annotate-display-default (or vc-annotate-ratio 1.0))) ;; One of the auto-scaling modes ((eq vc-annotate-display-mode 'scale) - (vc-exec-after `(vc-annotate-display-autoscale))) + (vc-run-delayed (vc-annotate-display-autoscale))) ((eq vc-annotate-display-mode 'fullscale) - (vc-exec-after `(vc-annotate-display-autoscale t))) + (vc-run-delayed (vc-annotate-display-autoscale t))) ((numberp vc-annotate-display-mode) ; A fixed number of days lookback (vc-annotate-display-default (/ vc-annotate-display-mode @@ -316,6 +316,8 @@ (t (error "No such display mode: %s" vc-annotate-display-mode)))) +(defvar vc-sentinel-movepoint) + ;;;###autoload (defun vc-annotate (file rev &optional display-mode buf move-point-to vc-bk) "Display the edit history of the current FILE using colors. @@ -397,16 +399,16 @@ display-mode)))) (with-current-buffer temp-buffer-name - (vc-exec-after - `(progn - ;; Ideally, we'd rather not move point if the user has already - ;; moved it elsewhere, but really point here is not the position - ;; of the user's cursor :-( - (when ,current-line ;(and (bobp)) - (goto-line ,current-line) - (setq vc-sentinel-movepoint (point))) - (unless (active-minibuffer-window) - (message "Annotating... done"))))))) + (vc-run-delayed + ;; Ideally, we'd rather not move point if the user has already + ;; moved it elsewhere, but really point here is not the position + ;; of the user's cursor :-( + (when current-line ;(and (bobp)) + (goto-char (point-min)) + (forward-line (1- current-line)) + (setq vc-sentinel-movepoint (point))) + (unless (active-minibuffer-window) + (message "Annotating... done")))))) (defun vc-annotate-prev-revision (prefix) "Visit the annotation of the revision previous to this one. @@ -630,7 +632,7 @@ (vc-call-backend vc-annotate-backend 'annotate-current-time)) next-time)))) -(defun vc-default-annotate-current-time (backend) +(defun vc-default-annotate-current-time (_backend) "Return the current time, encoded as fractional days." (vc-annotate-convert-time (current-time))) === modified file 'lisp/vc/vc-arch.el' --- lisp/vc/vc-arch.el 2013-05-28 07:01:59 +0000 +++ lisp/vc/vc-arch.el 2013-09-04 21:09:42 +0000 @@ -321,8 +321,8 @@ (let ((default-directory dir)) (vc-arch-command t 'async nil "changes")) ;; The updating could be done asynchronously. - (vc-exec-after - `(vc-arch-after-dir-status ',callback))) + (vc-run-delayed + (vc-arch-after-dir-status callback))) (defun vc-arch-after-dir-status (callback) (let* ((state-map '(("M " . edited) === modified file 'lisp/vc/vc-bzr.el' --- lisp/vc/vc-bzr.el 2013-09-04 00:31:13 +0000 +++ lisp/vc/vc-bzr.el 2013-09-04 21:09:42 +0000 @@ -47,6 +47,7 @@ (eval-when-compile (require 'cl-lib) + (require 'vc-dispatcher) (require 'vc-dir)) ; vc-dir-at-event ;; Clear up the cache to force vc-call to check again and discover @@ -354,7 +355,7 @@ command (cadr args) args (cddr args))) (let ((buf (apply 'vc-bzr-async-command command args))) - (with-current-buffer buf (vc-exec-after '(vc-compilation-mode 'bzr))) + (with-current-buffer buf (vc-run-delayed (vc-compilation-mode 'bzr))) (vc-set-async-update buf)))) (defun vc-bzr-merge-branch () @@ -385,7 +386,7 @@ (command (cadr cmd)) (args (cddr cmd))) (let ((buf (apply 'vc-bzr-async-command command args))) - (with-current-buffer buf (vc-exec-after '(vc-compilation-mode 'bzr))) + (with-current-buffer buf (vc-run-delayed (vc-compilation-mode 'bzr))) (vc-set-async-update buf)))) (defun vc-bzr-status (file) @@ -995,23 +996,23 @@ (defun vc-bzr-dir-status (dir update-function) "Return a list of conses (file . state) for DIR." (vc-bzr-command "status" (current-buffer) 'async dir "-v" "-S") - (vc-exec-after - `(vc-bzr-after-dir-status (quote ,update-function) - ;; "bzr status" results are relative to - ;; the bzr root directory, NOT to the - ;; directory "bzr status" was invoked in. - ;; Ugh. - ;; We pass the relative directory here so - ;; that `vc-bzr-after-dir-status' can - ;; frob the results accordingly. - (file-relative-name ,dir (vc-bzr-root ,dir))))) + (vc-run-delayed + (vc-bzr-after-dir-status update-function + ;; "bzr status" results are relative to + ;; the bzr root directory, NOT to the + ;; directory "bzr status" was invoked in. + ;; Ugh. + ;; We pass the relative directory here so + ;; that `vc-bzr-after-dir-status' can + ;; frob the results accordingly. + (file-relative-name dir (vc-bzr-root dir))))) (defun vc-bzr-dir-status-files (dir files _default-state update-function) "Return a list of conses (file . state) for DIR." (apply 'vc-bzr-command "status" (current-buffer) 'async dir "-v" "-S" files) - (vc-exec-after - `(vc-bzr-after-dir-status (quote ,update-function) - (file-relative-name ,dir (vc-bzr-root ,dir))))) + (vc-run-delayed + (vc-bzr-after-dir-status update-function + (file-relative-name dir (vc-bzr-root dir))))) (defvar vc-bzr-shelve-map (let ((map (make-sparse-keymap))) === modified file 'lisp/vc/vc-cvs.el' --- lisp/vc/vc-cvs.el 2013-07-30 03:46:06 +0000 +++ lisp/vc/vc-cvs.el 2013-09-04 21:09:42 +0000 @@ -518,7 +518,7 @@ (if (vc-stay-local-p files 'CVS) 'async 0) files "log") (with-current-buffer buffer - (vc-exec-after (vc-rcs-print-log-cleanup))) + (vc-run-delayed (vc-rcs-print-log-cleanup))) (when limit 'limit-unsupported)) (defun vc-cvs-comment-history (file) @@ -1015,14 +1015,14 @@ ;; (vc-cvs-command (current-buffer) 'async ;; (file-relative-name dir) ;; "-f" "-n" "update" "-d" "-P") - (vc-exec-after - `(vc-cvs-after-dir-status (quote ,update-function)))))) + (vc-run-delayed + (vc-cvs-after-dir-status update-function))))) (defun vc-cvs-dir-status-files (dir files _default-state update-function) "Create a list of conses (file . state) for DIR." (apply 'vc-cvs-command (current-buffer) 'async dir "-f" "status" files) - (vc-exec-after - `(vc-cvs-after-dir-status (quote ,update-function)))) + (vc-run-delayed + (vc-cvs-after-dir-status update-function))) (defun vc-cvs-file-to-string (file) "Read the content of FILE and return it as a string." === modified file 'lisp/vc/vc-dispatcher.el' --- lisp/vc/vc-dispatcher.el 2013-06-15 02:50:47 +0000 +++ lisp/vc/vc-dispatcher.el 2013-09-04 21:09:42 +0000 @@ -198,11 +198,11 @@ ;; Normally, we want async code such as sentinels to not move point. (save-excursion (goto-char m) - ;; Each sentinel may move point and the next one should be run - ;; at that new point. We could get the same result by having - ;; each sentinel read&set process-mark, but since `cmd' needs - ;; to work both for async and sync processes, this would be - ;; difficult to achieve. + ;; Each sentinel may move point and the next one should be run + ;; at that new point. We could get the same result by having + ;; each sentinel read&set process-mark, but since `cmd' needs + ;; to work both for async and sync processes, this would be + ;; difficult to achieve. (vc-exec-after code) (move-marker m (point))) ;; But sometimes the sentinels really want to move point. @@ -247,6 +247,10 @@ (t (error "Unexpected process state")))) nil) +(defmacro vc-run-delayed (&rest body) + (declare (indent 0) (debug t)) + `(vc-exec-after (lambda () ,@body))) + (defvar vc-post-command-functions nil "Hook run at the end of `vc-do-command'. Each function is called inside the buffer in which the command was run @@ -328,8 +332,8 @@ (set-process-filter proc 'vc-process-filter) (setq status proc) (when vc-command-messages - (vc-exec-after - `(message "Running %s in background... done" ',full-command)))) + (vc-run-delayed + (message "Running %s in background... done" full-command)))) ;; Run synchronously (when vc-command-messages (message "Running %s in foreground..." full-command)) @@ -346,9 +350,9 @@ (if (integerp status) (format "status %d" status) status))) (when vc-command-messages (message "Running %s...OK = %d" full-command status)))) - (vc-exec-after - `(run-hook-with-args 'vc-post-command-functions - ',command ',file-or-list ',flags)) + (vc-run-delayed + (run-hook-with-args 'vc-post-command-functions + command file-or-list flags)) status)))) (defun vc-do-async-command (buffer root command &rest args) @@ -408,17 +412,17 @@ (cond ((derived-mode-p 'vc-dir-mode) (with-current-buffer process-buffer - (vc-exec-after - `(if (buffer-live-p ,buf) - (with-current-buffer ,buf - (vc-dir-refresh)))))) + (vc-run-delayed + (if (buffer-live-p buf) + (with-current-buffer buf + (vc-dir-refresh)))))) ((derived-mode-p 'dired-mode) (with-current-buffer process-buffer - (vc-exec-after - `(and (buffer-live-p ,buf) - (= (buffer-modified-tick ,buf) ,tick) - (with-current-buffer ,buf - (revert-buffer))))))))) + (vc-run-delayed + (and (buffer-live-p buf) + (= (buffer-modified-tick buf) tick) + (with-current-buffer buf + (revert-buffer))))))))) ;; These functions are used to ensure that the view the user sees is up to date ;; even if the dispatcher client mode has messed with file contents (as in, === modified file 'lisp/vc/vc-git.el' --- lisp/vc/vc-git.el 2013-09-04 00:39:34 +0000 +++ lisp/vc/vc-git.el 2013-09-04 21:09:42 +0000 @@ -477,8 +477,8 @@ (`diff-index (vc-git-command (current-buffer) 'async files "diff-index" "--relative" "-z" "-M" "HEAD" "--"))) - (vc-exec-after - `(vc-git-after-dir-status-stage ',stage ',files ',update-function))) + (vc-run-delayed + (vc-git-after-dir-status-stage stage files update-function))) (defun vc-git-dir-status (_dir update-function) "Return a list of (FILE STATE EXTRA) entries for DIR." @@ -726,7 +726,7 @@ command (cadr args) args (cddr args))) (apply 'vc-do-async-command buffer root git-program command args) - (with-current-buffer buffer (vc-exec-after '(vc-compilation-mode 'git))) + (with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'git))) (vc-set-async-update buffer))) (defun vc-git-merge-branch () @@ -746,7 +746,7 @@ nil t))) (apply 'vc-do-async-command buffer root vc-git-program "merge" (list merge-source)) - (with-current-buffer buffer (vc-exec-after '(vc-compilation-mode 'git))) + (with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'git))) (vc-set-async-update buffer))) ;;; HISTORY FUNCTIONS === modified file 'lisp/vc/vc-hg.el' --- lisp/vc/vc-hg.el 2013-09-04 00:31:13 +0000 +++ lisp/vc/vc-hg.el 2013-09-04 21:09:42 +0000 @@ -608,13 +608,13 @@ (defun vc-hg-dir-status (dir update-function) (vc-hg-command (current-buffer) 'async dir "status" "-C") - (vc-exec-after - `(vc-hg-after-dir-status (quote ,update-function)))) + (vc-run-delayed + (vc-hg-after-dir-status update-function))) (defun vc-hg-dir-status-files (dir files _default-state update-function) (apply 'vc-hg-command (current-buffer) 'async dir "status" "-C" files) - (vc-exec-after - `(vc-hg-after-dir-status (quote ,update-function)))) + (vc-run-delayed + (vc-hg-after-dir-status update-function))) (defun vc-hg-dir-extra-header (name &rest commands) (concat (propertize name 'face 'font-lock-type-face) @@ -708,7 +708,8 @@ args (cddr args))) (apply 'vc-do-async-command buffer root hg-program command args) - (with-current-buffer buffer (vc-exec-after '(vc-compilation-mode 'hg))) + (with-current-buffer buffer + (vc-run-delayed (vc-compilation-mode 'hg))) (vc-set-async-update buffer))))) (defun vc-hg-merge-branch () @@ -717,7 +718,7 @@ (let* ((root (vc-hg-root default-directory)) (buffer (format "*vc-hg : %s*" (expand-file-name root)))) (apply 'vc-do-async-command buffer root vc-hg-program '("merge")) - (with-current-buffer buffer (vc-exec-after '(vc-compilation-mode 'hg))) + (with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'hg))) (vc-set-async-update buffer))) ;;; Internal functions === modified file 'lisp/vc/vc-mtn.el' --- lisp/vc/vc-mtn.el 2013-05-28 07:01:59 +0000 +++ lisp/vc/vc-mtn.el 2013-09-04 21:09:42 +0000 @@ -128,8 +128,8 @@ (defun vc-mtn-dir-status (dir update-function) (vc-mtn-command (current-buffer) 'async dir "status") - (vc-exec-after - `(vc-mtn-after-dir-status (quote ,update-function)))) + (vc-run-delayed + (vc-mtn-after-dir-status update-function))) (defun vc-mtn-working-revision (file) ;; If `mtn' fails or returns status>0, or if the search fails, just === modified file 'lisp/vc/vc-rcs.el' --- lisp/vc/vc-rcs.el 2013-05-28 07:01:59 +0000 +++ lisp/vc/vc-rcs.el 2013-09-04 21:09:42 +0000 @@ -1,4 +1,4 @@ -;;; vc-rcs.el --- support for RCS version-control +;;; vc-rcs.el --- support for RCS version-control -*- lexical-binding:t -*- ;; Copyright (C) 1992-2013 Free Software Foundation, Inc. @@ -520,7 +520,7 @@ ;; No, it was some other error: re-signal it. (signal (car err) (cdr err))))))))) -(defun vc-rcs-revert (file &optional contents-done) +(defun vc-rcs-revert (file &optional _contents-done) "Revert FILE to the version it was based on. If FILE is a directory, revert all registered files beneath it." (if (file-directory-p file) @@ -571,8 +571,8 @@ (when (looking-at "[\b\t\n\v\f\r ]+") (delete-char (- (match-end 0) (match-beginning 0)))))) -(defun vc-rcs-print-log (files buffer &optional shortlog - start-revision-ignored limit) +(defun vc-rcs-print-log (files buffer &optional _shortlog + _start-revision-ignored limit) "Print commit log associated with FILES into specified BUFFER. Remaining arguments are ignored. If FILE is a directory the operation is applied to all registered @@ -853,7 +853,7 @@ (string-match "[0-9]+\\'" rev) (substring rev (match-beginning 0) (match-end 0))) -(defun vc-rcs-previous-revision (file rev) +(defun vc-rcs-previous-revision (_file rev) "Return the revision number immediately preceding REV for FILE, or nil if there is no previous revision. This default implementation works for MAJOR.MINOR-style revision numbers as @@ -1440,8 +1440,8 @@ ;; only the former since it behaves identically to the ;; latter in the absence of "@@".) sub) - (cl-flet ((incg (beg end) - (let ((b beg) (e end) @-holes) + (cl-flet ((incg (_beg end) + (let ((e end) @-holes) (while (and asc (< (car asc) e)) (push (pop asc) @-holes)) ;; Self-deprecate when work is done. === modified file 'lisp/vc/vc-sccs.el' --- lisp/vc/vc-sccs.el 2013-05-28 07:47:11 +0000 +++ lisp/vc/vc-sccs.el 2013-09-04 21:09:42 +0000 @@ -1,4 +1,4 @@ -;;; vc-sccs.el --- support for SCCS version-control +;;; vc-sccs.el --- support for SCCS version-control -*- lexical-binding:t -*- ;; Copyright (C) 1992-2013 Free Software Foundation, Inc. @@ -101,7 +101,7 @@ ;;; Properties of the backend (defun vc-sccs-revision-granularity () 'file) -(defun vc-sccs-checkout-model (files) 'locking) +(defun vc-sccs-checkout-model (_files) 'locking) ;;; ;;; State-querying functions @@ -321,7 +321,7 @@ (vc-name file) (concat "-r" discard)) (vc-sccs-do-command nil 0 "get" (vc-name file) nil)))) -(defun vc-sccs-revert (file &optional contents-done) +(defun vc-sccs-revert (file &optional _contents-done) "Revert FILE to the version it was based on. If FILE is a directory, revert all subfiles." (if (file-directory-p file) @@ -353,7 +353,7 @@ ;;; History functions ;;; -(defun vc-sccs-print-log (files buffer &optional shortlog start-revision-ignored limit) +(defun vc-sccs-print-log (files buffer &optional _shortlog _start-revision-ignored limit) "Print commit log associated with FILES into specified BUFFER. Remaining arguments are ignored." (setq files (vc-expand-dirs files)) @@ -363,6 +363,8 @@ (autoload 'vc-setup-buffer "vc-dispatcher") (autoload 'vc-delistify "vc-dispatcher") +(defvar w32-quote-process-args) + ;; FIXME use sccsdiff if present? (defun vc-sccs-diff (files &optional oldvers newvers buffer) "Get a difference report using SCCS between two filesets." === modified file 'lisp/vc/vc-svn.el' --- lisp/vc/vc-svn.el 2013-09-04 00:31:13 +0000 +++ lisp/vc/vc-svn.el 2013-09-04 21:09:42 +0000 @@ -1,4 +1,4 @@ -;;; vc-svn.el --- non-resident support for Subversion version-control +;;; vc-svn.el --- non-resident support for Subversion version-control -*- lexical-binding:t -*- ;; Copyright (C) 2003-2013 Free Software Foundation, Inc. @@ -115,7 +115,7 @@ ;;; Properties of the backend (defun vc-svn-revision-granularity () 'repository) -(defun vc-svn-checkout-model (files) 'implicit) +(defun vc-svn-checkout-model (_files) 'implicit) ;;; ;;; State-querying functions @@ -231,13 +231,13 @@ (remote (or t (not local) (eq local 'only-file)))) (vc-svn-command (current-buffer) 'async nil "status" (if remote "-u")) - (vc-exec-after - `(vc-svn-after-dir-status (quote ,callback) ,remote)))) + (vc-run-delayed + (vc-svn-after-dir-status callback remote)))) -(defun vc-svn-dir-status-files (dir files default-state callback) +(defun vc-svn-dir-status-files (dir files _default-state callback) (apply 'vc-svn-command (current-buffer) 'async nil "status" files) - (vc-exec-after - `(vc-svn-after-dir-status (quote ,callback)))) + (vc-run-delayed + (vc-svn-after-dir-status callback))) (defun vc-svn-dir-extra-headers (dir) "Generate extra status headers for a Subversion working copy." @@ -268,7 +268,7 @@ ;; vc-svn-mode-line-string doesn't exist because the default implementation ;; works just fine. -(defun vc-svn-previous-revision (file rev) +(defun vc-svn-previous-revision (_file rev) (let ((newrev (1- (string-to-number rev)))) (when (< 0 newrev) (number-to-string newrev)))) @@ -298,7 +298,7 @@ (autoload 'vc-switches "vc") -(defun vc-svn-register (files &optional rev comment) +(defun vc-svn-register (files &optional _rev _comment) "Register FILES into the SVN version-control system. The COMMENT argument is ignored This does an add but not a commit. Passes either `vc-svn-register-switches' or `vc-register-switches' @@ -314,7 +314,7 @@ "Return non-nil if FILE could be registered in SVN. This is only possible if SVN is responsible for FILE's directory.") -(defun vc-svn-checkin (files rev comment &optional extra-args-ignored) +(defun vc-svn-checkin (files rev comment &optional _extra-args-ignored) "SVN-specific version of `vc-backend-checkin'." (if rev (error "Committing to a specific revision is unsupported in SVN")) (let ((status (apply @@ -357,7 +357,7 @@ FILE is a file wildcard, relative to the root directory of DIRECTORY." (vc-svn-command t 0 file "propedit" "svn:ignore")) -(defun vc-svn-ignore-completion-table (file) +(defun vc-svn-ignore-completion-table (_file) "Return the list of ignored files." ) @@ -368,7 +368,7 @@ (vc-mode-line file 'SVN) (message "Checking out %s...done" file)) -(defun vc-svn-update (file editable rev switches) +(defun vc-svn-update (file _editable rev switches) (if (and (file-exists-p file) (not rev)) ;; If no revision was specified, there's nothing to do. nil @@ -457,7 +457,7 @@ (error "Couldn't analyze svn update result"))) (message "Merging changes into %s...done" file)))) -(defun vc-svn-modify-change-comment (files rev comment) +(defun vc-svn-modify-change-comment (_files rev comment) "Modify the change comments for a specified REV. You must have ssh access to the repository host, and the directory Emacs uses locally for temp files must also be writable by you on that host. @@ -509,7 +509,7 @@ (autoload 'vc-setup-buffer "vc-dispatcher") -(defun vc-svn-print-log (files buffer &optional shortlog start-revision limit) +(defun vc-svn-print-log (files buffer &optional _shortlog start-revision limit) "Print commit log associated with FILES into specified BUFFER. SHORTLOG is ignored. If START-REVISION is non-nil, it is the newest revision to show. === modified file 'lisp/vc/vc.el' --- lisp/vc/vc.el 2013-09-04 00:39:34 +0000 +++ lisp/vc/vc.el 2013-09-04 21:09:42 +0000 @@ -1536,11 +1536,11 @@ ;; (vc-file-tree-walk ;; default-directory ;; (lambda (f) -;; (vc-exec-after -;; `(let ((coding-system-for-read (vc-coding-system-for-diff ',f))) -;; (message "Looking at %s" ',f) -;; (vc-call-backend ',(vc-backend f) -;; 'diff (list ',f) ',rev1 ',rev2)))))) +;; (vc-run-delayed +;; (let ((coding-system-for-read (vc-coding-system-for-diff f))) +;; (message "Looking at %s" f) +;; (vc-call-backend (vc-backend f) +;; 'diff (list f) rev1 rev2)))))) (defvar vc-coding-system-inherit-eol t "When non-nil, inherit the EOL format for reading Diff output from the file. @@ -1678,8 +1678,8 @@ (diff-mode) (set (make-local-variable 'diff-vc-backend) (car vc-fileset)) (set (make-local-variable 'revert-buffer-function) - `(lambda (ignore-auto noconfirm) - (vc-diff-internal ,async ',vc-fileset ,rev1 ,rev2 ,verbose))) + (lambda (_ignore-auto _noconfirm) + (vc-diff-internal async vc-fileset rev1 rev2 verbose))) ;; Make the *vc-diff* buffer read only, the diff-mode key ;; bindings are nicer for read only buffers. pcl-cvs does the ;; same thing. @@ -1695,8 +1695,8 @@ ;; The diff process may finish early, so call `vc-diff-finish' ;; after `pop-to-buffer'; the former assumes the diff buffer is ;; shown in some window. - (vc-exec-after `(vc-diff-finish ,(current-buffer) - ',(when verbose messages))) + (let ((buf (current-buffer))) + (vc-run-delayed (vc-diff-finish buf (when verbose messages)))) ;; In the async case, we return t even if there are no differences ;; because we don't know that yet. t))) @@ -2230,6 +2230,7 @@ (defvar vc-log-view-type nil "Set this to differentiate the different types of logs.") (put 'vc-log-view-type 'permanent-local t) +(defvar vc-sentinel-movepoint) (defun vc-log-internal-common (backend buffer-name @@ -2252,13 +2253,13 @@ (set (make-local-variable 'log-view-vc-fileset) files) (set (make-local-variable 'revert-buffer-function) rev-buff-func)) - (vc-exec-after - `(let ((inhibit-read-only t)) - (funcall ',setup-buttons-func ',backend ',files ',retval) - (shrink-window-if-larger-than-buffer) - (funcall ',goto-location-func ',backend) - (setq vc-sentinel-movepoint (point)) - (set-buffer-modified-p nil))))) + (vc-run-delayed + (let ((inhibit-read-only t)) + (funcall setup-buttons-func backend files retval) + (shrink-window-if-larger-than-buffer) + (funcall goto-location-func backend) + (setq vc-sentinel-movepoint (point)) + (set-buffer-modified-p nil))))) (defun vc-incoming-outgoing-internal (backend remote-location buffer-name type) (vc-log-internal-common ------------------------------------------------------------ revno: 114130 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-09-04 16:56:54 -0400 message: * lisp/autorevert.el (auto-revert-notify-handler): Explicitly ignore `deleted'. Don't drop errors silently. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-04 20:03:52 +0000 +++ lisp/ChangeLog 2013-09-04 20:56:54 +0000 @@ -1,5 +1,8 @@ 2013-09-04 Stefan Monnier + * autorevert.el (auto-revert-notify-handler): Explicitly ignore + `deleted'. Don't drop errors silently. + * emacs-lisp/gv.el (gv-get): Warn about CL-compiled places. 2013-09-04 Xue Fuqiao @@ -15,7 +18,7 @@ 2013-09-03 Stefan Monnier - * net/tramp-gvfs.el (tramp-gvfs-mount-spec, tramp-synce-list-devices): + * net/tramp-gvfs.el (tramp-gvfs-mount-spec, tramp-synce-list-devices): * net/tramp-smb.el (tramp-smb-get-file-entries): * net/tramp-sh.el (tramp-sh-handle-insert-directory) (tramp-compute-multi-hops): Fix misuses of `add-to-list'. === modified file 'lisp/autorevert.el' --- lisp/autorevert.el 2013-08-01 23:18:37 +0000 +++ lisp/autorevert.el 2013-09-04 20:56:54 +0000 @@ -531,7 +531,7 @@ (defun auto-revert-notify-handler (event) "Handle an EVENT returned from file notification." - (ignore-errors + (with-demoted-errors (let* ((descriptor (car event)) (action (nth 1 event)) (file (nth 2 event)) @@ -541,28 +541,31 @@ ;; Check, that event is meant for us. (cl-assert descriptor) ;; We do not handle `deleted', because nothing has to be refreshed. - (cl-assert (memq action '(attribute-changed changed created renamed)) t) - ;; Since we watch a directory, a file name must be returned. - (cl-assert (stringp file)) - (when (eq action 'renamed) (cl-assert (stringp file1))) - ;; Loop over all buffers, in order to find the intended one. - (dolist (buffer buffers) - (when (buffer-live-p buffer) - (with-current-buffer buffer - (when (and (stringp buffer-file-name) - (or - (and (memq action '(attribute-changed changed created)) - (string-equal - (file-name-nondirectory file) - (file-name-nondirectory buffer-file-name))) - (and (eq action 'renamed) - (string-equal - (file-name-nondirectory file1) - (file-name-nondirectory buffer-file-name))))) - ;; Mark buffer modified. - (setq auto-revert-notify-modified-p t) - ;; No need to check other buffers. - (cl-return)))))))) + (unless (eq action 'deleted) + (cl-assert (memq action '(attribute-changed changed created renamed)) + t) + ;; Since we watch a directory, a file name must be returned. + (cl-assert (stringp file)) + (when (eq action 'renamed) (cl-assert (stringp file1))) + ;; Loop over all buffers, in order to find the intended one. + (dolist (buffer buffers) + (when (buffer-live-p buffer) + (with-current-buffer buffer + (when (and (stringp buffer-file-name) + (or + (and (memq action '(attribute-changed changed + created)) + (string-equal + (file-name-nondirectory file) + (file-name-nondirectory buffer-file-name))) + (and (eq action 'renamed) + (string-equal + (file-name-nondirectory file1) + (file-name-nondirectory buffer-file-name))))) + ;; Mark buffer modified. + (setq auto-revert-notify-modified-p t) + ;; No need to check other buffers. + (cl-return))))))))) (defun auto-revert-active-p () "Check if auto-revert is active (in current buffer or globally)." ------------------------------------------------------------ revno: 114129 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-09-04 16:32:22 -0400 message: * src/keyboard.c (read_key_sequence_vs): New function. (Fread_key_sequence_vector, Fread_key_sequence): Use it to factor out common code. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-09-04 20:22:37 +0000 +++ src/ChangeLog 2013-09-04 20:32:22 +0000 @@ -1,5 +1,9 @@ 2013-09-04 Stefan Monnier + * keyboard.c (read_key_sequence_vs): New function. + (Fread_key_sequence_vector, Fread_key_sequence): Use it to factor out + common code. + * callint.c (Fcall_interactively): Always return a vector for 'K'. 2013-09-04 Paul Eggert === modified file 'src/keyboard.c' --- src/keyboard.c 2013-08-27 18:47:55 +0000 +++ src/keyboard.c 2013-09-04 20:32:22 +0000 @@ -9712,6 +9712,66 @@ return t; } +static Lisp_Object +read_key_sequence_vs (Lisp_Object prompt, Lisp_Object continue_echo, + Lisp_Object dont_downcase_last, + Lisp_Object can_return_switch_frame, + Lisp_Object cmd_loop, bool allow_string) +{ + Lisp_Object keybuf[30]; + register int i; + struct gcpro gcpro1; + ptrdiff_t count = SPECPDL_INDEX (); + + if (!NILP (prompt)) + CHECK_STRING (prompt); + QUIT; + + specbind (Qinput_method_exit_on_first_char, + (NILP (cmd_loop) ? Qt : Qnil)); + specbind (Qinput_method_use_echo_area, + (NILP (cmd_loop) ? Qt : Qnil)); + + memset (keybuf, 0, sizeof keybuf); + GCPRO1 (keybuf[0]); + gcpro1.nvars = (sizeof keybuf / sizeof (keybuf[0])); + + if (NILP (continue_echo)) + { + this_command_key_count = 0; + this_command_key_count_reset = 0; + this_single_command_key_start = 0; + } + +#ifdef HAVE_WINDOW_SYSTEM + if (display_hourglass_p) + cancel_hourglass (); +#endif + + i = read_key_sequence (keybuf, (sizeof keybuf / sizeof (keybuf[0])), + prompt, ! NILP (dont_downcase_last), + ! NILP (can_return_switch_frame), 0); + +#if 0 /* The following is fine for code reading a key sequence and + then proceeding with a lengthy computation, but it's not good + for code reading keys in a loop, like an input method. */ +#ifdef HAVE_WINDOW_SYSTEM + if (display_hourglass_p) + start_hourglass (); +#endif +#endif + + if (i == -1) + { + Vquit_flag = Qt; + QUIT; + } + UNGCPRO; + return unbind_to (count, + ((allow_string ? make_event_array : Fvector) + (i, keybuf))); +} + DEFUN ("read-key-sequence", Fread_key_sequence, Sread_key_sequence, 1, 5, 0, doc: /* Read a sequence of keystrokes and return as a string or vector. The sequence is sufficient to specify a non-prefix command in the @@ -9761,56 +9821,8 @@ will read just one key sequence. */) (Lisp_Object prompt, Lisp_Object continue_echo, Lisp_Object dont_downcase_last, Lisp_Object can_return_switch_frame, Lisp_Object cmd_loop) { - Lisp_Object keybuf[30]; - register int i; - struct gcpro gcpro1; - ptrdiff_t count = SPECPDL_INDEX (); - - if (!NILP (prompt)) - CHECK_STRING (prompt); - QUIT; - - specbind (Qinput_method_exit_on_first_char, - (NILP (cmd_loop) ? Qt : Qnil)); - specbind (Qinput_method_use_echo_area, - (NILP (cmd_loop) ? Qt : Qnil)); - - memset (keybuf, 0, sizeof keybuf); - GCPRO1 (keybuf[0]); - gcpro1.nvars = (sizeof keybuf / sizeof (keybuf[0])); - - if (NILP (continue_echo)) - { - this_command_key_count = 0; - this_command_key_count_reset = 0; - this_single_command_key_start = 0; - } - -#ifdef HAVE_WINDOW_SYSTEM - if (display_hourglass_p) - cancel_hourglass (); -#endif - - i = read_key_sequence (keybuf, (sizeof keybuf / sizeof (keybuf[0])), - prompt, ! NILP (dont_downcase_last), - ! NILP (can_return_switch_frame), 0); - -#if 0 /* The following is fine for code reading a key sequence and - then proceeding with a lengthy computation, but it's not good - for code reading keys in a loop, like an input method. */ -#ifdef HAVE_WINDOW_SYSTEM - if (display_hourglass_p) - start_hourglass (); -#endif -#endif - - if (i == -1) - { - Vquit_flag = Qt; - QUIT; - } - UNGCPRO; - return unbind_to (count, make_event_array (i, keybuf)); + return read_key_sequence_vs (prompt, continue_echo, dont_downcase_last, + can_return_switch_frame, cmd_loop, true); } DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector, @@ -9818,52 +9830,8 @@ doc: /* Like `read-key-sequence' but always return a vector. */) (Lisp_Object prompt, Lisp_Object continue_echo, Lisp_Object dont_downcase_last, Lisp_Object can_return_switch_frame, Lisp_Object cmd_loop) { - Lisp_Object keybuf[30]; - register int i; - struct gcpro gcpro1; - ptrdiff_t count = SPECPDL_INDEX (); - - if (!NILP (prompt)) - CHECK_STRING (prompt); - QUIT; - - specbind (Qinput_method_exit_on_first_char, - (NILP (cmd_loop) ? Qt : Qnil)); - specbind (Qinput_method_use_echo_area, - (NILP (cmd_loop) ? Qt : Qnil)); - - memset (keybuf, 0, sizeof keybuf); - GCPRO1 (keybuf[0]); - gcpro1.nvars = (sizeof keybuf / sizeof (keybuf[0])); - - if (NILP (continue_echo)) - { - this_command_key_count = 0; - this_command_key_count_reset = 0; - this_single_command_key_start = 0; - } - -#ifdef HAVE_WINDOW_SYSTEM - if (display_hourglass_p) - cancel_hourglass (); -#endif - - i = read_key_sequence (keybuf, (sizeof keybuf / sizeof (keybuf[0])), - prompt, ! NILP (dont_downcase_last), - ! NILP (can_return_switch_frame), 0); - -#ifdef HAVE_WINDOW_SYSTEM - if (display_hourglass_p) - start_hourglass (); -#endif - - if (i == -1) - { - Vquit_flag = Qt; - QUIT; - } - UNGCPRO; - return unbind_to (count, Fvector (i, keybuf)); + return read_key_sequence_vs (prompt, continue_echo, dont_downcase_last, + can_return_switch_frame, cmd_loop, false); } /* Return true if input events are pending. */ ------------------------------------------------------------ revno: 114128 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-09-04 16:22:37 -0400 message: * src/callint.c (Fcall_interactively): Always return a vector for 'K'. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-09-04 06:45:44 +0000 +++ src/ChangeLog 2013-09-04 20:22:37 +0000 @@ -1,3 +1,7 @@ +2013-09-04 Stefan Monnier + + * callint.c (Fcall_interactively): Always return a vector for 'K'. + 2013-09-04 Paul Eggert Makefile improvements. === modified file 'src/callint.c' --- src/callint.c 2013-08-14 16:36:16 +0000 +++ src/callint.c 2013-09-04 20:22:37 +0000 @@ -616,8 +616,8 @@ Fput_text_property (make_number (0), make_number (SCHARS (callint_message)), Qface, Qminibuffer_prompt, callint_message); - args[i] = Fread_key_sequence (callint_message, - Qnil, Qt, Qnil, Qnil); + args[i] = Fread_key_sequence_vector (callint_message, + Qnil, Qt, Qnil, Qnil); teml = args[i]; visargs[i] = Fkey_description (teml, Qnil); unbind_to (speccount1, Qnil); ------------------------------------------------------------ revno: 114127 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-09-04 16:03:52 -0400 message: * lisp/emacs-lisp/gv.el (gv-get): Warn about CL-compiled places. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-04 00:39:34 +0000 +++ lisp/ChangeLog 2013-09-04 20:03:52 +0000 @@ -1,3 +1,7 @@ +2013-09-04 Stefan Monnier + + * emacs-lisp/gv.el (gv-get): Warn about CL-compiled places. + 2013-09-04 Xue Fuqiao * vc/vc.el (vc-ignore): Rewrite. === modified file 'lisp/emacs-lisp/gv.el' --- lisp/emacs-lisp/gv.el 2013-08-13 02:30:52 +0000 +++ lisp/emacs-lisp/gv.el 2013-09-04 20:03:52 +0000 @@ -102,7 +102,9 @@ ;; Follow aliases. (setq me (cons (symbol-function head) (cdr place)))) (if (eq me place) - (error "%S is not a valid place expression" place) + (if (and (symbolp head) (get head 'setf-method)) + (error "Incompatible place needs recompilation: %S" head) + (error "%S is not a valid place expression" place)) (gv-get me do))))))) ;;;###autoload ------------------------------------------------------------ revno: 114126 committer: Paul Eggert branch nick: trunk timestamp: Tue 2013-09-03 23:45:44 -0700 message: Makefile improvements. * Makefile.in (lib): Depend on am--refresh, to avoid a race. (src): Remove duplicate dependency on FRC. Invoke just one submake, not two. Avoid the need for 'pwd'. * lwlib/Makefile.in (all): Put this first. Don't use double-colon rules, as they are not portable according to POSIX. Mark as phony. * oldXMenu/Makefile.in (all, tags): Don't use double-colon rules, as they are not portable according to POSIX. Mark as phony. * src/Makefile.in (config.status): Don't use double-colon rules, as they are not portable according to POSIX. Fix shell typo with `; I guess this rule has never been tested? (VCSWITNESS): New macro, to override any environment var. diff: === modified file 'ChangeLog' --- ChangeLog 2013-09-02 07:01:53 +0000 +++ ChangeLog 2013-09-04 06:45:44 +0000 @@ -1,3 +1,10 @@ +2013-09-04 Paul Eggert + + Makefile improvements. + * Makefile.in (lib): Depend on am--refresh, to avoid a race. + (src): Remove duplicate dependency on FRC. + Invoke just one submake, not two. Avoid the need for 'pwd'. + 2013-09-02 Jan Djärv * configure.ac: Add ns_check_file. === modified file 'Makefile.in' --- Makefile.in 2013-08-28 06:01:52 +0000 +++ Makefile.in 2013-09-04 06:45:44 +0000 @@ -352,9 +352,13 @@ -e "/^.*#/s|@SRC@|$${w32srcdir}|g") && \ ${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h +# If lib/Makefile would build files in '.', then build them before +# building 'lib', to avoid races with parallel makes. +lib: am--refresh + lib-src src: $(NTDIR) lib -src: lib-src FRC +src: lib-src # We need to build `emacs' in `src' to compile the *.elc files in `lisp' # and `leim'. @@ -376,18 +380,15 @@ # all preloaded elisp files, and only then dump the actual src/emacs, which # is not wrong, but is overkill in 99.99% of the cases. src: Makefile FRC - boot=bootstrap-emacs$(EXEEXT); \ - if [ ! -x "src/$$boot" ]; then \ - cd $@; $(MAKE) all $(MFLAGS) \ - CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \ - LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' BOOTSTRAPEMACS="$$boot"; \ - fi; - if [ -r .bzr/checkout/dirstate ]; then \ - vcswitness="`pwd`/.bzr/checkout/dirstate"; \ - fi; \ - cd $@; $(MAKE) all $(MFLAGS) \ - CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \ - LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' BOOTSTRAPEMACS="" \ + dirstate='.bzr/checkout/dirstate'; \ + vcswitness='$$(srcdir)/../'$$dirstate; \ + [ -r "$(srcdir)/$$dirstate" ] || vcswitness=''; \ + cd $@ || exit; \ + boot=bootstrap-emacs$(EXEEXT); \ + [ ! -x "$$boot" ] || boot=''; \ + $(MAKE) all $(MFLAGS) \ + CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \ + LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' BOOTSTRAPEMACS="$$boot" \ VCSWITNESS="$$vcswitness" blessmail: Makefile src FRC === modified file 'lwlib/ChangeLog' --- lwlib/ChangeLog 2013-06-30 16:14:22 +0000 +++ lwlib/ChangeLog 2013-09-04 06:45:44 +0000 @@ -1,3 +1,9 @@ +2013-09-04 Paul Eggert + + Makefile improvements. + * Makefile.in (all): Put this first. Don't use double-colon + rules, as they are not portable according to POSIX. Mark as phony. + 2013-06-30 Paul Eggert Fix minor problems found by static checking. === modified file 'lwlib/Makefile.in' --- lwlib/Makefile.in 2013-07-23 22:57:17 +0000 +++ lwlib/Makefile.in 2013-09-04 06:45:44 +0000 @@ -59,11 +59,12 @@ -Demacs -I../src \ -I$(srcdir) -I$(srcdir)/../src -I../lib -I$(srcdir)/../lib +all: liblw.a +.PHONY: all + .c.o: $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< -all:: liblw.a - liblw.a: $(OBJS) rm -f $@ $(AR) $(ARFLAGS) $@ $(OBJS) === modified file 'oldXMenu/ChangeLog' --- oldXMenu/ChangeLog 2013-03-11 16:31:55 +0000 +++ oldXMenu/ChangeLog 2013-09-04 06:45:44 +0000 @@ -1,3 +1,9 @@ +2013-09-04 Paul Eggert + + Makefile improvements. + * Makefile.in (all, tags): Don't use double-colon rules, as they + are not portable according to POSIX. Mark as phony. + 2012-12-04 Paul Eggert Include uniformly in oldXMenu sources. === modified file 'oldXMenu/Makefile.in' --- oldXMenu/Makefile.in 2013-07-23 22:55:38 +0000 +++ oldXMenu/Makefile.in 2013-09-04 06:45:44 +0000 @@ -85,7 +85,8 @@ SetSel.o \ XDelAssoc.o XLookAssoc.o XCrAssoc.o XDestAssoc.o XMakeAssoc.o -all:: libXMenu11.a +all: libXMenu11.a +.PHONY: all ALL_CFLAGS=$(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \ $(C_SWITCH_X_SITE) \ @@ -139,5 +140,6 @@ rm -f Makefile maintainer-clean: distclean -tags:: +tags: $(TAGS) -t *.[ch] +.PHONY: tags === modified file 'src/ChangeLog' --- src/ChangeLog 2013-09-04 04:02:56 +0000 +++ src/ChangeLog 2013-09-04 06:45:44 +0000 @@ -1,3 +1,11 @@ +2013-09-04 Paul Eggert + + Makefile improvements. + * Makefile.in (config.status): Don't use double-colon rules, as + they are not portable according to POSIX. Fix shell typo with `; + I guess this rule has never been tested? + (VCSWITNESS): New macro, to override any environment var. + 2013-09-04 Dmitry Antipov * xterm.h (struct x_display_info): Do not track X connection === modified file 'src/Makefile.in' --- src/Makefile.in 2013-08-28 06:01:52 +0000 +++ src/Makefile.in 2013-09-04 06:45:44 +0000 @@ -538,14 +538,9 @@ $(OLDXMENU): $(OLDXMENU_TARGET) -../config.status:: epaths.in - @echo "The file epaths.h needs to be set up from epaths.in." - @echo "Please run the `configure' script again." - exit 1 - -../config.status:: config.in - @echo "The file config.h needs to be set up from config.in." - @echo "Please run the `configure' script again." +../config.status: config.in epaths.in + @echo "The file ${?:.in=.h} needs to be set up from $?." + @echo "Please run the 'configure' script again." exit 1 doc.o: buildobj.h @@ -658,6 +653,9 @@ ## VCSWITNESS points to the file that holds info about the current checkout. ## We use it as a heuristic to decide when to rebuild loaddefs.el. +## If empty it is ignored; the parent makefile can set it to some other value. +VCSWITNESS = + $(lispsource)/loaddefs.el: $(BOOTSTRAPEMACS) $(VCSWITNESS) cd ../lisp; $(MAKE) $(MFLAGS) autoloads EMACS=$(bootstrap_exe)