From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: discard-input - why do I need it? Date: Mon, 10 Jan 2022 15:12:20 +0100 Message-ID: <87a6g3r86z.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17366"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 10 15:14:18 2022 Return-path: Envelope-to: geh-help-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 1n6vRA-0004MP-DY for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 10 Jan 2022 15:14:16 +0100 Original-Received: from localhost ([::1]:54414 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n6vR9-0003On-0c for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 10 Jan 2022 09:14:15 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6vPN-0003OQ-GK for help-gnu-emacs@gnu.org; Mon, 10 Jan 2022 09:12:25 -0500 Original-Received: from mout.web.de ([212.227.15.14]:35657) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6vPL-0003mI-DO for help-gnu-emacs@gnu.org; Mon, 10 Jan 2022 09:12:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1641823940; bh=HXiv7WvZaNfxR10/3VCgePP/4PvZnZn33zZAXyP64FY=; h=X-UI-Sender-Class:From:To:Subject:Date; b=TJM05JrTH5kX3cZeJjtQRyFOtoYoTx96sRwi1vNobKaN+EN/VIWVhO2OSgHi8nInN cL3hNQZSR85DRjNjUrabXrBZRR+ZvvSDCz4Pf9MBEGBvVkZWdxMmpuZ+B1DIHq9ECJ wn3aKkkWfVmNFQWuAe0IBJWt/sbiSCBQJdFEbdgE= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([88.66.201.186]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MF2gW-1n945E2hZY-00Ffwo; Mon, 10 Jan 2022 15:12:20 +0100 X-Provags-ID: V03:K1:OW6rbsI6VXxXm20Whzq9APc1dLh4i7Eyr9luoK55OeeGLZrRkSW bf7dJm2ZNLZ68FH58x1znyVkAds7a5qrYDyiAtHfNqOHxtirRCbcz+5koCM78mAogbDFtoS GFj4SevarnS5gy5Pqa3h2AyckJwtDmQsv011tEDvA0aljXVSDqm0RJZ2O8d1xeTLmfraLev ZA3mTYvn9PvIUTawGWg0g== X-UI-Out-Filterresults: notjunk:1;V03:K0:6Tkd5VGrsFc=:SKlQioR+Dej4NSkj5/syKK R/qU718ULDG/uD8f8mGBc/ZDaqACJQcV67sjyysKuDZIcdgmQ9LYuKnNTSWDJnDSpGn18rHdS Na8sWjkPmdkjcPu5ftp22MFI+46GsSdsLoHEQVyDffTNDDAhqud6FOcTMCW2qk8lqPtM56bFy 7JkhT9DdPoO3cklJVsGzMjiKSJpNC6zLmcX1nNOD62maeNdWV6EOE61xukKq9AXISHWbvUv0M IZF30AMMe1YV3UlT0ViNfV0iA0z4c/Tp4k0qWoEdK3RqdjT6Ej0BgFgT3QsH+1Rz/xri36El1 KQUgOOIIEZy2xGt77W2JuAGsaQ6Rx3Z8R28LYw2ePiOJqYg3mdX42fQsA21/9Lwl8f0XQP8jE NcmeYeF+scOXtVDTNE6rvhVUen18pfNWS8urzajKTb7RQZv+2Pl86moIo0fWLmgOxJpCJpzHn 333BnU2OUKkvOSL+d8Wq/rhF1qXm0rA860g0biwmK3fSb6VhGXCOoDDPgJ9nclU0akoe7bkkI 7CKf5sJ1EiVfOE5E1ws/E4IoXQI7gxUnGminRX1CdVpEAFnmKj0JATlXFiQcua5vlgnpwfW01 1jqHNRiIh7LSbs5cTjOx4qE+naBxO5IpZy3b02AUPoCtA0FcGLGq2VoiPjxZ4vupO+1/qjXPq va1g+6YKsNcYooEyDrbhfbk7B0o6I0rwnALq7oQSk1bZcUOiQY29eb8s1RhZc2e9Sm1fKLoA2 1HYlxcuD3ELHVRNaRTsyb//iF4xo4EizDtzd/ckvBh4eyJ9UsFwZF7u3t5GLji5J5AL/OTr3 Received-SPF: pass client-ip=212.227.15.14; envelope-from=michael_heerdegen@web.de; helo=mout.web.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:135181 Archived-At: Hello, in "el-search" I do a lot of computations "in the background", and these can all be interrupted by the user. This is implemented using timers and `while-no-input' calls. Oh, and I also use transient maps in a few locations. It seems that using this stuff in my case sometimes makes `discard-input' calls necessary. Because sometimes, a `while-no-input' is interrupted without any apparent physical user interaction. I once looked at the pending input and it had been a key whose binding already had been processed. With other words: the command invoked by the key was being processed, but the key was still pending. Using these `discard-input' calls is extremely ugly and a pain: it's more or less guessing where they should be best put to, and a downside is that sometimes "real" user interactions are discarded and ignored. Does anybody have an idea why I see this kind of problem (using one of these crystal balls maybe?) or what I could do better to avoid the trouble? TIA, Michael.