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

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

modify-coding-system & compressed files


From: Karl Berry
Subject: modify-coding-system & compressed files
Date: Sat, 12 May 2001 10:58:16 -0400

I'd like to suggest that more extensions for compressed files be added
as 'no-conversion to file-coding-system-alist (or even
auto-coding-alist).  Along the lines of:

(modify-coding-system-alist 'file "\\.gz\\'" 'no-conversion)
(modify-coding-system-alist 'file "\\.Z\\'" 'no-conversion)
(modify-coding-system-alist 'file "\\.bz\\'" 'no-conversion)
(modify-coding-system-alist 'file "\\.bz2\\'" 'no-conversion)

I don't think it can ever be a good thing to do eol conversion in the
midst of compressed bytes?

This came up while I was working on crypt++.el, which attaches itself to
find-file-hooks.  It was not getting the actual bytes in the file in
some cases, because eol conversion had happened.

It would be even better if the algorithm could somehow be improved so
that we did not have to rely on file extensions.  On the other hand, I
suppose the bytes around the eol's could be almost anything.  Perhaps
it would work to look for the compressed formats' magic numbers?  That
won't help with encrypted files, 

Below is one example of this.  It is a bzip2'd /etc/printcap file which
Emacs 20.7 (i686-gnu-linux and sparc-solaris2.7) thinks is a
Macintosh-format file, because of the two \r's.

Thanks,
karl@gnu.org


begin 666 p.bz2
M0EIH.3%!62936?5T1]```$7?@``P:./;TCHEW@2_[__N0`'UJK;MNW"202GI
MJ;3)IZA,FF@>H&U!H--'H@21$Q":$:::#0`,AD>IHTT`)%332,DR;0F:$R#3
M09,30P3U`24B:>IZCU`:`&AH````#`EU`E9D5[O,H2A_.F@C:,.;?F_WUBFU
M0S['FUDM\\28></?!,WTW@1VX+YYL6;#A-T9!(9=8QP0\IGT3\6FTV6ETN"@
MO9'?IGE6158+*K0RT(YX59$/6%"HNV.%LDBHNUGE3H:FK'8_`ASX.1J5,7QB
M^#(]02D14$K;;&?!M&8]Y4<C[/0E(KP&?1A('V:".XM(%)!>@);QV33>X<6B
M(>JTW:H-.ZY,S@?S&QM0*["ZA-@UE1%$8#'JH'HFK\H1/J4,V'$%HT",4M]Y
M7,=:,8G3%9$HXVM7U"LPJM#.DP?H9>=\:J5I1)#^\*RIZ"LLV\@XJFH4[K;+
MC"!@B>HS`]I23DT2C#7"@JQ(@$0N.A&Y]82A1&8I:IP(&1<SI5#&7C66*H,(
MTG0"CRCEN,YA%%`EKL?(SQ19<SDEES#A$,0C(9YF3%Y-E[$QH&FJ!$@Y+$SI
MA2@BI'`F(E%Q5&-$V167"*6IUC/OAH8&)X"1&X=8B%@J5$I$QCX5!Z^N5`:B
=8(AB0Q,M(VE]KR:/3`EEDK_@_B[DBG"A(>KHCZ``
`
end



reply via email to

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