(require 'stdlib) ;; entry structure: ;; ^entry-name$ ;; ^$ ;; entry-text, both tab-prefixed lines and empty lines ;; ^$ ;; ^next-entry-name$ (defun foldoc-read (file) (let ((text (make-string-output-stream)) (file (open-file file 'read)) t) (copy-stream file text) (close-file file) (setq t (string-replace "\n(\\w)" "###\n\\1" (get-output-stream-string text))) ;;(puts t) (string-split "###\n" t))) (defun foldoc-lookup (regex) t) (let ((dict (foldoc-read "Dictionary"))) (printf "%s entries\n" (length dict)) ;;(princ dict) ;; (puts (foldoc-lookup "athlon")) )