← 12. Export & Publishing

Chapter 13: Advanced Features and the Org Ecosystem

You’ve learned the essentials. You could stop here and have a productive Org-Mode workflow. But Org-Mode goes deeper. Much deeper.

This chapter explores the advanced features and extensions that make Org-Mode practically inexhaustible.

1. Advanced Agenda Features

1.1. Stuck Projects

Identify projects without next actions:

(setq org-stuck-projects
      '("+PROJECT/-DONE" ("TODO" "NEXT") nil ""))

C-c a # - Show stuck projects

Projects are headings tagged PROJECT without any TODO/NEXT items. These need attention—no next action defined.

1.2. Custom Agenda Commands: Advanced

Block agendas with search:

(setq org-agenda-custom-commands
      '(("w" "Work Dashboard"
         ((agenda "" ((org-agenda-span 1)))
          (tags-todo "+work+PRIORITY=\"A\"")
          (tags-todo "+work-PRIORITY=\"A\"")
          (tags "+work+SCHEDULED>=\"<today>\"")))))

Combine agenda views, searches, filters—build mission control dashboards.

1.3. Agenda Skip Functions

Programmatically exclude items:

(defun my-skip-unless-high-priority ()
  (let ((next-headline (save-excursion (or (outline-next-heading) (point-max)))))
    (if (not (string= (org-get-priority (current-buffer)) "A"))
        next-headline
      nil)))

