[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
latexenc and `TeX-master'
From: |
David Reitter |
Subject: |
latexenc and `TeX-master' |
Date: |
Sun, 22 Jan 2006 08:58:51 +0000 |
When trying to load a .tex files with a (faulty) TeX Master directive,
the behavior of latexenc-find-file-coding-system is slightly flawed,
leading to an "Wrong type argument: arrayp, nil" error later-on.
The TeX master file in the .tex file I have is a directory:
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "~/web"
%%% End:
What happens in `latexenc-find-file-coding-system' is that this
directory is loaded (in dired mode). In this buffer, both
`coding-system-for-write' and `buffer-file-coding-system' are nil so
that `latexenc-find-file-coding-system' returns nil instead of
`undecided.
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.
*** latexenc.el 02 Dec 2005 13:24:11 +0000 1.11
--- latexenc.el 22 Jan 2006 08:52:12 +0000
***************
*** 156,162 ****
"")
".tex" ".ltx" ".dtx" ".drv"))
(if (and (null latexenc-main-file) ;Stop at
first.
! (file-exists-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)
--- 156,163 ----
"")
".tex" ".ltx" ".dtx" ".drv"))
(if (and (null latexenc-main-file) ;Stop at
first.
! (file-exists-p (concat file ext))
! (not (file-directory-p filename)))
(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)
***************
*** 174,180 ****
(find-file-noselect latexenc-main-file t)))
(coding-system-base ;Disregard the EOL part of
the CS.
(with-current-buffer latexenc-main-buffer
! (or coding-system-for-write buffer-file-coding-
system))))
'undecided))))
'undecided))
--- 175,183 ----
(find-file-noselect latexenc-main-file t)))
(coding-system-base ;Disregard the EOL part of
the CS.
(with-current-buffer latexenc-main-buffer
! (or coding-system-for-write
! buffer-file-coding-system
! 'undecided))))
'undecided))))
'undecided))
- latexenc and `TeX-master',
David Reitter <=
Re: latexenc and `TeX-master', Arne Jørgensen, 2006/01/22