GNU bug report logs - #376
latex error message starts dired

Previous Next

Package: emacs;

Reported by: Nate Eldredge <neldredge <at> ucsd.edu>

Date: Sun, 8 Jun 2008 03:50:03 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 376 in the body.
You can then email your comments to 376 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#376; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Nate Eldredge <neldredge <at> ucsd.edu>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Nate Eldredge <neldredge <at> ucsd.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: latex error message starts dired
Date: Sat, 7 Jun 2008 20:41:43 -0700 (PDT)
In latex mode, when latex produces an error, sometimes using C-x `
(next-error) opens a dired buffer instead of jumping to the error.

Here is a file which reproduces it.

============ snip ==================
\documentclass[12pt]{article}

\usepackage{amsthm}
\usepackage{amsmath}
\newcommand{\polar}{x}
\newcommand{\oldlambda}{xx}

\begin{document}

 \begin{proof}
   
 \begin{align}
 g(\polar, s) &= \Re \phi(se^{i\polar})\frac{1}{4\pi}s
 \psi(i(\pi-se^{i\polar}),\pi-s) \\
 k(\sqrt{\oldlambda}, \polar, s) &= e^{
 \end{align}
 \end{proof}

\end{document}
================ snip ====================

Visit the file with C-x C-f emacs-tex-error.tex
Compile it with C-c C-f
Try to jump to next error with C-x `
You should find yourself in a dired session (at least that's what it
does for me), which is not useful.

Here is the output of latex, as it appears in the *tex-shell* buffer.

================= snip ==================
nate <at> vulcan:~/bugs$ latex \\nonstopmode\\input emacs-tex-error.tex
This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)
entering extended mode
LaTeX2e <2003/12/01>
Babel <v3.8d> and hyphenation patterns for american, french, german, ngerman, b
ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch, esperanto, e
stonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk, polis
h, portuges, romanian, russian, serbian, slovak, slovene, spanish, swedish, tur
kish, ukrainian, nohyphenation, loaded.

(./emacs-tex-error.tex (/usr/local/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2004/02/16 v1.4f Standard LaTeX document class
(/usr/local/share/texmf-dist/tex/latex/base/size12.clo))
(/usr/local/share/texmf-dist/tex/latex/amscls/amsthm.sty)
(/usr/local/share/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/share/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/share/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/share/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/share/texmf-dist/tex/latex/amsmath/amsopn.sty))
(./emacs-tex-error.aux)
Runaway argument?
 g(\polar , s) &= \Re \phi (se^{i\polar })\frac {1}{4\pi }s \psi (i(\pi \ETC.
! Paragraph ended before \align was complete.
<to be read again> 
                   \par 
l.21 
     
! Missing $ inserted.
<inserted text> 
                $
l.21 
     
! Missing } inserted.
<inserted text> 
                }
l.21 
     
! Missing \endgroup inserted.
<inserted text> 
                \endgroup 
l.21 
     
! Display math should end with $$.
<to be read again> 
                   \@@par 
l.21 
     
! Extra }, or forgotten \endgroup.
\par ...m \@noitemerr {\@@par }\fi \else {\@@par }
                                                  \fi 
l.21 
     

! LaTeX Error: \begin{align} on input line 15 ended by \end{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.22 \end{document}
                   
[1] (./emacs-tex-error.aux) )
(\end occurred inside a group at level 2)

### semi simple group (level 2) entered at line 15 (\begingroup)
### semi simple group (level 1) entered at line 13 (\begingroup)
### bottom level
(see the transcript file for additional information)
Output written on emacs-tex-error.dvi (1 page, 276 bytes).
Transcript written on emacs-tex-error.log.
nate <at> vulcan:~/bugs$ 
===================== snip =====================

Any suggestions appreciated.  Thanks!



In GNU Emacs 22.2.1 (x86_64-pc-freebsd, GTK+ Version 2.12.9)
 of 2008-06-07 on vulcan.lan
