From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: closing man and help buffers Date: Mon, 19 Aug 2013 17:47:11 +0800 Message-ID: <871u5qau74.fsf@ericabrahamsen.net> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1376905621 32761 80.91.229.3 (19 Aug 2013 09:47:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Aug 2013 09:47:01 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 19 11:47:03 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VBM3D-0007dR-8p for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Aug 2013 11:47:03 +0200 Original-Received: from localhost ([::1]:41881 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBM3C-0002pD-Uy for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Aug 2013 05:47:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBM2v-0002p1-Ji for help-gnu-emacs@gnu.org; Mon, 19 Aug 2013 05:46:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VBM2o-0001SP-KI for help-gnu-emacs@gnu.org; Mon, 19 Aug 2013 05:46:45 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:56090) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBM2o-0001Rv-DB for help-gnu-emacs@gnu.org; Mon, 19 Aug 2013 05:46:38 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VBM2n-0007OM-G1 for help-gnu-emacs@gnu.org; Mon, 19 Aug 2013 11:46:37 +0200 Original-Received: from 114.252.246.79 ([114.252.246.79]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 19 Aug 2013 11:46:37 +0200 Original-Received: from eric by 114.252.246.79 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 19 Aug 2013 11:46:37 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 37 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 114.252.246.79 User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:9NbbHIo2pibpu9alSVTieSfWzcI= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:92980 Archived-At: Luca Ferrari 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