From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "B. T. Raven" Newsgroups: gmane.emacs.help Subject: Re: efficient replacing =?windows-1252?Q?=96_really_faster_?= =?windows-1252?Q?compared_to_using_the_mouse=3F?= Date: Fri, 10 Aug 2012 13:44:15 -0500 Organization: NewsGuy - Unlimited Usenet $19.95 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1344624621 19268 80.91.229.3 (10 Aug 2012 18:50:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Aug 2012 18:50:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 10 20:50:22 2012 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 1SzuHo-0004Wv-M5 for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Aug 2012 20:50:16 +0200 Original-Received: from localhost ([::1]:36851 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzuHn-0002Bz-Jk for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Aug 2012 14:50:15 -0400 Original-Path: usenet.stanford.edu!news.glorb.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!spln!extra.newsguy.com!newsp.newsguy.com!news6 Original-Newsgroups: gnu.emacs.help Original-Lines: 114 Original-NNTP-Posting-Host: p40137112c195f79f162f2945248b41ffe926ab5b9aebc868.newsdawg.com User-Agent: Mozilla/5.0 (Windows NT 5.0; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 In-Reply-To: X-Received-Bytes: 4908 Original-Xref: usenet.stanford.edu gnu.emacs.help:193936 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:86304 Archived-At: Die Fri Aug 10 2012 10:21:48 GMT-0500 (Central Daylight Time) Ferdinand scripsit: > Hi, > > I am currently trying to get used to emacs. > Before I heavily relied on TextMate (on Mac OS). > > A lot of people claim that, once you learned all the shortcuts, emacs is much faster without ever using the mouse. > > > I just ran into a problem where I really couldn't figure out how to do this with emacs at all. > Eventually I switched back to TextMate ... > > > So, probably I just am not aware of some key-combinations or there are other tricks I don't know, so I thought I just ask some emacs-professionals here on the list. > > > Here is the specific problem: > > I have a html table with a lot of radio buttons. > These radio buttons have names (xyz + a number). > Now I have to change all the numbers in the following way: > > > - orignal: > ---------- > > print("\n"); > > ... something else ... > > print(" \n"); > print(" \n"); > print(" \n"); > print(" \n"); > > print("\n"); > > > print("\n"); > > ... something else ... > > print(" \n"); > print(" \n"); > print(" \n"); > print(" \n"); > > print("\n"); > > [....] > > > > edited: > ------- > > print("\n"); > > ... something else ... > > print(" \n"); > print(" \n"); > print(" \n"); > print(" \n"); > > print("\n"); > > > print("\n"); > > ... something else ... > > print(" \n"); > print(" \n"); > print(" \n"); > print(" \n"); > > print("\n"); > > [and so on] > > > > Now in TextMate I just switch to column-mode with my mouse (by pressing alt while selecting). > Then I draw a rectangle with the mouse to select the number behind xyz of one -block and type in the right number. > This is fairly easy to me and quite quick. > > In emacs I just have no idea how to do this in a reasonable amount of time. > Only to navigate to the next block with C-n / C-p and to get to the right place in the line with C-b / C-f takes a lot of time. > And then to mark the beginning (with C-space) navigate to the end to replace it ... > > That is much less efficient compared to using the mouse (in my opinion). > > > So what am I doing wrong here? > How do you solve such edits in emacs efficiently? > > > Thanks for any suggestions! It depends on what you mean by a lot of radio buttons, 20 or 20000? In your specific example it seems to me that M-% z23 z1 ent spc spc spc spc, and likewise with the rest of names would accomplish your task as fast in Emacs as in textmate and would even work if columns are not aligned. An elisp programmer could probably write a short routine using regular expressions and some kind of counter to rename 20000 blocks of 4 names ending in xyz##### into xyz%%%% where numbers ##### are not in order and %%%% are forced to be sequential. Ed