From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jacob Gerlach Newsgroups: gmane.emacs.help Subject: Operate on each line in region Date: Wed, 23 Apr 2014 10:45:35 -0700 (PDT) Message-ID: <787a28ce-2ab1-4b11-92fd-ca4506447baa@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1398275429 3373 80.91.229.3 (23 Apr 2014 17:50:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Apr 2014 17:50:29 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 23 19:50:23 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 1Wd1JN-0000gJ-Lh for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Apr 2014 19:50:21 +0200 Original-Received: from localhost ([::1]:34103 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wd1JN-0000ft-Cp for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Apr 2014 13:50:21 -0400 X-Received: by 10.58.196.209 with SMTP id io17mr27318573vec.7.1398275135496; Wed, 23 Apr 2014 10:45:35 -0700 (PDT) X-Received: by 10.140.102.65 with SMTP id v59mr2765qge.42.1398275135425; Wed, 23 Apr 2014 10:45:35 -0700 (PDT) Original-Path: usenet.stanford.edu!cm18no5704934qab.0!news-out.google.com!du2ni14151qab.0!nntp.google.com!m5no4707666qaj.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=18.189.15.14; posting-account=Hx-_8AoAAACyMXgs4MCS3wNERNLct_lk Original-NNTP-Posting-Host: 18.189.15.14 User-Agent: G2/1.0 Injection-Date: Wed, 23 Apr 2014 17:45:35 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:205067 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:97333 Archived-At: I am writing a function that will indent each line in a region to justify equals signs: foo = 1 longerfoo = bar Would become foo = 1 longerfoo = bar I believe I understand how to iterate through the lines in a region using either of two methods: condition on the buffer positions for the start and end of the region: (defun my-justify (start end) (interactive 'r') (while (< (point) end)) ...body... (forward-line 1))) Narrow the buffer to region and use similar conditioning with (eobp). I'm wondering if there is a more straightforward way to accomplish this. Thanks for any suggestions. Jake