diff options
-rw-r--r-- | emacs/init.el | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/emacs/init.el b/emacs/init.el index 6a37030..641cdc2 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -446,7 +446,10 @@ Values: `desktop', `server', `laptop'") auto-indent-backward-delete-char-behavior nil auto-indent-delete-trailing-whitespace-on-save-file t auto-indent-mode-untabify-on-yank-or-paste nil) - (auto-indent-global-mode))) + (auto-indent-global-mode) + (defun lisp-auto-indent-mode () + (set (make-local-variable 'auto-indent-assign-indent-level) 2)) + (add-hook 'lisp-common-mode-hook #'lisp-auto-indent-mode))) (use-package smart-tabs-mode :ensure t @@ -815,9 +818,13 @@ Also returns nil if pid is nil." (use-package autopair :ensure t - :commands (autopair-mode) + :commands (autopair-mode + autopair-on) :init (progn - (add-hook 'prog-mode-hook #'autopair-mode) + (add-hook 'prog-mode-hook #'autopair-on) + (defun autopair-off () + (autopair-mode -1)) + (add-hook 'lisp-common-mode-hook #'autopair-off) (setq autopair-blink nil autopair-skip-whitespace nil))) @@ -836,10 +843,16 @@ Also returns nil if pid is nil." ("C-<f3>" . mc/mark-more-like-this-extended) ("C-S-L" . mc/edit-lines))) +(use-package eldoc + :defuns (eldoc-add-command) + :config (progn + (eldoc-add-command 'paredit-backward-delete 'paredit-close-round))) + (use-package paredit :ensure t :commands (paredit-mode) :init (progn + (add-hook 'lisp-common-mode-hook #'enable-paredit-mode) (put #'paredit-forward-delete 'delete-selection 'supersede) (put #'paredit-backward-delete 'delete-selection 'supersede) (add-hook 'minibuffer-setup-hook #'conditionally-enable-paredit-mode) @@ -878,17 +891,7 @@ Also returns nil if pid is nil." ;;;; Lisps (defun ap/lisp-setup () - (if (featurep 'autopair) - (autopair-mode -1)) - (paredit-mode +1) - (if (featurep 'redshank) - (redshank-mode +1)) - (eldoc-add-command 'paredit-backward-delete 'paredit-close-round) - - (if (featurep 'auto-indent-mode) - (progn (set (make-local-variable 'auto-indent-assign-indent-level) 2) - (auto-indent-mode +1))) - + (run-hooks 'lisp-common-mode-hook) (show-paren-mode t) (setq indent-tabs-mode nil) (local-set-key (kbd "RET") #'paredit-newline)) @@ -914,7 +917,9 @@ Also returns nil if pid is nil." run-racket)) (use-package redshank - :ensure t) + :ensure t + :init (progn + (add-hook 'lisp-common-mode-hook #'turn-on-redshank-mode))) (use-package geiser-base :defer t |