[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Loading souce Elisp faster
From: |
Kenichi Handa |
Subject: |
Re: Loading souce Elisp faster |
Date: |
Wed, 27 Feb 2013 13:18:16 +0900 |
In article <address@hidden>, Stefan Monnier <address@hidden> writes:
> > Why not assuming it is utf-8? ;-)
> > Unless there is a "-*- coding: ..." comment.
> Hmm... that's very appealing, but what about those Elisp files that have
> a "coding:" tag at the end of the file? Or are these so rare it's not
> worth the trouble to worry about them?
Isn't it ok to make it faster to load only such a file that
has "-*- coding: utf-8-unix -*-", and document it clearly.
The following is just an quick idea.
(defun load-source-file-internal (fullname file &optional noerror nomessage)
(let (need-decoding)
(with-temp-buffer
(let ((coding-system-for-read 'no-conversion))
(insert-file-contents fullname nil 0 256) ; or 512, 1024?
(or (coding-tag-is-utf-8-unix-p) ; this function must be implemented.
(setq need-decoding t))))
(if need-decoding
(load-with-code-conversion fullname file noerror nomessage)
(load fullname noerror nomessage nil nil
t ; new optional argument to tell Fopen to load
; this file without through code-conversion.
))))
(setq load-source-file-function 'load-source-file-internal)
---
Kenichi Handa
address@hidden
- Re: Loading souce Elisp faster, (continued)
- Re: Loading souce Elisp faster, Paul Eggert, 2013/02/25
- Re: Loading souce Elisp faster, Xue Fuqiao, 2013/02/25
- Re: Loading souce Elisp faster, Eli Zaretskii, 2013/02/25
- Re: Loading souce Elisp faster, Paul Eggert, 2013/02/25
- Re: Loading souce Elisp faster, Werner LEMBERG, 2013/02/26
- Re: Loading souce Elisp faster, Andreas Schwab, 2013/02/26
- Re: Loading souce Elisp faster, Leo Liu, 2013/02/25
- Re: Loading souce Elisp faster, Ted Zlatanov, 2013/02/25
- Re: Loading souce Elisp faster,
Kenichi Handa <=
- Re: Loading souce Elisp faster, Stefan Monnier, 2013/02/27
- RE: Loading souce Elisp faster, Drew Adams, 2013/02/27
- Re: Loading souce Elisp faster, Werner LEMBERG, 2013/02/27
- Re: Loading souce Elisp faster, Richard Stallman, 2013/02/27
- Re: Loading souce Elisp faster, Kenichi Handa, 2013/02/28
- Re: Loading souce Elisp faster, Richard Stallman, 2013/02/28
Re: Loading souce Elisp faster, Achim Gratz, 2013/02/25
Re: Loading souce Elisp faster, Richard Stallman, 2013/02/25