aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond2007-12-28 13:29:41 +0000
committerEric S. Raymond2007-12-28 13:29:41 +0000
commit9c4b89d5a4a3507a27b9861af28efdf6cf2fd39a (patch)
treece2d8ed50c7541dd7a7e5cff370285d3e30c7670
parent14f2605422012a620ae97320d1efff338dec8d4e (diff)
downloademacs-9c4b89d5a4a3507a27b9861af28efdf6cf2fd39a.tar.gz
emacs-9c4b89d5a4a3507a27b9861af28efdf6cf2fd39a.zip
* vc-hooks.el, vc.el: Move vc-directory-exclusion-list from vc.el
to vc-hooks.el so it will be available to other modes, such as speedbar.el. Also, teach it to recognize monotine state directories. * speedbar.el: Remove this mode's fragile assumptions about version-control systems. Instead, make it use logic from vc-hooks.el so it will become smarter whenever VC mode does. * vc-hooks.el: 'added is a real state, not a future hypothetical one. Fix the documentation.
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/speedbar.el42
-rw-r--r--lisp/vc-hooks.el7
-rw-r--r--lisp/vc.el6
4 files changed, 26 insertions, 40 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a2e69e254a1..83cb23b33b0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,16 @@
12007-12-28 Eric S. Raymond <esr@snark.thyrsus.com> 12007-12-28 Eric S. Raymond <esr@snark.thyrsus.com>
2 2
3 * vc-hooks.el, vc.el: Move vc-directory-exclusion-list from vc.el
4 to vc-hooks.el so it will be available to other modes, such as
5 speedbar.el. Also, teach it to recognize monotine state directories.
6
7 * speedbar.el: Remove this mode's fragile assumptions about
8 version-control systems. Instead, make it use logic from
9 vc-hooks.el so it will become smarter whenever VC mode does.
10
11 * vc-hooks.el: 'added is a real state, not a future hypothetical
12 one. Fix the documentation.
13
3 * vc-bzr.el, vc-cvs.el, vc-git.el, vc-hg.el, vc-mcvs.el, vc-svn.el: 14 * vc-bzr.el, vc-cvs.el, vc-git.el, vc-hg.el, vc-mcvs.el, vc-svn.el:
4 Modify all instances of the dir-state back-end method to suppress 15 Modify all instances of the dir-state back-end method to suppress
5 keeping undo lists on the buffers holding astatus output, which 16 keeping undo lists on the buffers holding astatus output, which
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index 6861615d468..fb93211ea0c 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -657,10 +657,11 @@ before speedbar has been loaded."
657 speedbar-ignored-directory-regexp 657 speedbar-ignored-directory-regexp
658 (speedbar-extension-list-to-regex val)))) 658 (speedbar-extension-list-to-regex val))))
659 659
660(defcustom speedbar-directory-unshown-regexp "^\\(CVS\\|RCS\\|SCCS\\|\\..*\\)\\'" 660(defcustom speedbar-directory-unshown-regexp "^\\(\\..*\\)\\'"
661 "*Regular expression matching directories not to show in speedbar. 661 "*Regular expression matching directories not to show in speedbar.
662They should include commonly existing directories which are not 662They should include commonly existing directories which are not
663useful, such as version control." 663useful. It is no longer necessary to include include version-control
664directories here; see \\[vc-directory-exclusion-list\\]."
664 :group 'speedbar 665 :group 'speedbar
665 :type 'string) 666 :type 'string)
666 667
@@ -1917,6 +1918,7 @@ the file-system."
1917 (while dir 1918 (while dir
1918 (if (not 1919 (if (not
1919 (or (string-match speedbar-file-unshown-regexp (car dir)) 1920 (or (string-match speedbar-file-unshown-regexp (car dir))
1921 (member (car dir) vc-directory-exclusion-list)
1920 (string-match speedbar-directory-unshown-regexp (car dir)))) 1922 (string-match speedbar-directory-unshown-regexp (car dir))))
1921 (if (file-directory-p (car dir)) 1923 (if (file-directory-p (car dir))
1922 (setq dirs (cons (car dir) dirs)) 1924 (setq dirs (cons (car dir) dirs))
@@ -2972,18 +2974,8 @@ the file being checked."
2972 "Return t if we should bother checking DIRECTORY for version control files. 2974 "Return t if we should bother checking DIRECTORY for version control files.
2973This can be overloaded to add new types of version control systems." 2975This can be overloaded to add new types of version control systems."
2974 (or 2976 (or
2975 ;; Local CVS available in Emacs 21 2977 (catch t (dolist (vcd vc-directory-exclusion-list)
2976 (and (fboundp 'vc-state) 2978 (if (file-exists-p (concat directory vcd)) (throw t t))) nil)
2977 (file-exists-p (concat directory "CVS/")))
2978 ;; Local RCS
2979 (file-exists-p (concat directory "RCS/"))
2980 ;; Local SCCS
2981 (file-exists-p (concat directory "SCCS/"))
2982 ;; Remote SCCS project
2983 (let ((proj-dir (getenv "PROJECTDIR")))
2984 (if proj-dir
2985 (file-exists-p (concat proj-dir "/SCCS"))
2986 nil))
2987 ;; User extension 2979 ;; User extension
2988 (run-hook-with-args-until-success 'speedbar-vc-directory-enable-hook 2980 (run-hook-with-args-until-success 'speedbar-vc-directory-enable-hook
2989 directory) 2981 directory)
@@ -2991,29 +2983,11 @@ This can be overloaded to add new types of version control systems."
2991 2983
2992(defun speedbar-this-file-in-vc (directory name) 2984(defun speedbar-this-file-in-vc (directory name)
2993 "Check to see if the file in DIRECTORY with NAME is in a version control system. 2985 "Check to see if the file in DIRECTORY with NAME is in a version control system.
2994You can add new VC systems by overriding this function. You can 2986Automatically recognizes all VCs supported by VC mode. You can
2995optimize this function by overriding it and only doing those checks 2987optimize this function by overriding it and only doing those checks
2996that will occur on your system." 2988that will occur on your system."
2997 (or 2989 (or
2998 (if (fboundp 'vc-state) 2990 (vc-backend (concat directory "/" name)
2999 ;; Emacs 21 handles VC state in a nice way.
3000 (condition-case nil
3001 (let ((state (vc-state (concat directory name))))
3002 (not (or (eq 'up-to-date state)
3003 (null state))))
3004 ;; An error means not in a VC system
3005 (error nil))
3006 (or
3007 ;; RCS file name
3008 (file-exists-p (concat directory "RCS/" name ",v"))
3009 (file-exists-p (concat directory "RCS/" name))
3010 ;; Local SCCS file name
3011 (file-exists-p (concat directory "SCCS/s." name))
3012 ;; Remote SCCS file name
3013 (let ((proj-dir (getenv "PROJECTDIR")))
3014 (if proj-dir
3015 (file-exists-p (concat proj-dir "/SCCS/s." name))
3016 nil))))
3017 ;; User extension 2991 ;; User extension
3018 (run-hook-with-args 'speedbar-vc-in-control-hook directory name) 2992 (run-hook-with-args 'speedbar-vc-in-control-hook directory name)
3019 )) 2993 ))
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index 437b2267d7f..3657878232e 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -76,6 +76,13 @@ An empty list disables VC altogether."
76 :version "23.1" 76 :version "23.1"
77 :group 'vc) 77 :group 'vc)
78 78
79(defcustom vc-directory-exclusion-list '("SCCS" "RCS" "CVS" "MCVS"
80 ".svn" ".git" ".hg" ".bzr"
81 "_MTN" "{arch}")
82 "List of directory names to be ignored when walking directory trees."
83 :type '(repeat string)
84 :group 'vc)
85
79(defcustom vc-path 86(defcustom vc-path
80 (if (file-directory-p "/usr/sccs") 87 (if (file-directory-p "/usr/sccs")
81 '("/usr/sccs") 88 '("/usr/sccs")
diff --git a/lisp/vc.el b/lisp/vc.el
index c5411718633..e8a481be3d3 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -620,12 +620,6 @@ These are passed to the checkin program by \\[vc-register]."
620 :group 'vc 620 :group 'vc
621 :version "20.3") 621 :version "20.3")
622 622
623(defcustom vc-directory-exclusion-list '("SCCS" "RCS" "CVS" "MCVS" ".svn"
624 ".git" ".hg" ".bzr" "{arch}")
625 "List of directory names to be ignored when walking directory trees."
626 :type '(repeat string)
627 :group 'vc)
628
629(defcustom vc-diff-switches nil 623(defcustom vc-diff-switches nil
630 "A string or list of strings specifying switches for diff under VC. 624 "A string or list of strings specifying switches for diff under VC.
631When running diff under a given BACKEND, VC concatenates the values of 625When running diff under a given BACKEND, VC concatenates the values of