emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] org-agenda-other-frame


From: Tory S. Anderson
Subject: [O] org-agenda-other-frame
Date: Mon, 02 Feb 2015 10:01:22 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

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---



reply via email to

[Prev in Thread] Current Thread [Next in Thread]