From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: Reading D-Bus messages Date: Sat, 25 Sep 2010 18:52:25 +0200 Message-ID: <87mxr5epfa.fsf@gmx.de> References: <878w2tx6gk.fsf@gmx.de> <4C9A493F.4050701@cornell.edu> <874odhyliu.fsf@gmx.de> <4C9B452E.1040101@cornell.edu> <4C9B63A1.2060604@cornell.edu> <87y6asy0uh.fsf@gmx.de> <4C9BBD5C.30201@cornell.edu> <83tylgtbo8.fsf@gnu.org> <871v8jhcw2.fsf@gmx.de> <4C9CB57E.1010708@swipnet.se> <8339sztayd.fsf@gnu.org> <87tyleetju.fsf@gmx.de> <4C9DA26F.4030007@swipnet.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1285433564 21053 80.91.229.12 (25 Sep 2010 16:52:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 25 Sep 2010 16:52:44 +0000 (UTC) Cc: Eli Zaretskii , kbrown@cornell.edu, emacs-devel@gnu.org To: Jan =?utf-8?Q?Dj=C3=A4rv?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 25 18:52:42 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OzXzN-00021P-Mu for ged-emacs-devel@m.gmane.org; Sat, 25 Sep 2010 18:52:42 +0200 Original-Received: from localhost ([127.0.0.1]:49147 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzXzN-0001Cs-7T for ged-emacs-devel@m.gmane.org; Sat, 25 Sep 2010 12:52:41 -0400 Original-Received: from [140.186.70.92] (port=42048 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzXzE-0001Bg-JP for emacs-devel@gnu.org; Sat, 25 Sep 2010 12:52:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OzXzD-0002Lv-7n for emacs-devel@gnu.org; Sat, 25 Sep 2010 12:52:32 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:38409 helo=mail.gmx.net) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OzXzC-0002Le-RI for emacs-devel@gnu.org; Sat, 25 Sep 2010 12:52:31 -0400 Original-Received: (qmail invoked by alias); 25 Sep 2010 16:52:28 -0000 Original-Received: from p4FC18069.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [79.193.128.105] by mail.gmx.net (mp038) with SMTP; 25 Sep 2010 18:52:28 +0200 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX19odNkYG9Bo5Cz/x3tTdAiIJwoE/C7ILt/zFwbSNU XxjjrsVAwkSwmh In-Reply-To: <4C9DA26F.4030007@swipnet.se> ("Jan =?utf-8?Q?Dj=C3=A4rv=22's?= message of "Sat, 25 Sep 2010 09:19:11 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:130865 Archived-At: Jan Dj=C3=A4rv writes: > We should have a general way to add file descriptors and get a > callback for them. In the mean time, do something like this in > process.c: > > static SELECT_TYPE dbus_mask; > > void > add_dbus_fd (int fd) > { > FD_SET (fd, &dbus_mask); > add_keyboard_wait_descriptor (fd); > } > > void > remove_dbus_fd (int fd) > { > FD_CLR (fd, &dbus_mask); > remove_keyboard_wait_descriptor (fd); > } > > After this wait_reading_process_output > > /* Check for data from a process. */ > if (no_avail || nfds =3D=3D 0) > continue; > > add > for (channel =3D 0; channel <=3D max_keyboard_desc; ++channel) > if (FD_ISSET (channel, &dbus_mask) && FD_ISSET (channel, &Available)) > { > xd_read_queued_messages (); > break; /* All dbus channels has been read, exit loop */ > } > > and in init_process: > > FD_ZERO (&dbus_mask); > > Use remove_dbus_fd and add_dbus_fd in dbusbind.c. > But maybe I'll add that general input mechanism instead, well see. I have added this, and it works fine in an X11 environment. I guess, redisplay() does the job. If I test it in a non-X11 terminal, arriving D-Bus messages are recognised only after pressing a character on the keyboard. So at least an additional trigger is missing to handle this event in time. > Jan D. Best regards, Michael.