[Top][All Lists]

[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.
;;; causes "%sRCS/%s,v" and "%sRCS/%s" templates to fail because of the
;;; "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
;;; 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
             ;; the check for the identical file. This also allows using
             ;; vc-rcs-master-templates.
                (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

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


reply via email to

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