From mboxrd@z Thu Jan 1 00:00:00 1970 From: Max Mikhanosha Subject: Re: [Sticky Agenda] How to create Agenda Buffers in functions Date: Tue, 03 Apr 2012 20:23:36 -0400 Message-ID: <87limc73av.wl%max@openchat.com> References: <87fwckbv21.fsf@gmx.ch> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from eggs.gnu.org ([208.118.235.92]:47896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFE0j-0004PC-Rl for emacs-orgmode@gnu.org; Tue, 03 Apr 2012 20:23:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SFE0h-0003ld-QI for emacs-orgmode@gnu.org; Tue, 03 Apr 2012 20:23:41 -0400 Received: from openchat.com ([75.99.81.170]:53556 helo=momoland.openchat.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFE0h-0003l7-LU for emacs-orgmode@gnu.org; Tue, 03 Apr 2012 20:23:39 -0400 In-Reply-To: <87fwckbv21.fsf@gmx.ch> 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: emacs-orgmode@gnu.org At 3 Apr 2012 19:10:30 +0200, Sven Bretfeld wrote: > > Hi all > > The Sticky Agenda is something I have been waiting for since a long > time. Thank you very much! > > I want to write a function that creates a new frame with several > windows, each displaying a different Agenda Views. I fail to find a > function that creates special agenda views. Formerly I used > org-batch-agenda for similar purposes. But that doesn't work in the > sticky branch. This is what I have: > > (defun my-gtd-frame () > (interactive) > (save-excursion) > (make-frame '( > (name . "gtd") > (active-alpha . 0.75) > (inactive-alpha . 0.8) > (top . 110) > (left . 2000) > (width . 80) > (height . 40) > (font . "-Adobe-Courier-Medium-R-Normal--18-180-75-75-M-110-ISO8859-1"))) > (select-frame-by-name "gtd") > (toggle-fullscreen) > (org-agenda-goto-today) > (delete-other-windows) > (split-window-horizontally) > (other-window 1) > (org-batch-agenda "OFFICE/NEXT") > ) > This is the same bug as Martyn Jago reported earlier, basically I forgot that separate org agenda commands can be run individually rather then through (org-agenda) function. A temporary workaround in your specific case would be to wrap (org-batch-agenda) call like this: (catch 'exit (org-batch-agenda "OFFICE/NEXT")) I tested it and it seems to work.. The actual fix for the bug will be similar and will be wrapping bodies of (org-todo-list) (org-tags-list) and friends with (catch 'exit), but it needs to be done conditionally as to only do it its called individually and not from (org-agenda)