From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#23980: 25.0.95; Events put in `unread-command-events' can be wrongly handled Date: Wed, 21 Feb 2018 12:47:20 +0200 Message-ID: <6830cf80-1964-bf58-16ab-31ab1fbed3ea@yandex.ru> References: <8660s871vt.fsf@gmail.com> <92f514d5-ca5e-e341-a625-8c94a85cb679@yandex.ru> <83y3jn7bi5.fsf@gnu.org> <83h8qb6kf4.fsf@gnu.org> <87po4yaiz0.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1519209973 6460 195.159.176.226 (21 Feb 2018 10:46:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 21 Feb 2018 10:46:13 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Thunderbird/59.0 Cc: 23980@debbugs.gnu.org To: Chris Feng , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 21 11:46:08 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eoRua-0001E6-Gj for geb-bug-gnu-emacs@m.gmane.org; Wed, 21 Feb 2018 11:46:08 +0100 Original-Received: from localhost ([::1]:59996 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eoRwc-00086k-OD for geb-bug-gnu-emacs@m.gmane.org; Wed, 21 Feb 2018 05:48:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eoRwT-000868-PV for bug-gnu-emacs@gnu.org; Wed, 21 Feb 2018 05:48:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eoRwQ-0006AX-MR for bug-gnu-emacs@gnu.org; Wed, 21 Feb 2018 05:48:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45752) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eoRwQ-0006AB-Gz for bug-gnu-emacs@gnu.org; Wed, 21 Feb 2018 05:48:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eoRwQ-0001Sh-7k for bug-gnu-emacs@gnu.org; Wed, 21 Feb 2018 05:48:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Feb 2018 10:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23980 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23980-submit@debbugs.gnu.org id=B23980.15192100515571 (code B ref 23980); Wed, 21 Feb 2018 10:48:02 +0000 Original-Received: (at 23980) by debbugs.gnu.org; 21 Feb 2018 10:47:31 +0000 Original-Received: from localhost ([127.0.0.1]:53649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eoRvv-0001Rn-Ar for submit@debbugs.gnu.org; Wed, 21 Feb 2018 05:47:31 -0500 Original-Received: from mail-wr0-f177.google.com ([209.85.128.177]:40572) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eoRvu-0001RY-74 for 23980@debbugs.gnu.org; Wed, 21 Feb 2018 05:47:30 -0500 Original-Received: by mail-wr0-f177.google.com with SMTP id o76so3112593wrb.7 for <23980@debbugs.gnu.org>; Wed, 21 Feb 2018 02:47:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=MvZYKb+FnMnIC1/9t7dOdzMPhRas+wjdrnwphbaNH08=; b=ALA2wkbPksFmg8kh2IL12M7e+UmrUe1LldP9l0r5r+Mpqi9i9AubgDcVnmwWx1qEL4 2ij8VqeXrHaQL8OtodHb5Q53Ja4dj1heB58By6eXrmpX3Ij8a2WfSSajXx2XZNH/hhuf 5ZNdZwZsj/wauSOq+1PmT1CvwY4CALLJZPCf+bRXxW7Y/7NU0u39PTK/Kdr3lisbbG16 FcH26A4qicGWxcBVXE9jpfXyAxBVWzpwxzdXg+B1BLxafHBNPXRg6AlC6oLaqqs2L/9G 0Heh6pskuY6OVmSMAgfB0oPlB0g6Ls+ufPqxvaAsvfvQZD5nYsjUmp4M6gmnin3zrKzP rO3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=MvZYKb+FnMnIC1/9t7dOdzMPhRas+wjdrnwphbaNH08=; b=i/nOKu9p4ubw4fhEYreY3MnDoMn0mWrFtyR2pP2v47jOvoqsPvXegZI+Bu4HzSsSkW h5EQyfy522wtP7KIAZIG3p/dHbbwNXRibYiu8fL17g8chtw9X6tUS56nKgVXoA1lRiZb 51YCo7kGhbWDE2yKfYh/1EWQlN2XoJ3padUYtE9RSQMYKeEtWBbXI/YguQzLMXqbLL42 5Cxo7sFJ4Ub6F03xguJuTlbsnxe5o/ivKK1aWp160nhw3rngufqzbbtLxSnApqP4DKLU EaTFEaGNTEF4j8N1UmqQpSEq+OPhvzwlTu6g8QYHBu99qbsIcSKeP9n5KfcNQA2mcMYh H0wA== X-Gm-Message-State: APf1xPBjRv6rgpb2zxYOZGB10cznn+T+mqzaHFRo8cGH2ct9msQcdTdM MQVH3Hp+WmZHsxNn0T8DwxxrNocT X-Google-Smtp-Source: AH8x2272DEPM0MRs2xs6W/rnwMQMjB07talZDrX1smUIv/Mrm8ic9TC4F70FuBpxBcR/j/gB38xNoA== X-Received: by 10.80.135.229 with SMTP id 34mr4273339edz.227.1519210043987; Wed, 21 Feb 2018 02:47:23 -0800 (PST) Original-Received: from [192.168.1.3] ([185.105.174.193]) by smtp.googlemail.com with ESMTPSA id c22sm3704479eda.1.2018.02.21.02.47.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 02:47:22 -0800 (PST) In-Reply-To: <87po4yaiz0.fsf@gmail.com> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:143547 Archived-At: On 2/21/18 9:40 AM, Chris Feng wrote: > It seems to be the only use case in Emacs's source tree, but we can't > tell how many packages do this trick in the wild nor can we predict > that. They only do that with one goal, though (so we are dealing with a protocol). >> But then how come you have (t t . 45) there? > > Probably shortly after (t . 45) is unread another call to `sit-for' > happens to read it out directly from `unread-command-events', and the > event is further unread as (cons t '(t . 45)). More or less, this. Except we don't get this effect from two (or more) consecutive calls to sit-for. What triggers it, is effectively recursive sit-for calls, when the second sit-for is called inside a timer, which are allowed to run inside the first sit-for. > PS. Many users will stick with the pre-26 releases in the next upcoming > years so backporting this fix does not necessarily resolve the problem > for company-mode. At least a workaround has to be come up with to deal > with the situations where this fix is absent. I've been trying to. So far, the options are: - Advise users to lower flyspell-delay to (* 0.9 company-idle-delay). That actually leads to freezes, which I should file as a separate bug report. - Ask people to disable flyspell-mode :) - Use sleep-for instead of sit-for in the relevant place, forgoing the significant latency improvement that comes with the latter. Maybe predicated on Emacs version, and flyspell-mode being enabled. So far the last option is winning, but I'd be much more content to use it if the Emacs 26 are not going to need it.