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: Using glib's g_file_monitor_file and g_file_monitor_directory Date: Thu, 06 Jun 2013 13:06:33 +0200 Message-ID: <87hahba47a.fsf@gmx.de> References: <87zjxxn6th.fsf@gmx.de> <83bo7ozc0q.fsf@gnu.org> <87zjxxn6th.fsf@gmx.de> <87hajqpjn1.fsf@gmx.de> <8738t7pewc.fsf@gmx.de> <83fvx7p1h4.fsf@gnu.org> <877gihc3qm.fsf@gmx.de> <83mwrd6c54.fsf@gnu.org> <87obbtaie8.fsf@gmx.de> <83bo7ozc0q.fsf@gnu.org> <87bo7ngwj8.fsf@gmx.de> <83mwr7xm7b.fsf@gnu.org> <3d7gibw6sa.fsf@fencepost.gnu.org> <83bo7nxim8.fsf@gnu.org> <834ndfxh0g.fsf@gnu.org> <2cobbnt897.fsf@fencepost.gnu.org> <87ip1vq8wy.fsf@gmx.de> <51AD8485.90201@cs.ucla.edu> <878v2od70c.fsf@gmx.de> <2AEE82C8-0C4C-4CF8-B44B-FF2E657B03CD@swipnet.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1370516810 7856 80.91.229.3 (6 Jun 2013 11:06:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Jun 2013 11:06:50 +0000 (UTC) Cc: Paul Eggert , 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 Thu Jun 06 13:06:49 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UkY1o-0000TA-6V for ged-emacs-devel@m.gmane.org; Thu, 06 Jun 2013 13:06:48 +0200 Original-Received: from localhost ([::1]:43676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkY1n-0001AQ-0c for ged-emacs-devel@m.gmane.org; Thu, 06 Jun 2013 07:06:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53959) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkY1j-0001AI-Uh for emacs-devel@gnu.org; Thu, 06 Jun 2013 07:06:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkY1i-0007dH-IR for emacs-devel@gnu.org; Thu, 06 Jun 2013 07:06:43 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:51501) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkY1i-0007cu-8y for emacs-devel@gnu.org; Thu, 06 Jun 2013 07:06:42 -0400 Original-Received: from mailout-de.gmx.net ([10.1.76.2]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0MDBXW-1UacPs0TJk-00GYZV for ; Thu, 06 Jun 2013 13:06:40 +0200 Original-Received: (qmail invoked by alias); 06 Jun 2013 11:06:39 -0000 Original-Received: from p5DCA3275.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [93.202.50.117] by mail.gmx.net (mp002) with SMTP; 06 Jun 2013 13:06:39 +0200 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX1++OBtyaqm+0JR3Ek0HBff2Kgr82TjF7TYxxiBygT XDixH21DpemBMD In-Reply-To: <2AEE82C8-0C4C-4CF8-B44B-FF2E657B03CD@swipnet.se> ("Jan \=\?utf-8\?Q\?Dj\=C3\=A4rv\=22's\?\= message of "Wed, 5 Jun 2013 20:37:14 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.17.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:160161 Archived-At: Jan Dj=C3=A4rv writes: > Hello. Hi, >> I've committed a patch to the trunk which prevents this crash. However, >> if you call "emacs -nw", you won't get any notification. I suppose we >> need an generalized g_main_loop integration, synchronized with the code >> in gtkutil.c. >>=20 >> Likely, we must move this code out of gtkutil.c and gfilenotify.c. Jan? > > > Which code? The glib event loop integration is in xgselect.c. I > think it is called in the -nw case also. It is only dependent on > HAVE_GLIB. > The Gtk+ event loop integration is in xterm.c, it is a separate thing. I was thinking about the g_main_loop_run and g_main_loop_quit calls in gtkutil.c. Reading the code in more detail, it looks like the calls have a local scope only, so we don't need to sync. gfilenotify.c needs a running glib event loop. If Emacs is called with the "-nw" flag there is no such event loop; it must be started in a new thread by gfilenotify.c I believe. > Jan D. Best regards, Michael.