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 buffer


From: martin rudalics
Subject: Re: How to make display-buffer automatically focus (e.g. for help buffers)
Date: Mon, 13 Jul 2009 19:31:58 +0200
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

> For instance, using AucTeX the TeX errors are displayed in a buffer
> that uses display-buffer and is writeable; I've seen other similar
> instances before...  It would be nice to be able to have them be
> automatically focused in view mode and dismissed via 'q'.

I haven't installed AucTeX here so I can't tell.  In any case you could
roll your own `display-buffer-function'.  Unfortuantely, the doc-string
of that variable lies because neither `switch-to-buffer-other-window'
nor `find-file-other-window' currently use it ;-)

Basically, you should be able to define a variable which holds the names
of all buffers where you want the view-mode/select-window behavior like

(defvar my-display-buffer-list ...)

write a function like the completely untested

(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]