From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: [konrad.podczeck@univie.ac.at: flyspell bug] Date: Sat, 21 Oct 2006 15:47:58 +0200 Message-ID: <453A250E.3030306@gmx.at> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030106020405050001060707" X-Trace: sea.gmane.org 1161438618 21837 80.91.229.2 (21 Oct 2006 13:50:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 21 Oct 2006 13:50:18 +0000 (UTC) Cc: konrad.podczeck@univie.ac.at, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 21 15:50:16 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GbHEs-0002OR-Mn for ged-emacs-devel@m.gmane.org; Sat, 21 Oct 2006 15:50:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GbHEs-0002Ds-8a for ged-emacs-devel@m.gmane.org; Sat, 21 Oct 2006 09:50:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GbHE7-0001Q8-BB for emacs-devel@gnu.org; Sat, 21 Oct 2006 09:49:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GbHE5-0001L5-5d for emacs-devel@gnu.org; Sat, 21 Oct 2006 09:49:26 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GbHE4-0001KI-Ss for emacs-devel@gnu.org; Sat, 21 Oct 2006 09:49:24 -0400 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.52) id 1GbHE4-0002JF-Iv for emacs-devel@gnu.org; Sat, 21 Oct 2006 09:49:24 -0400 Original-Received: (qmail invoked by alias); 21 Oct 2006 13:49:22 -0000 Original-Received: from N768P019.adsl.highway.telekom.at (EHLO [62.47.39.243]) [62.47.39.243] by mail.gmx.net (mp042) with SMTP; 21 Oct 2006 15:49:22 +0200 X-Authenticated: #14592706 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en Original-To: rms@gnu.org In-Reply-To: X-Y-GMX-Trusted: 0 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:60990 Archived-At: This is a multi-part message in MIME format. --------------030106020405050001060707 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit > The recent incorporation into flyspell-large-region of checking for > duplicated words has led to the following bug: > > If a large region contains text of the form: > > x$ $y > > or of the form > > x# #y > > (where x and y may be any words and there may be multiple white spaces > between the $'s or #'s), > then flyspell-large-region makes Emacs hanging (i.e. I have to press > Ctrl-g to make Emacs running again). > > > I regard the following as a flyspell bug, too: If duplicated words are > separated by more than one white space, then they are not detected. The attached patch tries to address these issues. Please make sure that it doesn't break anything else. --------------030106020405050001060707 Content-Type: text/plain; name="flyspell.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="flyspell.patch" *** flyspell.el Sat Oct 21 11:36:32 2006 --- flyspell.el Sat Oct 21 15:44:44 2006 *************** *** 1011,1021 **** (not (memq (char-after (1- start)) '(?\} ?\\))))) flyspell-mark-duplications-flag (save-excursion ! (goto-char (1- start)) ! (let ((p (flyspell-word-search-backward ! word ! (- start (1+ (- end start)))))) ! (and p (/= p (1- start)))))) ;; yes, this is a doublon (flyspell-highlight-incorrect-region start end 'doublon) nil) --- 1011,1022 ---- (not (memq (char-after (1- start)) '(?\} ?\\))))) flyspell-mark-duplications-flag (save-excursion ! (goto-char start) ! (let* ((bound ! (- start (- end start) (- (skip-chars-backward " \t\n\f")))) ! (p (when (>= bound (point-min)) ! (flyspell-word-search-backward word bound)))) ! (and p (/= p start))))) ;; yes, this is a doublon (flyspell-highlight-incorrect-region start end 'doublon) nil) *************** *** 1472,1478 **** (flyspell-word) ; Make sure current word is checked (backward-word 1) (while (and (< (point) end) ! (re-search-forward "\\b\\([^ \n\t]+\\)[ \n\t]+\\1\\b" end 'move)) (flyspell-word) (backward-word 1)) --- 1473,1479 ---- (flyspell-word) ; Make sure current word is checked (backward-word 1) (while (and (< (point) end) ! (re-search-forward "\\(\\w+\\)\\s-+\\1\\>" end 'move)) (flyspell-word) (backward-word 1)) *************** *** 1708,1714 **** ;; now we can use a new overlay (setq flyspell-overlay (make-flyspell-overlay ! beg end 'flyspell-incorrect 'highlight))))))) ;;*---------------------------------------------------------------------*/ ;;* flyspell-highlight-duplicate-region ... */ --- 1709,1717 ---- ;; now we can use a new overlay (setq flyspell-overlay (make-flyspell-overlay ! beg end ! (if (eq poss 'doublon) 'flyspell-duplicate 'flyspell-incorrect) ! 'highlight))))))) ;;*---------------------------------------------------------------------*/ ;;* flyspell-highlight-duplicate-region ... */ --------------030106020405050001060707 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --------------030106020405050001060707--