From: Eli Zaretskii Date: Fri, 27 Jan 2006 19:24:00 +0000 (+0000) Subject: (latexenc-find-file-coding-system): Make sure latexenc-main-file is X-Git-Tag: emacs-pretest-22.0.90~4552 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=96a6ec17fe612074a1af084060301991b3bbda18;p=emacs.git (latexenc-find-file-coding-system): Make sure latexenc-main-file is a regular file and is readable. --- diff --git a/lisp/international/latexenc.el b/lisp/international/latexenc.el index 17a9df20843..07f76477ffd 100644 --- a/lisp/international/latexenc.el +++ b/lisp/international/latexenc.el @@ -156,7 +156,8 @@ coding system names is determined from `latex-inputenc-coding-alist'." "") ".tex" ".ltx" ".dtx" ".drv")) (if (and (null latexenc-main-file) ;Stop at first. - (file-exists-p (concat file ext))) + (file-regular-p (concat file ext)) + (file-readable-p (concat file ext))) (setq latexenc-main-file (concat file ext))))))) ;; try tex-modes tex-guess-main-file (when (and (not latexenc-dont-use-tex-guess-main-file-flag) @@ -167,7 +168,7 @@ coding system names is determined from `latex-inputenc-coding-alist'." (setq latexenc-main-file (tex-guess-main-file))))) ;; if we found a master/main file get the coding system from it (if (and latexenc-main-file - (file-regular-p latexenc-main-file) + (file-regular-p latexenc-main-file) (file-readable-p latexenc-main-file)) (let* ((latexenc-dont-use-tex-guess-main-file-flag t) (latexenc-dont-use-TeX-master-flag t)