From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Reitter Newsgroups: gmane.emacs.devel Subject: latexenc and `TeX-master' Date: Sun, 22 Jan 2006 08:58:51 +0000 Message-ID: <86169402-381A-4DAD-AF54-72DE99CD1959@gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1137920722 21639 80.91.229.2 (22 Jan 2006 09:05:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 22 Jan 2006 09:05:22 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 22 10:05:20 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F0b9y-0002zJ-59 for ged-emacs-devel@m.gmane.org; Sun, 22 Jan 2006 10:05:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F0bCF-00058n-D6 for ged-emacs-devel@m.gmane.org; Sun, 22 Jan 2006 04:07:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F0b6W-00052j-GO for emacs-devel@gnu.org; Sun, 22 Jan 2006 04:01:45 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F0b6O-0004yZ-S4 for emacs-devel@gnu.org; Sun, 22 Jan 2006 04:01:42 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F0b6O-0004xh-3J for emacs-devel@gnu.org; Sun, 22 Jan 2006 04:01:36 -0500 Original-Received: from [66.249.92.202] (helo=uproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1F0bAv-0006u6-3y for emacs-devel@gnu.org; Sun, 22 Jan 2006 04:06:17 -0500 Original-Received: by uproxy.gmail.com with SMTP id o2so503613uge for ; Sun, 22 Jan 2006 00:58:54 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:mime-version:content-transfer-encoding:message-id:content-type:to:from:subject:date:x-mailer; b=BrjMBcjPexJm1qZZQwdhgjzF6VijJ808yJWzWAk9G1lOIdPyspljUAwjcKAQb8Sndc8lyds0ahYQyEx2qi13YFTcTvYOlx1Fb4Wuu+xJC8I6VOP/KXlhOiFBiybpGx3lgET69sla8PJ75re8YLHeis1XrQQ1ZXtblNOp1xtNYfM= Original-Received: by 10.66.248.7 with SMTP id v7mr1706514ugh; Sun, 22 Jan 2006 00:58:53 -0800 (PST) Original-Received: from ?10.0.0.100? ( [82.41.74.89]) by mx.gmail.com with ESMTP id j1sm1318134ugf.2006.01.22.00.58.53; Sun, 22 Jan 2006 00:58:53 -0800 (PST) Original-To: Emacs-Devel ' X-Mailer: Apple Mail (2.746.2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:49391 Archived-At: 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))