all messages for Emacs-related lists mirrored at yhetil.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: Thu, 14 Mar 2024 19:50:08 +0200	[thread overview]
Message-ID: <86cyrwpusv.fsf@mail.linkov.net> (raw)
In-Reply-To: <86sf0vnysh.fsf@mail.linkov.net> (Juri Linkov's message of "Tue,  12 Mar 2024 19:30:06 +0200")

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)





      reply	other threads:[~2024-03-14 17:50 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
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 [this message]

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

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

  git send-email \
    --in-reply-to=86cyrwpusv.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.