-
Notifications
You must be signed in to change notification settings - Fork 1
/
my-elisp.el
73 lines (62 loc) · 1.94 KB
/
my-elisp.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
;;; my-elisp --- elisp related customisation
;;
;; Copyright (C) 2014 Alex Bennée
;;
;; Author: Alex Bennée <[email protected]>
;;
;; This file is not part of GNU Emacs.
;;
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;;
;;; Commentary:
;;
;; Not much in here.
;;
;;; Code:
(require 'use-package)
(defun my-elisp-compile-buffer ()
"Compile the current buffer."
(interactive)
(let ((bfn (buffer-file-name)))
(when bfn
(byte-compile-file bfn))))
(use-package eldoc
:commands eldoc-mode
:diminish "")
;; see https://github.com/joddie/macrostep/issues/11
(defun my-macrostep-expand-wrapper ()
"Workaround `macrostep-expand' not liking white-space after a sexp."
(interactive)
(when (and (= ?\n (char-after))
(= (point) (cdr (bounds-of-thing-at-point 'sexp))))
(backward-char))
(macrostep-expand))
(use-package macrostep
:ensure t
:commands macrostep-expand)
(defun my-elisp-hook-functions ()
"A few quick elisp hook customisation."
(setq mode-name "elisp")
(eldoc-mode t)
(when buffer-file-name
(local-set-key (kbd "C-c C-c") 'my-elisp-compile-buffer)))
(use-package lisp-mode
:commands emacs-lisp-mode
:hook (emacs-lisp-mode . my-elisp-hook-functions)
:mode ((".*\.el.gz" . emacs-lisp-mode))
:bind (:map emacs-lisp-mode-map
("C-x e" . my-macrostep-expand-wrapper)
("C-x i" . ielm))
:config
(add-to-list 'safe-local-variable-values
'(lisp-indent-function . common-lisp-indent-function)))
;; This seems to cause problems for booting up emacs daemon
(use-package ert-async
:after ert
:config (remove-hook 'emacs-lisp-mode-hook 'ert--activate-font-lock-keywords)
:hook (emacs-lisp-mode . ert-async-activate-font-lock-keywords))
(provide 'my-elisp)
;;; my-elisp.el ends here