From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: New Context Menu Date: Mon, 23 Aug 2021 19:04:39 +0300 Organization: LINKOV.NET Message-ID: <87y28sqhq8.fsf@mail.linkov.net> References: <20210818120834.i3orh535tb2enpos.ref@Ergus> <20210818120834.i3orh535tb2enpos@Ergus> <87r1epzznt.fsf@mail.linkov.net> <83zgtd2762.fsf@gnu.org> <87fsv4io41.fsf@mail.linkov.net> <838s0w1hiz.fsf@gnu.org> <871r6odq3s.fsf@mail.linkov.net> <83y28wyozn.fsf@gnu.org> <87a6l8it83.fsf@mail.linkov.net> <83sfz0wfxz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28117"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: spacibba@aol.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Aug 23 18:09:06 2021 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 1mICVW-0007Do-0i for ged-emacs-devel@m.gmane-mx.org; Mon, 23 Aug 2021 18:09:06 +0200 Original-Received: from localhost ([::1]:39660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mICVU-0003Re-VP for ged-emacs-devel@m.gmane-mx.org; Mon, 23 Aug 2021 12:09:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41924) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mICTd-0007o9-Cp for emacs-devel@gnu.org; Mon, 23 Aug 2021 12:07:10 -0400 Original-Received: from relay12.mail.gandi.net ([217.70.178.232]:59691) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mICTb-0000JU-JL; Mon, 23 Aug 2021 12:07:09 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay12.mail.gandi.net (Postfix) with ESMTPSA id B5E19200007; Mon, 23 Aug 2021 16:07:02 +0000 (UTC) In-Reply-To: <83sfz0wfxz.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 23 Aug 2021 14:36:40 +0300") Received-SPF: pass client-ip=217.70.178.232; envelope-from=juri@linkov.net; helo=relay12.mail.gandi.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, 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: 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:272875 Archived-At: --=-=-= Content-Type: text/plain > The question is: do we want to remove this unconditionally for all the > commands that say (interactive "e") ? That sounds a > backward-incompatible change to me. > > Should we perhaps condition that by some variable, which menu commands > could bind when they want? So here is a new variable: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=inhibit-event-check.patch diff --git a/src/callint.c b/src/callint.c index 6f8a7f13f6..381a3443d2 100644 --- a/src/callint.c +++ b/src/callint.c @@ -606,7 +606,7 @@ DEFUN ("call-interactively", Fcall_interactively, Scall_interactively, 1, 3, 0, break; case 'e': /* The invoking event. */ - if (next_event >= key_count) + if (!inhibit_event_check && next_event >= key_count) error ("%s must be bound to an event with parameters", (SYMBOLP (function) ? SSDATA (SYMBOL_NAME (function)) @@ -900,6 +900,13 @@ syms_of_callint (void) a way to turn themselves off when a mouse command switches windows. */); Vmouse_leave_buffer_hook = Qnil; + DEFVAR_BOOL ("inhibit-event-check", inhibit_event_check, + doc: /* Non-nil means the interactive spec "e" doesn't check for events. +In this case `(interactive "e")' doesn't signal an error when no event +is produced. Then `event-start', `event-end', `event-click-count' +can create a new event. */); + inhibit_event_check = false; + defsubr (&Sinteractive); defsubr (&Scall_interactively); defsubr (&Sfuncall_interactively); --=-=-=--