src/Tools/jEdit/src/bibtex_jedit.scala
changeset 58545 30b75b7958d6
child 58546 72e2b2a609c4
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/Tools/jEdit/src/bibtex_jedit.scala	Sun Oct 05 17:58:36 2014 +0200
     1.3 @@ -0,0 +1,27 @@
     1.4 +/*  Title:      Tools/jEdit/src/bibtex_jedit.scala
     1.5 +    Author:     Makarius
     1.6 +
     1.7 +BibTeX support in Isabelle/jEdit.
     1.8 +*/
     1.9 +
    1.10 +package isabelle.jedit
    1.11 +
    1.12 +
    1.13 +import isabelle._
    1.14 +
    1.15 +
    1.16 +import org.gjt.sp.jedit.Buffer
    1.17 +
    1.18 +
    1.19 +object Bibtex_JEdit
    1.20 +{
    1.21 +  /* buffer model entries */
    1.22 +
    1.23 +  def entries_iterator(): Iterator[(String, Buffer, Text.Offset)] =
    1.24 +    for {
    1.25 +      buffer <- JEdit_Lib.jedit_buffers()
    1.26 +      model <- PIDE.document_model(buffer).iterator
    1.27 +      (name, offset) <- model.bibtex_entries.iterator
    1.28 +    } yield (name, buffer, offset)
    1.29 +}
    1.30 +