From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 06 09:03:35 2023 Received: (at submit) by debbugs.gnu.org; 6 Feb 2023 14:03:36 +0000 Received: from localhost ([127.0.0.1]:47644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pP25n-0000LL-KC for submit@debbugs.gnu.org; Mon, 06 Feb 2023 09:03:35 -0500 Received: from lists.gnu.org ([209.51.188.17]:46134) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pP25k-0000L6-N5 for submit@debbugs.gnu.org; Mon, 06 Feb 2023 09:03:33 -0500 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 1pP25d-0000oy-Is for bug-gnu-emacs@gnu.org; Mon, 06 Feb 2023 09:03:29 -0500 Received: from snd00003.auone-net.jp ([111.86.247.3] helo=dmta0003.auone-net.jp) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP24T-0000vk-4F for bug-gnu-emacs@gnu.org; Mon, 06 Feb 2023 09:02:15 -0500 Received: from kzhr.d1.dion.ne.jp by dmta0003.auone-net.jp with ESMTP id <20230206140202653.FVRD.44995.kzhr.d1.dion.ne.jp@dmta0003.auone-net.jp>; Mon, 6 Feb 2023 23:02:02 +0900 Date: Mon, 06 Feb 2023 23:02:01 +0900 Message-ID: <86a61qnb8m.wl--xmue@d1.dion.ne.jp> From: Kazuhiro Ito To: bug-gnu-emacs@gnu.org Subject: 30.0.50; Fail to load file with file variables and CRLF EOL without EOL conversion X-Hashcash: 1:20:230205:bug-gnu-emacs@gnu.org::Cts9m1T8F3MqSLq7:B9Tx User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.0.50 (x86_64-w64-mingw32) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Received-SPF: pass client-ip=111.86.247.3; envelope-from=kzhr@d1.dion.ne.jp; helo=dmta0003.auone-net.jp X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) I receive user error in opening a file with file varibles and CRLF EOL when I inhibit EOL conversion. (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 I bumped this issue by calling url-retrieve-synchronously with coding-system-for-read is let-bound to 'binary. On MS-Windows, url package saves cookies into a file with CRLF EOL and fails to load it under such condition. Of course I can fix the caller and have already fixed, but inhibit-eol-conversion is customizable variable and file variables can be set in any text files. So this issue may occur in opening any files, although it should have rarely been a real problem. (I confirmed that the issue had been introduced emacs 22 at the latest.) -- Kazuhiro Ito From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 06 10:17:43 2023 Received: (at 61321) by debbugs.gnu.org; 6 Feb 2023 15:17:43 +0000 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 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 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==; 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 Date: Mon, 06 Feb 2023 17:17:46 +0200 Message-Id: <83zg9qq0v9.fsf@gnu.org> From: Eli Zaretskii To: Kazuhiro Ito In-Reply-To: <86a61qnb8m.wl--xmue@d1.dion.ne.jp> (message from Kazuhiro Ito on Mon, 06 Feb 2023 23:02:01 +0900) Subject: Re: bug#61321: 30.0.50; Fail to load file with file variables and CRLF EOL without EOL conversion References: <86a61qnb8m.wl--xmue@d1.dion.ne.jp> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61321 Cc: 61321@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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) From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 06 11:02:02 2023 Received: (at 61321) by debbugs.gnu.org; 6 Feb 2023 16:02:02 +0000 Received: from localhost ([127.0.0.1]:49661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pP3wP-0004LX-Ut for submit@debbugs.gnu.org; Mon, 06 Feb 2023 11:02:02 -0500 Received: from snd00014.auone-net.jp ([111.86.247.14]:61633 helo=dmta0008.auone-net.jp) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pP3wM-0004L8-HM for 61321@debbugs.gnu.org; Mon, 06 Feb 2023 11:02:01 -0500 Received: from kzhr.d1.dion.ne.jp by dmta0008.auone-net.jp with ESMTP id <20230206160154506.FSEG.23294.kzhr.d1.dion.ne.jp@dmta0008.auone-net.jp>; Tue, 7 Feb 2023 01:01:54 +0900 Date: Tue, 07 Feb 2023 01:01:53 +0900 Message-ID: <868rhan5ou.wl--xmue@d1.dion.ne.jp> From: Kazuhiro Ito To: Eli Zaretskii Subject: Re: bug#61321: 30.0.50; Fail to load file with file variables and CRLF EOL without EOL conversion In-Reply-To: <83zg9qq0v9.fsf@gnu.org> References: <86a61qnb8m.wl--xmue@d1.dion.ne.jp> <83zg9qq0v9.fsf@gnu.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.0.50 (x86_64-w64-mingw32) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61321 Cc: 61321@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > > (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? I confirmed the problem was fixed. Thank you for the quick fix! -- Kazuhiro Ito From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 06 11:30:07 2023 Received: (at 61321-done) by debbugs.gnu.org; 6 Feb 2023 16:30:07 +0000 Received: from localhost ([127.0.0.1]:49695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pP4Na-00058e-QK for submit@debbugs.gnu.org; Mon, 06 Feb 2023 11:30:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43328) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pP4NY-00057c-Uv for 61321-done@debbugs.gnu.org; Mon, 06 Feb 2023 11:30:05 -0500 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 1pP4NT-0000fv-0E; Mon, 06 Feb 2023 11:29:59 -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=iKcb+gm3Hj6o6sQ4xfFuUMTLk6ZQkYWXBIPHd58WMnY=; b=OYHlgUcZKwzT l0jdbYJWTyAX1VyWVlJTKsWoIQFRNhSQefJGSRwWLkEttF2bHJnbZIlnaH9eQMRz0Mf24kYLobXnb MNgZHtBKr9GXoXv1b262QvWKA9pYnhC4YEb1ELTxXx8jksakFgDe5PQzclrqJVwpewCfxo6YXtuxx 3Ej8mk0B+9JhDMwuIzhp5NGFa+1oFt5+UbNp1XlMRll2WAUP6jFwqcgF8jdcchTFuVsksyf6Nk6Bi /xvt/lKqub30zRyn8Pj4dORrPQUGzLZHoQ1rAVDTn9uDO90GzavmLI3HW6ArbuejHc/KncJMTP5jr 2ikzccJzUuQoAleYsUc6Zg==; 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 1pP4NR-0008Gm-UI; Mon, 06 Feb 2023 11:29:58 -0500 Date: Mon, 06 Feb 2023 18:30:10 +0200 Message-Id: <83r0v2pxil.fsf@gnu.org> From: Eli Zaretskii To: Kazuhiro Ito In-Reply-To: <868rhan5ou.wl--xmue@d1.dion.ne.jp> (message from Kazuhiro Ito on Tue, 07 Feb 2023 01:01:53 +0900) Subject: Re: bug#61321: 30.0.50; Fail to load file with file variables and CRLF EOL without EOL conversion References: <86a61qnb8m.wl--xmue@d1.dion.ne.jp> <83zg9qq0v9.fsf@gnu.org> <868rhan5ou.wl--xmue@d1.dion.ne.jp> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61321-done Cc: 61321-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Tue, 07 Feb 2023 01:01:53 +0900 > From: Kazuhiro Ito > Cc: 61321@debbugs.gnu.org > > > > (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? > > I confirmed the problem was fixed. Thank you for the quick fix! Thanks, I've now installed this on the master branch, and I'm therefore closing this bug. From unknown Sun Jun 22 08:09:11 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 07 Mar 2023 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator