From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#61321: 30.0.50; Fail to load file with file variables and CRLF EOL without EOL conversion Date: Mon, 06 Feb 2023 17:17:46 +0200 Message-ID: <83zg9qq0v9.fsf@gnu.org> References: <86a61qnb8m.wl--xmue@d1.dion.ne.jp> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30269"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61321@debbugs.gnu.org To: Kazuhiro Ito Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 06 16:18:21 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pP3G8-0007fC-LV for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Feb 2023 16:18:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP3Fs-0007Ko-UC; Mon, 06 Feb 2023 10:18:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP3Fq-0007JN-EZ for bug-gnu-emacs@gnu.org; Mon, 06 Feb 2023 10:18:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP3Fq-0002ux-6G for bug-gnu-emacs@gnu.org; Mon, 06 Feb 2023 10:18:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pP3Fp-00032A-Mj for bug-gnu-emacs@gnu.org; Mon, 06 Feb 2023 10:18:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Feb 2023 15:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61321 X-GNU-PR-Package: emacs Original-Received: via spool by 61321-submit@debbugs.gnu.org id=B61321.167569666311632 (code B ref 61321); Mon, 06 Feb 2023 15:18:01 +0000 Original-Received: (at 61321) by debbugs.gnu.org; 6 Feb 2023 15:17:43 +0000 Original-Received: from localhost ([127.0.0.1]:49621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pP3FX-00031Y-Ds for submit@debbugs.gnu.org; Mon, 06 Feb 2023 10:17:43 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40186) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pP3FV-00031H-1w for 61321@debbugs.gnu.org; Mon, 06 Feb 2023 10:17:41 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP3FP-0002qF-8M; Mon, 06 Feb 2023 10:17:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=83ul8Z5/ZgxGMB9DMUdkcQwvZB/hdvi+3G3grPZOFnk=; b=gjieSa086dcr dShGGPlaptNNrNvZ2Ta7G4bLnjLMmruFb77X0f1fgIObUxMa2bkewJS3OU3VORJEsF2XQy30t8+L8 nvr+fLkiBa5C8aSIUhhz32VtPEeW7FrdfxwsseVVDvmmfhIr216OhSljSjhHVysGjL5VVg48+A28g KzkOLZ2H+8Ls6R58efSd5rmpGew9tQTXm7JJBIe3y0QOP5dFLW/iAghP4PG4KFwDAfW+COLXSm02Q 6tiOhn45rLXBMktGl0kCrzJ+Li0oETCGdsWu7BQD1mPqe/hGYSaqP9FJlWyfREbZQOCTgrulMOFTc rIoKmwqz5+Y0HOc9KBU2lw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP3FO-0007mc-OI; Mon, 06 Feb 2023 10:17:35 -0500 In-Reply-To: <86a61qnb8m.wl--xmue@d1.dion.ne.jp> (message from Kazuhiro Ito on Mon, 06 Feb 2023 23:02:01 +0900) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:254966 Archived-At: > Date: Mon, 06 Feb 2023 23:02:01 +0900 > From: Kazuhiro Ito > > (let ((filename (expand-file-name "test.txt" > temporary-file-directory))) > (with-temp-buffer > (setq buffer-file-coding-system 'dos) > (insert "This is a test.\n" > "\n" > "Local Variables:\n" > "comment-column: 0\n" > "End:\n") > (write-file filename)) > (unwind-protect > (let (;; (coding-system-for-read 'unix) > (inhibit-eol-conversion t) > ) > (find-file filename)) > (delete-file filename))) > > -> Local variables entry is missing the suffix Thanks. Does the patch below give good results? diff --git a/lisp/files.el b/lisp/files.el index 9da8244..b0ec6bb 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4017,6 +4017,7 @@ hack-local-variables--find-variables (forward-line 1) (let ((startpos (point)) endpos + (selective-p (eq selective-display t)) (thisbuf (current-buffer))) (save-excursion (unless (let ((case-fold-search t)) @@ -4033,7 +4034,8 @@ hack-local-variables--find-variables (with-temp-buffer (insert-buffer-substring thisbuf startpos endpos) (goto-char (point-min)) - (subst-char-in-region (point) (point-max) ?\^m ?\n) + (if selective-p + (subst-char-in-region (point) (point-max) ?\r ?\n)) (while (not (eobp)) ;; Discard the prefix. (if (looking-at prefix)