From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#6205: 23.1; align.el error deleting a lot of whitespace Date: Tue, 18 May 2010 23:33:02 -0400 Message-ID: References: <87y6fi150y.fsf@blah.blah> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1274241429 16962 80.91.229.12 (19 May 2010 03:57:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 19 May 2010 03:57:09 +0000 (UTC) Cc: 6205@debbugs.gnu.org, Kevin Ryde To: John Wiegley Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 19 05:57:07 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-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 1OEaP5-0005wK-44 for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 May 2010 05:57:07 +0200 Original-Received: from localhost ([127.0.0.1]:52642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OEaP4-00056Q-J5 for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 May 2010 23:57:06 -0400 Original-Received: from [140.186.70.92] (port=48947 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OEaOx-00055a-1L for bug-gnu-emacs@gnu.org; Tue, 18 May 2010 23:57:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OEaOv-0001z6-An for bug-gnu-emacs@gnu.org; Tue, 18 May 2010 23:56:59 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47241) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OEaOv-0001z2-7E for bug-gnu-emacs@gnu.org; Tue, 18 May 2010 23:56:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OEa2k-0006WV-9g; Tue, 18 May 2010 23:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 May 2010 03:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6205 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6205-submit@debbugs.gnu.org id=B6205.127423998925064 (code B ref 6205); Wed, 19 May 2010 03:34:02 +0000 Original-Received: (at 6205) by debbugs.gnu.org; 19 May 2010 03:33:09 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OEa1t-0006WD-AN for submit@debbugs.gnu.org; Tue, 18 May 2010 23:33:09 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OEa1q-0006Vy-Gu for 6205@debbugs.gnu.org; Tue, 18 May 2010 23:33:07 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAAb58ktMCpz0/2dsb2JhbACeB3K9O4UQBIwv X-IronPort-AV: E=Sophos;i="4.53,259,1272859200"; d="scan'208";a="64538764" Original-Received: from 76-10-156-244.dsl.teksavvy.com (HELO alfajor.home) ([76.10.156.244]) by ironport2-out.pppoe.ca with ESMTP; 18 May 2010 23:33:02 -0400 Original-Received: by alfajor.home (Postfix, from userid 20848) id 2A2A1AED5D; Tue, 18 May 2010 23:33:02 -0400 (EDT) In-Reply-To: <87y6fi150y.fsf@blah.blah> (Kevin Ryde's message of "Tue, 18 May 2010 09:29:17 +1000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 18 May 2010 23:34:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:37038 Archived-At: John, what's your opinion? The patch looks OK to me, but at the same time, the code is pretty impenetrable from here, Stefan >>>>> "Kevin" == Kevin Ryde writes: > If M-x align deletes a lot of whitespace doing its alignment it can get > an "Invalid search bound" error. Eg. with foo.el below > emacs -Q foo.el > M-x end-of-buffer > M-x align > => Invalid search bound (wrong side of point) > In `align-region' it seems `last-point' is established from `b' which is > an integer buffer position but that position is invalidated by > whitespace deletes before that point (done by `align-regions'). > I get some joy from making the marker before changing the buffer, per > below. Alternately (untested!) perhaps `b' could be a marker to start > with, ready to be the new value of `last-point'. > 2010-05-17 Kevin Ryde > * align.el (align-region): For `last-point' take marker of b > position before align-regions because that function inserts or > deletes text before there. In particular fixes "Invalid search > bound" when there's two sections in the region and alignment in > the first deletes a lot of whitespace. > (ab . c) > (def . ghi) > (ab . c) > (foo . bar) > (foo . bar) > --- align.el.~1.35.~ 2009-03-28 09:41:43.000000000 +1100 > +++ align.el 2010-05-16 19:03:40.000000000 +1000 > @@ -1502,10 +1502,10 @@ > (align-new-section-p last-point b > thissep)) > (progn > + (setq last-point (copy-marker b t)) > (align-regions regions align-props > rule func) > - (setq last-point (copy-marker b t) > - regions nil > + (setq regions nil > align-props nil)) > (setq last-point (copy-marker b t))) > In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5) > of 2009-09-14 on raven, modified by Debian > configured using `configure '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' > Important settings: > value of $LC_ALL: nil > value of $LC_COLLATE: nil > value of $LC_CTYPE: nil > value of $LC_MESSAGES: nil > value of $LC_MONETARY: nil > value of $LC_NUMERIC: nil > value of $LC_TIME: nil > value of $LANG: en_AU > value of $XMODIFIERS: nil > locale-coding-system: iso-latin-1-unix > default-enable-multibyte-characters: t