all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 7728@debbugs.gnu.org
Subject: bug#7728: 24.0.50; GDB backtrace from abort
Date: Wed, 12 Jan 2011 18:42:55 +0100	[thread overview]
Message-ID: <4D2DE81F.5040002@gmx.at> (raw)
In-Reply-To: <E1Pd3TM-0001IP-Uo@fencepost.gnu.org>

[-- Attachment #1: Type: text/plain, Size: 708 bytes --]

 > Are you saying tha this isn't kosher, because the body of
 > save-window-excursion is not allowed to select a different frame?

I doubt it's kosher because if the old selected window is not on the
restored frame and a window on the restored frame gets selected, the
point of the buffer whose window is deselected is not stored in the old
selected window's pointm which is certainly not TRT.

Inherently, the source of all evil is the idea to have (1) these two
variables selected_frame and selected_window and (2) to allow setting
them independently from each other.

To avoid the present crash we could try something like the attached
patch (which does not try to solve anything but that crash).

martin

[-- Attachment #2: window.c.diff --]
[-- Type: text/plain, Size: 2668 bytes --]

*** c:/window.c	2011-01-07 08:25:53.406250000 +0100
--- c:/window.c	2011-01-12 18:25:01.859375000 +0100
***************
*** 158,163 ****
--- 158,167 ----
  
  static int window_initialized;
  
+ /* ...  */
+ 
+ static int inhibit_point_swap;
+ 
  /* Hook to run when window config changes.  */
  
  static Lisp_Object Qwindow_configuration_change_hook;
***************
*** 3594,3600 ****
    /* Store the current buffer's actual point into the
       old selected window.  It belongs to that window,
       and when the window is not selected, must be in the window.  */
!   if (!NILP (selected_window))
      {
        ow = XWINDOW (selected_window);
        if (! NILP (ow->buffer))
--- 3598,3606 ----
    /* Store the current buffer's actual point into the
       old selected window.  It belongs to that window,
       and when the window is not selected, must be in the window.  */
!   if (inhibit_point_swap)
!     inhibit_point_swap = 0;
!   else
      {
        ow = XWINDOW (selected_window);
        if (! NILP (ow->buffer))
***************
*** 3602,3607 ****
--- 3608,3615 ----
  			 BUF_PT (XBUFFER (ow->buffer)),
  			 BUF_PT_BYTE (XBUFFER (ow->buffer)));
      }
+   else
+     inhibit_point_swap = 0;
  
    selected_window = window;
  
***************
*** 5767,5773 ****
      /* This test is needed to make sure PT/PT_BYTE make sense in w->buffer
         when passed below to set_marker_both.  */
      error ("move-to-window-line called from unrelated buffer");
!   
    window = selected_window;
    start = marker_position (w->start);
    if (start < BEGV || start > ZV)
--- 5775,5781 ----
      /* This test is needed to make sure PT/PT_BYTE make sense in w->buffer
         when passed below to set_marker_both.  */
      error ("move-to-window-line called from unrelated buffer");
! 
    window = selected_window;
    start = marker_position (w->start);
    if (start < BEGV || start > ZV)
***************
*** 6147,6153 ****
        /* Prevent "swapping out point" in the old selected window
  	 using the buffer that has been restored into it.
  	 We already swapped out point that from that window's old buffer.  */
!       selected_window = Qnil;
  
        /* Arrange *not* to restore point in the buffer that was
  	 current when the window configuration was saved.  */
--- 6155,6161 ----
        /* Prevent "swapping out point" in the old selected window
  	 using the buffer that has been restored into it.
  	 We already swapped out point that from that window's old buffer.  */
!       inhibit_point_swap = 1;
  
        /* Arrange *not* to restore point in the buffer that was
  	 current when the window configuration was saved.  */

  reply	other threads:[~2011-01-12 17:42 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-24 16:55 bug#7728: 24.0.50; GDB backtrace from abort Drew Adams
2010-12-25  9:38 ` Eli Zaretskii
2010-12-25 10:44   ` Andreas Schwab
2010-12-25 11:12     ` Eli Zaretskii
2010-12-25 20:35   ` Stefan Monnier
2011-01-01 18:02     ` Eli Zaretskii
2011-01-09 21:18       ` Eli Zaretskii
2011-01-10 23:32         ` Drew Adams
2011-01-11 20:55       ` Stefan Monnier
2011-01-11 21:14         ` Eli Zaretskii
2011-01-11 21:44           ` Drew Adams
2011-01-12  4:11             ` Eli Zaretskii
2011-01-12  4:59               ` Drew Adams
2011-01-12 11:03                 ` Eli Zaretskii
2011-01-12 18:36                   ` Drew Adams
2011-01-12 19:52                   ` Drew Adams
2011-01-12 21:30                     ` Drew Adams
2011-01-12  7:54         ` martin rudalics
2011-01-12 15:05           ` Drew Adams
2011-01-12 15:14           ` Stefan Monnier
2011-01-12 15:59             ` martin rudalics
2011-01-12 16:22             ` Eli Zaretskii
2011-01-12 17:42               ` martin rudalics [this message]
2011-01-12 17:48                 ` Eli Zaretskii
2011-01-12 18:35                   ` martin rudalics
2011-01-12 18:36                   ` Drew Adams
2011-01-15  2:59                 ` Chong Yidong
2011-01-15 20:05                   ` martin rudalics
2011-01-13  2:53               ` Stefan Monnier
2011-01-13  7:07                 ` Drew Adams
2011-01-13 17:02                   ` Stefan Monnier
2011-01-13 17:57                     ` Drew Adams
2011-01-13 21:24                       ` Stefan Monnier
2011-01-13 22:06                         ` Drew Adams
2011-01-14  0:26                       ` Eli Zaretskii
2011-01-14  1:19                         ` Drew Adams
2011-01-14  2:40                           ` Eli Zaretskii
2011-01-14  6:46                             ` Drew Adams
2011-01-14  7:09                               ` Drew Adams
2011-01-14 20:01                         ` Sean Sieger
2011-01-14 21:06                           ` Drew Adams
2011-01-14 21:46                             ` Sean Sieger
2011-01-14 22:51                               ` Eli Zaretskii
2011-01-14 23:56                                 ` Sean Sieger
2011-01-14  2:25                       ` Stefan Monnier
2011-01-14  4:25                         ` Drew Adams
2011-01-14  8:26                     ` martin rudalics
2011-01-14  8:58                       ` Drew Adams
2011-01-14 15:30                         ` Stefan Monnier
2011-01-16 20:44                           ` Drew Adams

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=4D2DE81F.5040002@gmx.at \
    --to=rudalics@gmx.at \
    --cc=7728@debbugs.gnu.org \
    --cc=eliz@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.