homeS
authorAdam Chlipala <adamc@hcoop.net>
Sat, 17 Nov 2007 22:26:18 +0000 (22:26 +0000)
committerAdam Chlipala <adamc@hcoop.net>
Sat, 17 Nov 2007 22:26:18 +0000 (22:26 +0000)
lib/hcoop.dtl
src/plugins/hcoop.sml

index 755949d..3135462 100644 (file)
@@ -6,6 +6,10 @@ extern type homedir_path;
 extern val home : homedir_path -> your_path;
 {{Shortcut to denote a subdirectory of your home directory}}
 
+extern val homeS : no_spaces -> no_spaces;
+{{Use this version when it doesn't matter if the output is a real filesystem
+  path.}}
+
 val mailmanHcoop = mailmanWebHost "lists.hcoop.net";
 {{Configure your domain to have its Mailman mailing lists served on the web at
   lists.hcoop.net.}}
index b5f6b40..0441e3b 100644 (file)
@@ -29,9 +29,12 @@ val _ = Env.type_one "homedir_path"
        (fn dir => Domain.yourPath (OS.Path.concat (Domain.homedir (), dir))
                   handle _ => false)
 
-val () = Env.registerFunction ("home",
-                              fn [(EString dir, _)] => (SOME (EString (OS.Path.concat (Domain.homedir (), dir)), dl)
-                                                        handle _ => NONE)
-                               | _ => NONE)
+fun addHome name = Env.registerFunction (name,
+                                     fn [(EString dir, _)] => (SOME (EString (OS.Path.concat (Domain.homedir (), dir)), dl)
+                                                               handle _ => NONE)
+                                      | _ => NONE)
+
+val () = addHome "home"
+val () = addHome "homeS"
 
 end