From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: miha--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#48379: 27.2; ispell-init-process may be called recursively during sit-for Date: Wed, 12 May 2021 16:14:07 +0200 Message-ID: <87v97oca4w.fsf@miha-pc> Reply-To: miha@kamnitnik.top Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5919"; mail-complaints-to="usenet@ciao.gmane.io" To: 48379@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 12 16:22:58 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lgplK-0001P9-6N for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 May 2021 16:22:58 +0200 Original-Received: from localhost ([::1]:37912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgplJ-0005q1-8l for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 May 2021 10:22:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgpcg-00033Y-Uf for bug-gnu-emacs@gnu.org; Wed, 12 May 2021 10:14:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56668) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgpcg-0002rz-NA for bug-gnu-emacs@gnu.org; Wed, 12 May 2021 10:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lgpcg-0001FG-JA for bug-gnu-emacs@gnu.org; Wed, 12 May 2021 10:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: miha@kamnitnik.top Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 May 2021 14:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48379 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16208288394766 (code B ref -1); Wed, 12 May 2021 14:14:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 May 2021 14:13:59 +0000 Original-Received: from localhost ([127.0.0.1]:39981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgpcd-0001Eo-8K for submit@debbugs.gnu.org; Wed, 12 May 2021 10:13:59 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:52206) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgpcZ-0001Ee-Rp for submit@debbugs.gnu.org; Wed, 12 May 2021 10:13:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgpcX-00031O-7n for bug-gnu-emacs@gnu.org; Wed, 12 May 2021 10:13:54 -0400 Original-Received: from kamnitnik.top ([209.250.245.214]:50766 helo=mail.kamnitnik.top) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgpcV-0002id-Du for bug-gnu-emacs@gnu.org; Wed, 12 May 2021 10:13:53 -0400 Original-Received: from localhost (BSN-77-156-43.static.siol.net [193.77.156.43]) by mail.kamnitnik.top (Postfix) with ESMTPSA id 51779BBB7F for ; Wed, 12 May 2021 14:13:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top; s=mail; t=1620828827; bh=C8dyeBMhLM938KwdOpYRfo/WAghmVksacdP8/oJ8BXU=; h=From:To:Subject:Date:From; b=AA55AjrDk+iboJk1yNMYLtZ4XC0H3gxvOobwQPELU4DtCvMJShsmLyv7EgZQpUe9g qPAgUjQCuuCH93fW1784tChfTB+Om1pF6y4yp8utX0+RbMxpairWUFazjgEQovH8kb nMB/MtVTDrjzewbXBHom16UHgdKg7a6zn/6Z4qtM+Ojs06va+SIJ1NZh0v9a/NZQ5A fz3th8KyckuWBWU7mr668e3CHFQ4mAbQSDGe33IMcnoRA1bwQGAuaNCdWvGhlhC6NB OmeK8+dEeR2czQd+fwZbAlMOZaymG9Mv5jpQt+2iD1ha7aIHC2am/FNuzJXIi5zp4W pTXAC/xVqLRAQ== Received-SPF: pass client-ip=209.250.245.214; envelope-from=miha@kamnitnik.top; helo=mail.kamnitnik.top X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.499, FROM_SUSPICIOUS_NTLD_FP=0.002, PDS_OTHER_BAD_TLD=1.999, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:206327 Archived-At: --=-=-= Content-Type: text/plain In ispell-init-process, sit-for can accept process output, which may in turn call ispell-init-process again, recursively. If needed, I can post a short reproducer. This recursive call results in the following sequence of events: (ispell-kill-ispell t) (ispell-kill-ispell t) (setq ispell-process (ispell-start-process)) (setq ispell-process (ispell-start-process)) where the middle two calls happen recursively from within sit-for. As you can see, this creates one extra useless ispell process. The following simple patch fixes this by moving the killing of the process closer to starting of the new process without sit-for in the middle diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 4dbc7640bc..80ddb4861f 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -2865,8 +2865,6 @@ ispell-init-process (or (or ispell-local-pdict ispell-personal-dictionary) (equal ispell-process-directory default-directory))) (setq ispell-filter nil ispell-filter-continue nil) - ;; may need to restart to select new personal dictionary. - (ispell-kill-ispell t) (let ((reporter (make-progress-reporter (format "Starting new Ispell process %s with %s dictionary..." @@ -2874,6 +2872,8 @@ ispell-init-process (or ispell-local-dictionary ispell-dictionary "default"))))) (sit-for 0) + ;; May need to restart to select new personal dictionary. + (ispell-kill-ispell t) (setq ispell-library-directory (ispell-check-version) ;; Assign a non-nil value to ispell-process-directory ;; before calling ispell-start-process, since that Best regards. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCAAxFiEEmxVnesoT5rQXvVXnswkaGpIVmT8FAmCb4q8THG1paGFAa2Ft bml0bmlrLnRvcAAKCRCzCRoakhWZPyqcEAC8eojK7oSLZ9uut0ZVXGzk/CFtzSRJ JvNyCOrCAIImM2+toN/Fop751NOBwZo2INK9hH+xPgHP8mzUdEEVjRosJ6Za/QAF h4JMqmBCx94EweN6zL/qeEmgya51tHBchB44ZYMoH34X+cA4PJX8xm7C6sCbXtZn xUOactWR5DZtFiLu6xGqtDHhIgGUF3ZR1E2UICQy7VIpJc++PNnvbkQoHPdG6l9r IfVTgnj7augYsp/tvDeXp0VHX9K8tsusXBl9vNOlw8nRYSK8eZ63GbCltR0sJzJq rOsmlJFheKx78NFgfhA57HuK+iaKbMw+NwxmyCd3FOkYi03UgXnr4hG17lDJoGvR qyhMBQdi1ziodP4hLGaaRRdUSXVjt1nPZ0An7oPsQwU3hU1VfnCKhLH60xS62bFb 6yWY0+mVmdnK+Ej4OqRhjfOWGeIfhXNceGNVHLjVIisC21eSwO6Hm/kQERd05/gL 2bQkfV0VgaYfverGN/AnvNIRvVION8v8eKwOIHzAAS2D9S9hmgF9VcCWtF+uzBRa EdCBndarpu5aRixaHh1MSim60bLtx2cINqw4w2o0x7Dfa+LtsVEW5mFQFREhRsFf rRm604Fqm5H+HRQiB3aj3FDvGziEFIRmGFk3GIuMnCyEGdeRxQhYomEKhsAcg1P9 quxlhn/e1ttItw== =ybtY -----END PGP SIGNATURE----- --=-=-=--