From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Richard M. Stallman" Newsgroups: gmane.emacs.devel Subject: Re: flyspell bug Date: Mon, 24 Oct 2005 12:27:32 -0400 Message-ID: References: <20051013122745.23F5.SLAWOMIR.NOWACZYK.847@student.lu.se> <20051014131718.2403.SLAWOMIR.NOWACZYK.847@student.lu.se> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1130171452 24569 80.91.229.2 (24 Oct 2005 16:30:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 24 Oct 2005 16:30:52 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 24 18:30:49 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EU5Am-0006U6-8s for ged-emacs-devel@m.gmane.org; Mon, 24 Oct 2005 18:27:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EU5Al-0005FK-GF for ged-emacs-devel@m.gmane.org; Mon, 24 Oct 2005 12:27:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EU5Ab-0005FF-K4 for emacs-devel@gnu.org; Mon, 24 Oct 2005 12:27:33 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EU5Ab-0005F3-7D for emacs-devel@gnu.org; Mon, 24 Oct 2005 12:27:33 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EU5Ab-0005F0-1n for emacs-devel@gnu.org; Mon, 24 Oct 2005 12:27:33 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EU5Ab-0004kS-6a for emacs-devel@gnu.org; Mon, 24 Oct 2005 12:27:33 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1EU5Aa-0004GR-7y; Mon, 24 Oct 2005 12:27:32 -0400 Original-To: Piet van Oostrum Original-to: Slawomir Nowaczyk In-reply-to: (message from Piet van Oostrum on Mon, 24 Oct 2005 09:16:39 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:44736 Archived-At: When I check it, it is considered a misspelling. Maybe it is in your personal dictionary? That was indeed the reason. Trying it with an empty personal dictionary, I observed the bug. This patch seems to work; does it give good results? *** flyspell.el 20 Oct 2005 00:27:34 -0400 1.80 --- flyspell.el 24 Oct 2005 11:50:52 -0400 *************** *** 1333,1339 **** ;; 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. --- 1333,1339 ---- ;; Loop over incorrect words. (while (re-search-forward "\\([^\n]+\\)\n" (point-max) t) ;; Bind WORD to the next one. ! (let ((word (match-string 1)) (wordpos (point))) ;; 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. *************** *** 1349,1360 **** ;; 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. --- 1349,1362 ---- ;; but I didn't want to change it. -- rms.) (with-current-buffer flyspell-large-region-buffer (goto-char flyspell-large-region-beg) ! (if (search-forward word flyspell-large-region-end t) ! (progn ! (setq flyspell-large-region-beg (point)) ! (goto-char (- (point) 1)) ! ;; (setq keep (flyspell-word)) ! (flyspell-word)) ! (error "Bug: misspelled word `%s' (output pos %d) not found in buffer" ! word wordpos))))) ;; we are done (if flyspell-issue-message-flag (message "Spell Checking completed."))) ;; Kill and forget the buffer with the list of incorrect words.