]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/vc/vc-dispatcher.el (vc-run-delayed): New macro.
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 4 Sep 2013 21:09:42 +0000 (17:09 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 4 Sep 2013 21:09:42 +0000 (17:09 -0400)
(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.

12 files changed:
lisp/vc/vc-annotate.el
lisp/vc/vc-arch.el
lisp/vc/vc-bzr.el
lisp/vc/vc-cvs.el
lisp/vc/vc-dispatcher.el
lisp/vc/vc-git.el
lisp/vc/vc-hg.el
lisp/vc/vc-mtn.el
lisp/vc/vc-rcs.el
lisp/vc/vc-sccs.el
lisp/vc/vc-svn.el
lisp/vc/vc.el

index 8af488789de3f460ebe831dab9625812a5f91ae6..066b4ec65876ced2ba6b356bf888b711440183fc 100644 (file)
@@ -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 @@ use; you may override this using the second optional arg MODE."
         (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 @@ use; you may override this using the second optional arg MODE."
        (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 @@ mode-specific menu.  `vc-annotate-color-map' and
                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 @@ or OFFSET if present."
              (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)))
 
index f94e19271ee7e24510314a55c1e990dc0ab3ffc8..e9c65b49202798d0bbd89c2db5aa369d7a2ff8a0 100644 (file)
@@ -321,8 +321,8 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
   (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)
index 0d95fbed8c29eb86f5d841a00b960760ed439971..5f5416dc2ff6049240c7d8704e7698898e450b5e 100644 (file)
@@ -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 @@ prompt for the Bzr command to run."
            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 @@ default if it is available."
         (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 @@ stream.  Standard error output is discarded."
 (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)))
index 48d83d4f408e9916d4e9631bf45c1ce6db2998e1..931193c46e03cbd329e86f1594767bc8d0e9e5db 100644 (file)
@@ -518,7 +518,7 @@ Remaining arguments are ignored."
    (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 @@ state."
       ;; (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."
index 4f4c6942ba9b7b0ce80be497914524203c950c42..1b8bfa274f8fa2839b999c1f3614cd46d924969e 100644 (file)
@@ -198,11 +198,11 @@ Another is that undo information is not kept."
           ;; 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 @@ to evaluate."
      (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 @@ case, and the process object in the asynchronous case."
                (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 @@ case, and the process object in the asynchronous case."
                     (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 @@ If the current buffer is a Dired buffer, revert it."
     (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,
index 7e555825e38ba5db0d2e05dce3f212e2d42a5769..a4ce3a2c46c373ea2e75f0353bade918cf5d384d 100644 (file)
@@ -477,8 +477,8 @@ or an empty string if none."
     (`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 @@ for the Git command to run."
            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 @@ This prompts for a branch to merge from."
                           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
index 211a0c131c943820087f9249e4724a5b7fa094f1..ba882a3ec5dc10e28c80045f666bc244a9a142ba 100644 (file)
@@ -608,13 +608,13 @@ REV is the revision to check out into WORKFILE."
 
 (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 @@ then attempts to update the working directory."
                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 @@ This runs the command \"hg merge\"."
   (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
index 29996fafe92c26c825456059cefcf70a904e5ace..56536a26b41fb0aa1837c8ddd8379d5769af91c7 100644 (file)
@@ -128,8 +128,8 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
 
 (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
index e85494b21561f77aff41eee43e6d4bcf69be5bca..ef1ae8294b2100b59a9fe52d09b487bb730cea09 100644 (file)
@@ -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 @@ expanded to all registered subfiles in them."
                         ;; 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 @@ directory the operation is applied to all registered files beneath it."
     (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 @@ systime, or nil if there is none.  Also, reposition point."
   (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 @@ The `:insn' key is a keyword to distinguish it as a vc-rcs.el extension."
               ;; 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.
index 7bce1ea3ba6f5ebc0f7d05e7b8120da509879b62..e00d55218c8cf937c7dc173ab05338d52f7485db 100644 (file)
@@ -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 @@ For a description of possible values, see `vc-check-master-templates'."
 ;;; 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 @@ are expanded to all version-controlled subfiles."
                                 (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 @@ revert all subfiles."
 ;;; 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 @@ Remaining arguments are ignored."
 (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."
index 38c3bd9970da20f74b38d9ca07fb132374d86549..afc76c0974261a0a2c52f535575a79c33cb40d9b 100644 (file)
@@ -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 @@ If you want to force an empty list of arguments, use t."
 ;;; 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 @@ RESULT is a list of conses (FILE . STATE) for directory DIR."
         (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 @@ RESULT is a list of conses (FILE . STATE) for directory DIR."
 ;; 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 @@ RESULT is a list of conses (FILE . STATE) for directory DIR."
 
 (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 @@ to the SVN command."
   "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 @@ This is only possible if SVN is responsible for FILE's directory.")
 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 @@ FILE is a file wildcard, relative to the root directory of DIRECTORY."
   (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 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
             (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 @@ or svn+ssh://."
 
 (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.
index fcab6f36c6fd7e3ae42541152fa6d686c9c0203f..39e3fbdc29a44502331de53befa2888e5e432078 100644 (file)
@@ -1536,11 +1536,11 @@ Runs the normal hooks `vc-before-checkin-hook' and `vc-checkin-hook'."
 ;;   (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 @@ Return t if the buffer had changes, nil otherwise."
     (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 @@ Return t if the buffer had changes, nil otherwise."
       ;; 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 @@ earlier revisions.  Show up to LIMIT entries (non-nil means unlimited)."
 (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 @@ earlier revisions.  Show up to LIMIT entries (non-nil means unlimited)."
       (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