emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* (Possible Feature Request) Hiding Tags in Agenda View/Implementing Contexts in Org
@ 2009-10-07  5:16 Miguel Fernando Cabrera
  2009-10-07 11:29 ` Matt Lundin
  2009-10-08 16:07 ` Martin Pohlack
  0 siblings, 2 replies; 4+ messages in thread
From: Miguel Fernando Cabrera @ 2009-10-07  5:16 UTC (permalink / raw)
  To: emacs-orgmode

Hello all,

We all know of FILETAGS. Those are tags added to all entries in a
file.  That is cool. The only thing I don't like is that all those
tags are shown also in the Agenda, which if it itself restricted to
the file can be redundant.
Is there a way to avoid a specific tag to show up in the Agenda?

Let me tell you what I would do if tha functionality exists, so maybe
you can give me a good alternative.

I have several files, gtd.org (I put the name after a tutorial, but I
don't implement pure gtd) and home.org. One if for work related tasks
and the other for personal projects and task that are usually
performed at home.

I have "work" agenda view that shows my schedule of the tasks I have
in gtd.org (and in other work related org files).  I also have a
"home" agenda view, that is restricted to home.org.

Now, sometimes I have to do something related to a personal project
that can be only accomplished during work-hours. For example schedule
a appointment with the dentist. So far what I have done is that I put
"@work" tag on it.  And below the agenda view for "gtd.org" I put
tags-todo view  looking for headlines tagged "@work":

     ("w" "Things to do at Work"
         (
          (agenda "" ((org-agenda-ndays 1)


                      (org-agenda-sorting-strategy
                       (quote ((agenda time-up priority-down tag-up) )))
                      (org-agenda-files org-files-work)


                      (org-deadline-warning-days 0)

                      ))
          (tags-todo "REFILE")
          (tags-todo "@work") ;; show the stuff from home that can be
done at work as well (etc, calls or  whatever)
          )

         )

org-files-work is a variable set to something like:  (setq
org-files-work '("gtd.org" "scm.org"))


This work fine, however, I would like to see those task on "home.org"
that have been tagged with "@work" in the agenda day-view of
"gtd.org". I think that this can't be done right now. So I thought,
what if I use a FILETAG for those files that belong to the "@work"
context. And in "home.org" only mark those personal tasks donde at
work with the "@work" tag. Then use "org-agenda-skip-function" to skip
those tags that don't have "@work" tag attached in any file (I haven't
written that function yet):

for example:

          ("w" "Things to do at Work"
         (
          (agenda "" ((org-agenda-ndays 1)

                      (org-agenda-skip-function 'my-skip-unless-at-work)
                      (org-agenda-sorting-strategy
                       (quote ((agenda time-up priority-down tag-up) )))
                     (org-agenda-files ("gtd.org", "home.org"))


                      (org-deadline-warning-days 0)

                      ))
          (tags-todo "REFILE")
         )

         )



Too hacky?
Now, to really do what I want would be cool to have a way of saying to
org that don't show the "@work" tag.


I think at the end this is a question of how implement context in a
good way in Org. Any advice or strategy will be really helpful.

BTW, is there some lisp function like "org-entry-tags" to get the tags
of an entry, not reliying in  "re-search-forward"  as in [1]


[1] http://orgmode.org/manual/Special-agenda-views.html#Special-agenda-views

Thank you!

--
Miguel Fernando Cabrera Granados
http://mfcabrera.com
"A los hombres fuertes les pasa lo que a los barriletes; se elevan cuando es
mayor el viento que se opone a su ascenso." - José Ingenieros

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

* Re: (Possible Feature Request) Hiding Tags in Agenda View/Implementing Contexts in Org
  2009-10-07  5:16 (Possible Feature Request) Hiding Tags in Agenda View/Implementing Contexts in Org Miguel Fernando Cabrera
@ 2009-10-07 11:29 ` Matt Lundin
  2009-10-08 16:07 ` Martin Pohlack
  1 sibling, 0 replies; 4+ messages in thread
From: Matt Lundin @ 2009-10-07 11:29 UTC (permalink / raw)
  To: Miguel Fernando Cabrera; +Cc: emacs-orgmode

Miguel Fernando Cabrera <mfcabrera@gmail.com> writes:
>
> Too hacky?
> Now, to really do what I want would be cool to have a way of saying to
> org that don't show the "@work" tag.

I think you might also be able to use the variable org-agenda-filter-preset.

> I think at the end this is a question of how implement context in a
> good way in Org. Any advice or strategy will be really helpful.

I use secondary filtering for this. IMO, it's much faster and more flexible
than having to define multiple custom agenda commands.

> BTW, is there some lisp function like "org-entry-tags" to get the tags
> of an entry, not reliying in  "re-search-forward"  as in [1]

org-get-tags

- Matt

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

* Re: (Possible Feature Request) Hiding Tags in Agenda View/Implementing Contexts in Org
  2009-10-07  5:16 (Possible Feature Request) Hiding Tags in Agenda View/Implementing Contexts in Org Miguel Fernando Cabrera
  2009-10-07 11:29 ` Matt Lundin
@ 2009-10-08 16:07 ` Martin Pohlack
  2009-10-08 18:56   ` Darlan Cavalcante Moreira
  1 sibling, 1 reply; 4+ messages in thread
From: Martin Pohlack @ 2009-10-08 16:07 UTC (permalink / raw)
  To: Miguel Fernando Cabrera; +Cc: emacs-orgmode

Hi Migual, all,

Miguel Fernando Cabrera wrote:
[…]
> I have several files, gtd.org (I put the name after a tutorial, but I
> don't implement pure gtd) and home.org. One if for work related tasks
> and the other for personal projects and task that are usually
> performed at home.

I use a very similar setup as you do, one file for work, one for home.
I tagged the topmost hierarchy in each file with a corresponding tag
(:@work:, :@home:) and use inheritance for context propagation.

I also use distinct agenda views for home and work stuff.

("w" "Agenda and work items at work"
 ((agenda "" ((org-agenda-ndays 1)
              (org-agenda-prefix-format "%?-12t% s")
              (org-agenda-files (quote ("~/Daten/plan_work.org")))
              (org-agenda-skip-function
               (quote (org-agenda-skip-entry-if (quote regexp) "maybe")))))
  (todo "INBOX"
        ((org-agenda-skip-function
          (quote (org-agenda-skip-entry-if (quote scheduled))))
         (org-agenda-files (quote ("~/Daten/plan_work.org")))))
  (stuck "" ((org-agenda-files (quote ("~/Daten/plan_work.org")))))
  (alltodo "" ((org-agenda-skip-function
                (quote (org-agenda-skip-entry-if
                        (quote notregexp) "^\\*+ \\(TICKLER\\|WAITING\\)"
                        (quote regexp) "^\\*+ NEXT .*:ag_"
                        (quote scheduled))))
               (org-agenda-overriding-header
                "Buggy items (missing schedule / agenda):")
               (org-agenda-files (quote ("~/Daten/plan_work.org")))))
  (tags "{^ag_.*}-{^ag_.*_\\(meeting\\|call\\)$}-maybe"
        ((org-agenda-sorting-strategy (quote (tag-up)))
         (org-agenda-skip-function
          (quote
           (org-agenda-skip-subtree-if
            (quote regexp)
            "^\\*+ \\(DONE\\|CANCELED\\|CONTAINER\\|PROJECT\\|MAYBE\\) ")))
         (org-agenda-overriding-header "Agendas (non-regular):")
         (org-agenda-files (quote ("~/Daten/plan_work.org")))))
  (tags "LEVEL>1+@work-maybe-TODO=\"MAYBE\"-TODO=\"DONE\"-TODO=\"CANCELED\"-TODO=\"PROJECT\"-TODO=\"CONTAINER\"-TODO=\"\""
        ((org-agenda-skip-function (quote (org-agenda-skip-entry-if
                                           (quote scheduled)))))))
 ((org-agenda-prefix-format "")))


[…]

> Now, to really do what I want would be cool to have a way of saying to
> org that don't show the "@work" tag.

This sounds like an intriguing feature to me.  For my setup, I
sometimes have each tag twice in each agenda line as refiling inlines
inherited tags.

In my work agenda I have many lines similar to this one:

  In   1 d.:  TODO task A          :@work::@work:

So the @work context is there *three* times on screen:
* from the whole agenda title,
* directly as tag in the task, and
* inherited in the task.

So I have two partially orthogonal feature requests here.
* Could we show tags only once, for example, for cases where a task
  has a tag directly and if it has inherited it?
* Could we have a filter for not showing certain tags in agenda views
  at all, for example, if the tag information would be redundant due
  to information provided by the whole agenda (work agenda -> don't
  show :@work:).

Note that I cannot easily disable tag inheritance in my setup as I use
it also for propagating the :maybe: tag to descendants of projects.

Cheers,
Martin Pohlack

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

* Re: (Possible Feature Request) Hiding Tags in Agenda View/Implementing Contexts in Org
  2009-10-08 16:07 ` Martin Pohlack
@ 2009-10-08 18:56   ` Darlan Cavalcante Moreira
  0 siblings, 0 replies; 4+ messages in thread
From: Darlan Cavalcante Moreira @ 2009-10-08 18:56 UTC (permalink / raw)
  To: Martin Pohlack; +Cc: emacs-orgmode


If you have an org file for work stuff and another one for home stuff, each one
with their respective filetags, then IMHO it is better simply not to set the
@work and @home tags explicitly. If something is work related then refile it to
the work org file instead of setting the @work tag. You lose flexibility, but
avoid this problem.

Darlan

At Thu, 08 Oct 2009 18:07:21 +0200,
Martin Pohlack <mp26@os.inf.tu-dresden.de> wrote:
> 
> Hi Migual, all,
> 
> Miguel Fernando Cabrera wrote:
> […]
> > I have several files, gtd.org (I put the name after a tutorial, but I
> > don't implement pure gtd) and home.org. One if for work related tasks
> > and the other for personal projects and task that are usually
> > performed at home.
> 
> I use a very similar setup as you do, one file for work, one for home.
> I tagged the topmost hierarchy in each file with a corresponding tag
> (:@work:, :@home:) and use inheritance for context propagation.
> 
> I also use distinct agenda views for home and work stuff.
> 
> ("w" "Agenda and work items at work"
>  ((agenda "" ((org-agenda-ndays 1)
>               (org-agenda-prefix-format "%?-12t% s")
>               (org-agenda-files (quote ("~/Daten/plan_work.org")))
>               (org-agenda-skip-function
>                (quote (org-agenda-skip-entry-if (quote regexp) "maybe")))))
>   (todo "INBOX"
>         ((org-agenda-skip-function
>           (quote (org-agenda-skip-entry-if (quote scheduled))))
>          (org-agenda-files (quote ("~/Daten/plan_work.org")))))
>   (stuck "" ((org-agenda-files (quote ("~/Daten/plan_work.org")))))
>   (alltodo "" ((org-agenda-skip-function
>                 (quote (org-agenda-skip-entry-if
>                         (quote notregexp) "^\\*+ \\(TICKLER\\|WAITING\\)"
>                         (quote regexp) "^\\*+ NEXT .*:ag_"
>                         (quote scheduled))))
>                (org-agenda-overriding-header
>                 "Buggy items (missing schedule / agenda):")
>                (org-agenda-files (quote ("~/Daten/plan_work.org")))))
>   (tags "{^ag_.*}-{^ag_.*_\\(meeting\\|call\\)$}-maybe"
>         ((org-agenda-sorting-strategy (quote (tag-up)))
>          (org-agenda-skip-function
>           (quote
>            (org-agenda-skip-subtree-if
>             (quote regexp)
>             "^\\*+ \\(DONE\\|CANCELED\\|CONTAINER\\|PROJECT\\|MAYBE\\) ")))
>          (org-agenda-overriding-header "Agendas (non-regular):")
>          (org-agenda-files (quote ("~/Daten/plan_work.org")))))
>   (tags "LEVEL>1+@work-maybe-TODO=\"MAYBE\"-TODO=\"DONE\"-TODO=\"CANCELED\"-TODO=\"PROJECT\"-TODO=\"CONTAINER\"-TODO=\"\""
>         ((org-agenda-skip-function (quote (org-agenda-skip-entry-if
>                                            (quote scheduled)))))))
>  ((org-agenda-prefix-format "")))
> 
> 
> […]
> 
> > Now, to really do what I want would be cool to have a way of saying to
> > org that don't show the "@work" tag.
> 
> This sounds like an intriguing feature to me.  For my setup, I
> sometimes have each tag twice in each agenda line as refiling inlines
> inherited tags.
> 
> In my work agenda I have many lines similar to this one:
> 
>   In   1 d.:  TODO task A          :@work::@work:
> 
> So the @work context is there *three* times on screen:
> * from the whole agenda title,
> * directly as tag in the task, and
> * inherited in the task.
> 
> So I have two partially orthogonal feature requests here.
> * Could we show tags only once, for example, for cases where a task
>   has a tag directly and if it has inherited it?
> * Could we have a filter for not showing certain tags in agenda views
>   at all, for example, if the tag information would be redundant due
>   to information provided by the whole agenda (work agenda -> don't
>   show :@work:).
> 
> Note that I cannot easily disable tag inheritance in my setup as I use
> it also for propagating the :maybe: tag to descendants of projects.
> 
> Cheers,
> Martin Pohlack
> 
> 
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

end of thread, other threads:[~2009-10-08 19:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-07  5:16 (Possible Feature Request) Hiding Tags in Agenda View/Implementing Contexts in Org Miguel Fernando Cabrera
2009-10-07 11:29 ` Matt Lundin
2009-10-08 16:07 ` Martin Pohlack
2009-10-08 18:56   ` Darlan Cavalcante Moreira

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).