From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: commenting out a SCHEDULED line does not remove todo from agenda. Date: Thu, 17 Jan 2013 00:02:05 -0500 Message-ID: <16014.1358398925@alphaville> References: <8696.1358358500@alphaville> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:33043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tvhc9-0001s3-7M for emacs-orgmode@gnu.org; Thu, 17 Jan 2013 00:02:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tvhc7-0003SR-VK for emacs-orgmode@gnu.org; Thu, 17 Jan 2013 00:02:09 -0500 Received: from g4t0015.houston.hp.com ([15.201.24.18]:11440) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tvhc7-0003SN-P0 for emacs-orgmode@gnu.org; Thu, 17 Jan 2013 00:02:07 -0500 In-Reply-To: Message from Nick Dokos of "Wed, 16 Jan 2013 12:48:20 EST." <8696.1358358500@alphaville> 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: Rainer Stengele Cc: emacs-orgmode@gnu.org Nick Dokos wrote: > Rainer Stengele wrote: > > > Hi! > > > > Imagine you have a todo like this: > > > > ***** TODO a task > > SCHEDULED: <2013-01-16 Mi +2m> > > > > Now suppose you want to put that todo on hold. In order to no more see > > the scheduled date in the agenda I comment out the "SCHEDULED" line. > > I do not want to delete it because I maybe need it later again: > > > > > > ***** TODO a task > > # SCHEDULED: <2013-01-16 Mi +2m> > > > > The todo still appears in the agenda. > > Is this not counterintuitive? > > > > Try putting the # in column 1 (untested). > I've now tested it and it is as I thought: the comment character has to be in column 1. The reason is org-agenda-skip: ,---- | (defun org-agenda-skip () | "Throw to `:skip' in places that should be skipped. | Also moves point to the end of the skipped region, so that search can | continue from there." | (let ((p (point-at-bol)) to) | (when (org-in-src-block-p t) (throw :skip t)) | (and org-agenda-skip-archived-trees (not org-agenda-archives-mode) | (get-text-property p :org-archived) | (org-end-of-subtree t) | (throw :skip t)) | (and org-agenda-skip-comment-trees | (get-text-property p :org-comment) | (org-end-of-subtree t) | (throw :skip t)) | (if (equal (char-after p) ?#) (throw :skip t)) | (when (setq to (or (org-agenda-skip-eval org-agenda-skip-function-global) | (org-agenda-skip-eval org-agenda-skip-function))) | (goto-char to) | (throw :skip t)))) `---- It sets p to the point at the beginning of the line and then checks if the character after it is '#'. Only then does it skip the entry. Nick