summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmin Bandali <bandali@gnu.org>2018-12-23 14:44:10 -0500
committerAmin Bandali <bandali@gnu.org>2018-12-23 14:44:17 -0500
commitab6781dd1f90e15d55768d63b2698d12913ab741 (patch)
tree81b20e9c1c8bf033c53d90988ccd3dcb432a21ca
parentf1516d514c999d36839ff7f6e70f63a7d4c43390 (diff)
downloadconfigs-ab6781dd1f90e15d55768d63b2698d12913ab741.tar.gz
configs-ab6781dd1f90e15d55768d63b2698d12913ab741.tar.xz
configs-ab6781dd1f90e15d55768d63b2698d12913ab741.zip
[emacs] drop after! and use with-eval-after-load
Diffstat (limited to '')
-rw-r--r--init.org41
1 files changed, 4 insertions, 37 deletions
diff --git a/init.org b/init.org
index 3a170a3..61af647 100644
--- a/init.org
+++ b/init.org
@@ -447,39 +447,6 @@ buffers and/or modes.
** Useful utilities
-#+begin_src emacs-lisp
-(defun amin-enlist (exp)
- "Return EXP wrapped in a list, or as-is if already a list."
-(if (listp exp) exp (list exp)))
-
-; from https://github.com/hlissner/doom-emacs/commit/589108fdb270f24a98ba6209f6955fe41530b3ef
-(defmacro after! (features &rest body)
- "A smart wrapper around `with-eval-after-load'. Supresses warnings during
-compilation."
- (declare (indent defun) (debug t))
- (list (if (or (not (bound-and-true-p byte-compile-current-file))
- (dolist (next (amin-enlist features))
- (if (symbolp next)
- (require next nil :no-error)
- (load next :no-message :no-error))))
- #'progn
- #'with-no-warnings)
- (cond ((symbolp features)
- `(eval-after-load ',features '(progn ,@body)))
- ((and (consp features)
- (memq (car features) '(:or :any)))
- `(progn
- ,@(cl-loop for next in (cdr features)
- collect `(after! ,next ,@body))))
- ((and (consp features)
- (memq (car features) '(:and :all)))
- (dolist (next (cdr features))
- (setq body `(after! ,next ,@body)))
- body)
- ((listp features)
- `(after! (:all ,@features) ,@body)))))
-#+end_src
-
Convenience macro for =setq='ing multiple variables to the same value:
#+begin_src emacs-lisp
@@ -822,7 +789,7 @@ d/async-babel-tangle]] which uses [[https://github.com/jwiegley/emacs-async][asy
file.
#+begin_src emacs-lisp
-(after! org
+(with-eval-after-load 'org
(defvar amin-show-async-tangle-results nil
"Keep *emacs* async buffers around for later inspection.")
@@ -1892,7 +1859,7 @@ Also see [[https://www.emacswiki.org/emacs/rebox2][rebox2]].
#+begin_src emacs-lisp
(defvar amin-maildir (expand-file-name "~/mail/"))
-(after! recentf
+(with-eval-after-load 'recentf
(add-to-list 'recentf-exclude amin-maildir))
#+end_src
@@ -2066,7 +2033,7 @@ Also see [[https://www.emacswiki.org/emacs/rebox2][rebox2]].
;; (message-header-cc ((t (:foreground "#333" :weight normal))))
)
-(after! mml-sec
+(with-eval-after-load 'mml-sec
(setq mml-secure-openpgp-encrypt-to-self t
mml-secure-openpgp-sign-with-sender t))
#+end_src
@@ -2103,7 +2070,7 @@ Convenient footnotes in =message-mode=.
:bind (:map gnus-group-mode-map ("e" . ebdb))
:config
(setq ebdb-sources (no-littering-expand-var-file-name "ebdb"))
- (after! swiper
+ (with-eval-after-load 'swiper
(add-to-list 'swiper-font-lock-exclude 'ebdb-mode t)))
(use-package ebdb-com