Subject: [PATCH] help-for-help interferes with buffer order, and displays help in too many windows
From: Kelly Dean <[email-masked]>
To: [email-masked]
Date: Tue, 11 Dec 2012 10:57:39 -0800 (PST)
List-Id: <debbugs-submit.debbugs.gnu.org>

In 24.2, do emacs -Q, then
M-x split-window RET C-x b foo RET C-x b bar RET C-h C-h C-g C-x b
It defaults to *Help*, but it should default to foo; transiently displaying help-for-help shouldn't modify the buffer order.

Now do C-g C-h f mark RET C-x o C-h C-h
It shows the help-for-help page in both windows, but it should show it in only one.

The attached helphelpbug.patch fixes both problems. I'm not bothering to submit separate reports for the two since it's a one-line patch.
--- emacs-24.2/lisp/help-macro.el
+++ emacs-24.2/lisp/help-macro.el
@@ -130,7 +130,7 @@
 		   (when (or (eq char ??) (eq char help-char)
 			     (memq char help-event-list))
 		     (setq config (current-window-configuration))
-		     (switch-to-buffer-other-window "*Help*")
+		     (if (not (equal (buffer-name) "*Help*")) (switch-to-buffer-other-window "*Help*" t))
 		     (and (fboundp 'make-frame)
 			  (not (eq (window-frame (selected-window))
 				   prev-frame))