aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-05-08 16:14:11 +0000
committerRichard M. Stallman1993-05-08 16:14:11 +0000
commit6ed5075cab814946fc39d5810facd2ca5f23df27 (patch)
treebc8586f3ab4ddf8d26acf2f2c22f0f1c200d19eb
parentb04904fb2e0d6ddf614feeed36bdacb6707ff897 (diff)
downloademacs-6ed5075cab814946fc39d5810facd2ca5f23df27.tar.gz
emacs-6ed5075cab814946fc39d5810facd2ca5f23df27.zip
(vc-directory-18): New function.
If Emacs 18, make vc-directory alias to this.
-rw-r--r--lisp/vc.el33
1 files changed, 32 insertions, 1 deletions
diff --git a/lisp/vc.el b/lisp/vc.el
index ef2ab776eef..9bc5dabaa38 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -44,7 +44,7 @@
44;; 44;;
45;; This code depends on call-process passing back the subprocess exit 45;; This code depends on call-process passing back the subprocess exit
46;; status. Thus, you need Emacs 18.58 or later to run it. For the 46;; status. Thus, you need Emacs 18.58 or later to run it. For the
47;; vc-directory command to work properly, you need 19 47;; vc-directory command to work properly as documented, you need 19.
48;; 48;;
49;; The vc code maintains some internal state in order to reduce expensive 49;; The vc code maintains some internal state in order to reduce expensive
50;; version-control operations to a minimum. Some names are only computed 50;; version-control operations to a minimum. Some names are only computed
@@ -847,6 +847,8 @@ on a buffer attached to the file named in the current Dired buffer line."
847 (replace-match (concat "\\1" rep "\\2") t))) 847 (replace-match (concat "\\1" rep "\\2") t)))
848 ) 848 )
849 849
850;;; Note in Emacs 18 the following defun gets overridden
851;;; with the symbol 'vc-directory-18. See below.
850;;;###autoload 852;;;###autoload
851(defun vc-directory (verbose) 853(defun vc-directory (verbose)
852 "Show version-control status of all files under the current directory." 854 "Show version-control status of all files under the current directory."
@@ -891,6 +893,35 @@ on a buffer attached to the file named in the current Dired buffer line."
891 (if verbose "registered" "locked") default-directory)) 893 (if verbose "registered" "locked") default-directory))
892 )) 894 ))
893 895
896;; Emacs 18 version
897(defun vc-directory-18 (verbose)
898 "Show version-control status of all files under the current directory."
899 (interactive "P")
900 (let (nonempty)
901 (save-excursion
902 (set-buffer (get-buffer-create "*vc-status*"))
903 (erase-buffer)
904 (vc-file-tree-walk
905 (function (lambda (f)
906 (if (vc-registered f)
907 (let ((user (vc-locking-user f)))
908 (if (or user verbose)
909 (insert (format
910 "%s %s\n"
911 (concat user) f))))))))
912 (setq nonempty (not (zerop (buffer-size)))))
913 (if nonempty
914 (progn
915 (pop-to-buffer "*vc-status*" t)
916 (vc-shrink-to-fit)
917 (goto-char (point-min)))
918 (message "No files are currently %s under %s"
919 (if verbose "registered" "locked") default-directory))
920 ))
921
922(or (boundp 'minor-mode-map-alist)
923 (fset 'vc-directory 'vc-directory-18))
924
894;; Named-configuration support for SCCS 925;; Named-configuration support for SCCS
895 926
896(defun vc-add-triple (name file rev) 927(defun vc-add-triple (name file rev)