emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Proposed tweak to org-agenda-skip-entry-when-regexp-matches-in-subtree
@ 2010-06-28 11:34 eric johnson
  2010-06-28 12:44 ` Bernt Hansen
  0 siblings, 1 reply; 4+ messages in thread
From: eric johnson @ 2010-06-28 11:34 UTC (permalink / raw)
  To: emacs-orgmode

Hi -

org-mode is fantastic.  Part of what makes it so awesome is that one can keep
tweaking the software and the process.  In looking at my own usage, I
noticed that
I really wanted to simplify my org-todo-keywords.  I 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 '(
              (sequence "TODO" "STARTED" "WAITING" "|" "DONE" "CNCL"))
(setq org-stuck-projects '("project/STARTED" ("TODO" "WAITING"
"STARTED") nil ""))

* STARTED Stuck project           :project:
** DONE This was done
* STARTED Not stuck project      :project:
** TODO Next project

C-a # won't show "Stuck Project".  That's because the project line's "STARTED"
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 ()
  "Checks if the current subtree contains match for `org-agenda-skip-regexp'.
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.  This is a function that can be put into
`org-agenda-skip-function' for the duration of a command.  An important
use of this function is for the stuck project list."
  (let ((begin (save-excursion (org-end-of-line) (1- (point))))
	(end (save-excursion (org-end-of-subtree t)))
	(entry-end (save-excursion (outline-next-heading) (1- (point))))
	skip)
    (save-excursion
      (goto-char begin)
      (setq skip (re-search-forward org-agenda-skip-regexp end t)))
    (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 via
an element in org-stuck-projects.

I'm thinking something like this...

  (let* ((org-agenda-skip-function
           (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.

-Eric

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Proposed tweak to org-agenda-skip-entry-when-regexp-matches-in-subtree
  2010-06-28 11:34 Proposed tweak to org-agenda-skip-entry-when-regexp-matches-in-subtree eric johnson
@ 2010-06-28 12:44 ` Bernt Hansen
  2010-07-02  4:46   ` Carsten Dominik
  0 siblings, 1 reply; 4+ messages in thread
From: Bernt Hansen @ 2010-06-28 12:44 UTC (permalink / raw)
  To: eric johnson; +Cc: emacs-orgmode

eric johnson <johnson.eric@gmail.com> writes:

> org-mode is fantastic.  Part of what makes it so awesome is that one can keep
> tweaking the software and the process.  In looking at my own usage, I
> noticed that
> I really wanted to simplify my org-todo-keywords.  I 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 '(
>               (sequence "TODO" "STARTED" "WAITING" "|" "DONE" "CNCL"))
> (setq org-stuck-projects '("project/STARTED" ("TODO" "WAITING"
> "STARTED") nil ""))
>
> * STARTED Stuck project           :project:
> ** DONE This was done
> * STARTED Not stuck project      :project:
> ** TODO Next project
>
> C-a # won't show "Stuck Project".  That's because the project line's "STARTED"
> 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 ()
>   "Checks if the current subtree contains match for `org-agenda-skip-regexp'.
> 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.  This is a function that can be put into
> `org-agenda-skip-function' for the duration of a command.  An important
> use of this function is for the stuck project list."
>   (let ((begin (save-excursion (org-end-of-line) (1- (point))))
> 	(end (save-excursion (org-end-of-subtree t)))
> 	(entry-end (save-excursion (outline-next-heading) (1- (point))))
> 	skip)
>     (save-excursion
>       (goto-char begin)
>       (setq skip (re-search-forward org-agenda-skip-regexp end t)))
>     (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 via
> an element in org-stuck-projects.
>
> I'm thinking something like this...
>
>   (let* ((org-agenda-skip-function
>            (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.  I 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.  So 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: Proposed tweak to org-agenda-skip-entry-when-regexp-matches-in-subtree
  2010-06-28 12:44 ` Bernt Hansen
