From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: infinite loop in align latex Date: Sun, 10 Dec 2006 09:43:41 -0500 Message-ID: NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1165761889 26530 80.91.229.10 (10 Dec 2006 14:44:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 10 Dec 2006 14:44:49 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 10 15:44:47 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1GtPv3-00069Z-TL for ged-emacs-devel@m.gmane.org; Sun, 10 Dec 2006 15:44:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GtPv3-0002TC-I6 for ged-emacs-devel@m.gmane.org; Sun, 10 Dec 2006 09:44:45 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GtPuZ-0002Cc-AP for emacs-devel@gnu.org; Sun, 10 Dec 2006 09:44:15 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GtPuS-00026a-Cc for emacs-devel@gnu.org; Sun, 10 Dec 2006 09:44:10 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GtPuQ-00024J-Gb for emacs-devel@gnu.org; Sun, 10 Dec 2006 09:44:06 -0500 Original-Received: from [128.183.244.130] (helo=mailhost2.gsfc.nasa.gov) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GtPuQ-0002qU-9f for emacs-devel@gnu.org; Sun, 10 Dec 2006 09:44:06 -0500 Original-Received: from popc.gsfc.nasa.gov (pop200.gsfc.nasa.gov [128.183.244.176]) by mailhost2.gsfc.nasa.gov (8.12.11/8.12.11) with ESMTP id kBAEhoWf017849 for ; Sun, 10 Dec 2006 09:43:55 -0500 Original-Received: from ACS1100007992 (gsfc48-vpn148.gsfc.nasa.gov [198.119.48.148]) by popc.gsfc.nasa.gov (8.13.7/8.12.11) with ESMTP id kBAEhjhp029746 for ; Sun, 10 Dec 2006 09:43:50 -0500 (EST) Original-To: emacs-devel User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:63547 Archived-At: I've found a fix for a bug in align for LaTeX. To reproduce the bug, paste the following text in a buffer: ------------ The I \& T custom cards uses a single FPGA per custom card. Older custom cards do not use a single FPGA for each custom card; they use ADLINK digital IO and Kontron timer cards, as well as the \code{GDS_Timers} FPGA image. Some custom cards have 2 cPLDs on them. We do not have a consistent naming convention for the older cPLDs. \begin{tabular}{|lllll|} \hline \multicolumn{5}{|c|}{FPGA images} \\ \hline Name & Configuration & Driver & Driver & image file \\ & & ID high & ID low & \\ \hline GDS\_Timers & 1 & 0 & 0 & \file{gds_timers.hexout} \\ I\&T & 1 & 1 & 1 & \file{fpga_int_sdo_1.hexout} \\ I\&T & 2 & 1 & 2 & \file{fpga_int_sdo_2.hexout} \\ \hline \end{tabular} ----------- Then position point on 'Name' in the table. Then: M-x latex-mode M-x align-current Emacs hangs; interrupt with control-g. I don't understand why this is not always a problem; it only occurs in some (apparently rare) situations. Here's the fix: =================================================================== RCS file: /sources/emacs/emacs/lisp/align.el,v retrieving revision 1.22 diff -c -r1.22 align.el *** align.el 6 Feb 2006 14:33:31 -0000 1.22 --- align.el 10 Dec 2006 14:38:42 -0000 *************** *** 1074,1080 **** (eq (char-before pos) ?\\)) (setq count (1+ count) pos (1- pos))) (eq (mod count 2) 1)) ! (goto-char (match-beginning 2)))) result)) (defun align-new-section-p (beg end separator) --- 1074,1080 ---- (eq (char-before pos) ?\\)) (setq count (1+ count) pos (1- pos))) (eq (mod count 2) 1)) ! (goto-char (match-beginning (if reverse 1 2))))) result)) (defun align-new-section-p (beg end separator) -- -- Stephe