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#50946: insert-file-contents can corrupt buffers. [Was: bug#50946: Emacs-28: Inadequate coding in hack-elisp-shorthands] Date: Sun, 03 Oct 2021 18:56:05 +0300 Message-ID: <83bl4685m2.fsf@gnu.org> References: <831r54einq.fsf@gnu.org> <871r54xnds.fsf@gmail.com> <87ee933bcj.fsf@gmail.com> <83pmsnbnci.fsf@gnu.org> <83k0ivbjbu.fsf@gnu.org> <83czonbhex.fsf@gnu.org> <83lf3a8eo7.fsf@gnu.org> <87y27at950.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8420"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50946@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 03 17:58:12 2021 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 1mX3sS-0001v8-46 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 Oct 2021 17:58:12 +0200 Original-Received: from localhost ([::1]:42302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mX3sO-0004yH-Dr for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 Oct 2021 11:58:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mX3rK-0004CQ-GD for bug-gnu-emacs@gnu.org; Sun, 03 Oct 2021 11:57:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51464) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mX3rK-0001i9-8X for bug-gnu-emacs@gnu.org; Sun, 03 Oct 2021 11:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mX3rJ-0003Es-SK for bug-gnu-emacs@gnu.org; Sun, 03 Oct 2021 11:57:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Oct 2021 15:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50946 X-GNU-PR-Package: emacs Original-Received: via spool by 50946-submit@debbugs.gnu.org id=B50946.163327659012407 (code B ref 50946); Sun, 03 Oct 2021 15:57:01 +0000 Original-Received: (at 50946) by debbugs.gnu.org; 3 Oct 2021 15:56:30 +0000 Original-Received: from localhost ([127.0.0.1]:34777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mX3qo-0003E3-9F for submit@debbugs.gnu.org; Sun, 03 Oct 2021 11:56:30 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mX3qj-0003Do-Sm for 50946@debbugs.gnu.org; Sun, 03 Oct 2021 11:56:28 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:51228) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mX3qe-0008Gf-Il; Sun, 03 Oct 2021 11:56:20 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4145 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 1mX3qd-0000D6-Qc; Sun, 03 Oct 2021 11:56:20 -0400 In-Reply-To: <87y27at950.fsf@gmail.com> (message from =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= on Sun, 03 Oct 2021 16:34:19 +0100) 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" Xref: news.gmane.io gmane.emacs.bugs:216271 Archived-At: > From: João Távora > Cc: 50946@debbugs.gnu.org > Date: Sun, 03 Oct 2021 16:34:19 +0100 > > Eli Zaretskii writes: > > > João, why didn't you simply insert > > > > (alist-get 'elisp-shorthands (hack-local-variables--find-variables)) > > > > in load-with-code-conversion, immediately after it calls > > insert-file-contents? Are there any problems with that, and if so, > > what are they? > > There shouldn't be any big problems. As I said, I think that is > cleaner. However, doing it "from the outside" is safer (except for > these insert-file-contents bugs/edge cases, which frankly escape me). > > Your suggestion has a very minor problem, that you're doing this stuff > in lisp/international/mule.el, which slightly icky. Why "icky"? The whole load-with-code-conversion stuff is defined there, so that's a natural place for any things that need to be done during loading, IMO. > A bigger problem is that hack-local-variables--find-variables isn't > defined at that point and the function will then be used to load > lisp/files.el itself (which happens to be where h-l-v--f-v is defined). You are talking about loadup? We can easily condition the call by that function's being fboundp, no? Preloaded files, at least those loaded before file.el, should not use shorthands, so bypassing the call should not produce any problems. Am I missing something? > (BTW this is after the agreed renaming to read-symbol-shorthands, which > I just pushed) OK, thanks.