From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= Newsgroups: gmane.emacs.devel Subject: Re: Reading D-Bus messages Date: Sat, 25 Sep 2010 09:19:11 +0200 Message-ID: <4C9DA26F.4030007@swipnet.se> 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> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1285399181 29572 80.91.229.12 (25 Sep 2010 07:19:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 25 Sep 2010 07:19:41 +0000 (UTC) Cc: Eli Zaretskii , kbrown@cornell.edu, emacs-devel@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 25 09:19:39 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 1OzP2m-0005EG-Kh for ged-emacs-devel@m.gmane.org; Sat, 25 Sep 2010 09:19:37 +0200 Original-Received: from localhost ([127.0.0.1]:44036 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzP2g-0002sn-Cj for ged-emacs-devel@m.gmane.org; Sat, 25 Sep 2010 03:19:30 -0400 Original-Received: from [140.186.70.92] (port=34921 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzP2W-0002sP-Kz for emacs-devel@gnu.org; Sat, 25 Sep 2010 03:19:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OzP2V-0008Mg-Dj for emacs-devel@gnu.org; Sat, 25 Sep 2010 03:19:20 -0400 Original-Received: from smtprelay-b11.telenor.se ([62.127.194.20]:38447) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OzP2O-0008M4-Vd; Sat, 25 Sep 2010 03:19:13 -0400 Original-Received: from ipb2.telenor.se (ipb2.telenor.se [195.54.127.165]) by smtprelay-b11.telenor.se (Postfix) with ESMTP id 57D58C4BA; Sat, 25 Sep 2010 09:19:11 +0200 (CEST) X-SENDER-IP: [85.225.45.35] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuhHAH4/nUxV4S0jPGdsb2JhbACHbZpcDAEBAQE1LcIbhUMEjTg X-IronPort-AV: E=Sophos;i="4.57,233,1283724000"; d="scan'208";a="133368896" Original-Received: from c-232de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.35]) by ipb2.telenor.se with ESMTP; 25 Sep 2010 09:19:10 +0200 Original-Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 287197FA05A; Sat, 25 Sep 2010 09:19:10 +0200 (CEST) User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 In-Reply-To: <87tyleetju.fsf@gmx.de> 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:130828 Archived-At: Michael Albinus skrev 2010-09-24 23.11: > Eli Zaretskii writes: > >>> From: Michael Albinus >>> Cc: Eli Zaretskii, Ken Brown, >>> "emacs-devel\@gnu.org" >>> Date: Fri, 24 Sep 2010 17:10:14 +0200 >>> >>> Handling D-Bus messages like process output would not be reasonable, >>> because one needs to requests this via accept-process-output. And there >>> is no related process. >> >> I didn't say like process output, I said inside >> wait_reading_process_output. That function does more than just read >> process output, please take a look. > > Looks promising. Over the weekend, I'll try to write an own xd_select, and > to call it there. I will take xg_select as example to steal code from :-) > No, please don't, you have total control over your filed escriptors xg_select was done because file descriptors are handeled outside of Emacs control. 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 == 0) continue; add for (channel = 0; channel <= 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. Jan D.