all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* infinite loop in align latex
@ 2006-12-10 14:43 Stephen Leake
  0 siblings, 0 replies; only message in thread
From: Stephen Leake @ 2006-12-10 14:43 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-12-10 14:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-10 14:43 infinite loop in align latex Stephen Leake

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.