summaryrefslogtreecommitdiff
path: root/cider-repl.el
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@tradeo.com>2014-09-14 15:54:42 +0300
committerBozhidar Batsov <bozhidar@tradeo.com>2014-09-14 15:54:42 +0300
commit0d368a5be1363e62f398745eb1d09a6ce334aa68 (patch)
treeeb8ffe516e940a4b6851b194287ba137bb18b32d /cider-repl.el
parent5c25210e65b22dcd828e25db4bcab6ced5564d53 (diff)
Remove some code duplication
Diffstat (limited to 'cider-repl.el')
-rw-r--r--cider-repl.el31
1 files changed, 1 insertions, 30 deletions
diff --git a/cider-repl.el b/cider-repl.el
index 9c3e609b..6c37c373 100644
--- a/cider-repl.el
+++ b/cider-repl.el
@@ -940,29 +940,6 @@ constructs."
;;;;; CIDER REPL mode
-
-;;; Prevent paredit from inserting some inappropriate spaces.
-;;; C.f. clojure-mode.el
-(defun cider-space-for-delimiter-p (endp delim)
- "Hook for paredit's `paredit-space-for-delimiter-predicates'.
-
-Decides if paredit should insert a space after/before (if/unless
-ENDP) DELIM."
- (if (derived-mode-p 'cider-repl-mode)
- (save-excursion
- (backward-char)
- (if (and (or (char-equal delim ?\()
- (char-equal delim ?\")
- (char-equal delim ?{))
- (not endp))
- (if (char-equal (char-after) ?#)
- (and (not (bobp))
- (or (char-equal ?w (char-syntax (char-before)))
- (char-equal ?_ (char-syntax (char-before)))))
- t)
- t))
- t))
-
(defvar cider-repl-mode-hook nil
"Hook executed when entering `cider-repl-mode'.")
@@ -1059,13 +1036,7 @@ ENDP) DELIM."
(cider-repl-history-load cider-repl-history-file)
(add-hook 'kill-buffer-hook 'cider-repl-history-just-save t t)
(add-hook 'kill-emacs-hook 'cider-repl-history-just-save))
- (add-hook 'paredit-mode-hook
- (lambda ()
- (when (>= paredit-version 21)
- (define-key cider-repl-mode-map "{" 'paredit-open-curly)
- (define-key cider-repl-mode-map "}" 'paredit-close-curly)
- (add-to-list 'paredit-space-for-delimiter-predicates
- 'cider-space-for-delimiter-p)))))
+ (add-hook 'paredit-mode-hook 'clojure-paredit-setup))
(provide 'cider-repl)