unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Some way to have cursor focus on help windows automatically?
@ 2007-10-19  0:36 Philip
  2007-10-19 13:00 ` Juanma Barranquero
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Philip @ 2007-10-19  0:36 UTC (permalink / raw)
  To: help-gnu-emacs

Emacs 22.1 - currently undergoing the pain of XEmacs -> GNU emacs
transition ...

When I do C-h <whatever> and the buffer-window splits to display the
help buffer, I want the focus to go to the help buffer so I can just
to "q" to get rid of it. So much more convenient what C-x 1 in the
original buffer. Any way to set this?

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

* Re: Some way to have cursor focus on help windows automatically?
  2007-10-19  0:36 Some way to have cursor focus on help windows automatically? Philip
@ 2007-10-19 13:00 ` Juanma Barranquero
  2007-10-19 13:30   ` William Xu
  2007-10-20 22:00   ` Allan Gottlieb
  2007-10-19 13:33 ` William Xu
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 12+ messages in thread
From: Juanma Barranquero @ 2007-10-19 13:00 UTC (permalink / raw)
  To: Philip@kime.org.uk; +Cc: help-gnu-emacs

On 10/19/07, Philip@kime.org.uk <Philip@kime.org.uk> wrote:

> When I do C-h <whatever> and the buffer-window splits to display the
> help buffer, I want the focus to go to the help buffer so I can just
> to "q" to get rid of it. So much more convenient what C-x 1 in the
> original buffer. Any way to set this?

Take a look at ehelp.el (it's included in the standard distribution).
It makes many help functions to be "electric" (which is similar to
what you are looking for).

             Juanma

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

* Re: Some way to have cursor focus on help windows automatically?
  2007-10-19 13:00 ` Juanma Barranquero
@ 2007-10-19 13:30   ` William Xu
  2007-10-19 13:42     ` Juanma Barranquero
  2007-10-20 22:00   ` Allan Gottlieb
  1 sibling, 1 reply; 12+ messages in thread
From: William Xu @ 2007-10-19 13:30 UTC (permalink / raw)
  To: help-gnu-emacs

"Juanma Barranquero" <lekktu@gmail.com> writes:

> Take a look at ehelp.el (it's included in the standard distribution).
> It makes many help functions to be "electric" (which is similar to
> what you are looking for).

Seems it doesn't comply with normal help functions' behaviour. The help
window is not always created by splitting current window half and half.

-- 
William

http://williamxu.net9.org

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

* Re: Some way to have cursor focus on help windows automatically?
  2007-10-19  0:36 Some way to have cursor focus on help windows automatically? Philip
  2007-10-19 13:00 ` Juanma Barranquero
@ 2007-10-19 13:33 ` William Xu
  2007-10-19 18:43 ` Andrew Walrond
       [not found] ` <mailman.2295.1192798813.18990.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 12+ messages in thread
From: William Xu @ 2007-10-19 13:33 UTC (permalink / raw)
  To: help-gnu-emacs

Philip@kime.org.uk writes:

> When I do C-h <whatever> and the buffer-window splits to display the
> help buffer, I want the focus to go to the help buffer so I can just
> to "q" to get rid of it. So much more convenient what C-x 1 in the
> original buffer. Any way to set this?

I have the following in my .emacs.

;; help/doc buffers
;; ----------------

(defun xwl-jump-to-help ()
  "Focus cusor on the help-mode buffer."
  (unless (eq major-mode 'help-mode)
    (other-window 1)))

(defadvice describe-mode (after jump-to-help)
  (xwl-jump-to-help))

(defadvice describe-bindings (after jump-to-help)
  (xwl-jump-to-help))

(defadvice describe-function (after jump-to-help)
  (xwl-jump-to-help))

(defadvice describe-variable (after jump-to-help)
  (xwl-jump-to-help))

(defadvice describe-key (after jump-to-help)
  (xwl-jump-to-help))

(ad-activate 'describe-mode)
(ad-activate 'describe-bindings)
(ad-activate 'describe-function)
(ad-activate 'describe-variable)
(ad-activate 'describe-key)

-- 
William

http://williamxu.net9.org

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

* Re: Some way to have cursor focus on help windows automatically?
  2007-10-19 13:30   ` William Xu
