; ; Bruce Schneier's Crypto-Gram ; (defun nndoc-crypto-gram-type-p nil "Decide whether an article is a Crypto-Gram digest" (let ((case-fold-search nil)) (not (not (re-search-forward "^ +CRYPTO-GRAM\n\n.*\n\n +by Bruce Schneier" nil t))))) (setq nndoc-crypto-gram-separator-string (concat "\\*\\* \\*\\*\\* \\*\\*\\*\\*\\* " "\\*\\*\\*\\*\\*\\*\\* " "\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\* " "\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*")) (defun nndoc-generate-crypto-gram-head (article) "Generate headers for a Crypto-Gram article" (let ((entry (cdr (assq article nndoc-dissection-alist))) (subject "Couldn't find subject")) (save-excursion (set-buffer nndoc-current-buffer) (save-restriction (narrow-to-region (car entry) (nth 3 entry)) (goto-char (point-min)) (while (or (eq (following-char) ?\n) (looking-at (concat "^" nndoc-crypto-gram-separator-string))) (forward-line 1)) (when (looking-at "^ *\\(.*\\)$") (setq subject (match-string 1))) )) (insert "From: Bruce Schneier \n" "Subject: " subject "\n") )) (nndoc-add-type `(crypto-gram (article-begin . ,(concat "^" nndoc-crypto-gram-separator-string "$")) (first-article . ,(concat "^" nndoc-crypto-gram-separator-string "\n\n" "In this issue:\n+" "\\([^*].*\n\\)*" "\n*" nndoc-crypto-gram-separator-string)) (file-end . ,(concat "^" nndoc-crypto-gram-separator-string "CRYPTO-GRAM is a free monthly newsletter providing")) (generate-head-function . nndoc-generate-crypto-gram-head) ))