emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Re: multiple agenda buffers


From: Matt Lundin
Subject: [O] Re: multiple agenda buffers
Date: Wed, 02 Mar 2011 15:03:43 -0500
User-agent: Gnus/5.110014 (No Gnus v0.14) Emacs/24.0.50 (gnu/linux)

Hi Bastien,

Bastien <address@hidden> writes:

> Hi all,
>
> Suvayu Ali <address@hidden> writes:
>
>> However I was wondering, block agenda commands might work at least for
>> doing multiple searches. But I don't think there is any interactive
>> interface to it.
>
> inspired by this conversation, I have add a new agenda command:
>
>   M-x org-agenda-append-agenda RET
>
> It is bound to `A' in the agenda buffer and lets you append any 
> agenda to the currently displayed one, thus providing some kind
> of interactive interface to build block agendas from simple ones.
>
> I think it's a neat addition -- especially useful when you want 
> to compare to _small_ list of items.
>
> Let me know what you think - and thanks Suvayu for the idea!

Thanks for the new function. However, at the moment, it has destructive
effects if it is called in a buffer other than the agenda buffer, as it
appends the new agenda results to the current buffer and then makes the
buffer read-only. 

Perhaps for now we could throw an error if the append function is called
from outside the agenda:

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index ea822da..f2eac99 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2266,6 +2266,8 @@ Pressing `<' twice means to restrict to the current 
subtree or region
 This function allows interactive building of block agendas.
 Agenda views are separated by `org-agenda-block-separator'."
   (interactive)
+  (unless (string= (buffer-name) org-agenda-buffer-name)
+    (error "Can only append from within agenda buffer"))
   (let ((org-agenda-multi t))
     (org-agenda)
     (widen)))
--8<---------------cut here---------------end--------------->8---
 
Best,
Matt



reply via email to

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