From d2ce5467c31ea4b505c1414307fdf374ab53f550 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 14 Apr 2011 20:48:36 +0200 Subject: Bytecompile Byte-compile and recompile all modules in .emacs.d and .emacs.d/elisp --- emacs | 28 +++++++++++++++++++++------- emacs.d/00-paths.el | 3 --- emacs.d/20-folding.el | 22 ++++++++++------------ 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/emacs b/emacs index fbdac85..887fbd3 100644 --- a/emacs +++ b/emacs @@ -1,14 +1,28 @@ ;; -*- mode: Emacs-Lisp; -*- (setq load-dir "~/.emacs.d/") -(setq myfiles (directory-files load-dir nil "^[0-9]\\{2\\}-\.*el$")) +(setq elisp-dir (concat load-dir "elisp/")) -(while myfiles - (let ((myfilename (concat load-dir (car myfiles)))) - (if (not (file-exists-p (concat myfilename "c"))) - (byte-compile-file myfilename)) - (load (substring myfilename 0 (- (length myfilename) 3))) - (setq myfiles (cdr myfiles)))) +(setq my-elisp-files + (directory-files elisp-dir nil "\\.el$")) +(setq my-files (directory-files load-dir nil "^[0-9]\\{2\\}-\.*el$")) + +;; Compile 3rd party elisp files +(byte-recompile-directory elisp-dir) +(while my-elisp-files + (let ((my-elisp-file-name (concat elisp-dir (car my-elisp-files)))) + (if (not (file-exists-p (concat my-elisp-file-name "c"))) + (byte-compile-file my-elisp-file-name)) + (setq my-elisp-files (cdr my-elisp-files)))) + +;; Compile my elisp files +(byte-recompile-directory load-dir) +(while my-files + (let ((my-file-name (concat load-dir (car my-files)))) + (if (not (file-exists-p (concat my-file-name "c"))) + (byte-compile-file my-file-name)) + (load (substring my-file-name 0 (- (length my-file-name) 3))) + (setq my-files (cdr my-files)))) (add-to-list 'compilation-finish-functions 'my-comp-finish-function) diff --git a/emacs.d/00-paths.el b/emacs.d/00-paths.el index 1990c59..e883739 100644 --- a/emacs.d/00-paths.el +++ b/emacs.d/00-paths.el @@ -1,5 +1,2 @@ (add-to-list 'load-path "~/.emacs.d/elisp") (add-to-list 'load-path "~/.emacs.d/naquadah-theme") -(add-to-list 'load-path "~/.emacs.d/auto-complete-clang") -(add-to-list 'load-path "~/.emacs.d/nxhtml") -(add-to-list 'load-path "~/.emacs.d/elisp/muse") diff --git a/emacs.d/20-folding.el b/emacs.d/20-folding.el index f59c11a..fcf7cc4 100644 --- a/emacs.d/20-folding.el +++ b/emacs.d/20-folding.el @@ -1,12 +1,10 @@ -(autoload 'folding-mode "folding" "Folding mode" t) - -(add-hook 'folding-mode-hook - (lambda () - (local-set-key [C-tab] 'folding-toggle-show-hide))) - -(add-hook 'c-mode-hook - (lambda () - (folding-mode))) -(add-hook 'emacs-lisp-mode-hook - (lambda () - (folding-mode))) +(if (load "folding") + (progn (add-hook 'folding-mode-hook + (lambda () + (local-set-key [C-tab] 'folding-toggle-show-hide))) + (add-hook 'c-mode-hook + (lambda () + (folding-mode))) + (add-hook 'emacs-lisp-mode-hook + (lambda () + (folding-mode))))) -- cgit v1.2.3-54-g00ecf