Merge from emacs-24; up to 2012-04-24T21:47:24Z!michael.albinus@gmx.de
[bpt/emacs.git] / lisp / vc / vc-arch.el
index ba91f7f..18dfbe1 100644 (file)
@@ -1,7 +1,6 @@
-;;; vc-arch.el --- VC backend for the Arch version-control system
+;;; vc-arch.el --- VC backend for the Arch version-control system  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 2004-2012  Free Software Foundation, Inc.
 
 ;; Author:      FSF (see vc.el for full credits)
 ;; Maintainer:  Stefan Monnier <monnier@gnu.org>
@@ -40,7 +39,7 @@
 
 ;; Bugs:
 
-;; - *VC-log*'s initial content lacks the `Summary:' lines.
+;; - *vc-log*'s initial content lacks the `Summary:' lines.
 ;; - All files under the tree are considered as "under Arch's control"
 ;;   without regards to =tagging-method and such.
 ;; - Files are always considered as `edited'.
 ;;; Properties of the backend
 
 (defun vc-arch-revision-granularity () 'repository)
-(defun vc-arch-checkout-model (files) 'implicit)
+(defun vc-arch-checkout-model (_files) 'implicit)
 
 ;;;
 ;;; Customization options
 ;;;
 
+(defgroup vc-arch nil
+  "VC Arch backend."
+  :version "24.1"
+  :group 'vc)
+
 ;; It seems Arch diff does not accept many options, so this is not
 ;; very useful.  It exists mainly so that the VC backends are all
 ;; consistent with regards to their treatment of diff switches.
@@ -77,7 +81,7 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
                 (string :tag "Argument String")
                 (repeat :tag "Argument List" :value ("") string))
   :version "23.1"
-  :group 'vc)
+  :group 'vc-arch)
 
 (define-obsolete-variable-alias 'vc-arch-command 'vc-arch-program "23.1")
 
@@ -88,7 +92,7 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
     (or (car candidates) "tla"))
   "Name of the Arch executable."
   :type 'string
-  :group 'vc)
+  :group 'vc-arch)
 
 ;; Clear up the cache to force vc-call to check again and discover
 ;; new functions when we reload this file.
@@ -223,7 +227,7 @@ Only the value `maybe' can be trusted :-(."
          (vc-file-setprop
           file 'arch-root root)))))
 
-(defun vc-arch-register (files &optional rev comment)
+(defun vc-arch-register (files &optional rev _comment)
   (if rev (error "Explicit initial revision not supported for Arch"))
   (dolist (file files)
     (let ((tagmet (vc-arch-tagging-method file)))
@@ -254,7 +258,7 @@ Only the value `maybe' can be trusted :-(."
               ;; Strip the terminating newline.
               (buffer-substring (point-min) (1- (point-max)))))))))
 
-(defun vc-arch-workfile-unchanged-p (file)
+(defun vc-arch-workfile-unchanged-p (_file)
   "Stub: arch workfiles are always considered to be in a changed state,"
   nil)
 
@@ -378,7 +382,7 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
   '(("\\`.*--\\(.*--.*\\)--\\(v?\\).*-\\([0-9]+\\)\\'" . "\\2\\3[\\1]"))
   "Rewrite rules to shorten Arch's revision names on the mode-line."
   :type '(repeat (cons regexp string))
-  :group 'vc)
+  :group 'vc-arch)
 
 (defun vc-arch-mode-line-string (file)
   "Return string for placement in modeline by `vc-mode-line' for FILE."
@@ -399,7 +403,7 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
         (with-temp-buffer
           (insert-file-contents rej)
           (goto-char (point-min))
-          (looking-at "Conflicts occured, diff3 conflict markers left in file\\.")))))
+          (looking-at "Conflicts occurred, diff3 conflict markers left in file\\.")))))
 
 (defun vc-arch-delete-rej-if-obsolete ()
   "For use in `after-save-hook'."
@@ -504,12 +508,11 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
                    "*"))))))
 
 (defun vc-arch-revision-completion-table (files)
-  (lexical-let ((files files))
-    (lambda (string pred action)
-      ;; FIXME: complete revision patches as well.
-      (let* ((root (expand-file-name "{arch}" (vc-arch-root (car files))))
-             (table (vc-arch--version-completion-table root string)))
-       (complete-with-action action table string pred)))))
+  (lambda (string pred action)
+    ;; FIXME: complete revision patches as well.
+    (let* ((root (expand-file-name "{arch}" (vc-arch-root (car files))))
+           (table (vc-arch--version-completion-table root string)))
+      (complete-with-action action table string pred))))
 
 ;;; Trimming revision libraries.
 
@@ -543,13 +546,12 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
     minrev))
 
 (defun vc-arch-trim-make-sentinel (revs)
-  (if (null revs) (lambda (proc msg) (message "VC-Arch trimming ... done"))
-    (lexical-let ((revs revs))
-      (lambda (proc msg)
-        (message "VC-Arch trimming %s..." (file-name-nondirectory (car revs)))
-        (rename-file (car revs) (concat (car revs) "*rm*"))
-       (setq proc (start-process "vc-arch-trim" nil
-                                  "rm" "-rf" (concat (car revs) "*rm*")))
+  (if (null revs) (lambda (_proc _msg) (message "VC-Arch trimming ... done"))
+    (lambda (_proc _msg)
+      (message "VC-Arch trimming %s..." (file-name-nondirectory (car revs)))
+      (rename-file (car revs) (concat (car revs) "*rm*"))
+      (let ((proc (start-process "vc-arch-trim" nil
+                                 "rm" "-rf" (concat (car revs) "*rm*"))))
         (set-process-sentinel proc (vc-arch-trim-make-sentinel (cdr revs)))))))
 
 (defun vc-arch-trim-one-revlib (dir)
@@ -568,7 +570,7 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
                'car-less-than-car))
         (subdirs nil))
     (when (cddr revs)
-      (dotimes (i (/ (length revs) 2))
+      (dotimes (_i (/ (length revs) 2))
         (let ((minrev (vc-arch-trim-find-least-useful-rev revs)))
           (setq revs (delq minrev revs))
           (push minrev subdirs)))
@@ -638,5 +640,4 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
 
 (provide 'vc-arch)
 
-;; arch-tag: a35c7c1c-5237-429d-88ef-3d718fd2e704
 ;;; vc-arch.el ends here