diff options
Diffstat (limited to 'lisp/acdw.el')
-rw-r--r-- | lisp/acdw.el | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index 1c6f826..f972d08 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el | |||
@@ -28,33 +28,6 @@ the filesystem, unless INHIBIT-MKDIR is non-nil." | |||
28 | (make-directory (file-name-directory file-name) :parents)) | 28 | (make-directory (file-name-directory file-name) :parents)) |
29 | file-name)))) | 29 | file-name)))) |
30 | 30 | ||
31 | ;;; Convenience macros | ||
32 | |||
33 | (defun eval-after-init (fn) | ||
34 | "Evaluate FN after inititation, or now if Emacs is initialized. | ||
35 | FN is called with no arguments." | ||
36 | (if after-init-time | ||
37 | (funcall fn) | ||
38 | (add-hook 'after-init-hook fn))) | ||
39 | |||
40 | (defmacro eval-after (features &rest body) | ||
41 | "Evaluate BODY, but only after loading FEATURES. | ||
42 | FEATURES can be an atom or a list; as an atom it works like | ||
43 | `with-eval-after-load'. The special feature `init' will evaluate | ||
44 | BODY after Emacs is finished initializing." | ||
45 | (declare (indent 1) | ||
46 | (debug (form def-body))) | ||
47 | (if (eq features 'init) | ||
48 | `(eval-after-init (lambda () ,@body)) | ||
49 | (unless (listp features) | ||
50 | (setq features (list features))) | ||
51 | (if (null features) | ||
52 | (macroexp-progn body) | ||
53 | (let* ((this (car features)) | ||
54 | (rest (cdr features))) | ||
55 | `(with-eval-after-load ',this | ||
56 | (eval-after ,rest ,@body)))))) | ||
57 | |||
58 | ;;; Convenience functions | 31 | ;;; Convenience functions |
59 | 32 | ||
60 | (defun define-keys (maps &rest keydefs) | 33 | (defun define-keys (maps &rest keydefs) |