(defun navi2ch-board-dat2html (&optional board ask) (interactive) (or board (setq board navi2ch-board-current-board)) (unless (eq board navi2ch-board-current-board) (setq board (navi2ch-board-load-info board))) (let ((dir (navi2ch-board-get-file-name board "")) (str) (bname) (idir) (filelist) (cfile) (eflg) (ofile)) (if (and (file-exists-p dir) (directory-files dir nil "\\.dat$")) (progn (setq idir dir) (setq filelist (directory-files dir nil "\\.dat$")) (setq str (split-string dir "/")) (setq dir "") (while str (setq dir (concat dir (car str) "\\\\")) (if (null (cdr str)) (setq bname (car str))) (setq str (cdr str)) ) (if bname (progn (setq str (concat "d:/home/navi2ch/html/" bname)) (if (not (file-exists-p str)) (make-directory str)) (setq str (concat "d:\\\\home\\\\navi2ch\\\\html\\\\" bname)) (while filelist (progn (setq cfile (car filelist)) (setq filelist (cdr filelist)) (setq ofile (concat "d:/home/navi2ch/html/" bname "/" (file-name-sans-extension cfile) "\.html")) (if (or (and (file-exists-p ofile) (file-newer-than-file-p (concat idir "/" cfile) (concat "d:/home/navi2ch/html/" bname "/" (file-name-sans-extension cfile) "\.html"))) (not (file-exists-p ofile))) (progn (call-process "dat2html" nil "*2ch*" nil (concat dir cfile) str) ;; str (message (concat idir cfile " done!")))) )))))) (if bname (message (concat bname " dat2html done!"))) )) (defun navi2ch-list-dat2html-current-board (&optional ask) (interactive) (navi2ch-board-dat2html (get-text-property (point) 'board) ask)) (defun navi2ch-list-dat2html-current-category (&optional ask) (interactive) (and (interactive-p) (setq ask t)) (when (or (not ask) (y-or-n-p "dat2html current category boards?")) (dolist (board (navi2ch-list-get-current-category-list)) (navi2ch-board-dat2html board)) (message "dat2html current category is done"))) (defun navi2ch-list-dat2html-all (&optional ask) (interactive) (and (interactive-p) (setq ask t)) (when (or (not ask) (y-or-n-p "Dat2html all boards?")) (dolist (board (navi2ch-list-get-board-name-list navi2ch-list-category-list)) (when (eq (cdr (assq 'type board)) 'board) (navi2ch-board-dat2html board))) (message "dat2html all board is done"))) (defun navi2ch-list-dat2html () (interactive) (let ((ch (navi2ch-read-char-with-retry "Dat2html b) oard c) ategory a) ll? " nil '(?b ?c ?a)))) (cond ((eq ch ?b) (navi2ch-list-dat2html-current-board 'ask)) ((eq ch ?c) (navi2ch-list-dat2html-current-category 'ask)) ((eq ch ?a) (navi2ch-list-dat2html-all 'ask)))))