From 1957b847ef31dabb860a08c335aaf9ab1ef6d1f2 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Fri, 25 Jul 2008 18:39:38 +0000 Subject: [PATCH] (tex-compilation-parse-errors): Check for invalid filename strings when parsing tex errors (bug#376). --- lisp/textmodes/tex-mode.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 3f5aa2458a5..0a89a34ac45 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -2188,6 +2188,7 @@ for the error messages." (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,7 +2196,11 @@ for the error messages." (with-syntax-table tex-error-parse-syntax-table (backward-up-list 1) (skip-syntax-forward "(_") - (while (not (file-readable-p (thing-at-point 'filename))) + (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 "(_")) -- 2.39.2