Created
April 15, 2010 12:12
-
-
Save hnw/367021 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; .emacs先頭で、.emacs.elcの方が古かったら再作成する。 | |
;; (ってこのタイミングで再作成しても間に合わない気がする…。) | |
(if (file-newer-than-file-p "~/.emacs" "~/.emacs.elc") | |
(save-excursion | |
(byte-compile-file "~/.emacs"))) | |
;; .emacsをsaveしたらelcを作る | |
(add-hook 'after-save-hook | |
(function (lambda () | |
(if (string= (file-truename (expand-file-name "~/.emacs")) | |
(file-truename (buffer-file-name))) | |
(save-excursion | |
(byte-compile-file "~/.emacs")))))) | |
;; その他好きな処理 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment