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 08:50:13 +0200 Message-ID: <46CA8B25.3030001@gmx.at> References: <46C9F265.1070902@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 1187679033 16110 80.91.229.12 (21 Aug 2007 06:50:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Aug 2007 06:50:33 +0000 (UTC) To: bug-gnu-emacs@gnu.org, Martin von Gagern Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 21 08:50:29 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 1INNZJ-00045Z-FJ for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Aug 2007 08:50:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1INNZI-0000R9-P9 for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Aug 2007 02:50:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1INNZG-0000Nz-JP for bug-gnu-emacs@gnu.org; Tue, 21 Aug 2007 02:50:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1INNZF-0000M6-RN for bug-gnu-emacs@gnu.org; Tue, 21 Aug 2007 02:50:21 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1INNZF-0000Lt-FV for bug-gnu-emacs@gnu.org; Tue, 21 Aug 2007 02:50:21 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1INNZE-0002RL-LG for bug-gnu-emacs@gnu.org; Tue, 21 Aug 2007 02:50:21 -0400 Original-Received: (qmail invoked by alias); 21 Aug 2007 06:50:18 -0000 Original-Received: from N956P008.adsl.highway.telekom.at (EHLO [62.47.63.104]) [62.47.63.104] by mail.gmx.net (mp030) with SMTP; 21 Aug 2007 08:50:18 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/t6QRykWTtZYIAV+EFKiSePw2LY3HBOdP60rmoIS Pw+TZy9cXRrgsI User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: <46C9F265.1070902@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:16403 Archived-At: > The bug occurs when there is a backup file FILE~ for some FILE the user > modified and wants to save. If the user doesn't have the privileges to > unlink FILE~, it will try over and over again, resulting in an infinite > loop. Pressing C-g gets it out of the loop, but the modifications still > haven't been saved. Backtraces always mention backup-buffer-copy, I > guess that's where the actual loop happens. I suppose the `file-error' handler of `backup-buffer-copy' (while (condition-case () (progn (condition-case nil (delete-file to-name) (file-error nil)) (copy-file from-name to-name nil t) nil) (file-already-exists t)) ;; The file was somehow created by someone else between ;; `delete-file' and `copy-file', so let's try again. nil)) will ignore any error in `delete-file'. The subsequent `copy-file' will trigger a `file-already-exists' error and Emacs continues to loop. In practice, the `file-already-exists' error is always due to a failure to delete `to-name' and hardly ever to some strange power creating files in between. Likely the `file-error' handler of `backup-buffer' will encounter a similar fate when `backupname' can't be deleted by `backup-buffer-copy'.