From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] Add new keyword :coding for #+include directive Date: Tue, 08 May 2018 19:31:03 +0200 Message-ID: <87o9hqrr54.fsf@nicolasgoaziou.fr> References: <87tvsbx72g.fsf@killashandra.ballybran.fr> <87in8qyh3t.fsf@killashandra.ballybran.fr> <874lkakz58.fsf@nicolasgoaziou.fr> <87muy0b4kw.fsf@killashandra.ballybran.fr> <87in8lh3xk.fsf@killashandra.ballybran.fr> <87zi1uqkta.fsf@nicolasgoaziou.fr> <87in8hd7xe.fsf@killashandra.ballybran.fr> <87zi1sl0yq.fsf@nicolasgoaziou.fr> <874lk01ad6.fsf@killashandra.ballybran.fr> <871serrqla.fsf@killashandra.ballybran.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fG6SF-0007ge-Vl for emacs-orgmode@gnu.org; Tue, 08 May 2018 13:31:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fG6SB-0004tO-Sd for emacs-orgmode@gnu.org; Tue, 08 May 2018 13:31:11 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:39401) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fG6SB-0004sm-LW for emacs-orgmode@gnu.org; Tue, 08 May 2018 13:31:07 -0400 In-Reply-To: <871serrqla.fsf@killashandra.ballybran.fr> ("Pierre =?utf-8?Q?T=C3=A9choueyres=22's?= message of "Sat, 05 May 2018 00:41:37 +0200") 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" To: Pierre =?utf-8?Q?T=C3=A9choueyres?= Cc: org-mode Hello, pierre.techoueyres@free.fr (Pierre T=C3=A9choueyres) writes: > Hello Nicolas, > Did you have time to review the patches ? Sorry for the delay, I have been sidetracked. I admit I don't fully understand your bugfix patch, i.e., "[PATCH] Correctly convert encoding of included files". For the record, here is the change: (with-temp-buffer - (insert-file-contents file) + (let ((org-buffer-coding-system buffer-file-coding-system)) + (insert-file-contents file) + (unless (eq org-buffer-coding-system buffer-file-coding-system) + (set-buffer-file-coding-system org-buffer-coding-system))) You pretend `org-buffer-coding-system' is storing coding-system from the Org buffer, but the let-binding happens from within `with-temp-buffer'. So the coding system comes from the temporary buffer instead.=20 Also, `insert-file-contents' is not supposed to change coding system, or is it? So when would the `unless' be triggered? Could you explain a bit the issue you are fixing here? Thank you. Regards, --=20 Nicolas Goaziou 0x80A93738