tags 39898 + patch thanks OGAWA Hirofumi writes: > With the following test, > > (with-temp-buffer > (select-window (display-buffer (current-buffer))) > (insert "appl") > (flyspell-buffer) > (flyspell-check-previous-highlighted-word)) > > `flyspell-check-previous-highlighted-word' calls `(error)'. But "appl" > is the typo that should be fixed. > > At the following [**] mark in a that command, the ">" looks not allowing > a typo at (point-min). Maybe the ">" should be the ">=". > > (defun flyspell-check-previous-highlighted-word (&optional arg) > > [...] > > (if (> pos (point-min)) <- [**] > > [...] > > (save-excursion > (goto-char pos) > (ispell-word) > (setq flyspell-word-cache-word nil) ;; Force flyspell-word re-check > (flyspell-word)) > (error "No word to correct before point")))) Indeed, this just looks like an OBOE to me. The attached patch fixes it as per your suggestion. However, there is some stuff going on with `previous-overlay-change', so it would be good if someone could double-check that the fix here is correct. AFAIU, this should work at the price that in a buffer with no misspelled words we uselessly check if there's a misspelled word at point-min. Best regards, Stefan Kangas