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: relative backup-directory-alist backup directories are not created correctly via ange-ftp Date: Mon, 2 Sep 2002 19:17:40 +0100 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: <80256C28.0064633E.00@ruddick> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: main.gmane.org 1030990352 29357 127.0.0.1 (2 Sep 2002 18:12:32 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 2 Sep 2002 18:12:32 +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 17lvgd-0007dO-00 for ; Mon, 02 Sep 2002 20:12:31 +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 17lviA-0004Ql-00; Mon, 02 Sep 2002 14:14:06 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17lvhu-0004NL-00 for bug-gnu-emacs@gnu.org; Mon, 02 Sep 2002 14:13:50 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17lvhr-0004MN-00 for bug-gnu-emacs@gnu.org; Mon, 02 Sep 2002 14:13:49 -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 17lvhq-0004MJ-00 for bug-gnu-emacs@gnu.org; Mon, 02 Sep 2002 14:13:46 -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 19:10:22 +0100 Original-Received: from ruddick (notes-gw.orange.co.uk [172.16.133.18]) by bit.orange.co.uk with SMTP id g82IDft09969 for ; Mon, 2 Sep 2002 19:13:42 +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:3378 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:3378 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. *******************************************************************************