Fork me on GitHub
#emacs
<
2022-08-14
>
teodorlu08:08:48

is there a paredit action that can move an sexp "left"/"right"? Example:

;; from

(defn link? [el]
  (= (get el "t")
     #_cursor "Link"))

;; to

(defn link? [el]
  (= "Link"
     (get el "t")))

teodorlu08:08:25

option: transpose-sexps:

(defn link? [el]
  (= "Link"
     ;; M-x transpose-sexps
     (get el "t")))

teodorlu08:08:49

Calva has "drax sexp backward/forward". This is exactly what I'm looking for! https://calva.io/paredit/

cwchriswilliams12:08:24

I think drag forward would be transpose-sexprs and drag backward would be transpose-sexprs with a negative prefix. (i.e. drag-forward=C-M-t, drag-backward C-- C-M-t)

👍 1
teodorlu16:08:20

Good point - thanks!

👍 1
richiardiandrea15:08:15

👍 I use transpose all the times for these use cases!

👍 1
Drew Verlee19:08:53

Going to try and work on this https://github.com/clojure-emacs/cider/issues/3231#issuecomment-1200686301 again in an hour or two if anyone wants to pair (maybe on discord?). I keep getting distracted by my complete lack of understanding of any beyond a superficial understanding of emacs and elisp 😆

cider 2