[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Version Control in Speedbar (speedbar-vc)
From: |
Nordlöw |
Subject: |
Version Control in Speedbar (speedbar-vc) |
Date: |
Thu, 05 Jul 2007 16:02:55 -0000 |
User-agent: |
G2/1.0 |
Hey again, Emacs Users!
I am trying to get speedbar to display version control context in
project trees being version controlled by CVS, Subversion, Bazaar,
etc. I thought the follow code should do the trick by displaying an
icon beside all directories that have changed. This would make Emacs
+Speedbar attractive to people familiar with GUI-interfaces such as
Tourtoise-SVN. However, I only get an icon to the right of the actual
file that has been changed. This makes it harder to see what has
changed when I am currently viewing from the top of the project tree.
Is there a way to make Speedbar display information in this way?
(defun pnw-speedbar-vc-check-dir-p (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)
(or
(file-exists-p (concat directory "CVS/"))
(file-exists-p (concat directory ".svn/"))
(file-exists-p (concat directory ".bzr/"))
(file-exists-p (concat directory ".git/"))
))
;; 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))
;; User extension
(run-hook-with-args-until-success 'speedbar-vc-directory-enable-
hook
directory)
))
(add-hook 'speedbar-vc-directory-enable-hook 'pnw-speedbar-vc-check-
dir-p)
(setq speedbar-verbosity-level 3)
Thanks in advance,
Per Nordlöw
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Version Control in Speedbar (speedbar-vc),
Nordlöw <=