emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/textmodes/flyspell.el


From: Richard M . Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/textmodes/flyspell.el
Date: Sun, 09 Oct 2005 21:13:22 -0400

Index: emacs/lisp/textmodes/flyspell.el
diff -c emacs/lisp/textmodes/flyspell.el:1.77 
emacs/lisp/textmodes/flyspell.el:1.78
*** emacs/lisp/textmodes/flyspell.el:1.77       Tue Oct  4 20:29:00 2005
--- emacs/lisp/textmodes/flyspell.el    Mon Oct 10 01:13:22 2005
***************
*** 1322,1368 ****
  ;*    flyspell-external-point-words ...                                */
  ;*---------------------------------------------------------------------*/
  (defun flyspell-external-point-words ()
!   (let ((buffer flyspell-external-ispell-buffer))
!     (set-buffer buffer)
      (goto-char (point-min))
!     (let ((pword "")
!         (pcount 1))
!       ;; now we are done with ispell, we have to find the word in
!       ;; the initial buffer
!       (while (< (point) (- (point-max) 1))
!       ;; we have to fetch the incorrect word
!       (if (re-search-forward "\\([^\n]+\\)\n" (point-max) t)
!           (let ((word (match-string 1)))
!             (if (string= word pword)
!                 (setq pcount (1+ pcount))
!               (progn
!                 (setq pword word)
!                 (setq pcount 1)))
!             (goto-char (match-end 0))
!             (if flyspell-issue-message-flag
!                 (message "Spell Checking...%d%% [%s]"
!                          (* 100 (/ (float (point)) (point-max)))
!                          word))
!             (set-buffer flyspell-large-region-buffer)
!             (goto-char flyspell-large-region-beg)
!             (let ((keep t)
!                   (n 0))
!               (while (and (or (< n pcount) keep)
!                           (search-forward word flyspell-large-region-end t))
!                 (progn
!                   (goto-char (- (point) 1))
!                   (setq n (1+ n))
!                   (setq keep (flyspell-word))))
!               (if (= n pcount)
!                   (setq flyspell-large-region-beg (point))))
!             (set-buffer buffer))
!         (goto-char (point-max)))))
      ;; we are done
!     (if flyspell-issue-message-flag (message "Spell Checking completed."))
!     ;; ok, we are done with pointing out incorrect words, we just
!     ;; have to kill the temporary buffer
!     (kill-buffer flyspell-external-ispell-buffer)
!     (setq flyspell-external-ispell-buffer nil)))
  
  ;*---------------------------------------------------------------------*/
  ;*    flyspell-large-region ...                                        */
--- 1322,1364 ----
  ;*    flyspell-external-point-words ...                                */
  ;*---------------------------------------------------------------------*/
  (defun flyspell-external-point-words ()
!   "Mark words from a buffer listing incorrect words in order of appearance.
! The list of incorrect words should be in `flyspell-external-ispell-buffer'.
! \(We finish by killing that buffer and setting the variable to nil.)
! The buffer to mark them in is `flyspell-large-region-buffer'."
! 
!   (with-current-buffer flyspell-external-ispell-buffer
      (goto-char (point-min))
!     ;; Loop over incorrect words.
!     (while (re-search-forward "\\([^\n]+\\)\n" (point-max) t)
!       ;; Bind WORD to the next one.
!       (let ((word (match-string 1)))
!       ;; Here there used to be code to see if WORD is the same
!       ;; as the previous iteration, and count the number of consecutive
!       ;; identical words, and the loop below would search for that many.
!       ;; That code seemed to be incorrect, and on principle, should
!       ;; be unnecessary too. -- rms.
!       (if flyspell-issue-message-flag
!           (message "Spell Checking...%d%% [%s]"
!                    (* 100 (/ (float (point)) (point-max)))
!                    word))
!       ;; Search the other buffer for occurrences of this word,
!       ;; and check them.  Stop when we find one that reports "incorrect".
!       ;; (I don't understand the reason for that logic,
!       ;; but I didn't want to change it. -- rms.)
!       (with-current-buffer flyspell-large-region-buffer
!         (goto-char flyspell-large-region-beg)
!         (let ((keep t))
!           (while (and keep
!                       (search-forward word flyspell-large-region-end t))
!             (goto-char (- (point) 1))
!             (setq keep (flyspell-word)))
!           (setq flyspell-large-region-beg (point))))))
      ;; we are done
!     (if flyspell-issue-message-flag (message "Spell Checking completed.")))
!   ;; Kill and forget the buffer with the list of incorrect words.
!   (kill-buffer flyspell-external-ispell-buffer)
!   (setq flyspell-external-ispell-buffer nil))
  
  ;*---------------------------------------------------------------------*/
  ;*    flyspell-large-region ...                                        */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]