help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how do i create keyboard shortcut to specific query-replace?


From: Hod b
Subject: how do i create keyboard shortcut to specific query-replace?
Date: Mon, 30 Sep 2013 09:36:18 -0700 (PDT)

Hello
I've trying to create a keyboard shortcut that replace some query that i
have in many(!) files with similar query.
Example:

original code: 
foo( type => 'bar', action => 'execute bar' );
foo( type => 'baz', action => 'special action' );
foo( type => 'bat', action => 'yyyyy' );
foo( type => 'bar', action => 'bar finished' );


new code: 
bar( action => 'execute bar' );
baz( action => 'special action' );
bat( action => 'yyyyy' );
bar( action => 'bar finished' );

I don't want to do that automatically to all my files,
because it depend on projects that we are work at the company.
my regex to this problem is s/foo\(\s+type\s+=>\s+'(\w+)',\s+/$1( /g
but i don't know how to save it to .emacs

thanks for trying help me.



--
View this message in context: 
http://emacs.1067599.n5.nabble.com/how-do-i-create-keyboard-shortcut-to-specific-query-replace-tp298658.html
Sent from the Emacs - Help mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]