unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* latexenc and `TeX-master'
@ 2006-01-22  8:58 David Reitter
  2006-01-22 14:24 ` Arne Jørgensen
  2006-01-22 14:26 ` Arne Jørgensen
  0 siblings, 2 replies; 8+ messages in thread
From: David Reitter @ 2006-01-22  8:58 UTC (permalink / 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))

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-01-23 23:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-22  8:58 latexenc and `TeX-master' David Reitter
2006-01-22 14:24 ` 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

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).