+DocIterator doc_iterator_end(const Buffer * buf0, const Inset * inset0)
+{
+ Buffer * buf = const_cast<Buffer *>(buf0);
+ Inset * inset = const_cast<Inset *>(inset0);
+ return DocIterator(buf, inset ? inset : &buf->inset());
+}
+
+
+bool DocIterator::inRegexped() const
+{
+ InsetMathHull * i = dynamic_cast<InsetMathHull *>(inset().asInsetMath());
+ return i && i->getType() == hullRegexp;
+}
+
+
+LyXErr & operator<<(LyXErr & os, DocIterator const & it)