Earlier quoted context omitted.
The way I do it, is that in my editor, I can type: '(some data|) Where | is my cursor. And then I have a keybinding that moves my cursor to the front and wraps around like so: (| '(some data)) So I can type the next thing: (get-string| '(some data)) Press it again: (| (get-string '(some-data))) And so on. That way, even though the code is visually nested, I can write it in logical order from what eval first to what e…
This is just what I've been looking for! I've been searching for this and see there are commands for navigating s expressions but I haven't found this example. Is this a built-in command? Is there name for this action?
There isn't, as far as I know, a default keybinding for what GP did - navigate up the SEXP, wrap in parens and place point before the inner SEXP. You can get very close to it with two steps: paredit-backward-up [C-M-u] and paredit-wrap-round [M-(], though it gets confused by the hanging quote a bit. To demonstrate on GP's example:
'(some data|)
'|(some data) ; after C-M-u
'(|(some data)) ; after M-(
So the quote is in a wrong place. You could probably whip a command doing OP's thing that calls paredit-backward-up and paredit-wrap-round, with a conditional that backs up a few chars if it detects a piece of syntactic sugar attached to the SEXP (quote, quasiquote, comma, reader macro invocation). Somebody has likely already done it, or maybe there is a less known Paredit command for that - I don't know. If anyone does, please chime in.Myself, I mostly use wrapping, barfing and slurping.
--
[0] - Available in Emacs' package manager on MELPA, or here: https://github.com/emacsmirror/paredit.
[1] - http://danmidwood.com/content/2014/11/21/animated-paredit.ht...