clarified ISABELLE_DOC_FORMAT -- eliminated slightly odd fall-back;
authorwenzelm
Tue Jun 25 19:25:40 2013 +0200 (2013-06-25)
changeset 52448082a1c8c2c89
parent 52447 9a74000426e2
child 52449 79e7fd57acc4
clarified ISABELLE_DOC_FORMAT -- eliminated slightly odd fall-back;
src/Pure/Tools/doc.scala
     1.1 --- a/src/Pure/Tools/doc.scala	Tue Jun 25 19:13:37 2013 +0200
     1.2 +++ b/src/Pure/Tools/doc.scala	Tue Jun 25 19:25:40 2013 +0200
     1.3 @@ -53,19 +53,12 @@
     1.4  
     1.5    def view(name: String)
     1.6    {
     1.7 -    val formats = List(Isabelle_System.getenv_strict("ISABELLE_DOC_FORMAT"), "dvi")
     1.8 -    val docs =
     1.9 -      for {
    1.10 -        dir <- dirs()
    1.11 -        fmt <- formats
    1.12 -        doc = name + "." + fmt
    1.13 -        if (dir + Path.basic(doc)).is_file
    1.14 -      } yield (dir, doc)
    1.15 -    docs match {
    1.16 -      case (dir, doc) :: _ =>
    1.17 +    val doc = name + "." + Isabelle_System.getenv_strict("ISABELLE_DOC_FORMAT")
    1.18 +    dirs().find(dir => (dir + Path.basic(doc)).is_file) match {
    1.19 +      case Some(dir) =>
    1.20          Isabelle_System.bash_env(dir.file, null,
    1.21            "\"$ISABELLE_TOOL\" display " + quote(doc) + " >/dev/null 2>/dev/null &")
    1.22 -      case Nil => error("Missing Isabelle documentation: " + quote(name))
    1.23 +      case None => error("Missing Isabelle documentation file: " + quote(doc))
    1.24      }
    1.25    }
    1.26