Windowing system distributor `The X.Org Foundation', version 11.0.10400000
configured using `configure  '--with-gtk' '--x-libraries=/usr/local/lib' '--x-includes=/usr/local/include' '--prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/info/' 'amd64-freebsd' 'build_alias=amd64-freebsd' 'host_alias=amd64-freebsd' 'target_alias=amd64-freebsd' 'CC=cc' 'CFLAGS=-O2 -fno-strict-aliasing -pipe -march=opteron''

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: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Major mode: Dired by name

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent input:
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> C-x C-f ~ b <backspace> / b u g <tab> <tab> 
<tab> e m <tab> <tab> t <tab> <return> C-c C-f C-x 
` <help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <menu-bar> <help-menu> <se
nd-emacs-bug-report>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...
Loading help-mode...done
Making completion list...
Loading tex-mode...
Loading regexp-opt...done
Loading tex-mode...done
(No files need saving)
Loading dired...done
Loading emacsbug...done





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#376; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Ralf Angeli <angeli <at> caeruleus.net>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #10 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Ralf Angeli <angeli <at> caeruleus.net>
To: Nate Eldredge <neldredge <at> ucsd.edu>
Cc: 376 <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
Subject: Re: bug#376: latex error message starts dired
Date: Sun, 08 Jun 2008 10:03:38 +0200
* Nate Eldredge (2008-06-08) writes:

> Here is the output of latex, as it appears in the *tex-shell* buffer.

> Runaway argument?
>  g(\polar , s) &= \Re \phi (se^{i\polar })\frac {1}{4\pi }s \psi (i(\pi \ETC.
> ! Paragraph ended before \align was complete.

The parser finds this error and subsequently tries to determine the file
name.  In course of that it checks the "(\pi" construct with point right
before the backslash.  In this case the form
(file-readable-p (thing-at-point 'filename))
returns t and the file name is set to an empty string.  (This is what
`(thing-at-point 'filename)' returns.)

