From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: Emacs Book Vs Emacs Manuals Date: Sat, 27 Jun 2015 10:25:38 +0200 Message-ID: <87wpypblrx.fsf@mbork.pl> References: <55561B9E.4070101@arlsoft.com> <87y4kpfvct.fsf@debian.uxu> <87mvzmv7ef.fsf@nl106-137-147.student.uu.se> <871tgycjae.fsf@mbork.pl> <20150626221204690538460@bob.proulx.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1435393583 20224 80.91.229.3 (27 Jun 2015 08:26:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 27 Jun 2015 08:26:23 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jun 27 10:26:16 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 1Z8lRH-00049j-0H for geh-help-gnu-emacs@m.gmane.org; Sat, 27 Jun 2015 10:26:15 +0200 Original-Received: from localhost ([::1]:34815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8lRF-0006hv-Vf for geh-help-gnu-emacs@m.gmane.org; Sat, 27 Jun 2015 04:26:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8lR5-0006hn-A5 for help-gnu-emacs@gnu.org; Sat, 27 Jun 2015 04:26:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8lR1-0005mL-Kf for help-gnu-emacs@gnu.org; Sat, 27 Jun 2015 04:26:03 -0400 Original-Received: from mail.mojserwer.eu ([2a01:5e00:2:52::8]:56727) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8lR1-0005jm-6n for help-gnu-emacs@gnu.org; Sat, 27 Jun 2015 04:25:59 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 5A0E24F6080 for ; Sat, 27 Jun 2015 10:25:56 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2elVNXxfPY5S for ; Sat, 27 Jun 2015 10:25:54 +0200 (CEST) Original-Received: from localhost (ipz217.internetdsl.tpnet.pl [79.190.154.217]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 81E634F607F for ; Sat, 27 Jun 2015 10:25:50 +0200 (CEST) In-reply-to: <20150626221204690538460@bob.proulx.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a01:5e00:2:52::8 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:105217 Archived-At: On 2015-06-27, at 07:02, Bob Proulx wrote: > Rusi wrote: >> Emanuel Berg wrote: >> > %% (replace-regexp "^\\(.*&.*&\\).*&\\(.*\\)" "\\1\\2") >> >> 51 chars (ignoring that things like ^& are shift chords) >>=20 >> F3 >> C-s & RET C-SPC C-s C-s RET C-w C-a C-n >> F4 >>=20 >> 16 keystrokes counting each chord as 1 1/2 keys > > I don't think keyboard golf is the best justification for something. > It helps. But for me keyboard macros are simply more interactive. > They are a way to quickly multiply one keystroke into many. > > But the above does make me realize that I often use keyboard macros > when the "shape" of the text is a factor in the editing of it. Such > as when I need to make edits around something both above and below > it. I might need to move a chunk of text up or down or otherwise > mutate it in unusual ways while editing. During the keyboard macro I > can search for something, then search for something different, perhaps > several times to land on the right starting point. Then I can move up > or down spatially to be where I want to be. That is much harder to do > with regular expression. I grew up with regular expressions and use > them all of the time. But I use different tools at different times. Exactly. Macros are especially nice in that they mimic the way you edit text. You can do that in Elisp, too, or sometimes regexen, but Elisp requires a lot of typing and regexen require a lot of thinking; both are energy- and time-consuming. OTOH, there are cases when macros won't do (conditional expressions, loops =E2=80=93 they are doable in macros =E2=80= =93 see Calc manual =E2=80=93 but much less intuitive, at least for me). > Here is a contrived example. Split the buffer into two windows. Nice! > Regular expressions are awesome. But keyboard macros are awesome too. Yes. > Bob Best, --=20 Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University