🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #98981

Re: Infinite loop in (forward-paragraph -1)

#98981
From: Alan M. Carroll
Date: Fri, 14 Dec 1990 17:52
33 lines
2026 bytes
In article <CMM.0.88.661053213.beebe@sandy.math.utah.edu>, beebe@SANDY.MATH.UTAH.EDU ("Nelson H.F. Beebe") writes:
> In GNU Emacs 18.55 (and likely earlier versions), if in
> tex-mode, you have a paragraph whose first line begins with a
> backslash, and then you type M-g (fill-region), you get an
> infinite loop.  M-q (fill-paragraph) works fine.
> 
> I've traced the problem to fill-region calling
> (forward-paragraph -1), and it appears that the section
> 
> 	    ;; Found one.
> 	    (progn
> 	      (while (looking-at paragraph-separate)
> 		(forward-line 1))
> 	      (if (eq (char-after (- (point) 2)) ?\n)
> 		  (forward-line -1)))
> 
> in forward-paragraph in lisp/paragraph.el is where the loop
> happens.

Well, I thought I'd fixed this in Epoch, but I can't find the fix
anymore. It seems to have gotten lost during a merge. Try the
following as a fix.

	    (progn
	      (while (and (not (bobp)) (looking-at paragraph-separate))
		(forward-line 1))
	      (if (eq (char-after (- (point) 2)) ?\n)
		  (forward-line -1)))

-- 
Alan M. Carroll                "It's psychosomatic. You need a lobotomy.
Epoch Development Team          I'll get a saw."
CS Grad / U of Ill @ Urbana    ...{ucbvax,pur-ee,convex}!cs.uiuc.edu!carroll
Technical Details
Message-ID: <1990Dec14.175229.25020@ux1.cso.uiuc.edu>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!snorkelwacker.mit.edu!tut.cis.ohio-state.edu!CS.UIUC.EDU!carroll
References: <CMM.0.88.661053213.beebe@sandy.math.utah.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,23dad4245b57fd80
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1990-12-14 09:52:29 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!snorkelwacker.mit.edu!tut.cis.ohio-state.edu!CS.UIUC.EDU!carroll
From: carroll@CS.UIUC.EDU (Alan M. Carroll)
Newsgroups: gnu.emacs.bug
Subject: Re: Infinite loop in (forward-paragraph -1)
Message-ID: <1990Dec14.175229.25020@ux1.cso.uiuc.edu>
Date: 14 Dec 90 17:52:29 GMT
References: <CMM.0.88.661053213.beebe@sandy.math.utah.edu>
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: carroll@cs.uiuc.edu (Alan M. Carroll)
Distribution: gnu
Organization: Technophiles Inc. - Engineers with Attitude
Lines: 33
Approved: bug-gnu-emacs@prep.ai.mit.edu