all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: help-gnu-emacs@gnu.org
Subject: Re: closing man and help buffers
Date: Mon, 19 Aug 2013 17:47:11 +0800	[thread overview]
Message-ID: <871u5qau74.fsf@ericabrahamsen.net> (raw)
In-Reply-To: CAKoxK+7jZwUJ2Q2QqKQwMSzgy7YqUfFdQmdX1RxEEOWzGKnWqw@mail.gmail.com

Luca Ferrari <fluca1978@infinito.it> writes:

> Hi all,
> this should be trivial, but I have not found a solution yet: often I
> open a man buffer (M-x man) or an help buffer (e.g., C-h something).
> The behavior is that the window splits and the buffer I was currently
> editing keeps the focus, so to close the other informational buffer I
> have to either use C-x C-b or switch to the buffer and kill it. Is
> there a smarter way to close such buffer (and only it) while keep the
> focus on the editing one? Something like "close the last opened
> buffer" could work.

The advice of the help buffer itself is to use "C-x 1" to get rid of it
-- since successive calls to help or man will reuse those buffers,
that's not too onerous. If you had more than one window to begin with,
of course, it's not nice as it will get rid of *all* the other windows.
I agree that some sort of "close utility window" command would be great,
and please God let it apply to the Quail Completion buffer as well.

Perhaps a fair solution would be a command that calls delete-window for
any buffer matching a list of regexps stored in (for example)
utility-buffer-names. Default to '("\\*Help\\*" "\\*Man*"
"\\*Apropos\\*" "\\*Quail Completions\\*) or something like that.

Untested code:

(defvar utility-buffer-names '("\\*Help\\*" "\\*Man" "\\*Apropos\\*"))

(defun kill-utility-windows ()
  (dolist (w (window-list))
    (dolist (b utility-buffer-names)
      (when (string-match-p b (buffer-name (window-buffer w)))
	(delete-window w))))) 

Probably too simplistic, but could be developed into something....

E




      parent reply	other threads:[~2013-08-19  9:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-19  8:53 closing man and help buffers Luca Ferrari
2013-08-19  9:08 ` Vlad Piersec
2013-08-19  9:55   ` Luca Ferrari
2013-08-19 11:42     ` Tim Visher
2013-08-19 13:42       ` Luca Ferrari
2013-08-19 14:11         ` Michael Heerdegen
2013-08-19 14:36           ` Luca Ferrari
2013-08-19 16:11             ` Michael Heerdegen
     [not found]             ` <mailman.352.1376928704.10748.help-gnu-emacs@gnu.org>
2013-08-19 16:17               ` Dan Espen
2013-08-19 18:17                 ` Óscar Fuentes
     [not found]                 ` <mailman.361.1376936252.10748.help-gnu-emacs@gnu.org>
2013-08-19 18:54                   ` Dan Espen
2013-08-19 20:11                     ` Óscar Fuentes
     [not found]                     ` <mailman.372.1376943131.10748.help-gnu-emacs@gnu.org>
2013-08-19 20:28                       ` Dan Espen
2013-08-19 22:30                         ` Óscar Fuentes
     [not found]                         ` <mailman.382.1376951626.10748.help-gnu-emacs@gnu.org>
2013-08-19 23:26                           ` Dan Espen
2013-08-19  9:47 ` Eric Abrahamsen [this message]

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=871u5qau74.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --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.