On Dec 27, 2008, at 12:51 AM, Abdulaziz Ghuloum wrote:
You can also modify
it so that it attempts to recompile the script after you exit
vim (successfully).
like:
(define (edit file posn)
(system (format "vim ~s -c \"goto ~a\"" file posn)))
(define (compile script-name)
(guard (con
[(source-position-condition? con)
(print-condition con (current-output-port))
(let ([file (source-position-file-name con)]
[posn (source-position-character con)])
(let* ([m1 (file-mtime file)]
[rv (edit file posn)]
[m2 (file-mtime file)])
(when (and (zero? rv) (> m2 m1))
(compile script-name))))])
(load-r6rs-script script-name #f #f)))
Aziz,,,