From: christopher.moore@orange.co.uk
Subject: Re: relative backup-directory-alist backup directories are not created correctly via ange-ftp
Date: Mon, 2 Sep 2002 20:07:23 +0100 [thread overview]
Message-ID: <80256C28.0068F826.00@ruddick> (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.
*******************************************************************************
next reply other threads:[~2002-09-02 19:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-02 19:07 christopher.moore [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-09-02 18:17 relative backup-directory-alist backup directories are not created correctly via ange-ftp christopher.moore
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=80256C28.0068F826.00@ruddick \
--to=christopher.moore@orange.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.