GNU bug report logs - #58801
[PATCH] Autoload the `calc-eval-error' variable

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Matt Armstrong <matt@HIDDEN>; Keywords: patch; dated Wed, 26 Oct 2022 17:04:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 58801 <at> debbugs.gnu.org:


Received: (at 58801) by debbugs.gnu.org; 11 Nov 2022 13:16:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 11 08:16:51 2022
Received: from localhost ([127.0.0.1]:45302 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1otTtq-0002WB-Se
	for submit <at> 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 <stefankangas@HIDDEN>) id 1otTto-0002Vg-RW
 for 58801 <at> 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 <at> 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 <stefankangas@HIDDEN>
In-Reply-To: <87fsfaa56t.fsf@HIDDEN> (Matt Armstrong's message of "Wed, 26
 Oct 2022 10:02:50 -0700")
References: <87fsfaa56t.fsf@HIDDEN>
X-Hashcash: 1:20:221111:58801 <at> debbugs.gnu.org::1g+giFQ+1SkwQ5T0:7Jew
MIME-Version: 1.0
Date: Fri, 11 Nov 2022 05:16:42 -0800
Message-ID: <CADwFkmmzf+ho6_KqO1Avyz6pcNrzTydngz5q6DdkgZs5frBWOQ@HIDDEN>
Subject: Re: bug#58801: [PATCH] Autoload the `calc-eval-error' variable
To: Matt Armstrong <matt@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 58801
Cc: 58801 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Matt Armstrong <matt@HIDDEN> writes:

> From 526d0b31e0d836e7a3c21d831849b8c50da2420e Mon Sep 17 00:00:00 2001
> From: Matt Armstrong <matt@HIDDEN>
> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#58801; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 26 Oct 2022 17:03:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 26 13:03:12 2022
Received: from localhost ([127.0.0.1]:55187 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1onjo7-0000Kc-PL
	for submit <at> 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 <matt@HIDDEN>) id 1onjo5-0000KV-Pt
 for submit <at> 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 <matt@HIDDEN>) id 1onjo5-0005lA-Ki
 for bug-gnu-emacs@HIDDEN; 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 <matt@HIDDEN>) id 1onjnt-0005K0-2l
 for bug-gnu-emacs@HIDDEN; Wed, 26 Oct 2022 13:03:09 -0400
Received: (Authenticated sender: matt@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id 78CE0240008
 for <bug-gnu-emacs@HIDDEN>; 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 <matt@HIDDEN>) id 1onjnm-000W2I-2O
 for bug-gnu-emacs@HIDDEN; Wed, 26 Oct 2022 10:02:50 -0700
From: Matt Armstrong <matt@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] Autoload the `calc-eval-error' variable
Date: Wed, 26 Oct 2022 10:02:50 -0700
Message-ID: <87fsfaa56t.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=217.70.178.230; envelope-from=matt@HIDDEN;
 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 <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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 <matt@HIDDEN>
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


--=-=-=--




Acknowledgement sent to Matt Armstrong <matt@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#58801; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 11 Nov 2022 13:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.