I'm not sure if this is a problem with `thing-at-point' or
`file-readable-p'.

As a workaround you could enable file:line:error messages for latex.

-- 
Ralf





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#376; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Ralf Angeli <angeli <at> caeruleus.net>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#376; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Nate Eldredge <neldredge <at> math.ucsd.edu>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #20 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Nate Eldredge <neldredge <at> math.ucsd.edu>
To: Ralf Angeli <angeli <at> caeruleus.net>
Cc: 376 <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
Subject: Re: bug#376: latex error message starts dired
Date: Sun, 8 Jun 2008 01:33:32 -0700 (PDT)
On Sun, 8 Jun 2008, Ralf Angeli wrote:

> * Nate Eldredge (2008-06-08) writes:
>
>> Here is the output of latex, as it appears in the *tex-shell* buffer.
>
>> Runaway argument?
>>  g(\polar , s) &= \Re \phi (se^{i\polar })\frac {1}{4\pi }s \psi (i(\pi \ETC.
>> ! Paragraph ended before \align was complete.
>
> The parser finds this error and subsequently tries to determine the file
> name.  In course of that it checks the "(\pi" construct with point right
> before the backslash.  In this case the form
> (file-readable-p (thing-at-point 'filename))
> returns t and the file name is set to an empty string.  (This is what
> `(thing-at-point 'filename)' returns.)
>
> I'm not sure if this is a problem with `thing-at-point' or
> `file-readable-p'.
>
> As a workaround you could enable file:line:error messages for latex.

Ah, thanks for the suggestion.  I did not know about that feature.  That 
solves the problem for me.

Thanks for investigating this bug.

-- 

Nate Eldredge
neldredge <at> math.ucsd.edu





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#376; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Nate Eldredge <neldredge <at> math.ucsd.edu>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#376; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Chong Yidong <cyd <at> stupidchicken.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #30 received at 376 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Ralf Angeli <angeli <at> caeruleus.net>
Cc: Nate Eldredge <neldredge <at> ucsd.edu>, 376 <at> debbugs.gnu.org
Subject: Re: latex error message starts dired
Date: Fri, 25 Jul 2008 13:35:13 -0400
>> In latex mode, when latex produces an error, sometimes using C-x `
>> (next-error) opens a dired buffer instead of jumping to the error.
>>
>> Here is the output of latex, as it appears in the *tex-shell* buffer.
>>
>> Runaway argument?
>>  g(\polar , s) &= \Re \phi (se^{i\polar })\frac {1}{4\pi }s \psi (i(\pi \ETC.
>> ! Paragraph ended before \align was complete.
>
> The parser finds this error and subsequently tries to determine the file
> name.  In course of that it checks the "(\pi" construct with point right
> before the backslash.  In this case the form
> (file-readable-p (thing-at-point 'filename))
> returns t and the file name is set to an empty string.  (This is what
> `(thing-at-point 'filename)' returns.)

How bout the following patch to tex-mode?

*** textmodes/tex-mode.el.~1.213.~	2008-06-25 18:35:53.000000000 -0400
--- textmodes/tex-mode.el	2008-07-25 13:32:46.000000000 -0400
***************
*** 2188,2193 ****
--- 2188,2194 ----
        (let* ((this-error (copy-marker begin-of-error))
  	     (linenum (string-to-number (match-string 1)))
  	     (error-text (regexp-quote (match-string 3)))
+ 	     try-filename
  	     (filename
  	      ;; Prefer --file-liner-error filename if we have it.
  	      (or errfilename
***************
*** 2195,2201 ****
  		    (with-syntax-table tex-error-parse-syntax-table
  		      (backward-up-list 1)
  		      (skip-syntax-forward "(_")
! 		      (while (not (file-readable-p (thing-at-point 'filename)))
  			(skip-syntax-backward "(_")
  			(backward-up-list 1)
  			(skip-syntax-forward "(_"))
--- 2196,2206 ----
  		    (with-syntax-table tex-error-parse-syntax-table
  		      (backward-up-list 1)
  		      (skip-syntax-forward "(_")
! 		      (while (not 
! 			      (and (setq try-filename (thing-at-point
! 						       'filename))
! 				   (not (string= "" try-filename))
! 				   (file-readable-p try-filename)))
  			(skip-syntax-backward "(_")
  			(backward-up-list 1)
  			(skip-syntax-forward "(_"))




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#376; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Ralf Angeli <angeli <at> caeruleus.net>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #35 received at 376 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Ralf Angeli <angeli <at> caeruleus.net>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: Nate Eldredge <neldredge <at> ucsd.edu>, 376 <at> debbugs.gnu.org
Subject: Re: latex error message starts dired
Date: Fri, 25 Jul 2008 19:50:39 +0200
* Chong Yidong (2008-07-25) writes:

>> The parser finds this error and subsequently tries to determine the file
>> name.  In course of that it checks the "(\pi" construct with point right
>> before the backslash.  In this case the form
>> (file-readable-p (thing-at-point 'filename))
>> returns t and the file name is set to an empty string.  (This is what
>> `(thing-at-point 'filename)' returns.)
>
> How bout the following patch to tex-mode?

> ! 		      (while (not 
> ! 			      (and (setq try-filename (thing-at-point
> ! 						       'filename))
> ! 				   (not (string= "" try-filename))
> ! 				   (file-readable-p try-filename)))

Looks okay (without actually trying it).  (I'd probably move the `setq'
call into the `string=' call.)  Of course it will still lose if there is
a string after the paren which corresponds to the name of an existing
file, but the chances for that are really slim.

-- 
Ralf




Reply sent to Chong Yidong <cyd <at> stupidchicken.com>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Nate Eldredge <neldredge <at> ucsd.edu>:
bug acknowledged by developer. Full text and rfc822 format available.

Message #40 received at 376-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Ralf Angeli <angeli <at> caeruleus.net>
Cc: Nate Eldredge <neldredge <at> ucsd.edu>, 376-done <at> debbugs.gnu.org
Subject: Re: latex error message starts dired
Date: Fri, 25 Jul 2008 14:44:07 -0400
Ralf Angeli <angeli <at> caeruleus.net> writes:

>> How bout the following patch to tex-mode?
>
> Looks okay (without actually trying it).  (I'd probably move the
> `setq' call into the `string=' call.)  Of course it will still lose if
> there is a string after the paren which corresponds to the name of an
> existing file, but the chances for that are really slim.

Thanks.




bug archived. Request was from Debbugs Internal Request <don <at> donarmstrong.com> to internal_control <at> emacsbugs.donarmstrong.com. (Sat, 23 Aug 2008 14:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 16 years and 360 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.