(setq org-agenda-custom-commands
      '(("h" "High Priority"
         tags-todo "work"
         ((org-agenda-skip-function 'my-skip-unless-high-priority)))))

Ultimate filtering control.

1.4. Calendar Integration

Sync with external calendars:

(setq org-agenda-include-diary t)

Org agenda shows diary entries (birthdays, holidays, appointments).

2. Encryption with org-crypt

Encrypt sensitive headings:

(require 'org-crypt)
(org-crypt-use-before-save-magic)
(setq org-tags-exclude-from-inheritance '("crypt"))
(setq org-crypt-key "your-gpg-key-id")

Tag heading with :crypt::

#+begin_example

3. Passwords   crypt

MyBank: password123 Email: supersecret456 #+end_example

Save file → heading encrypts automatically:

#+begin_example

4. Passwords   crypt

–—BEGIN PGP MESSAGE–— [encrypted content] –—END PGP MESSAGE–— #+end_example

Open file → Org decrypts on demand. Plain text security.

5. Attachments

Attach files to headings:

C-c C-a a - Attach file

Org creates directory structure:

~/org/data/
  └── ab/
      └── 123abc-def4-5678-90ab-cdef12345678/
          ├── document.pdf
          └── image.png

Unique ID per heading. Files travel with your org files.

C-c C-a o - Open attachment C-c C-a f - Browse attachment directory

Reference attachments in exports. Everything in one ecosystem.

6. Advanced Properties and Column View

6.1. Formulas in Column View

Remember column view? Add calculations:

#+COLUMNS: %25ITEM %ESTIMATE{+} %ACTUAL{+} %REMAINING

The {+} sums values. Parent headings show totals.

6.2. Dynamic Blocks from Properties

Create reports:

#+BEGIN: columnview :hlines 1 :id local :format "%ITEM %EFFORT{+} %CLOCKSUM{+}"
#+END:

Generates effort vs. actual time reports. Track estimation accuracy.

7. Org-Babel: Advanced Techniques

7.1. Remote Code Execution

Execute code on remote machines:

#+BEGIN_SRC shell :dir /ssh:user@remote:/path/to/dir
ls -la
#+end_src

Tramp integration. Document remote operations.

7.2. Data Pipeline

Chain multiple languages:

#+BEGIN_SRC shell :results output
curl -s https://api.example.com/data.json
#+end_src
import json
parsed = json.loads(data)
return [[item['name'], item['value']] for item in parsed['items']]
plot(dataset)

Fetch with shell → Parse with Python → Visualize with R. All in one document.

7.3. Unit Tests in Documentation

#+begin_example

8. Function: calculate_tax

def calculate_tax(income, rate=0.2):
    return income * rate

#+end_example

9. Tests

assert calculate_tax(100, 0.2) == 20
assert calculate_tax(0) == 0
assert calculate_tax(50) == 10
print("All tests passed!")

Tests live with documentation. Update function → re-run tests.

10. Org-Roam: Zettelkasten for Org

For serious knowledge management, add org-roam:

(use-package org-roam
  :custom
  (org-roam-directory "~/org-roam/")
  :bind (("C-c n l" . org-roam-buffer-toggle)
         ("C-c n f" . org-roam-node-find)
         ("C-c n i" . org-roam-node-insert))
  :config
  (org-roam-db-autosync-mode))

Features:

  • Bidirectional links (see what links to current note)
  • Network graph of knowledge
  • Daily notes
  • Tag-based organization

Roam transforms org files into a personal Wikipedia.

11. Org-Agenda + Email Integration

With mu4e or notmuch email:

(setq org-capture-templates
      '(("e" "Email TODO" entry (file "~/org/inbox.org")
         "* TODO Reply to %:from about %:subject\n  %a\n  %i")))

Reading email, press capture key → creates TODO with link back to email. Never lose track of email actions.

12. Habit Tracking: Advanced

Track multiple habits with different intervals:

#+begin_example

13. TODO Exercise   health

14. TODO Weekly Review   gtd

15. TODO Meditation   wellness

#+end_example

Agenda shows consistency graphs for each. Visual accountability.

16. Mobile Org

Access org files on mobile:

Options:

  • Beorg (iOS) - Native org-mode app
  • Orgzly (Android) - Full-featured org client
  • Dropbox/Syncthing - Sync files, edit in plain text apps

Some sync via Dropbox/Git, others via MobileOrg protocol.

Capture on phone → appears in Emacs. Seamless mobile integration.

17. Version Control Integration

Org files are plain text. Use git:

cd ~/org
git init
git add .
git commit -m "Initial commit"

Now:

  • Track changes
  • Revert mistakes
  • Sync across machines
  • Collaborate with others

Org + Git = distributed, versioned knowledge base.

18. Archiving Strategies

Advanced archiving:

(setq org-archive-location "archive/%s_archive::")

Creates archive/ directory with per-file archives.

Or archive to date trees:

(setq org-archive-location "~/org/archive.org::datetree/")

All archived items in one file, organized by date.

19. Org-Protocol: Browser Integration

Capture from browser:

  1. Set up org-protocol handler
  2. Create bookmarklet
  3. Click on any web page → Emacs capture opens

Instant web-to-org pipeline.

Example bookmarklet:

javascript:location.href='org-protocol://capture?template=w&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection())

Read article → click → captured with link and selected text.

20. Custom Link Types: Real Examples

Jira integration:

(org-link-set-parameters "jira"
  :follow (lambda (issue)
            (browse-url (concat "https://jira.mycompany.com/browse/" issue))))

Use: [[jira:PROJ-123][Bug fix]]

Local file with line number:

(org-link-set-parameters "line"
  :follow (lambda (path)
            (let ((parts (split-string path ":")))
              (find-file (car parts))
              (goto-line (string-to-number (cadr parts))))))

Use: [[line:/path/to/file.py:42][Implementation]]

Shell command links:

(org-link-set-parameters "cmd"
  :follow (lambda (command)
            (async-shell-command command)))

Use: [[cmd:docker ps][Check containers]]

Infinitely extensible.

21. Effort and Clocksum Reporting

Generate effort reports:

#+BEGIN: columnview :hlines 2 :id local :format "%50ITEM(Task) %10EFFORT(Estimated){:} %10CLOCKSUM(Actual){:}"
#+END:

Compare estimated vs. actual across projects. Improve estimates over time.

22. Org-Edna: Task Dependencies

Complex task dependencies:

(use-package org-edna
  :config
  (org-edna-mode))

Define:

#+begin_example

23. TODO Task A

24. NEXT Task B

#+end_example

Complete Task A → Task B auto-changes to TODO. Task B can’t complete until Task A done.

Advanced workflows in plain text.

25. Presentations with Org-Tree-Slide

Present directly from org:

(use-package org-tree-slide)

M-x org-tree-slide-mode

Each top-level heading becomes a slide. Navigate with arrow keys. Simple presentations without leaving Emacs.

26. Org-Drill: Spaced Repetition

Flashcards in org:

#+begin_example

27. Question   drill

What is the capital of France?

27.1. Answer

Paris #+end_example

M-x org-drill - Start drill session

Spaced repetition learning from plain text.

28. Custom TODO State Triggers

Auto-actions on state changes:

(setq org-todo-state-tags-triggers
      '(("CANCELLED" ("CANCELLED" . t))
        ("WAITING" ("WAITING" . t))
        (done ("WAITING"))
        ("TODO" ("WAITING") ("CANCELLED"))
        ("DONE" ("WAITING") ("CANCELLED"))))

Change to WAITING → auto-adds :WAITING: tag. Change to DONE → removes :WAITING:.

29. Bibliography Management

With org-ref:

(use-package org-ref)

Cite papers:

#+begin_example

30. Introduction

Recent studies show cite:knuth1984literate that literate programming…

31. Bibliography

bibliography:~/papers/references.bib #+end_example

Export to LaTeX → citations formatted properly.

32. The Org Ecosystem: Notable Packages

  • org-roam - Zettelkasten knowledge base
  • org-super-agenda - Enhanced agenda grouping
  • org-brain - Concept mapping
  • org-noter - Annotate PDFs within org
  • org-transclusion - Embed content from other files
  • org-download - Drag-and-drop images
  • org-pomodoro - Pomodoro timer with org integration
  • org-journal - Journaling system
  • org-chef - Recipe manager
  • org-timeline - Visual timeline of tasks

The ecosystem is vast.

33. Configuration: Going Further

A mature config might include:

;; Custom agenda views for different contexts
;; Project-specific capture templates
;; Custom link types for your tools
;; Export templates for different document types
;; Keyboard shortcuts for common operations
;; Integration with email, calendar, chat
;; Automated archiving and cleanup
;; Custom functions for your workflow

Org-Mode grows with you. Start simple, add complexity as needed.

34. The Org Manual

We’ve covered a lot. The official manual covers more:

  • Advanced exporting
  • Special blocks
  • Macro expansion
  • Publishing customization
  • Internal linking
  • Complex property searches
  • And hundreds of configuration options

Access in Emacs: C-h i m org

Or online: https://orgmode.org/manual/

35. When Org-Mode Isn’t the Answer

Org-Mode is powerful but not universal:

Not ideal for:

  • Real-time collaboration (conflicts in plain text)
  • Heavy multimedia (images, video editing)
  • WYSIWYG requirements
  • Non-technical team members
  • Mobile-first workflows

Excels at:

  • Personal knowledge management
  • Technical writing
  • Project planning
  • Research and notes
  • Reproducible research
  • Text-oriented workflows

Use the right tool for the job.

36. Your Journey Continues

You’ve learned:

  • Document structure
  • Task management
  • Time tracking
  • Capture workflows
  • Literate programming
  • Publishing systems
  • Advanced features

But Org-Mode is infinite. People use it for:

  • Running businesses
  • Writing books (like this one)
  • Managing PhDs
  • Tracking fitness
  • Planning meals
  • Managing finances
  • Running D&D campaigns
  • And everything in between

37. Final Exercise

Build your system:

  1. Decide on core workflows (GTD? Custom? Hybrid?)
  2. Set up agenda files structure
  3. Create capture templates for common inputs
  4. Configure custom agenda views
  5. Set up time tracking if needed
  6. Choose tags and properties schema
  7. Configure export for your needs
  8. Iterate and refine

Start small. Add features as you need them. Your Org-Mode system should grow organically.

38. The Philosophy: Embrace the Journey

Org-Mode has a learning curve. That’s not a bug—it’s a feature. Tools that do everything for everyone do nothing particularly well.

Org-Mode provides primitives. You compose them. The result is a system that matches your brain, not someone else’s productivity philosophy.

There’s always more to learn. That’s exciting, not overwhelming. Each new feature is a tool you can choose to adopt or ignore.

39. Parting Thoughts

You started this book as an Org-Mode beginner. You’ve learned the syntax, the workflows, the power. But the real learning happens in practice.

Your first week: things will be slow. Keybindings feel awkward. You’ll reach for the mouse.

Your first month: muscle memory forms. Capture becomes natural. Agenda views make sense.

Your first year: Org-Mode becomes an extension of thought. You’ll wonder how you managed before.

Welcome to the community of people who manage their lives in plain text. We’re a peculiar bunch, but we’re productive.

Now close this book. Open Emacs. Create an org file.

Your journey begins.


40. Appendix: Quick Reference

Essential Keybindings:

  • TAB - Fold/unfold heading
  • S-TAB - Fold/unfold all
  • M-RET - New heading/item
  • M-left/right - Promote/demote
  • M-up/down - Move heading
  • C-c C-t - Cycle TODO state
  • C-c C-s - Schedule
  • C-c C-d - Deadline
  • C-c C-c - Context-aware command
  • C-c C-e - Export dispatcher
  • C-c a - Agenda dispatcher
  • C-c c - Capture (if configured)
  • C-c C-x C-i - Clock in
  • C-c C-x C-o - Clock out
  • C-c C-l - Insert link
  • C-c C-o - Open link
  • C-c ' - Edit code block

Resources:

The End… and the Beginning

Org-Mode with Emacs — CC0 1.0 Universal  ·  Built with Org-Mode & Emacs