From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: [Accepted] Add org-agenda-todo-ignore-timestamp Date: Mon, 29 Nov 2010 10:25:29 +0100 (CET) Message-ID: <20101129092530.18985883B81@u016822.science.uva.nl> References: <1290691976-11203-1-git-send-email-julien@danjou.info> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=47709 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PMzzI-0002Vc-A7 for emacs-orgmode@gnu.org; Mon, 29 Nov 2010 04:25:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PMzzG-000860-Rp for emacs-orgmode@gnu.org; Mon, 29 Nov 2010 04:25:32 -0500 Received: from u016822.science.uva.nl ([146.50.39.34]:60778) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PMzzG-00085p-Gy for emacs-orgmode@gnu.org; Mon, 29 Nov 2010 04:25:30 -0500 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Patch 407 (http://patchwork.newartisans.com/patch/407/) is now "Accepted". Maintainer comment: none This relates to the following submission: http://mid.gmane.org/%3C1290691976-11203-1-git-send-email-julien%40danjou.info%3E Here is the original message containing the patch: > Content-Type: text/plain; charset="utf-8" > MIME-Version: 1.0 > Content-Transfer-Encoding: 7bit > Subject: [Orgmode] Add org-agenda-todo-ignore-timestamp > Date: Thu, 25 Nov 2010 18:32:56 -0000 > From: Julien Danjou > X-Patchwork-Id: 407 > Message-Id: <1290691976-11203-1-git-send-email-julien@danjou.info> > To: emacs-orgmode@gnu.org > Cc: Julien Danjou > > * lisp/org-agenda.el: Add org-agenda-todo-ignore-timestamp. > (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item): > Honor org-agenda-todo-ignore-timestamp. > * doc/org.texi: Mention org-agenda-todo-ignore-timestamp. > > Signed-off-by: Julien Danjou > > --- > doc/org.texi | 8 ++++-- > lisp/org-agenda.el | 57 +++++++++++++++++++++++++++++++++++++++++++++++++-- > 2 files changed, 59 insertions(+), 6 deletions(-) > > diff --git a/doc/org.texi b/doc/org.texi > index f391e84..ed1c4bb 100644 > --- a/doc/org.texi > +++ b/doc/org.texi > @@ -7117,13 +7117,15 @@ it more compact: > @item > @vindex org-agenda-todo-ignore-scheduled > @vindex org-agenda-todo-ignore-deadlines > +@vindex org-agenda-todo-ignore-timestamp > @vindex org-agenda-todo-ignore-with-date > Some people view a TODO item that has been @emph{scheduled} for execution or > have a @emph{deadline} (@pxref{Timestamps}) as no longer @emph{open}. > Configure the variables @code{org-agenda-todo-ignore-scheduled}, > -@code{org-agenda-todo-ignore-deadlines}, and/or > -@code{org-agenda-todo-ignore-with-date} to exclude such items from the > -global TODO list. > +@code{org-agenda-todo-ignore-deadlines}, > +@code{org-agenda-todo-ignore-timestamp} and/or > +@code{org-agenda-todo-ignore-with-date} to exclude such items from the global > +TODO list. > @item > @vindex org-agenda-todo-list-sublevels > TODO items may have sublevels to break up the task into subtasks. In > diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el > index a248068..acdc1b2 100644 > --- a/lisp/org-agenda.el > +++ b/lisp/org-agenda.el > @@ -562,6 +562,33 @@ See also the variable `org-agenda-tags-todo-honor-ignore-options'." > :group 'org-agenda-todo-list > :type 'boolean) > > +(defcustom org-agenda-todo-ignore-timestamp nil > + "Non-nil means don't show entries with a timestamp. > +This applies when creating the global todo list. > +Valid values are: > + > +past Don't show entries for today or in the past. > + > +future Don't show entries with a timestamp in the future. > + The idea behind this is that if it has a future > + timestamp, you don't want to think about it until the > + date. > + > +all Don't show any entries with a timestamp in the global todo list. > + The idea behind this is that by setting a timestamp, you > + have already \"taken care\" of this item. > + > +See also `org-agenda-todo-ignore-with-date'. > +See also the variable `org-agenda-tags-todo-honor-ignore-options' if you want > +to make his option also apply to the tags-todo list." > + :group 'org-agenda-skip > + :group 'org-agenda-todo-list > + :type '(choice > + (const :tag "Ignore future timestamp todos" future) > + (const :tag "Ignore past or present timestamp todos" past) > + (const :tag "Ignore all timestamp todos" all) > + (const :tag "Show timestamp todos" nil))) > + > (defcustom org-agenda-todo-ignore-scheduled nil > "Non-nil means, ignore some scheduled TODO items when making TODO list. > This applies when creating the global todo list. > @@ -632,7 +659,8 @@ to make his option also apply to the tags-todo list." > "Non-nil means honor todo-list ...ignore options also in tags-todo search. > The variables > `org-agenda-todo-ignore-with-date', > - `org-agenda-todo-ignore-scheduled' > + `org-agenda-todo-ignore-timestamp', > + `org-agenda-todo-ignore-scheduled', > `org-agenda-todo-ignore-deadlines' > make the global TODO list skip entries that have time stamps of certain > kinds. If this option is set, the same options will also apply for the > @@ -4435,7 +4463,8 @@ the documentation of `org-diary'." > "Do we have a reason to ignore this TODO entry because it has a time stamp?" > (when (or org-agenda-todo-ignore-with-date > org-agenda-todo-ignore-scheduled > - org-agenda-todo-ignore-deadlines) > + org-agenda-todo-ignore-deadlines > + org-agenda-todo-ignore-timestamp) > (setq end (or end (save-excursion (outline-next-heading) (point)))) > (save-excursion > (or (and org-agenda-todo-ignore-with-date > @@ -4458,7 +4487,29 @@ the documentation of `org-diary'." > (> (org-days-to-time (match-string 1)) 0)) > ((eq org-agenda-todo-ignore-deadlines 'past) > (<= (org-days-to-time (match-string 1)) 0)) > - (t (org-deadline-close (match-string 1))))))))) > + (t (org-deadline-close (match-string 1))))) > + (and org-agenda-todo-ignore-timestamp > + (let ((buffer (current-buffer)) > + (regexp > + (concat > + org-scheduled-time-regexp "\\|" org-deadline-time-regexp)) > + (start (point))) > + ;; Copy current buffer into a temporary one > + (with-temp-buffer > + (insert-buffer-substring buffer start end) > + (goto-char (point-min)) > + ;; Delete SCHEDULED and DEADLINE items > + (while (re-search-forward regexp end t) > + (delete-region (match-beginning 0) (match-end 0))) > + (goto-char (point-min)) > + ;; No search for timestamp left > + (when (re-search-forward org-ts-regexp nil t) > + (cond > + ((eq org-agenda-todo-ignore-timestamp 'future) > + (> (org-days-to-time (match-string 1)) 0)) > + ((eq org-agenda-todo-ignore-timestamp 'past) > + (<= (org-days-to-time (match-string 1)) 0)) > + (t)))))))))) > > (defconst org-agenda-no-heading-message > "No heading for this item in buffer or region.") >