From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: trunk is trying to access X windows selection in -nw mode Date: Tue, 31 Aug 2010 04:29:00 -0400 Message-ID: References: <87wrr8q7bq.fsf@kobe.laptop> <8739tvhf33.fsf@stupidchicken.com> <871v9fqmhq.fsf@kobe.laptop> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1283243362 26824 80.91.229.12 (31 Aug 2010 08:29:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 31 Aug 2010 08:29:22 +0000 (UTC) Cc: cyd@stupidchicken.com, emacs-devel@gnu.org To: Giorgos Keramidas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 31 10:29:18 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 1OqMDS-0005Xr-6Q for ged-emacs-devel@m.gmane.org; Tue, 31 Aug 2010 10:29:14 +0200 Original-Received: from localhost ([127.0.0.1]:53406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OqMDR-0006rC-MK for ged-emacs-devel@m.gmane.org; Tue, 31 Aug 2010 04:29:13 -0400 Original-Received: from [199.232.76.173] (port=59569 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OqMDL-0006q0-8W for emacs-devel@gnu.org; Tue, 31 Aug 2010 04:29:07 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1OqMDJ-00022y-V3 for emacs-devel@gnu.org; Tue, 31 Aug 2010 04:29:07 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:48354) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1OqMDJ-00022t-Kc for emacs-devel@gnu.org; Tue, 31 Aug 2010 04:29:05 -0400 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1OqMDE-0006Aw-6C; Tue, 31 Aug 2010 04:29:00 -0400 In-reply-to: <871v9fqmhq.fsf@kobe.laptop> (message from Giorgos Keramidas on Tue, 31 Aug 2010 10:17:53 +0300) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:129481 Archived-At: > From: Giorgos Keramidas > Date: Tue, 31 Aug 2010 10:17:53 +0300 > Cc: emacs-devel@gnu.org > > On Mon, 30 Aug 2010 19:10:24 -0400, Chong Yidong wrote: > > Giorgos Keramidas writes: > > > >> When running in 'emacs -nw' mode, the latest builds of trunk on my > >> laptop display an error in the modeline: > >> > >> X windows are not in use or not initialized > > > > Could you try to figure out what code is emitting this error? Run Emacs > > in gdb with checkpoints on `error'. > > The stack trace is: > > (gdb) bt > #0 error (m=0x81f8cd0 "X windows are not in use or not initialized") at eval.c:2035 > #1 0x080ee3fd in check_x () at xfns.c:220 > #2 0x080fac47 in Fx_own_selection_internal (selection_name=138393082, selection_value=145865153) at xselect.c:2075 > #3 0x0818e388 in Ffuncall (nargs=3, args=0xbfbfe120) at eval.c:2993 > #4 0x081c36c9 in Fbyte_code (bytestr=137023001, vector=137023021, > maxdepth=Variable "maxdepth" is not available. > ) at bytecode.c:679 > #5 0x0818ddf4 in funcall_lambda (fun=137022965, nargs=2, arg_vector=0xbfbfe260) at eval.c:3174 > #6 0x0818e10f in Ffuncall (nargs=3, args=0xbfbfe25c) at eval.c:3047 > #7 0x0818e5db in call2 (fn=138393058, arg1=138393082, arg2=145865153) at eval.c:2804 > #8 0x08133484 in command_loop_1 () at keyboard.c:1814 The culprit is the code below in keyboard.c, it should never call x-set-selection if the frame returns nil from display-selections-p (this could be replaced with a test of the frame kind). else { /* Even if not deactivating the mark, set PRIMARY if `select-active-regions' is non-nil. */ if ((EQ (Vselect_active_regions, Qonly) ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly) : (!NILP (Vselect_active_regions) && !NILP (Vtransient_mark_mode))) && !EQ (Vthis_command, Qhandle_switch_frame)) { int beg = XINT (Fmarker_position (current_buffer->mark)); int end = XINT (make_number (PT)); if (beg < end) call2 (Qx_set_selection, QPRIMARY, make_buffer_string (beg, end, 0));