unofficial mirror of bug-gnu-emacs@gnu.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 19:35:52 +0100	[thread overview]
Message-ID: <4D2DF488.4060904@gmx.at> (raw)
In-Reply-To: <E1Pd4oC-00037K-7n@fencepost.gnu.org>

 >> 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.
 >
 > But I bet Drew's code works just fine, when it does not crash.

I doubt the scenario sketched above shows up frequently.  And when it
show up I doubt many people would notice it.

 > Anyway, if switching away of the frame inside save-window-excursion is
 > not allowed, we should detect that and signal an error.

It _is_ allowed by design.

 > That would
 > solve this bug cleanly, with no need for any low-level hacking or
 > kludges.

Have you looked into the ChangeLog of this?  It was never clean and
people just managed to make it work, more or less.

As I noticed earlier, one bug is in the design of using two variables
that should never change independently from each other.  Better, there
should be only one variable - either selected_window or selected_frame.
After that has been solved we would have to fix the bug where the
selected window is not the selected window because it's on a frame that
has not been risen.  And, finally we should warn people to avoid things
like `save-window-excursion' in the first place.

 >> To avoid the present crash we could try something like the attached
 >> patch (which does not try to solve anything but that crash).
 >
 > But if you say that switching a frame inside save-window-excursion is
 > not supported, why do we need to change code to support it?  What am I
 > missing?

As I said it is allowed.  But almost all 100 or so occurrences of
`save-window-excursion' in Emacs are harmful.  Take, for example, the
commented-out sections of buff-menu.el.  Richard took them out
apparently because he used that code in practice and noticed that it
didn't DTRT.  Most other instances are still here because people don't
care enough.

martin





  reply	other threads:[~2011-01-12 18:35 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
2011-01-12 17:48                 ` Eli Zaretskii
2011-01-12 18:35                   ` martin rudalics [this message]
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=4D2DF488.4060904@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).