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#21695: 25.0.50; Change most occurrences of `setq' in Emacs manual to `customize-set-variable'? Really? Date: Sun, 12 Sep 2021 13:11:52 +0300 Message-ID: <83czpef6hj.fsf@gnu.org> References: <97d3ff2c-9e72-4004-88a9-08130ac99a74@default> <838s0fpixr.fsf@gnu.org> <83k0jtr45c.fsf@gnu.org> <87v93avtoe.fsf@gnus.org> <87r1dyvtav.fsf@gnus.org> <87mtolx6de.fsf@gnus.org> <87ilz9x5c8.fsf@gnus.org> <87y284rb1z.fsf@gnus.org> <0d48a23084a8b0435f37@heytings.org> <83h7eqf9wx.fsf@gnu.org> <0d48a230848de1d1b255@heytings.org> <83ee9uf82a.fsf@gnu.org> <0d48a23084cf7a569554@heytings.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9079"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, hmelman@gmail.com, 21695@debbugs.gnu.org, rms@gnu.org To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 12 12:13:24 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 1mPMUE-0002BY-VJ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Sep 2021 12:13:22 +0200 Original-Received: from localhost ([::1]:57982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPMUC-0007UM-Fd for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Sep 2021 06:13:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50918) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPMTu-0007Ss-K3 for bug-gnu-emacs@gnu.org; Sun, 12 Sep 2021 06:13:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58826) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mPMTu-0005FL-CO for bug-gnu-emacs@gnu.org; Sun, 12 Sep 2021 06:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mPMTu-00083X-3o for bug-gnu-emacs@gnu.org; Sun, 12 Sep 2021 06:13:02 -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, 12 Sep 2021 10:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21695 X-GNU-PR-Package: emacs Original-Received: via spool by 21695-submit@debbugs.gnu.org id=B21695.163144154330916 (code B ref 21695); Sun, 12 Sep 2021 10:13:02 +0000 Original-Received: (at 21695) by debbugs.gnu.org; 12 Sep 2021 10:12:23 +0000 Original-Received: from localhost ([127.0.0.1]:42139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPMTH-00082a-Gw for submit@debbugs.gnu.org; Sun, 12 Sep 2021 06:12:23 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPMTF-00082N-NG for 21695@debbugs.gnu.org; Sun, 12 Sep 2021 06:12:22 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:55210) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPMT9-0004bP-SP; Sun, 12 Sep 2021 06:12:15 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4165 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 1mPMT1-0000xB-10; Sun, 12 Sep 2021 06:12:07 -0400 In-Reply-To: <0d48a23084cf7a569554@heytings.org> (message from Gregory Heytings on Sun, 12 Sep 2021 09:54:51 +0000) 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:214128 Archived-At: > Date: Sun, 12 Sep 2021 09:54:51 +0000 > From: Gregory Heytings > cc: larsi@gnus.org, 21695@debbugs.gnu.org, hmelman@gmail.com, rms@gnu.org > > >>> Also, warnings.el is not preloaded, so this call could barf in some > >>> valid cases. > >> > >> That's not what I see: > >> > >> ;;;###autoload > >> (defun display-warning (type message &optional level buffer-name) > > > > That's autoloaded, not preloaded; the latter is in loadup.el. > > > > Hmm, then I don't see what you mean. I did not know that there is a > difference between "autoload" and "preload". The difference is that while Emacs is being built, especially bootstrapped, calls to Lisp code that isn't preloaded by autoload.el could fail. So such calls need to be careful not to call a symbol if the call could fail, or at least use internal_condition_case* functions to protect themselves against failure. > > Is this multiplicative, i.e. if you perform it many times, does it > > indeed take 20% longer overall? If so, this is not an acceptable > > performance hit, I think, not for such a minor feature. > > > > The "(get sym 'custom-set)" call adds about ~8 nanoseconds to each call to > setq. I don't see how this could be avoided, if the idea is to display a > warning when setq is used when customize-set-variable should be used > instead. Of course every new feature comes at a cost. > > Perhaps a new defcustom could be created, e.g. customize-warn-setq, > defaulting to t, to make it possible to avoid that call to "(get sym > 'custom-set)"? Are we only doing this only for initializations in the init files? Then perhaps this could be enabled only until the startup is completed. Even then, some people will frown on 20% slowdown of the startup. Let's see what others think about this aspect.