From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: while-no-input and pending input (was: while-no-input interrupted by *shell*) Date: Tue, 25 Sep 2018 10:53:36 -0700 (PDT) Message-ID: References: <87sh1y535s.fsf@web.de> <87k1n94gg2.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1537897907 1934 195.159.176.226 (25 Sep 2018 17:51:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 25 Sep 2018 17:51:47 +0000 (UTC) To: Michael Heerdegen , Emacs Development Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 25 19:51:43 2018 Return-path: Envelope-to: ged-emacs-devel@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 1g4rUr-0000Kg-QA for ged-emacs-devel@m.gmane.org; Tue, 25 Sep 2018 19:51:42 +0200 Original-Received: from localhost ([::1]:54598 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4rWx-0002AV-Vv for ged-emacs-devel@m.gmane.org; Tue, 25 Sep 2018 13:53:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4rWr-00029g-Qr for emacs-devel@gnu.org; Tue, 25 Sep 2018 13:53:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4rWn-0006Cr-PF for emacs-devel@gnu.org; Tue, 25 Sep 2018 13:53:45 -0400 Original-Received: from userp2120.oracle.com ([156.151.31.85]:42478) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g4rWn-0006BB-Ff for emacs-devel@gnu.org; Tue, 25 Sep 2018 13:53:41 -0400 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w8PHn80b061720; Tue, 25 Sep 2018 17:53:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=0uDGAMPzxJMZI5xfHLaRVxTBJSbxZzkoHie+3UrE++s=; b=Ly1ZL3+8HB2daUFIZJs7UBcorqTiuvuo4Z7rLzVsTTUbkqu/chSJ6DYIQu2TzLLBiIHZ sG0g9YN1d1nM8mduaUk4jQNnVP75jg7nlb+NQPbJwYFIiw5UuuU6dOufgUQMc5tpM0e9 jKOkgyc4mAYSDWHg/T2+hcoZVZE9UxSbsNCWk2t84V3lrEp4fbP6m54MIEfxWpV9Ico2 f12Fv5w4NCJxhYWoWVbnjkEuddsFXEGFbsCW8XhSF2zUlI/a2C01uqHz5iK2WcFaAQHA PT2Oa4zVHMe5n8wNfybNM+BSGkZjwOn6gyjxNNKA4M/L+8AGdORb/UtwBwZgbFA3loBg HA== Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2mnvtumj6x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Sep 2018 17:53:38 +0000 Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w8PHrb5C032304 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Sep 2018 17:53:38 GMT Original-Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w8PHrbcp003882; Tue, 25 Sep 2018 17:53:37 GMT In-Reply-To: <87k1n94gg2.fsf@web.de> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4735.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9026 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809250176 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.85 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:230069 Archived-At: > I ran into other trouble with `while-no-input': A command I use - it > calls w-n-i to generate feedback for the echo area unless the user hits > a key - sometimes needs to select a different frame. AFAIK this > generates an event and w-n-i then does nothing because of its implicit > `input-pending-p' test. >=20 > Using a modified version of w-n-i with the input-pending-p test removed > solves the problem, but that's not good because (1) I have to duplicate > the definition of w-n-i in my code (it's what Helm does btw.) and (2) > hmm, can doing this have downsides? >=20 > What could I else do in this situation to prevent the frame switch or > whatever event to be misinterpreted as user input? Could/should w-n-i > generally ignore events in `while-no-input-ignore-events' - I mean, also > the input-pending-p part? Dunno whether this helps or whether it's a good idea, but this is what I do= : (defun icicle-skip-this-command () "Prevent `handle-switch-frame' from being added to `this-command'." (interactive) (setq this-command last-command)) (defun icicle-handle-switch-frame (event) "Call `handle-switch-frame', but don't add it to `this-command'." (interactive "e") (handle-switch-frame event) (setq this-command last-command)) (define-key global-map [handle-switch-frame] 'icicle-skip-this-command) (define-key global-map [switch-frame] 'icicle-handle-switch-frame))