From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#16702: 24.3.50; flyspell in message mode messes up latin prefix input Date: Thu, 13 Feb 2014 18:26:25 +0200 Message-ID: <83zjlvq8r2.fsf@gnu.org> References: <87ha88dx4s.fsf@tao.kanis.fr> <20140211184153.GA13631@agmartin.aq.upm.es> <7mwhwau8w.fsf@fencepost.gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1392308836 24616 80.91.229.3 (13 Feb 2014 16:27:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Feb 2014 16:27:16 +0000 (UTC) Cc: agustin.martin@hispalinux.es, ivan@tao.kanis.fr, 16702@debbugs.gnu.org To: Glenn Morris , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 13 17:27:23 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WDz88-000659-Ow for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Feb 2014 17:27:16 +0100 Original-Received: from localhost ([::1]:47455 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDz88-0003aa-AP for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Feb 2014 11:27:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37770) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDz80-0003Yo-Ct for bug-gnu-emacs@gnu.org; Thu, 13 Feb 2014 11:27:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDz7v-0002cK-8Z for bug-gnu-emacs@gnu.org; Thu, 13 Feb 2014 11:27:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49798) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDz7v-0002c0-4e for bug-gnu-emacs@gnu.org; Thu, 13 Feb 2014 11:27:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WDz7u-0000Rz-76 for bug-gnu-emacs@gnu.org; Thu, 13 Feb 2014 11:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Feb 2014 16:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16702 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16702-submit@debbugs.gnu.org id=B16702.13923088031694 (code B ref 16702); Thu, 13 Feb 2014 16:27:02 +0000 Original-Received: (at 16702) by debbugs.gnu.org; 13 Feb 2014 16:26:43 +0000 Original-Received: from localhost ([127.0.0.1]:50980 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WDz7a-0000RD-Ej for submit@debbugs.gnu.org; Thu, 13 Feb 2014 11:26:43 -0500 Original-Received: from mtaout29.012.net.il ([80.179.55.185]:35563) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WDz7W-0000Q3-85 for 16702@debbugs.gnu.org; Thu, 13 Feb 2014 11:26:39 -0500 Original-Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0N0Y00H0008YKD00@mtaout29.012.net.il> for 16702@debbugs.gnu.org; Thu, 13 Feb 2014 18:28:46 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N0Y009TL0FYM590@mtaout29.012.net.il>; Thu, 13 Feb 2014 18:28:46 +0200 (IST) In-reply-to: <7mwhwau8w.fsf@fencepost.gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:85487 Archived-At: > From: Glenn Morris > Date: Wed, 12 Feb 2014 16:36:31 -0500 > Cc: Ivan Kanis , 16702@debbugs.gnu.org > > emacs -Q > C-\ latin-prefix RET > d' > -> now displayed in the buffer "d" followed by "'" with underline. > Echo area displays stuff you can input next. > > > Repeat with > emacs -Q -f flyspell-mode > > and just see "d" followed by nothing in the buffer, and one extra > element at the front of the echo area list. > > > It seems to be just a display issue, because the input method still > works (eg if you type "d'y", you get "d" followed by an accented "y".) I see the same symptoms, but I don't think it's a display issue. I think it's an issue with how we read events in sit-for. The problem seems to be with this code in flyspell (part of flyspell-check-word-p): (cond ((get this-command 'flyspell-deplacement) (not (eq flyspell-previous-command this-command))) ((get this-command 'flyspell-delayed) ;; The current command is not delayed, that ;; is that we must check the word now. (and (not unread-command-events) <<<<<<<<<<<<<<<<<<< (sit-for flyspell-delay))) <<<<<<<<<<<<<<<<<<< (t t))) This is Flyspell giving the user a chance to take a short break while typing a word, and avoid spell-checking incomplete words. If you customize flyspell-delay to zero, the problem goes away. The change that introduced this bug is the following portion of revision 113293: - (let ((read (read-event nil nil seconds))) + ;; FIXME: we should not read-event here at all, because it's much too + ;; difficult to reliably "undo" a read-event by pushing it onto + ;; unread-command-events. + (let ((read (read-event nil t seconds))) We now call read-event with 2nd arg t instead of nil. If I revert this single change, the problem goes away even without zeroing out flyspell-delay. Of course, I'm not saying we should actually revert this change: it was done for a reason. But hopefully, Stefan, who made that change, will know how to fix this problem, which is that asking sit-for to read events while inheriting the input method sometimes isn't TRT.