summary refs log tree commit diff stats
path: root/tag-emacs/emacs.d/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'tag-emacs/emacs.d/init.el')
-rw-r--r--tag-emacs/emacs.d/init.el24
1 files changed, 22 insertions, 2 deletions
diff --git a/tag-emacs/emacs.d/init.el b/tag-emacs/emacs.d/init.el
index 051d2987..120c85b2 100644
--- a/tag-emacs/emacs.d/init.el
+++ b/tag-emacs/emacs.d/init.el
@@ -1057,7 +1057,26 @@ mouse-1: Display Line and Column Mode Menu"))))))
   :commands (eldoc-mode)
   :diminish eldoc-mode
   :config (progn
-            (setq eldoc-idle-delay 0.1)))
+            (setq eldoc-idle-delay 0.1)
+            (eldoc-add-command 'paredit-backward-delete 'paredit-close-round)))
+
+(req-package paredit
+  :diminish "()"
+  :commands (paredit-mode)
+  :config (progn
+            (defun ap/cedit-space-delimiter-p (endp delimiter)
+              "Don't insert a space before delimiters in c-style modes"
+              (not cedit-mode))
+            (add-to-list 'paredit-space-for-delimiter-predicates #'ap/cedit-space-delimiter-p))
+  :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)))))
 
 (req-package smartparens-config
   :config (progn
@@ -1077,7 +1096,8 @@ mouse-1: Display Line and Column Mode Menu"))))))
             (bind-key "C-M-S-k" #'sp-kill-hybrid-sexp sp-keymap)
             (bind-key "C-S-<right>" #'sp-slurp-hybrid-sexp sp-keymap)
             (show-smartparens-global-mode t)
-            (smartparens-global-strict-mode t)))
+            (smartparens-global-strict-mode t)
+            (add-hook 'lisp-mode-common-hook #'turn-off-smartparens-mode)))
 
 (req-package move-text
   :config (move-text-default-bindings))