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 03:54:13 -0500 Message-ID: <17512.1358412853@alphaville> References: <8696.1358358500@alphaville> <16014.1358398925@alphaville> <717C030F-136F-46CA-B0C0-5F9CB3560921@gmail.com> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:46530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvlEn-0000sQ-37 for emacs-orgmode@gnu.org; Thu, 17 Jan 2013 03:54:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvlEl-0005dA-W1 for emacs-orgmode@gnu.org; Thu, 17 Jan 2013 03:54:16 -0500 Received: from g5t0008.atlanta.hp.com ([15.192.0.45]:42673) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvlEl-0005d3-Qd for emacs-orgmode@gnu.org; Thu, 17 Jan 2013 03:54:15 -0500 In-Reply-To: Message from Carsten Dominik of "Thu, 17 Jan 2013 07:41:36 +0100." <717C030F-136F-46CA-B0C0-5F9CB3560921@gmail.com> 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: Carsten Dominik Cc: Rainer Stengele , emacs-orgmode@gnu.org Carsten Dominik wrote: > > On 17.1.2013, at 06:02, Nick Dokos wrote: > > > ... > > 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. > > And this is done for speed. Maybe Moore's law has progressed enough to relax this assumption? > For me, probably yes: my agenda is fairly simple. More complicated agendas still seem to take a fairly substantial time to construct however - Bastien spent considerable effort recently to speed up the agenda and might look askance at any attempt to slow it down :-) But actual numbers would carry more weight than any guesses I might make. Here is a (probably stupid) implementation of the generalized mechanism. In org-agenda-skip, replace (if (equal (char-after p) ?#) (throw :skip t)) with (save-excursion (goto-char p) (skip-chars-forward "[:blank:]") (if (equal (char-after) ?#) (throw :skip t))) Assuming it's correct (and no better implementation is suggested), maybe somebody with a time-consuming agenda can try profiling with and without the generalized mechanism and let us know. I tried with my agenda which calls org-agenda-skip 5768 times. Without the mod, they took 0.13s; with the mod, they took 0.19s, so that's a 50% increase - but the overall time was actually shorter in the second case: 1.64s vs 1.72s. The data look noisy however (I only tried it once in each case) so it's hard to say anything meaningful. I'd need to run many more experiments before I'd trust these numbers. Nick