summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2016-03-24 23:11:44 +0100
committerAlan Pearce2016-03-24 23:11:44 +0100
commitce50593b3cc4898915c260aaf356adf533868e67 (patch)
treea9156c4f93dc80c3fb83e4282cfba5b8632181bc
parent94fa9d4f837d1363bf4aaa0f2afb5fbc9a91b81f (diff)
downloaddotfiles-ce50593b3cc4898915c260aaf356adf533868e67.tar.lz
dotfiles-ce50593b3cc4898915c260aaf356adf533868e67.tar.zst
dotfiles-ce50593b3cc4898915c260aaf356adf533868e67.zip
Emacs: Simplify paredit eval-expression setup
-rw-r--r--tag-emacs/emacs.d/init.org20
1 files changed, 8 insertions, 12 deletions
diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org
index a38eede..395ff53 100644
--- a/tag-emacs/emacs.d/init.org
+++ b/tag-emacs/emacs.d/init.org
@@ -2216,18 +2216,14 @@ Balanced parentheses in lisps are nice, but all the refactoring and
 movement commands are much more interesting.
 
 #+BEGIN_SRC emacs-lisp
-(use-package paredit
-  :diminish "()"
-  :commands (paredit-mode)
-  :init (progn
-          (add-hook 'lisp-mode-common-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)
-          (defun conditionally-enable-paredit-mode ()
-            "enable paredit-mode during eval-expression"
-            (if (eq this-command 'eval-expression)
-                (paredit-mode 1)))))
+  (use-package paredit
+    :diminish "()"
+    :commands (paredit-mode)
+    :init (progn
+            (add-hook 'lisp-mode-common-hook #'enable-paredit-mode)
+            (put #'paredit-forward-delete 'delete-selection 'supersede)
+            (put #'paredit-backward-delete 'delete-selection 'supersede)
+            (add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode)))
 #+END_SRC
 
 ** smartparens