[PATCH] arc-mode: set coding system
Aidan Kehoe
kehoea at parhasard.net
Fri Aug 18 06:49:34 EDT 2006
Ar an seachtú lá déag de mí Lúnasa, scríobh René Kyllingstad:
> arc-mode doesn't set coding-system-for-read when opening files inside a
> zip file. So when opening pictures I often get format error due to ascii
> conversion, as my default coding-system is raw-text.
>
> The patch below sets coding-system-for-read while reading the file, and
> buffer-file-coding-system on the resulting buffer. Works for me.
[...]
> + (coding-system-for-read (find-file-coding-system-for-read-from-filename iname))
This should duplicate what insert-file-contents does, that is, it should be
the following on 21.5:
(let ((coding-system-for-read
(or
;; #1.
coding-system-for-read
;; #2.
(run-hook-with-args-until-success
'insert-file-contents-pre-hook
filename visit)
;; #3.
(find-file-coding-system-for-read-from-filename filename)
;; #4.
buffer-file-coding-system-for-read
;; #5.
'raw-text))
It’d be more sensible to abstract that out into a separate function in
code-files.el, because tar-mode.el, mcrypt and so on all really should be
calling it.
--
Santa Maradona, priez pour moi!
More information about the XEmacs-Beta
mailing list