Subject: bug#7728: 24.0.50; GDB backtrace from abort

From: "Drew Adams" <[email-masked]>
Date: Wed, 12 Jan 2011 23:07:39 -0800

> > How could it?  For example, Drew's code that causes this 
> > crash does this:
> >     (save-window-excursion (select-frame frame)
> >                            (or (eq major-mode 'image-mode)
> >                                image-minor-mode))

FWIW, that is not the part of the code that gets executed when there is a crash.
However, the branch of the `if' that is executed when there is a crash also has
a similar `save-window-excursion':

(save-window-excursion
  (select-frame frame)
  (setq empty-buf-p  (and (= (point-min) (point-max))
                          (one-window-p (selected-window)))
        specbuf-p    (and empty-buf-p
                          (special-display-p
                            (buffer-name (window-buffer))))))

> > Are you saying tha this isn't kosher, because the body of
> > save-window-excursion is not allowed to select a different frame?
> 
> Admittedly, I think the above code is mistaken.  It kind of reminds me
> of the infamous (save-excursion (set-buffer) ...), although in worse
> since, like Martin, I despise save-window-excursion.

And just what code do you suggest for going off to do something on a different
frame and returning?  AFAIK we do not have a `save-frame-excursion'.  I have
always considered (and seen) `save-window-excursion' to be the way to do this.