@ 2007-10-19 13:42     ` Juanma Barranquero
  2007-10-19 14:06       ` William Xu
  0 siblings, 1 reply; 12+ messages in thread
From: Juanma Barranquero @ 2007-10-19 13:42 UTC (permalink / raw)
  To: William Xu; +Cc: help-gnu-emacs

On 10/19/07, William Xu <william.xwl@gmail.com> wrote:

> Seems it doesn't comply with normal help functions' behaviour. The help
> window is not always created by splitting current window half and half.

I'm not sure I understand you, but if I do, that's a feature. Why
would you want a window of half the previous window's size to show a
help just two or three lines high?

             Juanma

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

* Re: Some way to have cursor focus on help windows automatically?
  2007-10-19 13:42     ` Juanma Barranquero
@ 2007-10-19 14:06       ` William Xu
  2007-10-19 14:12         ` Juanma Barranquero
  0 siblings, 1 reply; 12+ messages in thread
From: William Xu @ 2007-10-19 14:06 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: help-gnu-emacs

"Juanma Barranquero" <lekktu@gmail.com> writes:

> I'm not sure I understand you, but if I do, that's a feature. Why
> would you want a window of half the previous window's size 

It's the default behaviour of the standard emacs help functions. I think
developers have their points.

> to show a help just two or three lines high?

Thinking of that the docstring is often much longer than just two of
three lines. 

-- 
William

http://williamxu.net9.org

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

* Re: Some way to have cursor focus on help windows automatically?
  2007-10-19 14:06       ` William Xu
@ 2007-10-19 14:12         ` Juanma Barranquero
  2007-10-19 14:29           ` William Xu
  0 siblings, 1 reply; 12+ messages in thread
From: Juanma Barranquero @ 2007-10-19 14:12 UTC (permalink / raw)
  To: William Xu; +Cc: help-gnu-emacs

On 10/19/07, William Xu <william.xwl@gmail.com> wrote:

> It's the default behaviour of the standard emacs help functions.

I don't follow. ehelp is optional, and its behavior is
fit-window-to-buffer. Which is the problem again?

> I think developers have their points.

Meaning?

> Thinking of that the docstring is often much longer than just two of
> three lines.

Yes. How does that represent a problem with ehelp?

             Juanma

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

* Re: Some way to have cursor focus on help windows automatically?
  2007-10-19 14:12         ` Juanma Barranquero
@ 2007-10-19 14:29           ` William Xu
  2007-10-19 14:36             ` Juanma Barranquero
  0 siblings, 1 reply; 12+ messages in thread
From: William Xu @ 2007-10-19 14:29 UTC (permalink / raw)
  To: help-gnu-emacs

"Juanma Barranquero" <lekktu@gmail.com> writes:

> I don't follow. ehelp is optional, and its behavior is
> fit-window-to-buffer. Which is the problem again?

[...]

> Yes. How does that represent a problem with ehelp?

Actually i was just saying that it behaves differently from usual help
functions, not that it's a problem with ehelp. 

Maybe simply people have different tastes.

-- 
William

http://williamxu.net9.org

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

* Re: Some way to have cursor focus on help windows automatically?
  2007-10-19 14:29           ` William Xu
