From unknown Sun Jun 22 11:35:39 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#69703 <69703@debbugs.gnu.org> To: bug#69703 <69703@debbugs.gnu.org> Subject: Status: Ispell process restarted too often Reply-To: bug#69703 <69703@debbugs.gnu.org> Date: Sun, 22 Jun 2025 18:35:39 +0000 retitle 69703 Ispell process restarted too often reassign 69703 emacs submitter 69703 Juri Linkov severity 69703 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 10 03:46:16 2024 Received: (at submit) by debbugs.gnu.org; 10 Mar 2024 07:46:16 +0000 Received: from localhost ([127.0.0.1]:35405 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjDst-0001q6-RI for submit@debbugs.gnu.org; Sun, 10 Mar 2024 03:46:16 -0400 Received: from lists.gnu.org ([209.51.188.17]:40816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjDsp-0001px-W8 for submit@debbugs.gnu.org; Sun, 10 Mar 2024 03:46:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjDsI-00014r-Iu for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 03:45:38 -0400 Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjDsG-0000s3-Fn for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 03:45:38 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id E663440003 for ; Sun, 10 Mar 2024 07:45:30 +0000 (UTC) From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: Ispell process restarted too often Organization: LINKOV.NET Date: Sun, 10 Mar 2024 09:37:20 +0200 Message-ID: <86y1aqh70o.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net Received-SPF: pass client-ip=2001:4b98:dc4:8::222; envelope-from=juri@linkov.net; helo=relay2-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) When different projects have different personal dictionaries and flyspell mode is used, then ispell process is killed and restarted almost on every key press. This creates hundreds of hunspell processes that soon fill all available memory. Is it possible to fix this? Here is an example of project-local .dir-locals.el: ((nil . ((ispell-personal-dictionary . "/tmp/test/.hunspell") (mode . flyspell)))) Example of backtrace after switching buffers with different personal dictionaries: ispell-kill-ispell(t) ispell-internal-change-dictionary() ispell-buffer-local-dict() ispell-accept-buffer-local-defs() flyspell-accept-buffer-local-defs() flyspell-word() flyspell-check-changes() Also tried to make the ispell process buffer-local with: (make-variable-buffer-local 'ispell-process) (make-variable-buffer-local 'ispell-current-personal-dictionary) But this is worse and caused more problems: Error enabling Flyspell mode: (Buffer *temp* has no process) flyspell-mode() set-auto-mode-0(flyspell-mode t) hack-one-local-variable(mode flyspell) hack-local-variables-apply() hack-dir-local-variables-non-file-buffer() project--value-in-dir(project-vc-name "/tmp/test/") project-name((vc Git "/tmp/test/")) project-mode-line-format() eval((project-mode-line-format) t) redisplay_internal\ \(C\ function\)() From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 10 04:07:40 2024 Received: (at 69703) by debbugs.gnu.org; 10 Mar 2024 08:07:40 +0000 Received: from localhost ([127.0.0.1]:35579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjEDc-0005Nx-4W for submit@debbugs.gnu.org; Sun, 10 Mar 2024 04:07:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35082) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjEDY-0005Nj-KV for 69703@debbugs.gnu.org; Sun, 10 Mar 2024 04:07:38 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjECv-0004pO-2U; Sun, 10 Mar 2024 04:06:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=asuzms9uXfGMwrn6ClTbuLg5hUMBVsgtm/BbFprJcYs=; b=Doswm4uo0ryz 5iLRht/fsIkHt5HW3yMuaL1iIRk+VkSep8bdjtTVGO7s1urlu4yWHhvz4FxAV/h+pJ+soL24a2S2s wCFg//jY/oyZ/64OHEc8XBr17CHqeL34i6uGKJcj2QtBRre+GUx1rl7gDi6gJZ1uO0QNmlUibsi9q +VUiO7MeEeJy8dsOyHk9ncVnzHPjvxjGbAMP5DQE8PaEasSur0Smq0efxUttXH7vv30Mxn406A4SE Hck6/5pMP6XwTi5vKNf/4iTzT1+jdpCSLRqBPu7F8MvgrQVnq6Gdg46IbPtHUfNmSVzXT/e0A2LqX mb4emlSyDLorF8Gl7CoVfw==; Date: Sun, 10 Mar 2024 10:06:50 +0200 Message-Id: <86bk7mwlwl.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <86y1aqh70o.fsf@mail.linkov.net> (message from Juri Linkov on Sun, 10 Mar 2024 09:37:20 +0200) Subject: Re: bug#69703: Ispell process restarted too often References: <86y1aqh70o.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69703 Cc: 69703@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Date: Sun, 10 Mar 2024 09:37:20 +0200 > > When different projects have different personal dictionaries > and flyspell mode is used, then ispell process is killed and restarted > almost on every key press. This creates hundreds of hunspell processes > that soon fill all available memory. If the speller process is killed each time before starting a new one, how come there's more than just one running at any given time? IOW, how come you have "hundreds of hunspell processes" in memory? Does killing a hunspell process fail for some reason? And why are you saying "almost on every key press"? are different personal dictionaries defined for different portions of text in some way? Otherwise, I'd expect hunspell to be restarted when you change buffers, whuch is hardly "on every key press". Or what am I missing? > Is it possible to fix this? Not easily, AFAIR. But I don't think I understand the nature of the problem you are experiencing, see above. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 10 13:33:20 2024 Received: (at 69703) by debbugs.gnu.org; 10 Mar 2024 17:33:20 +0000 Received: from localhost ([127.0.0.1]:37809 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjN32-00086B-BI for submit@debbugs.gnu.org; Sun, 10 Mar 2024 13:33:20 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:56131) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjN30-00085u-Lb for 69703@debbugs.gnu.org; Sun, 10 Mar 2024 13:33:19 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 48B6FE0002; Sun, 10 Mar 2024 17:32:38 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#69703: Ispell process restarted too often In-Reply-To: <86bk7mwlwl.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 10 Mar 2024 10:06:50 +0200") Organization: LINKOV.NET References: <86y1aqh70o.fsf@mail.linkov.net> <86bk7mwlwl.fsf@gnu.org> Date: Sun, 10 Mar 2024 19:10:19 +0200 Message-ID: <867cia3z7x.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69703 Cc: 69703@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> When different projects have different personal dictionaries >> and flyspell mode is used, then ispell process is killed and restarted >> almost on every key press. This creates hundreds of hunspell processes >> that soon fill all available memory. > > If the speller process is killed each time before starting a new one, > how come there's more than just one running at any given time? IOW, > how come you have "hundreds of hunspell processes" in memory? Does > killing a hunspell process fail for some reason? Actually, hundreds were when I tried to use buffer-local ispell-process because then ispell-internal-change-dictionary didn't kill ispell-process but ispell-init-process created new processes. But with the default configuration there are "only" a dozen of processes. I guess one process per buffer. And this is even in case when ispell-process is NOT buffer-local. I noticed that all these processes are created after loading the desktop buffers. > And why are you saying "almost on every key press"? are different > personal dictionaries defined for different portions of text in some > way? Otherwise, I'd expect hunspell to be restarted when you change > buffers, whuch is hardly "on every key press". Or what am I missing? On every key press was only when trying to use buffer-local ispell-process. But with the default configuration ispell-process is killed and started "only" on switching buffers that is very annoying since most of the time I see these messages in the echo area: Ispell process killed Starting new Ispell process /usr/bin/hunspell ... Ispell process killed Starting new Ispell process /usr/bin/hunspell ... Ispell process killed Starting new Ispell process /usr/bin/hunspell ... ... >> Is it possible to fix this? > > Not easily, AFAIR. But I don't think I understand the nature of the > problem you are experiencing, see above. The nature of the problem is the inability of ispell.el to maintain multiple processes with different dictionaries simultaneously that is required by flyspell-mode. What is needed here is a hash of processes where the key is the ispell program name and its dictionary arguments. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 10 13:52:09 2024 Received: (at 69703) by debbugs.gnu.org; 10 Mar 2024 17:52:09 +0000 Received: from localhost ([127.0.0.1]:37843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjNLF-0000ED-EQ for submit@debbugs.gnu.org; Sun, 10 Mar 2024 13:52:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43056) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjNLD-0000Dy-K1 for 69703@debbugs.gnu.org; Sun, 10 Mar 2024 13:52:08 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjNKa-0005DN-5v; Sun, 10 Mar 2024 13:51:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=VQ3g/nVZT0r6+ScLyq+5esamDrmNIkaIc+8+XNDdU3A=; b=EKwu+bJjCm5P kI+cDiJLxdZPaoO30l34F5nbrOc61nsSHWC1ef43rabwQG+kvnCCIXBgXoKAWMEgdKNTU4ECNgOQS VJw0EXPxvi8jMEMKvnMEd31vlIc2INRf0XB34V0uG1Afa2lI9NbReR4rnlAsJGhekyD+D9ozDZZ+m CgPBokeJNfos5TiXBx+S4hnFLpMdtvDQZC6tSuD6dchT38pUvBWsBN7hjJ0Xws4cksbXS3K3P64jt Mpvq7WqylUG0VZ0ABK63eBT0zqDWalZoTrFG8RI0M135G1oqjGhWxFbXr/2eLtz6P/5J73RLq9Itd BwNTz9Qrd33rMGGsKrIVEw==; Date: Sun, 10 Mar 2024 19:51:20 +0200 Message-Id: <86sf0yug9z.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <867cia3z7x.fsf@mail.linkov.net> (message from Juri Linkov on Sun, 10 Mar 2024 19:10:19 +0200) Subject: Re: bug#69703: Ispell process restarted too often References: <86y1aqh70o.fsf@mail.linkov.net> <86bk7mwlwl.fsf@gnu.org> <867cia3z7x.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69703 Cc: 69703@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Cc: 69703@debbugs.gnu.org > Date: Sun, 10 Mar 2024 19:10:19 +0200 > > > If the speller process is killed each time before starting a new one, > > how come there's more than just one running at any given time? IOW, > > how come you have "hundreds of hunspell processes" in memory? Does > > killing a hunspell process fail for some reason? > > Actually, hundreds were when I tried to use buffer-local ispell-process > because then ispell-internal-change-dictionary didn't kill ispell-process > but ispell-init-process created new processes. > > But with the default configuration there are "only" a dozen of processes. That's also unexpected. There should be only one. > I guess one process per buffer. And this is even in case when ispell-process > is NOT buffer-local. I noticed that all these processes are created > after loading the desktop buffers. Please show a reproduction recipe, as I didn't know this is possible. > But with the default configuration ispell-process is killed and started > "only" on switching buffers that is very annoying since most of the time > I see these messages in the echo area: > > Ispell process killed > Starting new Ispell process /usr/bin/hunspell ... > Ispell process killed > Starting new Ispell process /usr/bin/hunspell ... > Ispell process killed > Starting new Ispell process /usr/bin/hunspell ... If the problem is with the messages, it can be easily solved by adding some optional feature. But I understand there are more urgent issues, so let's discuss those first, okay? > > Not easily, AFAIR. But I don't think I understand the nature of the > > problem you are experiencing, see above. > > The nature of the problem is the inability of ispell.el to maintain > multiple processes with different dictionaries simultaneously > that is required by flyspell-mode. > > What is needed here is a hash of processes where the key is > the ispell program name and its dictionary arguments. Feel free to submit patches for that, and thanks. (But didn't you just complain about one speller process per buffer?) From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 12 04:01:20 2024 Received: (at 69703) by debbugs.gnu.org; 12 Mar 2024 08:01:20 +0000 Received: from localhost ([127.0.0.1]:41739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjx4Z-0001sq-Jw for submit@debbugs.gnu.org; Tue, 12 Mar 2024 04:01:19 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:48853) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjx4U-0001sX-OK for 69703@debbugs.gnu.org; Tue, 12 Mar 2024 04:01:18 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 789CD60002; Tue, 12 Mar 2024 08:00:13 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#69703: Ispell process restarted too often In-Reply-To: <86sf0yug9z.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 10 Mar 2024 19:51:20 +0200") Organization: LINKOV.NET References: <86y1aqh70o.fsf@mail.linkov.net> <86bk7mwlwl.fsf@gnu.org> <867cia3z7x.fsf@mail.linkov.net> <86sf0yug9z.fsf@gnu.org> Date: Tue, 12 Mar 2024 09:45:14 +0200 Message-ID: <867ci7rj05.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69703 Cc: 69703@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> I noticed that all these processes are created >> after loading the desktop buffers. > > Please show a reproduction recipe, as I didn't know this is possible. Here is what happens during loading the desktop: 1. When creating a new file buffer, 'ispell-kill-ispell' is called for every buffer because its personal dictionary is different from the previously restored buffer. 2. Then in the middle of 'ispell-kill-ispell', 'project-mode-line-format' kicks in from 'redisplay_internal'. 3. 'project-mode-line-format' creates a temporary buffer and enables 'flyspell-mode' in it. 4. 'flyspell-mode' creates a new stray process. 5. 'ispell-kill-ispell' that was started at 1 above finishes killing the previous Ispell process. So the processes created by 'flyspell-mode' remain unhandled. Ok, the bug is in 'project-mode-line-format'. I will send a patch to fix it in a separate bug report. >> But with the default configuration ispell-process is killed and started >> "only" on switching buffers that is very annoying since most of the time >> I see these messages in the echo area: >> >> Ispell process killed >> Starting new Ispell process /usr/bin/hunspell ... >> Ispell process killed >> Starting new Ispell process /usr/bin/hunspell ... >> Ispell process killed >> Starting new Ispell process /usr/bin/hunspell ... > > If the problem is with the messages, it can be easily solved by adding > some optional feature. But I understand there are more urgent issues, > so let's discuss those first, okay? Messages is not a problem. Perpetual process restarting causes noticeable performance degradation. Since the bug will be fixed in 'project-mode-line-format', the remaining problems are less urgent. But still the remaining inconvenience is the following: 1. Loading the desktop takes more time since it restarts the Ispell process for the every buffer: Starting new Ispell process... Ispell process killed Starting new Ispell process... Ispell process killed Starting new Ispell process... Ispell process killed Starting new Ispell process... Ispell process killed Starting new Ispell process... 2. Ispell processes still restarted on editing another buffer. >> > Not easily, AFAIR. But I don't think I understand the nature of the >> > problem you are experiencing, see above. >> >> The nature of the problem is the inability of ispell.el to maintain >> multiple processes with different dictionaries simultaneously >> that is required by flyspell-mode. >> >> What is needed here is a hash of processes where the key is >> the ispell program name and its dictionary arguments. > > Feel free to submit patches for that, and thanks. (But didn't you > just complain about one speller process per buffer?) Since implementing this is not urgent, here is a design outline for possible future improvements: 1. Create a pool of Ispell processes. 2. Instead of killing Ispell processes just get the process from the pool by the ispell program name and its dictionary arguments. 3. For backward-compatibility in 'ispell-init-process' need to set the value of 'ispell-process' to the process extracted from the pool. From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 12 10:45:25 2024 Received: (at 69703) by debbugs.gnu.org; 12 Mar 2024 14:45:25 +0000 Received: from localhost ([127.0.0.1]:43356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rk3Nb-0002f5-Vq for submit@debbugs.gnu.org; Tue, 12 Mar 2024 10:45:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55724) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rk3NQ-0002eW-4q for 69703@debbugs.gnu.org; Tue, 12 Mar 2024 10:45:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rk3Mk-0000Ek-It; Tue, 12 Mar 2024 10:44:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=g3brPPtABWrpTPGw0u6nxxU8cSEUZnnTMJO3lCuTkQ4=; b=fyc9tDn+D0A6 7aKfdmE5SBs7uYTGOEsC4gjBkKOGAGjwMJbkXqQrNymxTWxZdHiX2YkX/tMelH0YCu0U91RNGXmIN jYr/u4/JHXNNwdjDWVTg33RrP5E8g4UvL+dnfX2vYuidr36lYAaJCSFPrAnKnbl7rRMMe1MscDbyz 4H7dEmiBzc+tqrwHj+RTocYkpR422rkmnn5OJhk2sttreAa8YAThUakIhpNQbg3Mj2hi2+796wJgm +gOVKEf1yhaNNu7JfCTsreIM4RMCANoiCoPes1fEvUTuGEoyQc7vMECxBOgX/fCD5hkQs5Ysx1Es1 meU12cuiKz2g/M8mnwS6zA==; Date: Tue, 12 Mar 2024 16:44:26 +0200 Message-Id: <86le6ntsqd.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <867ci7rj05.fsf@mail.linkov.net> (message from Juri Linkov on Tue, 12 Mar 2024 09:45:14 +0200) Subject: Re: bug#69703: Ispell process restarted too often References: <86y1aqh70o.fsf@mail.linkov.net> <86bk7mwlwl.fsf@gnu.org> <867cia3z7x.fsf@mail.linkov.net> <86sf0yug9z.fsf@gnu.org> <867ci7rj05.fsf@mail.linkov.net> X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69703 Cc: 69703@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Cc: 69703@debbugs.gnu.org > Date: Tue, 12 Mar 2024 09:45:14 +0200 > > >> The nature of the problem is the inability of ispell.el to maintain > >> multiple processes with different dictionaries simultaneously > >> that is required by flyspell-mode. > >> > >> What is needed here is a hash of processes where the key is > >> the ispell program name and its dictionary arguments. > > > > Feel free to submit patches for that, and thanks. (But didn't you > > just complain about one speller process per buffer?) > > Since implementing this is not urgent, here is a design outline > for possible future improvements: > > 1. Create a pool of Ispell processes. > > 2. Instead of killing Ispell processes > just get the process from the pool > by the ispell program name and its dictionary arguments. This assumes that the number of different personal dictionaries is much smaller than the number of buffers under flyspell-mode. Since I don't quite understand why you need so many personal dictionaries (presumably for the same language?), I cannot say whether this assumption is reasonable or scalable. In general, if we want to support buffer-local speller processes, we could have hundreds of speller processes running on the system, which is not very nice, I think. The current design is generally based on the following assumptions: . a speller process is mostly needed in a single buffer at a time, the buffer where the user is typing . a speller process needs to be restarted only if you change the dictionary, which is done when you need to spell-check a different language . the number of languages for which the user needs spell-checking is small (or even spell-checked by a single speller, if that is Hunspell) From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 12 13:35:49 2024 Received: (at 69703) by debbugs.gnu.org; 12 Mar 2024 17:35:49 +0000 Received: from localhost ([127.0.0.1]:43720 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rk62W-0001wg-Lz for submit@debbugs.gnu.org; Tue, 12 Mar 2024 13:35:48 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:42033) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rk62U-0001wM-DY; Tue, 12 Mar 2024 13:35:47 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id AAC77240003; Tue, 12 Mar 2024 17:35:04 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#69703: Ispell process restarted too often In-Reply-To: <86le6ntsqd.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 12 Mar 2024 16:44:26 +0200") Organization: LINKOV.NET References: <86y1aqh70o.fsf@mail.linkov.net> <86bk7mwlwl.fsf@gnu.org> <867cia3z7x.fsf@mail.linkov.net> <86sf0yug9z.fsf@gnu.org> <867ci7rj05.fsf@mail.linkov.net> <86le6ntsqd.fsf@gnu.org> Date: Tue, 12 Mar 2024 19:30:06 +0200 Message-ID: <86sf0vnysh.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69703 Cc: 69703@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) close 69703 30.0.50 thanks >> 1. Create a pool of Ispell processes. >> >> 2. Instead of killing Ispell processes >> just get the process from the pool >> by the ispell program name and its dictionary arguments. > > This assumes that the number of different personal dictionaries is > much smaller than the number of buffers under flyspell-mode. Since I > don't quite understand why you need so many personal dictionaries > (presumably for the same language?), I cannot say whether this > assumption is reasonable or scalable. In general, if we want to > support buffer-local speller processes, we could have hundreds of > speller processes running on the system, which is not very nice, I > think. I meant the case of per-project dictionaries with each project having own .hunspell file, on the assumption that a set of identifiers in the project-local dictionary is unique to each project. This implies one Isearch process for every project, but not for every buffer. > The current design is generally based on the following assumptions: > > . a speller process is mostly needed in a single buffer at a time, > the buffer where the user is typing > . a speller process needs to be restarted only if you change the > dictionary, which is done when you need to spell-check a different > language > . the number of languages for which the user needs spell-checking is > small (or even spell-checked by a single speller, if that is > Hunspell) After fixing the project-mode-line-format bug, I see no more problems when switching between projects with local dictionaries restarts the Ispell process on typing, so I'm going to close this request. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 14 13:56:33 2024 Received: (at 69703) by debbugs.gnu.org; 14 Mar 2024 17:56:33 +0000 Received: from localhost ([127.0.0.1]:50562 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rkpJg-0004qO-Rv for submit@debbugs.gnu.org; Thu, 14 Mar 2024 13:56:33 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:58027) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rkpJb-0004q3-89 for 69703@debbugs.gnu.org; Thu, 14 Mar 2024 13:56:31 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 60EC740003; Thu, 14 Mar 2024 17:55:44 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#69703: Ispell process restarted too often In-Reply-To: <86sf0vnysh.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 12 Mar 2024 19:30:06 +0200") Organization: LINKOV.NET References: <86y1aqh70o.fsf@mail.linkov.net> <86bk7mwlwl.fsf@gnu.org> <867cia3z7x.fsf@mail.linkov.net> <86sf0yug9z.fsf@gnu.org> <867ci7rj05.fsf@mail.linkov.net> <86le6ntsqd.fsf@gnu.org> <86sf0vnysh.fsf@mail.linkov.net> Date: Thu, 14 Mar 2024 19:50:08 +0200 Message-ID: <86cyrwpusv.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69703 Cc: 69703@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) BTW, currently the order or enabling minor modes and reading dir-local variables looks wrong: after visiting a file first minor modes are enabled, then dir-local-variables are set in the buffer. So with (add-hook 'text-mode-hook 'flyspell-mode) Ispell starts the Ispell process with the global dictionary. Then later reads 'ispell-personal-dictionary' from .dir-locals.el and restarts the Ispell process with another dictionary. A workaround for configs is to force 'hack-dir-local-variables' before enabling 'flyspell-mode' that is not a nice hack: (defun my-flyspell-mode () ;; Avoid duplicate calls when ‘flyspell-mode’ is enabled by ‘.dir-locals.el’, ;; because the first call uses the global value of ‘ispell-personal-dictionary’, ;; and so restarts the Ispell process. (unless (progn (hack-dir-local-variables) (member '(mode . flyspell) file-local-variables-alist)) (flyspell-mode))) (add-hook 'text-mode-hook 'my-flyspell-mode) From unknown Sun Jun 22 11:35:39 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 12 Apr 2024 11:24:16 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator