From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Francis Belliveau Newsgroups: gmane.emacs.help Subject: Re: pushing and popping the mark Date: Sat, 9 May 2015 08:49:48 -0400 Message-ID: References: <1e6c5c11-44fe-4b97-bef0-20149b34619b@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1431175818 31150 80.91.229.3 (9 May 2015 12:50:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 May 2015 12:50:18 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Sam Halliday Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat May 09 14:50:09 2015 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 1Yr4Cn-0000ix-9n for geh-help-gnu-emacs@m.gmane.org; Sat, 09 May 2015 14:50:09 +0200 Original-Received: from localhost ([::1]:59218 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yr4Cm-0000ky-E9 for geh-help-gnu-emacs@m.gmane.org; Sat, 09 May 2015 08:50:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yr4Cb-0000kd-69 for help-gnu-emacs@gnu.org; Sat, 09 May 2015 08:49:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yr4CX-0003Mj-UT for help-gnu-emacs@gnu.org; Sat, 09 May 2015 08:49:57 -0400 Original-Received: from resqmta-ch2-11v.sys.comcast.net ([69.252.207.43]:38463) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yr4CX-0003LO-OW for help-gnu-emacs@gnu.org; Sat, 09 May 2015 08:49:53 -0400 Original-Received: from resomta-ch2-18v.sys.comcast.net ([69.252.207.114]) by resqmta-ch2-11v.sys.comcast.net with comcast id Rop51q0082Udklx01oppry; Sat, 09 May 2015 12:49:49 +0000 Original-Received: from [10.0.1.3] ([76.119.172.160]) by resomta-ch2-18v.sys.comcast.net with comcast id Ropo1q0033TzthY01opoNi; Sat, 09 May 2015 12:49:49 +0000 In-Reply-To: <1e6c5c11-44fe-4b97-bef0-20149b34619b@googlegroups.com> X-Mailer: Apple Mail (2.2098) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1431175789; bh=h6EdUtu+S8FTW8kXUhxFSMXofj5qvY4Rn5e3zk5MjRY=; h=Received:Received:Content-Type:Mime-Version:Subject:From:Date: Message-Id:To; b=hGgfa4JyfBZroxdislKgyw9V4xA9luu4/6wTcTJ9xQlZr3dwX6qyeiI1c8cpYA5hC NwWqdRTKY5ITEnmeLScucbAhxcdJ13AO791dcB1vaWBPQRYYJarTl291G6eSMAGDTn g4+w/TYJnktI4SYmTSItl4tYnjdO3ohdJ4mGhl8xcH4AhxGNkBpS4+kqe7KHECW1YY 2BOGyBlOT+obMEJ8KjuEssp6B1Wtki1rEZ6doHCfNPXDeUDth1W3Rml7z3foKNU9oz v1WVo3vPyeQGgLOZDcNbslgXQFYtZjFEqiq/lOI2sxY4uLW19X7C2JfzVfpxFbGS7q PGpcRQO1+B1rg== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 69.252.207.43 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:104326 Archived-At: Sam, First let me say that emacs is so engrained in my finger tips that I = find it difficult to decipher keystroke speak. I do not have time to = try your keystrokes to get the fill feel of what your are doing. Although I do not fully follow what you are doing, two things come to = mind. First would C-X C-X (swap point and mark) rather than C-U C-Space (pop = mark) to help reduce things a little. It is certainly easier to type. Second, whenever I have something repetitive like this to do, I usually = define a temporary keyboard macro to help out. You just need to be = creative about where in the process the macro starts and ends. I would think something like: 1. Position curser at yank location. 2. C-Space to mark the location 3. Position curser at start of cut location. 4. Mark and select text to be cut. 5. C-X( to start keyboard macro. 6. C-W to cut the text 7. C-X C-X to swap to paste location 8. C-Y to yank the text 9. C-X) to end keyboard macro. Now you have. A. Perform the first 4 steps. B. C-Xe to execute the macro. As opposed what I see as your 7 steps, this takes 9 steps the first = time, then 5 steps for every repeat after that. Not much of a savings, but with a lot of repeats it does helps and it = certainly gets around the finger tangles. The one that I use a lot is to paste something at the beginning of a = line like when turning an enumerated list into a switch statement: After priming the pump with a "M-W C-E :=94 I create a macro that looks = something like: C-N C-A C-Y C-E: Fran > On May 9, 2015, at 7:30 AM, Sam Halliday = wrote: >=20 > To answer my own question, with an alternative, below: >=20 > On Saturday, 9 May 2015 12:18:39 UTC+1, Sam Halliday wrote: >> I have found myself doing some repetitive editing recently that I am = sure can be optimised. >>=20 >> Let's say I have a chunk of existing text (in the middle of the = buffer), and a bunch of new text (at the bottom of the buffer) with bits = of text that I want to selectively kill and then yank into the existing = text. >>=20 >> So the workflow looks like this: >>=20 >> 1. go to "new text", kill some relevant text >> 2. go to "existing text", yank >> 3. repeat >>=20 >>=20 >> In terms of keys strokes this means: >>=20 >> 1. `C-U SPACE` (now near relevant "new text") then unavoidable manual = keystrokes to select/kill >> 2. `C-SPACE C-SPACE`, then `C-U SPACE` (does nothing) to add this = location to the mark ring and ignore that mark in the ring. >> 3. `C-U SPACE` (now near relevant "existing text") then unavoidable = manual keystrokes to yank >> 4. `C-SPACE C-SPACE`, then `C-U SPACE` (does nothing) to add this = location to the mark ring >>=20 >> Actually, my fingers can confused and end up just using pageup/down = :-/ >>=20 >> Obviously, steps 2 and 4 are undesirable. Is there a single command = that I can perform to effectively save the current point, then go to the = second mark in the mark ring? >=20 >=20 > The workflow can also be optimised by opening a second frame into the = same buffer. That helps a lot because `C-x o` then jumps to = approximately the locations where I was wanting to set the marks anyway. = However, it then requires me to split my screen... which is sometimes = not ideal.