comparison lisp/pcvs.el @ 32309:bb96b2ece52b

(cvs-append-to-ignore, cvs-vc-command-advice) (vc-post-command-functions): Remove old-VC compatibility code.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 08 Oct 2000 19:11:34 +0000
parents 418444640a1e
children 1fd2c9a94ec3
comparison
equal deleted inserted replaced
32308:cd03345c07c1 32309:bb96b2ece52b
12 ;; (Greg Klanderman) greg@alphatech.com 12 ;; (Greg Klanderman) greg@alphatech.com
13 ;; (Jari Aalto+mail.emacs) jari.aalto@poboxes.com 13 ;; (Jari Aalto+mail.emacs) jari.aalto@poboxes.com
14 ;; Maintainer: (Stefan Monnier) monnier+lists/cvs/pcl@flint.cs.yale.edu 14 ;; Maintainer: (Stefan Monnier) monnier+lists/cvs/pcl@flint.cs.yale.edu
15 ;; Keywords: CVS, version control, release management 15 ;; Keywords: CVS, version control, release management
16 ;; Version: $Name: $ 16 ;; Version: $Name: $
17 ;; Revision: $Id: pcvs.el,v 1.10 2000/09/29 03:14:36 monnier Exp $ 17 ;; Revision: $Id: pcvs.el,v 1.11 2000/10/05 22:45:59 monnier Exp $
18 18
19 ;; This file is part of GNU Emacs. 19 ;; This file is part of GNU Emacs.
20 20
21 ;; GNU Emacs is free software; you can redistribute it and/or modify 21 ;; GNU Emacs is free software; you can redistribute it and/or modify
22 ;; it under the terms of the GNU General Public License as published by 22 ;; it under the terms of the GNU General Public License as published by
1703 (save-window-excursion 1703 (save-window-excursion
1704 (set-buffer (find-file-noselect (expand-file-name ".cvsignore" dir))) 1704 (set-buffer (find-file-noselect (expand-file-name ".cvsignore" dir)))
1705 (when (ignore-errors 1705 (when (ignore-errors
1706 (and buffer-read-only 1706 (and buffer-read-only
1707 (eq 'CVS (vc-backend buffer-file-name)) 1707 (eq 'CVS (vc-backend buffer-file-name))
1708 (not (if (fboundp 'vc-editable-p) 1708 (not (vc-editable-p buffer-file-name))))
1709 (vc-editable-p buffer-file-name)
1710 (vc-locking-user buffer-file-name)))))
1711 ;; CVSREAD=on special case 1709 ;; CVSREAD=on special case
1712 (vc-toggle-read-only)) 1710 (vc-toggle-read-only))
1713 (goto-char (point-max)) 1711 (goto-char (point-max))
1714 (unless (zerop (current-column)) (insert "\n")) 1712 (unless (zerop (current-column)) (insert "\n"))
1715 (insert str "\n") 1713 (insert str "\n")
2050 2048
2051 ;; 2049 ;;
2052 ;; hook into VC 2050 ;; hook into VC
2053 ;; 2051 ;;
2054 2052
2055 (if (boundp 'vc-post-command-functions) 2053 (add-hook 'vc-post-command-functions 'cvs-vc-command-advice)
2056 ;; Hook into the new VC. 2054
2057 (add-hook 'vc-post-command-functions 2055 (defun cvs-vc-command-advice (command file flags)
2058 (lambda (cmd file flags) 2056 (when (and (equal command "cvs")
2059 (cvs-vc-command-advice (current-buffer) cmd (car flags))))
2060 ;; Hook into the old VC.
2061 (defadvice vc-simple-command (after pcl-cvs-vc activate)
2062 (cvs-vc-command-advice "*vc-info*" (ad-get-arg 1) (ad-get-arg 3)))
2063 (defadvice vc-do-command (after pcl-cvs-vc activate)
2064 (cvs-vc-command-advice (if (eq t (ad-get-arg 0)) (current-buffer)
2065 (or (ad-get-arg 0) "*vc*"))
2066 (ad-get-arg 2)
2067 (if (stringp (ad-get-arg 4))
2068 (ad-get-arg 4)
2069 (ad-get-arg 5)))))
2070
2071 (defun cvs-vc-command-advice (buffer command cvscmd)
2072 (when (and (setq buffer (get-buffer buffer))
2073 (equal command "cvs")
2074 ;; don't parse output we don't understand. 2057 ;; don't parse output we don't understand.
2075 (member cvscmd cvs-parse-known-commands)) 2058 (member (car flags) cvs-parse-known-commands))
2076 (save-excursion 2059 (save-excursion
2077 (let ((dir (with-current-buffer buffer default-directory)) 2060 (let ((buffer (current-buffer))
2061 (dir default-directory)
2078 (cvs-from-vc t)) 2062 (cvs-from-vc t))
2079 (dolist (cvs-buf (buffer-list)) 2063 (dolist (cvs-buf (buffer-list))
2080 (set-buffer cvs-buf) 2064 (set-buffer cvs-buf)
2081 ;; look for a corresponding pcl-cvs buffer 2065 ;; look for a corresponding pcl-cvs buffer
2082 (when (and (eq major-mode 'cvs-mode) 2066 (when (and (eq major-mode 'cvs-mode)