all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Leo Alekseyev <dnquark@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: How to make display-buffer automatically focus (e.g. for help buffers)
Date: Mon, 13 Jul 2009 19:31:58 +0200	[thread overview]
Message-ID: <4A5B6F8E.9080601@gmx.at> (raw)
In-Reply-To: <14cd9a5d0907130902i71c0ca55q4e6b66ad8d763ac8@mail.gmail.com>

 > 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	other threads:[~2009-07-13 17:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-13 15:10 How to make display-buffer automatically focus (e.g. for help buffers) martin rudalics
2009-07-13 16:02 ` Leo Alekseyev
2009-07-13 17:31   ` martin rudalics [this message]
2009-07-14  1:36     ` Leo Alekseyev
  -- strict thread matches above, loose matches on Subject: below --
2009-07-13 11:12 dnquark

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A5B6F8E.9080601@gmx.at \
    --to=rudalics@gmx.at \
    --cc=dnquark@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.