Subject: Re: bug#79143: [PATCH] New user option to inhibit Calc startup message

From: Sean Devlin <[email-masked]>
Date: Sun, 3 Aug 2025 10:41:32 -0500

> On Aug 2, 2025, at 8:56 PM, Christopher Howard <[email-masked]> wrote:
> 
>> Christopher, any comments?  (I hope you don't mind being involved in
>> maintenance of Calc by way of reviewing patches of others.)
> 
> The basic idea seems straightforward enough. Just glancing over the patch quickly, I wonder what significance that calc-said-hello variable has and if we are handling that logic for that correctly. But I haven't looked at the larger context.
> 

Hi Christopher,

I investigated this a little while I was developing the change.

Calc-said-hello is a defvar (as opposed to defcustom or defcalcmodevar) with this doc string:

“Non-nil if the welcome message has been displayed.”

It’s referenced only in the calc defun at the end:

        (message (substitute-command-keys
                  (concat "Welcome to the GNU Emacs Calculator!  \\<calc-mode-map>"
                          "Press \\[calc-help] or \\[calc-help-prefix] for help, \\[calc-quit] to quit")))
        ...
        (when (and calc-said-hello interactive)
          (sit-for 2)
          (message ""))
        (setq calc-said-hello t)

Basically, the first time we run M-x calc, the welcome message stays there until the user does something. On subsequent uses of M-x calc (within the same Emacs session), we clear the welcome message after two seconds or when the user does something, whichever comes first.

I think my patch makes sense with respect to managing this variable. If calc-inhibit-startup-message is set, we avoid setting this flag, since Calc hasn’t “said hello” yet. If the user then clears calc-inhibit-startup-message, the next invocation of M-x calc will be the first time the welcome message appears, so presumably we want it to stay there until the user does something and give them time to read it.

What do you think?

Cheers.

> -- 
> Christopher Howard