** 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
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.")
#+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
;; (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
: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