From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Emacs 24.0.50.1, Flyspell, and "blocking call to accept-process-output with quit inhibited!!" Date: Wed, 14 Sep 2011 15:15:25 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1316027738 15257 80.91.229.12 (14 Sep 2011 19:15:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 14 Sep 2011 19:15:38 +0000 (UTC) Cc: emacs-devel@gnu.org To: Benjamin Slade Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 14 21:15:34 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R3uvk-0001wp-Sv for ged-emacs-devel@m.gmane.org; Wed, 14 Sep 2011 21:15:33 +0200 Original-Received: from localhost ([::1]:49613 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3uvk-0001tZ-39 for ged-emacs-devel@m.gmane.org; Wed, 14 Sep 2011 15:15:32 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:34217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3uvg-0001tD-O2 for emacs-devel@gnu.org; Wed, 14 Sep 2011 15:15:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R3uve-0001Jd-VX for emacs-devel@gnu.org; Wed, 14 Sep 2011 15:15:28 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:38409) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3uve-0001Ip-RC for emacs-devel@gnu.org; Wed, 14 Sep 2011 15:15:26 -0400 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id p8EJFPhQ008223; Wed, 14 Sep 2011 15:15:25 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 6EAF113007E; Wed, 14 Sep 2011 15:15:25 -0400 (EDT) In-Reply-To: (Benjamin Slade's message of "Wed, 14 Sep 2011 12:37:10 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3980=0 X-NAI-Spam-Version: 2.2.0.9286 : core <3980> : streams <681609> : uri <959510> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:144037 Archived-At: > Using Emacs 24.0.50.1 with the flyspell package generates a (constantly > repeating and annoying) message "blocking call to accept-process-output with > quit inhibited!!". It doesn't actually seem to "block" anything as flyspell > still functions as expected, but it's annoying. The message simply indicates that the code waits for some external event (in this case answer from ispell) while quit is inhibited, which implies that if ispell decides to take its time, Emacs will hang. I.e. it indicates of a latent bug in flyspell.el. > Or something which can be fixed/hacked in Flyspell? Can you try the patch below? Stefan === modified file 'lisp/textmodes/flyspell.el' --- lisp/textmodes/flyspell.el 2011-09-11 02:14:10 +0000 +++ lisp/textmodes/flyspell.el 2011-09-14 19:14:21 +0000 @@ -931,9 +931,10 @@ ;;* previous word nor the current word */ ;;*---------------------------------------------------------------------*/ (defun flyspell-post-command-hook () - "The `post-command-hook' used by flyspell to check a word in-the-fly." + "The `post-command-hook' used by flyspell to check a word on-the-fly." (interactive) (when flyspell-mode + (with-local-quit (let ((command this-command) ;; Prevent anything we do from affecting the mark. deactivate-mark) @@ -946,6 +947,7 @@ (if (flyspell-check-word-p) (progn '(flyspell-debug-signal-word-checked) + ;; FIXME: This should be asynchronous! (flyspell-word) ;; we remember which word we have just checked. ;; this will be used next time we will check a word @@ -960,7 +962,8 @@ (setq flyspell-pre-pre-point nil) ;; when a word is not checked because of a delayed command ;; we do not disable the ispell cache. - (if (and (symbolp this-command) (get this-command 'flyspell-delayed)) + (if (and (symbolp this-command) + (get this-command 'flyspell-delayed)) (progn (setq flyspell-word-cache-end -1) (setq flyspell-word-cache-result '_))))) @@ -973,7 +976,7 @@ (goto-char start) (flyspell-word))) (setq flyspell-changes (cdr flyspell-changes)))) - (setq flyspell-previous-command command)))) + (setq flyspell-previous-command command))))) ;;*---------------------------------------------------------------------*/ ;;* flyspell-notify-misspell ... */ @@ -1100,14 +1103,10 @@ ;; we mark the ispell process so it can be killed ;; when emacs is exited without query (set-process-query-on-exit-flag ispell-process nil) - ;; Wait until ispell has processed word. Since this - ;; code is often executed from post-command-hook but - ;; the ispell process may not be responsive, it's - ;; important to make sure we re-enable C-g. - (with-local-quit + ;; Wait until ispell has processed word. (while (progn (accept-process-output ispell-process) - (not (string= "" (car ispell-filter)))))) + (not (string= "" (car ispell-filter))))) ;; (ispell-send-string "!\n") ;; back to terse mode. ;; Remove leading empty element