;;; speedbar --- quick access to files and tags in a frame
;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
;; Keywords: file, tags, tools
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
speedbar-ignored-directory-regexp
(speedbar-extension-list-to-regex val))))
-(defcustom speedbar-directory-unshown-regexp "^\\(CVS\\|RCS\\|SCCS\\|\\..*\\)\\'"
+(defcustom speedbar-directory-unshown-regexp "^\\(\\..*\\)\\'"
"*Regular expression matching directories not to show in speedbar.
They should include commonly existing directories which are not
-useful, such as version control."
+useful. It is no longer necessary to include include version-control
+directories here; see \\[vc-directory-exclusion-list\\]."
:group 'speedbar
:type 'string)
'speedbar-buffer
"Speedbar"
#'speedbar-frame-mode
- (if dframe-xemacsp
+ (if (featurep 'xemacs)
(append speedbar-frame-plist
;; This is a hack to get speedbar to iconfiy
;; with the selected frame.
(defun speedbar-frame-reposition-smartly ()
"Reposition the speedbar frame to be next to the attached frame."
- (cond ((and dframe-xemacsp
+ (cond ((and (featurep 'xemacs)
(or (member 'left speedbar-frame-plist)
(member 'top speedbar-frame-plist)))
(dframe-reposition-frame
(cons (car (cdr (member 'left speedbar-frame-plist)))
(car (cdr (member 'top speedbar-frame-plist)))))
)
- ((and (not dframe-xemacsp)
+ ((and (not (featurep 'xemacs))
(or (assoc 'left speedbar-frame-parameters)
(assoc 'top speedbar-frame-parameters)))
;; if left/top were specified in the parameters, pass them
This gives visual indications of what is up. It EXPECTS the speedbar
frame and window to be the currently active frame and window."
(if (and (frame-live-p (speedbar-current-frame))
- (or (not dframe-xemacsp)
+ (or (not (featurep 'xemacs))
(with-no-warnings
(specifier-instance has-modeline-p)))
speedbar-buffer)
(if speedbar-previous-menu (easy-menu-remove speedbar-previous-menu))
(setq speedbar-previous-menu md)
;; Now add the new menu
- (if (not dframe-xemacsp)
+ (if (not (featurep 'xemacs))
(easy-menu-define speedbar-menu-map (current-local-map)
"Speedbar menu" md)
(easy-menu-add md (current-local-map))
(while dir
(if (not
(or (string-match speedbar-file-unshown-regexp (car dir))
+ (member (car dir) vc-directory-exclusion-list)
(string-match speedbar-directory-unshown-regexp (car dir))))
(if (file-directory-p (car dir))
(setq dirs (cons (car dir) dirs))
(not (or (and (featurep 'ange-ftp)
(string-match
(car (symbol-value
- (if dframe-xemacsp
+ (if (featurep 'xemacs)
'ange-ftp-directory-format
'ange-ftp-name-format)))
(expand-file-name default-directory)))
"Return t if we should bother checking DIRECTORY for version control files.
This can be overloaded to add new types of version control systems."
(or
- ;; Local CVS available in Emacs 21
- (and (fboundp 'vc-state)
- (file-exists-p (concat directory "CVS/")))
- ;; Local RCS
- (file-exists-p (concat directory "RCS/"))
- ;; Local SCCS
- (file-exists-p (concat directory "SCCS/"))
- ;; Remote SCCS project
- (let ((proj-dir (getenv "PROJECTDIR")))
- (if proj-dir
- (file-exists-p (concat proj-dir "/SCCS"))
- nil))
+ (catch t (dolist (vcd vc-directory-exclusion-list)
+ (if (file-exists-p (concat directory vcd)) (throw t t))) nil)
;; User extension
(run-hook-with-args-until-success 'speedbar-vc-directory-enable-hook
directory)
(defun speedbar-this-file-in-vc (directory name)
"Check to see if the file in DIRECTORY with NAME is in a version control system.
-You can add new VC systems by overriding this function. You can
+Automatically recognizes all VCs supported by VC mode. You can
optimize this function by overriding it and only doing those checks
that will occur on your system."
(or
- (if (fboundp 'vc-state)
- ;; Emacs 21 handles VC state in a nice way.
- (condition-case nil
- (let ((state (vc-state (concat directory name))))
- (not (or (eq 'up-to-date state)
- (null state))))
- ;; An error means not in a VC system
- (error nil))
- (or
- ;; RCS file name
- (file-exists-p (concat directory "RCS/" name ",v"))
- (file-exists-p (concat directory "RCS/" name))
- ;; Local SCCS file name
- (file-exists-p (concat directory "SCCS/s." name))
- ;; Remote SCCS file name
- (let ((proj-dir (getenv "PROJECTDIR")))
- (if proj-dir
- (file-exists-p (concat proj-dir "/SCCS/s." name))
- nil))))
+ (vc-backend (concat directory "/" name))
;; User extension
(run-hook-with-args 'speedbar-vc-in-control-hook directory name)
))