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

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

`auto-coding-alist' on remote files


From: Ilya N. Golubev
Subject: `auto-coding-alist' on remote files
Date: Fri, 31 Oct 2003 19:57:23 +0300

`auto-coding-alist' contains regexps to be matched against names of
files being inserted in buffer.  Since, e. g., `no-conversion' should
be used for any `.tar' files, local or remote, the regexp match should
be done both for local file names and remote ones as processed by
`ange-ftp' or similar package.

So file names being matched should be original ones specified by user
to `find-file' and like, even when the file is remote and its data is
retrieved by file name handler from `ange-ftp'.

Currently this is not the case.  `auto-coding-alist-lookup' gets
called inside `ange-ftp' filename handler on name of temporary file
where `ange-ftp' puts file data retrieved from remote host.  So read
coding is not set properly for remote archive files.

Trying to retain file name suffixes while choosing temporary file
names will help only partially.  The regexps do not have to check
suffixes only, so we never know what particular characteristics of
file name should be retained.

Simply calling `auto-coding-alist-lookup' before
`insert-file-contents' and then setting `coding-system-for-read' may
help or not help.  If `coding-system-for-read' will only be used for
file it was intended for, that is, for (temporary) local file
eventually obtained by file name handlers, it is fine.  But, AFAIK,
nothing forbids file name handler to depend on some additional
(configuration?) data, which are taken from additional files, and
coding system defaults used while reading files may affect that data.

So perhaps the fix is a radical change, involving passing coding
system (already returned by `auto-coding-alist-lookup') to file name
handlers of `insert-file-contents' so that they apply it only to the
file they are inserting, after retrieving its data.




reply via email to

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