]> git.eshelyaron.com Git - emacs.git/commitdiff
Small cal-tex fix.
authorGlenn Morris <rgm@gnu.org>
Tue, 12 Apr 2011 07:03:52 +0000 (00:03 -0700)
committerGlenn Morris <rgm@gnu.org>
Tue, 12 Apr 2011 07:03:52 +0000 (00:03 -0700)
* lisp/calendar/cal-tex.el (cal-tex-end-document):
Try to automatically use latin1 input if needed.

lisp/ChangeLog
lisp/calendar/cal-tex.el

index b1007b146fcb205cbc3a6f4e59338f078fc989de..b5309f2a3ed8635ceac6b2d76589a5ea932a9361 100644 (file)
@@ -1,5 +1,8 @@
 2011-04-12  Glenn Morris  <rgm@gnu.org>
 
+       * 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.
 
index a3f71107854a0add2b1b217145346e5631a07671..2fc215c06c47e96f126a42ac39a0c6214477d8a0 100644 (file)
@@ -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))