Subject: bug#58801: closed (Re: bug#58801: [PATCH] Autoload the `calc-eval-error' variable)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 05 Nov 2023 16:40:01 +0000

Your bug report

#58801: [PATCH] Autoload the `calc-eval-error' variable

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
58801: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58801
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#58801: [PATCH] Autoload the `calc-eval-error' variable
From: Stefan Kangas <[email-masked]>
To: Matt Armstrong <[email-masked]>
Cc: [email-masked]
Date: Sun, 5 Nov 2023 08:38:21 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 30.1

Stefan Kangas <[email-masked]> 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

Subject: [PATCH] Autoload the `calc-eval-error' variable
From: Matt Armstrong <[email-masked]>
To: [email-masked]
Date: Wed, 26 Oct 2022 10:02:50 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

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'

>From 526d0b31e0d836e7a3c21d831849b8c50da2420e Mon Sep 17 00:00:00 2001
From: Matt Armstrong <[email-masked]>
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