Using emacs with Paredit enabled. How can I search through a LISP (Clojure) S-expression and rename a variable? I'd like to do it within the current S-expression instead of globally.
Search and replace on variable name within S-Expression (lexical scope)?
550 Views Asked by Eric Schoonover At
2
There are 2 best solutions below
0
event_jr
On
The query-replace with active region is quite good for general
search/replace in region. But for refactoring code, I much prefer iedit.
To rename a variable within a defun, go to the symbol to be reanmed, press C-0 C-; and edit away.
To rename a variable within arbitrary region, go to the symbol, press C-;, select the region of interest, and press C-; again.
iedit has many other functions to help code refactoring. Hint: C-'
Related Questions in EMACS
- EMACS-Live + Slime error at startup
- Auto complete of braces in emacs
- tmux + emacs : ctrl is not reconized
- yasnippet weird-input when org-mode :tag: on same line
- Error in Dired sorting on Windows (with Cygwin Emacs)
- ESS produces "Variable binding depth exceeds max-specpdl-size"
- How to simplify the mode-line, and enter evil-insert-state depending on buffer name
- MELPA pointing to non-existent version of multi-term?
- Mark-up for bold and italic in emacs org-mode
- How to get C-` key combo recognized in Emacs under Mac?
- how to install Emacs Prelude system-wide on windows/MinGW?
- Emacs on Windows 8: write-error, bad file descriptor
- Emacs and Skim not in Sync fails to open
- Emacs web mode selection word delimiters include _
- Error loading D:\cygdrive\d\path\to\my\file.pdf
Related Questions in CLOJURE
- core.logic CLP(FD) with ClojureScript
- clojure worker-only app on heroku fails with Error R10
- How do persistent data structures help make Om faster
- Union in HoneySQL
- Reduce memory consumption in development
- twitter response: "error 32: Could not authenticate you" from Heroku, but not desktop
- How can I create a global object, and attach a string and a function to that object, in ClojureScript?
- AngularJS $http GET method to backend server: Request Method:OPTIONS 405
- Clojure : event listener on domina library
- Why is my streamparse topology definition complaining about a wrong number of arguments to thrift$mk-topology?
- Clojure defn name as multiplier
- clojure quoting inside let
- Build macro result with loops
- How do I unit test clojure.core.async go macros?
- Datomic and HornetQException "unable to validate user"
Related Questions in LISP
- Intercept and modify user input in Common Lisp
- Read next line when loading file in Common Lisp
- Calling CCL + Quicklisp script as executable with command line arguments and achieving the desired output
- Avoiding echos in Clozure lisp (noob)
- Backquote String Interpolation
- Structuring large Lisp applications
- If strings are vectors, why are they immutable?
- Invalid specialized parameter in method lambda list
- Emacs init.el and Elisp and equivalent of common lisp every-p function
- EVAL/APPLY: too many arguments given to F
- Insertion into a list doesn't reflect outside function whereas deletion does?
- How to traverse a tree in Clojure while collecting the value from each node node?
- in clojure, function argument type mismatch
- In Lisp is the function `1+` just syntactic sugar?
- Search function in lisp
Related Questions in S-EXPRESSION
- (Prolog) Parsing Lisp s-expressions Into Prolog Terms
- (Unbound variable) Use functions on a list of S-Expressions (mit-scheme)
- running embedded R in C
- Custom pattern-matching facility for Chez Scheme
- What are improper lists for?
- Why do we need `nil`?
- parsing keyed lists from a file in tcl?
- Lisp: list vs S-expression
- Difference between sexp and list in Emacs?
- S-expression idioms
- What's causing my OCaml S-expression parser to fail?
- Why does my Prolog S-expression tokenizer fail on its base case?
- Extending Rcpp::as for custom classes depending on Rcpp.h
- `Rcpp::wrap` and `Rcpp::as` for external classes that use Rcpp namespace classes
- LISP 1.5 How lisp is like a machine language?
Related Questions in PAREDIT
- Emacs putting a newline after closing parenthesis
- How do I set the paredit comment line wrap length (or turn it off)
- Paredit forward slurp "C-)" does not work for emacs on Windows 7
- what's the use for paredit-convolute-sexp in paredit mode
- paredit keybindings with GUI vs terminal emacs
- How do I enable Paredit in Light Table?
- Paredit Wrap Round command not bound to M-(
- Can't find a place to bind paredit's convolute-sexp
- emacs paredit - how to delete quotes
- Using SLIMV to code Lisp, how do I insert a single " without disabling paredit.vim?
- How to barf double quotes
- How can I get paredit mode when doing eval-expression?
- Using Paredit to wrap existing expression
- kill next expression in paredit
- Light Table : parentheses are not auto-closing
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Just use
C-M-<space>at the start of the s-expression you'd like to use as your scope, to highlight it, and then do aquery-replaceas usual - it restricts itself to the active region.