@ 2007-10-19 14:36             ` Juanma Barranquero
  0 siblings, 0 replies; 12+ messages in thread
From: Juanma Barranquero @ 2007-10-19 14:36 UTC (permalink / raw)
  To: William Xu; +Cc: help-gnu-emacs

On 10/19/07, William Xu <william.xwl@gmail.com> wrote:

> Actually i was just saying that it behaves differently from usual help
> functions

Well, yes, but the fact that the ehelp *Help* buffer is electric (it
disappears when you type "q", for example) is a bigger departure from
"standard helpiness" that the size of the window...

> Maybe simply people have different tastes.

Sure. One of the things I hate most when I start Emacs without my
.emacs is having to type C-x 0 or C-x 1 all the time...

             Juanma

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

* Re: Some way to have cursor focus on help windows automatically?
  2007-10-19  0:36 Some way to have cursor focus on help windows automatically? Philip
  2007-10-19 13:00 ` Juanma Barranquero
  2007-10-19 13:33 ` William Xu
@ 2007-10-19 18:43 ` Andrew Walrond
       [not found] ` <mailman.2295.1192798813.18990.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 12+ messages in thread
From: Andrew Walrond @ 2007-10-19 18:43 UTC (permalink / raw)
  To: Philip; +Cc: help-gnu-emacs

Philip@kime.org.uk wrote:
> Emacs 22.1 - currently undergoing the pain of XEmacs -> GNU emacs
> transition ...
> 
> When I do C-h <whatever> and the buffer-window splits to display the
> help buffer, I want the focus to go to the help buffer so I can just
> to "q" to get rid of it. So much more convenient what C-x 1 in the
> original buffer. Any way to set this?
> 

Not exactly what you want, but this causes the selected window types to
use the current window, with focus:

; Make some buffers which by default appear in the 'other' window
; appear in the current window.
(nconc same-window-buffer-names '("*Buffer List*" "*Help*"))


Andrew Walrond

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

* Re: Some way to have cursor focus on help windows automatically?
       [not found] ` <mailman.2295.1192798813.18990.help-gnu-emacs@gnu.org>
@ 2007-10-19 22:45   ` Philip
  0 siblings, 0 replies; 12+ messages in thread
From: Philip @ 2007-10-19 22:45 UTC (permalink / raw)
  To: help-gnu-emacs

On Oct 19, 6:00 am, "Juanma Barranquero" <lek...@gmail.com> wrote:

> Take a look at ehelp.el (it's included in the standard distribution).
> It makes many help functions to be "electric" (which is similar to
> what you are looking for).

Perfect - that's exactly what I wanted, thanks. So nice that it fits
to the doctring size too. No more crippling C-x 1 ...

PK

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

* Re: Some way to have cursor focus on help windows automatically?
  2007-10-19 13:00 ` Juanma Barranquero
  2007-10-19 13:30   ` William Xu
@ 2007-10-20 22:00   ` Allan Gottlieb
  1 sibling, 0 replies; 12+ messages in thread
From: Allan Gottlieb @ 2007-10-20 22:00 UTC (permalink / raw)
  To: help-gnu-emacs

At Fri, 19 Oct 2007 15:00:07 +0200 Juanma Barranquero <lekktu@gmail.com> wrote:

> On 10/19/07, Philip@kime.org.uk <Philip@kime.org.uk> wrote:
>
>> When I do C-h <whatever> and the buffer-window splits to display the
>> help buffer, I want the focus to go to the help buffer so I can just
>> to "q" to get rid of it. So much more convenient what C-x 1 in the
>> original buffer. Any way to set this?

This is very nice.  Thanks for pointing it out.  For anyone wanting to
try it, just add these four lines to .emacs.

(require 'ehelp)
(define-key global-map "\C-h" 'ehelp-command)
(define-key global-map [help] 'ehelp-command)
(define-key global-map [f1] 'ehelp-command)

allan

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

end of thread, other threads:[~2007-10-20 22:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-19  0:36 Some way to have cursor focus on help windows automatically? Philip
2007-10-19 13:00 ` Juanma Barranquero
2007-10-19 13:30   ` William Xu
2007-10-19 13:42     ` Juanma Barranquero
2007-10-19 14:06       ` William Xu
2007-10-19 14:12         ` Juanma Barranquero
2007-10-19 14:29           ` William Xu
2007-10-19 14:36             ` Juanma Barranquero
2007-10-20 22:00   ` Allan Gottlieb
2007-10-19 13:33 ` William Xu
2007-10-19 18:43 ` Andrew Walrond
     [not found] ` <mailman.2295.1192798813.18990.help-gnu-emacs@gnu.org>
2007-10-19 22:45   ` Philip

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).