|
3 | 3 | ;; Author: IMAKADO <[email protected]> |
4 | 4 | ;; URL: https://github.com/emacs-jp/init-loader/ |
5 | 5 | ;; Version: 0.02 |
| 6 | +;; Package-Requires: ((cl-lib "0.5")) |
6 | 7 |
|
7 | 8 | ;; This file is free software; you can redistribute it and/or modify |
8 | 9 | ;; it under the terms of the GNU General Public License as published by |
|
78 | 79 |
|
79 | 80 | ;;; Code: |
80 | 81 |
|
81 | | -(eval-when-compile (require 'cl)) |
| 82 | +(require 'cl-lib) |
82 | 83 | (require 'benchmark) |
83 | 84 |
|
84 | 85 | ;;; customize-variables |
@@ -140,11 +141,11 @@ example, 00_foo.el, 01_bar.el ... 99_keybinds.el." |
140 | 141 | :type 'regexp) |
141 | 142 |
|
142 | 143 | ;;;###autoload |
143 | | -(defun* init-loader-load (&optional (init-dir init-loader-directory)) |
| 144 | +(cl-defun init-loader-load (&optional (init-dir init-loader-directory)) |
144 | 145 | "Load configuration files in INIT-DIR." |
145 | 146 | (let ((init-dir (init-loader-follow-symlink init-dir)) |
146 | 147 | (is-carbon-emacs nil)) |
147 | | - (assert (and (stringp init-dir) (file-directory-p init-dir))) |
| 148 | + (cl-assert (and (stringp init-dir) (file-directory-p init-dir))) |
148 | 149 | (init-loader-re-load init-loader-default-regexp init-dir t) |
149 | 150 |
|
150 | 151 | ;; Windows |
@@ -177,7 +178,7 @@ example, 00_foo.el, 01_bar.el ... 99_keybinds.el." |
177 | 178 | (when (not window-system) |
178 | 179 | (init-loader-re-load init-loader-nw-regexp init-dir)) |
179 | 180 |
|
180 | | - (case init-loader-show-log-after-init |
| 181 | + (cl-case init-loader-show-log-after-init |
181 | 182 | (error-only (add-hook 'after-init-hook 'init-loader--show-log-error-only)) |
182 | 183 | ('t (add-hook 'after-init-hook 'init-loader-show-log))))) |
183 | 184 |
|
@@ -229,13 +230,13 @@ example, 00_foo.el, 01_bar.el ... 99_keybinds.el." |
229 | 230 | ;; 2011/JUN/12 zqwell Read first byte-compiled file if it exist. |
230 | 231 | ;; See. http://twitter.com/#!/fkmn/statuses/21411277599 |
231 | 232 | (defun init-loader--re-load-files (re dir &optional sort) |
232 | | - (loop for el in (directory-files dir t) |
233 | | - when (and (string-match re (file-name-nondirectory el)) |
234 | | - (or (string-match "elc\\'" el) |
235 | | - (and (string-match "el\\'" el) |
236 | | - (not (locate-library (concat el "c")))))) |
237 | | - collect (file-name-nondirectory el) into ret |
238 | | - finally return (if sort (sort ret 'string<) ret))) |
| 233 | + (cl-loop for el in (directory-files dir t) |
| 234 | + when (and (string-match re (file-name-nondirectory el)) |
| 235 | + (or (string-match "elc\\'" el) |
| 236 | + (and (string-match "el\\'" el) |
| 237 | + (not (locate-library (concat el "c")))))) |
| 238 | + collect (file-name-nondirectory el) into ret |
| 239 | + finally return (if sort (sort ret 'string<) ret))) |
239 | 240 |
|
240 | 241 | (defun init-loader--show-log-error-only () |
241 | 242 | (let ((err (init-loader-error-log))) |
|
0 commit comments