From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manuel Hermenegildo Subject: Re: Calendar-like view of the org-agenda Date: Fri, 8 Jul 2011 05:11:23 +0200 Message-ID: <19990.30043.951811.390956@72-255-53-162.client.stsn.net> References: <87pqlu5quz.fsf@gnu.org> <87zkky48ol.wl%markert.michael@googlemail.com> <87tyb2qs39.fsf@isil.kanru.info> <8762nigeuk.wl%markert.michael@googlemail.com> <8739iklkgq.fsf@grumps.lan> <878vsbube7.fsf@member.fsf.org> <19988.11619.3400.87930@gazelle.local> <20110707044758.A52F913C56D@vps1.kiwanami.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:55601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qf2Ly-0008QV-1j for emacs-orgmode@gnu.org; Fri, 08 Jul 2011 00:07:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qf2Lx-0000QN-03 for emacs-orgmode@gnu.org; Fri, 08 Jul 2011 00:07:46 -0400 Received: from relay.fi.upm.es ([138.100.8.76]:54607 helo=relay3.fi.upm.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qf2Lw-0000BA-KR for emacs-orgmode@gnu.org; Fri, 08 Jul 2011 00:07:44 -0400 In-Reply-To: Manuel Hermenegildo 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: SAKURAI Masashi Cc: tassilo@member.fsf.org, emacs-orgmode@gnu.org > > Seems like calfw is ignoring the org priorities and order. In my case > > the problem is that calfw is gathering all the tasks ignoring my per > > tag filters. I explain: in my case I only want to see in my agenda > > entries that have a certain tag (my tag): I share org files with other > > people and we assign tasks by marking E.g., I am MH and my tasks are > > like: > > > > * TODO Thank Sakurai for a great tool <2011-07-05 Tue> :MH: > > > > which should appear in my agenda and there are other tasks like: > > > > * TODO Write paper <2011-07-05 Tue> :JF: > > > > which should only appear in JF's agenda. This is done using a custom > > agenda command that filters by tag. > > > > It seems to me too complicated to try to reproduce all the nuances and > > capabilities of org agenda generation (priorities, filtering, custom > > views, etc.) and do it all again in calfw --it would always be very > > hard to keep them in sync. > > I read the code of org-agenda-list and subsequent callee functions. > Indeed it was very hard way and I didn't understand all codes because > I was not a orgmode user. > > Then, I use the function org-agenda-get-day-entries to get schedule > items of the org-agenda-files. The function can receive some arguments > to limit the tasks, but I didn't understand exactly. Do you use this > function? If so, it may be easy to implement a simple filter. ... > org-agenda-get-day-entries can take more > arguments like :scheduled :deadline to help reduce the size of listed > entries. See the docstring of org-diary, which understands the same > list of arguments. I use the "org-agenda-custom-commands" variable and define a command with a filter (this is the recommended way of creating different agendas and todo lists in org). For example, to get an agenda view with only my tasks, which I identfy with the tag "MH" I use (this is my normal agenda view): (setq org-agenda-custom-commands (list (list "a" "Agenda with (only) my tasks (those that have my tag and a date)" '((agenda "" ((org-agenda-skip-function '(my-skip-by-tags-mytag "MH")) (org-agenda-overriding-header "Agenda -- with (only) my tasks (those that have my tag and a date)") )))))) (defun my-skip-by-tags-mytag (tag) "Skip tasks except those that contain tag (with inheritance!)." (let ((line-end (save-excursion (progn (end-of-line) (point))))) ;; return pos (if (or (member tag (org-get-local-tags)) ;; check first if only local (speed) (member tag (org-get-tags-at (point))) ;; rest include inherited tags ) nil ; do not skip line-end))) ; skip, continue after that The issue here is that the filter is a function that checks for inherited tags. I am not sure this can be done with org-agenda-get-day-entries. This is why I was suggesting perhaps using a modified version of org-agenda that would feed data to calfw instead of (or, perhaps even better, in addition to) generating the org agenda views. Or perhaps org-agenda-get-day-entries can be made to call a filter function like the one above? Manuel --