From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: christopher.moore@orange.co.uk Newsgroups: gmane.emacs.bugs Subject: Re: relative backup-directory-alist backup directories are not created correctly via ange-ftp Date: Mon, 2 Sep 2002 20:07:23 +0100 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: <80256C28.0068F826.00@ruddick> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: main.gmane.org 1030993389 4254 127.0.0.1 (2 Sep 2002 19:03:09 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 2 Sep 2002 19:03:09 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17lwTb-00016V-00 for ; Mon, 02 Sep 2002 21:03:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17lwV9-00058z-00; Mon, 02 Sep 2002 15:04:43 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17lwUD-0004eX-00 for bug-gnu-emacs@gnu.org; Mon, 02 Sep 2002 15:03:45 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17lwU9-0004bT-00 for bug-gnu-emacs@gnu.org; Mon, 02 Sep 2002 15:03:44 -0400 Original-Received: from smtpout11.orange.co.uk ([193.35.135.134] helo=dumbledore.orange.co.uk) by monty-python.gnu.org with esmtp (Exim 4.10) id 17lwU9-0004bP-00 for bug-gnu-emacs@gnu.org; Mon, 02 Sep 2002 15:03:41 -0400 Original-Received: from bit.orange.co.uk (bit.orange.co.uk) by dumbledore.orange.co.uk (Content Technologies SMTPRS 4.2.1) with ESMTP id for ; Mon, 2 Sep 2002 20:00:18 +0100 Original-Received: from ruddick (notes-gw.orange.co.uk [172.16.133.18]) by bit.orange.co.uk with SMTP id g82J3bt20961 for ; Mon, 2 Sep 2002 20:03:37 +0100 (BST) X-Lotus-FromDomain: HTLUK Original-To: bug-gnu-emacs@gnu.org Content-Disposition: inline Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:3379 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:3379 And another thing... When the make-directory fails (in files.el's make-backup-file-name-1 function), the 'condition-case' evaluates to 'file', but that value is thrown away: (unless (file-exists-p backup-directory) (condition-case nil (make-directory backup-directory 'parents) (file-error file))) (if (file-name-absolute-p backup-directory) ... The code then continues to try and use the backup directory, even though we know it doesn't exist and cannot be created. The condition-case should probably set backup-directory back to a legal value, such as ".", which we know exists. Chris. ---------------------- Forwarded by Christopher MOORE/IT/HTLUK on 02/09/2002 19:59 --------------------------- Christopher MOORE 02/09/2002 19:17 To: bug-gnu-emacs@gnu.org cc: bcc: Subject: relative backup-directory-alist backup directories are not created correctly via ange-ftp In GNU Emacs 21.2.1 (i386-msvc-nt5.1.2600) of 2002-03-19 on buffy configured using `configure --with-msvc (12.00)' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: ENG locale-coding-system: iso-latin-1 default-enable-multibyte-characters: t I have backup-directory-alist set like this in my .emacs: (custom-set-variables ... '(backup-directory-alist (quote (("." . "Backup")))) ...) When editing files locally, it automatically creates a directory called 'Backup' wherever I edit files and all backup files go into that local Backup directory. However, when I am editing files remotely, using ange-ftp, the directory isn't created. The reason for this is that the call to make-directory in files.el's make-backup-file-name-1 function looks like this: (make-directory backup-directory 'parents) where backup-directory is just the string "Backup" (a relative path name, not an absolute one). As a result, backup-directory doesn't know that it should use any ange-ftp magic (in particular, make-directory's call to (find-file-name-handler dir 'make-directory) returns nil). I found that replacing this line in files.el's definition of make-backup-file-name-1(): ------------------------------------ (make-directory backup-directory 'parents) ------------------------------------ with these 5 lines: ------------------------------------ (make-directory (if (file-name-absolute-p backup-directory) backup-directory (expand-file-name backup-directory (file-name-directory file))) 'parents) ------------------------------------ makes the problem go away, since now we are passing an absolute path to make-directory, including the /user@host:/ prefix, so it can know that it should use ange-ftp to make the directory. You might well find a *nice* fix... Chris. ******************************************************************************* Important. Confidentiality: This communication is intended for the above-named person and may be confidential and/or legally privileged. Any opinions expressed in this communication are not necessarily those of the company. If it has come to you in error you must take no action based on it, nor must you copy or show it to anyone; please delete/destroy and inform the sender immediately. Monitoring/Viruses Orange may monitor all incoming and outgoing emails in line with current legislation. Although we have taken steps to ensure that this email and attachments are free from any virus, we advise that in keeping with good computing practice the recipient should ensure they are actually virus free. Orange PCS Limited is a subsidiary of Orange SA and is registered in England No 2178917, with its address at St James Court, Great Park Road, Almondsbury Park, Bradley Stoke, Bristol BS32 4QJ. *******************************************************************************