From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Exporting non utf8 org documents Date: Tue, 23 Mar 2010 09:06:55 +0100 Message-ID: <21F1399D-6EFE-44DA-8D31-DAB56DC90A11@gmail.com> References: <87my1tcu59.fsf@missioncriticalit.com> <6B5F0F7A-F055-435F-ADE2-846E99649B1D@gmail.com> <87zl4o3ha1.fsf@missioncriticalit.com> <0929970B-35B4-495A-A972-985AF9FF1B91@gmail.com> <87k4t4xws7.fsf@mundaneum.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nu0My-0008Uu-U0 for emacs-orgmode@gnu.org; Tue, 23 Mar 2010 05:25:52 -0400 Received: from [140.186.70.92] (port=59597 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nu0Mx-0008Tu-IU for emacs-orgmode@gnu.org; Tue, 23 Mar 2010 05:25:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nu0Mv-0007MB-Uv for emacs-orgmode@gnu.org; Tue, 23 Mar 2010 05:25:51 -0400 Received: from mail-ew0-f216.google.com ([209.85.219.216]:58685) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nu0Mv-0007M3-Ow for emacs-orgmode@gnu.org; Tue, 23 Mar 2010 05:25:49 -0400 Received: by ewy8 with SMTP id 8so187804ewy.8 for ; Tue, 23 Mar 2010 02:25:48 -0700 (PDT) In-Reply-To: <87k4t4xws7.fsf@mundaneum.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Francesco Pizzolante Cc: mailing-list-org-mode On Mar 22, 2010, at 3:20 PM, Francesco Pizzolante wrote: > Hi Carsten, > > I'm sorry for my very very late reply on this topic, but I'm just > observing > problem with this. > >> you can remove the code I sent you again, and instead grab the >> latest git >> release. >> >> Then you can also do >> >> (setq org-export-latex-inputenc-alist '(("utf8" . "utf8x"))) >> >> to get utf8x instead of utf8. > > I still get the utf8 encoding even if, as you said, I set this: > > --8<---------------cut here---------------start------------->8--- > (setq org-export-latex-inputenc-alist '(("utf8" . "utf8x"))) > --8<---------------cut here---------------end--------------->8--- > > > So, we get the following code: > > --8<---------------cut here---------------start------------->8--- > (defun org-export-latex-fix-inputenc () > "Set the codingsystem in inputenc to what the buffer is." > (let* ((cs buffer-file-coding-system) > (opt (or (ignore-errors (latexenc-coding-system-to-inputenc cs)) > "utf8"))) > (when opt > ;; Translate if that is requested > (setq opt (or (cdr (assoc opt org-export-latex-inputenc-alist)) > opt)) > ;; find the \usepackage statement and replace the option > (goto-char (point-min)) > (while (re-search-forward "\\\\usepackage\\[\\(AUTO\\)\\] > {inputenc}" > nil t) > (goto-char (match-beginning 1)) > (delete-region (match-beginning 1) (match-end 1)) > (insert opt)) > (and buffer-file-name > (save-buffer))))) > --8<---------------cut here---------------end--------------->8--- > > If I print the opt variable (message opt), I can see that its value is > correctly set to utf8x. > > But, the re-search-forward command always fails. In effect, if I > change the > last argument from t to nil, I get the following error: > > --8<---------------cut here---------------start------------->8--- > while: Search failed: "\\\\usepackage\\[\\(AUTO\\)\\]{inputenc}" > --8<---------------cut here---------------end--------------->8--- > > I'm using an almost empty Org buffer with no option at all, so it > generates a > simple article document class. > > I would like to give you more input, but I don't know how to better > debug > this. If you have any idea, please let me know. Hi Francesco, Maybe you have customized org-export-latex-classes? Unfortunately, this will make the changes I make in the default value of the variable disappear. So you need to do one of two things: - remove your customizations of that variable or - edit your value so that in all entries it says \usepackage[AUTO]{inputenc} instead of a fixed [utf8] or whatever you have there. HTH - Carsten > > Thanks a lot, > Francesco - Carsten