Skip to content

Commit 9fdfaf1

Browse files
yuhan0bbatsov
authored andcommitted
Simplify logic
1 parent adddf96 commit 9fdfaf1

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

clojure-mode.el

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -452,16 +452,13 @@ The command will prompt you to select one of the available sections."
452452
(interactive)
453453
(browse-url clojure-style-guide-url))
454454

455-
(defun clojure-space-for-delimiter-p (endp delim)
455+
(defun clojure-space-for-delimiter-p (endp _delim)
456456
"Prevent paredit from inserting useless spaces.
457457
See `paredit-space-for-delimiter-predicates' for the meaning of
458458
ENDP and DELIM."
459-
(and (not (eq (char-before) ?'))
460-
(or endp
461-
(not (memq delim '(?\" ?\{ ?\())) ;; always insert for [
462-
(not (or (derived-mode-p 'clojure-mode) ;; FIXME why does this check exist
463-
(derived-mode-p 'cider-repl-mode)))
464-
(not (looking-back "\\_<#\\??"))))) ;; auto-gensym syntax foo#
459+
(and (not endp)
460+
;; don't insert after ' or # that is part of auto-gensym or reader conditional syntax
461+
(not (looking-back "\\_<\\(?:'+\\|#\\??\\)" (point-at-bol)))))
465462

466463

467464
(defconst clojure--collection-tag-regexp "#\\(::[a-zA-Z0-9._-]*\\|:?\\([a-zA-Z0-9._-]+/\\)?[a-zA-Z0-9._-]+\\)"

0 commit comments

Comments
 (0)