🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #1591

Crashing Emacs in one short (let ...)

#1591
From: David C Lawrence
Date: Sat, 15 Apr 1989 19:46
43 lines
2120 bytes
GNU Emacs 18.53.2 of Tue Apr 11 1989 on imagine.pawl.rpi.edu (berkeley-unix)

Although I know what is causing a problem here, I think Emacs could be
slightly more graceful about recovering from it.

Repeat by:
   (let ((win (selected-window)))
     (pop-to-buffer "*crash*")
     (enlarge-window (- (screen-height) (window-height))
     (select-window win)))

At this point Emacs will die an ugly death, reporting that the marker
does not point anywhere and that Fatal Error(6.) has occurred.

The error in the lisp fragment above is in referencing a window for
select-window that is no longer visible.  Playing around some, I also
found this caused Emacs considerable grief:

(setq grief (selected-window))
=> #<window 20 on *post-news*>
(switch-to-buffer "*Newsgroup*")
grief
=> #<window 20 on *Newsgroup*>        
(switch-to-buffer-other-window "*post-news*")
grief
=> #<window 20 on *Newsgroup*>
(delete-other-windows)
grief
=> #<window 20 on *Newsgroup*>

... hmm ... looks like it is still active.  When I did this just a
couple of minutes ago, I followed it with (select-window grief) and
Emacs had a lot of problems with that.  Somehow through it all it did
not crash (though it was hardly working as it should -- correction, as
I expect it to) but it took many C-g's and other miscellaneous key
punching to get seemingly back to normal (now #<window 24 on *post-news*>).

Trying to figure out a way to build around this in the code that led
me to the first lisp segment above, I have only found 
(if (get-buffer-window (window-buffer win)) (select-window win))
to do the trick (though there might be another way).
--
      tale@rpitsmts.bitnet, tale%mts@itsgw.rpi.edu, tale@pawl.rpi.edu
Technical Details
Message-ID: <TALE.89Apr15154633@imagine.pawl.rpi.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!leah!rpi!rpi.edu!tale

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!leah!rpi!rpi.edu!tale
From: tale@pawl.rpi.edu (David C Lawrence)
Newsgroups: gnu.emacs.bug
Subject: Crashing Emacs in one short (let ...)
Message-ID: <TALE.89Apr15154633@imagine.pawl.rpi.edu>
Date: 15 Apr 89 19:46:33 GMT
Sender: usenet@rpi.edu
Reply-To: tale@pawl.rpi.edu
Distribution: gnu
Lines: 43