emacs-devel
[Top][All Lists]
Advanced

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

Re: vc mode enhancement proposal


From: Kevin Rodgers
Subject: Re: vc mode enhancement proposal
Date: Sun, 20 Jul 2008 10:11:04 -0600
User-agent: Thunderbird 2.0.0.14 (Macintosh/20080421)

Neal Becker wrote:
If I edit a version-controlled, hard-linked file, no backup is made (cause
it's version-controlled), and the results is the editing does not break
the hard link.

Sometimes that's what I want.  Other times it's not.

I don't know how to get emacs to break the hard link.

Does this do what you want:

(defun vc-backup-by-copying-when-linked ()
  "Set `vc-make-backup-files' according to the visited file.
If the visited file has multiple names, set the buffer-local value of
`vc-make-backup-files' to t.  See `backup-by-copying-when-linked'."
  (let ((real-file-name (file-chase-links buffer-file-name)))
    (when (> (file-nlinks real-file-name) 1)
      (set (make-local-variable 'vc-make-backup-files) t))))

(add-hook 'find-file-hook 'vc-backup-by-copying-when-linked)

What I think we need is to add vc-make-backups-when-linked.

--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

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