help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to make display-buffer automatically focus (e.g. for help buffe


From: Leo Alekseyev
Subject: Re: How to make display-buffer automatically focus (e.g. for help buffers)
Date: Mon, 13 Jul 2009 21:36:36 -0400

this is going in the right direction, but isn't working
First, the comparison should be
(when (member (buffer-name buffer-or-name) my-display-buffer-list)

and the function should return a window

However, even so it doesn't work: because the buffer is supposed to
display a message, you can't enable the view mode right after spawning
it -- because then you can't write to it.  I actually don't see how
you can get around this.

But even without the view mode, the (select-window window) doesn't
appear to focus the buffer...
>
> (defun my-display-buffer (buffer-or-name flag)
>  (let (display-buffer-function window)
>    (setq window (display-buffer buffer-or-name flag))
>    (when (memq buffer-or-name my-display-buffer-list)
>      (select-window window)
>      (view-mode 1))))
>
> customize `display-buffer-function' to `my-display-buffer' and tell me
> whether it does what you want.
>
> martin
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]