From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 26 13:03:12 2022 Received: (at submit) by debbugs.gnu.org; 26 Oct 2022 17:03:12 +0000 Received: from localhost ([127.0.0.1]:55187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1onjo7-0000Kc-PL for submit@debbugs.gnu.org; Wed, 26 Oct 2022 13:03:12 -0400 Received: from lists.gnu.org ([209.51.188.17]:41482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1onjo5-0000KV-Pt for submit@debbugs.gnu.org; Wed, 26 Oct 2022 13:03:10 -0400 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 1onjo5-0005lA-Ki for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2022 13:03:09 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onjnt-0005K0-2l for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2022 13:03:09 -0400 Received: (Authenticated sender: matt@rfc20.org) by mail.gandi.net (Postfix) with ESMTPSA id 78CE0240008 for ; Wed, 26 Oct 2022 17:02:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rfc20.org; s=gm1; t=1666803773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=3tlCShGs9MbQaTLJLP1P3FXGYV55c63fu036sGr0Deo=; b=C5ko9J+dxv7XEeinHpD+BhKfvjfvTnCOj7dF0YBBCRNBaV+QRvbGNFjusrNt+h6+kAoD3Q AJQbe1xb3NoiKY8acKjk2IEp2BxpYe4ei7ybOiNc1z9bcKcNnTPW8cFKgC0ShIz32NLKV0 3okFASsl3/OOmL2nXrZGeYS2RgRXo3dkisKsWJ79Fvy4MEvpz6hoPo4kgQZKo61SH4bvWy KH95F1Fx8X1/dNZ7kC7zEh3b/zfrhXUK6xl2VxteTpgo89LsZ2lUbfq5lnEtUk8BfjLPzi jlJr+6Ox1DLOZy38q6Xu1Q0un1xC/fFuI/GaZdTKA9WB0cWNcxsYEV+rIvmoRw== Received: from matt by naz with local (Exim 4.96) (envelope-from ) id 1onjnm-000W2I-2O for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2022 10:02:50 -0700 From: Matt Armstrong To: bug-gnu-emacs@gnu.org Subject: [PATCH] Autoload the `calc-eval-error' variable Date: Wed, 26 Oct 2022 10:02:50 -0700 Message-ID: <87fsfaa56t.fsf@rfc20.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=217.70.178.230; envelope-from=matt@rfc20.org; helo=relay10.mail.gandi.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) 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.6 (--) --=-=-= Content-Type: text/plain Tags: patch (rationale in the patch) In GNU Emacs 29.0.50 (build 8, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, cairo version 1.16.0) of 2022-10-25 built on naz Repository revision: 9d7ba2b1998afc3664c37d9d1b6f6ca2d68356e9 Repository branch: feature/noverlay System Description: Debian GNU/Linux bookworm/sid Configured using: 'configure 'CFLAGS=-Og -g3' 'CXXFLAGS=-Og -g3' --enable-checking=yes --enable-check-lisp-object-type --with-pgtk' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Autoload-the-calc-eval-error-variable.patch >From 526d0b31e0d836e7a3c21d831849b8c50da2420e Mon Sep 17 00:00:00 2001 From: Matt Armstrong Date: Wed, 26 Oct 2022 09:46:37 -0700 Subject: [PATCH] Autoload the `calc-eval-error' variable * lisp/calc/calc-aent.el: Autoload the `calc-eval-error' variable, because it is documented as a lisp level option of the `calc-eval' function, which is also autoloaded. Otherwise, even (require 'calc) is not enough to get the variable defined; `calc-eval' must actually be evaluated. This squashes byte compiler warnings in code using the variable. --- lisp/calc/calc-aent.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index ef3e0d4b67..59692beff7 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el @@ -252,6 +252,7 @@ calc-do-calc-eval res (cdr res))) buf))))))))) +;;;###autoload (defvar calc-eval-error nil "Determines how calc handles errors. If nil, return a list containing the character position of error. -- 2.35.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 08:16:51 2022 Received: (at 58801) by debbugs.gnu.org; 11 Nov 2022 13:16:51 +0000 Received: from localhost ([127.0.0.1]:45302 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otTtq-0002WB-Se for submit@debbugs.gnu.org; Fri, 11 Nov 2022 08:16:51 -0500 Received: from mail-oa1-f45.google.com ([209.85.160.45]:41787) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otTto-0002Vg-RW for 58801@debbugs.gnu.org; Fri, 11 Nov 2022 08:16:49 -0500 Received: by mail-oa1-f45.google.com with SMTP id 586e51a60fabf-13b23e29e36so5369636fac.8 for <58801@debbugs.gnu.org>; Fri, 11 Nov 2022 05:16:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=qviCXnq+jMJeOPxhrcj7ftYOY+07NKZJ3sTa6ZqqMFY=; b=qetdZPGgGiMVxw9XW/9CSiwLZ+zELHoxEP7TWZ6JCbNmV9R7WyU/kG8KJz/TcNT+ii xRSp7aE1KeRg05dk7SylVnLWf0MyuzNZC7md2qwLLknNGEAWbM9oCfj3pfAel9SyZAfD Pe4HeiSknNNV485Ts3+gHhcsvjJP/aKHzbNoWWGTJ59+CmUzAxX9s055oPD5eWcJ+5vN VwbL7++fLoyXQy6Lk7udXvgPWILt2cvRJ17nnVjJNNmgJZA2cSuX6udWWvA9VPf2Zj7w MG/5GFshCVItEc++hJDsze1LM0UdYbGBDXKvZT4/OqBMUZrb+lDpJCa5khP21BGGH2lU vcww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qviCXnq+jMJeOPxhrcj7ftYOY+07NKZJ3sTa6ZqqMFY=; b=ontteArNiuIGesTaEnNOwMgUFwbQh6zB0SO8igLwxMHvfb4jSfQtP4ps4WZ1SghELV PUzya8meHpZmpfwoo402cygjYB/tMdS2nYMU6v92qImGvNMt0TPyAP5j2UvnF5E3os6D F9i2w/IgxgrQa8KsjcR53+2TEE7GJVMqDQrhh9X/s8op3tFWwoMovEb7NqCZ7CiJhUGy S4nzm0DF2QwKaVZdkNW3hlVkB2Pr1BeJTW4V5zaccGERSiKvom6jL77lGIGMUxkAh7ZM XpiXD0fVY59Vg2OXwlxbrIRx1cfktkehHM24i2Qxn24yOcxOHtCkiU/1F/gR/ydIgNuh cUhw== X-Gm-Message-State: ANoB5plKsnBUnxdW1kSE4/jbiBJ7VCfTakvoi1d7QyIEiUuJYIkhDhQX 0odJl70OszqqWCa1F5ExbcGj2Ay2h052VqVZslbqivnf X-Google-Smtp-Source: AA0mqf4KbrCy0jTnOfvjumApQlpHcAosxOq+JJLGpDmV6K/nr71C3RifTDuo/8ENXebeITNdZaLh5Tmz/bhqfinf64Y= X-Received: by 2002:a05:6871:480a:b0:12b:fbe7:b793 with SMTP id qc10-20020a056871480a00b0012bfbe7b793mr797385oab.92.1668172603258; Fri, 11 Nov 2022 05:16:43 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 11 Nov 2022 05:16:42 -0800 From: Stefan Kangas In-Reply-To: <87fsfaa56t.fsf@rfc20.org> (Matt Armstrong's message of "Wed, 26 Oct 2022 10:02:50 -0700") References: <87fsfaa56t.fsf@rfc20.org> X-Hashcash: 1:20:221111:58801@debbugs.gnu.org::1g+giFQ+1SkwQ5T0:7Jew MIME-Version: 1.0 Date: Fri, 11 Nov 2022 05:16:42 -0800 Message-ID: Subject: Re: bug#58801: [PATCH] Autoload the `calc-eval-error' variable To: Matt Armstrong Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58801 Cc: 58801@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 (-) Matt Armstrong writes: > From 526d0b31e0d836e7a3c21d831849b8c50da2420e Mon Sep 17 00:00:00 2001 > From: Matt Armstrong > Date: Wed, 26 Oct 2022 09:46:37 -0700 > Subject: [PATCH] Autoload the `calc-eval-error' variable > > * lisp/calc/calc-aent.el: Autoload the `calc-eval-error' variable, > because it is documented as a lisp level option of the `calc-eval' > function, which is also autoloaded. Otherwise, even (require 'calc) > is not enough to get the variable defined; `calc-eval' must actually > be evaluated. This squashes byte compiler warnings in code using the > variable. I don't necessarily object strongly or anything, but should we really autoload a variable just to squash byte compiler warnings? I think the usual way to do that is to say (defvar calc-eval-error) in the calling code. > --- > lisp/calc/calc-aent.el | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el > index ef3e0d4b67..59692beff7 100644 > --- a/lisp/calc/calc-aent.el > +++ b/lisp/calc/calc-aent.el > @@ -252,6 +252,7 @@ calc-do-calc-eval > res (cdr res))) > buf))))))))) > > +;;;###autoload > (defvar calc-eval-error nil > "Determines how calc handles errors. > If nil, return a list containing the character position of error. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 08:16:43 2022 Received: (at control) by debbugs.gnu.org; 11 Nov 2022 13:16:43 +0000 Received: from localhost ([127.0.0.1]:45296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otTtj-0002Ve-CL for submit@debbugs.gnu.org; Fri, 11 Nov 2022 08:16:43 -0500 Received: from mail-oa1-f48.google.com ([209.85.160.48]:37740) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otTti-0002VR-Bk for control@debbugs.gnu.org; Fri, 11 Nov 2022 08:16:42 -0500 Received: by mail-oa1-f48.google.com with SMTP id 586e51a60fabf-12c8312131fso5384639fac.4 for ; Fri, 11 Nov 2022 05:16:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=KtsIYLMgd8jLqEwPretvZ/wu3fL9YEaplvjF5GCujY8=; b=HHcbpDVHI5SQ//GMXsxuJMdyVuMDpnygF4btY8motZKLe5YXB2O4InkVrENwTLhqmD nvSQxJYRtRtC2fZH3NkHkUtngyGEfgbAil1hdnfLUKV1f3B5QgZaLyGMUkpPU1G/AfaF aIQZQwgSmr1DIbl/G5NmGuui6l7lISUQMHcmh/vH/a0CfXu9Ak7QpuNJR9NAPAIJDS1i agsbxuyBL3bZGasoMgFnqwo3Rjc1s7fnQUFyd71MXPdJ43c6VuMi8Odaeo89CHB6Lxgt ingsAM4Dgo4Q/pepJ0zAwP++DSZ14EQTgUBdjRvOXTJ9vX7t0nBpOq/cTsn5PAcGUOjk I1Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=KtsIYLMgd8jLqEwPretvZ/wu3fL9YEaplvjF5GCujY8=; b=tbjQjBAUnhXMsL3vytvOQzIj7Nye1DC2UBkA0Kri1AhqGMDVAd0GpHjoCtXsfktbog ko2/anig/zRyRD7WiMsRK471vL+00R+fC3ZyMgfgg0qRAJeiez+qQnojfagPUuZHbuVZ BHBErpEi67KsnLG1BNIDNJAjhPbnNXaFt1S1dF5kH5wM6jJcADU+zIJ06pUjJigny8NW uOYdUPWru4P3MzLYcCJ08Te9F9mtfo7IPX1DwG6+IUdQ1LgxR8wtbNvPHiYGMK1mvG0z w0HxJktH0viSm91WML7sgHdQ1YLxztPpRZ8DuGlEAkTl3LAVUe2nNvZbc9qIOV4oOKUw Onyw== X-Gm-Message-State: ANoB5pktffD6ZtIUoD7LoGo5p7PvfNWljhdgiS5uv8O1YH5ltagPmvnE 84zpbT2JvKAeO7PPQ3rvapOc6bLNh2GdF8B6yTUpg72s X-Google-Smtp-Source: AA0mqf6Wu0IbSCdJBx0pPeiRXwH0f/176RWhaTotm4lN4cM/vnuuXYuGO1/0MAdxydKuxYraLWGr0aYIqKM7LxpOCvY= X-Received: by 2002:a05:6871:480a:b0:12b:fbe7:b793 with SMTP id qc10-20020a056871480a00b0012bfbe7b793mr797061oab.92.1668172596574; Fri, 11 Nov 2022 05:16:36 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 11 Nov 2022 05:16:36 -0800 From: Stefan Kangas X-Hashcash: 1:20:221111:control@debbugs.gnu.org::itUUOH5O84yclb6N:13qW MIME-Version: 1.0 Date: Fri, 11 Nov 2022 05:16:36 -0800 Message-ID: Subject: control message for bug #58801 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control 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 (-) severity 58801 wishlist quit From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 15 13:24:13 2022 Received: (at 58801) by debbugs.gnu.org; 15 Nov 2022 18:24:13 +0000 Received: from localhost ([127.0.0.1]:55211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ov0bU-0004HU-OI for submit@debbugs.gnu.org; Tue, 15 Nov 2022 13:24:13 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:42167) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ov0bS-0004HF-Cj for 58801@debbugs.gnu.org; Tue, 15 Nov 2022 13:24:11 -0500 Received: (Authenticated sender: matt@rfc20.org) by mail.gandi.net (Postfix) with ESMTPSA id 96EE5FF80B; Tue, 15 Nov 2022 18:24:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rfc20.org; s=gm1; t=1668536644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jw6mFbpHn5fsEYv6MXT7ex5TMCZw3UAEyw+hgKlP0wg=; b=TMZ7W2b/So6bn+Ww43bSX5G+YinrP5ZTXn2ObbtzTZFfeANkoR07/Pa/yKfPsWS+i/RIwq o44KQAGcubLvrafOqdYzWpvJA7P8jSfsOyiptJ4MVtkhQFJrHO88/96iZgE8CdQShrPbdl kdsdBC/WwwoLo6ssvSua49GGAjDTJIaYdWS5f0XDJlhDZLrTiV8pzDiz57+a5Z83SDkHlW //6GEZHANkm/W/0aUyDwo4PRLp7q7QltlPtjex1g0mr/TS8zVnT9iauTvOL+DwSnicEPKo MBGb8VPuPYNwp/DMihgbrl/SkDhP31gIx20uSisD08ujnsPH7T64lOuwpF12Ag== Received: from matt by naz with local (Exim 4.96) (envelope-from ) id 1ov0bI-000QVZ-14; Tue, 15 Nov 2022 10:24:00 -0800 From: Matt Armstrong To: Stefan Kangas Subject: Re: bug#58801: [PATCH] Autoload the `calc-eval-error' variable In-Reply-To: References: <87fsfaa56t.fsf@rfc20.org> Date: Tue, 15 Nov 2022 10:24:00 -0800 Message-ID: <8735ak6pq7.fsf@rfc20.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 58801 Cc: 58801@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.7 (-) Stefan Kangas writes: > Matt Armstrong writes: > >> From 526d0b31e0d836e7a3c21d831849b8c50da2420e Mon Sep 17 00:00:00 2001 >> From: Matt Armstrong >> Date: Wed, 26 Oct 2022 09:46:37 -0700 >> Subject: [PATCH] Autoload the `calc-eval-error' variable >> >> * lisp/calc/calc-aent.el: Autoload the `calc-eval-error' variable, >> because it is documented as a lisp level option of the `calc-eval' >> function, which is also autoloaded. Otherwise, even (require 'calc) >> is not enough to get the variable defined; `calc-eval' must actually >> be evaluated. This squashes byte compiler warnings in code using the >> variable. > > I don't necessarily object strongly or anything, but should we really > autoload a variable just to squash byte compiler warnings? Perhaps I can learn something here. Why refrain from autoloading the variable in this situation? Note that in my case I had (require 'calc) in the file that used the `calc-eval-error' symbol. The info docs for calc state that (require 'calc) loads nearly everything you need from calc. I may not understand something about the design constraints here, but it seems strange to refrain from autoloading this symbol, since (require 'calc) already (auto)loads a *lot* of stuff. > I think the usual way to do that is to say > > (defvar calc-eval-error) > > in the calling code. I think "in the calling code" applies to specific situations. For example: - A defvar for something x- in package x. - Symbols provided by packages that are conditionally loaded, so the current package can not rely on (require 'x) to providing `x-' symbols at bytcomp time. - Situations where the package has inadequate/incorrect autoloads, so (require 'x) doesn't provide enough. I.e. to work around bugs. ;-) My first impression is that adding `defvar' to squash bytecomp warnings for symbols in other packages is the wrong default action, and that the best idea is for (require 'foo) to provide all symbols 'foo-' that one might need when using the `foo' package in the normal way. Notice that (info "(elisp) Converting to Lexical Binding") has this phrasing: > A warning about a reference or an assignment to a free variable is > usually a clear sign that that variable should be marked as > dynamically scoped, so you need to add an appropriate =E2=80=98defvar=E2= =80=99 before > the first use of that variable. It doesn't state what an "appropriate 'defvar'" is. Certainly, if the var is part of the current package, adding a 'defvar' in the same file makes sense. If the var is part of some other package, properly required by the current package, I think that other package is missing an autoload. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 15 13:42:06 2022 Received: (at 58801) by debbugs.gnu.org; 15 Nov 2022 18:42:06 +0000 Received: from localhost ([127.0.0.1]:55232 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ov0so-0004jF-IW for submit@debbugs.gnu.org; Tue, 15 Nov 2022 13:42:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35474) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ov0sj-0004ii-Ug for 58801@debbugs.gnu.org; Tue, 15 Nov 2022 13:42: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 1ov0sd-0006yz-Il; Tue, 15 Nov 2022 13:41:56 -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=npqz69DNH8D43MqDUTo9hdmNisu0sBIi8nqumqlGu8c=; b=mXpWRdOd19En 9GYiOM9X2aFprftI20GDBjstJlkyLDH+U6byKQwN4esLXWnkAEemBmDknXpjPvBNlI/lU1jSeNZp9 f7onqcbnta/+DzewpliRpGHpLXa3+J4nQkoXvsJqqq/kHVZ6hfvS6h+cVRwBeEDGufuT2QzrT5bSy AGAqEuNG09ObzPMiWqNUUtR0tk6/ZIAL93Svc9s++xn3zQLPdPedy1b5i9uPTx7kOy6G3c6VclAKR LEwGaMaMvT1FDOD25cOBXb13FV+VkmPuGz7MTRyoOrjKkYUqFd8nJ/KtliLXnAtqU10t4VNpvt9i0 b6sjwwndh4dduqOFK3FgDw==; 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 1ov0sc-00089S-Ai; Tue, 15 Nov 2022 13:41:55 -0500 Date: Tue, 15 Nov 2022 20:42:08 +0200 Message-Id: <83wn7wgiv3.fsf@gnu.org> From: Eli Zaretskii To: Matt Armstrong In-Reply-To: <8735ak6pq7.fsf@rfc20.org> (message from Matt Armstrong on Tue, 15 Nov 2022 10:24:00 -0800) Subject: Re: bug#58801: [PATCH] Autoload the `calc-eval-error' variable References: <87fsfaa56t.fsf@rfc20.org> <8735ak6pq7.fsf@rfc20.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58801 Cc: 58801@debbugs.gnu.org, stefankangas@gmail.com 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 (---) > Cc: 58801@debbugs.gnu.org > From: Matt Armstrong > Date: Tue, 15 Nov 2022 10:24:00 -0800 > > My first impression is that adding `defvar' to squash bytecomp warnings > for symbols in other packages is the wrong default action No, it's the standard solution for byte-compilation warnings. There are a few others, all of them better than an actual require. > and that the best idea is for > > (require 'foo) > > to provide all symbols 'foo-' that one might need when using the `foo' > package in the normal way. That actually loads the package foo, for no good reason. We don't necessarily want to use foo, we just want to compile a reference to its variable or function. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 24 14:56:47 2022 Received: (at 58801) by debbugs.gnu.org; 24 Nov 2022 19:56:47 +0000 Received: from localhost ([127.0.0.1]:60313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyIL1-0003ih-57 for submit@debbugs.gnu.org; Thu, 24 Nov 2022 14:56:47 -0500 Received: from mail-oa1-f47.google.com ([209.85.160.47]:42735) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyIKy-0003iU-Sw for 58801@debbugs.gnu.org; Thu, 24 Nov 2022 14:56:45 -0500 Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-142b72a728fso2939774fac.9 for <58801@debbugs.gnu.org>; Thu, 24 Nov 2022 11:56:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=Zz2Dm4ZFLq6h/CN6i/E4a2fmdjSo4ltw8q9bAOyPITQ=; b=KtK1ULSGwF7Zkxi/WUq22CpdrnLTZZ5orHgFOllQ9OnNd/Q9KZlJHSX8i45C1GN8+5 uhKizXNmnhr5XDHi8y1m8gfH27IUUHoTjPyWrid/M5SyXs2aiAHWum0i+Ax0lCE7TsvF C0QIY2fLaDUD7BbxoNoMRlj6ca6PC9sJmDsAn7D3BSC+pyySMGHB81UpAfrYXY/wztDg /t6/6PnSzt7oLdbPywid6dFDnXWx+RNZwq5v+cTCFsYv1cbN16DdYT6xjo6KmB6KbSEV e6zYkWeW1oUxn1WXvNpVF0kUHShYy5ToJDuVgIBvnWO0SLW+bc3V6qFAXcIa9YYmtk0n WmPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Zz2Dm4ZFLq6h/CN6i/E4a2fmdjSo4ltw8q9bAOyPITQ=; b=WpLFtitWcra3ezxAPEXnqRsgv/KPrRTUW7kBuMHRjJ4ejtPZ+Uvkf/dSJMbxZURDnt 153ZINagPp6UbppL9YuZsl0TaSvzpi7F25GOj9CYQZuZXeOuhkFJiHAxskIE00KADPZH m7gKesuyYFfpHkSF0njoEECq4ipO+HjLqJiO9MhGVAp4etswsVNfkPgiy/nX9D+65Y8M IlbCSRfiqTPx0jmkqDrvRIRckzfEC7fp6fXrkfliJNixRDuf4giypD5xOymsYicb22OO B5xogzbc55qYwK2gKbb2+N5Z7pLvsZ6vbAl4J11fCcrYv9Vg/EdEze2HQfWtcFCqTHGz N8kQ== X-Gm-Message-State: ANoB5plJjDWf5khztQtKjpL20FP3cvyaO+Vv5EqlCfiyL9a1eKzOqkAY Zr5LbRlQU/qqbv/lNppwnfBKCsAYVZLRnB5lnETN04h9 X-Google-Smtp-Source: AA0mqf54mSCqiEWGO6/joIyGyrnQUe1sPUSYN8k0ZY+Ymzz/qbI4LeTjrKakVwvj/twke6H9aDgLq+OoyPy9SFSW9jI= X-Received: by 2002:a05:6870:cc89:b0:12b:fbe7:b793 with SMTP id ot9-20020a056870cc8900b0012bfbe7b793mr21416428oab.92.1669319457148; Thu, 24 Nov 2022 11:50:57 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 24 Nov 2022 11:50:56 -0800 From: Stefan Kangas In-Reply-To: <8735ak6pq7.fsf@rfc20.org> (Matt Armstrong's message of "Tue, 15 Nov 2022 10:24:00 -0800") References: <87fsfaa56t.fsf@rfc20.org> <8735ak6pq7.fsf@rfc20.org> X-Hashcash: 1:20:221124:58801@debbugs.gnu.org::iVRj35ybKgmzBmor:3TJg MIME-Version: 1.0 Date: Thu, 24 Nov 2022 11:50:56 -0800 Message-ID: Subject: Re: bug#58801: [PATCH] Autoload the `calc-eval-error' variable To: Matt Armstrong Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58801 Cc: 58801@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 (-) Matt Armstrong writes: > Note that in my case I had (require 'calc) in the file that used the > `calc-eval-error' symbol. The info docs for calc state that (require > 'calc) loads nearly everything you need from calc. I may not understand > something about the design constraints here, but it seems strange to > refrain from autoloading this symbol, since (require 'calc) already > (auto)loads a *lot* of stuff. So you are saying that if you have a file foo.el, that requires calc, and then tries to use calc-eval-error variable (documented as part of the external API), you get a byte-compiler warning? I agree that this doesn't sound very intuitive. > My first impression is that adding `defvar' to squash bytecomp warnings > for symbols in other packages is the wrong default action, and that the > best idea is for > > (require 'foo) > > to provide all symbols 'foo-' that one might need when using the `foo' > package in the normal way. So I think we could install your patch. From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 26 11:59:08 2022 Received: (at 58801) by debbugs.gnu.org; 26 Nov 2022 16:59:08 +0000 Received: from localhost ([127.0.0.1]:41319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyyWB-0002fm-Pl for submit@debbugs.gnu.org; Sat, 26 Nov 2022 11:59:08 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:52745) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyyW9-0002fP-AL for 58801@debbugs.gnu.org; Sat, 26 Nov 2022 11:59:06 -0500 Received: (Authenticated sender: matt@rfc20.org) by mail.gandi.net (Postfix) with ESMTPSA id 7A42F60003; Sat, 26 Nov 2022 16:58:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rfc20.org; s=gm1; t=1669481938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qe0Mkxr2SbtbwGCGkY4CMKl4C12X2OaEUEQL761fSsU=; b=CJmtjFR3ala00u0qy+EmEMPgmyNcg89L++u6rAu2o3GGy5FWfr8Zz2fO62CBweViNW2l41 AVcdyFrrSyQurS69m1wncuSiOsrN9E1QbNMl5nboecsDHgM9XMbnIVW/yJ7kuqjh7YGxwf 6S69zlnY32eIPgE4n5atdNy9nCbdgwtpozOnUhcL8NAEcwTwvvLux/90a0EDGMqInNfWym u7rRvvWPk3ygkdOVpqOzFqwAUEAYfOurywIZ0hgRFtpDkIFYV1d1wUPSO+VfEGY5NInEJX 1KSNzqct68oM4fIhYyxcggpJNWaHOeVwON/p4otdteuSrolekbWTmMDebeNinQ== Received: by mac-mini.lan (Postfix) with ESMTPS id 4005B3BCC6; Sat, 26 Nov 2022 08:58:54 -0800 (PST) Received: by naz.lan (Postfix, from userid 1000) id 15B0043CAC30; Sat, 26 Nov 2022 08:58:54 -0800 (PST) From: Matt Armstrong To: Stefan Kangas Subject: Re: bug#58801: [PATCH] Autoload the `calc-eval-error' variable In-Reply-To: References: <87fsfaa56t.fsf@rfc20.org> <8735ak6pq7.fsf@rfc20.org> Date: Sat, 26 Nov 2022 08:58:53 -0800 Message-ID: <87o7std54i.fsf@rfc20.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 58801 Cc: 58801@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.7 (-) Stefan Kangas writes: > Matt Armstrong writes: > >> Note that in my case I had (require 'calc) in the file that used the >> `calc-eval-error' symbol. The info docs for calc state that (require >> 'calc) loads nearly everything you need from calc. I may not understand >> something about the design constraints here, but it seems strange to >> refrain from autoloading this symbol, since (require 'calc) already >> (auto)loads a *lot* of stuff. > > So you are saying that if you have a file foo.el, that requires calc, > and then tries to use calc-eval-error variable (documented as part of > the external API), you get a byte-compiler warning? > > I agree that this doesn't sound very intuitive. I regret typing about `require' at all, as my line of argument is simpler than that. Running "emacs -Q" comes with `calc-eval' autoloaded. Since calc documentation mentions `calc-eval-error' as a configuration variable for the `calc-eval' behavior, it is makes most sense to autoload either neither of them or both of them. (In the particular case of the Calc package, dozens of functions and variables are already autoloaded. The omission of `calc-eval-error' also seems more an oversight than intentional.) > So I think we could install your patch. Me too. ;-) From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 07 03:52:12 2023 Received: (at 58801) by debbugs.gnu.org; 7 Sep 2023 07:52:12 +0000 Received: from localhost ([127.0.0.1]:38443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qe9oB-00079q-5b for submit@debbugs.gnu.org; Thu, 07 Sep 2023 03:52:12 -0400 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]:46289) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qe9o5-00079I-Pc for 58801@debbugs.gnu.org; Thu, 07 Sep 2023 03:52:09 -0400 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-5007c8308c3so1041925e87.0 for <58801@debbugs.gnu.org>; Thu, 07 Sep 2023 00:52:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694073118; x=1694677918; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=Wo8fpwsrvwtwH6GXh4OAAwlZEcwqlzyJjyxbo6ce5zo=; b=YwSaoTUbmdAGACTNKgO6eEiPithfmQl6lwr5FJZbAKFTr1dvHZa9bUaa5xMpoOG29f 1FafUyex1fKrs3JbeNGLgNYvpl1fDSGt4IUAnrQHOfkfHL+EWIryHT5zFzB457QxYznv 5jBOafyXQJNbZB6KyiyfgK/CgfoxTJ7Od9UyFHNqHmBRhrkg+7XG8kRh0DOp0irbrXJQ 2lIJtt3RwZhqqLOCyt4MwNFZEZ+wj0WQfAPW8NUhFSYhsyH5urNZtOGzFhmgg9OoD4WP KdlR+htBG50ZlefNRdYk3OXhfXULWUG0Tu5XlpQiDmabaE2/eiqQC1BiuEuST6DxwrpT HQfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694073118; x=1694677918; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Wo8fpwsrvwtwH6GXh4OAAwlZEcwqlzyJjyxbo6ce5zo=; b=QMFbeqhnbqfHhBDssiq3sfhIBVzyOd/h+MgCJA0fg4UzBCxMzIK//+uazqRoJANtQO a2wPwf8yWS6EJAyR2L/1b+V+QiAEw5bBtvXfU9P2MNT2INLj71DHHBbO5ezNWE6bqz6P E2IUP/MvnBa0uTl8uLJizDsW2E5g1+Mu18vrSi9grVfdBL1Vbhp5sxwvT2SksusTm/40 pR9jUW2NC9BNjdFfzIulUI2jHPNGM9ixR0A1ixJWzp6wTLa5xoS2rOhpJkcU2hCdGcL9 Al0xexzSi3NNEwd6Y0FlOL23O6yzyxRSnwccoKL672snBRzKnPFaQG4Db8LO4T+Mw4Iw bq7A== X-Gm-Message-State: AOJu0YwGlmtSJwIXb3beXWLzn3tXJfD9SxYFc+PFdDPVPbx/C08J5ca6 Mf0Yd7R+5PeaHwLVyNSHPqIZQncPXN4+pW6NPVAom0yWVw0= X-Google-Smtp-Source: AGHT+IEJhKvsWVzQ/IoUYeu4bZQEyBWERFbLm3jtuuvdjc6eENDh8cUfets76DpbdBopOSaATy6bWB6wUC6a45KzpBM= X-Received: by 2002:a19:6404:0:b0:4f8:5635:2cd8 with SMTP id y4-20020a196404000000b004f856352cd8mr4046829lfb.32.1694073117796; Thu, 07 Sep 2023 00:51:57 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 7 Sep 2023 00:51:57 -0700 From: Stefan Kangas In-Reply-To: <87o7std54i.fsf@rfc20.org> (Matt Armstrong's message of "Sat, 26 Nov 2022 08:58:53 -0800") References: <87fsfaa56t.fsf@rfc20.org> <8735ak6pq7.fsf@rfc20.org> <87o7std54i.fsf@rfc20.org> MIME-Version: 1.0 Date: Thu, 7 Sep 2023 00:51:57 -0700 Message-ID: Subject: Re: bug#58801: [PATCH] Autoload the `calc-eval-error' variable To: Matt Armstrong Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58801 Cc: 58801@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 (-) Matt Armstrong writes: > Stefan Kangas writes: > >> Matt Armstrong writes: >> >>> Note that in my case I had (require 'calc) in the file that used the >>> `calc-eval-error' symbol. The info docs for calc state that (require >>> 'calc) loads nearly everything you need from calc. I may not understand >>> something about the design constraints here, but it seems strange to >>> refrain from autoloading this symbol, since (require 'calc) already >>> (auto)loads a *lot* of stuff. >> >> So you are saying that if you have a file foo.el, that requires calc, >> and then tries to use calc-eval-error variable (documented as part of >> the external API), you get a byte-compiler warning? >> >> I agree that this doesn't sound very intuitive. > > I regret typing about `require' at all, as my line of argument is > simpler than that. > > Running "emacs -Q" comes with `calc-eval' autoloaded. Since calc > documentation mentions `calc-eval-error' as a configuration variable for > the `calc-eval' behavior, it is makes most sense to autoload either > neither of them or both of them. Thanks, now I understand the situation better. We typically avoid autoloading variables, and I'm not sure it's justified here. See (info "(elisp) When to Autoload") for details. Could we instead just declare it in calc.el? I believe that should silence any warnings from the byte-compiler. It's a one line change: (defvar calc-eval-error) Or will that not work in your use case for some reason? > (In the particular case of the Calc package, dozens of functions and > variables are already autoloaded. The omission of `calc-eval-error' > also seems more an oversight than intentional.) FWIW, I couldn't find any autoloaded variables in calc-loaddefs.el. What am I missing? From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 05 11:39:08 2023 Received: (at 58801-done) by debbugs.gnu.org; 5 Nov 2023 16:39:08 +0000 Received: from localhost ([127.0.0.1]:38090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzg9T-00007N-Ks for submit@debbugs.gnu.org; Sun, 05 Nov 2023 11:39:07 -0500 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]:55780) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzg9R-00006l-Hf for 58801-done@debbugs.gnu.org; Sun, 05 Nov 2023 11:39:06 -0500 Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2c501bd6ff1so52195151fa.3 for <58801-done@debbugs.gnu.org>; Sun, 05 Nov 2023 08:38:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699202302; x=1699807102; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=w0YWn4Wu8t/tdGSMrIedTNPDrI+lZ+zejMv3oNkuHfg=; b=NNvVPSHwxjBuQix0Sh3vHDNXw7La67wt4tyKKpD+YL4GNY9+8jMI3VgWH8t+5JChcj Of8CUbpIljZoUDsvavmtV0d9z6a5jRyaCFqiW/mLQ3Cisnkscovn6UG6rrZUv3cvu0zI fs7VcbpNhuEsFYwDsVbL+WLq+DSksoWq6wz1JKDaZXvggfXnGyVZOBlV973GpJC5NYuG V+N8rqcTw1PDZVWq3wQ69ECww2bB+tpZR3MY3Pc8782flYJ0qL/8UaxhHZ/7fkR5oeQt Hphj5ROMfnB4Fg9yN+ehHMrO4ZetCdE+KmOtUqmGm7JT5rJO1sj5f4YH6qJiuFRyPojy oqcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699202302; x=1699807102; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=w0YWn4Wu8t/tdGSMrIedTNPDrI+lZ+zejMv3oNkuHfg=; b=t3lcUvERncHuiY0ddFDG47dQ4KVb1YmNWe14pzbL7VVYggSJ8lOlfOemc0NMLub/IM 1MqQr4TtVmCWr2Vfd7ycZbB0jM8od4MAioU7m/ojtBVhIqU6V/2i1zn6jflEmidQZ5TJ qOis2EQvpLUUOxD1Bveedc/dyJf398r2AsbKvHOcgGWStAHDkNRjOR/E5dYhCpQ/rAz5 5MeBasyA75UZu87E+E6/+dm/s1WqaUfFcilmSk0tfB4vo3324vkPgxG7JruTYll13lUw P/Dd0ew/3yK9liRWUu7/SXB3vgO2MV2OwR29eEeRBQ4voZRGNzbd2lOR/PjgUGE3ZVmb oP8g== X-Gm-Message-State: AOJu0YxXFvDHRF5Rj7wve3XReAitQhZjAKacPOtl7XXsTfRja0UFcUMd j32cqTP+eZF5LaQvA1UWW/4IdAmz6zpuRfqoaVw9f2qe X-Google-Smtp-Source: AGHT+IGDQd8ANpn73xoBU99FqlxwAOWdVxu98S+ChvzKWzFp6LR4/5fHW2h0d3IK9X89PL70rMLxMbKqcKsQT8U1lZc= X-Received: by 2002:a05:651c:2203:b0:2c5:128c:fae8 with SMTP id y3-20020a05651c220300b002c5128cfae8mr25815325ljq.30.1699202302393; Sun, 05 Nov 2023 08:38:22 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 5 Nov 2023 08:38:21 -0800 From: Stefan Kangas In-Reply-To: References: <87fsfaa56t.fsf@rfc20.org> <8735ak6pq7.fsf@rfc20.org> <87o7std54i.fsf@rfc20.org> MIME-Version: 1.0 Date: Sun, 5 Nov 2023 08:38:21 -0800 Message-ID: Subject: Re: bug#58801: [PATCH] Autoload the `calc-eval-error' variable To: Matt Armstrong Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58801-done Cc: 58801-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: -1.0 (-) Version: 30.1 Stefan Kangas writes: > We typically avoid autoloading variables, and I'm not sure it's > justified here. See (info "(elisp) When to Autoload") for details. > > Could we instead just declare it in calc.el? I believe that should > silence any warnings from the byte-compiler. It's a one line change: > > (defvar calc-eval-error) > > Or will that not work in your use case for some reason? > >> (In the particular case of the Calc package, dozens of functions and >> variables are already autoloaded. The omission of `calc-eval-error' >> also seems more an oversight than intentional.) > > FWIW, I couldn't find any autoloaded variables in calc-loaddefs.el. > What am I missing? No further comments here within 2 months, so I've pushed the above proposed fix to master, and I'm closing this bug. If this is still an issue, please reply to this email (use "Reply to all" in your email client) and we can reopen the bug report. [1: ad82bc9b29e]: 2023-11-05 17:36:21 +0100 Declare calc-eval-error in calc.el https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=ad82bc9b29eacad29a441bbb4e87bd09ef1ff1c4 From unknown Tue Jun 17 01:49:01 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 04 Dec 2023 12:24:05 +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