From: Oscar Fuentes Date: Thu, 26 Feb 2015 14:46:12 +0000 (+0100) Subject: Use vc-switches on vc-*-annotate-command X-Git-Tag: emacs-25.0.90~2564^2~281 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b5a0603eb41c7a350c16a1b3ec5c1b8d8c84a4eb;p=emacs.git Use vc-switches on vc-*-annotate-command This also removes switch "-C -C" from vc-git-annotate-command. Fixes: debbugs:17945 * vc/vc.el (vc-annotate-switches): New defcustom. * vc/vc-bzr.el (vc-bzr-annotate-switches): New defcustom. (vc-bzr-annotate-command): Use it. * vc/vc-cvs.el (vc-cvs-annotate-switches): New defcustom. (vc-cvs-annotate-command): Use it. * vc/vc-git.el (vc-git-annotate-switches): New defcustom. (vc-git-annotate-command): Use it. * vc/vc-hg.el (vc-hg-annotate-switches): New defcustom. (vc-hg-annotate-command): Use it. * vc/vc-mtn.el (vc-mtn-annotate-switches): New defcustom. (vc-mtn-annotate-command): Use it. * vc/vc-svn.el (vc-svn-annotate-switches): New defcustom. (vc-svn-annotate-command): Use it. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8ccc2c35b1f..749bd343973 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,19 @@ +2015-02-26 Oscar Fuentes + + * vc/vc.el (vc-annotate-switches): New defcustom. + * vc/vc-bzr.el (vc-bzr-annotate-switches): New defcustom. + (vc-bzr-annotate-command): Use it. + * vc/vc-cvs.el (vc-cvs-annotate-switches): New defcustom. + (vc-cvs-annotate-command): Use it. + * vc/vc-git.el (vc-git-annotate-switches): New defcustom. + (vc-git-annotate-command): Use it. + * vc/vc-hg.el (vc-hg-annotate-switches): New defcustom. + (vc-hg-annotate-command): Use it. + * vc/vc-mtn.el (vc-mtn-annotate-switches): New defcustom. + (vc-mtn-annotate-command): Use it. + * vc/vc-svn.el (vc-svn-annotate-switches): New defcustom. + (vc-svn-annotate-command): Use it. + 2015-02-26 Alan Mackenzie Handle "#" operator properly inside macro. Fix coding bug. diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index 96d6d1da48c..811f9e80b0c 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el @@ -73,6 +73,16 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." (repeat :tag "Argument List" :value ("") string)) :group 'vc-bzr) +(defcustom vc-bzr-annotate-switches nil + "String or list of strings specifying switches for bzr annotate under VC. +If nil, use the value of `vc-annotate-switches'. If t, use no switches." + :type '(choice (const :tag "Unspecified" nil) + (const :tag "None" t) + (string :tag "Argument String") + (repeat :tag "Argument List" :value ("") string)) + :version "25.1" + :group 'vc-bzr) + (defcustom vc-bzr-log-switches nil "String or list of strings specifying switches for bzr log under VC." :type '(choice (const :tag "None" nil) @@ -826,7 +836,8 @@ If LIMIT is non-nil, show no more than this many entries." Each line is tagged with the revision number, which has a `help-echo' property containing author and date information." (apply #'vc-bzr-command "annotate" buffer 'async file "--long" "--all" - (if revision (list "-r" revision))) + (append (vc-switches 'bzr 'annotate) + (if revision (list "-r" revision)))) (let ((table (make-hash-table :test 'equal))) (set-process-filter (get-buffer-process buffer) diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index 707090a10eb..232dcc2185e 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el @@ -96,6 +96,17 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." :version "21.1" :group 'vc-cvs) +(defcustom vc-cvs-annotate-switches nil + "String or list of strings specifying switches for cvs annotate under VC. +If nil, use the value of `vc-annotate-switches'. If t, use no +switches." + :type '(choice (const :tag "Unspecified" nil) + (const :tag "None" t) + (string :tag "Argument String") + (repeat :tag "Argument List" :value ("") string)) + :version "25.1" + :group 'vc-cvs) + (defcustom vc-cvs-header '("\$Id\$") "Header keywords to be inserted by `vc-insert-headers'." :version "24.1" ; no longer consult the obsolete vc-header-alist @@ -623,11 +634,12 @@ Remaining arguments are ignored." (defun vc-cvs-annotate-command (file buffer &optional revision) "Execute \"cvs annotate\" on FILE, inserting the contents in BUFFER. Optional arg REVISION is a revision to annotate from." - (vc-cvs-command buffer - (if (vc-cvs-stay-local-p file) - 'async 0) - file "annotate" - (if revision (concat "-r" revision))) + (apply #'vc-cvs-command buffer + (if (vc-cvs-stay-local-p file) + 'async 0) + file "annotate" + (append (vc-switches 'cvs 'annotate) + (if revision (list (concat "-r" revision))))) ;; Strip the leading few lines. (let ((proc (get-buffer-process buffer))) (if proc diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index a31c121b89b..48e22c82647 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -120,6 +120,16 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." :version "23.1" :group 'vc-git) +(defcustom vc-git-annotate-switches nil + "String or list of strings specifying switches for Git blame under VC. +If nil, use the value of `vc-annotate-switches'. If t, use no switches." + :type '(choice (const :tag "Unspecified" nil) + (const :tag "None" t) + (string :tag "Argument String") + (repeat :tag "Argument List" :value ("") string)) + :version "25.1" + :group 'vc-git) + (defcustom vc-git-program "git" "Name of the Git executable (excluding any arguments)." :version "24.1" @@ -1013,7 +1023,9 @@ or BRANCH^ (where \"^\" can be repeated)." (defun vc-git-annotate-command (file buf &optional rev) (let ((name (file-relative-name file))) - (vc-git-command buf 'async nil "blame" "--date=iso" "-C" "-C" rev "--" name))) + (apply #'vc-git-command buf 'async nil "blame" "--date=iso" + (append (vc-switches 'git 'annotate) + (list rev "--" name))))) (declare-function vc-annotate-convert-time "vc-annotate" (time)) diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 8b4067f536b..c841dfcdf54 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -131,6 +131,17 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." :version "23.1" :group 'vc-hg) +(defcustom vc-hg-annotate-switches nil + "String or list of strings specifying switches for hg annotate under VC. +If nil, use the value of `vc-annotate-switches'. If t, use no +switches." + :type '(choice (const :tag "Unspecified" nil) + (const :tag "None" t) + (string :tag "Argument String") + (repeat :tag "Argument List" :value ("") string)) + :version "25.1" + :group 'vc-hg) + (defcustom vc-hg-program "hg" "Name of the Mercurial executable (excluding any arguments)." :type 'string @@ -358,8 +369,9 @@ If LIMIT is non-nil, show no more than this many entries." (defun vc-hg-annotate-command (file buffer &optional revision) "Execute \"hg annotate\" on FILE, inserting the contents in BUFFER. Optional arg REVISION is a revision to annotate from." - (vc-hg-command buffer 0 file "annotate" "-d" "-n" "--follow" - (when revision (concat "-r" revision)))) + (apply #'vc-hg-command buffer 0 file "annotate" "-d" "-n" "--follow" + (append (vc-switches 'hg 'annotate) + (if revision (list (concat "-r" revision)))))) (declare-function vc-annotate-convert-time "vc-annotate" (time)) diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el index d783572678c..cd84ebe7afa 100644 --- a/lisp/vc/vc-mtn.el +++ b/lisp/vc/vc-mtn.el @@ -49,6 +49,17 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." :version "23.1" :group 'vc-mtn) +(defcustom vc-mtn-annotate-switches nil + "String or list of strings specifying switches for mtn annotate under VC. +If nil, use the value of `vc-annotate-switches'. If t, use no +switches." + :type '(choice (const :tag "Unspecified" nil) + (const :tag "None" t) + (string :tag "Argument String") + (repeat :tag "Argument List" :value ("") string)) + :version "25.1" + :group 'vc-mtn) + (define-obsolete-variable-alias 'vc-mtn-command 'vc-mtn-program "23.1") (defcustom vc-mtn-program "mtn" "Name of the monotone executable." @@ -246,8 +257,9 @@ If LIMIT is non-nil, show no more than this many entries." (if rev1 (list "-r" rev1)) (if rev2 (list "-r" rev2))))) (defun vc-mtn-annotate-command (file buf &optional rev) - (apply 'vc-mtn-command buf 'async file "annotate" - (if rev (list "-r" rev)))) + (apply #'vc-mtn-command buf 'async file "annotate" + (append (vc-switches 'mtn 'annotate) + (if rev (list "-r" rev))))) (declare-function vc-annotate-convert-time "vc-annotate" (time)) diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index d74daf9c36f..5ce9afa02c6 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el @@ -95,6 +95,17 @@ If you want to force an empty list of arguments, use t." :version "22.1" :group 'vc-svn) +(defcustom vc-svn-annotate-switches nil + "String or list of strings specifying switches for svn annotate under VC. +If nil, use the value of `vc-annotate-switches'. If t, use no +switches." + :type '(choice (const :tag "Unspecified" nil) + (const :tag "None" t) + (string :tag "Argument String") + (repeat :tag "Argument List" :value ("") string)) + :version "25.1" + :group 'vc-svn) + (defcustom vc-svn-header '("\$Id\$") "Header keywords to be inserted by `vc-insert-headers'." :version "24.1" ; no longer consult the obsolete vc-header-alist @@ -736,7 +747,9 @@ Set file properties accordingly. If FILENAME is non-nil, return its status." ;; Support for `svn annotate' (defun vc-svn-annotate-command (file buf &optional rev) - (vc-svn-command buf 'async file "annotate" (if rev (concat "-r" rev)))) + (apply #'vc-svn-command buf 'async file "annotate" + (append (vc-switches 'svn 'annotate) + (if rev (list (concat "-r" rev)))))) (defun vc-svn-annotate-time-of-rev (rev) ;; Arbitrarily assume 10 commits per day. diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 54b221428a5..e8e8202dbbb 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -780,6 +780,26 @@ not specific to any particular backend." :group 'vc :version "21.1") +(defcustom vc-annotate-switches nil + "A string or list of strings specifying switches for annotate under VC. +When running annotate under a given BACKEND, VC uses the first +non-nil value of `vc-BACKEND-annotate-switches', `vc-annotate-switches', +and `annotate-switches', in that order. Since nil means to check the +next variable in the sequence, either of the first two may use +the value t to mean no switches at all. `vc-annotate-switches' +should contain switches that are specific to version control, but +not specific to any particular backend. + +As very few switches (if any) are used across different VC tools, +please consider using the specific `vc-BACKEND-annotate-switches' +for the backend you use." + :type '(choice (const :tag "Unspecified" nil) + (const :tag "None" t) + (string :tag "Argument String") + (repeat :tag "Argument List" :value ("") string)) + :group 'vc + :version "25.1") + (defcustom vc-log-show-limit 2000 "Limit the number of items shown by the VC log commands. Zero means unlimited.