Macaulay2 / M2

The primary source code repository for Macaulay2, a system for computing in commutative algebra, algebraic geometry and related fields.
https://macaulay2.com
343 stars 228 forks source link

help(ZZ) error #3386

Closed d-torrance closed 3 weeks ago

d-torrance commented 1 month ago

I think this may have started with #3341:

i1 : about "monomialCurveIdeal"

o1 = {0 => (Macaulay2Doc "monomialCurveIdeal" -- make the ideal of a monomial curve)}

o1 : NumberedVerticalList

i2 : help 0
stdio:2:1:(3): error: can't determine symbol whose value is document tag: SPAN{"Macaulay2Doc"," ",TOH{new Documen$
pzinn commented 1 month ago

ah yes, this PR was merged a bit too quickly. I should be able to fix that.

pzinn commented 1 month ago

easy fix, though it might be a good time to review these changes and maybe improve them.

mahrud commented 1 month ago

I'd like to advocate for reverting to the previous behavior of about and instead implementing one of the following solutions:

  1. add an optional argument to display headlines in the following format:
    o1 = {0 => Macaulay2Doc::monomialCurveIdeal -- make the ideal of a monomial curve}
  2. add a new command headlines which behaves as follows:
    
    i14 : about "monomialCurveIdeal"

o14 = {0 => Macaulay2Doc::monomialCurveIdeal}

i15 : headlines about "monomialCurveIdeal"

o15 = {0 => Macaulay2Doc::monomialCurveIdeal -- make the ideal of a monomial curve}

i16 : headlines methods monomialCurveIdeal

o16 = {0 => Macaulay2Doc::monomialCurveIdeal -- make the ideal of a monomial curve}



The output formats are the same, and the entries are strings, but we can modify `makeDocumentTag String` to ignore everything after `--`, so `help 0` calls `help "Macaulay2Doc::monomialCurveIdeal -- make the ideal of a monomial curve"` and works as expected. I can open a PR to this effect to demonstrate.

ps: also, can we just silence the afterprint of NumberedVerticalList? It's kind of annoying.
mahrud commented 1 month ago

What are your thoughts about this output?


i20 : headlines about quotient

o20 = 0   Saturation :: quotient(...,BasisElementLimit=>...)                                 
      1   Saturation :: quotient(...,DegreeLimit=>...)                                       
      2   Saturation :: quotient(...,MinimalGenerators=>...)   -- ideal or submodule quotient
      3   Saturation :: quotient(...,PairLimit=>...)                                         
      4   Saturation :: quotient(...,Strategy=>...)                                          
      5   Saturation :: quotient(Ideal,Ideal)                  -- ideal or submodule quotient
      6   Saturation :: quotient(Ideal,Number)                                               
      7   Saturation :: quotient(Ideal,RingElement)            -- ideal or submodule quotient
      8   Saturation :: quotient(Module,Ideal)                 -- ideal or submodule quotient
      9   Saturation :: quotient(Module,Module)                -- ideal or submodule quotient
      10  Saturation :: quotient(Module,Number)                                              
      11  Saturation :: quotient(Module,RingElement)           -- ideal or submodule quotient
      12  Saturation :: quotient(MonomialIdeal,RingElement)    -- ideal or submodule quotient

I'm guessing that Paul wants the headlines to be links, but in terminal links are quoted, which is unfortunate. Any suggestions, Doug?

d-torrance commented 1 month ago

Quotes might not be so bad in the terminal if we define ZZ String (or maybe RR String) to do the same thing as * String so users could move up and press Return in Emacs to view the documentation.

So for example, maybe about could do something like this?

i1 : RR String := (x, y) -> help y;

i2 : beginDocumentation(); OL {TOH rank, TOH ideal}

o3 =   0. "rank" -- compute the rank
       1. "ideal" -- make an ideal

-- after navigating up and pressing return on item #0:

i4 : o3 =   0. "rank" -- compute the rank

o4 = rank -- compute the rank
     ************************
...
mahrud commented 1 month ago

Quotes are bad because they prevent syntax highlighting. We already have help ZZ and shorthands like this for that reason, I don't think we need more.

d-torrance commented 1 month ago

Ah, good point