From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [Bug] Export Coding System Date: Fri, 22 Feb 2013 17:23:46 +0100 Message-ID: <87ppzsjp0t.fsf@gmail.com> References: <87zjywjxjp.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:53753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8vPq-0001pU-17 for emacs-orgmode@gnu.org; Fri, 22 Feb 2013 11:24:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8vPk-00027d-Sj for emacs-orgmode@gnu.org; Fri, 22 Feb 2013 11:24:05 -0500 Received: from mail-wg0-f49.google.com ([74.125.82.49]:59796) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8vPk-00026k-La for emacs-orgmode@gnu.org; Fri, 22 Feb 2013 11:24:00 -0500 Received: by mail-wg0-f49.google.com with SMTP id 15so646128wgd.28 for ; Fri, 22 Feb 2013 08:23:59 -0800 (PST) In-Reply-To: (Achim Gratz's message of "Fri, 22 Feb 2013 15:06:47 +0000 (UTC)") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Achim Gratz Cc: emacs-orgmode@gnu.org Achim Gratz writes: > Nicolas Goaziou gmail.com> writes: >> IIUC, there is no such thing as a coding system associated to a buffer. >> A coding system only kicks in when doing some I/O operation. > > The coding system should be associated with the file the buffer is visiting, but > a fresh buffer still shows a coding system indicator in the modeline even if it > is not (yet) associated with a file. That coding system always seems to be the > default coding system as provided by the language environment. > >> Anyway, with the same context described above, what's the return value >> for: >> >> (detect-coding-string (org-export-as 'latex) t) > > Depends on what language environment is set to, but with the default setting of > my Emacs (German) it becomes iso-latin-1, independently of what the coding > system in the original Org buffer was. In this case, it should be `utf-8', shouldn't it? > I think that the export buffer coding system should be explicitly set (via > buffer-file-coding-system, which is automatically buffer-local) to copy the > coding of the parent buffer (or the coding specified via export options if > anything like that exists) so that the default choice of the language > environment doesn't kick in. Still trying to understand: is the coding system wrong when you export to a file, to a (temporary) buffer, or both? Note that `org-export-to-file' use `coding-system-for-write', which overrides `buffer-file-coding-system'. So this variable is probably irrelevant here. Regards, -- Nicolas Goaziou