Skip to content

Commit 035b9a5

Browse files
yuhan0bbatsov
authored andcommitted
refactor clojure-space-for-delimiter-p
1 parent 673c272 commit 035b9a5

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

clojure-mode.el

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -457,20 +457,11 @@ The command will prompt you to select one of the available sections."
457457
See `paredit-space-for-delimiter-predicates' for the meaning of
458458
ENDP and DELIM."
459459
(or endp
460-
(not (memq delim '(?\" ?{ ?\( )))
461-
(not (or (derived-mode-p 'clojure-mode)
460+
(not (memq delim '(?\" ?\{ ?\())) ;; always insert for [
461+
(not (or (derived-mode-p 'clojure-mode) ;; FIXME why does this check exist
462462
(derived-mode-p 'cider-repl-mode)))
463-
(save-excursion
464-
(backward-char)
465-
(cond ((eq (char-after) ?#)
466-
(and (not (bobp))
467-
(or (char-equal ?w (char-syntax (char-before)))
468-
(char-equal ?_ (char-syntax (char-before))))))
469-
((and (eq delim ?\()
470-
(eq (char-after) ??)
471-
(eq (char-before) ?#))
472-
nil)
473-
(t)))))
463+
(not (looking-back "\\_<#\\??")))) ;; auto-gensym syntax foo#
464+
474465

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

0 commit comments

Comments
 (0)