On 2011-09-26, Uwe Brauer <oub(a)mat.ucm.es> wrote:
I find the following very annoying:
if a file is under version control (RCS) and if the file
[ actually always]
Then when I checkin the cursor always lands at the beginning
of the buffer, of course I could put in more of these fields
I have the following in my .emacs (or whatever). It's not quite
perfect, but it's good enough to avoid major annoyance:
; quick hack to make checkout keep point roughly in place
(defun vc-checkout (file &optional writable rev)
"Retrieve a copy of the latest version of the given file."
;; If ftp is on this system and the name matches the ange-ftp format
;; for a remote file, the user is trying something that won't work.
(if (and (string-match "^/[^/:]+:" file) (vc-find-binary "ftp"))
(error "Sorry, you can't check out files over FTP"))
(let ((p (point)))
(vc-backend-checkout file writable rev)
(vc-resynch-buffer file t t)
(goto-char p)))
it's many years old, so I haven't kept it up to date with any vc
changes, but it still works for me!
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta