From xemacs-m  Tue Jun 24 14:14:59 1997
Received: from jagor.srce.hr (hniksic@jagor.srce.hr [161.53.2.130])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id OAA23745
	for <xemacs-beta@xemacs.org>; Tue, 24 Jun 1997 14:14:58 -0500 (CDT)
Received: (from hniksic@localhost)
          by jagor.srce.hr (8.8.5/8.8.4)
	  id VAA02330; Tue, 24 Jun 1997 21:14:58 +0200 (MET DST)
To: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: [PATCH] Stray help buffers
X-Attribution: Hrv
X-Face: Mie8:rOV<\c/~z{s.X4A{!?vY7{drJ([U]0O=W/<W*SMo/Mv:58:*_y~ki>xDi&N7XG
        KV^$k0m3Oe/)'e%3=$PCR&3ITUXH,cK>]bci&<qQ>Ff%x_>1`T(+M2Gg/fgndU%k*ft
        [(7._6e0n-V%|%'[c|q:;}td$#INd+;?!-V=c8Pqf}3J
From: Hrvoje Niksic <hniksic@srce.hr>
Date: 24 Jun 1997 21:14:57 +0200
Message-ID: <kigsoy7x172.fsf@jagor.srce.hr>
Lines: 38
X-Mailer: Gnus v5.4.59/XEmacs 20.3(beta8) - "Copenhagen"

When one presses `q' in a help buffer, the window configuration is
restored, but the buffer is not buried to the end of the list.  So, if 
one switches between two buffers, he constantly gets annoying *Help*
buffer in the way.  This patch does what the code was (I think) Meant
To Do.

--- lisp/prim/help.el.orig	Tue Jun 24 20:56:01 1997
+++ lisp/prim/help.el	Tue Jun 24 20:57:37 1997
@@ -188,16 +188,17 @@
 (define-key help-mode-map 'delete 'scroll-down)
 
 (defun help-mode-quit ()
-  "Exits from help mode, possibly restoring the previous window configuration."
+  "Exits from help mode, possibly restoring the previous window configuration.
+Bury the help buffer to the end of the buffer list."
   (interactive)
-  (cond ((frame-property (selected-frame) 'help-window-config)
+  (let ((buf (current-buffer)))
+    (cond ((frame-property (selected-frame) 'help-window-config)
 	   (set-window-configuration
 	    (frame-property (selected-frame) 'help-window-config))
 	   (set-frame-property  (selected-frame) 'help-window-config nil))
-        ((one-window-p)
-	 (bury-buffer))
-        (t
-         (delete-window))))
+	  ((not (one-window-p))
+	   (delete-window)))
+    (bury-buffer buf)))
 
 (defun help-quit ()
   (interactive)


-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Oh lord won't you buy me a color TV...

