aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2012-04-25 23:18:47 -0400
committerStefan Monnier2012-04-25 23:18:47 -0400
commit0d42eb3e961e612b1b04e32e99c2998dd4d5d3be (patch)
treeba3f4b82f97ff86ca4c5773f43b2d8a50a23e123
parentf08ae1c9b5ee79aef764f4ef35ae4c84009333e6 (diff)
downloademacs-0d42eb3e961e612b1b04e32e99c2998dd4d5d3be.tar.gz
emacs-0d42eb3e961e612b1b04e32e99c2998dd4d5d3be.zip
* lisp/vc/vc-mtn.el:
* lisp/vc/vc-hg.el: * lisp/vc/vc-git.el: * lisp/vc/vc-dir.el: * lisp/vc/vc-cvs.el: * lisp/vc/vc-bzr.el: * lisp/vc/vc-arch.el: * lisp/vc/vc.el: Replace lexical-let by lexical-binding. * lisp/minibuffer.el (lazy-completion-table): Avoid ((λ ...) ...). * lisp/emacs-lisp/cl-macs.el (lexical-let): Fix use in lexical-binding. * lisp/emacs-lisp/cconv.el (cconv-analyse-form): Warn use of ((λ ...) ...).
-rw-r--r--lisp/ChangeLog14
-rw-r--r--lisp/emacs-lisp/cconv.el4
-rw-r--r--lisp/emacs-lisp/cl-loaddefs.el2
-rw-r--r--lisp/emacs-lisp/cl-macs.el22
-rw-r--r--lisp/files.el3
-rw-r--r--lisp/minibuffer.el2
-rw-r--r--lisp/vc/vc-arch.el34
-rw-r--r--lisp/vc/vc-bzr.el209
-rw-r--r--lisp/vc/vc-cvs.el16
-rw-r--r--lisp/vc/vc-dir.el31
-rw-r--r--lisp/vc/vc-git.el28
-rw-r--r--lisp/vc/vc-hg.el25
-rw-r--r--lisp/vc/vc-mtn.el81
-rw-r--r--lisp/vc/vc.el173
14 files changed, 317 insertions, 327 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 04271849758..bb40b542792 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,17 @@
12012-04-26 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * vc/vc-mtn.el:
4 * vc/vc-hg.el:
5 * vc/vc-git.el:
6 * vc/vc-dir.el:
7 * vc/vc-cvs.el:
8 * vc/vc-bzr.el:
9 * vc/vc-arch.el:
10 * vc/vc.el: Replace lexical-let by lexical-binding.
11 * minibuffer.el (lazy-completion-table): Avoid ((λ ...) ...).
12 * emacs-lisp/cl-macs.el (lexical-let): Fix use in lexical-binding.
13 * emacs-lisp/cconv.el (cconv-analyse-form): Warn use of ((λ ...) ...).
14
12012-04-26 Chong Yidong <cyd@gnu.org> 152012-04-26 Chong Yidong <cyd@gnu.org>
2 16
3 * vc/ediff-wind.el (ediff-setup-windows-default): New function. 17 * vc/ediff-wind.el (ediff-setup-windows-default): New function.
diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el
index b6b6a78a9bb..3ce0eadab55 100644
--- a/lisp/emacs-lisp/cconv.el
+++ b/lisp/emacs-lisp/cconv.el
@@ -639,7 +639,9 @@ and updates the data stored in ENV."
639 (cconv-analyse-form (cadr forms) env) 639 (cconv-analyse-form (cadr forms) env)
640 (setq forms (cddr forms)))) 640 (setq forms (cddr forms))))
641 641
642 (`((lambda . ,_) . ,_) ; first element is lambda expression 642 (`((lambda . ,_) . ,_) ; First element is lambda expression.
643 (byte-compile-log-warning
644 "Use of deprecated ((lambda ...) ...) form" t :warning)
643 (dolist (exp `((function ,(car form)) . ,(cdr form))) 645 (dolist (exp `((function ,(car form)) . ,(cdr form)))
644 (cconv-analyse-form exp env))) 646 (cconv-analyse-form exp env)))
645 647
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el
index 9e0099bb649..48be2f72972 100644
--- a/lisp/emacs-lisp/cl-loaddefs.el
+++ b/lisp/emacs-lisp/cl-loaddefs.el
@@ -286,7 +286,7 @@ This also does some trivial optimizations to make the form prettier.
286;;;;;; flet progv psetq do-all-symbols do-symbols dotimes dolist 286;;;;;; flet progv psetq do-all-symbols do-symbols dotimes dolist
287;;;;;; do* do loop return-from return block etypecase typecase ecase 287;;;;;; do* do loop return-from return block etypecase typecase ecase
288;;;;;; case load-time-value eval-when destructuring-bind function* 288;;;;;; case load-time-value eval-when destructuring-bind function*
289;;;;;; defmacro* defun* gentemp gensym) "cl-macs" "cl-macs.el" "91b45885535a73dd8015973cb8c988e1") 289;;;;;; defmacro* defun* gentemp gensym) "cl-macs" "cl-macs.el" "abb2e33c6f61539d69ddbe7c4046261b")
290;;; Generated autoloads from cl-macs.el 290;;; Generated autoloads from cl-macs.el
291 291
292(autoload 'gensym "cl-macs" "\ 292(autoload 'gensym "cl-macs" "\
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 4fc71bbbc60..35cda8cfcf6 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -1483,18 +1483,24 @@ lexical closures as in Common Lisp.
1483 (cons 'progn body) 1483 (cons 'progn body)
1484 (nconc (mapcar (function (lambda (x) 1484 (nconc (mapcar (function (lambda (x)
1485 (list (symbol-name (car x)) 1485 (list (symbol-name (car x))
1486 (list 'symbol-value (caddr x)) 1486 (list 'symbol-value (caddr x))
1487 t))) vars) 1487 t))) vars)
1488 (list '(defun . cl-defun-expander)) 1488 (list '(defun . cl-defun-expander))
1489 cl-macro-environment)))) 1489 cl-macro-environment))))
1490 (if (not (get (car (last cl-closure-vars)) 'used)) 1490 (if (not (get (car (last cl-closure-vars)) 'used))
1491 (list 'let (mapcar (function (lambda (x) 1491 ;; Turn (let ((foo (gensym))) (set foo <val>) ...(symbol-value foo)...)
1492 (list (caddr x) (cadr x)))) vars) 1492 ;; into (let ((foo <val>)) ...(symbol-value 'foo)...).
1493 (sublis (mapcar (function (lambda (x) 1493 ;; This is good because it's more efficient but it only works with
1494 (cons (caddr x) 1494 ;; dynamic scoping, since with lexical scoping we'd need
1495 (list 'quote (caddr x))))) 1495 ;; (let ((foo <val>)) ...foo...).
1496 vars) 1496 `(progn
1497 ebody)) 1497 ,@(mapcar (lambda (x) `(defvar ,(caddr x))) vars)
1498 (let ,(mapcar (lambda (x) (list (caddr x) (cadr x))) vars)
1499 ,(sublis (mapcar (lambda (x)
1500 (cons (caddr x)
1501 (list 'quote (caddr x))))
1502 vars)
1503 ebody)))
1498 (list 'let (mapcar (function (lambda (x) 1504 (list 'let (mapcar (function (lambda (x)
1499 (list (caddr x) 1505 (list (caddr x)
1500 (list 'make-symbol 1506 (list 'make-symbol
diff --git a/lisp/files.el b/lisp/files.el
index 703b443765d..96a5b40e791 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3642,7 +3642,8 @@ and `file-local-variables-alist', without applying them."
3642 (when (and enable-local-variables 3642 (when (and enable-local-variables
3643 (not (file-remote-p (or (buffer-file-name) default-directory)))) 3643 (not (file-remote-p (or (buffer-file-name) default-directory))))
3644 ;; Find the variables file. 3644 ;; Find the variables file.
3645 (let ((variables-file (dir-locals-find-file (or (buffer-file-name) default-directory))) 3645 (let ((variables-file (dir-locals-find-file
3646 (or (buffer-file-name) default-directory)))
3646 (class nil) 3647 (class nil)
3647 (dir-name nil)) 3648 (dir-name nil))
3648 (cond 3649 (cond
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 733a132bb1c..59bd0d231dc 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -199,7 +199,7 @@ You should give VAR a non-nil `risky-local-variable' property."
199 `(completion-table-dynamic 199 `(completion-table-dynamic
200 (lambda (,str) 200 (lambda (,str)
201 (when (functionp ,var) 201 (when (functionp ,var)
202 (setq ,var (,fun))) 202 (setq ,var (funcall #',fun)))
203 ,var)))) 203 ,var))))
204 204
205(defun completion-table-case-fold (table &optional dont-fold) 205(defun completion-table-case-fold (table &optional dont-fold)
diff --git a/lisp/vc/vc-arch.el b/lisp/vc/vc-arch.el
index 052e6784b08..18dfbe1f5fa 100644
--- a/lisp/vc/vc-arch.el
+++ b/lisp/vc/vc-arch.el
@@ -1,4 +1,4 @@
1;;; vc-arch.el --- VC backend for the Arch version-control system 1;;; vc-arch.el --- VC backend for the Arch version-control system -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 2004-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2004-2012 Free Software Foundation, Inc.
4 4
@@ -59,7 +59,7 @@
59;;; Properties of the backend 59;;; Properties of the backend
60 60
61(defun vc-arch-revision-granularity () 'repository) 61(defun vc-arch-revision-granularity () 'repository)
62(defun vc-arch-checkout-model (files) 'implicit) 62(defun vc-arch-checkout-model (_files) 'implicit)
63 63
64;;; 64;;;
65;;; Customization options 65;;; Customization options
@@ -227,7 +227,7 @@ Only the value `maybe' can be trusted :-(."
227 (vc-file-setprop 227 (vc-file-setprop
228 file 'arch-root root))))) 228 file 'arch-root root)))))
229 229
230(defun vc-arch-register (files &optional rev comment) 230(defun vc-arch-register (files &optional rev _comment)
231 (if rev (error "Explicit initial revision not supported for Arch")) 231 (if rev (error "Explicit initial revision not supported for Arch"))
232 (dolist (file files) 232 (dolist (file files)
233 (let ((tagmet (vc-arch-tagging-method file))) 233 (let ((tagmet (vc-arch-tagging-method file)))
@@ -258,7 +258,7 @@ Only the value `maybe' can be trusted :-(."
258 ;; Strip the terminating newline. 258 ;; Strip the terminating newline.
259 (buffer-substring (point-min) (1- (point-max))))))))) 259 (buffer-substring (point-min) (1- (point-max)))))))))
260 260
261(defun vc-arch-workfile-unchanged-p (file) 261(defun vc-arch-workfile-unchanged-p (_file)
262 "Stub: arch workfiles are always considered to be in a changed state," 262 "Stub: arch workfiles are always considered to be in a changed state,"
263 nil) 263 nil)
264 264
@@ -508,12 +508,11 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
508 "*")))))) 508 "*"))))))
509 509
510(defun vc-arch-revision-completion-table (files) 510(defun vc-arch-revision-completion-table (files)
511 (lexical-let ((files files)) 511 (lambda (string pred action)
512 (lambda (string pred action) 512 ;; FIXME: complete revision patches as well.
513 ;; FIXME: complete revision patches as well. 513 (let* ((root (expand-file-name "{arch}" (vc-arch-root (car files))))
514 (let* ((root (expand-file-name "{arch}" (vc-arch-root (car files)))) 514 (table (vc-arch--version-completion-table root string)))
515 (table (vc-arch--version-completion-table root string))) 515 (complete-with-action action table string pred))))
516 (complete-with-action action table string pred)))))
517 516
518;;; Trimming revision libraries. 517;;; Trimming revision libraries.
519 518
@@ -547,13 +546,12 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
547 minrev)) 546 minrev))
548 547
549(defun vc-arch-trim-make-sentinel (revs) 548(defun vc-arch-trim-make-sentinel (revs)
550 (if (null revs) (lambda (proc msg) (message "VC-Arch trimming ... done")) 549 (if (null revs) (lambda (_proc _msg) (message "VC-Arch trimming ... done"))
551 (lexical-let ((revs revs)) 550 (lambda (_proc _msg)
552 (lambda (proc msg) 551 (message "VC-Arch trimming %s..." (file-name-nondirectory (car revs)))
553 (message "VC-Arch trimming %s..." (file-name-nondirectory (car revs))) 552 (rename-file (car revs) (concat (car revs) "*rm*"))
554 (rename-file (car revs) (concat (car revs) "*rm*")) 553 (let ((proc (start-process "vc-arch-trim" nil
555 (setq proc (start-process "vc-arch-trim" nil 554 "rm" "-rf" (concat (car revs) "*rm*"))))
556 "rm" "-rf" (concat (car revs) "*rm*")))
557 (set-process-sentinel proc (vc-arch-trim-make-sentinel (cdr revs))))))) 555 (set-process-sentinel proc (vc-arch-trim-make-sentinel (cdr revs)))))))
558 556
559(defun vc-arch-trim-one-revlib (dir) 557(defun vc-arch-trim-one-revlib (dir)
@@ -572,7 +570,7 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
572 'car-less-than-car)) 570 'car-less-than-car))
573 (subdirs nil)) 571 (subdirs nil))
574 (when (cddr revs) 572 (when (cddr revs)
575 (dotimes (i (/ (length revs) 2)) 573 (dotimes (_i (/ (length revs) 2))
576 (let ((minrev (vc-arch-trim-find-least-useful-rev revs))) 574 (let ((minrev (vc-arch-trim-find-least-useful-rev revs)))
577 (setq revs (delq minrev revs)) 575 (setq revs (delq minrev revs))
578 (push minrev subdirs))) 576 (push minrev subdirs)))
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index 505e40f46ba..5488e53e32f 100644
--- a/lisp/vc/vc-bzr.el
+++ b/lisp/vc/vc-bzr.el
@@ -1,4 +1,4 @@
1;;; vc-bzr.el --- VC backend for the bzr revision control system 1;;; vc-bzr.el --- VC backend for the bzr revision control system -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 2006-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2006-2012 Free Software Foundation, Inc.
4 4
@@ -41,7 +41,7 @@
41;;; Properties of the backend 41;;; Properties of the backend
42 42
43(defun vc-bzr-revision-granularity () 'repository) 43(defun vc-bzr-revision-granularity () 'repository)
44(defun vc-bzr-checkout-model (files) 'implicit) 44(defun vc-bzr-checkout-model (_files) 'implicit)
45 45
46;;; Code: 46;;; Code:
47 47
@@ -208,9 +208,9 @@ in the repository root directory of FILE."
208 ;; + working ( = packed_stat ) 208 ;; + working ( = packed_stat )
209 ;; parent = common ( as above ) + history ( = rev_id ) 209 ;; parent = common ( as above ) + history ( = rev_id )
210 ;; kinds = (r)elocated, (a)bsent, (d)irectory, (f)ile, (l)ink 210 ;; kinds = (r)elocated, (a)bsent, (d)irectory, (f)ile, (l)ink
211 (lexical-let ((root (vc-bzr-root file))) 211 (let ((root (vc-bzr-root file)))
212 (when root ; Short cut. 212 (when root ; Short cut.
213 (lexical-let ((dirstate (expand-file-name vc-bzr-admin-dirstate root))) 213 (let ((dirstate (expand-file-name vc-bzr-admin-dirstate root)))
214 (condition-case nil 214 (condition-case nil
215 (with-temp-buffer 215 (with-temp-buffer
216 (insert-file-contents dirstate) 216 (insert-file-contents dirstate)
@@ -303,9 +303,8 @@ in the repository root directory of FILE."
303 303
304(defun vc-bzr-file-name-relative (filename) 304(defun vc-bzr-file-name-relative (filename)
305 "Return file name FILENAME stripped of the initial Bzr repository path." 305 "Return file name FILENAME stripped of the initial Bzr repository path."
306 (lexical-let* 306 (let* ((filename* (expand-file-name filename))
307 ((filename* (expand-file-name filename)) 307 (rootdir (vc-bzr-root filename*)))
308 (rootdir (vc-bzr-root filename*)))
309 (when rootdir 308 (when rootdir
310 (file-relative-name filename* rootdir)))) 309 (file-relative-name filename* rootdir))))
311 310
@@ -412,9 +411,8 @@ in the branch repository (or whose status not be determined)."
412 (with-temp-buffer 411 (with-temp-buffer
413 ;; This is with-demoted-errors without the condition-case-unless-debug 412 ;; This is with-demoted-errors without the condition-case-unless-debug
414 ;; annoyance, which makes it fail during ert testing. 413 ;; annoyance, which makes it fail during ert testing.
415 (let (err) 414 (condition-case err (vc-bzr-command "status" t 0 file)
416 (condition-case err (vc-bzr-command "status" t 0 file) 415 (error (message "Error: %S" err) nil))
417 (error (message "Error: %S" err) nil)))
418 (let ((status 'unchanged)) 416 (let ((status 'unchanged))
419 ;; the only secure status indication in `bzr status' output 417 ;; the only secure status indication in `bzr status' output
420 ;; is a couple of lines following the pattern:: 418 ;; is a couple of lines following the pattern::
@@ -433,7 +431,7 @@ in the branch repository (or whose status not be determined)."
433 (if (file-directory-p file) "/?" "\\*?") 431 (if (file-directory-p file) "/?" "\\*?")
434 "[ \t\n]*$") 432 "[ \t\n]*$")
435 nil t) 433 nil t)
436 (lexical-let ((statusword (match-string 1))) 434 (let ((statusword (match-string 1)))
437 ;; Erase the status text that matched. 435 ;; Erase the status text that matched.
438 (delete-region (match-beginning 0) (match-end 0)) 436 (delete-region (match-beginning 0) (match-end 0))
439 (setq status 437 (setq status
@@ -452,7 +450,7 @@ in the branch repository (or whose status not be determined)."
452 (unless (eobp) (buffer-substring (point) (point-max)))))))) 450 (unless (eobp) (buffer-substring (point) (point-max))))))))
453 451
454(defun vc-bzr-state (file) 452(defun vc-bzr-state (file)
455 (lexical-let ((result (vc-bzr-status file))) 453 (let ((result (vc-bzr-status file)))
456 (when (consp result) 454 (when (consp result)
457 (let ((warnings (cdr result))) 455 (let ((warnings (cdr result)))
458 (when warnings 456 (when warnings
@@ -504,16 +502,15 @@ in the branch repository (or whose status not be determined)."
504(defun vc-bzr-working-revision (file) 502(defun vc-bzr-working-revision (file)
505 ;; Together with the code in vc-state-heuristic, this makes it possible 503 ;; Together with the code in vc-state-heuristic, this makes it possible
506 ;; to get the initial VC state of a Bzr file even if Bzr is not installed. 504 ;; to get the initial VC state of a Bzr file even if Bzr is not installed.
507 (lexical-let* 505 (let* ((rootdir (vc-bzr-root file))
508 ((rootdir (vc-bzr-root file)) 506 (branch-format-file (expand-file-name vc-bzr-admin-branch-format-file
509 (branch-format-file (expand-file-name vc-bzr-admin-branch-format-file 507 rootdir))
510 rootdir)) 508 (revhistory-file (expand-file-name vc-bzr-admin-revhistory rootdir))
511 (revhistory-file (expand-file-name vc-bzr-admin-revhistory rootdir)) 509 (lastrev-file (expand-file-name vc-bzr-admin-lastrev rootdir)))
512 (lastrev-file (expand-file-name vc-bzr-admin-lastrev rootdir)))
513 ;; This looks at internal files to avoid forking a bzr process. 510 ;; This looks at internal files to avoid forking a bzr process.
514 ;; May break if they change their format. 511 ;; May break if they change their format.
515 (if (and (file-exists-p branch-format-file) 512 (if (and (file-exists-p branch-format-file)
516 ;; For lightweight checkouts (obtained with bzr checkout --lightweight) 513 ;; For lightweight checkouts (obtained with bzr co --lightweight)
517 ;; the branch-format-file does not contain the revision 514 ;; the branch-format-file does not contain the revision
518 ;; information, we need to look up the branch-format-file 515 ;; information, we need to look up the branch-format-file
519 ;; in the place where the lightweight checkout comes 516 ;; in the place where the lightweight checkout comes
@@ -532,17 +529,21 @@ in the branch repository (or whose status not be determined)."
532 (when (re-search-forward "file://\\(.+\\)" nil t) 529 (when (re-search-forward "file://\\(.+\\)" nil t)
533 (let ((l-c-parent-dir (match-string 1))) 530 (let ((l-c-parent-dir (match-string 1)))
534 (when (and (memq system-type '(ms-dos windows-nt)) 531 (when (and (memq system-type '(ms-dos windows-nt))
535 (string-match-p "^/[[:alpha:]]:" l-c-parent-dir)) 532 (string-match-p "^/[[:alpha:]]:"
536 ;;; The non-Windows code takes a shortcut by using the host/path 533 l-c-parent-dir))
537 ;;; separator slash as the start of the absolute path. That 534 ;;; The non-Windows code takes a shortcut by using
538 ;;; does not work on Windows, so we must remove it (bug#5345) 535 ;;; the host/path separator slash as the start of
536 ;;; the absolute path. That does not work on
537 ;;; Windows, so we must remove it (bug#5345)
539 (setq l-c-parent-dir (substring l-c-parent-dir 1))) 538 (setq l-c-parent-dir (substring l-c-parent-dir 1)))
540 (setq branch-format-file 539 (setq branch-format-file
541 (expand-file-name vc-bzr-admin-branch-format-file 540 (expand-file-name vc-bzr-admin-branch-format-file
542 l-c-parent-dir)) 541 l-c-parent-dir))
543 (setq lastrev-file 542 (setq lastrev-file
544 (expand-file-name vc-bzr-admin-lastrev l-c-parent-dir)) 543 (expand-file-name vc-bzr-admin-lastrev
545 ;; FIXME: maybe it's overkill to check if both these files exist. 544 l-c-parent-dir))
545 ;; FIXME: maybe it's overkill to check if both these
546 ;; files exist.
546 (and (file-exists-p branch-format-file) 547 (and (file-exists-p branch-format-file)
547 (file-exists-p lastrev-file))))) 548 (file-exists-p lastrev-file)))))
548 t))) 549 t)))
@@ -564,11 +565,10 @@ in the branch repository (or whose status not be determined)."
564 (when (re-search-forward "[0-9]+" nil t) 565 (when (re-search-forward "[0-9]+" nil t)
565 (buffer-substring (match-beginning 0) (match-end 0)))))) 566 (buffer-substring (match-beginning 0) (match-end 0))))))
566 ;; fallback to calling "bzr revno" 567 ;; fallback to calling "bzr revno"
567 (lexical-let* 568 (let* ((result (vc-bzr-command-discarding-stderr
568 ((result (vc-bzr-command-discarding-stderr 569 vc-bzr-program "revno" (file-relative-name file)))
569 vc-bzr-program "revno" (file-relative-name file))) 570 (exitcode (car result))
570 (exitcode (car result)) 571 (output (cdr result)))
571 (output (cdr result)))
572 (cond 572 (cond
573 ((eq exitcode 0) (substring output 0 -1)) 573 ((eq exitcode 0) (substring output 0 -1))
574 (t nil)))))) 574 (t nil))))))
@@ -577,21 +577,21 @@ in the branch repository (or whose status not be determined)."
577 "Create a new Bzr repository." 577 "Create a new Bzr repository."
578 (vc-bzr-command "init" nil 0 nil)) 578 (vc-bzr-command "init" nil 0 nil))
579 579
580(defun vc-bzr-init-revision (&optional file) 580(defun vc-bzr-init-revision (&optional _file)
581 "Always return nil, as Bzr cannot register explicit versions." 581 "Always return nil, as Bzr cannot register explicit versions."
582 nil) 582 nil)
583 583
584(defun vc-bzr-previous-revision (file rev) 584(defun vc-bzr-previous-revision (_file rev)
585 (if (string-match "\\`[0-9]+\\'" rev) 585 (if (string-match "\\`[0-9]+\\'" rev)
586 (number-to-string (1- (string-to-number rev))) 586 (number-to-string (1- (string-to-number rev)))
587 (concat "before:" rev))) 587 (concat "before:" rev)))
588 588
589(defun vc-bzr-next-revision (file rev) 589(defun vc-bzr-next-revision (_file rev)
590 (if (string-match "\\`[0-9]+\\'" rev) 590 (if (string-match "\\`[0-9]+\\'" rev)
591 (number-to-string (1+ (string-to-number rev))) 591 (number-to-string (1+ (string-to-number rev)))
592 (error "Don't know how to compute the next revision of %s" rev))) 592 (error "Don't know how to compute the next revision of %s" rev)))
593 593
594(defun vc-bzr-register (files &optional rev comment) 594(defun vc-bzr-register (files &optional rev _comment)
595 "Register FILES under bzr. 595 "Register FILES under bzr.
596Signal an error unless REV is nil. 596Signal an error unless REV is nil.
597COMMENT is ignored." 597COMMENT is ignored."
@@ -640,7 +640,7 @@ REV non-nil gets an error."
640 (vc-bzr-command "cat" t 0 file "-r" rev) 640 (vc-bzr-command "cat" t 0 file "-r" rev)
641 (vc-bzr-command "cat" t 0 file)))) 641 (vc-bzr-command "cat" t 0 file))))
642 642
643(defun vc-bzr-checkout (file &optional editable rev) 643(defun vc-bzr-checkout (_file &optional _editable rev)
644 (if rev (error "Operation not supported") 644 (if rev (error "Operation not supported")
645 ;; Else, there's nothing to do. 645 ;; Else, there's nothing to do.
646 nil)) 646 nil))
@@ -791,7 +791,7 @@ Each line is tagged with the revision number, which has a `help-echo'
791property containing author and date information." 791property containing author and date information."
792 (apply #'vc-bzr-command "annotate" buffer 'async file "--long" "--all" 792 (apply #'vc-bzr-command "annotate" buffer 'async file "--long" "--all"
793 (if revision (list "-r" revision))) 793 (if revision (list "-r" revision)))
794 (lexical-let ((table (make-hash-table :test 'equal))) 794 (let ((table (make-hash-table :test 'equal)))
795 (set-process-filter 795 (set-process-filter
796 (get-buffer-process buffer) 796 (get-buffer-process buffer)
797 (lambda (proc string) 797 (lambda (proc string)
@@ -956,7 +956,7 @@ stream. Standard error output is discarded."
956 ;; frob the results accordingly. 956 ;; frob the results accordingly.
957 (file-relative-name ,dir (vc-bzr-root ,dir))))) 957 (file-relative-name ,dir (vc-bzr-root ,dir)))))
958 958
959(defun vc-bzr-dir-status-files (dir files default-state update-function) 959(defun vc-bzr-dir-status-files (dir files _default-state update-function)
960 "Return a list of conses (file . state) for DIR." 960 "Return a list of conses (file . state) for DIR."
961 (apply 'vc-bzr-command "status" (current-buffer) 'async dir "-v" "-S" files) 961 (apply 'vc-bzr-command "status" (current-buffer) 'async dir "-v" "-S" files)
962 (vc-exec-after 962 (vc-exec-after
@@ -1193,74 +1193,73 @@ stream. Standard error output is discarded."
1193 "revno" "submit" "tag"))) 1193 "revno" "submit" "tag")))
1194 1194
1195(defun vc-bzr-revision-completion-table (files) 1195(defun vc-bzr-revision-completion-table (files)
1196 (lexical-let ((files files)) 1196 ;; What about using `files'?!? --Stef
1197 ;; What about using `files'?!? --Stef 1197 (lambda (string pred action)
1198 (lambda (string pred action) 1198 (cond
1199 (cond 1199 ((string-match "\\`\\(ancestor\\|branch\\|\\(revno:\\)?[-0-9]+:\\):"
1200 ((string-match "\\`\\(ancestor\\|branch\\|\\(revno:\\)?[-0-9]+:\\):" 1200 string)
1201 string) 1201 (completion-table-with-context (substring string 0 (match-end 0))
1202 (completion-table-with-context (substring string 0 (match-end 0)) 1202 (apply-partially
1203 (apply-partially 1203 'completion-table-with-predicate
1204 'completion-table-with-predicate 1204 'completion-file-name-table
1205 'completion-file-name-table 1205 'file-directory-p t)
1206 'file-directory-p t) 1206 (substring string (match-end 0))
1207 (substring string (match-end 0)) 1207 pred
1208 pred 1208 action))
1209 action)) 1209 ((string-match "\\`\\(before\\):" string)
1210 ((string-match "\\`\\(before\\):" string) 1210 (completion-table-with-context (substring string 0 (match-end 0))
1211 (completion-table-with-context (substring string 0 (match-end 0)) 1211 (vc-bzr-revision-completion-table files)
1212 (vc-bzr-revision-completion-table files) 1212 (substring string (match-end 0))
1213 (substring string (match-end 0)) 1213 pred
1214 pred 1214 action))
1215 action)) 1215 ((string-match "\\`\\(tag\\):" string)
1216 ((string-match "\\`\\(tag\\):" string) 1216 (let ((prefix (substring string 0 (match-end 0)))
1217 (let ((prefix (substring string 0 (match-end 0))) 1217 (tag (substring string (match-end 0)))
1218 (tag (substring string (match-end 0))) 1218 (table nil)
1219 (table nil) 1219 process-file-side-effects)
1220 process-file-side-effects) 1220 (with-temp-buffer
1221 (with-temp-buffer 1221 ;; "bzr-1.2 tags" is much faster with --show-ids.
1222 ;; "bzr-1.2 tags" is much faster with --show-ids. 1222 (process-file vc-bzr-program nil '(t) nil "tags" "--show-ids")
1223 (process-file vc-bzr-program nil '(t) nil "tags" "--show-ids") 1223 ;; The output is ambiguous, unless we assume that revids do not
1224 ;; The output is ambiguous, unless we assume that revids do not 1224 ;; contain spaces.
1225 ;; contain spaces. 1225 (goto-char (point-min))
1226 (goto-char (point-min)) 1226 (while (re-search-forward "^\\(.*[^ \n]\\) +[^ \n]*$" nil t)
1227 (while (re-search-forward "^\\(.*[^ \n]\\) +[^ \n]*$" nil t) 1227 (push (match-string-no-properties 1) table)))
1228 (push (match-string-no-properties 1) table))) 1228 (completion-table-with-context prefix table tag pred action)))
1229 (completion-table-with-context prefix table tag pred action))) 1229
1230 1230 ((string-match "\\`annotate:" string)
1231 ((string-match "\\`annotate:" string) 1231 (completion-table-with-context
1232 (completion-table-with-context 1232 (substring string 0 (match-end 0))
1233 (substring string 0 (match-end 0)) 1233 (apply-partially #'completion-table-with-terminator '(":" . "\\`a\\`")
1234 (apply-partially #'completion-table-with-terminator '(":" . "\\`a\\`") 1234 #'completion-file-name-table)
1235 #'completion-file-name-table) 1235 (substring string (match-end 0)) pred action))
1236 (substring string (match-end 0)) pred action)) 1236
1237 1237 ((string-match "\\`date:" string)
1238 ((string-match "\\`date:" string) 1238 (completion-table-with-context
1239 (completion-table-with-context 1239 (substring string 0 (match-end 0))
1240 (substring string 0 (match-end 0)) 1240 '("yesterday" "today" "tomorrow")
1241 '("yesterday" "today" "tomorrow") 1241 (substring string (match-end 0)) pred action))
1242 (substring string (match-end 0)) pred action)) 1242
1243 1243 ((string-match "\\`\\([a-z]+\\):" string)
1244 ((string-match "\\`\\([a-z]+\\):" string) 1244 ;; no actual completion for the remaining keywords.
1245 ;; no actual completion for the remaining keywords. 1245 (completion-table-with-context (substring string 0 (match-end 0))
1246 (completion-table-with-context (substring string 0 (match-end 0)) 1246 (if (member (match-string 1 string)
1247 (if (member (match-string 1 string) 1247 vc-bzr-revision-keywords)
1248 vc-bzr-revision-keywords) 1248 ;; If it's a valid keyword,
1249 ;; If it's a valid keyword, 1249 ;; use a non-empty table to
1250 ;; use a non-empty table to 1250 ;; indicate it.
1251 ;; indicate it. 1251 '("") nil)
1252 '("") nil) 1252 (substring string (match-end 0))
1253 (substring string (match-end 0)) 1253 pred
1254 pred 1254 action))
1255 action)) 1255 (t
1256 (t 1256 ;; Could use completion-table-with-terminator, except that it
1257 ;; Could use completion-table-with-terminator, except that it 1257 ;; currently doesn't work right w.r.t pcm and doesn't give
1258 ;; currently doesn't work right w.r.t pcm and doesn't give 1258 ;; the *Completions* output we want.
1259 ;; the *Completions* output we want. 1259 (complete-with-action action (eval-when-compile
1260 (complete-with-action action (eval-when-compile 1260 (mapcar (lambda (s) (concat s ":"))
1261 (mapcar (lambda (s) (concat s ":")) 1261 vc-bzr-revision-keywords))
1262 vc-bzr-revision-keywords)) 1262 string pred)))))
1263 string pred))))))
1264 1263
1265(provide 'vc-bzr) 1264(provide 'vc-bzr)
1266 1265
diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el
index 2d8d132a249..4d06e766a35 100644
--- a/lisp/vc/vc-cvs.el
+++ b/lisp/vc/vc-cvs.el
@@ -1,4 +1,4 @@
1;;; vc-cvs.el --- non-resident support for CVS version-control 1;;; vc-cvs.el --- non-resident support for CVS version-control -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 1995, 1998-2012 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 1998-2012 Free Software Foundation, Inc.
4 4
@@ -280,7 +280,7 @@ committed and support display of sticky tags."
280;;; State-changing functions 280;;; State-changing functions
281;;; 281;;;
282 282
283(defun vc-cvs-register (files &optional rev comment) 283(defun vc-cvs-register (files &optional _rev comment)
284 "Register FILES into the CVS version-control system. 284 "Register FILES into the CVS version-control system.
285COMMENT can be used to provide an initial description of FILES. 285COMMENT can be used to provide an initial description of FILES.
286Passes either `vc-cvs-register-switches' or `vc-register-switches' 286Passes either `vc-cvs-register-switches' or `vc-register-switches'
@@ -502,7 +502,7 @@ Will fail unless you have administrative privileges on the repo."
502 502
503(declare-function vc-rcs-print-log-cleanup "vc-rcs" ()) 503(declare-function vc-rcs-print-log-cleanup "vc-rcs" ())
504 504
505(defun vc-cvs-print-log (files buffer &optional shortlog start-revision-ignored limit) 505(defun vc-cvs-print-log (files buffer &optional _shortlog _start-revision limit)
506 "Get change logs associated with FILES." 506 "Get change logs associated with FILES."
507 (require 'vc-rcs) 507 (require 'vc-rcs)
508 ;; It's just the catenation of the individual logs. 508 ;; It's just the catenation of the individual logs.
@@ -1006,7 +1006,7 @@ state."
1006 (vc-exec-after 1006 (vc-exec-after
1007 `(vc-cvs-after-dir-status (quote ,update-function)))))) 1007 `(vc-cvs-after-dir-status (quote ,update-function))))))
1008 1008
1009(defun vc-cvs-dir-status-files (dir files default-state update-function) 1009(defun vc-cvs-dir-status-files (dir files _default-state update-function)
1010 "Create a list of conses (file . state) for DIR." 1010 "Create a list of conses (file . state) for DIR."
1011 (apply 'vc-cvs-command (current-buffer) 'async dir "-f" "status" files) 1011 (apply 'vc-cvs-command (current-buffer) 'async dir "-f" "status" files)
1012 (vc-exec-after 1012 (vc-exec-after
@@ -1021,7 +1021,7 @@ state."
1021 (buffer-substring (point) (point-max))) 1021 (buffer-substring (point) (point-max)))
1022 (file-error nil))) 1022 (file-error nil)))
1023 1023
1024(defun vc-cvs-dir-extra-headers (dir) 1024(defun vc-cvs-dir-extra-headers (_dir)
1025 "Extract and represent per-directory properties of a CVS working copy." 1025 "Extract and represent per-directory properties of a CVS working copy."
1026 (let ((repo 1026 (let ((repo
1027 (condition-case nil 1027 (condition-case nil
@@ -1206,10 +1206,8 @@ is non-nil."
1206 res))) 1206 res)))
1207 1207
1208(defun vc-cvs-revision-completion-table (files) 1208(defun vc-cvs-revision-completion-table (files)
1209 (lexical-let ((files files) 1209 (letrec ((table (lazy-completion-table
1210 table) 1210 table (lambda () (vc-cvs-revision-table (car files))))))
1211 (setq table (lazy-completion-table
1212 table (lambda () (vc-cvs-revision-table (car files)))))
1213 table)) 1211 table))
1214 1212
1215 1213
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index 4c32eea2f72..acb1a4d8862 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -1,4 +1,4 @@
1;;; vc-dir.el --- Directory status display under VC 1;;; vc-dir.el --- Directory status display under VC -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 2007-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2007-2012 Free Software Foundation, Inc.
4 4
@@ -529,7 +529,7 @@ If a prefix argument is given, move by that many lines."
529 529
530(defun vc-dir-mark-unmark (mark-unmark-function) 530(defun vc-dir-mark-unmark (mark-unmark-function)
531 (if (use-region-p) 531 (if (use-region-p)
532 (let ((firstl (line-number-at-pos (region-beginning))) 532 (let (;; (firstl (line-number-at-pos (region-beginning)))
533 (lastl (line-number-at-pos (region-end)))) 533 (lastl (line-number-at-pos (region-end))))
534 (save-excursion 534 (save-excursion
535 (goto-char (region-beginning)) 535 (goto-char (region-beginning))
@@ -546,7 +546,7 @@ If a prefix argument is given, move by that many lines."
546 ;; Non-nil iff a parent directory of arg is marked. 546 ;; Non-nil iff a parent directory of arg is marked.
547 ;; Return value, if non-nil is the `ewoc-data' for the marked parent. 547 ;; Return value, if non-nil is the `ewoc-data' for the marked parent.
548 (let* ((argdir (vc-dir-node-directory arg)) 548 (let* ((argdir (vc-dir-node-directory arg))
549 (arglen (length argdir)) 549 ;; (arglen (length argdir))
550 (crt arg) 550 (crt arg)
551 (found nil)) 551 (found nil))
552 ;; Go through the predecessors, checking if any directory that is 552 ;; Go through the predecessors, checking if any directory that is
@@ -814,7 +814,7 @@ child files."
814 ;; FIXME: use vc-dir-child-files-and-states here instead of duplicating it. 814 ;; FIXME: use vc-dir-child-files-and-states here instead of duplicating it.
815 (if (vc-dir-fileinfo->directory crt-data) 815 (if (vc-dir-fileinfo->directory crt-data)
816 (let* ((dir (vc-dir-fileinfo->directory crt-data)) 816 (let* ((dir (vc-dir-fileinfo->directory crt-data))
817 (dirlen (length dir)) 817 ;; (dirlen (length dir))
818 data) 818 data)
819 (while 819 (while
820 (and (setq crt (ewoc-next vc-ewoc crt)) 820 (and (setq crt (ewoc-next vc-ewoc crt))
@@ -842,7 +842,7 @@ If it is a file, return the corresponding cons for the file itself."
842 result) 842 result)
843 (if (vc-dir-fileinfo->directory crt-data) 843 (if (vc-dir-fileinfo->directory crt-data)
844 (let* ((dir (vc-dir-fileinfo->directory crt-data)) 844 (let* ((dir (vc-dir-fileinfo->directory crt-data))
845 (dirlen (length dir)) 845 ;; (dirlen (length dir))
846 data) 846 data)
847 (while 847 (while
848 (and (setq crt (ewoc-next vc-ewoc crt)) 848 (and (setq crt (ewoc-next vc-ewoc crt))
@@ -861,7 +861,7 @@ If it is a file, return the corresponding cons for the file itself."
861 861
862(defun vc-dir-recompute-file-state (fname def-dir) 862(defun vc-dir-recompute-file-state (fname def-dir)
863 (let* ((file-short (file-relative-name fname def-dir)) 863 (let* ((file-short (file-relative-name fname def-dir))
864 (remove-me-when-CVS-works 864 (_remove-me-when-CVS-works
865 (when (eq vc-dir-backend 'CVS) 865 (when (eq vc-dir-backend 'CVS)
866 ;; FIXME: Warning: UGLY HACK. The CVS backend caches the state 866 ;; FIXME: Warning: UGLY HACK. The CVS backend caches the state
867 ;; info, this forces the backend to update it. 867 ;; info, this forces the backend to update it.
@@ -875,15 +875,14 @@ If it is a file, return the corresponding cons for the file itself."
875 ;; Give a DIRNAME string return the list of all child files shown in 875 ;; Give a DIRNAME string return the list of all child files shown in
876 ;; the current *vc-dir* buffer. 876 ;; the current *vc-dir* buffer.
877 (let ((crt (ewoc-nth vc-ewoc 0)) 877 (let ((crt (ewoc-nth vc-ewoc 0))
878 children 878 children)
879 dname)
880 ;; Find DIR 879 ;; Find DIR
881 (while (and crt (not (string-prefix-p 880 (while (and crt (not (string-prefix-p
882 dirname (vc-dir-node-directory crt)))) 881 dirname (vc-dir-node-directory crt))))
883 (setq crt (ewoc-next vc-ewoc crt))) 882 (setq crt (ewoc-next vc-ewoc crt)))
884 (while (and crt (string-prefix-p 883 (while (and crt (string-prefix-p
885 dirname 884 dirname
886 (setq dname (vc-dir-node-directory crt)))) 885 (vc-dir-node-directory crt)))
887 (let ((data (ewoc-data crt))) 886 (let ((data (ewoc-data crt)))
888 (unless (vc-dir-fileinfo->directory data) 887 (unless (vc-dir-fileinfo->directory data)
889 (push (expand-file-name (vc-dir-fileinfo->name data)) children))) 888 (push (expand-file-name (vc-dir-fileinfo->name data)) children)))
@@ -1014,7 +1013,7 @@ specific headers."
1014 (unless (buffer-live-p vc-dir-process-buffer) 1013 (unless (buffer-live-p vc-dir-process-buffer)
1015 (setq vc-dir-process-buffer 1014 (setq vc-dir-process-buffer
1016 (generate-new-buffer (format " *VC-%s* tmp status" backend)))) 1015 (generate-new-buffer (format " *VC-%s* tmp status" backend))))
1017 (lexical-let ((buffer (current-buffer))) 1016 (let ((buffer (current-buffer)))
1018 (with-current-buffer vc-dir-process-buffer 1017 (with-current-buffer vc-dir-process-buffer
1019 (setq default-directory def-dir) 1018 (setq default-directory def-dir)
1020 (erase-buffer) 1019 (erase-buffer)
@@ -1045,7 +1044,7 @@ specific headers."
1045 1044
1046 (not (vc-dir-fileinfo->needs-update info)))))))))))) 1045 (not (vc-dir-fileinfo->needs-update info))))))))))))
1047 1046
1048(defun vc-dir-revert-buffer-function (&optional ignore-auto noconfirm) 1047(defun vc-dir-revert-buffer-function (&optional _ignore-auto _noconfirm)
1049 (vc-dir-refresh)) 1048 (vc-dir-refresh))
1050 1049
1051(defun vc-dir-refresh () 1050(defun vc-dir-refresh ()
@@ -1079,7 +1078,7 @@ Throw an error if another update process is in progress."
1079 ;; Bzr has serious locking problems, so setup the headers first (this is 1078 ;; Bzr has serious locking problems, so setup the headers first (this is
1080 ;; synchronous) rather than doing it while dir-status is running. 1079 ;; synchronous) rather than doing it while dir-status is running.
1081 (ewoc-set-hf vc-ewoc (vc-dir-headers backend def-dir) "") 1080 (ewoc-set-hf vc-ewoc (vc-dir-headers backend def-dir) "")
1082 (lexical-let ((buffer (current-buffer))) 1081 (let ((buffer (current-buffer)))
1083 (with-current-buffer vc-dir-process-buffer 1082 (with-current-buffer vc-dir-process-buffer
1084 (setq default-directory def-dir) 1083 (setq default-directory def-dir)
1085 (erase-buffer) 1084 (erase-buffer)
@@ -1219,7 +1218,7 @@ These are the commands available for use in the file status buffer:
1219 (let ((use-vc-backend backend)) 1218 (let ((use-vc-backend backend))
1220 (vc-dir-mode)))) 1219 (vc-dir-mode))))
1221 1220
1222(defun vc-default-dir-extra-headers (backend dir) 1221(defun vc-default-dir-extra-headers (_backend _dir)
1223 ;; Be loud by default to remind people to add code to display 1222 ;; Be loud by default to remind people to add code to display
1224 ;; backend specific headers. 1223 ;; backend specific headers.
1225 ;; XXX: change this to return nil before the release. 1224 ;; XXX: change this to return nil before the release.
@@ -1234,7 +1233,7 @@ These are the commands available for use in the file status buffer:
1234 map) 1233 map)
1235 "Local keymap for visiting a file.") 1234 "Local keymap for visiting a file.")
1236 1235
1237(defun vc-default-dir-printer (backend fileentry) 1236(defun vc-default-dir-printer (_backend fileentry)
1238 "Pretty print FILEENTRY." 1237 "Pretty print FILEENTRY."
1239 ;; If you change the layout here, change vc-dir-move-to-goal-column. 1238 ;; If you change the layout here, change vc-dir-move-to-goal-column.
1240 ;; VC backends can implement backend specific versions of this 1239 ;; VC backends can implement backend specific versions of this
@@ -1267,10 +1266,10 @@ These are the commands available for use in the file status buffer:
1267 'mouse-face 'highlight 1266 'mouse-face 'highlight
1268 'keymap vc-dir-filename-mouse-map)))) 1267 'keymap vc-dir-filename-mouse-map))))
1269 1268
1270(defun vc-default-extra-status-menu (backend) 1269(defun vc-default-extra-status-menu (_backend)
1271 nil) 1270 nil)
1272 1271
1273(defun vc-default-status-fileinfo-extra (backend file) 1272(defun vc-default-status-fileinfo-extra (_backend _file)
1274 "Default absence of extra information returned for a file." 1273 "Default absence of extra information returned for a file."
1275 nil) 1274 nil)
1276 1275
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index b71dc95dba2..c185c4e8fab 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1,4 +1,4 @@
1;;; vc-git.el --- VC backend for the git version control system 1;;; vc-git.el --- VC backend for the git version control system -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 2006-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2006-2012 Free Software Foundation, Inc.
4 4
@@ -160,7 +160,7 @@ matching the resulting Git log output, and KEYWORDS is a list of
160;;; BACKEND PROPERTIES 160;;; BACKEND PROPERTIES
161 161
162(defun vc-git-revision-granularity () 'repository) 162(defun vc-git-revision-granularity () 'repository)
163(defun vc-git-checkout-model (files) 'implicit) 163(defun vc-git-checkout-model (_files) 'implicit)
164 164
165;;; STATE-QUERYING FUNCTIONS 165;;; STATE-QUERYING FUNCTIONS
166 166
@@ -233,7 +233,7 @@ matching the resulting Git log output, and KEYWORDS is a list of
233 (vc-git--state-code diff-letter))) 233 (vc-git--state-code diff-letter)))
234 (if (vc-git--empty-db-p) 'added 'up-to-date))))) 234 (if (vc-git--empty-db-p) 'added 'up-to-date)))))
235 235
236(defun vc-git-working-revision (file) 236(defun vc-git-working-revision (_file)
237 "Git-specific version of `vc-working-revision'." 237 "Git-specific version of `vc-working-revision'."
238 (let* (process-file-side-effects 238 (let* (process-file-side-effects
239 (str (with-output-to-string 239 (str (with-output-to-string
@@ -471,14 +471,14 @@ or an empty string if none."
471 (vc-exec-after 471 (vc-exec-after
472 `(vc-git-after-dir-status-stage ',stage ',files ',update-function))) 472 `(vc-git-after-dir-status-stage ',stage ',files ',update-function)))
473 473
474(defun vc-git-dir-status (dir update-function) 474(defun vc-git-dir-status (_dir update-function)
475 "Return a list of (FILE STATE EXTRA) entries for DIR." 475 "Return a list of (FILE STATE EXTRA) entries for DIR."
476 ;; Further things that would have to be fixed later: 476 ;; Further things that would have to be fixed later:
477 ;; - how to handle unregistered directories 477 ;; - how to handle unregistered directories
478 ;; - how to support vc-dir on a subdir of the project tree 478 ;; - how to support vc-dir on a subdir of the project tree
479 (vc-git-dir-status-goto-stage 'update-index nil update-function)) 479 (vc-git-dir-status-goto-stage 'update-index nil update-function))
480 480
481(defun vc-git-dir-status-files (dir files default-state update-function) 481(defun vc-git-dir-status-files (_dir files _default-state update-function)
482 "Return a list of (FILE STATE EXTRA) entries for FILES in DIR." 482 "Return a list of (FILE STATE EXTRA) entries for FILES in DIR."
483 (vc-git-dir-status-goto-stage 'update-index files update-function)) 483 (vc-git-dir-status-goto-stage 'update-index files update-function))
484 484
@@ -512,7 +512,7 @@ or an empty string if none."
512 :help "Show the contents of the current stash")) 512 :help "Show the contents of the current stash"))
513 map)) 513 map))
514 514
515(defun vc-git-dir-extra-headers (dir) 515(defun vc-git-dir-extra-headers (_dir)
516 (let ((str (with-output-to-string 516 (let ((str (with-output-to-string
517 (with-current-buffer standard-output 517 (with-current-buffer standard-output
518 (vc-git--out-ok "symbolic-ref" "HEAD")))) 518 (vc-git--out-ok "symbolic-ref" "HEAD"))))
@@ -590,7 +590,7 @@ The car of the list is the current branch."
590 "Create a new Git repository." 590 "Create a new Git repository."
591 (vc-git-command nil 0 nil "init")) 591 (vc-git-command nil 0 nil "init"))
592 592
593(defun vc-git-register (files &optional rev comment) 593(defun vc-git-register (files &optional _rev _comment)
594 "Register FILES into the git version-control system." 594 "Register FILES into the git version-control system."
595 (let (flist dlist) 595 (let (flist dlist)
596 (dolist (crt files) 596 (dolist (crt files)
@@ -609,7 +609,7 @@ The car of the list is the current branch."
609 609
610(declare-function log-edit-extract-headers "log-edit" (headers string)) 610(declare-function log-edit-extract-headers "log-edit" (headers string))
611 611
612(defun vc-git-checkin (files rev comment) 612(defun vc-git-checkin (files _rev comment)
613 (let ((coding-system-for-write vc-git-commits-coding-system)) 613 (let ((coding-system-for-write vc-git-commits-coding-system))
614 (apply 'vc-git-command nil 0 files 614 (apply 'vc-git-command nil 0 files
615 (nconc (list "commit" "-m") 615 (nconc (list "commit" "-m")
@@ -635,7 +635,7 @@ The car of the list is the current branch."
635 nil 635 nil
636 "cat-file" "blob" (concat (if rev rev "HEAD") ":" fullname)))) 636 "cat-file" "blob" (concat (if rev rev "HEAD") ":" fullname))))
637 637
638(defun vc-git-checkout (file &optional editable rev) 638(defun vc-git-checkout (file &optional _editable rev)
639 (vc-git-command nil 0 file "checkout" (or rev "HEAD"))) 639 (vc-git-command nil 0 file "checkout" (or rev "HEAD")))
640 640
641(defun vc-git-revert (file &optional contents-done) 641(defun vc-git-revert (file &optional contents-done)
@@ -821,7 +821,7 @@ or BRANCH^ (where \"^\" can be repeated)."
821 (append (vc-switches 'git 'diff) 821 (append (vc-switches 'git 'diff)
822 (list "-p" (or rev1 "HEAD") rev2 "--"))))) 822 (list "-p" (or rev1 "HEAD") rev2 "--")))))
823 823
824(defun vc-git-revision-table (files) 824(defun vc-git-revision-table (_files)
825 ;; What about `files'?!? --Stef 825 ;; What about `files'?!? --Stef
826 (let (process-file-side-effects 826 (let (process-file-side-effects
827 (table (list "HEAD"))) 827 (table (list "HEAD")))
@@ -834,10 +834,8 @@ or BRANCH^ (where \"^\" can be repeated)."
834 table)) 834 table))
835 835
836(defun vc-git-revision-completion-table (files) 836(defun vc-git-revision-completion-table (files)
837 (lexical-let ((files files) 837 (letrec ((table (lazy-completion-table
838 table) 838 table (lambda () (vc-git-revision-table files)))))
839 (setq table (lazy-completion-table
840 table (lambda () (vc-git-revision-table files))))
841 table)) 839 table))
842 840
843(defun vc-git-annotate-command (file buf &optional rev) 841(defun vc-git-annotate-command (file buf &optional rev)
@@ -876,7 +874,7 @@ or BRANCH^ (where \"^\" can be repeated)."
876 (vc-git-command nil 0 nil "checkout" "-b" name) 874 (vc-git-command nil 0 nil "checkout" "-b" name)
877 (vc-git-command nil 0 nil "tag" name))))) 875 (vc-git-command nil 0 nil "tag" name)))))
878 876
879(defun vc-git-retrieve-tag (dir name update) 877(defun vc-git-retrieve-tag (dir name _update)
880 (let ((default-directory dir)) 878 (let ((default-directory dir))
881 (vc-git-command nil 0 nil "checkout" name) 879 (vc-git-command nil 0 nil "checkout" name)
882 ;; FIXME: update buffers if `update' is true 880 ;; FIXME: update buffers if `update' is true
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index a2728268816..e3af8a353ef 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -1,4 +1,4 @@
1;;; vc-hg.el --- VC backend for the mercurial version control system 1;;; vc-hg.el --- VC backend for the mercurial version control system -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 2006-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2006-2012 Free Software Foundation, Inc.
4 4
@@ -168,7 +168,7 @@ highlighting the Log View buffer."
168(defvar vc-hg-history nil) 168(defvar vc-hg-history nil)
169 169
170(defun vc-hg-revision-granularity () 'repository) 170(defun vc-hg-revision-granularity () 'repository)
171(defun vc-hg-checkout-model (files) 'implicit) 171(defun vc-hg-checkout-model (_files) 'implicit)
172 172
173;;; State querying functions 173;;; State querying functions
174 174
@@ -338,10 +338,8 @@ highlighting the Log View buffer."
338 338
339;; Modeled after the similar function in vc-cvs.el 339;; Modeled after the similar function in vc-cvs.el
340(defun vc-hg-revision-completion-table (files) 340(defun vc-hg-revision-completion-table (files)
341 (lexical-let ((files files) 341 (letrec ((table (lazy-completion-table
342 table) 342 table (lambda () (vc-hg-revision-table files)))))
343 (setq table (lazy-completion-table
344 table (lambda () (vc-hg-revision-table files))))
345 table)) 343 table))
346 344
347(defun vc-hg-annotate-command (file buffer &optional revision) 345(defun vc-hg-annotate-command (file buffer &optional revision)
@@ -377,12 +375,12 @@ Optional arg REVISION is a revision to annotate from."
377 (expand-file-name (match-string-no-properties 4) 375 (expand-file-name (match-string-no-properties 4)
378 (vc-hg-root default-directory))))))) 376 (vc-hg-root default-directory)))))))
379 377
380(defun vc-hg-previous-revision (file rev) 378(defun vc-hg-previous-revision (_file rev)
381 (let ((newrev (1- (string-to-number rev)))) 379 (let ((newrev (1- (string-to-number rev))))
382 (when (>= newrev 0) 380 (when (>= newrev 0)
383 (number-to-string newrev)))) 381 (number-to-string newrev))))
384 382
385(defun vc-hg-next-revision (file rev) 383(defun vc-hg-next-revision (_file rev)
386 (let ((newrev (1+ (string-to-number rev))) 384 (let ((newrev (1+ (string-to-number rev)))
387 (tip-revision 385 (tip-revision
388 (with-temp-buffer 386 (with-temp-buffer
@@ -408,7 +406,7 @@ Optional arg REVISION is a revision to annotate from."
408 "Rename file from OLD to NEW using `hg mv'." 406 "Rename file from OLD to NEW using `hg mv'."
409 (vc-hg-command nil 0 new "mv" old)) 407 (vc-hg-command nil 0 new "mv" old))
410 408
411(defun vc-hg-register (files &optional rev comment) 409(defun vc-hg-register (files &optional _rev _comment)
412 "Register FILES under hg. 410 "Register FILES under hg.
413REV is ignored. 411REV is ignored.
414COMMENT is ignored." 412COMMENT is ignored."
@@ -438,7 +436,7 @@ COMMENT is ignored."
438 436
439(declare-function log-edit-extract-headers "log-edit" (headers string)) 437(declare-function log-edit-extract-headers "log-edit" (headers string))
440 438
441(defun vc-hg-checkin (files rev comment) 439(defun vc-hg-checkin (files _rev comment)
442 "Hg-specific version of `vc-backend-checkin'. 440 "Hg-specific version of `vc-backend-checkin'.
443REV is ignored." 441REV is ignored."
444 (apply 'vc-hg-command nil 0 files 442 (apply 'vc-hg-command nil 0 files
@@ -455,7 +453,7 @@ REV is ignored."
455 (vc-hg-command buffer 0 file "cat")))) 453 (vc-hg-command buffer 0 file "cat"))))
456 454
457;; Modeled after the similar function in vc-bzr.el 455;; Modeled after the similar function in vc-bzr.el
458(defun vc-hg-checkout (file &optional editable rev) 456(defun vc-hg-checkout (file &optional _editable rev)
459 "Retrieve a revision of FILE. 457 "Retrieve a revision of FILE.
460EDITABLE is ignored. 458EDITABLE is ignored.
461REV is the revision to check out into WORKFILE." 459REV is the revision to check out into WORKFILE."
@@ -511,8 +509,7 @@ REV is the revision to check out into WORKFILE."
511 'face 'font-lock-comment-face))))) 509 'face 'font-lock-comment-face)))))
512 510
513(defun vc-hg-after-dir-status (update-function) 511(defun vc-hg-after-dir-status (update-function)
514 (let ((status-char nil) 512 (let ((file nil)
515 (file nil)
516 (translation '((?= . up-to-date) 513 (translation '((?= . up-to-date)
517 (?C . up-to-date) 514 (?C . up-to-date)
518 (?A . added) 515 (?A . added)
@@ -567,7 +564,7 @@ REV is the revision to check out into WORKFILE."
567 (vc-exec-after 564 (vc-exec-after
568 `(vc-hg-after-dir-status (quote ,update-function)))) 565 `(vc-hg-after-dir-status (quote ,update-function))))
569 566
570(defun vc-hg-dir-status-files (dir files default-state update-function) 567(defun vc-hg-dir-status-files (dir files _default-state update-function)
571 (apply 'vc-hg-command (current-buffer) 'async dir "status" "-C" files) 568 (apply 'vc-hg-command (current-buffer) 'async dir "status" "-C" files)
572 (vc-exec-after 569 (vc-exec-after
573 `(vc-hg-after-dir-status (quote ,update-function)))) 570 `(vc-hg-after-dir-status (quote ,update-function))))
diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el
index 122743c3747..bd3a6207b73 100644
--- a/lisp/vc/vc-mtn.el
+++ b/lisp/vc/vc-mtn.el
@@ -1,4 +1,4 @@
1;;; vc-mtn.el --- VC backend for Monotone 1;;; vc-mtn.el --- VC backend for Monotone -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 2007-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2007-2012 Free Software Foundation, Inc.
4 4
@@ -76,7 +76,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
76;;;###autoload (vc-mtn-registered file)))) 76;;;###autoload (vc-mtn-registered file))))
77 77
78(defun vc-mtn-revision-granularity () 'repository) 78(defun vc-mtn-revision-granularity () 'repository)
79(defun vc-mtn-checkout-model (files) 'implicit) 79(defun vc-mtn-checkout-model (_files) 'implicit)
80 80
81(defun vc-mtn-root (file) 81(defun vc-mtn-root (file)
82 (setq file (if (file-directory-p file) 82 (setq file (if (file-directory-p file)
@@ -173,7 +173,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
173 (t ?:)) 173 (t ?:))
174 branch))) 174 branch)))
175 175
176(defun vc-mtn-register (files &optional rev comment) 176(defun vc-mtn-register (files &optional _rev _comment)
177 (vc-mtn-command nil 0 files "add")) 177 (vc-mtn-command nil 0 files "add"))
178 178
179(defun vc-mtn-responsible-p (file) (vc-mtn-root file)) 179(defun vc-mtn-responsible-p (file) (vc-mtn-root file))
@@ -181,7 +181,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
181 181
182(declare-function log-edit-extract-headers "log-edit" (headers string)) 182(declare-function log-edit-extract-headers "log-edit" (headers string))
183 183
184(defun vc-mtn-checkin (files rev comment) 184(defun vc-mtn-checkin (files _rev comment)
185 (apply 'vc-mtn-command nil 0 files 185 (apply 'vc-mtn-command nil 0 files
186 (nconc (list "commit" "-m") 186 (nconc (list "commit" "-m")
187 (log-edit-extract-headers '(("Author" . "--author") 187 (log-edit-extract-headers '(("Author" . "--author")
@@ -201,7 +201,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
201;; (defun vc-mtn-rollback (files) 201;; (defun vc-mtn-rollback (files)
202;; ) 202;; )
203 203
204(defun vc-mtn-print-log (files buffer &optional shortlog start-revision limit) 204(defun vc-mtn-print-log (files buffer &optional _shortlog start-revision limit)
205 (apply 'vc-mtn-command buffer 0 files "log" 205 (apply 'vc-mtn-command buffer 0 files "log"
206 (append 206 (append
207 (when start-revision (list "--from" (format "%s" start-revision))) 207 (when start-revision (list "--from" (format "%s" start-revision)))
@@ -304,44 +304,43 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
304 (push (match-string 0) ids)) 304 (push (match-string 0) ids))
305 ids))) 305 ids)))
306 306
307(defun vc-mtn-revision-completion-table (files) 307(defun vc-mtn-revision-completion-table (_files)
308 ;; TODO: Implement completion for selectors 308 ;; TODO: Implement completion for selectors
309 ;; TODO: Implement completion for composite selectors. 309 ;; TODO: Implement completion for composite selectors.
310 (lexical-let ((files files)) 310 ;; What about using `files'?!? --Stef
311 ;; What about using `files'?!? --Stef 311 (lambda (string pred action)
312 (lambda (string pred action) 312 (cond
313 (cond 313 ;; "Tag" selectors.
314 ;; "Tag" selectors. 314 ((string-match "\\`t:" string)
315 ((string-match "\\`t:" string) 315 (complete-with-action action
316 (complete-with-action action 316 (mapcar (lambda (tag) (concat "t:" tag))
317 (mapcar (lambda (tag) (concat "t:" tag)) 317 (vc-mtn-list-tags))
318 (vc-mtn-list-tags)) 318 string pred))
319 string pred)) 319 ;; "Branch" selectors.
320 ;; "Branch" selectors. 320 ((string-match "\\`b:" string)
321 ((string-match "\\`b:" string) 321 (complete-with-action action
322 (complete-with-action action 322 (mapcar (lambda (tag) (concat "b:" tag))
323 (mapcar (lambda (tag) (concat "b:" tag)) 323 (vc-mtn-list-branches))
324 (vc-mtn-list-branches)) 324 string pred))
325 string pred)) 325 ;; "Head" selectors. Not sure how they differ from "branch" selectors.
326 ;; "Head" selectors. Not sure how they differ from "branch" selectors. 326 ((string-match "\\`h:" string)
327 ((string-match "\\`h:" string) 327 (complete-with-action action
328 (complete-with-action action 328 (mapcar (lambda (tag) (concat "h:" tag))
329 (mapcar (lambda (tag) (concat "h:" tag)) 329 (vc-mtn-list-branches))
330 (vc-mtn-list-branches)) 330 string pred))
331 string pred)) 331 ;; "ID" selectors.
332 ;; "ID" selectors. 332 ((string-match "\\`i:" string)
333 ((string-match "\\`i:" string) 333 (complete-with-action action
334 (complete-with-action action 334 (mapcar (lambda (tag) (concat "i:" tag))
335 (mapcar (lambda (tag) (concat "i:" tag)) 335 (vc-mtn-list-revision-ids
336 (vc-mtn-list-revision-ids 336 (substring string (match-end 0))))
337 (substring string (match-end 0)))) 337 string pred))
338 string pred)) 338 (t
339 (t 339 (complete-with-action action
340 (complete-with-action action 340 '("t:" "b:" "h:" "i:"
341 '("t:" "b:" "h:" "i:" 341 ;; Completion not implemented for these.
342 ;; Completion not implemented for these. 342 "a:" "c:" "d:" "e:" "l:")
343 "a:" "c:" "d:" "e:" "l:") 343 string pred)))))
344 string pred))))))
345 344
346 345
347 346
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 433383502da..ad828d6f78f 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1,4 +1,4 @@
1;;; vc.el --- drive a version-control system from within Emacs 1;;; vc.el --- drive a version-control system from within Emacs -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 1992-1998, 2000-2012 Free Software Foundation, Inc. 3;; Copyright (C) 1992-1998, 2000-2012 Free Software Foundation, Inc.
4 4
@@ -1075,7 +1075,7 @@ For old-style locking-based version control systems, like RCS:
1075 (let* ((vc-fileset (vc-deduce-fileset nil t 'state-model-only-files)) 1075 (let* ((vc-fileset (vc-deduce-fileset nil t 'state-model-only-files))
1076 (backend (car vc-fileset)) 1076 (backend (car vc-fileset))
1077 (files (nth 1 vc-fileset)) 1077 (files (nth 1 vc-fileset))
1078 (fileset-only-files (nth 2 vc-fileset)) 1078 ;; (fileset-only-files (nth 2 vc-fileset))
1079 ;; FIXME: We used to call `vc-recompute-state' here. 1079 ;; FIXME: We used to call `vc-recompute-state' here.
1080 (state (nth 3 vc-fileset)) 1080 (state (nth 3 vc-fileset))
1081 ;; The backend should check that the checkout-model is consistent 1081 ;; The backend should check that the checkout-model is consistent
@@ -1410,34 +1410,31 @@ that the version control system supports this mode of operation.
1410Runs the normal hooks `vc-before-checkin-hook' and `vc-checkin-hook'." 1410Runs the normal hooks `vc-before-checkin-hook' and `vc-checkin-hook'."
1411 (when vc-before-checkin-hook 1411 (when vc-before-checkin-hook
1412 (run-hooks 'vc-before-checkin-hook)) 1412 (run-hooks 'vc-before-checkin-hook))
1413 (lexical-let 1413 (vc-start-logentry
1414 ((backend backend)) 1414 files comment initial-contents
1415 (vc-start-logentry 1415 "Enter a change comment."
1416 files comment initial-contents 1416 "*vc-log*"
1417 "Enter a change comment." 1417 (lambda ()
1418 "*vc-log*" 1418 (vc-call-backend backend 'log-edit-mode))
1419 (lambda () 1419 (lambda (files comment)
1420 (vc-call-backend backend 'log-edit-mode)) 1420 (message "Checking in %s..." (vc-delistify files))
1421 (lexical-let ((rev rev)) 1421 ;; "This log message intentionally left almost blank".
1422 (lambda (files comment) 1422 ;; RCS 5.7 gripes about white-space-only comments too.
1423 (message "Checking in %s..." (vc-delistify files)) 1423 (or (and comment (string-match "[^\t\n ]" comment))
1424 ;; "This log message intentionally left almost blank". 1424 (setq comment "*** empty log message ***"))
1425 ;; RCS 5.7 gripes about white-space-only comments too. 1425 (with-vc-properties
1426 (or (and comment (string-match "[^\t\n ]" comment)) 1426 files
1427 (setq comment "*** empty log message ***")) 1427 ;; We used to change buffers to get local value of
1428 (with-vc-properties 1428 ;; vc-checkin-switches, but 'the' local buffer is
1429 files 1429 ;; not a well-defined concept for filesets.
1430 ;; We used to change buffers to get local value of 1430 (progn
1431 ;; vc-checkin-switches, but 'the' local buffer is 1431 (vc-call-backend backend 'checkin files rev comment)
1432 ;; not a well-defined concept for filesets. 1432 (mapc 'vc-delete-automatic-version-backups files))
1433 (progn 1433 `((vc-state . up-to-date)
1434 (vc-call-backend backend 'checkin files rev comment) 1434 (vc-checkout-time . ,(nth 5 (file-attributes file)))
1435 (mapc 'vc-delete-automatic-version-backups files)) 1435 (vc-working-revision . nil)))
1436 `((vc-state . up-to-date) 1436 (message "Checking in %s...done" (vc-delistify files)))
1437 (vc-checkout-time . ,(nth 5 (file-attributes file))) 1437 'vc-checkin-hook))
1438 (vc-working-revision . nil)))
1439 (message "Checking in %s...done" (vc-delistify files))))
1440 'vc-checkin-hook)))
1441 1438
1442;;; Additional entry points for examining version histories 1439;;; Additional entry points for examining version histories
1443 1440
@@ -1671,7 +1668,7 @@ Return t if the buffer had changes, nil otherwise."
1671 (list files rev1 rev2)))) 1668 (list files rev1 rev2))))
1672 1669
1673;;;###autoload 1670;;;###autoload
1674(defun vc-version-diff (files rev1 rev2) 1671(defun vc-version-diff (_files rev1 rev2)
1675 "Report diffs between revisions of the fileset in the repository history." 1672 "Report diffs between revisions of the fileset in the repository history."
1676 (interactive (vc-diff-build-argument-list-internal)) 1673 (interactive (vc-diff-build-argument-list-internal))
1677 ;; All that was just so we could do argument completion! 1674 ;; All that was just so we could do argument completion!
@@ -1883,11 +1880,9 @@ The headers are reset to their non-expanded form."
1883 "Enter a replacement change comment." 1880 "Enter a replacement change comment."
1884 "*vc-log*" 1881 "*vc-log*"
1885 (lambda () (vc-call-backend backend 'log-edit-mode)) 1882 (lambda () (vc-call-backend backend 'log-edit-mode))
1886 (lexical-let ((rev rev) 1883 (lambda (files comment)
1887 (backend backend)) 1884 (vc-call-backend backend
1888 (lambda (files comment) 1885 'modify-change-comment files rev comment)))))
1889 (vc-call-backend backend
1890 'modify-change-comment files rev comment))))))
1891 1886
1892;;;###autoload 1887;;;###autoload
1893(defun vc-merge () 1888(defun vc-merge ()
@@ -1952,7 +1947,7 @@ changes from the current branch."
1952 (error "Sorry, merging is not implemented for %s" backend))))) 1947 (error "Sorry, merging is not implemented for %s" backend)))))
1953 1948
1954 1949
1955(defun vc-maybe-resolve-conflicts (file status &optional name-A name-B) 1950(defun vc-maybe-resolve-conflicts (file status &optional _name-A _name-B)
1956 (vc-resynch-buffer file t (not (buffer-modified-p))) 1951 (vc-resynch-buffer file t (not (buffer-modified-p)))
1957 (if (zerop status) (message "Merge successful") 1952 (if (zerop status) (message "Merge successful")
1958 (smerge-mode 1) 1953 (smerge-mode 1)
@@ -2077,22 +2072,20 @@ Not all VC backends support short logs!")
2077 (when (and limit (not (eq 'limit-unsupported pl-return)) 2072 (when (and limit (not (eq 'limit-unsupported pl-return))
2078 (not is-start-revision)) 2073 (not is-start-revision))
2079 (goto-char (point-max)) 2074 (goto-char (point-max))
2080 (lexical-let ((working-revision working-revision) 2075 (insert "\n")
2081 (limit limit)) 2076 (insert-text-button "Show 2X entries"
2082 (insert "\n") 2077 'action (lambda (&rest _ignore)
2083 (insert-text-button "Show 2X entries" 2078 (vc-print-log-internal
2084 'action (lambda (&rest ignore) 2079 log-view-vc-backend log-view-vc-fileset
2085 (vc-print-log-internal 2080 working-revision nil (* 2 limit)))
2086 log-view-vc-backend log-view-vc-fileset 2081 'help-echo "Show the log again, and double the number of log entries shown")
2087 working-revision nil (* 2 limit))) 2082 (insert " ")
2088 'help-echo "Show the log again, and double the number of log entries shown") 2083 (insert-text-button "Show unlimited entries"
2089 (insert " ") 2084 'action (lambda (&rest _ignore)
2090 (insert-text-button "Show unlimited entries" 2085 (vc-print-log-internal
2091 'action (lambda (&rest ignore) 2086 log-view-vc-backend log-view-vc-fileset
2092 (vc-print-log-internal 2087 working-revision nil nil))
2093 log-view-vc-backend log-view-vc-fileset 2088 'help-echo "Show the log again, including all entries")))
2094 working-revision nil nil))
2095 'help-echo "Show the log again, including all entries"))))
2096 2089
2097(defun vc-print-log-internal (backend files working-revision 2090(defun vc-print-log-internal (backend files working-revision
2098 &optional is-start-revision limit) 2091 &optional is-start-revision limit)
@@ -2102,8 +2095,7 @@ Not all VC backends support short logs!")
2102 (let ((dir-present nil) 2095 (let ((dir-present nil)
2103 (vc-short-log nil) 2096 (vc-short-log nil)
2104 (buffer-name "*vc-change-log*") 2097 (buffer-name "*vc-change-log*")
2105 type 2098 type)
2106 pl-return)
2107 (dolist (file files) 2099 (dolist (file files)
2108 (when (file-directory-p file) 2100 (when (file-directory-p file)
2109 (setq dir-present t))) 2101 (setq dir-present t)))
@@ -2112,25 +2104,20 @@ Not all VC backends support short logs!")
2112 (memq 'directory vc-log-short-style) 2104 (memq 'directory vc-log-short-style)
2113 (memq 'file vc-log-short-style))))) 2105 (memq 'file vc-log-short-style)))))
2114 (setq type (if vc-short-log 'short 'long)) 2106 (setq type (if vc-short-log 'short 'long))
2115 (lexical-let 2107 (let ((shortlog vc-short-log))
2116 ((working-revision working-revision)
2117 (backend backend)
2118 (limit limit)
2119 (shortlog vc-short-log)
2120 (files files)
2121 (is-start-revision is-start-revision))
2122 (vc-log-internal-common 2108 (vc-log-internal-common
2123 backend buffer-name files type 2109 backend buffer-name files type
2124 (lambda (bk buf type-arg files-arg) 2110 (lambda (bk buf _type-arg files-arg)
2125 (vc-call-backend bk 'print-log files-arg buf 2111 (vc-call-backend bk 'print-log files-arg buf shortlog
2126 shortlog (when is-start-revision working-revision) limit)) 2112 (when is-start-revision working-revision) limit))
2127 (lambda (bk files-arg ret) 2113 (lambda (_bk _files-arg ret)
2128 (vc-print-log-setup-buttons working-revision 2114 (vc-print-log-setup-buttons working-revision
2129 is-start-revision limit ret)) 2115 is-start-revision limit ret))
2130 (lambda (bk) 2116 (lambda (bk)
2131 (vc-call-backend bk 'show-log-entry working-revision)) 2117 (vc-call-backend bk 'show-log-entry working-revision))
2132 (lambda (ignore-auto noconfirm) 2118 (lambda (_ignore-auto _noconfirm)
2133 (vc-print-log-internal backend files working-revision is-start-revision limit)))))) 2119 (vc-print-log-internal backend files working-revision
2120 is-start-revision limit))))))
2134 2121
2135(defvar vc-log-view-type nil 2122(defvar vc-log-view-type nil
2136 "Set this to differentiate the different types of logs.") 2123 "Set this to differentiate the different types of logs.")
@@ -2168,20 +2155,12 @@ Not all VC backends support short logs!")
2168(defun vc-incoming-outgoing-internal (backend remote-location buffer-name type) 2155(defun vc-incoming-outgoing-internal (backend remote-location buffer-name type)
2169 (vc-log-internal-common 2156 (vc-log-internal-common
2170 backend buffer-name nil type 2157 backend buffer-name nil type
2171 (lexical-let 2158 (lambda (bk buf type-arg _files)
2172 ((remote-location remote-location)) 2159 (vc-call-backend bk type-arg buf remote-location))
2173 (lambda (bk buf type-arg files) 2160 (lambda (_bk _files-arg _ret) nil)
2174 (vc-call-backend bk type-arg buf remote-location))) 2161 (lambda (_bk) (goto-char (point-min)))
2175 (lambda (bk files-arg ret)) 2162 (lambda (_ignore-auto _noconfirm)
2176 (lambda (bk) 2163 (vc-incoming-outgoing-internal backend remote-location buffer-name type))))
2177 (goto-char (point-min)))
2178 (lexical-let
2179 ((backend backend)
2180 (remote-location remote-location)
2181 (buffer-name buffer-name)
2182 (type type))
2183 (lambda (ignore-auto noconfirm)
2184 (vc-incoming-outgoing-internal backend remote-location buffer-name type)))))
2185 2164
2186;;;###autoload 2165;;;###autoload
2187(defun vc-print-log (&optional working-revision limit) 2166(defun vc-print-log (&optional working-revision limit)
@@ -2246,11 +2225,11 @@ When called interactively with a prefix argument, prompt for REMOTE-LOCATION.."
2246 (interactive 2225 (interactive
2247 (when current-prefix-arg 2226 (when current-prefix-arg
2248 (list (read-string "Remote location (empty for default): ")))) 2227 (list (read-string "Remote location (empty for default): "))))
2249 (let ((backend (vc-deduce-backend)) 2228 (let ((backend (vc-deduce-backend)))
2250 rootdir working-revision)
2251 (unless backend 2229 (unless backend
2252 (error "Buffer is not version controlled")) 2230 (error "Buffer is not version controlled"))
2253 (vc-incoming-outgoing-internal backend remote-location "*vc-incoming*" 'log-incoming))) 2231 (vc-incoming-outgoing-internal backend remote-location "*vc-incoming*"
2232 'log-incoming)))
2254 2233
2255;;;###autoload 2234;;;###autoload
2256(defun vc-log-outgoing (&optional remote-location) 2235(defun vc-log-outgoing (&optional remote-location)
@@ -2259,11 +2238,11 @@ When called interactively with a prefix argument, prompt for REMOTE-LOCATION."
2259 (interactive 2238 (interactive
2260 (when current-prefix-arg 2239 (when current-prefix-arg
2261 (list (read-string "Remote location (empty for default): ")))) 2240 (list (read-string "Remote location (empty for default): "))))
2262 (let ((backend (vc-deduce-backend)) 2241 (let ((backend (vc-deduce-backend)))
2263 rootdir working-revision)
2264 (unless backend 2242 (unless backend
2265 (error "Buffer is not version controlled")) 2243 (error "Buffer is not version controlled"))
2266 (vc-incoming-outgoing-internal backend remote-location "*vc-outgoing*" 'log-outgoing))) 2244 (vc-incoming-outgoing-internal backend remote-location "*vc-outgoing*"
2245 'log-outgoing)))
2267 2246
2268;;;###autoload 2247;;;###autoload
2269(defun vc-revert () 2248(defun vc-revert ()
@@ -2688,23 +2667,23 @@ log entries should be gathered."
2688 (when index 2667 (when index
2689 (substring rev 0 index)))) 2668 (substring rev 0 index))))
2690 2669
2691(defun vc-default-responsible-p (backend file) 2670(defun vc-default-responsible-p (_backend _file)
2692 "Indicate whether BACKEND is responsible for FILE. 2671 "Indicate whether BACKEND is responsible for FILE.
2693The default is to return nil always." 2672The default is to return nil always."
2694 nil) 2673 nil)
2695 2674
2696(defun vc-default-could-register (backend file) 2675(defun vc-default-could-register (_backend _file)
2697 "Return non-nil if BACKEND could be used to register FILE. 2676 "Return non-nil if BACKEND could be used to register FILE.
2698The default implementation returns t for all files." 2677The default implementation returns t for all files."
2699 t) 2678 t)
2700 2679
2701(defun vc-default-latest-on-branch-p (backend file) 2680(defun vc-default-latest-on-branch-p (_backend _file)
2702 "Return non-nil if FILE is the latest on its branch. 2681 "Return non-nil if FILE is the latest on its branch.
2703This default implementation always returns non-nil, which means that 2682This default implementation always returns non-nil, which means that
2704editing non-current revisions is not supported by default." 2683editing non-current revisions is not supported by default."
2705 t) 2684 t)
2706 2685
2707(defun vc-default-init-revision (backend) vc-default-init-revision) 2686(defun vc-default-init-revision (_backend) vc-default-init-revision)
2708 2687
2709(defun vc-default-find-revision (backend file rev buffer) 2688(defun vc-default-find-revision (backend file rev buffer)
2710 "Provide the new `find-revision' op based on the old `checkout' op. 2689 "Provide the new `find-revision' op based on the old `checkout' op.
@@ -2718,7 +2697,7 @@ to provide the `find-revision' operation instead."
2718 (insert-file-contents-literally tmpfile))) 2697 (insert-file-contents-literally tmpfile)))
2719 (delete-file tmpfile)))) 2698 (delete-file tmpfile))))
2720 2699
2721(defun vc-default-rename-file (backend old new) 2700(defun vc-default-rename-file (_backend old new)
2722 (condition-case nil 2701 (condition-case nil
2723 (add-name-to-file old new) 2702 (add-name-to-file old new)
2724 (error (rename-file old new))) 2703 (error (rename-file old new)))
@@ -2730,11 +2709,11 @@ to provide the `find-revision' operation instead."
2730 2709
2731(declare-function log-edit-mode "log-edit" ()) 2710(declare-function log-edit-mode "log-edit" ())
2732 2711
2733(defun vc-default-log-edit-mode (backend) (log-edit-mode)) 2712(defun vc-default-log-edit-mode (_backend) (log-edit-mode))
2734 2713
2735(defun vc-default-log-view-mode (backend) (log-view-mode)) 2714(defun vc-default-log-view-mode (_backend) (log-view-mode))
2736 2715
2737(defun vc-default-show-log-entry (backend rev) 2716(defun vc-default-show-log-entry (_backend rev)
2738 (with-no-warnings 2717 (with-no-warnings
2739 (log-view-goto-rev rev))) 2718 (log-view-goto-rev rev)))
2740 2719
@@ -2800,7 +2779,7 @@ to provide the `find-revision' operation instead."
2800(defalias 'vc-default-revision-completion-table 'ignore) 2779(defalias 'vc-default-revision-completion-table 'ignore)
2801(defalias 'vc-default-mark-resolved 'ignore) 2780(defalias 'vc-default-mark-resolved 'ignore)
2802 2781
2803(defun vc-default-dir-status-files (backend dir files default-state update-function) 2782(defun vc-default-dir-status-files (_backend _dir files default-state update-function)
2804 (funcall update-function 2783 (funcall update-function
2805 (mapcar (lambda (file) (list file default-state)) files))) 2784 (mapcar (lambda (file) (list file default-state)) files)))
2806 2785