unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* vc mode enhancement proposal
@ 2008-07-18 11:28 Neal Becker
  2008-07-20 16:11 ` Kevin Rodgers
  0 siblings, 1 reply; 2+ messages in thread
From: Neal Becker @ 2008-07-18 11:28 UTC (permalink / raw)
  To: emacs-devel

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.

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





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: vc mode enhancement proposal
  2008-07-18 11:28 vc mode enhancement proposal Neal Becker
@ 2008-07-20 16:11 ` Kevin Rodgers
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2008-07-20 16:11 UTC (permalink / raw)
  To: emacs-devel

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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-07-20 16:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-18 11:28 vc mode enhancement proposal Neal Becker
2008-07-20 16:11 ` Kevin Rodgers

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).