From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: Re: backup-buffer-copy loops if old backup can't be deleted Date: Tue, 21 Aug 2007 16:37:32 +0200 Message-ID: <46CAF8AC.9070809@gmx.at> References: <46CAD810.3050904@gmx.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1187707171 28976 80.91.229.12 (21 Aug 2007 14:39:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Aug 2007 14:39:31 +0000 (UTC) To: Martin von Gagern , bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 21 16:39:30 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1INUt9-0006xc-TR for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Aug 2007 16:39:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1INUt9-0001es-Ch for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Aug 2007 10:39:23 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1INUsd-0001QS-0p for bug-gnu-emacs@gnu.org; Tue, 21 Aug 2007 10:38:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1INUsa-0001PU-HN for bug-gnu-emacs@gnu.org; Tue, 21 Aug 2007 10:38:48 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1INUsa-0001PO-6r for bug-gnu-emacs@gnu.org; Tue, 21 Aug 2007 10:38:48 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1INUsa-0004MX-2l for bug-gnu-emacs@gnu.org; Tue, 21 Aug 2007 10:38:48 -0400 Original-Received: (qmail invoked by alias); 21 Aug 2007 14:38:46 -0000 Original-Received: from N803P004.adsl.highway.telekom.at (EHLO [62.47.44.68]) [62.47.44.68] by mail.gmx.net (mp039) with SMTP; 21 Aug 2007 16:38:46 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX194M7oIzdV4U058XoYH1W6u4M5BXtfQpbrTTjYoYQ U+8FXVYi8sCysh User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: <46CAD810.3050904@gmx.net> X-Y-GMX-Trusted: 0 X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:16407 Archived-At: > 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.