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."
(interactive)
(let ((overlay nil))
(unwind-protect
(with-syntax-table *normal-syntax-table*
(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)))
(mom-highlight-and-center overlay)
(let ((correction (prompt-for-contraction first second)))
(if (not (zerop (length correction)))
(progn
(delete-overlay overlay)
(replace-match correction t)
(fill-paragraph nil)))))
(delete-overlay overlay)
(setq overlay nil)))
(if overlay (delete-overlay overlay)))))
I'm using a fairly recent CVS emacs on GNU/Linux.
-Peter
--
Peter Seibel pe...@javamonkey.com
Lisp is the red pill. -- John Fraser, comp.lang.lisp