diff -u /home/oub/emacs/site-lisp/versch/add-ons/vc-rcs.el /home/oub/emacs/site-lisp/versch/add-ons/vc-rcs-new.el --- /home/oub/emacs/site-lisp/versch/add-ons/vc-rcs.el 2015-09-06 16:19:54.780811291 +0200 +++ /home/oub/emacs/site-lisp/versch/add-ons/vc-rcs-new.el 2015-09-06 16:27:04.662942964 +0200 @@ -106,6 +106,58 @@ :group 'vc-rcs) + +;; new variable for changing the login user + + +(defvar vc-rcs-ask-for-login nil + "*Variable which allows to change the login Id by a y-or-n question.") + +(defvar vc-rcs-login-user nil + "*Variable which saves the value of the rcs user who checks in.") + + +;; since changing the (login) user is not a frequent thing to do, the following functions +;; toggle this behaviour on an off + +;; the following function was written by Adrian Kubala +;; + +(defun make-repeat-command (symbol command-list) + "Command changes with each repetition. +SYMBOL is a symbol unique to this command." + (if (eq last-command symbol) + (set symbol (+ (eval symbol) 1)) + (set symbol 0)) + (if (>= (eval symbol) (length command-list)) + (set symbol 0)) + (call-interactively (nth (eval symbol) command-list)) + (setq this-command symbol)) + + +(defun vc-rcs-set-for-login () + (interactive) + (load-file "~/emacs/site-lisp/versch/vc-change-login.elc") + (setq vc-rcs-ask-for-login t) + (message "Now login will be changed when vc-rcs-checkin is called.")) + +(defun vc-rcs-remove-for-login () + (interactive) + (setq vc-rcs-ask-for-login nil) + (message "Now login will *NOT* be changed when vc-rcs-checkin is called.")) + + +(defun vc-ask-login-or-not () + (interactive) + (make-repeat-command 'vc-ask-login-or-not + '(vc-rcs-set-for-login + vc-rcs-remove-for-login))) + + +;; end of toggling functions + + + ;;; Properties of the backend (defun vc-rcs-revision-granularity () 'file) @@ -309,9 +361,11 @@ ;; It used to be possible to pass in a value for the variable rev, but ;; nothing in the rest of VC used this capability. Removing it makes the ;; backend interface simpler for all modes. -;; +;; modified (defun vc-rcs-checkin (files comment) - "RCS-specific version of `vc-backend-checkin'." + "RCS-specific version of `vc-backend-checkin'. If the variable +vc-rcs-ask-for-login is set to t, function asks for user login. +Useful for collaboration to distinguish different checkins." (let (rev (switches (vc-switches 'RCS 'checkin))) ;; Now operate on the files (dolist (file (vc-expand-dirs files 'RCS)) @@ -331,6 +385,12 @@ ;; if available, use the secure check-in option (and (vc-rcs-release-p "5.6.4") "-j") (concat "-u" rev) + (if vc-rcs-ask-for-login + (if (y-or-n-p (format "Do you want to change the login ")) + (progn + (setq vc-rcs-login-user (read-string "Enter New login: ")) + (concat "-w" vc-rcs-login-user)) + (concat "-m" comment))) (concat "-m" comment) switches) (vc-file-setprop file 'vc-working-revision nil) Diff finished. Sun Sep 6 16:27:33 2015