Function: flyspell-word-search-backward

flyspell-word-search-backward is a byte-compiled function defined in flyspell.el.gz.

Signature

(flyspell-word-search-backward WORD BOUND &optional IGNORE-CASE)

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/flyspell.el.gz
;;*---------------------------------------------------------------------*/
;;*    flyspell-word-search-backward ...                                */
;;*---------------------------------------------------------------------*/
(defun flyspell-word-search-backward (word bound &optional ignore-case)
  (save-excursion
    (let* ((r '())
	   (inhibit-point-motion-hooks t)
	   (flyspell-not-casechars (flyspell-get-not-casechars))
	   (bound (if (and bound
			   (> bound (point-min)))
		      (- bound 1)))
	   (word-re (concat
                     "\\(?:" flyspell-not-casechars "\\|\\`\\)"
                     (regexp-quote word)
                     flyspell-not-casechars))
	   p)
      (while
	  (and (not r)
               (setq p
                     (and
                      (re-search-backward word-re bound t)
		      (if (bobp)
			  (point)
                        (forward-char)
                        (point)))))
        (let ((lw (flyspell-get-word)))
          (if (and (consp lw)
                   (if ignore-case
                       (string-equal (downcase (car lw)) (downcase word))
                     (string-equal (car lw) word)))
              (setq r p)
            (goto-char p))))
      r)))