aartist
aartist

Reputation: 3236

Re-organizing in org-mode

In org-mode, I have a simple list of items, with multiple tags (C-c C-c). I like convert this in such a way that I can display each tag as different header and see the items under that tag. For example, if I have tags 'company' and 'fruit' applied to the item 'apple' , then I like to see 'company' and 'fruit' as header and see the 'apple' as item under both of them. I have many other items and I like to combine them. So I can have all fruits under 'fruit' header etc..

Upvotes: 1

Views: 1156

Answers (2)

R. P. Dillon
R. P. Dillon

Reputation: 2850

The best approach is to use agenda views.

To do this, add your current file(s) to org-agenda-files and then use the org-agenda command. The m option allows you to perform a tag matching search across all your agenda files. So, for example, if you wanted to list all the headlines tagged with "company" in a list, you could do so with C-c a m company <enter>

Upvotes: 3

Herbert Sitz
Herbert Sitz

Reputation: 22256

Org-mode isn't made in a way that encourages you to reorganize your .org documents this way. Instead, you should do agenda searches that give you a dynamic view of what you want to see. E.g., if you do an agenda search for the tags 'company' and 'fruit', the agenda buffer will show all headings that have both of those tags.

As far as having a document that consists of a list of tags, without actual headings, I don't think Org would work that way very well. For example, take the case where you say you have three tags: 'company', 'fruit', and 'apple'. In a normal Org document all three of those tags would apply to the heading. They would not apply to each other. So if you have a case where 'company' and 'fruit' apply to apple then 'apple would have to be the headline, like this:

* Apple    :company:fruit:

It makes no sense to have a blank headline that has just tags, since as I said the tags are intended to apply to the headline text, not to each other. So this doesn't really make any sense:

:company:fruit:apple:

What you could do is have a document like this:

* apple   :fruit:company:
* fruit  :apple:company:
* company :fruit:apple:

And in that case the agenda searches would show what you want. But the document has some redundancy, since same term shows up in different cases as both heading and as a tag.

Upvotes: 1

Related Questions