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

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

Re: backup-buffer-copy loops if old backup can't be deleted


From: martin rudalics
Subject: Re: backup-buffer-copy loops if old backup can't be deleted
Date: Tue, 21 Aug 2007 16:37:32 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> There now is a patch to fix this, provided by Ulrich Mueller.
> Original URL: http://bugs.gentoo.org/attachment.cgi?id=128742
>
> =================== emacs-22.1-backup-buffer.patch ===================
> --- emacs-22.1.orig/lisp/files.el  2007-05-25 14:43:31.000000000 +0200
> +++ emacs-22.1/lisp/files.el       2007-08-21 08:26:36.000000000 +0200
> @@ -3119,9 +3119,8 @@ backup-buffer-copy (from-name to-name modes)
>      (set-default-file-modes ?\700)
>      (while (condition-case ()
>                 (progn
> -                 (condition-case nil
> -                     (delete-file to-name)
> -                   (file-error nil))
> +                 (and (file-exists-p to-name)
> +                      (delete-file to-name))
>                   (copy-file from-name to-name nil t)
>                   nil)
>               (file-already-exists t))
> =============== end of  emacs-22.1-backup-buffer.patch ===============

Did you apply that patch?  Suppose the file to-name exists but cannot be
deleted.  `copy-file' will raise its `file-already-exists' error and you
remain trapped in that loop.

You have to either change the backup file's permissions from within the
`condition-case' or mandate error handling up to `backup-buffer' where
it attempts to do the (convert-standard-filename "~/%backup%~") stuff.

I can't test these solutions here since my file system doesn't provide
permissions.





reply via email to

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