[comp.emacs] RCS and emacs

douglis@UCBARPA.BERKELEY.EDU (Fred Douglis) (01/06/87)

Speaking of using RCS, does anyone have any interfaces between RCS &
emacs?  Sometimes I edit a file that is not locked, and I need to go
to a shell, cd, check out the file, and revert the buffer containing
the file.  Other times, I want to check in a revision but keep editing
the file, and if I manually save the file and check it in, emacs
later complains that the file has been touched.

If anyone has the routines to deal with this stuff intelligently, I'd
be grateful.  (If not I may do it myself, but not in the immediate
future.) 

- Fred -

phc@RENOIR.BERKELEY.EDU (Pehong Chen) (01/06/87)

I have hacked up an RCS emacs interface.  Let me know if you're interested.

- Pehong -

eichin@ATHENA.MIT.EDU ("Mark W. Eichin") (01/06/87)

I am interested in your RCS emacs interface. How can I get a copy?
		Mark Eichin
		<eichin@ATHENA.MIT.EDU>

tower@PREP.AI.MIT.EDU (Leonard H. Tower Jr.) (01/06/87)

There is a mock-lisp rcs interface in the file /u2/emacs/lisp/rcs.ml
on prep.ai.mit.edu.  It might be a starting point for a GNU Emacs Lisp
interface. 

suna@kossvax.keio.JUNET (Hideki Sunahara) (01/09/87)

I wrote a package for RCS on Unipress Emacs few year's ago.
If this package satisfy you, please use this one.
But, you can not get money from this package.

			    Hideki Sunahara
			    Keio University, in JAPAN.
			    CSNET: suna%koeavax.keio.junet@utokyo-relay

----------------------------(CUT HERE)---------------------------------
; Unix Emacs package for RCS files
; Copyright 1984 by Hideki Sunahara (Keio University)
; Distribution is free, but you can not get money from this.
; Do not delete these comment lines.
;
; functions:
;   rcs-write		write current file (management with RCS).
;   do-checkout		do checkout when current file is read-only.
; 
(defun
    (rcs-write
	(if (error-occurred (write-current-file))
	    (if buffer-is-modified
		(do-checkout (current-buffer-name) (current-file-name))))
	(novalue))
    (do-checkout c-buf co-fname
	(setq c-buf (arg 1))
	(setq co-fname (arg 2))
	(if (| (file-exists (concat "RCS/" c-buf ",v"))
		(file-exists (concat co-fname ",v")))
	    (progn
		(message "please wait, now locking revision.")
		(sit-for 0)
		(execute-monitor-command
		    (concat "chmod u+w " co-fname "; rcs -l " co-fname))
		(message "done!!")
		(pop-to-buffer c-buf)
		(write-current-file))
	    (error-message
		(concat "File " c-buf " cannot be written"))))
    (with-rcs fname
	(setq fname (current-file-name))
	(local-rebind "rcs-write" "write-current-file")
;	(local-bind-to-key "rcs-write" "\^X\^S")
	; check file-exists when not found do co without lock
	(if (! (file-exists fname))
	    (if (| (file-exists (concat "RCS/" (current-buffer-name) ",v"))
		    (file-exists (concat fname ",v")))
		(progn
		    (message "please wait, now doing check out...")
		    (sit-for 0)
		    (execute-monitor-command (concat "co " fname))
		    (visit-file fname)
		    (message "done!!")
		))))
    
)