From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: MBR Newsgroups: gmane.emacs.help Subject: Re: Emacs Book Vs Emacs Manuals Date: Sat, 27 Jun 2015 15:29:54 -0400 Message-ID: <558EF9B2.2090108@arlsoft.com> References: <554C9356.5000204@gmail.com> <20150508125314086261755@bob.proulx.com> <87bnhuc177.fsf@mbork.pl> <55561B9E.4070101@arlsoft.com> <87y4kpfvct.fsf@debian.uxu> <87mvzmv7ef.fsf@nl106-137-147.student.uu.se> <871tgycjae.fsf@mbork.pl> <87lhf6ks6g.fsf@nl106-137-147.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1435433437 7159 80.91.229.3 (27 Jun 2015 19:30:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 27 Jun 2015 19:30:37 +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 21:30:19 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 1Z8vnp-0003Gk-Sq for geh-help-gnu-emacs@m.gmane.org; Sat, 27 Jun 2015 21:30:14 +0200 Original-Received: from localhost ([::1]:37121 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8vno-0002u8-Nv for geh-help-gnu-emacs@m.gmane.org; Sat, 27 Jun 2015 15:30:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56845) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8vne-0002sn-ID for help-gnu-emacs@gnu.org; Sat, 27 Jun 2015 15:30:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8vnZ-0007CZ-97 for help-gnu-emacs@gnu.org; Sat, 27 Jun 2015 15:30:02 -0400 Original-Received: from [205.234.186.191] (port=37051 helo=hampton.hostforweb.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8vnZ-0007BZ-4t for help-gnu-emacs@gnu.org; Sat, 27 Jun 2015 15:29:57 -0400 Original-Received: from c-24-34-107-193.hsd1.ma.comcast.net ([24.34.107.193]:61890 helo=[192.168.1.121]) by hampton.hostforweb.net with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.85) (envelope-from ) id 1Z8vnW-0036gP-AU; Sat, 27 Jun 2015 14:29:55 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 In-Reply-To: <87lhf6ks6g.fsf@nl106-137-147.student.uu.se> X-OutGoing-Spam-Status: No, score=-2.9 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hampton.hostforweb.net X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - arlsoft.com X-Get-Message-Sender-Via: hampton.hostforweb.net: authenticated_id: mbr+arlsoft.com/only user confirmed/virtual account not confirmed X-Source: X-Source-Args: X-Source-Dir: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (barebone) [generic] X-Received-From: 205.234.186.191 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 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:105230 Archived-At: There are often multiple ways of accomplishing the same thing. Sometimes one approach is faster or easier to compose than others. Sometimes one approach is more errorprone. For this particular data, a macro vs. a regular expression is about the same effort. But what if the table had 200 lines so you might not have noticed that somewhere off the bottom of the screen was a line with 5 columns instead of 4? For any such line, the first ".*" in your regular expression would do a greedy match which would include the first "&". Another approach when dealing with things that line up visually in columns, is Emacs' rectangle commands. Using the same LaTeX table: \begin{longtable} 1 & 2 & 3 & 4 \\\\ a & b & c & d \\\\ A & B & C & D \end{longtable} Position mark on the "3" in line 2 and point on the "D" in line 4. Now type: C-x r k Done! Mark (not Point) Rosenthal On 6/26/15 6:42 PM, Emanuel Berg wrote: > Marcin Borkowski writes: > >>> What do you typically produce with your macros? >>> If you give me a good example where the macro is >>> the life saver, I can think how I would do the >>> same thing. >> What about this: you have a LaTeX table with 4 >> columns, and you want to delete the second one. >> While you /can/ do it with LaTeX hackery >> (essentially making one of the columns invisible), >> you want to deal with it at the level of the source >> file. You put the point at the beginning of the >> first row and do something along these lines: >> >> F3 C-s & RET C-SPC C-s C-s RET C-w C-a C-n F4 >> >> and then press F4 once for each row (or even C-8 F4 >> if you know you have 8 more rows to go). >> >> I cannot see how Elisp could be faster for this, >> even if you /think/ in Elisp /and/ can touch-type. > Oh, yeah? > > \begin{longtable} > 1 & 2 & 3 & 4 \\\\ > a & b & c & d \\\\ > A & B & C & D > \end{longtable} > > %% (replace-regexp "^\\(.*&.*&\\).*&\\(.*\\)" "\\1\\2") > > \begin{longtable} > 1 & 2 & 4 \\\\ > a & b & d \\\\ > A & B & D > \end{longtable} >