From mboxrd@z Thu Jan 1 00:00:00 1970 From: torys.anderson@gmail.com (Tory S. Anderson) Subject: org-agenda-other-frame Date: Mon, 02 Feb 2015 10:01:22 -0500 Message-ID: <87pp9s4at9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIIVE-0005ND-Sp for emacs-orgmode@gnu.org; Mon, 02 Feb 2015 10:01:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIIVB-00030d-KJ for emacs-orgmode@gnu.org; Mon, 02 Feb 2015 10:01:28 -0500 Received: from mail-yh0-x22b.google.com ([2607:f8b0:4002:c01::22b]:36629) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIIVB-00030V-GZ for emacs-orgmode@gnu.org; Mon, 02 Feb 2015 10:01:25 -0500 Received: by mail-yh0-f43.google.com with SMTP id 29so16095034yhl.2 for ; Mon, 02 Feb 2015 07:01:24 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: orgmode list I have a key which calls `gnus-other-frame`, a handy function that not only pops up a gnus frame, but also kills the frame when I exit gnus. I'd like something similar with my org agenda; the following function is used to pop it up, but I'm not sure how to kill the frame when I hit close the agenda (i.e. hitting `q`). The result should work whether I'm using sticky agenda or not. Any suggestions? --8<---------------cut here---------------start------------->8--- (defun go-or-make-agenda (&optional new-frame) (interactive "P") (let ((buffer org-agenda-buffer-name) (my-switch-function (if new-frame 'switch-to-buffer-other-frame 'switch-to-buffer))) (if (get-buffer buffer) (funcall my-switch-function buffer) (org-agenda-list)))) --8<---------------cut here---------------end--------------->8---