src/Tools/jEdit/src/bibtex_jedit.scala
author wenzelm
Sun Oct 05 17:58:36 2014 +0200 (2014-10-05 ago)
changeset 58545 30b75b7958d6
child 58546 72e2b2a609c4
permissions -rw-r--r--
citation tooltip/hyperlink based on open buffers with .bib files;
wenzelm@58545
     1
/*  Title:      Tools/jEdit/src/bibtex_jedit.scala
wenzelm@58545
     2
    Author:     Makarius
wenzelm@58545
     3
wenzelm@58545
     4
BibTeX support in Isabelle/jEdit.
wenzelm@58545
     5
*/
wenzelm@58545
     6
wenzelm@58545
     7
package isabelle.jedit
wenzelm@58545
     8
wenzelm@58545
     9
wenzelm@58545
    10
import isabelle._
wenzelm@58545
    11
wenzelm@58545
    12
wenzelm@58545
    13
import org.gjt.sp.jedit.Buffer
wenzelm@58545
    14
wenzelm@58545
    15
wenzelm@58545
    16
object Bibtex_JEdit
wenzelm@58545
    17
{
wenzelm@58545
    18
  /* buffer model entries */
wenzelm@58545
    19
wenzelm@58545
    20
  def entries_iterator(): Iterator[(String, Buffer, Text.Offset)] =
wenzelm@58545
    21
    for {
wenzelm@58545
    22
      buffer <- JEdit_Lib.jedit_buffers()
wenzelm@58545
    23
      model <- PIDE.document_model(buffer).iterator
wenzelm@58545
    24
      (name, offset) <- model.bibtex_entries.iterator
wenzelm@58545
    25
    } yield (name, buffer, offset)
wenzelm@58545
    26
}
wenzelm@58545
    27