all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: 9006@debbugs.gnu.org
Subject: bug#9006: 24.0.50; Abort in unshow_buffer/kill-buffer
Date: Sun, 10 Jul 2011 15:30:33 +0200	[thread overview]
Message-ID: <4E19A979.3070805@gmx.at> (raw)
In-Reply-To: <87d3hiqvos.fsf@escher.fritz.box>

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

 > Is window-point set to 1 as a side effect of making the temporary
 > buffer?

No.  It happens because I used BEG instead of the buffer's point.

 >>                                           Rather _you_ did set the old
 >> buffer's window point to 1 and it stays put there when you set w->buffer
 >> to old_buffer upon exiting `vertical-motion'.
 >
 > Do you have a suggestion how to reset point?

I attached I patch.  It compiles but is hardly trustworthy.  For
example, old_buffer might have got killed in the meantime.

 > /* If select_window is called with inhibit_point_swap non-zero it will
 >    not store point of the old selected window's buffer back into that
 >    window's pointm slot.  This is needed by Fset_window_configuration to
 >    avoid that the display routine is called with selected_window set to
 >    Qnil causing a subsequent crash.  */
 >
 > However, when I set a conditional breakpoint inhibit_point_swap!=0 this
 > did not interrupt execution, whereas with breakpoint select_window,
 > execution interrupts with inhibit_point_swap == 0, so I guess I don't
 > understand the comment.

IIRC this part is only relevant when you restore a window configuration,
for example, when leaving a `save-window-excursion'.  But I wouldn't
believe my own comments.

martin

[-- Attachment #2: indent.diff --]
[-- Type: text/plain, Size: 1697 bytes --]

*** src/indent.c	2011-07-10 08:20:10 +0000
--- src/indent.c	2011-07-10 13:03:07 +0000
***************
*** 1984,1991 ****
    struct it it;
    struct text_pos pt;
    struct window *w;
!   Lisp_Object old_buffer;
!   struct gcpro gcpro1;
    Lisp_Object lcols = Qnil;
    double cols IF_LINT (= 0);

--- 1984,1991 ----
    struct it it;
    struct text_pos pt;
    struct window *w;
!   Lisp_Object old_buffer, old_pointm;
!   struct gcpro gcpro1, gcpro2;
    Lisp_Object lcols = Qnil;
    double cols IF_LINT (= 0);

***************
*** 2005,2016 ****
    w = XWINDOW (window);

    old_buffer = Qnil;
!   GCPRO1 (old_buffer);
    if (XBUFFER (w->buffer) != current_buffer)
      {
        /* Set the window's buffer temporarily to the current buffer.  */
        old_buffer = w->buffer;
        XSETBUFFER (w->buffer, current_buffer);
      }

    if (noninteractive)
--- 2005,2019 ----
    w = XWINDOW (window);

    old_buffer = Qnil;
!   GCPRO2 (old_buffer, old_pointm);
    if (XBUFFER (w->buffer) != current_buffer)
      {
        /* Set the window's buffer temporarily to the current buffer.  */
        old_buffer = w->buffer;
+       old_pointm = w->pointm;
        XSETBUFFER (w->buffer, current_buffer);
+       set_marker_both
+ 	(w->pointm, w->buffer, BUF_PT (current_buffer), BUF_PT_BYTE (current_buffer));
      }

    if (noninteractive)
***************
*** 2131,2137 ****
      }

    if (BUFFERP (old_buffer))
!     w->buffer = old_buffer;

    RETURN_UNGCPRO (make_number (it.vpos));
  }
--- 2134,2143 ----
      }

    if (BUFFERP (old_buffer))
!     {
!       w->buffer = old_buffer;
!       w->pointm = old_pointm;
!     }

    RETURN_UNGCPRO (make_number (it.vpos));
  }


  reply	other threads:[~2011-07-10 13:30 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-05 23:20 bug#9006: 24.0.50; Abort in unshow_buffer/kill-buffer Stephen Berman
2011-07-06  9:25 ` martin rudalics
2011-07-06 19:19   ` Stephen Berman
2011-07-07  8:23     ` martin rudalics
2011-07-07  9:32       ` Stephen Berman
2011-07-07 15:47         ` martin rudalics
2011-07-08 23:03           ` Stephen Berman
2011-07-09  8:44             ` martin rudalics
2011-07-09 11:57               ` Stephen Berman
2011-07-09 13:01                 ` martin rudalics
2011-07-09 16:27                   ` Stephen Berman
2011-07-09 16:54                     ` Stephen Berman
2011-07-10  8:59                       ` martin rudalics
2011-07-10 10:25                         ` Stephen Berman
2011-07-10 13:30                           ` martin rudalics [this message]
2011-07-10 20:31                             ` Stephen Berman
2011-07-11 19:14                               ` martin rudalics
2011-07-11 20:04                                 ` Stephen Berman
2011-07-12  8:36                                   ` martin rudalics
2011-07-12  8:51                                     ` Stephen Berman
2011-07-13  6:53                                     ` Stephen Berman
2011-07-13  7:24                                       ` Eli Zaretskii
2011-07-13  8:00                                         ` Stephen Berman
2011-07-13 10:03                                           ` Eli Zaretskii
2011-07-13 11:40                                             ` Stephen Berman
2011-07-13  8:37                                       ` martin rudalics
2011-07-13 10:05                                         ` Eli Zaretskii
2011-07-13 11:54                                           ` martin rudalics
2011-07-13 12:20                                             ` Stephen Berman
2011-07-13 11:39                                         ` Stephen Berman
2011-07-14  8:35                                       ` martin rudalics
2011-07-15 21:05                                         ` Stephen Berman
2011-07-10  8:58                     ` martin rudalics
2011-07-09 12:44               ` Stephen Berman
2011-07-09 13:01                 ` martin rudalics
2011-07-09 17:31               ` Eli Zaretskii
2011-07-10  8:59                 ` 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=4E19A979.3070805@gmx.at \
    --to=rudalics@gmx.at \
    --cc=9006@debbugs.gnu.org \
    --cc=stephen.berman@gmx.net \
    /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.