diff lisp/pcvs.el @ 50965:c1e6923f4f9b

(cvs-make-cvs-buffer): Add the tag info. (cvs-mode): Prevent pilot-error.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 13 May 2003 15:22:39 +0000
parents d20464e3d617
children d79cc0e092b2
line wrap: on
line diff
--- a/lisp/pcvs.el	Tue May 13 14:30:58 2003 +0000
+++ b/lisp/pcvs.el	Tue May 13 15:22:39 2003 +0000
@@ -444,12 +444,17 @@
 	 (setq default-directory dir)
 	 (setq buffer-read-only nil)
 	 (erase-buffer)
-	 (insert "\
-Repository : " (directory-file-name (cvs-get-cvsroot)) "
-Module     : " (cvs-get-module) "
-Working dir: " (abbreviate-file-name dir) "
-
-")
+	 (insert "Repository : " (directory-file-name (cvs-get-cvsroot))
+		 "\nModule     : " (cvs-get-module)
+		 "\nWorking dir: " (abbreviate-file-name dir)
+		 (if (not (file-readable-p "CVS/Tag")) "\n"
+		   (let ((tag (cvs-file-to-string "CVS/Tag")))
+		     (cond
+		      ((string-match "\\`T" tag)
+		       (concat "\nTag        : " (substring tag 1)))
+		      ((string-match "\\`D" tag)
+		       (concat "\nDate       : " (substring tag 1)))
+		      ("")))))
 	 (setq buffer-read-only t)
 	 (cvs-mode)
 	 (set (make-local-variable 'list-buffers-directory) buffer-name)
@@ -1059,7 +1064,7 @@
   (cvs-prefix-set 'cvs-force-command arg))
 
 (put 'cvs-mode 'mode-class 'special)
-(define-derived-mode cvs-mode fundamental-mode "CVS"
+(define-derived-mode cvs-mode nil "CVS"
   "Mode used for PCL-CVS, a frontend to CVS.
 Full documentation is in the Texinfo file."
   (setq mode-line-process
@@ -1068,6 +1073,8 @@
 	       ("" cvs-branch-prefix (cvs-secondary-branch-prefix
 				      ("->" cvs-secondary-branch-prefix))))
 	  " " cvs-mode-line-process))
+  (if buffer-file-name
+      (error "Use M-x cvs-quickdir to get a *cvs* buffer."))
   (buffer-disable-undo)
   ;;(set (make-local-variable 'goal-column) cvs-cursor-column)
   (set (make-local-variable 'revert-buffer-function) 'cvs-mode-revert-buffer)