I tried to make it easier to transpose sexps in both directions. However, to do so, I initially had to use some functions from evil. If anyone could advise me on making this work without the functions:
- evil-a-paren
- evil-jump-item
...I would appreciate it.
(defun transpose-sexps-backward (arg &optional interactive)
"Transpose a sexp backward and position cursor to do it again."
(interactive "*p\nd") ; What does this mean?
; copied form transpose-sexps
(pcase-let* ((`(,begin ,end ,type) (evil-a-paren)))
(goto-char begin)
;;(message "arg %s interactive %s" arg interactive)
(transpose-sexps arg interactive)
(goto-char (- (point) 1))
(evil-jump-item) ; %
(backward-sexp) ; put cursor on opening paren
Comment too long. Click here to view the full text.