all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Reitter <david.reitter@gmail.com>
Subject: latexenc and `TeX-master'
Date: Sun, 22 Jan 2006 08:58:51 +0000	[thread overview]
Message-ID: <86169402-381A-4DAD-AF54-72DE99CD1959@gmail.com> (raw)

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))

             reply	other threads:[~2006-01-22  8:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-22  8:58 David Reitter [this message]
2006-01-22 14:24 ` latexenc and `TeX-master' Arne Jørgensen
2006-01-22 17:21   ` Arne Jørgensen
2006-01-23  9:54     ` David Reitter
2006-01-23 23:04       ` Arne Jørgensen
2006-01-23 14:31     ` Reiner Steib
2006-01-23 14:53       ` Arne Jørgensen
2006-01-22 14:26 ` Arne Jørgensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86169402-381A-4DAD-AF54-72DE99CD1959@gmail.com \
    --to=david.reitter@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.