Subject: bug#40185: closed (Re: #40185: 28.0.50; Emacs Calc selection of a sub-formula doesn't highlight it)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 23 Mar 2020 20:38:02 +0000

Your bug report

#40185: 28.0.50; Emacs Calc selection of a sub-formula doesn't highlight it

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].

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

Subject: Re: #40185: 28.0.50; Emacs Calc selection of a sub-formula doesn't highlight it
From: Mattias Engdegård <[email-masked]>
To: Narendra Joshi <[email-masked]>
Cc: [email-masked]
Date: Mon, 23 Mar 2020 21:37:40 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

23 mars 2020 kl. 20.06 skrev Narendra Joshi <[email-masked]>:

> Can you please help me
> understand what exactly the issue was and how declaring the variable
> fixed it? I see that it is `defvar`ed  in `calc-ext.el`.

'defvar' without an initial value is a declaration scoped to the surrounding lexical scope (or file, if at top level). It appears that calc.el does not require calc-ext, so that math-comp-selected was assumed to be lexical where it was bound in math-format-stack-value. This caused it to have the wrong number further down the call tree (in math-comp-to-string-flat, I think).

In Emacs 26 and earlier, calc.el used dynamic binding.

Thanks for verifying! Patch pushed to emacs-27.

Subject: 28.0.50; Emacs Calc selection of a sub-formula doesn't highlight it
From: Narendra Joshi <[email-masked]>
To: [email-masked]
Date: Sun, 22 Mar 2020 19:24:05 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

+ Start Emacs Calc with `C-x * *`.
+ Enter the following formula with:
  ' (a + b)^3 / c d
+ Move point to be before "+" and use "j s" to select the 
sub-formula "(a + b)".
+ This should have hidden the rest of the formula. But it does 
not.

           3
    (a + b)
1*  --------
      c d

Selecting a Calc sub-formula doesn't highlight it. For example, in 
the stack entry above, I have selected (a + b) but other parts of 
the formula are still visible. All commands operate on the 
selected formula and it is selected as evident from the '*' after 
the number of the stack entry. It is not highlighted. This seems 
to be working fine in Emacs 26. It's broken in the latest Emacs 
versions: Emacs 27 and Emacs 28. I can confirm that it is not 
happening because of any of my configuration because I tried the 
same thing with `emacs -Q` and the result was the same.

Best, 
-- 
Narendra Joshi