From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: vincent.belaiche@gmail.com (Vincent =?UTF-8?Q?Bela=C3=AFche?=) Newsgroups: gmane.emacs.bugs Subject: bug#27391: 25.2.50; utf-8 coding cookie is not applied on some specific markdown file Date: Sat, 17 Jun 2017 00:09:56 +0200 Message-ID: <84y3sry47f.fsf@gmail.com> References: <841sqkdzh5.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1497651074 6702 195.159.176.226 (16 Jun 2017 22:11:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 16 Jun 2017 22:11:14 +0000 (UTC) Cc: Vincent =?UTF-8?Q?Bela=C3=AFche?= To: Eli Zaretskii , 27391@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 17 00:11:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLzSO-0001Sg-N5 for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Jun 2017 00:11:08 +0200 Original-Received: from localhost ([::1]:60869 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLzST-0003NK-Qb for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Jun 2017 18:11:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLzSN-0003N9-P2 for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2017 18:11:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLzSI-0007Rl-RQ for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2017 18:11:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49110) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dLzSI-0007Re-O2 for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2017 18:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dLzSI-0007HQ-I5 for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2017 18:11:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <841sqkdzh5.fsf@gmail.com> Resent-From: vincent.belaiche@gmail.com (Vincent =?UTF-8?Q?Bela=C3=AFche?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Jun 2017 22:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27391 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27391-submit@debbugs.gnu.org id=B27391.149765101427917 (code B ref 27391); Fri, 16 Jun 2017 22:11:02 +0000 Original-Received: (at 27391) by debbugs.gnu.org; 16 Jun 2017 22:10:14 +0000 Original-Received: from localhost ([127.0.0.1]:51787 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLzRW-0007GB-Ik for submit@debbugs.gnu.org; Fri, 16 Jun 2017 18:10:14 -0400 Original-Received: from smtp05.smtpout.orange.fr ([80.12.242.127]:38531 helo=smtp.smtpout.orange.fr) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLzRU-0007Fw-Jj for 27391@debbugs.gnu.org; Fri, 16 Jun 2017 18:10:13 -0400 Original-Received: from AigleRoyal ([90.32.171.63]) by mwinf5d40 with ME id ZaA51v00Q1NRGYS03aA5Bo; Sat, 17 Jun 2017 00:10:06 +0200 X-ME-Helo: AigleRoyal X-ME-Auth: dmluY2VudGJlbGFpY2hlQG9yYW5nZS5mcg== X-ME-Date: Sat, 17 Jun 2017 00:10:06 +0200 X-ME-IP: 90.32.171.63 X-Antivirus: Avast (VPS 170616-2, 16/06/2017), Outbound message X-Antivirus-Status: Clean X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:133674 Archived-At: Le 16/06/2017 =E0 21:37, Vincent Bela=EFche a =E9crit : > > > Le 16/06/2017 =E0 21:15, Vincent Bela=EFche a =E9crit : >> [...] >> >> > After some more investigation, I think that the bug is in function > insert-file-contents of fileio.c which is the one that decide and sets > the coding system well before the other local variables are looked into. = I have located the bug. After some more investigation, in the end the find-auto-coding of mule.el is what is called to detect the coding. This function evaluates this expression to find the local variables: (re-search-forward "[\r\n]\\([^[\r\n]*\\)[ \t]*Local Variables:[ \t]*\\([^\r\n]*\\)[\r= \n]" tail-end t) This expression evaluates to nil over file CONTRIBUTING.md I can make a simple fix if you tell me on which branch to do it. However I think that the root of the problem is poor code factorization of local variable parsing between mule.el and file.el. A better, more futureproof fix would be some unique local variable parser with some input constrain telling what sort of setting are sought. The output of the parse could be used in file.el and mule.el. Vincent. --- L'absence de virus dans ce courrier =E9lectronique a =E9t=E9 v=E9rifi=E9e p= ar le logiciel antivirus Avast. https://www.avast.com/antivirus