@ 2010-07-02  4:46   ` Carsten Dominik
  2010-07-02  8:30     ` eric johnson
  0 siblings, 1 reply; 4+ messages in thread
From: Carsten Dominik @ 2010-07-02  4:46 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode

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 <johnson.eric@gmail.com> writes:
>
>> org-mode is fantastic.  Part of what makes it so awesome is that  
>> one can keep
>> tweaking the software and the process.  In looking at my own usage, I
>> noticed that
>> I really wanted to simplify my org-todo-keywords.  I 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 '(
>>              (sequence "TODO" "STARTED" "WAITING" "|" "DONE" "CNCL"))
>> (setq org-stuck-projects '("project/STARTED" ("TODO" "WAITING"
>> "STARTED") nil ""))
>>
>> * STARTED Stuck project           :project:
>> ** DONE This was done
>> * STARTED Not stuck project      :project:
>> ** TODO Next project
>>
>> C-a # won't show "Stuck Project".  That's because the project  
>> line's "STARTED"
>> 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 ()
>>  "Checks if the current subtree contains match for `org-agenda-skip- 
>> regexp'.
>> 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.  This is a function that can be put into
>> `org-agenda-skip-function' for the duration of a command.  An  
>> important
>> use of this function is for the stuck project list."
>>  (let ((begin (save-excursion (org-end-of-line) (1- (point))))
>> 	(end (save-excursion (org-end-of-subtree t)))
>> 	(entry-end (save-excursion (outline-next-heading) (1- (point))))
>> 	skip)
>>    (save-excursion
>>      (goto-char begin)
>>      (setq skip (re-search-forward org-agenda-skip-regexp end t)))
>>    (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 via
>> an element in org-stuck-projects.
>>
>> I'm thinking something like this...
>>
>>  (let* ((org-agenda-skip-function
>>           (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.  I 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.  So 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Proposed tweak to org-agenda-skip-entry-when-regexp-matches-in-subtree
  2010-07-02  4:46   ` Carsten Dominik
@ 2010-07-02  8:30     ` eric johnson
  0 siblings, 0 replies; 4+ messages in thread
From: eric johnson @ 2010-07-02  8:30 UTC (permalink / raw)
  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 <carsten.dominik@gmail.com> 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 <johnson.eric@gmail.com> writes:
>
>
> org-mode is fantastic.  Part of what makes it so awesome is that one can keep
> tweaking the software and the process.  In looking at my own usage, I
> noticed that
> I really wanted to simplify my org-todo-keywords.  I 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 '(
>              (sequence "TODO" "STARTED" "WAITING" "|" "DONE" "CNCL"))
> (setq org-stuck-projects '("project/STARTED" ("TODO" "WAITING"
> "STARTED") nil ""))
>
> * STARTED Stuck project           :project:
> ** DONE This was done
> * STARTED Not stuck project      :project:
> ** TODO Next project
>
> C-a # won't show "Stuck Project".  That's because the project line's "STARTED"
> 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 ()
>  "Checks if the current subtree contains match for `org-agenda-skip-regexp'.
> 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.  This is a function that can be put into
> `org-agenda-skip-function' for the duration of a command.  An important
> use of this function is for the stuck project list."
>  (let ((begin (save-excursion (org-end-of-line) (1- (point))))
>         (end (save-excursion (org-end-of-subtree t)))
>         (entry-end (save-excursion (outline-next-heading) (1- (point))))
>         skip)
>    (save-excursion
>      (goto-char begin)
>      (setq skip (re-search-forward org-agenda-skip-regexp end t)))
>    (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 via
> an element in org-stuck-projects.
>
> I'm thinking something like this...
>
>  (let* ((org-agenda-skip-function
>           (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.  I 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.  So 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
>
>
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-07-02  8:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-28 11:34 Proposed tweak to org-agenda-skip-entry-when-regexp-matches-in-subtree eric johnson
2010-06-28 12:44 ` Bernt Hansen
2010-07-02  4:46   ` Carsten Dominik
2010-07-02  8:30     ` eric johnson

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).