bug-gnu-emacs
[Top][All Lists]
Advanced

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

input-pending-p


From: David
Subject: input-pending-p
Date: Wed, 6 Mar 2002 20:26:06 -0700

;;; GNU Emacs 21.1.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
;;;  of 2001-12-28 on stan

 - Function: input-pending-p
     This function determines whether any command input is currently
     available to be read.  It returns immediately, with value `t' if
     there is available input, `nil' otherwise.  On rare occasions it
     may return `t' when no input is available.

You might like to know that this function is, newly, giving me trouble
so that the "rare occasions" occur exactly 50% of the time.  I am
calling the function in small (1-5) bursts and the value yielded by
input-pending-p is predictably and reliably nil on the odd-numbered
calls and t on the even numbered calls.  Under the conditions that
pertain the value always should be nil.

The code that, now, is failing is years old, has been in use
sucessfully for years, and, what is interesting, now performs like
this.

Emacs 20.7, window managers twm, fvwm, Gnome:  works properly
Emacs 21.1, window managers twm, fvwm:         works properly
Emacs 21.1, window managers Gnome, KDE:        fails as indicated
It is difficult for me to check KDE and 20.7 at the moment.

I have tried unsuccessfully to produce simple test code; unfortunately
the code that produces this problem is fairly extensive.

I have started to check using the debugger and have confirmed that the
value of input_pending on exit from input-pending-p is different in
the two cases.  So the problem seems to be generated in the call to
get_input_pending.

DEFUN ("input-pending-p", Finput_pending_p, Sinput_pending_p, 0, 0, 0,
  "T if command input is currently available with no waiting.\n\
Actually, the value is nil only if we can be sure that no input is available.")
  ()
{
  if (!NILP (Vunread_command_events) || unread_command_char != -1)
    return (Qt);

  get_input_pending (&input_pending, 1);
  return input_pending > 0 ? Qt : Qnil;
}

I shall try to find out more; however, I am not very experienced at
using gdb.  If you can give me some clues on how to proceed I shall
see what I can find out.

dajo



reply via email to

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