There is an issue with smartparens where sp-wrap-round doesn't correctly wrap symbols ending in ?, so foo? becomes (foo)? (https://github.com/Fuco1/smartparens/issues/1212). This happens in clojure-mode, but not in emacs-lisp-mode. Could this actually be clojure-mode's fault (i.e. some problem with the syntax table)?
I’ve been silently suffering from this for a while
It was introduced by a specific smartparens change, and doesn't happens with paredit, so I'm not sure where the problem is.
It seems to be related to the fact that when the character after the point is ?, then (syntax-after (point)) returns '(3) in emacs-lisp-mode, but '(1048579) in clojure-mode.
I think this is the problematic check in smartparens:
(when-let ((syntax (syntax-after p)))
(or (= (syntax-class syntax) 6)
(/= 0 (logand (lsh 1 20) (car syntax)))))
(syntax-class syntax) returns 3 for both elisp and clojure, whereas car is either 3 or 1048579.I upvoted the GitHub issue. Sometimes that helps.
A PR with a potential fix has been raised: https://github.com/Fuco1/smartparens/pull/1229