summary refs log tree commit diff stats
path: root/assets/tmpl
ModeNameSize
-rw-r--r--index.html2775log stats plain blame
0-10 16:28:16 +0100 committer David Morgan <djm_uk@protonmail.com> 2022-10-10 16:28:16 +0100 Try out straight' href='/djm/dotfiles/commit/.emacs.d/lisp/init-emacs-lisp.el?id=82a42c22402687bab36cea7a9953031784d7994a'>82a42c2 ^
d0db566 ^




f4fe800 ^
a58d9cc ^



d0db566 ^
fa5235f ^

49d58cd ^

fa5235f ^




49d58cd ^
fa5235f ^
d0db566 ^





05afb02 ^










d0db566 ^


05afb02 ^

d0db566 ^

d0db566 ^
f4fe800 ^
d0db566 ^


55318c9 ^
1ab1ff4 ^
fb211f4 ^




d0db566 ^
6a4b65d ^
be63636 ^



f4fe800 ^

6a4b65d ^
28f8104 ^









d0db566 ^

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
73
74
75
76
77
78
79
80
81
82
83
84
85




                                                                                   
                  




                            
                  



                                                       
         

                                   

                                                           




                                                                                                            
                                                                             
                                                           





                                             










                                                                        


                                

                                                                           

                                      
                                            
                                                      


                                 
                                 
                                  




                                                       
 
 



                                

                                                                                                  
 









                                             

                                
;;; init-emacs-lisp.el --- Emacs Lisp Configuration File -*- lexical-binding: t -*-
;;; Commentary:
;; Based on prelude-emacs-lisp.el
;;; Code:

(use-feature eldoc
  :diminish)

(use-package elisp-slime-nav
  :diminish)

(use-feature emacs
  :custom
  ;; These don't really belong here, but do affect ielm
  (comint-prompt-read-only t)
  (comint-buffer-maximum-size 2048)
  :config
  ;; Based on prelude-emacs-lisp.el
  (defun recompile-init-lisp ()
    "Recompile elisp files in `user-emacs-directory/lisp'."
    (interactive)
    (when (and
           (string-prefix-p (expand-file-name "lisp" user-emacs-directory) (file-truename buffer-file-name))
           (file-exists-p (byte-compile-dest-file buffer-file-name)))
      (emacs-lisp-byte-compile)))
  (defun recompile-init-lisp-on-save ()
    "Recompile your elc when saving an elisp file. (Adds buffer-local hook)."
    (add-hook 'after-save-hook 'recompile-init-lisp nil t))
  ;; From prelude-emacs-lisp.el
  (defun visit-ielm ()
    "Switch to default `ielm' buffer.
Start `ielm' if it's not already running."
    (interactive)
    (crux-start-or-switch-to 'ielm "*ielm*"))
  ;; from https://www.n16f.net/blog/making-ielm-more-comfortable/
  (defun ielm-init-history ()
    (let ((path (expand-file-name "ielm/history" user-emacs-directory)))
      (make-directory (file-name-directory path) t)
      (setq-local comint-input-ring-file-name path))
    (setq-local comint-input-ring-size 10000)
    (setq-local comint-input-ignoredups t)
    (comint-read-input-ring))
  (defun ielm-write-history (&rest _args)
    (with-file-modes #o600
      (comint-write-input-ring)))
  :hook
  (ielm-mode . (lambda ()
                 (eldoc-mode +1)
                 (ielm-init-history)
                 (advice-add 'ielm-send-input :after 'ielm-write-history)))
  (emacs-lisp-mode . (lambda ()
                       (eldoc-mode +1)
                       (setq mode-name "EL")
                       (recompile-init-lisp-on-save)))
  :bind
  (:map emacs-lisp-mode-map
        (("C-c C-z" . visit-ielm)
         ("C-c C-c" . eval-defun)
         ("C-c C-k" . eval-buffer)
         ("C-c e f" . emacs-lisp-byte-compile-and-load)
         ("C-c e z" .  byte-recompile-directory)
         ("C-c e c" . cancel-debug-on-entry)
         ("C-c e d" . debug-on-entry)
         ("C-c e e" . toggle-debug-on-error))))


(use-package eros
  :hook
  (emacs-lisp-mode . eros-mode))

(use-package erefactor
  :hook (emacs-lisp-mode . (lambda () (define-key emacs-lisp-mode-map "\C-c\C-v" erefactor-map))))

(use-package flycheck-package
  :hook
  (emacs-lisp-mode . flycheck-package-setup))

(use-package elsa)

(use-package flycheck-elsa
  :hook
  (emacs-lisp-mode . flycheck-elsa-setup))

(provide 'init-emacs-lisp)
;;; init-emacs-lisp.el ends here