help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NTemacs doesn't understand RCS


From: Jonathan Freidin
Subject: Re: NTemacs doesn't understand RCS
Date: Wed, 22 Dec 2004 00:47:46 -0500

;;; Inspired by a post from Kevin Rodgers.

;;; Fix a problem in Kevin's code, that the paths in vc-rcs-master-templates
;;; are relative to the parent of the file or directory in the RCS link.
This
;;; causes "%sRCS/%s,v" and "%sRCS/%s" templates to fail because of the
extra
;;; "RCS". A "%s%s" (not in vc-rcs-master-templates) also fails because
;;; vc-check-master-templates ensures that the master file isn't the same as
;;; the source file, and it is in the way Kevin used it. Most everything
else
;;; is the way Kevin wrote it.

(defun vc-rcs-template-fn (directory file)
  "Return non-nil if FILE in DIRECTORY is under RCS control."
  (if (file-regular-p (expand-file-name "RCS" directory))
      (let ((rcs-directory
             ;; Start in the parent directory so the template doesn't fail
on
             ;; the check for the identical file. This also allows using
             ;; vc-rcs-master-templates.
             (concat
              (with-temp-buffer
                (insert-file-contents (expand-file-name "RCS" directory))
                (buffer-substring (goto-char (point-min))
                                  (progn (end-of-line) (point))))
              "/..")))
        ;; in case rcs-directory is relative:
        (setq rcs-directory
              (expand-file-name rcs-directory directory))
        ;; check rcs-directory/FILE against the default templates:
        (if (file-directory-p rcs-directory)
            (vc-check-master-templates (expand-file-name file rcs-directory)
                                       (remq 'vc-rcs-template-fn
                                             vc-rcs-master-templates))))))

(setq vc-rcs-master-templates
      (cons 'vc-rcs-template-fn vc-rcs-master-templates))

Jonathan






reply via email to

[Prev in Thread] Current Thread [Next in Thread]