From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/30682 Path: main.gmane.org!not-for-mail From: Alex Tomlinson Newsgroups: gmane.emacs.gnus.general Subject: BUG: ispell appears to hang. FIX: change ispell-skip-region-alist. Date: 04 May 2000 17:41:02 -0500 Sender: owner-ding@hpc.uh.edu Message-ID: <82hfcekkg1.fsf_-_@atbsd.netpliance.net> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035167183 9749 80.91.224.250 (21 Oct 2002 02:26:23 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 02:26:23 +0000 (UTC) Return-Path: Original-Received: from lisa.math.uh.edu (lisa.math.uh.edu [129.7.128.49]) by mailhost.sclp.com (Postfix) with ESMTP id 9C47BD051E for ; Thu, 4 May 2000 18:28:02 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by lisa.math.uh.edu (8.9.1/8.9.1) with ESMTP id RAB16822; Thu, 4 May 2000 17:27:54 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 04 May 2000 17:27:04 -0500 (CDT) Original-Received: from mailhost.sclp.com (postfix@[204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id RAA01463 for ; Thu, 4 May 2000 17:26:54 -0500 (CDT) Original-Received: from shbang1.netpliance.net (shbang1.netpliance.net [216.136.56.34]) by mailhost.sclp.com (Postfix) with ESMTP id 9F473D051E for ; Thu, 4 May 2000 18:25:46 -0400 (EDT) Original-Received: from atbsd.netpliance.net ([216.136.56.83]) by shbang1.netpliance.net with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2448.0) id KJG6QRJD; Thu, 4 May 2000 17:21:47 -0500 Original-Received: (from alext@localhost) by atbsd.netpliance.net (8.9.3/8.9.3) id RAA17978; Thu, 4 May 2000 17:41:02 -0500 X-Authentication-Warning: atbsd.netpliance.net: alext set sender to alext@netpliance.com using -f Original-To: ding@gnus.org In-Reply-To: Shenghuo ZHU's message of "04 May 2000 17:52:58 -0400" Original-Lines: 86 User-Agent: Gnus/5.0803 (Gnus v5.8.3) XEmacs/21.1 (Bryce Canyon) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:30682 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:30682 I posted this message to: comp.emacs.xemacs gnu.emacs.gnus ispell-el-bugs@itcorp.com I'm sending it to this list because it affects gnus users who run ispell on outgoing messages. Original message follows. ================================================================ The default definition for ispell-skip-region-alist contains a regexp to skip computer names. Its form is "\\(/\\|\\(\\(\\w\\|-\\)+[.:@]\\)\\)\\(\\w\\|-\\)*\\([.:/@]+\\(\\w\\|-\\|~\\)+\\)+" In certain cases, the regexp causes 're-search-forward' to take so long that it appears to hang ispell. The problem occurs when the hyphen char (-) is part of the word syntax class (\\w) and if the buffer contains a string of hyphens. For example, run M-x modify-syntax-entry - w to put '-' into the word class. Then set up a buffer with the following text -------------------------------------------- Running ispell-buffer on that buffer takes way too long. If you system is fast, try a longer string. Shorten the string to lengh 8: -------- And it will finish in reasonable time. My fix was to simplify the expression to: "[/a-zA-Z0-9][-.:_a-zA-Z0-9]*[@/][-.:_a-zA-Z0-9@/~]+" which is probably mis-matches on occasion, but it's a lot faster! You can do this by adding this to your .emacs file: ;; The default definition for ispell-skip-region-alist is horribly ;; inefficent if '-' happens to be in the word syntax class. To test, ;; run ispell with the default definition on a buffer that contains a ;; string like this: "----------------------". You'll have to wait a ;; minute or more to search for the regexp. Do it again with a shorter ;; string (eg, "----------") and you'll notice it will be a bit faster, ;; but still slow. The culprit is a bunch of "\\(\\w|-\\)+" in the ;; default regexp. (setq ispell-skip-region-alist '((ispell-words-keyword forward-line) (ispell-dictionary-keyword forward-line) (ispell-pdict-keyword forward-line) (ispell-parsing-keyword forward-line) ("^---*BEGIN PGP [A-Z ]*--*" . "^---*END PGP [A-Z ]*--*") ("^---* \\(Start of \\)?[Ff]orwarded" . "^---* End of [Ff]orwarded") ;; identifying computer names and urls ("[/a-zA-Z0-9][-.:_a-zA-Z0-9]*[@/][-.:_a-zA-Z0-9@/~]+"))) I'm running xemacs with this version (taken from xemacs/xemacs-packages/lisp/ispell/ispell.el): ;; Copyright (C) 1994, 1995, 1997, 1998, 1999 Free Software Foundation, Inc. ;; Authors : Ken Stevens ;; Stevens Mod Date: Mon 29 Nov 11:38:34 PST 1999 ;; Stevens Revision: 3.3 ;; Status : Release with 3.1.12+ and 3.2.0+ ispell. ;; Bug Reports : ispell-el-bugs@itcorp.com ;; Web Site : http://kdstevens.com/~stevens/ispell-page.html -- Alex Tomlinson Netpliance, Inc., 7600-A N. Hwy 360, Austin, TX 78731 Tel:512-493-8337, FAX:512-493-8399, http://www.netpliance.net