Massive refactor. Refactor all the things
This commit is contained in:
parent
03514fc09d
commit
f234be68a4
56 changed files with 792 additions and 831 deletions
|
@ -1,18 +1,30 @@
|
|||
;;; module-lisp --- all things lisp
|
||||
|
||||
(add-hook! emacs-lisp-mode
|
||||
'(turn-on-eldoc-mode flycheck-mode highlight-numbers-mode highlight-quoted-mode))
|
||||
|
||||
;; Pop-up REPL
|
||||
(define-repl! emacs-lisp-mode narf/elisp-inf-ielm)
|
||||
|
||||
(use-package highlight-quoted :commands (highlight-quoted-mode))
|
||||
|
||||
;; 'Emacs Lisp' is too long [pedantry intensifies]
|
||||
(defadvice emacs-lisp-mode (after emacs-lisp-mode-rename-modeline activate)
|
||||
(setq mode-name "Elisp"))
|
||||
(associate! emacs-lisp-mode :match "\\(/Cask\\|\\.\\(el\\|gz\\)\\)$")
|
||||
(def-company-backend! emacs-lisp-mode (elisp yasnippet))
|
||||
(def-repl! emacs-lisp-mode narf/elisp-inf-ielm)
|
||||
|
||||
(add-hook! emacs-lisp-mode
|
||||
'(turn-on-eldoc-mode flycheck-mode highlight-numbers-mode))
|
||||
|
||||
;; Real go-to-definition for elisp
|
||||
(map! :map emacs-lisp-mode-map :m "gd" 'narf/elisp-find-function-at-pt)
|
||||
|
||||
(use-package highlight-quoted
|
||||
:commands (highlight-quoted-mode)
|
||||
:init (add-hook 'emacs-lisp-mode-hook 'highlight-quoted-mode))
|
||||
|
||||
(use-package slime :defer t
|
||||
:config (setq inferior-lisp-program "clisp"))
|
||||
|
||||
;; Don't affect lisp indentation (only `tab-width')
|
||||
(setq editorconfig-indentation-alist
|
||||
(delq (assq 'emacs-lisp-mode editorconfig-indentation-alist)
|
||||
editorconfig-indentation-alist))
|
||||
|
||||
(add-hook! emacs-lisp-mode
|
||||
(setq mode-name "Elisp") ; [pedantry intensifies]
|
||||
|
||||
(add-hook 'before-save-hook 'delete-trailing-whitespace nil t)
|
||||
(add-hook 'after-save-hook 'narf/elisp-auto-compile nil t)
|
||||
|
||||
|
@ -56,16 +68,18 @@
|
|||
'emacs-lisp-mode `(("(\\(lambda\\)"
|
||||
(1 (narf/show-as ?λ)))
|
||||
;; Highlight narf macros (macros are fontified in emacs 25+)
|
||||
(,(concat
|
||||
"(\\(def-"
|
||||
(regexp-opt '("electric" "project-type" "company-backend"
|
||||
"builder" "repl" "textobj" "tmp-excmd"
|
||||
"repeat" "yas-mode" "env-command" "docset"))
|
||||
"!\\)")
|
||||
(1 font-lock-keyword-face append))
|
||||
(,(concat
|
||||
"(\\("
|
||||
(regexp-opt '("λ" "in" "map" "after" "exmap" "shut-up" "add-hook"
|
||||
"associate" "open-with" "define-repl"
|
||||
"define-builder" "narf-space-setup"
|
||||
"define-env-command" "define-text-object"
|
||||
"add-yas-minor-mode" "define-docset"
|
||||
"define-org-link" "define-company-backend"
|
||||
"define-org-section" "define-temp-ex-cmd"
|
||||
"define-project-type"))
|
||||
(regexp-opt '("λ" "in" "map" "after" "shut-up" "add-hook"
|
||||
"associate" "open-with" "define-org-link"
|
||||
"define-org-section"))
|
||||
"!\\)")
|
||||
(1 font-lock-keyword-face append))
|
||||
;; Ert
|
||||
|
@ -77,19 +91,14 @@
|
|||
(2 font-lock-function-name-face))))
|
||||
|
||||
;;
|
||||
(use-package slime :defer t
|
||||
:config (setq inferior-lisp-program "clisp"))
|
||||
|
||||
;; Real go-to-definition for elisp
|
||||
(map! :map emacs-lisp-mode-map :m "gd" 'narf/elisp-find-function-at-pt)
|
||||
|
||||
(define-project-type! emacs-ert "ert"
|
||||
(def-project-type! emacs-ert "ert"
|
||||
:modes (emacs-lisp-mode)
|
||||
:match "/test/.+-test\\.el$"
|
||||
:bind (:localleader
|
||||
:n "tr" 'narf/ert-rerun-test
|
||||
:n "ta" 'narf/ert-run-all-tests
|
||||
:n "ts" 'narf/ert-run-test))
|
||||
:n "ts" 'narf/ert-run-test)
|
||||
(add-hook 'ert-results-mode-hook 'narf|hide-mode-line))
|
||||
|
||||
(provide 'module-lisp)
|
||||
;;; module-elisp.el ends here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue