GNU bug report logs - #16800
24.3; flyspell works slow on very short words at the end of big file

Previous Next

Package: emacs;

Reported by: Aleksey Cherepanov <aleksey.4erepanov <at> gmail.com>

Date: Tue, 18 Feb 2014 20:59:02 UTC

Severity: normal

Found in version 24.3

Fixed in version 24.5

Done: Agustin Martin <agustin6martin <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Aleksey Cherepanov <aleksey.4erepanov <at> gmail.com>
To: Agustin Martin <agustin.martin <at> hispalinux.es>
Cc: 16800 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: bug#16800: 24.3; flyspell works slow on very short words at the end of big file
Date: Mon, 24 Feb 2014 00:39:58 +0400
On Sun, Feb 23, 2014 at 02:26:00AM +0100, Agustin Martin wrote:
> --- flyspell.el.orig	2014-02-23 02:17:03.680107519 +0100
> +++ flyspell.el	2014-02-23 02:50:50.634625248 +0100
> @@ -1050,8 +1050,19 @@
>    (save-excursion
>      (let ((r '())
>  	  (inhibit-point-motion-hooks t)
> +	  (flyspell-not-casechars (flyspell-get-not-casechars))
>  	  p)
> -      (while (and (not r) (setq p (search-backward word bound t)))
> +      (while 
> +	  (and (not r) 
> +	       (setq p 
> +		     (re-search-backward
> +		      (concat
> +		       "\\(" flyspell-not-casechars "\\|\\b\\)"
> +		       "\\(" word "\\)"
> +		       flyspell-not-casechars
> +		       )
> +		      bound t)))
> +	(goto-char (match-beginning 2))

I am not yet sure that it is important. But as written we store
position - 1 instead of position if we matched with
flyspell-not-casechars branch. (goto-char ...) could be placed
inside (setq p ...) to fix it:
(setq p
      (and
        (re-search ...)
        (goto-char ...)))
I do not know real difference yet though.

Respectively we store position + 1 in forward search.

Thanks!

-- 
Regards,
Aleksey Cherepanov




This bug report was last modified 10 years and 137 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.