From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#376: latex error message starts dired Date: Fri, 25 Jul 2008 13:35:13 -0400 Message-ID: <878wvpzx2m.fsf@stupidchicken.com> Reply-To: Chong Yidong , 376@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1217008083 2706 80.91.229.12 (25 Jul 2008 17:48:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Jul 2008 17:48:03 +0000 (UTC) Cc: 376@emacsbugs.donarmstrong.com, Nate Eldredge To: Ralf Angeli Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 25 19:48:52 2008 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.50) id 1KMRPD-0002RB-6d for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Jul 2008 19:48:39 +0200 Original-Received: from localhost ([127.0.0.1]:51664 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KMROJ-0000LC-3C for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Jul 2008 13:47:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KMRO3-0000Ao-F7 for bug-gnu-emacs@gnu.org; Fri, 25 Jul 2008 13:47:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KMRO0-00007Y-LN for bug-gnu-emacs@gnu.org; Fri, 25 Jul 2008 13:47:26 -0400 Original-Received: from [199.232.76.173] (port=55640 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KMRO0-00007P-G4 for bug-gnu-emacs@gnu.org; Fri, 25 Jul 2008 13:47:24 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:56646) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KMRNz-0002qu-LT for bug-gnu-emacs@gnu.org; Fri, 25 Jul 2008 13:47:24 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m6PHlJI3029924; Fri, 25 Jul 2008 10:47:20 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m6PHe4lj027719; Fri, 25 Jul 2008 10:40:04 -0700 X-Loop: don@donarmstrong.com Resent-From: Chong Yidong Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 25 Jul 2008 17:40:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 376 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 376-submit@emacsbugs.donarmstrong.com id=B376.121700722326409 (code B ref 376); Fri, 25 Jul 2008 17:40:04 +0000 Original-Received: (at 376) by emacsbugs.donarmstrong.com; 25 Jul 2008 17:33:43 +0000 Original-Received: from cyd (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m6PHXdR7026403 for <376@emacsbugs.donarmstrong.com>; Fri, 25 Jul 2008 10:33:41 -0700 Original-Received: by cyd (Postfix, from userid 1000) id 8A20C57E311; Fri, 25 Jul 2008 13:35:13 -0400 (EDT) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Fri, 25 Jul 2008 13:47:26 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list 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:18854 Archived-At: >> 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 "(_"))