This is an interactive demonstration of org-supertag’s features. Follow along to learn how to use this powerful tool for your Org workflow.
- Make sure org-supertag is installed and loaded
- Open this file in Emacs
- Follow the demonstrations step by step
org-supertag introduces several powerful concepts:
- Every heading can become a node
- Nodes are uniquely identified
- Nodes can have tags and behaviors
- More than just org-mode tags
- Can have fields and behaviors
- Support hierarchical relationships
- Automatic actions triggered by tags
- Can respond to various events
- Highly customizable
- Powerful node search capabilities
- Support for complex filters
- Export and reuse results
Let’s start with some hands-on examples.
- Position cursor on heading
- Run
M-x org-supertag-node-create
- Notice how the heading gets an ID property
Try it now! ⬇️
Here we’ll explore tag operations.
- Position cursor on heading
- Add a tag with
M-x org-supertag-tag-add-tag
- Try adding these preset tags:
- book
- project
- contact
Let’s see how behaviors work with tags:
- First, add a tag to heading:
- Position cursor on heading
- Run
M-x org-supertag-tag-add-tag
- Choose a tag (e.g. “meeting”)
- Then attach a behavior:
- Run
M-x org-supertag-behavior-attach
- Select the tag you just added
- Choose from available behaviors
- Run
- Try it out:
- The behavior will trigger automatically based on its type
- Use
M-x org-supertag-behavior-execute-at-point
to run manually - Try different behaviors like changing TODO state
- Try
M-x org-supertag-behavior-execute-at-point
- Position cursor on this heading
- Run
M-x org-supertag-behavior-execute-at-point
- It is different from the behavior triggered by the tag
- Execute behavior without parameters
- And execute behavior without styles
- But it can execute behavior immediately, so sometimes it is very useful, especially you don’t want to add tag to the node
Let’s understand different types of behaviors and how to use them:
Basic behaviors are the foundation:
- Simple, single-purpose actions
- Usually modify node properties or content
- Provide parameter types for customization
- Examples:
(org-supertag-behavior-register "@todo"
:trigger :on-add
:action #'org-supertag-behavior--set-todo ; <= This is the action library function, which is defined in org-supertag-behavior-library.el
:params '(state) ; <= This is the parameter type
:style '(:face (:foreground "blue" :weight bold) ; <= This is the style, contains face and prefix
:prefix "☐"))
Built upon basic behaviors:
- Specialized for specific use cases
- Pre-configured parameter sets
- Examples:
(org-supertag-behavior-register "@done"
:trigger :on-add
:list '("@todo=DONE") ; <= This is the parameter set, is the basic behavior "@todo" with parameter "DONE"
:style '(:face (:foreground "green" :weight bold)
:prefix "✓"))
Chain multiple behaviors for workflows:
- Compose multiple behaviors
- Create task-specific workflows
- Examples:
(org-supertag-behavior-register "@done+archive"
:trigger :on-add
:list '("@todo=DONE" ; <= :list can be a list of behaviors
"@property=ARCHIVE_TIME,now" ; <= Format is "@property=NAME=VALUE", where = separates the behavior name, property name and property value
"@archive") ; <= This is the behavior "@archive" with no parameters
:style '(:face (:foreground "gray50" :strike-through t)
:prefix "📦"))
- :trigger - When to run (:on-add, :on-remove, :on-change, etc.)
- :action - Function from behavior library
- :params - Parameters the behavior accepts
- :style - Visual appearance with face and prefix
- :on-add - When tag is added
- :on-remove - When tag is removed
- :on-change - When node is modified
- :always - On all events
Try these behaviors in the Exercise Area below!
Time to explore the query system:
- Create several nodes with different tags
- Use
M-x org-supertag-query
to find them - Export results to a new buffer
Here’s how to use org-supertag for knowledge management:
Create new tag “book” to track your reading:
- Position cursor to this heading
- Run
M-x org-supertag-tag-add-tag
- Insert “book” as tag name
- Run
org-supertag-tag-set-field-and-value
- Fill in the fields and values:
- Title: “The Art of Computer Programming”
- Author: “Donald Knuth”
- Status: “Reading”
- Attach behavior to this tag:
- Run
M-x org-supertag-behavior-attach
- Select “book” as tag
- Choose “todo” behavior
- Run
Now you can use M-x org-supertag-query
to find all books:
- Run
M-x org-supertag-query
- Insert “book” as keyword
- Try to export the result
Use @research tag for research notes:
- Add some research notes
- Tag them appropriately
- Use queries to find related notes
Example of using org-supertag for projects:
- Add “project” tag
- Add some tasks with “task” tag
- Use
M-x org-supertag-node-create
for quick node creation - Try tag completion with TAB
- Use query history for frequent searches
- Combine multiple tags
- Create custom behaviors
- Export query results
Now you’ve seen the main features of org-supertag in action!
For more information:
- Check the documentation with
M-x describe-package RET org-supertag
- Visit the GitHub repository
- Try creating your own workflows
Use this area to practice what you’ve learned: