emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Properties Drawer versus tags


From: Adam Porter
Subject: Re: Properties Drawer versus tags
Date: Fri, 20 Dec 2019 11:17:15 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

I'll try to explain my view of tags.  Let's see if it makes sense.  :)

Conceptually, properties are like a generic key-value store for
headings, and tags are like a certain property.  Imagine if, instead of
tags being placed in headings, like this:

  * Blueberries  :food:fruit:

...tags were implemented as properties, like this:

  * Blueberries
  :PROPERTIES:
  :TAGS: food fruit
  :END:

The meaning would be essentially the same.

>From a technical perspective, putting tags on headings makes them much
faster to search for, because a regexp can be used to search directly to
them (local ones, anyway).  In contrast, to find the next location of a
certain property, a single regexp search is not enough, because even if
a regexp search was done to find an entry like the previous example,
like:

  (re-search-forward
    (rx bol ":TAGS:" (1+ blank) (0+ nonl) bow "food" eow)
    nil t)

...it would not be guaranteed that the result would actually be in a
heading's property drawer, so additional checks must be done to ensure
that.

Some properties are special, like CATEGORY.  As well, some properties
are "virtual," like SCHEDULED, which is written like:

  * Heading
  SCHEDULED: <2019-12-20 Fri 11:00>

...but is accessible with org-entry-get, like a property in a drawer.

So, use tags for applying simple, conceptual labels to headings, because
they're faster to search for than properties and always visible.  Use
properties as a key-value store for details that are less likely to be
used in a query and are less important to see.

What do you think?  :)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]