emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: trunk is trying to access X windows selection in -nw mode


From: Eli Zaretskii
Subject: Re: trunk is trying to access X windows selection in -nw mode
Date: Tue, 31 Aug 2010 04:29:00 -0400

> From: Giorgos Keramidas <address@hidden>
> Date: Tue, 31 Aug 2010 10:17:53 +0300
> Cc: address@hidden
> 
> On Mon, 30 Aug 2010 19:10:24 -0400, Chong Yidong <address@hidden> wrote:
> > Giorgos Keramidas <address@hidden> 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));



reply via email to

[Prev in Thread] Current Thread [Next in Thread]