all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: alarm_signal_handler is called too frequently
Date: Mon, 25 Oct 2004 09:13:44 -0400	[thread overview]
Message-ID: <E1CM4fQ-00054K-TS@fencepost.gnu.org> (raw)
In-Reply-To: <wlk6tpn0th.wl@church.math.s.chiba-u.ac.jp> (message from YAMAMOTO Mitsuharu on Sun, 17 Oct 2004 18:36:26 +0900)

    > For example, BLOCK_INPUT occurs when a popup menu is activated.
    > Then the menu takes control of the user input, and BLOCK_INPUT
    > continues until the user complete the menu operation.

    The frequent call of alarm_signal_handler was observed also on
    GNU/Linux (with or without GTK) during a popup menu was shown.  Could
    someone answer the original question below?

I looked at this just now (please forgive the delay) and found that
things seem to be rather messed up.

1. The code makes provision to handle unexpected kinds of
keyboard/mouse input while the popup menu is popped up, and to handle
timers.  That is a nice feature.

2. However, popup_get_selection is called inside BLOCK_INPUT, and it
calls timer_check, which can call Lisp code.  This seems to be a bug.

I don't see any way we could make this safe.  I think we have to
take out timer processing here.  However, I have some doubt that
it really works--see below.

3. popup_get_selection is called whenever USE_GTK is not defined, but
popup_get_selection is only defined when USE_X_TOOLKIT.  I suspect
this means that Emacs won't build in the non-toolkit mode any more.
Could someone check?


I propose the following change as a way to discover problems like #2
sooner.  Could people try it and say if it crashes?  (Strangely, it
does not crash for me when I try C-Mouse-3 just after enabling Font
Lock mode on emacs.c.  I wonder why.)


*** eval.c	30 Jul 2004 23:43:15 -0400	1.221
--- eval.c	25 Oct 2004 05:34:28 -0400	
***************
*** 1975,1981 ****
    struct backtrace backtrace;
    struct gcpro gcpro1, gcpro2, gcpro3;
  
!   if (handling_signal)
      abort ();
  
    if (SYMBOLP (form))
--- 1985,1991 ----
    struct backtrace backtrace;
    struct gcpro gcpro1, gcpro2, gcpro3;
  
!   if (handling_signal || INPUT_BLOCKED_P)
      abort ();
  
    if (SYMBOLP (form))

  reply	other threads:[~2004-10-25 13:13 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-13  1:15 alarm_signal_handler is called too frequently YAMAMOTO Mitsuharu
2004-10-13 14:43 ` Richard Stallman
2004-10-14  5:16   ` YAMAMOTO Mitsuharu
2004-10-17  9:36     ` YAMAMOTO Mitsuharu
2004-10-25 13:13       ` Richard Stallman [this message]
2004-10-25 14:38         ` Jan D.
2004-10-27 10:47           ` Richard Stallman
2004-10-28 18:02             ` Jan D.
2004-10-29  1:37               ` YAMAMOTO Mitsuharu
2004-10-29  7:00                 ` Jan D.
2004-10-29  8:24                   ` YAMAMOTO Mitsuharu
2004-11-01  7:24                   ` Richard Stallman
2004-11-01  9:06                     ` Jan D.
2004-11-01 12:21                       ` Jan D.
2004-11-02 14:08                       ` Richard Stallman
2004-11-02 21:56                         ` Jan D.
2004-11-03 17:04                           ` Richard Stallman
2004-11-03 17:26                             ` Jan D.
2004-11-04 20:42                               ` Richard Stallman
2004-11-04 22:41                             ` Jan D.
2004-11-05 12:36                               ` Kim F. Storm
2004-11-06  5:22                                 ` Richard Stallman
2004-11-04 13:02                         ` Jan D.
2004-10-31  9:42               ` Richard Stallman
2004-10-31 15:11                 ` Jan D.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1CM4fQ-00054K-TS@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.