[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Byte Compile Question
From: |
Xah Lee |
Subject: |
Re: Byte Compile Question |
Date: |
Tue, 31 Jul 2012 05:52:48 -0700 (PDT) |
User-agent: |
G2/1.0 |
byte-compile elisp buffer on save, only if a byte-compiled file
exists.
(defun byte-compile-current-buffer ()
"`byte-compile' current buffer if it's emacs-lisp-mode and compiled
file exists."
(interactive)
(when (and (eq major-mode 'emacs-lisp-mode)
(file-exists-p (byte-compile-dest-file buffer-file-
name)))
(byte-compile-file buffer-file-name)))
(add-hook 'after-save-hook 'byte-compile-current-buffer)
code part from Adolfo Benedetti.
some other tips:
〈Organize Your “dot emacs” Init File in 5 Minutes〉
http://ergoemacs.org/emacs/organize_your_dot_emacs.html
btw, there's lots alternatives on emacswiki.
Xah
On Jul 27, 7:44 am, Perry Smith <pedz...@gmail.com> wrote:
> Hi,
>
> I have the belief that byte compiling only helps with loading files and that
> once they are loaded, the code will execute at the same speed.
>
> Is that correct?
>
> Byte compiling all my personal files is a bit awkward for a couple of
> reasons. I considering not doing it any more but wanted to know all the
> tradeoffs.
>
> If you can, please CC me on your replies.
>
> Thank you,
> Perry Smith