unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 69703@debbugs.gnu.org
Subject: bug#69703: Ispell process restarted too often
Date: Sun, 10 Mar 2024 19:10:19 +0200	[thread overview]
Message-ID: <867cia3z7x.fsf@mail.linkov.net> (raw)
In-Reply-To: <86bk7mwlwl.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 10 Mar 2024 10:06:50 +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?

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.





  reply	other threads:[~2024-03-10 17:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-10  7:37 bug#69703: Ispell process restarted too often Juri Linkov
2024-03-10  8:06 ` Eli Zaretskii
2024-03-10 17:10   ` Juri Linkov [this message]
2024-03-10 17:51     ` Eli Zaretskii
2024-03-12  7:45       ` Juri Linkov
2024-03-12 14:44         ` Eli Zaretskii
2024-03-12 17:30           ` Juri Linkov
2024-03-14 17:50             ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=867cia3z7x.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=69703@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).