Skip to content

Commit b533580

Browse files
hrathodMalabarba
authored andcommitted
Add initial support for smartparens-mode (#385)
1 parent 2bc14d8 commit b533580

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

clojure-mode.el

+9-1
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,13 @@ instead of to `clojure-mode-map'."
342342
(add-to-list 'paredit-space-for-delimiter-predicates
343343
#'clojure-no-space-after-tag)))
344344

345+
(defun clojure-smartparens-setup ()
346+
"Make \"smartparens-mode\" play nicely with `clojure-mode'."
347+
(when (and (fboundp 'sp-with-modes) (fboundp 'sp-local-pair))
348+
(sp-with-modes '(clojure-mode)
349+
(sp-local-pair "#{" "}")
350+
(sp-local-pair "#(" ")"))))
351+
345352
(defun clojure-mode-variables ()
346353
"Set up initial buffer-local variables for Clojure mode."
347354
(setq-local imenu-create-index-function
@@ -380,7 +387,8 @@ instead of to `clojure-mode-map'."
380387
\\{clojure-mode-map}"
381388
(clojure-mode-variables)
382389
(clojure-font-lock-setup)
383-
(add-hook 'paredit-mode-hook #'clojure-paredit-setup))
390+
(add-hook 'paredit-mode-hook #'clojure-paredit-setup)
391+
(add-hook 'smartparens-mode-hook #'clojure-smartparens-setup))
384392

385393
(defcustom clojure-verify-major-mode t
386394
"If non-nil, warn when activating the wrong major-mode."

0 commit comments

Comments
 (0)