summaryrefslogtreecommitdiff
path: root/lisp/calendar/cal-tex.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2011-04-12 00:03:52 -0700
committerGlenn Morris <rgm@gnu.org>2011-04-12 00:03:52 -0700
commit088d0d61c3529e34c7fae10983d7911d4204124d (patch)
tree58e24b36898a0509b487e2620e8e302b6d59f9d3 /lisp/calendar/cal-tex.el
parentc0749a51330a59450298108cec49cef04cdb9377 (diff)
downloademacs-088d0d61c3529e34c7fae10983d7911d4204124d.tar.gz
Small cal-tex fix.
* lisp/calendar/cal-tex.el (cal-tex-end-document): Try to automatically use latin1 input if needed.
Diffstat (limited to 'lisp/calendar/cal-tex.el')
-rw-r--r--lisp/calendar/cal-tex.el10
1 files changed, 10 insertions, 0 deletions
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))