all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#13146: [PATCH] help-for-help interferes with buffer order, and displays help in too many windows
@ 2012-12-11 18:57 Kelly Dean
  2012-12-12  9:42 ` martin rudalics
  2012-12-16 11:58 ` Kelly Dean
  0 siblings, 2 replies; 6+ messages in thread
From: Kelly Dean @ 2012-12-11 18:57 UTC (permalink / raw)
  To: 13146

[-- Attachment #1: Type: text/plain, Size: 483 bytes --]

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.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: helphelpbug.patch --]
[-- Type: text/x-diff; name="helphelpbug.patch", Size: 474 bytes --]

--- 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))

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#13146: [PATCH] help-for-help interferes with buffer order, and displays help in too many windows
  2012-12-11 18:57 bug#13146: [PATCH] help-for-help interferes with buffer order, and displays help in too many windows Kelly Dean
@ 2012-12-12  9:42 ` martin rudalics
  2012-12-13  8:12   ` Kelly Dean
  2012-12-16 11:58 ` Kelly Dean
  1 sibling, 1 reply; 6+ messages in thread
From: martin rudalics @ 2012-12-12  9:42 UTC (permalink / raw)
  To: Kelly Dean; +Cc: 13146

 > 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.

You're right.  It shouldn't.

 > 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.

This look quite silly, indeed.

-		     (switch-to-buffer-other-window "*Help*")
+		     (if (not (equal (buffer-name) "*Help*")) (switch-to-buffer-other-window "*Help*" t))

Using t as NORECORD argument is correct IMO.  Checking whether *Help* is
current is not quite correct (the current buffer is not necessarily
displayed in the selected window) but good enough for interactive use.
I think a simple `pop-to-buffer' would suffice here.

But I'm not sure whether `help-for-help' should use *Help* in the first
place.  A user might want to consult `help-for-help' and continue/resume
watching the current help information.  Does anyone see a downside to
renaming the buffer used by `help-for-help' to *help-for-help* (with a
leading space)?

martin





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#13146: [PATCH] help-for-help interferes with buffer order, and displays help in too many windows
  2012-12-12  9:42 ` martin rudalics
@ 2012-12-13  8:12   ` Kelly Dean
  2012-12-14 10:24     ` martin rudalics
  0 siblings, 1 reply; 6+ messages in thread
From: Kelly Dean @ 2012-12-13  8:12 UTC (permalink / raw)
  To: martin rudalics; +Cc: 13146

> Does anyone see
> a downside to
> renaming the buffer used by `help-for-help' to
> *help-for-help* (with a
> leading space)?
That sounds like a good solution.






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#13146: [PATCH] help-for-help interferes with buffer order, and displays help in too many windows
  2012-12-13  8:12   ` Kelly Dean
@ 2012-12-14 10:24     ` martin rudalics
  0 siblings, 0 replies; 6+ messages in thread
From: martin rudalics @ 2012-12-14 10:24 UTC (permalink / raw)
  To: Kelly Dean; +Cc: 13146

 >> Does anyone see
 >> a downside to
 >> renaming the buffer used by `help-for-help' to
 >> *help-for-help* (with a
 >> leading space)?
 > That sounds like a good solution.

Can you provide a patch for this (using `pop-to-buffer' instead of
`switch-to-buffer-other-window') and test it a bit?

martin





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#13146: [PATCH] help-for-help interferes with buffer order, and displays help in too many windows
  2012-12-11 18:57 bug#13146: [PATCH] help-for-help interferes with buffer order, and displays help in too many windows Kelly Dean
  2012-12-12  9:42 ` martin rudalics
@ 2012-12-16 11:58 ` Kelly Dean
  2012-12-17 13:38   ` martin rudalics
  1 sibling, 1 reply; 6+ messages in thread
From: Kelly Dean @ 2012-12-16 11:58 UTC (permalink / raw)
  To: martin rudalics; +Cc: 13146

[-- Attachment #1: Type: text/plain, Size: 154 bytes --]

> Can you provide a patch for this (using `pop-to-buffer'
> instead of
> `switch-to-buffer-other-window') and test it a bit?
Attached. Works fine for me.

[-- Attachment #2: helphelpbug.patch2 --]
[-- Type: application/octet-stream, Size: 502 bytes --]

--- emacs-24.2/lisp/help-macro.el	2012-08-23 14:33:42.000000000 +0900
+++ emacs-24.2/lisp/help-macro.el.new3	2012-12-16 20:33:13.803381751 +0900
@@ -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*")
+		     (pop-to-buffer " *Metahelp*" nil t)
 		     (and (fboundp 'make-frame)
 			  (not (eq (window-frame (selected-window))
 				   prev-frame))

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#13146: [PATCH] help-for-help interferes with buffer order, and displays help in too many windows
  2012-12-16 11:58 ` Kelly Dean
@ 2012-12-17 13:38   ` martin rudalics
  0 siblings, 0 replies; 6+ messages in thread
From: martin rudalics @ 2012-12-17 13:38 UTC (permalink / raw)
  To: 13146-done; +Cc: Kelly Dean

 > Attached. Works fine for me.

Installed on trunk as revision 111254.  Bug closed.

Thanks, martin





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-12-17 13:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-11 18:57 bug#13146: [PATCH] help-for-help interferes with buffer order, and displays help in too many windows Kelly Dean
2012-12-12  9:42 ` martin rudalics
2012-12-13  8:12   ` Kelly Dean
2012-12-14 10:24     ` martin rudalics
2012-12-16 11:58 ` Kelly Dean
2012-12-17 13:38   ` martin rudalics

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.