summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--demo/counter.ur1
-rw-r--r--demo/prose2
-rw-r--r--src/demo.sig2
-rw-r--r--src/demo.sml4
-rw-r--r--src/main.mlton.sml3
5 files changed, 11 insertions, 1 deletions
diff --git a/demo/counter.ur b/demo/counter.ur
index b11fc936..23768ad3 100644
--- a/demo/counter.ur
+++ b/demo/counter.ur
@@ -1,3 +1,4 @@
+(* Workhorse function, which [main] will call *)
fun counter n = return <xml><body>
Current counter: {[n]}<br/>
<a link={counter (n + 1)}>Increment</a><br/>
diff --git a/demo/prose b/demo/prose
index df0ed0a9..1cc9a6ac 100644
--- a/demo/prose
+++ b/demo/prose
@@ -5,7 +5,7 @@
<blockquote><pre>./configure
make
sudo make install
-urweb -demo /Demo demo</pre></blockquote></p>
+urweb -noEmacs -demo /Demo demo</pre></blockquote></p>
<p>The <tt>-demo /Demo</tt> flag says that we want to build a demo application that expects its URIs to begin with <tt>/Demo</tt>. The final argument <tt>demo</tt> gives the path to a directory housing demo files. One of the files in that directory is <tt>prose</tt>, a file describing the different demo pieces with HTML. Some lines of <tt>prose</tt> have the form <tt><i>foo</i>.urp</tt>, naming particular project files (with the extension <tt>.urp</tt>) in that directory.</p>
diff --git a/src/demo.sig b/src/demo.sig
index 5f5fa2bb..57154ed7 100644
--- a/src/demo.sig
+++ b/src/demo.sig
@@ -30,4 +30,6 @@ signature DEMO = sig
val make : {prefix : string, dirname : string, guided : bool} -> unit
val make' : {prefix : string, dirname : string, guided : bool} -> bool
+ val noEmacs : bool ref
+
end
diff --git a/src/demo.sml b/src/demo.sml
index 358815de..19632d0e 100644
--- a/src/demo.sml
+++ b/src/demo.sml
@@ -27,6 +27,8 @@
structure Demo :> DEMO = struct
+val noEmacs = ref false
+
fun make' {prefix, dirname, guided} =
let
val prose = OS.Path.joinDirFile {dir = dirname,
@@ -333,6 +335,8 @@ fun make' {prefix, dirname, guided} =
else
()
end)
+
+ val highlight = fn () => if !noEmacs then () else highlight ()
in
if OS.Path.base file = "demo" then
()
diff --git a/src/main.mlton.sml b/src/main.mlton.sml
index 33838c93..09b53c58 100644
--- a/src/main.mlton.sml
+++ b/src/main.mlton.sml
@@ -88,6 +88,9 @@ fun doArgs args =
| "-moduleOf" :: fname :: _ =>
(print (Compiler.moduleOf fname ^ "\n");
OS.Process.exit OS.Process.success)
+ | "-noEmacs" :: rest =>
+ (Demo.noEmacs := true;
+ doArgs rest)
| arg :: rest =>
(if size arg > 0 andalso String.sub (arg, 0) = #"-" then
raise Fail ("Unknown flag " ^ arg)