\\)+" nil t) (replace-match "\n\n\n")) (goto-char (point-min)) (while (re-search-forward "<[^>]+>" nil t) (delete-region (match-beginning 0)(match-end 0))) (fill-region (point-min) (point-max)) (replace-from-table sgml-entities) (setf (gethash key *hachette-memoize-D-hash*) (buffer-string))))))) (goto-char (point-min)) (set-buffer-modified-p nil) (setq buffer-read-only t) (turn-on-font-lock)) (defun hachette-kill-buffer-and-window () "Kill the current buffer and delete the selected window." (interactive) (if (or (not hachette-confirm-window-killing) (funcall hachette-yes-or-no-function (if hachette-speak-french "Quitter? " "Quit? "))) (let ((buffer (current-buffer))) (delete-window (selected-window)) (kill-buffer buffer)))) (if (not emacs21p) (defun replace-from-table (lst) "Use the alist to search and replace a whole buffer. Argument LST Associative list of string and replacement-string." (let ((case-fold-search nil)) (cond ((null lst) lst) (t (progn (let ((pos (point-marker))) (goto-char (point-min)) (while (re-search-forward (car (car lst)) nil t) (replace-match (car (cdr (car lst))) t t)) (goto-char pos)) (replace-from-table (cdr lst)))))))) (defun unsgmlify () (if emacs21p (iso-sgml2iso (point-min)(point-max)) (replace-from-table sgml-entities))) (provide 'hachette) ;;; hachette.el ends here