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 230 forks source link

doc examples that shouldn't be captured #1891

Closed pzinn closed 3 years ago

pzinn commented 3 years ago

help on redefines ker which messes up other doc pages using ker, say help "modules in Macaulay2". so it shouldn't be captured (but rather, run the old-fashioned way in a separate M2 instance). will fix.

DanGrayson commented 3 years ago

Good point. I wonder if there are other documentation examples that redefine global methods.

Wait, doesn't "help on" use precomputed documentation output? So maybe you mean that after running installPackage on the core, it's screwed up for later documentation nodes.

mahrud commented 3 years ago

Thanks, on escaped my mind. Seems like there are 23 or so pages affected by this. Fortunately it looks like only the documentation for on calls it, so the simplest solution is this:

diff --git a/M2/Macaulay2/packages/Macaulay2Doc/debugging.m2 b/M2/Macaulay2/packages/Macaulay2Doc/debugging.m2
index f4b120a3a..23d168cc2 100644
--- a/M2/Macaulay2/packages/Macaulay2Doc/debugging.m2
+++ b/M2/Macaulay2/packages/Macaulay2Doc/debugging.m2
@@ -299,7 +299,7 @@ document {
          are write-protected; fortunately, their methods are not, and can be replaced."
          },
      EXAMPLE lines ///
-     ker Matrix := on(lookup(ker,Matrix),GenerateAssertions=>true,Name=>"ker");
+     ker Matrix := on(lookup(ker,Matrix),GenerateAssertions=>true,Name=>"ker"); -* no-capture-flag *-
      f = x -> kernel (x|x);
      R = QQ[a..c];
      f vars R
pzinn commented 3 years ago

yes, it's a one-line fix. was about to add to my PR but you can do it if you prefer

mahrud commented 3 years ago

No, go ahead.