Using emacs with Paredit enabled. How can I search through a LISP (Clojure) S expression and rename a variable? I would like to do this in the current S-expression, and not around the world.
Just use C-M-<space>at the beginning of the s-expression that you want to use as a scope to select it, and then execute query-replaceas usual - it limits itself to the active area.
C-M-<space>
query-replace
query-replacewith an active area pretty good for general search / replace in the region. But for code refactoring, I prefer iedit .
defun, , , C-0 C-; .
, , C-;, C-;.
iedit , . : C-'