From 088d0d61c3529e34c7fae10983d7911d4204124d Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 12 Apr 2011 00:03:52 -0700 Subject: [PATCH] Small cal-tex fix. * lisp/calendar/cal-tex.el (cal-tex-end-document): Try to automatically use latin1 input if needed. --- lisp/ChangeLog | 3 +++ lisp/calendar/cal-tex.el | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b1007b146fc..b5309f2a3ed 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2011-04-12 Glenn Morris + * calendar/cal-tex.el (cal-tex-end-document): + Try to automatically use latin1 input if needed. + * calendar/cal-hebrew.el (diary-hebrew-rosh-hodesh): Don't try to cons a mark onto an empty element. diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index a3f71107854..2fc215c06c4 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -1587,6 +1587,16 @@ FINAL-SEPARATOR is non-nil." Insert the trailer to LaTeX document, pop to LaTeX buffer, add informative header, and run HOOK." (cal-tex-e-document) + (or (and cal-tex-preamble-extra + (string-match "inputenc" cal-tex-preamble-extra)) + (not (re-search-backward "[^[:ascii:]]" nil 'move)) + (progn + (goto-char (point-min)) + (when (search-forward "documentclass" nil t) + (forward-line 1) + ;; Eg for some Bahai holidays. + ;; FIXME latin1 might not always be right. + (insert "\\usepackage[latin1]{inputenc}\n")))) (latex-mode) (pop-to-buffer cal-tex-buffer) (goto-char (point-min)) -- 2.39.2