comparison src/demo.sml @ 410:c5a3d223f157

Sql demo
author Adam Chlipala <adamc@hcoop.net>
date Tue, 21 Oct 2008 18:44:52 -0400
parents 1195f6e4d208
children 7ef4b2911b09
comparison
equal deleted inserted replaced
409:81d9f42bb641 410:c5a3d223f157
269 ext = SOME "html"}}}) 269 ext = SOME "html"}}})
270 270
271 fun highlight () = 271 fun highlight () =
272 doit (fn (src, html) => 272 doit (fn (src, html) =>
273 let 273 let
274 val dirty =
275 let
276 val srcSt = Posix.FileSys.stat src
277 val htmlSt = Posix.FileSys.stat html
278 in
279 Time.> (Posix.FileSys.ST.mtime srcSt,
280 Posix.FileSys.ST.mtime htmlSt)
281 end handle OS.SysErr _ => true
282
274 val cmd = "emacs --eval \"(progn " 283 val cmd = "emacs --eval \"(progn "
275 ^ "(global-font-lock-mode t) " 284 ^ "(global-font-lock-mode t) "
276 ^ "(add-to-list 'load-path \\\"" 285 ^ "(add-to-list 'load-path \\\""
277 ^ Config.sitelisp 286 ^ Config.sitelisp
278 ^ "/\\\") " 287 ^ "/\\\") "
285 ^ "(write-file \\\"" 294 ^ "(write-file \\\""
286 ^ html 295 ^ html
287 ^ "\\\") " 296 ^ "\\\") "
288 ^ "(kill-emacs))\"" 297 ^ "(kill-emacs))\""
289 in 298 in
290 print (">>> " ^ cmd ^ "\n"); 299 if dirty then
291 ignore (OS.Process.system cmd) 300 (print (">>> " ^ cmd ^ "\n");
301 ignore (OS.Process.system cmd))
302 else
303 ()
292 end) 304 end)
293 in 305 in
294 if OS.Path.base file = "demo" then 306 if OS.Path.base file = "demo" then
295 () 307 ()
296 else case OS.Path.ext file of 308 else case OS.Path.ext file of