Skip to content

Instantly share code, notes, and snippets.

@tani
Created February 9, 2015 04:46
Show Gist options
  • Save tani/c5ae0ea5e50d11ccb6b4 to your computer and use it in GitHub Desktop.
Save tani/c5ae0ea5e50d11ccb6b4 to your computer and use it in GitHub Desktop.
use-package.el like macro
(defmacro use (elisp &rest body)
(declare (indent defun))
`(when (require (quote ,elisp) nil t) ,@body))
(font-lock-add-keywords
'emacs-lisp-mode
'(("(\\(use\\)\\_>[ \t']*\\(\\(?:\\sw\\|\\s_\\)+\\)"
(1 font-lock-keyword-face) (2 font-lock-constant-face))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment