Skip to content

Commit c06278d

Browse files
committed
Tell paredit to not insert a space after #?
Related to e8c71e1#commitcomment-13832912
1 parent 6045a15 commit c06278d

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

clojure-mode.el

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -186,21 +186,21 @@ Inherits from `emacs-lisp-mode-syntax-table'.")
186186
"Prevent paredit from inserting useless spaces.
187187
See `paredit-space-for-delimiter-predicates' for the meaning of
188188
ENDP and DELIM."
189-
(if (or (derived-mode-p 'clojure-mode)
190-
(derived-mode-p 'cider-repl-mode))
189+
(or endp
190+
(not (memq delim '(?\" ?{ ?\( )))
191+
(not (or (derived-mode-p 'clojure-mode)
192+
(derived-mode-p 'cider-repl-mode)))
191193
(save-excursion
192194
(backward-char)
193-
(if (and (or (char-equal delim ?\()
194-
(char-equal delim ?\")
195-
(char-equal delim ?{))
196-
(not endp))
197-
(if (char-equal (char-after) ?#)
198-
(and (not (bobp))
199-
(or (char-equal ?w (char-syntax (char-before)))
200-
(char-equal ?_ (char-syntax (char-before)))))
201-
t)
202-
t))
203-
t))
195+
(cond ((eq (char-after) ?#)
196+
(and (not (bobp))
197+
(or (char-equal ?w (char-syntax (char-before)))
198+
(char-equal ?_ (char-syntax (char-before))))))
199+
((and (eq delim ?\()
200+
(eq (char-after) ??)
201+
(eq (char-before) ?#))
202+
nil)
203+
(t)))))
204204

205205
(defun clojure-no-space-after-tag (endp delimiter)
206206
"Prevent inserting a space after a reader-literal tag?

0 commit comments

Comments
 (0)