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 22:51:21 +0300 Message-ID: <83r1d17upy.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> <83bl4685m2.fsf@gnu.org> <837deu84i0.fsf@gnu.org> <87pmsmavj6.fsf@gmail.com> <83y27a6lh8.fsf@gnu.org> <87ilyeaq9f.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="25528"; 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 21:52:11 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 1mX7Wt-0006Le-SD for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 Oct 2021 21:52:11 +0200 Original-Received: from localhost ([::1]:37032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mX7Wq-0000A2-CZ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 Oct 2021 15:52:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mX7Wk-00009a-Bx for bug-gnu-emacs@gnu.org; Sun, 03 Oct 2021 15:52:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51713) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mX7Wk-0005xD-4K for bug-gnu-emacs@gnu.org; Sun, 03 Oct 2021 15:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mX7Wj-00010t-Ul for bug-gnu-emacs@gnu.org; Sun, 03 Oct 2021 15:52: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 19:52: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.16332907053871 (code B ref 50946); Sun, 03 Oct 2021 19:52:01 +0000 Original-Received: (at 50946) by debbugs.gnu.org; 3 Oct 2021 19:51:45 +0000 Original-Received: from localhost ([127.0.0.1]:35026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mX7WS-00010N-LP for submit@debbugs.gnu.org; Sun, 03 Oct 2021 15:51:44 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:38120) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mX7WO-000107-L6 for 50946@debbugs.gnu.org; Sun, 03 Oct 2021 15:51:42 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:55706) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mX7WJ-0004Rm-74; Sun, 03 Oct 2021 15:51:35 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3093 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 1mX7WI-0002I1-KZ; Sun, 03 Oct 2021 15:51:35 -0400 In-Reply-To: <87ilyeaq9f.fsf@gmail.com> (message from =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= on Sun, 03 Oct 2021 19:59:24 +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:216306 Archived-At: > From: João Távora > Cc: 50946@debbugs.gnu.org > Date: Sun, 03 Oct 2021 19:59:24 +0100 > > > Note that previously, the shorthand searching and application was > > effectively turned off until very late into the loadup procedure. But > > now, we enable it as soon as files.el is loaded, which is way > > earlier. Somewhere there is the reason for the problem. > > Yes, I agree, this makes sense. > > > So I think, instead of the fboundp test, introduce a variable, > > say inhibit-shorthands, set it to t at the beginning of loadup, then > > reset to nil after shorthands.el has been loaded. > > At this point, I think that's slightly worse than introducing > hack-read-symbol-shorthands-function... or introducing a hook as I had > before. Not at all: we have several inhibit-foo bits in loadup already, so one more won't make any change. > Given you dislike hooks, the patch with > hack-read-symbol-shorthands-function is below. Looks good? I like it slightly less than my proposal, because it spreads the arrangement over 3 files instead of just 2. But if you want a hook so badly, I won't fight. Just put a comment in mule.el describing how we arrange for this to start being in effect. Thanks.