more direct Isabelle_System.pdf_viewer;
authorwenzelm
Sat, 07 Dec 2013 13:10:56 +0100
changeset 54690 cd88b44623bf
parent 54689 ecaf646b865a
child 54691 506312c293f5
more direct Isabelle_System.pdf_viewer; generic Isabelle_System.open, e.g. for URLs;
src/Pure/System/isabelle_system.scala
src/Pure/Tools/doc.scala
--- a/src/Pure/System/isabelle_system.scala	Sat Dec 07 12:52:31 2013 +0100
+++ b/src/Pure/System/isabelle_system.scala	Sat Dec 07 13:10:56 2013 +0100
@@ -419,6 +419,12 @@
     }
   }
 
+  def open(arg: String): Unit =
+    bash("exec \"$ISABELLE_OPEN\" '" + arg + "' >/dev/null 2>/dev/null &")
+
+  def pdf_viewer(arg: Path): Unit =
+    bash("exec \"$PDF_VIEWER\" '" + standard_path(arg) + "' >/dev/null 2>/dev/null &")
+
 
 
   /** Isabelle resources **/
--- a/src/Pure/Tools/doc.scala	Sat Dec 07 12:52:31 2013 +0100
+++ b/src/Pure/Tools/doc.scala	Sat Dec 07 13:10:56 2013 +0100
@@ -81,12 +81,10 @@
 
   def view(name: String)
   {
-    val doc = name + ".pdf"
-    dirs().find(dir => (dir + Path.basic(doc)).is_file) match {
-      case Some(dir) =>
-        Isabelle_System.bash_env(dir.file, null,
-          "\"$ISABELLE_TOOL\" display " + quote(doc) + " >/dev/null 2>/dev/null &")
-      case None => error("Missing Isabelle documentation file: " + quote(doc))
+    val doc = Path.basic(name + ".pdf")
+    dirs().find(dir => (dir + doc).is_file) match {
+      case Some(dir) => Isabelle_System.pdf_viewer(dir + doc)
+      case None => error("Missing Isabelle documentation file: " + doc)
     }
   }