From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Hod b Newsgroups: gmane.emacs.help Subject: how do i create keyboard shortcut to specific query-replace? Date: Mon, 30 Sep 2013 09:36:18 -0700 (PDT) Message-ID: <1380558978954-298658.post@n5.nabble.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1380576378 16905 80.91.229.3 (30 Sep 2013 21:26:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 30 Sep 2013 21:26:18 +0000 (UTC) To: Help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 30 23:26:22 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VQkyy-0007bz-Go for geh-help-gnu-emacs@m.gmane.org; Mon, 30 Sep 2013 23:26:20 +0200 Original-Received: from localhost ([::1]:51650 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQkyx-0001GD-VK for geh-help-gnu-emacs@m.gmane.org; Mon, 30 Sep 2013 17:26:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQgSW-00033S-IQ for Help-gnu-emacs@gnu.org; Mon, 30 Sep 2013 12:36:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VQgSK-00046O-4z for Help-gnu-emacs@gnu.org; Mon, 30 Sep 2013 12:36:32 -0400 Original-Received: from sam.nabble.com ([216.139.236.26]:43517) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQgSJ-00046C-V6 for Help-gnu-emacs@gnu.org; Mon, 30 Sep 2013 12:36:20 -0400 Original-Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1VQgSI-0004Ke-W2 for Help-gnu-emacs@gnu.org; Mon, 30 Sep 2013 09:36:19 -0700 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 216.139.236.26 X-Mailman-Approved-At: Mon, 30 Sep 2013 17:25:59 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:93764 Archived-At: 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.