Commit 96a6ec17 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

(latexenc-find-file-coding-system): Make sure latexenc-main-file is

a regular file and is readable.
parent c5b46a65
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment