From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#12708: 24.1; M-x display-time-world "q" close window Date: Wed, 24 Oct 2012 10:44:44 +0300 Organization: JURTA Message-ID: <87objs9uvn.fsf@mail.jurta.org> References: <87txtmkziu.fsf@blah.blah> <50863A2C.1010008@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1351065137 9532 80.91.229.3 (24 Oct 2012 07:52:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Oct 2012 07:52:17 +0000 (UTC) Cc: 12708@debbugs.gnu.org, Kevin Ryde To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 24 09:52:23 2012 Return-path: Envelope-to: geb-bug-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 1TQvlG-0006uI-4o for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Oct 2012 09:52:22 +0200 Original-Received: from localhost ([::1]:57330 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQvl8-0001Ni-GV for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Oct 2012 03:52:14 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQvl1-0001Ml-CZ for bug-gnu-emacs@gnu.org; Wed, 24 Oct 2012 03:52:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQvl0-0003X7-C0 for bug-gnu-emacs@gnu.org; Wed, 24 Oct 2012 03:52:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48415) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQvl0-0003X3-8O for bug-gnu-emacs@gnu.org; Wed, 24 Oct 2012 03:52:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TQvms-0003rH-5g for bug-gnu-emacs@gnu.org; Wed, 24 Oct 2012 03:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Oct 2012 07:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12708 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12708-submit@debbugs.gnu.org id=B12708.135106520214782 (code B ref 12708); Wed, 24 Oct 2012 07:54:02 +0000 Original-Received: (at 12708) by debbugs.gnu.org; 24 Oct 2012 07:53:22 +0000 Original-Received: from localhost ([127.0.0.1]:58665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TQvmE-0003qN-A7 for submit@debbugs.gnu.org; Wed, 24 Oct 2012 03:53:22 -0400 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:44610 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TQvmB-0003qE-Bc for 12708@debbugs.gnu.org; Wed, 24 Oct 2012 03:53:20 -0400 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id BEAEBAAB4B9C; Wed, 24 Oct 2012 00:51:20 -0700 (PDT) In-Reply-To: <50863A2C.1010008@gmx.at> (martin rudalics's message of "Tue, 23 Oct 2012 08:33:16 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:65962 Archived-At: > We could do > > (defun quit-window-kill-buffer (&optional window) > "Quit WINDOW and kill its buffer. > WINDOW must be a live window and defaults to the selected one." > (interactive) > (quit-restore-window window 'kill)) > > (defvar display-time-world-mode-map > (let ((map (make-sparse-keymap))) > (define-key map "q" 'quit-window-kill-buffer) > map) > "Keymap of Display Time World mode.") BTW, when I needed to do the same for the *Occur* buffer (to kill it after going to the occurrence) I created a new command `occur-mode-goto-occurrence-kill-buffer' based on `occur-mode-goto-occurrence-other-window': (defun occur-mode-goto-occurrence-kill-buffer () "Go to the occurrence the current line describes, and kill the Occur buffer." (interactive) (let ((buf (current-buffer)) (pos (occur-mode-find-occurrence))) (switch-to-buffer-other-window (marker-buffer pos)) (goto-char pos) (kill-buffer buf) (run-hooks 'occur-mode-find-occurrence-hook))) I still have no idea how to generalize this common behavior. > But `display-time-world' should probably also use `display-buffer' > instead of `pop-to-buffer' and put the buffer in `view-mode'. After > all, who wants to edit or navigate the *wclock* buffer? In addition to this, it could also use the action `display-buffer-below-selected' (like in dired), and instead of `fit-window-to-buffer' it could use '((window-height . fit-window-to-buffer)).