From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: reverting non-existent file Date: Thu, 14 May 2020 21:22:01 +0300 Message-ID: <83o8qq4bsm.fsf@gnu.org> References: <87lfluijfh.fsf@yandex.com> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="33339"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Colin Baxter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu May 14 20:22:50 2020 Return-path: Envelope-to: ged-emacs-devel@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 1jZIVO-0008ad-Bq for ged-emacs-devel@m.gmane-mx.org; Thu, 14 May 2020 20:22:50 +0200 Original-Received: from localhost ([::1]:56534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZIVN-0004Nw-Aj for ged-emacs-devel@m.gmane-mx.org; Thu, 14 May 2020 14:22:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZIUr-0003yh-BX for emacs-devel@gnu.org; Thu, 14 May 2020 14:22:17 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39904) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZIUq-0001ol-Jn; Thu, 14 May 2020 14:22:16 -0400 Original-Received: from [176.228.60.248] (port=2858 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jZIUp-0006q6-UJ; Thu, 14 May 2020 14:22:16 -0400 In-Reply-To: <87lfluijfh.fsf@yandex.com> (message from Colin Baxter on Thu, 14 May 2020 17:13:22 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:250273 Archived-At: > From: Colin Baxter > Date: Thu, 14 May 2020 17:13:22 +0100 > > 1. emacs -Q > 2. C-x C-f some-non-existing-file-name > 3. M-x add-file-local-variable-prop-line > 4. coding > 5. iso-2022-jp > 6. Told to revert file for effect to take place. > 7. M-x revert-buffer > 8. yes > 9. Told cannot revert nonexistent file. > > The same effect occurs with other codings, for example utf-16 - but not > with utf-8-unix. I'm using emacs-28.0.50. I get the error message even if I don't do steps 3 to 6. And that is expected, as a non-existent file cannot be reverted. So what did you find surprising in this behavior? (I'm guessing that your locale uses UTF-8 as its codeset, so the new file's buffer has utf-8 encoding from the get-go, and thus adding the local variable doesn't change the coding-system, and you are not asked to revert the buffer. Which is also expected.) Confused.