Permalink
Browse files

Merge pull request #90 from jsnikeris/fix-paredit-keys

Use paredit-mode-hook to enable electric '{' and '}'
  • Loading branch information...
2 parents 38c0340 + 7750588 commit 1531338f014993a28aaaec412ec3aaa3627f5e6f @technomancy technomancy committed Jul 31, 2012
Showing with 7 additions and 6 deletions.
  1. +7 −6 clojure-mode.el
View
@@ -187,13 +187,14 @@ if that value is non-nil."
(clojure-mode-font-lock-setup)
- (run-mode-hooks 'clojure-mode-hook)
- (run-hooks 'prog-mode-hook)
+ (add-hook 'paredit-mode-hook
+ (lambda ()
+ (when (>= paredit-version 21)
+ (define-key clojure-mode-map "{" 'paredit-open-curly)
+ (define-key clojure-mode-map "}" 'paredit-close-curly))))
- ;; Enable curly braces when paredit is enabled in clojure-mode-hook
- (when (and (featurep 'paredit) paredit-mode (>= paredit-version 21))
- (define-key clojure-mode-map "{" 'paredit-open-curly)
- (define-key clojure-mode-map "}" 'paredit-close-curly)))
+ (run-mode-hooks 'clojure-mode-hook)
+ (run-hooks 'prog-mode-hook))
(defun clojure-display-inferior-lisp-buffer ()
"Display a buffer bound to `inferior-lisp-buffer'."

0 comments on commit 1531338

Please sign in to comment.