comparison lisp/textmodes/flyspell.el @ 77524:7be6bca439a5

(flyspell-auto-correct-previous-word): Use window-start and window-end.
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 27 Apr 2007 18:56:26 +0000
parents b2648f8ce834
children ac2665c1975b 70bf32a0f523
comparison
equal deleted inserted replaced
77523:98b058621040 77524:7be6bca439a5
1959 (defun flyspell-auto-correct-previous-word (position) 1959 (defun flyspell-auto-correct-previous-word (position)
1960 "Auto correct the first mispelled word that occurs before point. 1960 "Auto correct the first mispelled word that occurs before point.
1961 But don't look beyond what's visible on the screen." 1961 But don't look beyond what's visible on the screen."
1962 (interactive "d") 1962 (interactive "d")
1963 1963
1964 (let (top bot) 1964 (let ((top (window-start))
1965 (save-excursion 1965 (bot (window-end)))
1966 (move-to-window-line 0)
1967 (setq top (point))
1968 (move-to-window-line -1)
1969 (setq bot (point)))
1970 (save-excursion 1966 (save-excursion
1971 (save-restriction 1967 (save-restriction
1972 (narrow-to-region top bot) 1968 (narrow-to-region top bot)
1973 (overlay-recenter (point)) 1969 (overlay-recenter (point))
1974 1970