From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Doug Lewan Newsgroups: gmane.emacs.help Subject: RE: Operate on each line in region Date: Wed, 23 Apr 2014 18:03:00 +0000 Message-ID: <155DEC68569B714B86C2C7075F5EDA9892A75EC5@DAKIYA1.pegasus.local> References: <787a28ce-2ab1-4b11-92fd-ca4506447baa@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1398276212 15697 80.91.229.3 (23 Apr 2014 18:03:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Apr 2014 18:03:32 +0000 (UTC) To: Jacob Gerlach , "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 23 20:03:27 2014 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 1Wd1W1-00058v-Cd for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Apr 2014 20:03:25 +0200 Original-Received: from localhost ([::1]:34138 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wd1W0-0007tz-Ri for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Apr 2014 14:03:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wd1Vl-0007tq-EA for help-gnu-emacs@gnu.org; Wed, 23 Apr 2014 14:03:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wd1Vd-0003GB-QT for help-gnu-emacs@gnu.org; Wed, 23 Apr 2014 14:03:09 -0400 Original-Received: from webmail.shubertorg.com ([207.246.209.200]:22611) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wd1Vd-0003Fl-Mp for help-gnu-emacs@gnu.org; Wed, 23 Apr 2014 14:03:01 -0400 Original-Received: from dakiya1.pegasus.local ([172.16.208.201]) by DAKIYA1.pegasus.local ([172.16.208.201]) with mapi id 14.01.0438.000; Wed, 23 Apr 2014 14:03:01 -0400 Thread-Topic: Operate on each line in region Thread-Index: AQHPXxyCOm6/O8qNl0So5kq+8pnRRZsffiAA In-Reply-To: <787a28ce-2ab1-4b11-92fd-ca4506447baa@googlegroups.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.0.21.202] X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 207.246.209.200 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:97334 Archived-At: Jacob, There are a whole bunch of `align' commands that might be worth looking at. ,Douglas Douglas Lewan Shubert Ticketing (201) 489-8600 ext 224 Of course, shells have one feature that no other language has: subshells. > -----Original Message----- > From: help-gnu-emacs-bounces+dougl=3Dshubertticketing.com@gnu.org > [mailto:help-gnu-emacs-bounces+dougl=3Dshubertticketing.com@gnu.org] On > Behalf Of Jacob Gerlach > Sent: Wednesday, 2014 April 23 13:46 > To: help-gnu-emacs@gnu.org > Subject: Operate on each line in region >=20 > I am writing a function that will indent each line in a region to > justify equals signs: >=20 > foo =3D 1 > longerfoo =3D bar >=20 > Would become >=20 > foo =3D 1 > longerfoo =3D bar >=20 > I believe I understand how to iterate through the lines in a region > using either of two methods: >=20 > condition on the buffer positions for the start and end of the region: >=20 > (defun my-justify (start end) > (interactive 'r') > (while (< (point) end)) > ...body... > (forward-line 1))) >=20 > Narrow the buffer to region and use similar conditioning with (eobp). >=20 > I'm wondering if there is a more straightforward way to accomplish > this. >=20 > Thanks for any suggestions. > Jake