From mboxrd@z Thu Jan 1 00:00:00 1970 From: eric johnson Subject: Re: Proposed tweak to org-agenda-skip-entry-when-regexp-matches-in-subtree Date: Fri, 2 Jul 2010 04:30:57 -0400 Message-ID: References: <87pqzbcont.fsf@gollum.intra.norang.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=38769 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUbeG-0000nf-NV for emacs-orgmode@gnu.org; Fri, 02 Jul 2010 04:31:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OUbeF-0008LX-3L for emacs-orgmode@gnu.org; Fri, 02 Jul 2010 04:31:00 -0400 Received: from mail-px0-f169.google.com ([209.85.212.169]:37805) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUbeE-0008LK-Ry for emacs-orgmode@gnu.org; Fri, 02 Jul 2010 04:30:59 -0400 Received: by pxi17 with SMTP id 17so2862586pxi.0 for ; Fri, 02 Jul 2010 01:30:57 -0700 (PDT) In-Reply-To: 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: Carsten Dominik Cc: Bernt Hansen , "emacs-orgmode@gnu.org" Nope! I solved my issues thanks to Bernt's approach. On Friday, July 2, 2010, Carsten Dominik wrote: > Hi Eric, > > is there still an action item left here? > > Thanks. > > - Carsten > > On Jun 28, 2010, at 2:44 PM, Bernt Hansen wrote: > > > eric johnson writes: > > > org-mode is fantastic. =A0Part of what makes it so awesome is that one ca= n keep > tweaking the software and the process. =A0In looking at my own usage, I > noticed that > I really wanted to simplify my org-todo-keywords. =A0I had a separate > list of TODOs > for projects (PROJ->PRST->DONE) and was wondering why I had to have that. > Why couldn't I just get by with TODO->STARTED->DONE for everything, tasks > and projects, and mark up projects with a tag. > > You can see what I'm aiming for with this example. > > (setq org-tags-exclude-from-inheritance '("project")) > (setq org-todo-keywords '( > =A0 =A0 =A0 =A0 =A0 =A0 (sequence "TODO" "STARTED" "WAITING" "|" "DONE" = "CNCL")) > (setq org-stuck-projects '("project/STARTED" ("TODO" "WAITING" > "STARTED") nil "")) > > * STARTED Stuck project =A0 =A0 =A0 =A0 =A0 :project: > ** DONE This was done > * STARTED Not stuck project =A0 =A0 =A0:project: > ** TODO Next project > > C-a # won't show "Stuck Project". =A0That's because the project line's "S= TARTED" > is found in org-agenda-skip via the > org-agenda-skip-entry-when-regexp-matches-in-subtree. > I really want it to be > org-agenda-skip-entry-when-regexp-ONLY-matches-in-subtree. > > To do that, I hacked up the function to capture a "begin" point after > the headline. > > (defun org-agenda-skip-entry-when-regexp-matches-in-subtree () > =A0"Checks if the current subtree contains match for `org-agenda-skip-reg= exp'. > If yes, it returns the end position of the current entry (NOT the tree), > causing agenda commands to skip the entry but continuing the search in > the subtree. =A0This is a function that can be put into > `org-agenda-skip-function' for the duration of a command. =A0An important > use of this function is for the stuck project list." > =A0(let ((begin (save-excursion (org-end-of-line) (1- (point)))) > =A0 =A0 =A0 =A0(end (save-excursion (org-end-of-subtree t))) > =A0 =A0 =A0 =A0(entry-end (save-excursion (outline-next-heading) (1- (po= int)))) > =A0 =A0 =A0 =A0skip) > =A0 (save-excursion > =A0 =A0 (goto-char begin) > =A0 =A0 (setq skip (re-search-forward org-agenda-skip-regexp end t))) > =A0 (and skip entry-end))) > > If this change is too radical, it might make sense to modify > org-agenda-list-stuck-projects to let the user define the skip function v= ia > an element in org-stuck-projects. > > I'm thinking something like this... > > =A0(let* ((org-agenda-skip-function > =A0 =A0 =A0 =A0 =A0(or (nth 4 org-stuck-projects) > 'org-agenda-skip-entry-when-regexp-matches-in-subtree)) > > That would enable everyone to control the org-agenda-skip-function. > > > Hi Eric, > > I've already moved to this type of a system with lazy project > definitions. =A0I changed my STARTED keyword to NEXT and clocking in > changes TODO to NEXT only if there are no unfinished subtasks for the > headline. > > Stuck project views can be configured in a custom agenda view and that > is what I use now -- I don't use the standard stuck project definition > anymore - I just override the # key selection in the agenda so the keys > are all the same. > > Not changing tasks with actionable subtasks to STARTED or NEXT on clock > in keeps the standard stuck project determination working. =A0So if you > clock time on the top-level task it just stays as TODO since there are > subtasks available to work on. > > Details of my current set up are at http://doc.norang.ca/org-mode.html > > HTH, > Bernt > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > > - Carsten > > > >