* relative backup-directory-alist backup directories are not created correctly via ange-ftp
@ 2002-09-02 18:17 christopher.moore
0 siblings, 0 replies; 2+ messages in thread
From: christopher.moore @ 2002-09-02 18:17 UTC (permalink / raw)
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.
*******************************************************************************
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: relative backup-directory-alist backup directories are not created correctly via ange-ftp
@ 2002-09-02 19:07 christopher.moore
0 siblings, 0 replies; 2+ messages in thread
From: christopher.moore @ 2002-09-02 19:07 UTC (permalink / raw)
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.
*******************************************************************************
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-09-02 19:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-02 18:17 relative backup-directory-alist backup directories are not created correctly via ange-ftp christopher.moore
-- strict thread matches above, loose matches on Subject: below --
2002-09-02 19:07 christopher.moore
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).