aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2013-09-04 17:09:42 -0400
committerStefan Monnier2013-09-04 17:09:42 -0400
commit9c750ebae6b133bb28ed9508fdc74585b300c155 (patch)
tree4eaf634ea3ef261197e33166008b2879a2b8ab6f
parentabae272ccea2a9b01723c56d5ec60d6df9f0306c (diff)
downloademacs-9c750ebae6b133bb28ed9508fdc74585b300c155.tar.gz
emacs-9c750ebae6b133bb28ed9508fdc74585b300c155.zip
* 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.
-rw-r--r--lisp/vc/vc-annotate.el30
-rw-r--r--lisp/vc/vc-arch.el4
-rw-r--r--lisp/vc/vc-bzr.el31
-rw-r--r--lisp/vc/vc-cvs.el10
-rw-r--r--lisp/vc/vc-dispatcher.el42
-rw-r--r--lisp/vc/vc-git.el8
-rw-r--r--lisp/vc/vc-hg.el13
-rw-r--r--lisp/vc/vc-mtn.el4
-rw-r--r--lisp/vc/vc-rcs.el14
-rw-r--r--lisp/vc/vc-sccs.el10
-rw-r--r--lisp/vc/vc-svn.el28
-rw-r--r--lisp/vc/vc.el33
12 files changed, 119 insertions, 108 deletions
diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el
index 8af488789de..066b4ec6587 100644
--- a/lisp/vc/vc-annotate.el
+++ b/lisp/vc/vc-annotate.el
@@ -1,4 +1,4 @@
1;;; vc-annotate.el --- VC Annotate Support 1;;; vc-annotate.el --- VC Annotate Support -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 1997-1998, 2000-2013 Free Software Foundation, Inc. 3;; Copyright (C) 1997-1998, 2000-2013 Free Software Foundation, Inc.
4 4
@@ -306,9 +306,9 @@ use; you may override this using the second optional arg MODE."
306 (vc-annotate-display-default (or vc-annotate-ratio 1.0))) 306 (vc-annotate-display-default (or vc-annotate-ratio 1.0)))
307 ;; One of the auto-scaling modes 307 ;; One of the auto-scaling modes
308 ((eq vc-annotate-display-mode 'scale) 308 ((eq vc-annotate-display-mode 'scale)
309 (vc-exec-after `(vc-annotate-display-autoscale))) 309 (vc-run-delayed (vc-annotate-display-autoscale)))
310 ((eq vc-annotate-display-mode 'fullscale) 310 ((eq vc-annotate-display-mode 'fullscale)
311 (vc-exec-after `(vc-annotate-display-autoscale t))) 311 (vc-run-delayed (vc-annotate-display-autoscale t)))
312 ((numberp vc-annotate-display-mode) ; A fixed number of days lookback 312 ((numberp vc-annotate-display-mode) ; A fixed number of days lookback
313 (vc-annotate-display-default 313 (vc-annotate-display-default
314 (/ vc-annotate-display-mode 314 (/ vc-annotate-display-mode
@@ -316,6 +316,8 @@ use; you may override this using the second optional arg MODE."
316 (t (error "No such display mode: %s" 316 (t (error "No such display mode: %s"
317 vc-annotate-display-mode)))) 317 vc-annotate-display-mode))))
318 318
319(defvar vc-sentinel-movepoint)
320
319;;;###autoload 321;;;###autoload
320(defun vc-annotate (file rev &optional display-mode buf move-point-to vc-bk) 322(defun vc-annotate (file rev &optional display-mode buf move-point-to vc-bk)
321 "Display the edit history of the current FILE using colors. 323 "Display the edit history of the current FILE using colors.
@@ -397,16 +399,16 @@ mode-specific menu. `vc-annotate-color-map' and
397 display-mode)))) 399 display-mode))))
398 400
399 (with-current-buffer temp-buffer-name 401 (with-current-buffer temp-buffer-name
400 (vc-exec-after 402 (vc-run-delayed
401 `(progn 403 ;; Ideally, we'd rather not move point if the user has already
402 ;; Ideally, we'd rather not move point if the user has already 404 ;; moved it elsewhere, but really point here is not the position
403 ;; moved it elsewhere, but really point here is not the position 405 ;; of the user's cursor :-(
404 ;; of the user's cursor :-( 406 (when current-line ;(and (bobp))
405 (when ,current-line ;(and (bobp)) 407 (goto-char (point-min))
406 (goto-line ,current-line) 408 (forward-line (1- current-line))
407 (setq vc-sentinel-movepoint (point))) 409 (setq vc-sentinel-movepoint (point)))
408 (unless (active-minibuffer-window) 410 (unless (active-minibuffer-window)
409 (message "Annotating... done"))))))) 411 (message "Annotating... done"))))))
410 412
411(defun vc-annotate-prev-revision (prefix) 413(defun vc-annotate-prev-revision (prefix)
412 "Visit the annotation of the revision previous to this one. 414 "Visit the annotation of the revision previous to this one.
@@ -630,7 +632,7 @@ or OFFSET if present."
630 (vc-call-backend vc-annotate-backend 'annotate-current-time)) 632 (vc-call-backend vc-annotate-backend 'annotate-current-time))
631 next-time)))) 633 next-time))))
632 634
633(defun vc-default-annotate-current-time (backend) 635(defun vc-default-annotate-current-time (_backend)
634 "Return the current time, encoded as fractional days." 636 "Return the current time, encoded as fractional days."
635 (vc-annotate-convert-time (current-time))) 637 (vc-annotate-convert-time (current-time)))
636 638
diff --git a/lisp/vc/vc-arch.el b/lisp/vc/vc-arch.el
index f94e19271ee..e9c65b49202 100644
--- a/lisp/vc/vc-arch.el
+++ b/lisp/vc/vc-arch.el
@@ -321,8 +321,8 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
321 (let ((default-directory dir)) 321 (let ((default-directory dir))
322 (vc-arch-command t 'async nil "changes")) 322 (vc-arch-command t 'async nil "changes"))
323 ;; The updating could be done asynchronously. 323 ;; The updating could be done asynchronously.
324 (vc-exec-after 324 (vc-run-delayed
325 `(vc-arch-after-dir-status ',callback))) 325 (vc-arch-after-dir-status callback)))
326 326
327(defun vc-arch-after-dir-status (callback) 327(defun vc-arch-after-dir-status (callback)
328 (let* ((state-map '(("M " . edited) 328 (let* ((state-map '(("M " . edited)
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index 0d95fbed8c2..5f5416dc2ff 100644
--- a/lisp/vc/vc-bzr.el
+++ b/lisp/vc/vc-bzr.el
@@ -47,6 +47,7 @@
47 47
48(eval-when-compile 48(eval-when-compile
49 (require 'cl-lib) 49 (require 'cl-lib)
50 (require 'vc-dispatcher)
50 (require 'vc-dir)) ; vc-dir-at-event 51 (require 'vc-dir)) ; vc-dir-at-event
51 52
52;; Clear up the cache to force vc-call to check again and discover 53;; Clear up the cache to force vc-call to check again and discover
@@ -354,7 +355,7 @@ prompt for the Bzr command to run."
354 command (cadr args) 355 command (cadr args)
355 args (cddr args))) 356 args (cddr args)))
356 (let ((buf (apply 'vc-bzr-async-command command args))) 357 (let ((buf (apply 'vc-bzr-async-command command args)))
357 (with-current-buffer buf (vc-exec-after '(vc-compilation-mode 'bzr))) 358 (with-current-buffer buf (vc-run-delayed (vc-compilation-mode 'bzr)))
358 (vc-set-async-update buf)))) 359 (vc-set-async-update buf))))
359 360
360(defun vc-bzr-merge-branch () 361(defun vc-bzr-merge-branch ()
@@ -385,7 +386,7 @@ default if it is available."
385 (command (cadr cmd)) 386 (command (cadr cmd))
386 (args (cddr cmd))) 387 (args (cddr cmd)))
387 (let ((buf (apply 'vc-bzr-async-command command args))) 388 (let ((buf (apply 'vc-bzr-async-command command args)))
388 (with-current-buffer buf (vc-exec-after '(vc-compilation-mode 'bzr))) 389 (with-current-buffer buf (vc-run-delayed (vc-compilation-mode 'bzr)))
389 (vc-set-async-update buf)))) 390 (vc-set-async-update buf))))
390 391
391(defun vc-bzr-status (file) 392(defun vc-bzr-status (file)
@@ -995,23 +996,23 @@ stream. Standard error output is discarded."
995(defun vc-bzr-dir-status (dir update-function) 996(defun vc-bzr-dir-status (dir update-function)
996 "Return a list of conses (file . state) for DIR." 997 "Return a list of conses (file . state) for DIR."
997 (vc-bzr-command "status" (current-buffer) 'async dir "-v" "-S") 998 (vc-bzr-command "status" (current-buffer) 'async dir "-v" "-S")
998 (vc-exec-after 999 (vc-run-delayed
999 `(vc-bzr-after-dir-status (quote ,update-function) 1000 (vc-bzr-after-dir-status update-function
1000 ;; "bzr status" results are relative to 1001 ;; "bzr status" results are relative to
1001 ;; the bzr root directory, NOT to the 1002 ;; the bzr root directory, NOT to the
1002 ;; directory "bzr status" was invoked in. 1003 ;; directory "bzr status" was invoked in.
1003 ;; Ugh. 1004 ;; Ugh.
1004 ;; We pass the relative directory here so 1005 ;; We pass the relative directory here so
1005 ;; that `vc-bzr-after-dir-status' can 1006 ;; that `vc-bzr-after-dir-status' can
1006 ;; frob the results accordingly. 1007 ;; frob the results accordingly.
1007 (file-relative-name ,dir (vc-bzr-root ,dir))))) 1008 (file-relative-name dir (vc-bzr-root dir)))))
1008 1009
1009(defun vc-bzr-dir-status-files (dir files _default-state update-function) 1010(defun vc-bzr-dir-status-files (dir files _default-state update-function)
1010 "Return a list of conses (file . state) for DIR." 1011 "Return a list of conses (file . state) for DIR."
1011 (apply 'vc-bzr-command "status" (current-buffer) 'async dir "-v" "-S" files) 1012 (apply 'vc-bzr-command "status" (current-buffer) 'async dir "-v" "-S" files)
1012 (vc-exec-after 1013 (vc-run-delayed
1013 `(vc-bzr-after-dir-status (quote ,update-function) 1014 (vc-bzr-after-dir-status update-function
1014 (file-relative-name ,dir (vc-bzr-root ,dir))))) 1015 (file-relative-name dir (vc-bzr-root dir)))))
1015 1016
1016(defvar vc-bzr-shelve-map 1017(defvar vc-bzr-shelve-map
1017 (let ((map (make-sparse-keymap))) 1018 (let ((map (make-sparse-keymap)))
diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el
index 48d83d4f408..931193c46e0 100644
--- a/lisp/vc/vc-cvs.el
+++ b/lisp/vc/vc-cvs.el
@@ -518,7 +518,7 @@ Remaining arguments are ignored."
518 (if (vc-stay-local-p files 'CVS) 'async 0) 518 (if (vc-stay-local-p files 'CVS) 'async 0)
519 files "log") 519 files "log")
520 (with-current-buffer buffer 520 (with-current-buffer buffer
521 (vc-exec-after (vc-rcs-print-log-cleanup))) 521 (vc-run-delayed (vc-rcs-print-log-cleanup)))
522 (when limit 'limit-unsupported)) 522 (when limit 'limit-unsupported))
523 523
524(defun vc-cvs-comment-history (file) 524(defun vc-cvs-comment-history (file)
@@ -1015,14 +1015,14 @@ state."
1015 ;; (vc-cvs-command (current-buffer) 'async 1015 ;; (vc-cvs-command (current-buffer) 'async
1016 ;; (file-relative-name dir) 1016 ;; (file-relative-name dir)
1017 ;; "-f" "-n" "update" "-d" "-P") 1017 ;; "-f" "-n" "update" "-d" "-P")
1018 (vc-exec-after 1018 (vc-run-delayed
1019 `(vc-cvs-after-dir-status (quote ,update-function)))))) 1019 (vc-cvs-after-dir-status update-function)))))
1020 1020
1021(defun vc-cvs-dir-status-files (dir files _default-state update-function) 1021(defun vc-cvs-dir-status-files (dir files _default-state update-function)
1022 "Create a list of conses (file . state) for DIR." 1022 "Create a list of conses (file . state) for DIR."
1023 (apply 'vc-cvs-command (current-buffer) 'async dir "-f" "status" files) 1023 (apply 'vc-cvs-command (current-buffer) 'async dir "-f" "status" files)
1024 (vc-exec-after 1024 (vc-run-delayed
1025 `(vc-cvs-after-dir-status (quote ,update-function)))) 1025 (vc-cvs-after-dir-status update-function)))
1026 1026
1027(defun vc-cvs-file-to-string (file) 1027(defun vc-cvs-file-to-string (file)
1028 "Read the content of FILE and return it as a string." 1028 "Read the content of FILE and return it as a string."
diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index 4f4c6942ba9..1b8bfa274f8 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -198,11 +198,11 @@ Another is that undo information is not kept."
198 ;; Normally, we want async code such as sentinels to not move point. 198 ;; Normally, we want async code such as sentinels to not move point.
199 (save-excursion 199 (save-excursion
200 (goto-char m) 200 (goto-char m)
201 ;; Each sentinel may move point and the next one should be run 201 ;; Each sentinel may move point and the next one should be run
202 ;; at that new point. We could get the same result by having 202 ;; at that new point. We could get the same result by having
203 ;; each sentinel read&set process-mark, but since `cmd' needs 203 ;; each sentinel read&set process-mark, but since `cmd' needs
204 ;; to work both for async and sync processes, this would be 204 ;; to work both for async and sync processes, this would be
205 ;; difficult to achieve. 205 ;; difficult to achieve.
206 (vc-exec-after code) 206 (vc-exec-after code)
207 (move-marker m (point))) 207 (move-marker m (point)))
208 ;; But sometimes the sentinels really want to move point. 208 ;; But sometimes the sentinels really want to move point.
@@ -247,6 +247,10 @@ to evaluate."
247 (t (error "Unexpected process state")))) 247 (t (error "Unexpected process state"))))
248 nil) 248 nil)
249 249
250(defmacro vc-run-delayed (&rest body)
251 (declare (indent 0) (debug t))
252 `(vc-exec-after (lambda () ,@body)))
253
250(defvar vc-post-command-functions nil 254(defvar vc-post-command-functions nil
251 "Hook run at the end of `vc-do-command'. 255 "Hook run at the end of `vc-do-command'.
252Each function is called inside the buffer in which the command was run 256Each function is called inside the buffer in which the command was run
@@ -328,8 +332,8 @@ case, and the process object in the asynchronous case."
328 (set-process-filter proc 'vc-process-filter) 332 (set-process-filter proc 'vc-process-filter)
329 (setq status proc) 333 (setq status proc)
330 (when vc-command-messages 334 (when vc-command-messages
331 (vc-exec-after 335 (vc-run-delayed
332 `(message "Running %s in background... done" ',full-command)))) 336 (message "Running %s in background... done" full-command))))
333 ;; Run synchronously 337 ;; Run synchronously
334 (when vc-command-messages 338 (when vc-command-messages
335 (message "Running %s in foreground..." full-command)) 339 (message "Running %s in foreground..." full-command))
@@ -346,9 +350,9 @@ case, and the process object in the asynchronous case."
346 (if (integerp status) (format "status %d" status) status))) 350 (if (integerp status) (format "status %d" status) status)))
347 (when vc-command-messages 351 (when vc-command-messages
348 (message "Running %s...OK = %d" full-command status)))) 352 (message "Running %s...OK = %d" full-command status))))
349 (vc-exec-after 353 (vc-run-delayed
350 `(run-hook-with-args 'vc-post-command-functions 354 (run-hook-with-args 'vc-post-command-functions
351 ',command ',file-or-list ',flags)) 355 command file-or-list flags))
352 status)))) 356 status))))
353 357
354(defun vc-do-async-command (buffer root command &rest args) 358(defun vc-do-async-command (buffer root command &rest args)
@@ -408,17 +412,17 @@ If the current buffer is a Dired buffer, revert it."
408 (cond 412 (cond
409 ((derived-mode-p 'vc-dir-mode) 413 ((derived-mode-p 'vc-dir-mode)
410 (with-current-buffer process-buffer 414 (with-current-buffer process-buffer
411 (vc-exec-after 415 (vc-run-delayed
412 `(if (buffer-live-p ,buf) 416 (if (buffer-live-p buf)
413 (with-current-buffer ,buf 417 (with-current-buffer buf
414 (vc-dir-refresh)))))) 418 (vc-dir-refresh))))))
415 ((derived-mode-p 'dired-mode) 419 ((derived-mode-p 'dired-mode)
416 (with-current-buffer process-buffer 420 (with-current-buffer process-buffer
417 (vc-exec-after 421 (vc-run-delayed
418 `(and (buffer-live-p ,buf) 422 (and (buffer-live-p buf)
419 (= (buffer-modified-tick ,buf) ,tick) 423 (= (buffer-modified-tick buf) tick)
420 (with-current-buffer ,buf 424 (with-current-buffer buf
421 (revert-buffer))))))))) 425 (revert-buffer)))))))))
422 426
423;; These functions are used to ensure that the view the user sees is up to date 427;; These functions are used to ensure that the view the user sees is up to date
424;; even if the dispatcher client mode has messed with file contents (as in, 428;; even if the dispatcher client mode has messed with file contents (as in,
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 7e555825e38..a4ce3a2c46c 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -477,8 +477,8 @@ or an empty string if none."
477 (`diff-index 477 (`diff-index
478 (vc-git-command (current-buffer) 'async files 478 (vc-git-command (current-buffer) 'async files
479 "diff-index" "--relative" "-z" "-M" "HEAD" "--"))) 479 "diff-index" "--relative" "-z" "-M" "HEAD" "--")))
480 (vc-exec-after 480 (vc-run-delayed
481 `(vc-git-after-dir-status-stage ',stage ',files ',update-function))) 481 (vc-git-after-dir-status-stage stage files update-function)))
482 482
483(defun vc-git-dir-status (_dir update-function) 483(defun vc-git-dir-status (_dir update-function)
484 "Return a list of (FILE STATE EXTRA) entries for DIR." 484 "Return a list of (FILE STATE EXTRA) entries for DIR."
@@ -726,7 +726,7 @@ for the Git command to run."
726 command (cadr args) 726 command (cadr args)
727 args (cddr args))) 727 args (cddr args)))
728 (apply 'vc-do-async-command buffer root git-program command args) 728 (apply 'vc-do-async-command buffer root git-program command args)
729 (with-current-buffer buffer (vc-exec-after '(vc-compilation-mode 'git))) 729 (with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'git)))
730 (vc-set-async-update buffer))) 730 (vc-set-async-update buffer)))
731 731
732(defun vc-git-merge-branch () 732(defun vc-git-merge-branch ()
@@ -746,7 +746,7 @@ This prompts for a branch to merge from."
746 nil t))) 746 nil t)))
747 (apply 'vc-do-async-command buffer root vc-git-program "merge" 747 (apply 'vc-do-async-command buffer root vc-git-program "merge"
748 (list merge-source)) 748 (list merge-source))
749 (with-current-buffer buffer (vc-exec-after '(vc-compilation-mode 'git))) 749 (with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'git)))
750 (vc-set-async-update buffer))) 750 (vc-set-async-update buffer)))
751 751
752;;; HISTORY FUNCTIONS 752;;; HISTORY FUNCTIONS
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index 211a0c131c9..ba882a3ec5d 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -608,13 +608,13 @@ REV is the revision to check out into WORKFILE."
608 608
609(defun vc-hg-dir-status (dir update-function) 609(defun vc-hg-dir-status (dir update-function)
610 (vc-hg-command (current-buffer) 'async dir "status" "-C") 610 (vc-hg-command (current-buffer) 'async dir "status" "-C")
611 (vc-exec-after 611 (vc-run-delayed
612 `(vc-hg-after-dir-status (quote ,update-function)))) 612 (vc-hg-after-dir-status update-function)))
613 613
614(defun vc-hg-dir-status-files (dir files _default-state update-function) 614(defun vc-hg-dir-status-files (dir files _default-state update-function)
615 (apply 'vc-hg-command (current-buffer) 'async dir "status" "-C" files) 615 (apply 'vc-hg-command (current-buffer) 'async dir "status" "-C" files)
616 (vc-exec-after 616 (vc-run-delayed
617 `(vc-hg-after-dir-status (quote ,update-function)))) 617 (vc-hg-after-dir-status update-function)))
618 618
619(defun vc-hg-dir-extra-header (name &rest commands) 619(defun vc-hg-dir-extra-header (name &rest commands)
620 (concat (propertize name 'face 'font-lock-type-face) 620 (concat (propertize name 'face 'font-lock-type-face)
@@ -708,7 +708,8 @@ then attempts to update the working directory."
708 args (cddr args))) 708 args (cddr args)))
709 (apply 'vc-do-async-command buffer root hg-program 709 (apply 'vc-do-async-command buffer root hg-program
710 command args) 710 command args)
711 (with-current-buffer buffer (vc-exec-after '(vc-compilation-mode 'hg))) 711 (with-current-buffer buffer
712 (vc-run-delayed (vc-compilation-mode 'hg)))
712 (vc-set-async-update buffer))))) 713 (vc-set-async-update buffer)))))
713 714
714(defun vc-hg-merge-branch () 715(defun vc-hg-merge-branch ()
@@ -717,7 +718,7 @@ This runs the command \"hg merge\"."
717 (let* ((root (vc-hg-root default-directory)) 718 (let* ((root (vc-hg-root default-directory))
718 (buffer (format "*vc-hg : %s*" (expand-file-name root)))) 719 (buffer (format "*vc-hg : %s*" (expand-file-name root))))
719 (apply 'vc-do-async-command buffer root vc-hg-program '("merge")) 720 (apply 'vc-do-async-command buffer root vc-hg-program '("merge"))
720 (with-current-buffer buffer (vc-exec-after '(vc-compilation-mode 'hg))) 721 (with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'hg)))
721 (vc-set-async-update buffer))) 722 (vc-set-async-update buffer)))
722 723
723;;; Internal functions 724;;; Internal functions
diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el
index 29996fafe92..56536a26b41 100644
--- a/lisp/vc/vc-mtn.el
+++ b/lisp/vc/vc-mtn.el
@@ -128,8 +128,8 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
128 128
129(defun vc-mtn-dir-status (dir update-function) 129(defun vc-mtn-dir-status (dir update-function)
130 (vc-mtn-command (current-buffer) 'async dir "status") 130 (vc-mtn-command (current-buffer) 'async dir "status")
131 (vc-exec-after 131 (vc-run-delayed
132 `(vc-mtn-after-dir-status (quote ,update-function)))) 132 (vc-mtn-after-dir-status update-function)))
133 133
134(defun vc-mtn-working-revision (file) 134(defun vc-mtn-working-revision (file)
135 ;; If `mtn' fails or returns status>0, or if the search fails, just 135 ;; If `mtn' fails or returns status>0, or if the search fails, just
diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el
index e85494b2156..ef1ae8294b2 100644
--- a/lisp/vc/vc-rcs.el
+++ b/lisp/vc/vc-rcs.el
@@ -1,4 +1,4 @@
1;;; vc-rcs.el --- support for RCS version-control 1;;; vc-rcs.el --- support for RCS version-control -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 1992-2013 Free Software Foundation, Inc. 3;; Copyright (C) 1992-2013 Free Software Foundation, Inc.
4 4
@@ -520,7 +520,7 @@ expanded to all registered subfiles in them."
520 ;; No, it was some other error: re-signal it. 520 ;; No, it was some other error: re-signal it.
521 (signal (car err) (cdr err))))))))) 521 (signal (car err) (cdr err)))))))))
522 522
523(defun vc-rcs-revert (file &optional contents-done) 523(defun vc-rcs-revert (file &optional _contents-done)
524 "Revert FILE to the version it was based on. If FILE is a directory, 524 "Revert FILE to the version it was based on. If FILE is a directory,
525revert all registered files beneath it." 525revert all registered files beneath it."
526 (if (file-directory-p file) 526 (if (file-directory-p file)
@@ -571,8 +571,8 @@ directory the operation is applied to all registered files beneath it."
571 (when (looking-at "[\b\t\n\v\f\r ]+") 571 (when (looking-at "[\b\t\n\v\f\r ]+")
572 (delete-char (- (match-end 0) (match-beginning 0)))))) 572 (delete-char (- (match-end 0) (match-beginning 0))))))
573 573
574(defun vc-rcs-print-log (files buffer &optional shortlog 574(defun vc-rcs-print-log (files buffer &optional _shortlog
575 start-revision-ignored limit) 575 _start-revision-ignored limit)
576 "Print commit log associated with FILES into specified BUFFER. 576 "Print commit log associated with FILES into specified BUFFER.
577Remaining arguments are ignored. 577Remaining arguments are ignored.
578If FILE is a directory the operation is applied to all registered 578If FILE is a directory the operation is applied to all registered
@@ -853,7 +853,7 @@ systime, or nil if there is none. Also, reposition point."
853 (string-match "[0-9]+\\'" rev) 853 (string-match "[0-9]+\\'" rev)
854 (substring rev (match-beginning 0) (match-end 0))) 854 (substring rev (match-beginning 0) (match-end 0)))
855 855
856(defun vc-rcs-previous-revision (file rev) 856(defun vc-rcs-previous-revision (_file rev)
857 "Return the revision number immediately preceding REV for FILE, 857 "Return the revision number immediately preceding REV for FILE,
858or nil if there is no previous revision. This default 858or nil if there is no previous revision. This default
859implementation works for MAJOR.MINOR-style revision numbers as 859implementation works for MAJOR.MINOR-style revision numbers as
@@ -1440,8 +1440,8 @@ The `:insn' key is a keyword to distinguish it as a vc-rcs.el extension."
1440 ;; only the former since it behaves identically to the 1440 ;; only the former since it behaves identically to the
1441 ;; latter in the absence of "@@".) 1441 ;; latter in the absence of "@@".)
1442 sub) 1442 sub)
1443 (cl-flet ((incg (beg end) 1443 (cl-flet ((incg (_beg end)
1444 (let ((b beg) (e end) @-holes) 1444 (let ((e end) @-holes)
1445 (while (and asc (< (car asc) e)) 1445 (while (and asc (< (car asc) e))
1446 (push (pop asc) @-holes)) 1446 (push (pop asc) @-holes))
1447 ;; Self-deprecate when work is done. 1447 ;; Self-deprecate when work is done.
diff --git a/lisp/vc/vc-sccs.el b/lisp/vc/vc-sccs.el
index 7bce1ea3ba6..e00d55218c8 100644
--- a/lisp/vc/vc-sccs.el
+++ b/lisp/vc/vc-sccs.el
@@ -1,4 +1,4 @@
1;;; vc-sccs.el --- support for SCCS version-control 1;;; vc-sccs.el --- support for SCCS version-control -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 1992-2013 Free Software Foundation, Inc. 3;; Copyright (C) 1992-2013 Free Software Foundation, Inc.
4 4
@@ -101,7 +101,7 @@ For a description of possible values, see `vc-check-master-templates'."
101;;; Properties of the backend 101;;; Properties of the backend
102 102
103(defun vc-sccs-revision-granularity () 'file) 103(defun vc-sccs-revision-granularity () 'file)
104(defun vc-sccs-checkout-model (files) 'locking) 104(defun vc-sccs-checkout-model (_files) 'locking)
105 105
106;;; 106;;;
107;;; State-querying functions 107;;; State-querying functions
@@ -321,7 +321,7 @@ are expanded to all version-controlled subfiles."
321 (vc-name file) (concat "-r" discard)) 321 (vc-name file) (concat "-r" discard))
322 (vc-sccs-do-command nil 0 "get" (vc-name file) nil)))) 322 (vc-sccs-do-command nil 0 "get" (vc-name file) nil))))
323 323
324(defun vc-sccs-revert (file &optional contents-done) 324(defun vc-sccs-revert (file &optional _contents-done)
325 "Revert FILE to the version it was based on. If FILE is a directory, 325 "Revert FILE to the version it was based on. If FILE is a directory,
326revert all subfiles." 326revert all subfiles."
327 (if (file-directory-p file) 327 (if (file-directory-p file)
@@ -353,7 +353,7 @@ revert all subfiles."
353;;; History functions 353;;; History functions
354;;; 354;;;
355 355
356(defun vc-sccs-print-log (files buffer &optional shortlog start-revision-ignored limit) 356(defun vc-sccs-print-log (files buffer &optional _shortlog _start-revision-ignored limit)
357 "Print commit log associated with FILES into specified BUFFER. 357 "Print commit log associated with FILES into specified BUFFER.
358Remaining arguments are ignored." 358Remaining arguments are ignored."
359 (setq files (vc-expand-dirs files)) 359 (setq files (vc-expand-dirs files))
@@ -363,6 +363,8 @@ Remaining arguments are ignored."
363(autoload 'vc-setup-buffer "vc-dispatcher") 363(autoload 'vc-setup-buffer "vc-dispatcher")
364(autoload 'vc-delistify "vc-dispatcher") 364(autoload 'vc-delistify "vc-dispatcher")
365 365
366(defvar w32-quote-process-args)
367
366;; FIXME use sccsdiff if present? 368;; FIXME use sccsdiff if present?
367(defun vc-sccs-diff (files &optional oldvers newvers buffer) 369(defun vc-sccs-diff (files &optional oldvers newvers buffer)
368 "Get a difference report using SCCS between two filesets." 370 "Get a difference report using SCCS between two filesets."
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el
index 38c3bd9970d..afc76c09742 100644
--- a/lisp/vc/vc-svn.el
+++ b/lisp/vc/vc-svn.el
@@ -1,4 +1,4 @@
1;;; vc-svn.el --- non-resident support for Subversion version-control 1;;; vc-svn.el --- non-resident support for Subversion version-control -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2003-2013 Free Software Foundation, Inc. 3;; Copyright (C) 2003-2013 Free Software Foundation, Inc.
4 4
@@ -115,7 +115,7 @@ If you want to force an empty list of arguments, use t."
115;;; Properties of the backend 115;;; Properties of the backend
116 116
117(defun vc-svn-revision-granularity () 'repository) 117(defun vc-svn-revision-granularity () 'repository)
118(defun vc-svn-checkout-model (files) 'implicit) 118(defun vc-svn-checkout-model (_files) 'implicit)
119 119
120;;; 120;;;
121;;; State-querying functions 121;;; State-querying functions
@@ -231,13 +231,13 @@ RESULT is a list of conses (FILE . STATE) for directory DIR."
231 (remote (or t (not local) (eq local 'only-file)))) 231 (remote (or t (not local) (eq local 'only-file))))
232 (vc-svn-command (current-buffer) 'async nil "status" 232 (vc-svn-command (current-buffer) 'async nil "status"
233 (if remote "-u")) 233 (if remote "-u"))
234 (vc-exec-after 234 (vc-run-delayed
235 `(vc-svn-after-dir-status (quote ,callback) ,remote)))) 235 (vc-svn-after-dir-status callback remote))))
236 236
237(defun vc-svn-dir-status-files (dir files default-state callback) 237(defun vc-svn-dir-status-files (dir files _default-state callback)
238 (apply 'vc-svn-command (current-buffer) 'async nil "status" files) 238 (apply 'vc-svn-command (current-buffer) 'async nil "status" files)
239 (vc-exec-after 239 (vc-run-delayed
240 `(vc-svn-after-dir-status (quote ,callback)))) 240 (vc-svn-after-dir-status callback)))
241 241
242(defun vc-svn-dir-extra-headers (dir) 242(defun vc-svn-dir-extra-headers (dir)
243 "Generate extra status headers for a Subversion working copy." 243 "Generate extra status headers for a Subversion working copy."
@@ -268,7 +268,7 @@ RESULT is a list of conses (FILE . STATE) for directory DIR."
268;; vc-svn-mode-line-string doesn't exist because the default implementation 268;; vc-svn-mode-line-string doesn't exist because the default implementation
269;; works just fine. 269;; works just fine.
270 270
271(defun vc-svn-previous-revision (file rev) 271(defun vc-svn-previous-revision (_file rev)
272 (let ((newrev (1- (string-to-number rev)))) 272 (let ((newrev (1- (string-to-number rev))))
273 (when (< 0 newrev) 273 (when (< 0 newrev)
274 (number-to-string newrev)))) 274 (number-to-string newrev))))
@@ -298,7 +298,7 @@ RESULT is a list of conses (FILE . STATE) for directory DIR."
298 298
299(autoload 'vc-switches "vc") 299(autoload 'vc-switches "vc")
300 300
301(defun vc-svn-register (files &optional rev comment) 301(defun vc-svn-register (files &optional _rev _comment)
302 "Register FILES into the SVN version-control system. 302 "Register FILES into the SVN version-control system.
303The COMMENT argument is ignored This does an add but not a commit. 303The COMMENT argument is ignored This does an add but not a commit.
304Passes either `vc-svn-register-switches' or `vc-register-switches' 304Passes either `vc-svn-register-switches' or `vc-register-switches'
@@ -314,7 +314,7 @@ to the SVN command."
314 "Return non-nil if FILE could be registered in SVN. 314 "Return non-nil if FILE could be registered in SVN.
315This is only possible if SVN is responsible for FILE's directory.") 315This is only possible if SVN is responsible for FILE's directory.")
316 316
317(defun vc-svn-checkin (files rev comment &optional extra-args-ignored) 317(defun vc-svn-checkin (files rev comment &optional _extra-args-ignored)
318 "SVN-specific version of `vc-backend-checkin'." 318 "SVN-specific version of `vc-backend-checkin'."
319 (if rev (error "Committing to a specific revision is unsupported in SVN")) 319 (if rev (error "Committing to a specific revision is unsupported in SVN"))
320 (let ((status (apply 320 (let ((status (apply
@@ -357,7 +357,7 @@ This is only possible if SVN is responsible for FILE's directory.")
357FILE is a file wildcard, relative to the root directory of DIRECTORY." 357FILE is a file wildcard, relative to the root directory of DIRECTORY."
358 (vc-svn-command t 0 file "propedit" "svn:ignore")) 358 (vc-svn-command t 0 file "propedit" "svn:ignore"))
359 359
360(defun vc-svn-ignore-completion-table (file) 360(defun vc-svn-ignore-completion-table (_file)
361 "Return the list of ignored files." 361 "Return the list of ignored files."
362 ) 362 )
363 363
@@ -368,7 +368,7 @@ FILE is a file wildcard, relative to the root directory of DIRECTORY."
368 (vc-mode-line file 'SVN) 368 (vc-mode-line file 'SVN)
369 (message "Checking out %s...done" file)) 369 (message "Checking out %s...done" file))
370 370
371(defun vc-svn-update (file editable rev switches) 371(defun vc-svn-update (file _editable rev switches)
372 (if (and (file-exists-p file) (not rev)) 372 (if (and (file-exists-p file) (not rev))
373 ;; If no revision was specified, there's nothing to do. 373 ;; If no revision was specified, there's nothing to do.
374 nil 374 nil
@@ -457,7 +457,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
457 (error "Couldn't analyze svn update result"))) 457 (error "Couldn't analyze svn update result")))
458 (message "Merging changes into %s...done" file)))) 458 (message "Merging changes into %s...done" file))))
459 459
460(defun vc-svn-modify-change-comment (files rev comment) 460(defun vc-svn-modify-change-comment (_files rev comment)
461 "Modify the change comments for a specified REV. 461 "Modify the change comments for a specified REV.
462You must have ssh access to the repository host, and the directory Emacs 462You must have ssh access to the repository host, and the directory Emacs
463uses locally for temp files must also be writable by you on that host. 463uses locally for temp files must also be writable by you on that host.
@@ -509,7 +509,7 @@ or svn+ssh://."
509 509
510(autoload 'vc-setup-buffer "vc-dispatcher") 510(autoload 'vc-setup-buffer "vc-dispatcher")
511 511
512(defun vc-svn-print-log (files buffer &optional shortlog start-revision limit) 512(defun vc-svn-print-log (files buffer &optional _shortlog start-revision limit)
513 "Print commit log associated with FILES into specified BUFFER. 513 "Print commit log associated with FILES into specified BUFFER.
514SHORTLOG is ignored. 514SHORTLOG is ignored.
515If START-REVISION is non-nil, it is the newest revision to show. 515If START-REVISION is non-nil, it is the newest revision to show.
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index fcab6f36c6f..39e3fbdc29a 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1536,11 +1536,11 @@ Runs the normal hooks `vc-before-checkin-hook' and `vc-checkin-hook'."
1536;; (vc-file-tree-walk 1536;; (vc-file-tree-walk
1537;; default-directory 1537;; default-directory
1538;; (lambda (f) 1538;; (lambda (f)
1539;; (vc-exec-after 1539;; (vc-run-delayed
1540;; `(let ((coding-system-for-read (vc-coding-system-for-diff ',f))) 1540;; (let ((coding-system-for-read (vc-coding-system-for-diff f)))
1541;; (message "Looking at %s" ',f) 1541;; (message "Looking at %s" f)
1542;; (vc-call-backend ',(vc-backend f) 1542;; (vc-call-backend (vc-backend f)
1543;; 'diff (list ',f) ',rev1 ',rev2)))))) 1543;; 'diff (list f) rev1 rev2))))))
1544 1544
1545(defvar vc-coding-system-inherit-eol t 1545(defvar vc-coding-system-inherit-eol t
1546 "When non-nil, inherit the EOL format for reading Diff output from the file. 1546 "When non-nil, inherit the EOL format for reading Diff output from the file.
@@ -1678,8 +1678,8 @@ Return t if the buffer had changes, nil otherwise."
1678 (diff-mode) 1678 (diff-mode)
1679 (set (make-local-variable 'diff-vc-backend) (car vc-fileset)) 1679 (set (make-local-variable 'diff-vc-backend) (car vc-fileset))
1680 (set (make-local-variable 'revert-buffer-function) 1680 (set (make-local-variable 'revert-buffer-function)
1681 `(lambda (ignore-auto noconfirm) 1681 (lambda (_ignore-auto _noconfirm)
1682 (vc-diff-internal ,async ',vc-fileset ,rev1 ,rev2 ,verbose))) 1682 (vc-diff-internal async vc-fileset rev1 rev2 verbose)))
1683 ;; Make the *vc-diff* buffer read only, the diff-mode key 1683 ;; Make the *vc-diff* buffer read only, the diff-mode key
1684 ;; bindings are nicer for read only buffers. pcl-cvs does the 1684 ;; bindings are nicer for read only buffers. pcl-cvs does the
1685 ;; same thing. 1685 ;; same thing.
@@ -1695,8 +1695,8 @@ Return t if the buffer had changes, nil otherwise."
1695 ;; The diff process may finish early, so call `vc-diff-finish' 1695 ;; The diff process may finish early, so call `vc-diff-finish'
1696 ;; after `pop-to-buffer'; the former assumes the diff buffer is 1696 ;; after `pop-to-buffer'; the former assumes the diff buffer is
1697 ;; shown in some window. 1697 ;; shown in some window.
1698 (vc-exec-after `(vc-diff-finish ,(current-buffer) 1698 (let ((buf (current-buffer)))
1699 ',(when verbose messages))) 1699 (vc-run-delayed (vc-diff-finish buf (when verbose messages))))
1700 ;; In the async case, we return t even if there are no differences 1700 ;; In the async case, we return t even if there are no differences
1701 ;; because we don't know that yet. 1701 ;; because we don't know that yet.
1702 t))) 1702 t)))
@@ -2230,6 +2230,7 @@ earlier revisions. Show up to LIMIT entries (non-nil means unlimited)."
2230(defvar vc-log-view-type nil 2230(defvar vc-log-view-type nil
2231 "Set this to differentiate the different types of logs.") 2231 "Set this to differentiate the different types of logs.")
2232(put 'vc-log-view-type 'permanent-local t) 2232(put 'vc-log-view-type 'permanent-local t)
2233(defvar vc-sentinel-movepoint)
2233 2234
2234(defun vc-log-internal-common (backend 2235(defun vc-log-internal-common (backend
2235 buffer-name 2236 buffer-name
@@ -2252,13 +2253,13 @@ earlier revisions. Show up to LIMIT entries (non-nil means unlimited)."
2252 (set (make-local-variable 'log-view-vc-fileset) files) 2253 (set (make-local-variable 'log-view-vc-fileset) files)
2253 (set (make-local-variable 'revert-buffer-function) 2254 (set (make-local-variable 'revert-buffer-function)
2254 rev-buff-func)) 2255 rev-buff-func))
2255 (vc-exec-after 2256 (vc-run-delayed
2256 `(let ((inhibit-read-only t)) 2257 (let ((inhibit-read-only t))
2257 (funcall ',setup-buttons-func ',backend ',files ',retval) 2258 (funcall setup-buttons-func backend files retval)
2258 (shrink-window-if-larger-than-buffer) 2259 (shrink-window-if-larger-than-buffer)
2259 (funcall ',goto-location-func ',backend) 2260 (funcall goto-location-func backend)
2260 (setq vc-sentinel-movepoint (point)) 2261 (setq vc-sentinel-movepoint (point))
2261 (set-buffer-modified-p nil))))) 2262 (set-buffer-modified-p nil)))))
2262 2263
2263(defun vc-incoming-outgoing-internal (backend remote-location buffer-name type) 2264(defun vc-incoming-outgoing-internal (backend remote-location buffer-name type)
2264 (vc-log-internal-common 2265 (vc-log-internal-common