unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Backup remote files to local host
@ 2009-04-04  1:54 Ian Eure
  2009-04-05  8:19 ` Michael Albinus
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Eure @ 2009-04-04  1:54 UTC (permalink / raw)
  To: help-gnu-emacs

I want to put backups of files I edit via Tramp on my local machine,  
rather than on the remote one, since I expect this to be a bit faster.

It seems to be non-trivial. I did (setq tramp-backup-directory-alist  
backup-directory-alist), but this still places the backups on the  
remote host. According to the docs:

"If a Tramp file is backed up, and DIRECTORY is a local file name, the  
backup directory is prepended with Tramp file name prefix (method,  
user, host) of file."

i.e. it won't do what I want. I suppose I could set myself up for  
password-less sudo and prepend the cdrs of backup-directory-alist with  
"/sudo:ieure@localhost:", but this seems like an extremely


How can I get the desired behavior?

  - Ian




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

* Re: Backup remote files to local host
  2009-04-04  1:54 Backup remote files to local host Ian Eure
@ 2009-04-05  8:19 ` Michael Albinus
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Albinus @ 2009-04-05  8:19 UTC (permalink / raw)
  To: Ian Eure; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 576 bytes --]

Ian Eure <ian@digg.com> writes:

> I want to put backups of files I edit via Tramp on my local machine,
> rather than on the remote one, since I expect this to be a bit faster.

There is an error in Tramp (thanks for reporting!). The appended patch
shall fix it; likely you need to adjust the line numbers, because it is
for Tramp 2.1.16-pre.

Then you can simply say

(add-to-list 'backup-directory-alist
             (cons tramp-file-name-regexp "~/.emacs.d/backups/"))

I'll commit it later today to the Emacs and Tramp CVS repositories.

>  - Ian

Best regards, Michael.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1095 bytes --]

*** /home/albinus/src/tramp/lisp/tramp.el.~2.681.~	2009-03-23 15:26:12.000000000 +0100
--- /home/albinus/src/tramp/lisp/tramp.el	2009-04-05 10:08:55.000000000 +0200
***************
*** 4227,4233 ****
      (let ((backup-directory-alist
  	   ;; Emacs case
  	   (when (boundp 'backup-directory-alist)
! 	     (if (boundp 'tramp-backup-directory-alist)
  		 (mapcar
  		  '(lambda (x)
  		     (cons
--- 4227,4233 ----
      (let ((backup-directory-alist
  	   ;; Emacs case
  	   (when (boundp 'backup-directory-alist)
! 	     (if (symbol-value 'tramp-backup-directory-alist)
  		 (mapcar
  		  '(lambda (x)
  		     (cons
***************
*** 4243,4249 ****
  	  (bkup-backup-directory-info
  	   ;; XEmacs case
  	   (when (boundp 'bkup-backup-directory-info)
! 	     (if (boundp 'tramp-bkup-backup-directory-info)
  		 (mapcar
  		  '(lambda (x)
  		     (nconc
--- 4243,4249 ----
  	  (bkup-backup-directory-info
  	   ;; XEmacs case
  	   (when (boundp 'bkup-backup-directory-info)
! 	     (if (symbol-value 'tramp-bkup-backup-directory-info)
  		 (mapcar
  		  '(lambda (x)
  		     (nconc

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

end of thread, other threads:[~2009-04-05  8:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-04  1:54 Backup remote files to local host Ian Eure
2009-04-05  8:19 ` Michael Albinus

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).