From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.devel Subject: Re: Reading D-Bus messages Date: Sat, 25 Sep 2010 17:46:52 -0400 Message-ID: <4C9E6DCC.2050501@cornell.edu> 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> <87mxr5epfa.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1285451272 14552 80.91.229.12 (25 Sep 2010 21:47:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 25 Sep 2010 21:47:52 +0000 (UTC) Cc: Eli Zaretskii , =?UTF-8?B?SmFuIERqw6Rydg==?= , emacs-devel To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 25 23:47:50 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 1Ozcaz-0000or-GF for ged-emacs-devel@m.gmane.org; Sat, 25 Sep 2010 23:47:49 +0200 Original-Received: from localhost ([127.0.0.1]:53892 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ozcay-0000wC-UJ for ged-emacs-devel@m.gmane.org; Sat, 25 Sep 2010 17:47:48 -0400 Original-Received: from [140.186.70.92] (port=59477 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzcaI-0000YH-UZ for emacs-devel@gnu.org; Sat, 25 Sep 2010 17:47:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OzcaH-0002zG-3U for emacs-devel@gnu.org; Sat, 25 Sep 2010 17:47:06 -0400 Original-Received: from granite1.mail.cornell.edu ([128.253.83.141]:47343 helo=authusersmtp.mail.cornell.edu) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OzcaH-0002xp-00; Sat, 25 Sep 2010 17:47:05 -0400 Original-Received: from [192.168.1.5] (cpe-67-249-196-94.twcny.res.rr.com [67.249.196.94]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id o8PLkp6q004083 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sat, 25 Sep 2010 17:46:52 -0400 (EDT) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 In-Reply-To: <87mxr5epfa.fsf@gmx.de> X-MIME-Autoconverted: from 8bit to quoted-printable by authusersmtp.mail.cornell.edu id o8PLkp6q004083 X-detected-operating-system: by eggs.gnu.org: Solaris 9 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:130883 Archived-At: On 9/25/2010 12:52 PM, Michael Albinus wrote: > 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. Where can I find your changes? I'd like to test it in Cygwin. I tried=20 to make the changes Jan suggested myself, but I found that emacs was=20 blocked after I loaded dbus.el, just as before. I probably did=20 something wrong. Ken