From: martin rudalics <rudalics@gmx.at>
To: emacs-devel@gnu.org
Subject: Re: emacs 24 randomly hanging
Date: Wed, 22 Feb 2012 09:26:10 +0100 [thread overview]
Message-ID: <4F44A6A2.8040701@gmx.at> (raw)
In-Reply-To: <8762f0qbam.fsf@this.that>
[-- Attachment #1: Type: text/plain, Size: 928 bytes --]
> I tried applying it via git apply - which failed.
Sorry. My mailer probably mangled it. I'll attach newer versions.
> After applying your
> patch manually, I still does not work - the testcase results in a
> hanging emacs. I might have screwed the application of the patch up,
> though. Can anyone confirm my result?
I can't test emacsclient well on my system (Windows XP). Also, here
`frame-list' seems broken. It's OK with one frame but for > 1 frame
evaluating (frame-list) can sometimes return nil. I have to check
what's going on here, IIUC it takes some time (at least a couple of
seconds) for a frame to show up on Vframe_list.
In any case the patch I attached now tries to
(1) Check whether the frame passed to next_frame is in Vframe_list and
quit if it isn't.
(2) Put a maximum of 100 frames investigated on the loop in next_frame
so there should be no endless looping otherwise.
martin
[-- Attachment #2: frame.c.diff --]
[-- Type: text/plain, Size: 3676 bytes --]
=== modified file 'src/frame.c'
*** src/frame.c 2012-01-19 07:21:25 +0000
--- src/frame.c 2012-02-22 07:35:19 +0000
***************
*** 935,992 ****
forever. Forestall that. */
CHECK_LIVE_FRAME (frame);
! while (1)
for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
{
Lisp_Object f;
f = XCAR (tail);
! if (passed
! && ((!FRAME_TERMCAP_P (XFRAME (f)) && !FRAME_TERMCAP_P (XFRAME (frame))
! && FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame)))
! || (FRAME_TERMCAP_P (XFRAME (f)) && FRAME_TERMCAP_P (XFRAME (frame))
! && FRAME_TTY (XFRAME (f)) == FRAME_TTY (XFRAME (frame)))))
{
- /* Decide whether this frame is eligible to be returned. */
-
/* If we've looped all the way around without finding any
eligible frames, return the original frame. */
if (EQ (f, frame))
return f;
!
! /* Let minibuf decide if this frame is acceptable. */
! if (NILP (minibuf))
! {
! if (! FRAME_MINIBUF_ONLY_P (XFRAME (f)))
! return f;
! }
! else if (EQ (minibuf, Qvisible))
! {
! FRAME_SAMPLE_VISIBILITY (XFRAME (f));
! if (FRAME_VISIBLE_P (XFRAME (f)))
! return f;
! }
! else if (INTEGERP (minibuf) && XINT (minibuf) == 0)
! {
! FRAME_SAMPLE_VISIBILITY (XFRAME (f));
! if (FRAME_VISIBLE_P (XFRAME (f))
! || FRAME_ICONIFIED_P (XFRAME (f)))
! return f;
! }
! else if (WINDOWP (minibuf))
{
! if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf)
! || EQ (WINDOW_FRAME (XWINDOW (minibuf)), f)
! || EQ (WINDOW_FRAME (XWINDOW (minibuf)),
! FRAME_FOCUS_FRAME (XFRAME (f))))
! return f;
}
- else
- return f;
}
! if (EQ (frame, f))
passed++;
}
}
--- 935,997 ----
forever. Forestall that. */
CHECK_LIVE_FRAME (frame);
! while (Fmemq (frame, Vframe_list) && (passed < 100))
for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
{
Lisp_Object f;
f = XCAR (tail);
! if (passed)
{
/* If we've looped all the way around without finding any
eligible frames, return the original frame. */
if (EQ (f, frame))
return f;
! else
{
! passed++;
!
! /* Decide whether this frame is eligible to be returned. */
! if ((!FRAME_TERMCAP_P (XFRAME (f)) && !FRAME_TERMCAP_P (XFRAME (frame))
! && FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame)))
! || (FRAME_TERMCAP_P (XFRAME (f)) && FRAME_TERMCAP_P (XFRAME (frame))
! && FRAME_TTY (XFRAME (f)) == FRAME_TTY (XFRAME (frame))))
! {
! /* Let minibuf decide if this frame is acceptable. */
! if (NILP (minibuf))
! {
! if (! FRAME_MINIBUF_ONLY_P (XFRAME (f)))
! return f;
! }
! else if (EQ (minibuf, Qvisible))
! {
! FRAME_SAMPLE_VISIBILITY (XFRAME (f));
! if (FRAME_VISIBLE_P (XFRAME (f)))
! return f;
! }
! else if (INTEGERP (minibuf) && XINT (minibuf) == 0)
! {
! FRAME_SAMPLE_VISIBILITY (XFRAME (f));
! if (FRAME_VISIBLE_P (XFRAME (f))
! || FRAME_ICONIFIED_P (XFRAME (f)))
! return f;
! }
! else if (WINDOWP (minibuf))
! {
! if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf)
! || EQ (WINDOW_FRAME (XWINDOW (minibuf)), f)
! || EQ (WINDOW_FRAME (XWINDOW (minibuf)),
! FRAME_FOCUS_FRAME (XFRAME (f))))
! return f;
! }
! else
! return f;
! }
}
}
! else if (EQ (frame, f))
passed++;
}
}
next prev parent reply other threads:[~2012-02-22 8:26 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-19 5:28 emacs 24 randomly hanging Adam
2012-02-19 9:45 ` Adam
2012-02-19 9:54 ` Andreas Schwab
2012-02-20 7:23 ` Adam
2012-02-20 15:34 ` Dan Nicolaescu
2012-02-21 10:10 ` Adam
2012-02-21 10:43 ` Adam
2012-02-21 15:41 ` Dan Nicolaescu
2012-02-21 16:54 ` martin rudalics
2012-02-21 18:42 ` Adam
2012-02-22 8:26 ` martin rudalics [this message]
2012-02-22 9:01 ` Andreas Schwab
2012-02-22 9:41 ` martin rudalics
2012-02-22 14:49 ` Stefan Monnier
2012-02-24 18:43 ` martin rudalics
2012-02-22 10:55 ` Chong Yidong
2012-02-22 16:28 ` Eli Zaretskii
2012-02-23 8:05 ` Chong Yidong
2012-02-23 14:03 ` Christopher Schmidt
2012-02-23 16:39 ` Christopher Schmidt
2012-02-23 17:42 ` Chong Yidong
2012-02-24 18:43 ` martin rudalics
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=4F44A6A2.8040701@gmx.at \
--to=rudalics@gmx.at \
--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.