From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pranav Peshwe Newsgroups: gmane.emacs.help Subject: Re: apply macro to region lines by name Date: Tue, 6 Jul 2010 08:17:25 +0530 Message-ID: References: <48E8363E-CC44-47F0-88FD-4A86A7ADBBD1@Web.DE> <4C323378.9070507@gmail.com> <4C3297A0.4040508@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016e646120ec61ba7048aaf124f X-Trace: dough.gmane.org 1278384481 26839 80.91.229.12 (6 Jul 2010 02:48:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 6 Jul 2010 02:48:01 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Suvayu Ali Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 06 04:48:00 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OVyCV-00025X-5M for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Jul 2010 04:47:59 +0200 Original-Received: from localhost ([127.0.0.1]:52150 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OVyCU-0000wV-3y for geh-help-gnu-emacs@m.gmane.org; Mon, 05 Jul 2010 22:47:58 -0400 Original-Received: from [140.186.70.92] (port=58047 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OVyC3-0000wG-TV for help-gnu-emacs@gnu.org; Mon, 05 Jul 2010 22:47:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OVyBz-0001kQ-2C for help-gnu-emacs@gnu.org; Mon, 05 Jul 2010 22:47:31 -0400 Original-Received: from mail-iw0-f169.google.com ([209.85.214.169]:60123) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVyBy-0001kJ-Vb for help-gnu-emacs@gnu.org; Mon, 05 Jul 2010 22:47:27 -0400 Original-Received: by iwn2 with SMTP id 2so5773910iwn.0 for ; Mon, 05 Jul 2010 19:47:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=F8Yq47AZfAASkE7tTJuC2Lghv4m1mdS8Lu6hdw9/w74=; b=xCHfBZMBuHxGwa3vo9Aeq8zopYhd90PLEas4PjjitCbu89VtmHZg99GMlRyh/yRE33 dISKvdk1cnY1TDrgzKSdKgo0sj6a/aUgAo9df/ZFyZ4Sdn3B+YeWYOYYRaMcCi6bdvl+ DyMRtz5Br+vVl1umcBtQ19ZrwmZE5A567mlHQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=KOReCUASh4G+J9ApSrX9oZZdr3xD77KxkpF+HxrZwhJToK1AFWnXmUoiO3fnr+u5q2 Y7DDj9ORqhb6GkWh7z560QND96VDBqLeZmwCspZqF6r0YFjf+FWwuX2Zrg1rF1DNeRgp 6Zxq7qEKXdoHThv/e49sN4ghlbsrsS5b+mYMU= Original-Received: by 10.231.139.212 with SMTP id f20mr3333582ibu.166.1278384445724; Mon, 05 Jul 2010 19:47:25 -0700 (PDT) Original-Received: by 10.231.143.146 with HTTP; Mon, 5 Jul 2010 19:47:25 -0700 (PDT) In-Reply-To: <4C3297A0.4040508@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:74088 Archived-At: --0016e646120ec61ba7048aaf124f Content-Type: text/plain; charset=ISO-8859-1 On Tue, Jul 6, 2010 at 8:10 AM, Suvayu Ali > wrote: > On Monday 05 July 2010 06:17 PM, Corey Foote wrote: > >> >> Thanks, but that only applies the macro to the last line of the region. I >> want it to apply it to every line within the region. >> >> > How about you mark the region, then `M-='. This runs `count-lines-region'. > And then run `M- M-x foo' > > Its not very clean but that should do it. > > That will work fine provided that the macro itself contains a command to move to the next/previous line. Otherwise the same action will be done n times on the one line the macro was run on. HTH. -Pranav > -- > Suvayu > > Open source is the future. It sets us free. > > --0016e646120ec61ba7048aaf124f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Tue, Jul 6, 2010 at 8:10 AM, Suvayu Ali <fatkasuva= yu+linux@gmail.com> wrote:
On Monday 05 July 2010 06:17 PM, Corey Foote wrote:

Thanks, but that only applies the macro to the last line of the region. I w= ant it to apply it to every line within the region.


How about you mark the region, then `M-=3D'. This runs `count-lines-reg= ion'. And then run `M-<no_of_lines> M-x foo'

Its not very clean but that should do it.


That will work fine provided that the= macro itself contains a command to move to the next/previous line. Otherwi= se the same action will be done n times on the one line the macro was run o= n.

HTH.

-Pranav
=A0
--
Suvayu

Open source is the future. It sets us free.


--0016e646120ec61ba7048aaf124f--