From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: 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:23:19 +0200 Message-ID: References: <84y3sry47f.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1497651857 3338 195.159.176.226 (16 Jun 2017 22:24:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 16 Jun 2017 22:24:17 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 To: Eli Zaretskii , 27391@debbugs.gnu.org, p.stephani2@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 17 00:24:12 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 1dLzf2-0000ZQ-LI for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Jun 2017 00:24:12 +0200 Original-Received: from localhost ([::1]:60903 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLzf7-0008Fb-5w for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Jun 2017 18:24:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40470) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLzey-0008EM-Tn for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2017 18:24:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLzes-0004mg-7l for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2017 18:24:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49120) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dLzes-0004mS-4G for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2017 18:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dLzer-0007eD-RV for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2017 18:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: 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:24:01 +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.149765181029353 (code B ref 27391); Fri, 16 Jun 2017 22:24:01 +0000 Original-Received: (at 27391) by debbugs.gnu.org; 16 Jun 2017 22:23:30 +0000 Original-Received: from localhost ([127.0.0.1]:51797 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLzeM-0007dM-4D for submit@debbugs.gnu.org; Fri, 16 Jun 2017 18:23:30 -0400 Original-Received: from mail-wr0-f170.google.com ([209.85.128.170]:36568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLzeK-0007d7-JH for 27391@debbugs.gnu.org; Fri, 16 Jun 2017 18:23:28 -0400 Original-Received: by mail-wr0-f170.google.com with SMTP id 36so44750709wry.3 for <27391@debbugs.gnu.org>; Fri, 16 Jun 2017 15:23:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=yl1qsS5V4AUaLC/YMKdaLEPiW2C1PTpnHMIlb9zzxjs=; b=eej7cVsqmNwAjA/p7DidWH21P8iwLRMf+QVtoE5CTt0SfVDX3HOM3X+8hnxPillMkK 6iESz4tSEDOSsEOkVpZ4XOdBqLav7CCyPKCGQCgIR9nsidwzFOMtMai0z2lvGrUSzvQY XFAl7xxPLsSw69B+qO52Ci+SioXsCFfmYDMN1ZmkN+M9rw5a0BPNLToAu6pwsauCyfsg 1w7ZOZ2hEVqJGYNvypgjmWcuXxTo6OJqoYhttzj20Oic5UWMiHYfoZINq3ix4dtlA6Um RxbIE+zNenW1YVb1La/NEXVomvUPPKJId2sISXxU9ujeiJgllWp+vPfTibNpvmQZU5EY E3NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=yl1qsS5V4AUaLC/YMKdaLEPiW2C1PTpnHMIlb9zzxjs=; b=iNpQPTnKTFBkFMKR/ENZat+b6ZE5UB70cT/ECrpQ+NSleXH/QJzYMYhvSzOngy42iv 3fTxaDrrv8xD2zBgLWRDNqJ18NudlNEEY93clgBFsUDeFNSva3B2xYtY7RHGY9pdV71O 3g3iSps+EoYEBYWA36jAIE4PDNdS0tAAWyajwAKCXikTg9oOqmgajkqLavugJofnR3UQ BvTBFSV11oW+RbfkocGTjbSqEZmbp7SOKxXtSFcMWxxhnpxHXaK+2MFkjkBUK/j1Is/c us0Go106PIbCndnOOdYEpwL0WU3jalNenOfbLFAPLnb5m1TJW6qKIfWKGE/csjYIYKJ/ lIbw== X-Gm-Message-State: AKS2vOz4ILBxv8u+nrMkTh1iakFJD+3lF06KJ1DFVHvWEVMUJLg2963H J4N7UFzXXUstQA== X-Received: by 10.223.173.140 with SMTP id w12mr8847735wrc.125.1497651802896; Fri, 16 Jun 2017 15:23:22 -0700 (PDT) Original-Received: from [192.168.1.19] (ARennes-656-1-267-63.w90-32.abo.wanadoo.fr. [90.32.171.63]) by smtp.googlemail.com with ESMTPSA id g203sm5044468wmd.23.2017.06.16.15.23.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Jun 2017 15:23:22 -0700 (PDT) In-Reply-To: <84y3sry47f.fsf@gmail.com> 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:133675 Archived-At: Le 17/06/2017 à 00:09, Vincent Belaïche a écrit : > > Le 16/06/2017 à 21:37, Vincent Belaïche a écrit : >> >> Le 16/06/2017 à 21:15, Vincent Belaïche a écrit : > [...] > >>> >> 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. > > Ooops... my lengthy email of T23:34 was unwantedly sent. A shorter version with only the conclusion and w/o all the details of my investigation is above. Anyway, Philipp's patch is what I had in mind as a quick fix. Although I don't think that this is a good solution not to factorize code when possible. Factorizing makes it more maintainable. V. --- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus