Trac #15005: fix ref to SAGE_ROOT that broke %edit

See also:
trac #13432
git 1b96ec30440eac87b7361b7106fb4cae8ecc45a6
Trac #15010: Make Rational.minpoly consistent with NumberFieldElement.minpoly

Make the var parameter of Rational.minpoly() default to 'x', for
consistency with NumberFieldElement.minpoly(). (This is desirable since
is_NumberField(QQ) == True.)
#15097: improve documentation of is_prime
Different completion functors must not commute, to fix pushout of
completed fields
trac #15553: Broken links in the doc of graph/ and numerical/
Trac #15329: Fix pushout of completed fields

The aim is to fix the following problem.
{{{
sage: from sage.categories.pushout import pushout
sage: pushout(Qp(7),RLF)
Traceback (most recent call last):
...
RuntimeError: maximum recursion depth exceeded while calling a Python
object
}}}

This boils down to change how `CompletionFunctor` (which is a type of
construction functors used both for `RLF` and `Qp(7)`) commutes with
other construction functors. Currently, it commutes with the fraction
field functor ''and'' with other completion functors. But in fact it is
simply not true that construction functors commute.

URL: http://trac.sagemath.org/15329
Reported by: SimonKing
Ticket author(s): Simon King
Reviewer(s): Marc Mezzarobba
Trac #15005: %edit does not work anymore

{{{
sage: %edit
IPython will make a temporary file named: /tmp/ipython_edit_QLsRWD.py
Editing...--------------------------------------------------------------
-------------
AttributeError                            Traceback (most recent call
last)
<ipython-input-1-107a4967e4b8> in <module>()
----> 1 get_ipython().magic(u'edit')

/home/marc/co/sage/local/lib/python2.7/site-
packages/IPython/core/interactiveshell.pyc in magic(self, arg_s)
   2134         magic_name, _, magic_arg_s = arg_s.partition(' ')
   2135         magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2136         return self.run_line_magic(magic_name, magic_arg_s)
   2137
   2138     #-----------------------------------------------------------
--------------

/home/marc/co/sage/local/lib/python2.7/site-
packages/IPython/core/interactiveshell.pyc in run_line_magic(self,
magic_name, line)
   2060                 args.append(sys._getframe(stack_depth).f_locals)
   2061             with self.builtin_trap:
-> 2062                 result = fn(*args)
   2063             return result
   2064

/home/marc/co/sage/local/lib/python2.7/site-
packages/IPython/core/magics/code.pyc in edit(self, parameter_s,
last_call)

/home/marc/co/sage/local/lib/python2.7/site-
packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
    189     # but it's overkill for just that one bit of state.
    190     def magic_deco(arg):
--> 191         call = lambda f, *a, **k: f(*a, **k)
    192
    193         if callable(arg):

/home/marc/co/sage/local/lib/python2.7/site-
packages/IPython/core/magics/code.py
c in edit(self, parameter_s, last_call)
    490             if ' ' in filename:
    491                 filename = "'%s'" % filename
--> 492             self.shell.hooks.editor(filename,lineno)
    493         except TryNext:
    494             warn('Could not open editor')

/home/marc/co/sage/local/lib/python2.7/site-
packages/IPython/core/hooks.pyc in __call__(self, *args, **kw)
    136             #print "prio",prio,"cmd",cmd #dbg
    137             try:
--> 138                 return cmd(*args, **kw)
    139             except TryNext as exc:
    140                 last_exc = exc

/home/marc/co/sage/local/lib/python2.7/site-
packages/sage/misc/edit_module.pyc in edit_devel(self, filename,
linenum)
    302     """
    303     import IPython.core.hooks
--> 304     sageroot = sage.misc.sageinspect.SAGE_ROOT+'/'
    305     runpathpattern = '^'+sageroot+'local/lib/python[^/]*/site-
packages'
    306     develbranch = sageroot+'devel/sage'

AttributeError: 'module' object has no attribute 'SAGE_ROOT'
}}}

This is apparently due to an occurrence of SAGE_ROOT missed by #13432.

The branch linked to this ticket contains a simple patch to fix the
issue. I don't know how to test for it automatically (there are already
examples that trigger the bug in `sage.misc.edit_module`, but they are
all marked `# not tested`), so the patch doesn't add any new test.

Note that `%edit object` still fails in many cases (e.g., when `object`
is an instance of a Cython class). A workaround is to use `%edit -n 0`.
See also [https://github.com/ipython/ipython/issues/3920 IPython issue
3920].

URL: http://trac.sagemath.org/15005
Reported by: mmezzarobba
Ticket author(s): Marc Mezzarobba
Reviewer(s): Volker Braun
Trac #15010: Consistency between Rational.minpoly and NumberFieldElement.minpoly

Make the var parameter of `Rational.minpoly()` default to `'x'`, for
consistency with `NumberFieldElement.minpoly()`. (This is important
since `is_NumberField(QQ) == True`.)

I'm wondering if `minpoly()` shouldn't actually just be moved to
`FieldElement`. Thoughts?

URL: http://trac.sagemath.org/15010
Reported by: mmezzarobba
Ticket author(s): Marc Mezzarobba
Reviewer(s): Ben Hutz
Trac #15553: Broken links in the doc of graph/ and numerical/

When compiling the doc with --warn-links (pretty nice thing, by the
way), some broken links appeared in the doc of graphs/ and numerical/. I
fixed all I could `:-)`

Nathann

URL: http://trac.sagemath.org/15553
Reported by: ncohen
Ticket author(s): Nathann Cohen
Reviewer(s): Marc Mezzarobba
Trac #15097: improve documentation of is_prime

The documentation of {{{is_prime}}} says:
{{{
sage: n=17
sage: n.is_prime?
...
   * "proof" -- If False, use a strong pseudo-primality test. If True,
     use a provable primality test.  If unset, use the default
     arithmetic proof flag.
}}}
however no example or pointer is given to explain how to access or
change the "default arithmetic proof flag".

URL: http://trac.sagemath.org/15097
Reported by: zimmerma
Ticket author(s): Paul Zimmermann
Reviewer(s): Julian Rueth