From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#19547: Patch for this bug Date: Sat, 26 Nov 2016 09:40:24 +0200 Message-ID: <83h96u3d07.fsf@gnu.org> References: <874ms03qj1.fsf@web.de> <8360nxhfiw.fsf@gnu.org> <83k2ccfnh8.fsf@gnu.org> <83wpgbdy82.fsf@gnu.org> <87y4071o5k.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1480146074 15601 195.159.176.226 (26 Nov 2016 07:41:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 26 Nov 2016 07:41:14 +0000 (UTC) Cc: rrt@sc3d.org, 19547@debbugs.gnu.org To: Thierry Volpiatto Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 26 08:41:09 2016 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 1cAXbg-0002tg-I4 for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 Nov 2016 08:41:08 +0100 Original-Received: from localhost ([::1]:49536 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAXbk-0003vg-3v for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 Nov 2016 02:41:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAXbd-0003vP-FW for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2016 02:41:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cAXba-0007WJ-Ba for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2016 02:41:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54891) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cAXba-0007WD-7s for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2016 02:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cAXbZ-0007Fw-W3 for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2016 02:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Nov 2016 07:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19547 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19547-submit@debbugs.gnu.org id=B19547.148014604227859 (code B ref 19547); Sat, 26 Nov 2016 07:41:01 +0000 Original-Received: (at 19547) by debbugs.gnu.org; 26 Nov 2016 07:40:42 +0000 Original-Received: from localhost ([127.0.0.1]:42057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cAXbG-0007FH-8t for submit@debbugs.gnu.org; Sat, 26 Nov 2016 02:40:42 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cAXbE-0007F4-Va for 19547@debbugs.gnu.org; Sat, 26 Nov 2016 02:40:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cAXb6-0007SW-Em for 19547@debbugs.gnu.org; Sat, 26 Nov 2016 02:40:35 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAXb6-0007SQ-46; Sat, 26 Nov 2016 02:40:32 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3537 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1cAXb4-0001YO-ST; Sat, 26 Nov 2016 02:40:31 -0500 In-reply-to: <87y4071o5k.fsf@gmail.com> (message from Thierry Volpiatto on Fri, 25 Nov 2016 18:10:15 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:126107 Archived-At: > From: Thierry Volpiatto > Cc: Reuben Thomas , 19547@debbugs.gnu.org > Date: Fri, 25 Nov 2016 18:10:15 +0100 > > As no body is working on this, I started looking at this as I would like > to have a fix for this for helm, however I have difficulties as my C > level is 0. > Could you please bear with me on some points ? Sure, and thanks for working on this. > > In some preloaded Lisp file, say subr.el, give that variable a value, > > a list of symbols that name the events we currently don't consider > > relevant for throw-on-input. > > Ok. > > > (Those symbols will have to be invented, e.g. 'focus-in' for > > FOCUS_IN_EVENT, etc.) > > It is here I don't understand, how do I make the correspondance with e.g > focus-in (the lisp symbol) and FOCUS_IN_EVENT ? You can do that with a 'switch' in C, or, better, with a C array that holds the symbols and their corresponding C event_kind values, like this: struct event_value { Lisp_Object event_symbol; enum event_kind event_kind; }; static struct event_value symbol_to_kind[] = { { Qfocus_in, FOCUS_IN_EVENT }, { Qhelp, HELP_EVENT }, { Qiconify, ICONIFY_EVENT }, ... }; Then, for each symbol, you can find the corresponding event value by walking the array until you find a match.