Posted By

tprimke on 07/01/10


Tagged

newLISPwiki


Versions (?)

Change references to a page


 / Published in: Lisp
 

  1. ;; changes all references to the given page-old
  2. ;; to references to the given page-new
  3. (define (change-refs page-old page-new)
  4. (let ( page-old-filename (replace "_" (dup page-old 1) ".")
  5. rexp (append {\[\[} page-old {\]\]})
  6. subst (append {[[} page-new {]]})
  7. files (slice (directory "pages/") 2) )
  8. (dolist (fle files)
  9. (let ( content (get-content fle) )
  10. (if (find rexp content 0)
  11. (begin
  12. (replace rexp content subst 512)
  13. (write-file (append "pages/" fle) content)))))))

Report this snippet  

You need to login to post a comment.