emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: latexenc and `TeX-master'


From: Arne Jørgensen
Subject: Re: latexenc and `TeX-master'
Date: Sun, 22 Jan 2006 15:26:58 +0100
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

David Reitter <address@hidden> writes:

> While it seems like the "TeX-master" statement is clearly wrong, I
> think Emacs should tolerate that or give a useful error message rather
> than bailing out. The patch below takes care of that.

I think you have a good point.

But it is probably better to check if the file is a regular and then
also check if it is actually readable.

Patch attached.

Kind regards

     /arne
-- 
Arne Jørgensen <http://arnested.dk/>

Index: lisp/international/latexenc.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/international/latexenc.el,v
retrieving revision 1.11
diff -u -p -r1.11 latexenc.el
--- lisp/international/latexenc.el      2 Dec 2005 13:24:11 -0000       1.11
+++ lisp/international/latexenc.el      22 Jan 2006 14:22:40 -0000
@@ -1,6 +1,6 @@
 ;;; latexenc.el --- guess correct coding system in LaTeX files
 
-;; Copyright (C) 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Arne J,Ax(Brgensen <address@hidden>
 ;; Keywords: mule, coding system, latex
@@ -156,7 +156,8 @@ coding system names is determined from `
                                        "")
                                  ".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)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]