I have the following function which loops finding words in a text that
can possibly be conracted. Because replacing two words with one will
sometimes join two lines, I want to refill the paragraphs where I
replace text. Thus the call to fill-paragraph. But it seems to have no
effect. Am I doing something wrong?
(defun pbs:contract ()
"Finds potential contractions and lets you convert them."
(let ((overlay nil))
(while (search-forward-regexp *contraction-regexp* (point-max) t)
(let ((first (match-string 1))
(second (match-string 2)))
(setq overlay (make-overlay (match-beginning 0) (match-end 0)))
(let ((correction (prompt-for-contraction first second)))
(if (not (zerop (length correction)))
(replace-match correction t)
(setq overlay nil)))
(if overlay (delete-overlay overlay)))))
I'm using a fairly recent CVS emacs on GNU/Linux.
Peter Seibel pe...@javamonkey.com
Lisp is the red pill. -- John Fraser, comp.lang.lisp