forked from purcell/emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit-lisp.el
41 lines (30 loc) · 1.52 KB
/
init-lisp.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
;; ----------------------------------------------------------------------------
;; Highlight current sexp
;; ----------------------------------------------------------------------------
;; Prevent flickery behaviour due to hl-sexp-mode unhighlighting before each command
(eval-after-load 'hl-sexp
'(defadvice hl-sexp-mode (after unflicker (turn-on) activate)
(when turn-on
(remove-hook 'pre-command-hook #'hl-sexp-unhighlight))))
;; ----------------------------------------------------------------------------
;; Enable desired features for all lisp modes
;; ----------------------------------------------------------------------------
(defun smp-lisp-setup ()
"Enable features useful in any Lisp mode."
(make-variable-buffer-local 'whitespace-style)
(setq whitespace-style '(face tabs spaces trailing lines space-before-tab::space newline indentation::space empty space-after-tab::space space-mark tab-mark newline-mark))
(add-hook 'before-save-hook 'whitespace-cleanup nil 'local)
(pretty-symbols-mode 1)
(turn-on-eldoc-mode))
(defun smp-emacs-lisp-setup ()
"Enable features useful when working with elisp."
(require 'elisp-slime-nav)
(checkdoc-minor-mode))
(let* ((elispy-hooks '(emacs-lisp-mode-hook ielm-mode-hook))
(lispy-hooks (append elispy-hooks '(lisp-mode-hook inferior-lisp-mode-hook lisp-interaction-mode-hook))))
(dolist (hook lispy-hooks)
(add-hook hook 'smp-lisp-setup))
(dolist (hook elispy-hooks)
(add-hook hook 'smp-emacs-lisp-setup)))
(require 'eldoc-eval)
(provide 'init-lisp)