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

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

relative backup-directory-alist backup directories are not created corr


From: christopher . moore
Subject: relative backup-directory-alist backup directories are not created correctly via ange-ftp
Date: Mon, 2 Sep 2002 19:17:40 +0100

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.
*******************************************************************************





reply via email to

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