From unknown Sat Aug 16 18:40:00 2025 X-Loop: don@donarmstrong.com Subject: bug#496: 23.0.60; ispell-word becomes increasingly slower Reply-To: Markus Triska , 496@debbugs.gnu.org Resent-From: Markus Triska Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 28 Jun 2008 00:45:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 496 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.121461332128729 (code B ref -1); Sat, 28 Jun 2008 00:45:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-3.3 required=4.0 tests=AWL,BAYES_00,FOURLA, FVGT_m_MULTI_ODD,PHONENUMBER,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 28 Jun 2008 00:35:21 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5S0ZHJd028460 for ; Fri, 27 Jun 2008 17:35:19 -0700 Received: from mail.gnu.org ([199.232.76.166]:46906 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KCOPC-0007eu-2c for emacs-pretest-bug@gnu.org; Fri, 27 Jun 2008 20:35:06 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KCOHP-0001hv-MQ for emacs-pretest-bug@gnu.org; Fri, 27 Jun 2008 20:27:08 -0400 Received: from mail.gmx.net ([213.165.64.20]:53357) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1KCOHP-0001hm-AR for emacs-pretest-bug@gnu.org; Fri, 27 Jun 2008 20:27:03 -0400 Received: (qmail invoked by alias); 28 Jun 2008 00:27:01 -0000 Received: from chello062178240212.3.14.tuwien.teleweb.at (EHLO mt-computer.local) [62.178.240.212] by mail.gmx.net (mp030) with SMTP; 28 Jun 2008 02:27:01 +0200 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX182+3Vp+Ng2/zjD39PQEKiaNlrLv1nfCPMFa4Igex gvAiMAK+Sh/z34 Received: by mt-computer.local (Postfix, from userid 502) id A4921924848; Sat, 28 Jun 2008 02:26:55 +0200 (CEST) From: Markus Triska To: emacs-pretest-bug@gnu.org Message-Id: <20080628002655.A4921924848@mt-computer.local> Date: Sat, 28 Jun 2008 02:26:55 +0200 (CEST) X-Y-GMX-Trusted: 0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) When I save the following form to test.el: (let ((n 0)) (with-temp-buffer (insert "test") (while t (setq n (1+ n)) (when (= (mod n 100) 0) (message "n: %s -- %s" n (emacs-uptime))) (ispell-word nil t)))) and then do "emacs -Q --script test.el", I get: Starting new Ispell process [default] ... n: 100 -- 0 seconds n: 200 -- 0 seconds n: 300 -- 0 seconds n: 400 -- 0 seconds n: 500 -- 1 second n: 600 -- 1 second n: 700 -- 1 second n: 800 -- 1 second n: 900 -- 1 second n: 1000 -- 1 second n: 1100 -- 1 second n: 1200 -- 1 second n: 1300 -- 1 second n: 1400 -- 1 second n: 1500 -- 1 second n: 1600 -- 1 second n: 1700 -- 1 second n: 1800 -- 1 second n: 1900 -- 1 second n: 2000 -- 1 second ... n: 52400 -- 3 minutes, 12 seconds n: 52500 -- 3 minutes, 13 seconds n: 52600 -- 3 minutes, 14 seconds n: 52700 -- 3 minutes, 15 seconds .. n: 70500 -- 8 minutes, 30 seconds n: 70600 -- 8 minutes, 31 seconds n: 70700 -- 8 minutes, 33 seconds n: 70800 -- 8 minutes, 35 seconds n: 70900 -- 8 minutes, 36 seconds n: 71000 -- 8 minutes, 38 seconds ... i.e., the program becomes increasingly slower, from many iterations per second to several seconds per iteration. With "top", I also see that aspell uses increasingly more memory. I can reproduce this on Fedora Core 9 and OSX 10.4 with Aspell 0.60.5. In a simplified test to check for memory leaks in aspell, I did: $ while true; do echo "test"; done | aspell -a and in this case, aspell's memory usage seems to stay constant. In GNU Emacs 23.0.60.1 (i386-apple-darwin8.11.1, GTK+ Version 2.12.9) of 2008-06-15 on mt-computer.local Windowing system distributor `The XFree86 Project, Inc', version 11.0.40400000 Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: nil value of $XMODIFIERS: nil locale-coding-system: nil default-enable-multibyte-characters: t From unknown Sat Aug 16 18:40:00 2025 X-Loop: don@donarmstrong.com Subject: bug#496: 23.0.60; ispell-word becomes increasingly slower Reply-To: Eli Zaretskii , 496@debbugs.gnu.org Resent-From: Eli Zaretskii Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 28 Jun 2008 07:30:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 496 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.121463762131598 (code B ref -1); Sat, 28 Jun 2008 07:30:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-8.2 required=4.0 tests=AWL,BAYES_00,FOURLA, FVGT_m_MULTI_ODD,HAS_BUG_NUMBER,PHONENUMBER,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 28 Jun 2008 07:20:21 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5S7KGMr031482 for ; Sat, 28 Jun 2008 00:20:17 -0700 Received: from mail.gnu.org ([199.232.76.166]:59416 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KCUj6-0005KQ-Bg for emacs-pretest-bug@gnu.org; Sat, 28 Jun 2008 03:20:04 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KCUjD-0002Le-Gi for emacs-pretest-bug@gnu.org; Sat, 28 Jun 2008 03:20:15 -0400 Received: from mx20.gnu.org ([199.232.41.8]:34988) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KCUjC-0002La-VT; Sat, 28 Jun 2008 03:20:11 -0400 Received: from mtaout3.012.net.il ([84.95.2.7]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KCUjC-0003FN-D3; Sat, 28 Jun 2008 03:20:10 -0400 Received: from HOME-C4E4A596F7 ([80.230.31.196]) by i_mtaout3.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0K35003VGX2THTE4@i_mtaout3.012.net.il>; Sat, 28 Jun 2008 10:35:18 +0300 (IDT) Date: Sat, 28 Jun 2008 10:20:00 +0300 From: Eli Zaretskii In-reply-to: <20080628002655.A4921924848@mt-computer.local> X-012-Sender: halo1@inter.net.il To: Markus Triska , 496@debbugs.gnu.org Cc: emacs-pretest-bug@gnu.org, bug-submit-list@donarmstrong.com, bug-gnu-emacs@gnu.org Message-id: References: <20080628002655.A4921924848@mt-computer.local> X-detected-kernel: by mx20.gnu.org: Solaris 9.1 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) > Resent-From: Markus Triska > Resent-To: bug-submit-list@donarmstrong.com > Resent-CC: Emacs Bugs > Resent-Sender: don@donarmstrong.com > From: Markus Triska > Date: Sat, 28 Jun 2008 02:26:55 +0200 (CEST) > Cc: > > > When I save the following form to test.el: > > (let ((n 0)) > (with-temp-buffer > (insert "test") > (while t > (setq n (1+ n)) > (when (= (mod n 100) 0) > (message "n: %s -- %s" n (emacs-uptime))) > (ispell-word nil t)))) > > and then do "emacs -Q --script test.el", I get: > > Starting new Ispell process [default] ... > n: 100 -- 0 seconds > n: 200 -- 0 seconds > n: 300 -- 0 seconds > n: 400 -- 0 seconds > n: 500 -- 1 second > n: 600 -- 1 second > n: 700 -- 1 second > n: 800 -- 1 second > n: 900 -- 1 second > n: 1000 -- 1 second > n: 1100 -- 1 second > n: 1200 -- 1 second > n: 1300 -- 1 second > n: 1400 -- 1 second > n: 1500 -- 1 second > n: 1600 -- 1 second > n: 1700 -- 1 second > n: 1800 -- 1 second > n: 1900 -- 1 second > n: 2000 -- 1 second > ... > n: 52400 -- 3 minutes, 12 seconds > n: 52500 -- 3 minutes, 13 seconds > n: 52600 -- 3 minutes, 14 seconds > n: 52700 -- 3 minutes, 15 seconds > .. > n: 70500 -- 8 minutes, 30 seconds > n: 70600 -- 8 minutes, 31 seconds > n: 70700 -- 8 minutes, 33 seconds > n: 70800 -- 8 minutes, 35 seconds > n: 70900 -- 8 minutes, 36 seconds > n: 71000 -- 8 minutes, 38 seconds > ... > > i.e., the program becomes increasingly slower, from many iterations > per second to several seconds per iteration. With "top", I also see > that aspell uses increasingly more memory. I can reproduce this on > Fedora Core 9 and OSX 10.4 with Aspell 0.60.5. In a simplified test to > check for memory leaks in aspell, I did: > > $ while true; do echo "test"; done | aspell -a > > and in this case, aspell's memory usage seems to stay constant. Garbage collection? From unknown Sat Aug 16 18:40:00 2025 X-Loop: don@donarmstrong.com Subject: bug#496: 23.0.60; ispell-word becomes increasingly slower Reply-To: Markus Triska , 496@debbugs.gnu.org Resent-From: Markus Triska Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 28 Jun 2008 09:35:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 496 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.121464516530374 (code B ref -1); Sat, 28 Jun 2008 09:35:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-4.4 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_DNSWL_LOW autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 28 Jun 2008 09:26:05 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5S9Q1CX030363 for ; Sat, 28 Jun 2008 02:26:03 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KCWgz-0004fW-BM for bug-gnu-emacs@gnu.org; Sat, 28 Jun 2008 05:26:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KCWgw-0004aI-Ml for bug-gnu-emacs@gnu.org; Sat, 28 Jun 2008 05:26:00 -0400 Received: from [199.232.76.173] (port=59208 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KCWgw-0004Zf-Ci for bug-gnu-emacs@gnu.org; Sat, 28 Jun 2008 05:25:58 -0400 Received: from mail.gmx.net ([213.165.64.20]:41589) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1KCWgv-0005hU-TC for bug-gnu-emacs@gnu.org; Sat, 28 Jun 2008 05:25:58 -0400 Received: (qmail invoked by alias); 28 Jun 2008 09:25:56 -0000 Received: from chello062178240212.3.14.tuwien.teleweb.at (EHLO mt-computer.local) [62.178.240.212] by mail.gmx.net (mp063) with SMTP; 28 Jun 2008 11:25:56 +0200 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX1/lsDZW0yrliLCbzjw9eLI2b8gycrsILYKywTqqTV TBKAtpO5o9CNZz Received: by mt-computer.local (Postfix, from userid 502) id EDEB7924944; Sat, 28 Jun 2008 11:25:48 +0200 (CEST) From: Markus Triska To: Eli Zaretskii Cc: 496@debbugs.gnu.org, emacs-pretest-bug@gnu.org, bug-submit-list@donarmstrong.com, bug-gnu-emacs@gnu.org References: <20080628002655.A4921924848@mt-computer.local> Date: Sat, 28 Jun 2008 11:25:48 +0200 In-Reply-To: (Eli Zaretskii's message of "Sat, 28 Jun 2008 10:20:00 +0300") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Y-GMX-Trusted: 0 X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Eli Zaretskii writes: >> check for memory leaks in aspell, I did: >> >> $ while true; do echo "test"; done | aspell -a >> >> and in this case, aspell's memory usage seems to stay constant. > > Garbage collection? I've received a better test case from the Aspell maintainer: ( while true; do echo '!'; echo "-"; echo "%"; echo "^test"; done ) | aspell -a According to him, it is the constant switching of modes that is causing a problem. He notes: "I have narrowed down the problem code. Technically it is not a leak as the code is still reachable (according to valgrind), which makes it harder to fix. I will let you know." It is thus more an Aspell problem, but if it cannot be fixed in Aspell, I will look whether the Emacs side of communication can be improved. From unknown Sat Aug 16 18:40:00 2025 X-Loop: don@donarmstrong.com Subject: bug#496: 23.0.60; ispell-word becomes increasingly slower Reply-To: Eli Zaretskii , 496@debbugs.gnu.org Resent-From: Eli Zaretskii Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 28 Jun 2008 15:15:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 496 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.121466552317491 (code B ref -1); Sat, 28 Jun 2008 15:15:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-9.0 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 28 Jun 2008 15:05:23 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5SF5FJi017368 for ; Sat, 28 Jun 2008 08:05:17 -0700 Received: from mx10.gnu.org ([199.232.76.166]:52889) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KCbz5-0006je-Dt for emacs-pretest-bug@gnu.org; Sat, 28 Jun 2008 11:05:03 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KCbzC-0004Iu-9U for emacs-pretest-bug@gnu.org; Sat, 28 Jun 2008 11:05:15 -0400 Received: from mtaout1.012.net.il ([84.95.2.1]:42079) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KCbzB-0004IW-TX; Sat, 28 Jun 2008 11:05:10 -0400 Received: from HOME-C4E4A596F7 ([80.230.31.196]) by i-mtaout1.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0K3600HE0IK8PTV0@i-mtaout1.012.net.il>; Sat, 28 Jun 2008 18:19:21 +0300 (IDT) Date: Sat, 28 Jun 2008 18:04:02 +0300 From: Eli Zaretskii In-reply-to: X-012-Sender: halo1@inter.net.il To: Markus Triska Cc: 496@debbugs.gnu.org, emacs-pretest-bug@gnu.org, bug-submit-list@donarmstrong.com, bug-gnu-emacs@gnu.org Message-id: References: <20080628002655.A4921924848@mt-computer.local> X-detected-kernel: by monty-python.gnu.org: Solaris 9.1 > From: Markus Triska > Cc: 496@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org, > bug-submit-list@donarmstrong.com, bug-gnu-emacs@gnu.org > Date: Sat, 28 Jun 2008 11:25:48 +0200 > > Eli Zaretskii writes: > > >> check for memory leaks in aspell, I did: > >> > >> $ while true; do echo "test"; done | aspell -a > >> > >> and in this case, aspell's memory usage seems to stay constant. > > > > Garbage collection? > > I've received a better test case from the Aspell maintainer: > > ( while true; do echo '!'; echo "-"; echo "%"; echo "^test"; done ) | aspell -a > > According to him, it is the constant switching of modes that is causing > a problem. He notes: > > "I have narrowed down the problem code. Technically it is not a leak > as the code is still reachable (according to valgrind), which makes > it harder to fix. I will let you know." > > It is thus more an Aspell problem, but if it cannot be fixed in Aspell, > I will look whether the Emacs side of communication can be improved. But your test.el shows a similar problem with Ispell. So either Aspell and Ispell share the same problem, or Emacs still has something to do with the slowdown. From unknown Sat Aug 16 18:40:00 2025 X-Loop: don@donarmstrong.com Subject: bug#496: 23.0.60; ispell-word becomes increasingly slower Reply-To: Markus Triska , 496@debbugs.gnu.org Resent-From: Markus Triska Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 28 Jun 2008 15:30:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 496 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.121466652921398 (code B ref -1); Sat, 28 Jun 2008 15:30:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-8.3 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 28 Jun 2008 15:22:09 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5SFM5i6021382 for ; Sat, 28 Jun 2008 08:22:06 -0700 Received: from mx10.gnu.org ([199.232.76.166]:53630) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KCcFM-0001nK-Pj for emacs-pretest-bug@gnu.org; Sat, 28 Jun 2008 11:21:52 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KCcFU-0006yp-Ns for emacs-pretest-bug@gnu.org; Sat, 28 Jun 2008 11:22:04 -0400 Received: from mail.gmx.net ([213.165.64.20]:55514) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1KCcFU-0006yZ-5a for emacs-pretest-bug@gnu.org; Sat, 28 Jun 2008 11:22:00 -0400 Received: (qmail invoked by alias); 28 Jun 2008 15:21:59 -0000 Received: from pnsgw1-client184.demo.tuwien.ac.at (EHLO pnsgw1-client184.demo.tuwien.ac.at) [128.131.200.184] by mail.gmx.net (mp046) with SMTP; 28 Jun 2008 17:21:59 +0200 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX1+PHWNOIp+PBX3mshMXSImVuAEQV9V+TSZl75dO1O lsuMi3rX+zIDP3 Received: by pnsgw1-client184.demo.tuwien.ac.at (Postfix, from userid 502) id 17B1A9296D4; Sat, 28 Jun 2008 17:21:52 +0200 (CEST) From: Markus Triska To: Eli Zaretskii Cc: 496@debbugs.gnu.org, emacs-pretest-bug@gnu.org, bug-submit-list@donarmstrong.com, bug-gnu-emacs@gnu.org References: <20080628002655.A4921924848@mt-computer.local> Date: Sat, 28 Jun 2008 17:21:52 +0200 In-Reply-To: (Eli Zaretskii's message of "Sat, 28 Jun 2008 18:04:02 +0300") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Y-GMX-Trusted: 0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-CrossAssassin-Score: 2 Eli Zaretskii writes: > your test.el shows a similar problem with Ispell. So either Aspell and > Ispell share the same problem, or Emacs still has something to do with > the slowdown. Aspell's maintainer Kevin Atkinson has generously sent me the following patch for Aspell that fixes the problem for me with the latest CVS version of Aspell. He says it will be in Aspell 0.60.7. Here's a simpler test case for the problem in versions up to 0.60.6: while true; do echo "-"; done | aspell -a Index: common/config.cpp =================================================================== RCS file: /sources/aspell/aspell/common/config.cpp,v retrieving revision 1.79 diff -u -r1.79 config.cpp --- common/config.cpp 12 Oct 2007 00:33:17 -0000 1.79 +++ common/config.cpp 28 Jun 2008 10:42:10 -0000 @@ -1000,7 +1000,7 @@ } assert(ki->def != 0); // if null this key should never have values - // directly added to it + // directly added to it String value(entry->action == Reset ? get_default(ki) : entry->value); switch (ki->type) { @@ -1027,11 +1027,13 @@ goto error; } + clear_others(entry); NOTIFY_ALL(item_updated(ki, val)); break; } case KeyInfoString: + clear_others(entry); NOTIFY_ALL(item_updated(ki, value)); break; @@ -1040,6 +1042,7 @@ int num; if (sscanf(value.str(), "%i", &num) == 1 && num >= 0) { + clear_others(entry); NOTIFY_ALL(item_updated(ki, num)); } else { pe = make_err(bad_value, entry->key, value, _("a positive integer")); @@ -1049,6 +1052,9 @@ break; } case KeyInfoList: + + if (entry->action == ListSet || entry->action == ListClear) + clear_others(entry); NOTIFY_ALL(list_updated(ki)); break; @@ -1064,6 +1070,26 @@ return (PosibErrBase &)pe; } + // Delete all previous entries with the same key + void Config::clear_others(Entry * entry) { + + String & key = entry->key; + //printf("Clear Others For %s\n", key.c_str()); + Entry * * cur = &first_; + while (*cur != entry) { + assert(*cur != *insert_point_); + if ((*cur)->key == key) { + //printf("JAP \"%s\"!\n", (*cur)->value.c_str()); + Entry * tmp = *cur; + *cur = (*cur)->next; + delete tmp; + } else { + cur = &(*cur)->next; + } + } + + } + #undef NOTIFY_ALL Index: common/config.hpp =================================================================== RCS file: /sources/aspell/aspell/common/config.hpp,v retrieving revision 1.27 diff -u -r1.27 config.hpp --- common/config.hpp 3 May 2005 05:08:19 -0000 1.27 +++ common/config.hpp 28 Jun 2008 10:42:10 -0000 @@ -132,6 +132,8 @@ PosibErr commit(Entry * entry, Conv * conv = 0); + void clear_others(Entry * entry); + bool settings_read_in_; public: