From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Ivan Yonchovski Newsgroups: gmane.emacs.devel Subject: Questions about throw-on-input Date: Thu, 07 May 2020 10:31:23 +0300 Message-ID: <87r1vwxktw.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="84495"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.3.7; emacs 27.0.91 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu May 07 09:32:12 2020 Return-path: Envelope-to: ged-emacs-devel@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 1jWb0t-000LsS-4e for ged-emacs-devel@m.gmane-mx.org; Thu, 07 May 2020 09:32:11 +0200 Original-Received: from localhost ([::1]:34890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWb0s-0003Nd-3y for ged-emacs-devel@m.gmane-mx.org; Thu, 07 May 2020 03:32:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWb0E-0002xX-Ar for emacs-devel@gnu.org; Thu, 07 May 2020 03:31:30 -0400 Original-Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]:45378) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jWb0D-00013c-H8 for emacs-devel@gnu.org; Thu, 07 May 2020 03:31:30 -0400 Original-Received: by mail-lj1-x22c.google.com with SMTP id h4so5172493ljg.12 for ; Thu, 07 May 2020 00:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=fnx+XS+sDuaY1C0ENW3AuSlw9HUvTBQxEg3OJyo622k=; b=rZ+cZM5gdF5ba/1mntJhESXZJsFzkZ7FFnFuuwG3BKspwPkm8yNMBRlzVOKBf2a6Bj GVChtiKGolUJD2+qYr/i/E0wTpUtF/EGahAgnTSXfI8zCqpKWUM+Ne6E5S4HsT/KBWKK ZOq6jv7NPF2ZfjMsOBIVID7Slg78Q2vH5Ra64Qh6YGxUZfsYpBZQ2s4ul5oFlWTQnIpo G7Jt8lkaIhPh67n9/fIv3Pq65fDmjYj5zi6g4IvmWU2LZQtvd+gYmw7xZpkgjthr6PYf +IWptuJbliDHjy/Jkxo7stlXro5dmH4tFl9SgMOfBkk7l/+9N3gmFx2RukRvrAnOEY4z J06A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=fnx+XS+sDuaY1C0ENW3AuSlw9HUvTBQxEg3OJyo622k=; b=Vd8lFC9v4LzepGMU+2DRs2j+FcL3NNYbbvc59Yq/4Ypbms1sjMSJgnwE+FZbZ8HBXH 9etYl39gLOSxIX9AjRI6qo/KgLI4Wzqn78VDtcpm50B/Y2q0OHoVpQltOmK4TZskJ56S /wSvufBnvyJ1IQO5v16tzngKKTlbZ2NN+d3q21ZxnJmVK2Bv9Vj6kpdERN944EvS7UUm aKKk5cc1ETA7He575r8uHmak9U9NgJczpcqlN/Ma8ekTMRL8uys6m6GD5M54AXVLSmHj Eqvd26rgfe2VWNKIkNrZoPLgt+jeF2j7fzLVxJZ9wvpoqz0uKIYHxlQKWKmHJWCQxd95 KOVw== X-Gm-Message-State: AGi0PubIvDRtUoK3NHdUuU+iJubtcVch2TIx8HkYkSLGl+Dd/v0S6K6s Xoxogje7fziJiRrkliBmq3ez3hrIUa8= X-Google-Smtp-Source: APiQypJe1rvCfw30fGj7YyWn0nADHlvRE/chWreobIhGI2KAoFFx9Z5rcFeo33oLzi1LnzpYKjJuJQ== X-Received: by 2002:a05:651c:28c:: with SMTP id b12mr7429753ljo.167.1588836686023; Thu, 07 May 2020 00:31:26 -0700 (PDT) Original-Received: from kyoncho-H87-D3H ([2a00:4802:28d:1200:a100:1275:aabc:a737]) by smtp.gmail.com with ESMTPSA id o22sm2768038ljj.100.2020.05.07.00.31.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2020 00:31:24 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::22c; envelope-from=yyoncho@gmail.com; helo=mail-lj1-x22c.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:249156 Archived-At: Hi all, I have few questions regarding throw-on-input: 1. In the following example: (dotimes (_ 10) (message "Length %s" (length (let (result) (catch t (let ((throw-on-input t)) (dotimes (counter 10000000) (push (number-to-string counter) result)))) result)))) .. after I execute the following block each of the 10 computations will be canceled after pressing C-n for example, how do I force the handling of the command to be processed? I tried redisplay but it does not help. 2. Consider the following pieces of code: (message "Length %s" (length (let (result) (catch t (let ((throw-on-input t)) (dotimes (counter 10000000) (push (number-to-string counter) result)))) result))) (run-with-idle-timer 0.0 nil (lambda () (message "Length %s" (length (let (result) (catch t (let ((throw-on-input t)) (dotimes (counter 10000000) (push (number-to-string counter) result)))) result))))) The issue is with the second block, it seems like throw-on-input is disregarded when used in run-with-idle-timer. Can anyone confirm if this is a bug/desired behavior or I should use something else if I want to run cancelable tasks in on-idle? Thanks, Ivan