gnu.org

The Org Manual

This manual is for Org version 9.8.

Copyright © 2004–2026 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover Texts being “A GNU Manual,” and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled “GNU Free Documentation License.”

(a) The FSF’s Back-Cover Text is: “You have the freedom to copy and modify this GNU manual.”

Table of Contents


Next: Document Structure, Previous: The Org Manual, Up: The Org Manual   [Contents][Index]

1 Introduction


Next: Installation, Up: Introduction   [Contents][Index]

1.1 Summary

Org mode is an authoring tool and a TODO list manager for GNU Emacs. It relies on a lightweight plain-text markup language used in files with the ‘.org’ extension.

Authoring Org files is best supported by Emacs, but you can view, understand, and change them with any text editor.

As an authoring tool, Org helps you write structured documents and provides exporting facilities. Org files can also be used for literate programming and reproducible research. As a TODO list manager, Org helps you organize your tasks in a flexible way, from daily needs to detailed project planning, allowing logging, multiple views of your tasks, exporting your agendas, etc.

Org mode is implemented on top of Outline mode, which makes it possible to keep the content of large files well-structured. Visibility cycling and structure editing help you work with the tree. Tables are easily created with a built-in table editor. Plain text URL-like links connect to websites, emails, Usenet messages, BBDB entries, and any files related to the projects.

Org develops organizational tasks around note files that contain lists or information about projects as plain text. Project planning and task management make use of metadata, which is part of an outline node. Based on this data, specific entries can be extracted via queries to create dynamic agenda views that also integrate the Emacs calendar and diary. Org can be used to implement many different project planning schemes, such as David Allen’s GTD system.

Org files can serve as a single-source authoring system with export to many different formats such as HTML, LaTeX, Open Document, and Markdown. New export backends can be derived from existing ones, or defined from scratch.

Org files can include source code blocks, which makes Org uniquely suited for authoring technical documents with code examples. Org source code blocks are fully functional; they can be evaluated in place and their results can be captured in the file. This makes it possible to create a single-file reproducible research compendium.

Org keeps simple things simple. When first fired up, it should feel like a straightforward, easy-to-use outliner. Complexity is not imposed, but a large amount of functionality is available when needed. Org is a toolbox. Many users actually run only a—very personal—fraction of Org’s capabilities, and know that there is more whenever they need it.

All of this is achieved with strictly plain text files, the most portable and future-proof file format. Org runs in Emacs. Emacs is one of the most widely ported programs, so that Org mode is available on every major platform.

There is a website for Org which provides links to the newest version of Org, as well as additional information, frequently asked questions (FAQ), links to tutorials, etc. This page is located at https://orgmode.org.

An earlier version (7.3) of this manual was available as a paperback book from the Network Theory Ltd. publishing company, which closed in 2009.


Next: Activation, Previous: Summary, Up: Introduction   [Contents][Index]

1.2 Installation

Org is included in distributions of GNU Emacs, so you probably do not need to install it. Most users will simply activate Org and begin exploring its features.

If, for one reason or another, you want to install Org on top of the pre-packaged version, you can use the Emacs package system or clone Org’s Git repository. We strongly recommend sticking to a single installation method.

When installing Org on top of the pre-packaged version, please note that Org stable versions are meant to be fully compatible with the last three stable versions of Emacs but not with older Emacsen.

Some Org components also depend on third-party packages available through package archives. Org is only guaranteed to be compatible with the latest stable versions of these third-party packages.

Using Emacs packaging system

Recent Emacs distributions include a packaging system which lets you install Elisp libraries. You can install Org from the “package menu”, with M-x list-packages. See Package Menu.

Important: You need to do this in a session where no ‘.org’ file has been visited, i.e., where no Org built-in functions have been loaded. Otherwise, autoloaded Org functions will mess up the installation.

To avoid interference with the built-in Org mode, you can use the command line (you need Emacs 30 or later):

emacs -Q -batch -eval "(progn (package-refresh-contents) (package-upgrade 'org))"

This approach has the advantage of isolating the upgrade process from a running Emacs session, ensuring that version conflicts cannot arise.

Using Org’s Git repository

You can clone Org’s repository and install Org like this:

$ cd ~/src/
$ git clone https://https.git.savannah.nongnu.org/git/org-mode.git
$ # alternatively, you can use mirror
$ # git clone https://git.sr.ht/~bzg/org-mode
$ cd org-mode/
$ make autoloads

Note that in this case, ‘make autoloads’ is mandatory: it defines Org’s version in ‘org-version.el’ and Org’s autoloads in ‘org-loaddefs.el’.

Make sure you set the load path correctly in your Emacs init file:

(add-to-list 'load-path "~/src/org-mode/lisp")

You can also compile with ‘make’, generate the documentation with ‘make doc’, create a local configuration with ‘make config’, and install Org with ‘make install’. Please run ‘make help’ to get the list of compilation/installation options.

For more detailed explanations on Org’s build system, please check the Org Build System page on Worg.

Installing Org’s contributed packages

Org’s repository used to contain the ‘contrib/’ directory for add-ons contributed by others. As of Org 9.5, the directory has been moved to the dedicated org-contrib repository, which you can install separately as a package from NonGNU ELPA.

There are many valuable packages maintained outside the Org repository. Worg has a list of org-contrib and external packages; it is certainly not exhaustive.


Next: Feedback, Previous: Installation, Up: Introduction   [Contents][Index]

1.3 Activation

Org mode buffers need Font Lock to be turned on: this is the default in Emacs1.

There are compatibility issues between Org mode and some other Elisp packages (see Packages that conflict with Org mode). Please take the time to check the list.

For a better experience, the three Org commands org-store-link, org-capture and org-agenda ought to be accessible anywhere in Emacs, not just in Org buffers. To that effect, you need to bind them to globally available keys, like the ones reserved for users (see (elisp)Key Binding Conventions). Here are suggested bindings; please modify the keys to your own liking in your personal init file.

(global-set-key (kbd "C-c l") #'org-store-link)
(global-set-key (kbd "C-c a") #'org-agenda)
(global-set-key (kbd "C-c c") #'org-capture)

Files with the ‘.org’ extension use Org mode by default. To turn on Org mode in a file that does not have the extension ‘.org’, make the first line of a file look like this:

MY PROJECTS    -*- mode: org; -*-

which selects Org mode for this buffer no matter what the file’s name is. See also the variable org-insert-mode-line-in-empty-file.

Many commands in Org work on the region if the region is active. To make use of this, you need to have Transient Mark mode turned on, which is the default. If you do not like it, you can create an active region by using the mouse to select a region, or pressing C-SPC twice before moving point.


Next: Typesetting Conventions Used in this Manual, Previous: Activation, Up: Introduction   [Contents][Index]

1.4 Feedback

If you find problems with Org, or if you have questions, remarks, or ideas about it, please send an email to the Org mailing list mailto:emacs-orgmode@gnu.org. You can subscribe to the list from this web page. If you are not a member of the mailing list, your mail will be passed to the list after a moderator approves it2. We ask you to read and respect the GNU Kind Communications Guidelines when sending messages on this mailing list. Please allow up to one month for a response and follow up if no response is received on the bug report.

For bug reports, please first try to reproduce the bug with the latest version of Org available—if you are running an outdated version, it is quite possible that the bug has been fixed already. If the bug persists, prepare a report and provide as much information as possible, including the version information of Emacs (M-x emacs-version) and Org (M-x org-version), as well as the Org-related setup in the Emacs init file. The easiest way to do this is to use the command

M-x org-submit-bug-report <RET>

which puts all this information into an Emacs mail buffer so that you only need to add your description. If you are not sending the email from within Emacs, please copy and paste the content into your email program.

Sometimes you might face a problem due to an error in your Emacs or Org mode setup. Before reporting a bug, it is very helpful to start Emacs with minimal customizations and to reproduce the problem. Doing so often helps you determine if the problem is with your customization or with Org mode itself. You can start a typical minimal session with a command like the example below.

$ emacs -Q -l /path/to/minimal-org.el

However, if you are using Org mode as distributed with Emacs, a minimal setup is not necessary. In that case it is sufficient to start Emacs as ‘emacs -Q’. The ‘minimal-org.el’ setup file can have contents as shown below.

;;; Minimal setup to load latest `org-mode'.
;; Activate debugging.
(setq debug-on-error t
      debug-on-signal nil
      debug-on-quit nil)
;; Add latest Org mode to load path.
(add-to-list 'load-path (expand-file-name "/path/to/org-mode/lisp"))

If you are using the Org mode version from the Git repository, you can start a minimal session using ‘make’.

# Bare Emacs
make repro
# or pass extra arguments
make repro REPRO_ARGS="-l /path/to/minimal/config.el /tmp/bug.org"

If an error occurs, a “backtrace” can be very useful—see below for instructions on how to create one. Often a small example file helps, along with clear information about:

  1. What exactly did you do?
  2. What did you expect to happen?
  3. What happened instead?

If you experience degraded performance, you can record a “profile” and share it on the Org mailing list. See below for instructions on how to record a useful profile.

Thank you for helping to improve this program.

How to create a useful backtrace

If working with Org produces an error with a message you do not understand, you may have hit a bug. The best way to report this is by providing, in addition to what was mentioned above, a backtrace. This is information from the built-in debugger about where and how the error occurred. Here is how to produce a useful backtrace:

  1. Reload uncompiled versions of all Org mode Lisp files. The backtrace contains much more information if it is produced with uncompiled code. To do this, use
    C-u M-x org-reload <RET>
    

    or, from the menu: Org → Refresh/Reload → Reload Org uncompiled.

  2. Then, activate the debugger:
    M-x toggle-debug-on-error <RET>
    

    or, from the menu: Options → Enter Debugger on Error.

  3. Do whatever you have to do to hit the error. Do not forget to document the steps you take.
  4. When you hit the error, a ‘*Backtrace*’ buffer appears on the screen. Save this buffer to a file—for example using C-x C-w—and attach it to your bug report.

How to profile Org performance

Sometimes, Org becomes slow for no apparent reason. Such slowdown is often caused by interaction between third-party packages and Org mode. However, identifying the root cause is not always straightforward.

Emacs is able to record performance statistics, which can then be used to find out which functions are taking the most time to execute. To record the statistics, one can use a profiler. To use the Emacs profiler, we recommend the following steps:

  1. Make sure that no profiler is currently active:
    M-x profiler-stop <RET>
    
  2. Start a new CPU profiler session:
    M-x profiler-start <RET> cpu <RET>
    
  3. Use Emacs as usual, performing the actions that are deemed slow.
  4. Display and examine the recorded performance statistics:
    M-x profiler-report <RET>
    

    This command will display a summary of the commands and functions that have been executed between profiler-start and profiler-report invocations, with the command taking the most time displayed on top.

    The ‘<TAB>’ key can be used to fold and unfold lines in the profiler buffer. The child items revealed upon unfolding are the functions and commands called by the unfolded parent.

    The root causes are often buried deep inside child items in the profiler. You can press ‘B’ (profiler-report-render-reversed-calltree) to quickly reveal the actual function/command that takes the most time to run.

    Pressing ‘Cprofiler-report-render-calltree will recover the original view.

  5. If you need further help, you can share the statistics data.

    To save the data, issue

    M-x profiler-report-write-profile <RET>
    /path/to/profile-file-to-be-saved <RET>
    

    Then, you can attach the saved file to your email to the Org mailing list, along with details about what you did to trigger the slowdown.

    Note that the saved statistics will only contain the function names and how long their execution takes. No private data will be recorded.


Previous: Feedback, Up: Introduction   [Contents][Index]

1.5 Typesetting Conventions Used in this Manual

TODO keywords, tags, properties, etc.

Org uses various syntactic elements: TODO keywords, tags, property names, keywords, blocks, etc. In this manual we use the following conventions:

TODO’, ‘WAITING

TODO keywords are written with all capitals, even if they are user-defined.

boss’, ‘ARCHIVE

Tags are case-sensitive. User-defined tags are usually written in lowercase; built-in tags with special meaning are written as they should appear in the document, usually with all capitals.

Release’, ‘PRIORITY

User-defined properties are capitalized; built-in properties with special meaning are written with all capitals.

TITLE’, ‘BEGIN’ … ‘END

Keywords and blocks are written in uppercase to enhance their readability, but you can use lowercase in your Org files.

Key bindings and commands

The manual lists both the keys and the corresponding commands for accessing functionality. Org mode often uses the same key for different functions, depending on context. The command that is bound to such keys has a generic name, like org-metaright. In the manual, we will, wherever possible, give the function that is internally called by the generic command. For example, in the chapter on document structure, M-RIGHT will be listed to call org-do-demote, while in the chapter on tables, it will be listed to call org-table-move-column-right.


Next: Tables, Previous: Introduction, Up: The Org Manual   [Contents][Index]

2 Document Structure

Org is an outliner. Outlines allow a document to be organized in a hierarchical structure, which, at least for me, is the best representation of notes and thoughts. An overview of this structure is achieved by folding, i.e., hiding large parts of the document to show only the general document structure and the parts currently being worked on. Org greatly simplifies the use of outlines by compressing the show and hide functionality into a single command, org-cycle, which is bound to the TAB key.


Next: Visibility Cycling, Up: Document Structure   [Contents][Index]

2.1 Headlines

Headlines define the structure of an outline tree. Org headlines start on the left margin3 with one or more stars followed by a space. For example:

* First (top) level headline
** Second level
*** Third level
    some text
*** Third level
    more text
* Another first (top) level headline

The name defined in org-footnote-section is reserved. Do not use it as a title for your own headings.

Some people find the many stars too noisy and would prefer an outline that has whitespace followed by a single star as headline markers. This can be achieved using the Org Indent minor mode. See A Cleaner Outline View for more information.

Headlines are not numbered. However, you may want to dynamically number some, or all, of them. See Dynamic Headline Numbering.

An empty line after the end of a subtree is considered part of it and is hidden when the subtree is folded. However, if you leave at least two empty lines, one empty line remains visible after folding the subtree, in order to structure the collapsed view. See the variable org-cycle-separator-lines to modify this behavior.


Next: Motion, Previous: Headlines, Up: Document Structure   [Contents][Index]

2.2 Visibility Cycling


Next: Initial visibility, Up: Visibility Cycling   [Contents][Index]

2.2.1 Global and local cycling

Outlines make it possible to hide parts of the text in the buffer. Org uses just two commands, bound to TAB and S-TAB, to change the visibility in the buffer.

TAB (org-cycle)

Subtree cycling: Rotate current subtree among the states

,-> FOLDED -> CHILDREN -> SUBTREE --.
'-----------------------------------'

Point must be on a headline for this to work4.

S-TAB (org-global-cycle), C-u TAB

Global cycling: Rotate the entire buffer among the states

,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
'--------------------------------------'

When S-TAB is called with a numeric prefix argument N, view contents only up to headlines of level N.

Note that inside tables (see Tables), S-TAB jumps to the previous field instead.

You can run global cycling using TAB only if point is at the very beginning of the buffer, but not on a headline, and org-cycle-global-at-bob is set to a non-nil value.

C-u C-u TAB (org-cycle-set-startup-visibility)

Switch back to the startup visibility of the buffer (see Initial visibility).

C-u C-u C-u TAB (org-fold-show-all)

Show all, including drawers.

C-c C-r (org-reveal)

Reveal context around point, showing the current entry, the following heading, and the hierarchy above. It is useful for working near a location that has been exposed by a sparse tree command (see Sparse Trees) or an agenda command (see Commands in the Agenda Buffer). With a prefix argument, show, on each level, all sibling headings. With a double prefix argument, also show the entire subtree of the parent.

C-c C-k (org-show-branches)

Expose all the headings of the subtree, but not their bodies.

C-c TAB (org-fold-show-children)

Expose all direct children of the subtree. With a numeric prefix argument N, expose all children down to level N.

C-c C-x b (org-tree-to-indirect-buffer)

Show the current subtree in an indirect buffer5. With a numeric prefix argument N, go up to level N and then take that tree. If N is negative, then go up that many levels. With a C-u prefix, do not remove the previously used indirect buffer.

C-c C-x v (org-copy-visible)

Copy the visible text in the region into the kill ring.


Next: Catching invisible edits, Previous: Global and local cycling, Up: Visibility Cycling   [Contents][Index]

2.2.2 Initial visibility

When Emacs first visits an Org file, the global state is set to showeverything, i.e., all file content is visible6. This can be configured through the variable org-startup-folded, or on a per-file basis by adding one of the following lines anywhere in the buffer:

#+STARTUP: overview
#+STARTUP: content
#+STARTUP: showall
#+STARTUP: show2levels
#+STARTUP: show3levels
#+STARTUP: show4levels
#+STARTUP: show5levels
#+STARTUP: showeverything

Furthermore, any entries with a ‘VISIBILITY’ property (see Properties and Columns) get their visibility adapted accordingly. Allowed values for this property are ‘folded’, ‘children’, ‘content’, and ‘all’.

C-u C-u TAB (org-cycle-set-startup-visibility)

Switch back to the startup visibility of the buffer, i.e., whatever is requested by startup options and ‘VISIBILITY’ properties in individual entries.


Previous: Initial visibility, Up: Visibility Cycling   [Contents][Index]

2.2.3 Catching invisible edits

Sometimes you may inadvertently edit an invisible part of the buffer and be confused about what has been edited and how to undo the mistake. By default, Org prevents such edits for a limited set of user commands. Users can control which commands are affected by customizing org-fold-catch-invisible-edits-commands.

The strategy used to decide if a given edit is dangerous is controlled by org-fold-catch-invisible-edits. See the docstring of this option for the available strategies. Set the option to nil to disable catching invisible edits completely.


Next: Structure Editing, Previous: Visibility Cycling, Up: Document Structure   [Contents][Index]

2.3 Motion

The following commands jump to other headlines in the buffer.

C-c C-n (org-next-visible-heading)

Next heading.

C-c C-p (org-previous-visible-heading)

Previous heading.

C-c C-f (org-forward-heading-same-level)

Next heading same level.

C-c C-b (org-backward-heading-same-level)

Previous heading same level.

C-c C-u (outline-up-heading)

Backward to higher level heading.

C-c C-j (org-goto)

Jump to a different place without changing the current outline visibility. Shows the document structure in a temporary buffer, where you can use the following keys to find your destination:

TABCycle visibility.
DOWN / UPNext/previous visible headline.
RETSelect this location.
/Do a Sparse-tree search

The following keys work if you turn off org-goto-auto-isearch.

n / pNext/previous visible headline.
f / bNext/previous headline same level.
uOne level up.
09Digit argument.
qQuit.

See also the variable org-goto-interface.


Next: Sparse Trees, Previous: Motion, Up: Document Structure   [Contents][Index]

2.4 Structure Editing

M-RET (org-meta-return)

Insert a new heading, item, or row.

If the command is used at the beginning of a line, and if there is a heading or a plain list item (see Plain Lists) at point, the new heading/item is created before the current line. When used at the beginning of a regular line of text, turn that line into a heading.

When this command is used in the middle of a line, the line is split and the rest of the line becomes the new item or headline. If you do not want the line to be split, customize org-M-RET-may-split-line.

Calling the command with a C-u prefix unconditionally inserts a new heading at the end of the current subtree, thus preserving its contents. With a double C-u C-u prefix, the new heading is created at the end of the parent subtree instead.

C-RET (org-insert-heading-respect-content)

Insert a new heading at the end of the current subtree.

M-S-RET (org-insert-todo-heading)

Insert new TODO entry with same level as current heading. See also the variable org-treat-insert-todo-heading-as-state-change.

C-S-RET (org-insert-todo-heading-respect-content)

Insert new TODO entry with same level as current heading. Like C-RET, the new headline is inserted after the current subtree.

TAB (org-cycle)

In a new entry with no text yet, the first TAB demotes the entry to become a child of the previous one. The next TAB makes it a parent, and so on, all the way to top level. Yet another TAB, and you are back to the initial level.

M-LEFT (org-do-promote), M-RIGHT (org-do-demote)

Promote or demote current heading by one level.

When there is an active region—i.e., when Transient Mark mode is active—promotion and demotion work on all headlines in the region. To select a region of headlines, it is best to set mark at the beginning of the first headline, and point at the line just after the last headline to change.

M-S-LEFT (org-promote-subtree)

Promote the current subtree by one level.

M-S-RIGHT (org-demote-subtree)

Demote the current subtree by one level.

M-UP (org-move-subtree-up)

Move subtree up, i.e., swap with previous subtree of same level.

M-DOWN (org-move-subtree-down)

Move subtree down, i.e., swap with next subtree of same level.

C-c @ (org-mark-subtree)

Mark the subtree at point. Hitting it repeatedly marks subsequent subtrees of the same level as the marked subtree.

C-c C-x C-w (org-cut-subtree)

Kill subtree, i.e., remove it from the buffer but save in kill ring. With a numeric prefix argument N, kill N sequential subtrees.

C-c C-x M-w (org-copy-subtree)

Copy subtree to kill ring. With a numeric prefix argument N, copy the N sequential subtrees.

C-c C-x C-y (org-paste-subtree)

Yank subtree from kill ring. This does modify the level of the subtree to make sure the tree fits in nicely at the yank position. The yank level can also be specified with a numeric prefix argument, or by yanking after a headline marker like ‘****’. With C-u prefix, force inserting as a sibling. With C-u C-u prefix argument, force inserting as a child.

C-y (org-yank)

Depending on the variables org-yank-adjusted-subtrees and org-yank-folded-subtrees, Org’s internal yank command pastes subtrees folded and in a clever way, using the same command as C-c C-x C-y. With the default settings, no level adjustment takes place, but the yanked tree is folded unless doing so would swallow text previously visible. Any prefix argument to this command forces a normal yank to be executed, with the prefix passed along. A good way to force a normal yank is C-u C-y. If you use yank-pop after a yank, it yanks previous kill items plainly, without adjustment and folding.

C-c C-x c (org-clone-subtree-with-time-shift)

Clone a subtree by making a number of sibling copies of it. You are prompted for the number of copies to make, and you can also specify whether any timestamps in the entry should be shifted. This can be useful, for example, to create a number of tasks related to a series of lectures to prepare. For more details, see the docstring of the command org-clone-subtree-with-time-shift.

C-c C-w (org-refile)

Refile entry or region to a different location. See Refile and Copy.

C-c ^ (org-sort)

Sort same-level entries. When there is an active region, all entries in the region are sorted. Otherwise, the children of the current headline are sorted. The command prompts for the sorting method, which can be alphabetically, numerically, by time—first timestamp with active preferred, creation time, scheduled time, deadline time—by priority, by TODO keyword—in the sequence the keywords have been defined in the setup—or by the value of a property. Reverse sorting is possible as well. You can also supply your own function to extract the sorting key. With a C-u prefix, sorting is case-sensitive.

C-x n s (org-narrow-to-subtree)

Narrow buffer to current subtree.

C-x n b (org-narrow-to-block)

Narrow buffer to current block.

C-x n w (widen)

Widen buffer to remove narrowing.

C-c * (org-toggle-heading)

Turn a normal line or plain list item into a headline—so that it becomes a subheading at its location. Also turn a headline into a normal line by removing the stars. If there is an active region, turn all lines in the region into headlines. If the first line in the region was an item, turn only the item lines into headlines. Finally, if the first line is a headline, remove the stars from all headlines in the region.

Note that when point is inside a table (see Tables), the Meta-Cursor keys have different functionality.


Next: Plain Lists, Previous: Structure Editing, Up: Document Structure   [Contents][Index]

2.5 Sparse Trees

An important feature of Org mode is the ability to construct sparse trees for selected information in an outline tree, so that the entire document is folded as much as possible, but the selected information is made visible along with the headline structure above it7. Just try it out and you will see immediately how it works.

Org mode contains several commands creating such trees, all of which can be accessed through a dispatcher:

C-c / (org-sparse-tree)

This prompts for an extra key to select a sparse-tree creating command.

C-c / r or C-c / / (org-occur)

Prompts for a regexp (see Regular Expressions) and shows a sparse tree with all matches. If the match is in a headline, the headline is made visible. If the match is in the body of an entry, the headline and body are made visible. In order to provide minimal context, also the full hierarchy of headlines above the match is shown, as well as the headline following the match. Each match is also highlighted; the highlights disappear when the buffer is changed by an editing command, or by pressing C-c C-c8. When called with a C-u prefix argument, previous highlights are kept, so several calls to this command can be stacked.

M-g n or M-g M-n (next-error)

Jump to the next sparse tree match in this buffer.

M-g p or M-g M-p (previous-error)

Jump to the previous sparse tree match in this buffer.

For frequently used sparse trees for specific search strings, you can use the variable org-agenda-custom-commands to define fast keyboard access to specific sparse trees. These commands will then be accessible through the agenda dispatcher (see The Agenda Dispatcher). For example:

(setq org-agenda-custom-commands
      '(("f" occur-tree "FIXME")))

defines the key f as a shortcut for creating a sparse tree matching the string ‘FIXME’.

The other sparse tree commands select headings based on TODO keywords, tags, or properties and are discussed later in this manual.

To print a sparse tree, you can use the Emacs command ps-print-buffer-with-faces, which does not print invisible parts of the document. Or you can use the command C-c C-e C-v to export only the visible part of the document and print the resulting file.


Next: Drawers, Previous: Sparse Trees, Up: Document Structure   [Contents][Index]

2.6 Plain Lists

Within an entry of the outline tree, hand-formatted lists can provide additional structure. They also provide a way to create lists of checkboxes (see Checkboxes). Org supports editing such lists, and every exporter (see Exporting) can parse and format them.

Org knows ordered lists, unordered lists, and description lists.

  • Unordered list items start with ‘-’, ‘+’, or ‘*9 as bullets.
  • Ordered list items start with a numeral followed by either a period or a right parenthesis10, such as ‘1.’ or ‘1)11 If you want a list to start with a different value—e.g., 20—start the text of the item with ‘[@20]12. Those constructs can be used in any item of the list in order to enforce a particular numbering.
  • Description list items are unordered list items, and contain the separator ‘::’ to distinguish the description term from the description text.

Items belonging to the same list must have the same indentation on the first line. In particular, if an ordered list reaches number ‘10.’, then the 2-digit numbers must be written left-aligned with the other numbers in the list. An item ends before the next line that has an indentation less than or equal to its bullet/number.

A list ends whenever every item has ended, which means before any line with an indentation less than or equal to that of the top-level items. It also ends before two blank lines. In that case, all items are closed. Here is an example:

* Lord of the Rings
My favorite scenes are (in this order)
1. The attack of the Rohirrim
2. Eowyn's fight with the witch king
   + this was already my favorite scene in the book
   + I really like Miranda Otto.
3. Peter Jackson being shot by Legolas
   - on DVD only
   He makes a really funny face when it happens.
8. [@8] <favorite scenes 4 to 8 are skipped for brevity>
But in the end, no individual scenes matter but the film as a whole.
Important actors in this film are:
- Elijah Wood :: He plays Frodo
- Sean Astin :: He plays Sam, Frodo's friend.  I still remember him
     very well from his role as Mikey Walsh in /The Goonies/.

Org supports these lists by tuning filling and wrapping commands to deal with them correctly, and by exporting them properly (see Exporting). Since indentation is what governs the structure of these lists, many structural constructs like ‘#+BEGIN_’ blocks can be indented to signal that they belong to a particular item.

If you find that using a different bullet for a sub-list—than that used for the current list-level—improves readability, customize the variable org-list-demote-modify-bullet. To get a greater difference of indentation between items and their sub-items, customize org-list-indent-offset.

The following commands act on items when point is in the first line of an item—the line with the bullet or number. Some of them imply the application of automatic rules to keep list structure intact. If some of these actions get in your way, configure org-list-automatic-rules to disable them individually.

TAB (org-cycle)

Items can be folded just like headline levels. Normally this works only if point is on a plain list item. For more details, see the variable org-cycle-include-plain-lists. If this variable is set to integrate, plain list items are treated like low-level headlines. The level of an item is then given by the indentation of the bullet/number. Items are always subordinate to real headlines, however; the hierarchies remain completely separated. In a new item with no text yet, the first TAB demotes the item to become a child of the previous one. Subsequent TABs move the item to meaningful levels in the list and eventually get it back to its initial position.

M-RET (org-insert-item)

Insert new item at current level. With a prefix argument, force a new heading (see Structure Editing). If this command is used in the middle of an item, that item is split in two, and the second part becomes the new item13. If this command is executed before the item’s body, the new item is created before the current one.

M-S-RET

Insert a new item with a checkbox (see Checkboxes).

S-UP, S-DOWN

Jump to the previous/next item in the current list, but only if org-support-shift-select is off14. If not, you can still use paragraph jumping commands like C-UP and C-DOWN to quite similar effect.

M-UP, M-DOWN

Move the item including sub-items up/down15, i.e., swap with previous/next item of same indentation. If the list is ordered, renumbering is automatic.

M-LEFT, M-RIGHT

Decrease/increase the indentation of an item, leaving children alone.

M-S-LEFT, M-S-RIGHT

Decrease/increase the indentation of the item, including sub-items. Initially, the item tree is selected based on current indentation. When these commands are executed several times in direct succession, the initially selected region is used, even if the new indentation would imply a different hierarchy. To use the new hierarchy, break the command chain by moving point.

As a special case, using this command on the very first item of a list moves the whole list. This behavior can be disabled by configuring org-list-automatic-rules. The global indentation of a list has no influence on the text after the list.

C-c C-c

If there is a checkbox (see Checkboxes) in the item line, toggle the state of the checkbox. In any case, verify bullets and indentation consistency in the whole list.

C-c -

Cycle the entire list level through the different itemize/enumerate bullets (‘-’, ‘+’, ‘*’, ‘1.’, ‘1)’) or a subset of them, depending on org-plain-list-ordered-item-terminator, the type of list, and its indentation. With a numeric prefix argument N, select the Nth bullet from this list. If there is an active region when calling this, all lines are converted to list items. With a prefix argument, the selected text is changed into a single item. If the first line already was a list item, any item marker is removed from the list. Finally, even without an active region, a normal line is converted into a list item.

C-c *

Turn a plain list item into a headline—so that it becomes a subheading at its location. See Structure Editing for a detailed explanation.

C-c C-*

Turn the whole plain list into a subtree of the current heading. Checkboxes (see Checkboxes) become ‘TODO’ or ‘DONE’ keywords when unchecked or checked, respectively.

S-LEFT, S-RIGHT

This command also cycles bullet styles when point is on the bullet or anywhere in an item line, with details depending on org-support-shift-select.

C-c ^

Sort the plain list. Prompt for the sorting method: numerically, alphabetically, by time, or by custom function.


Next: Blocks, Previous: Plain Lists, Up: Document Structure   [Contents][Index]

2.7 Drawers

Sometimes you want to keep information associated with an entry, but you do not normally want to see it. For this, Org mode has drawers. They can contain anything but a headline and another drawer. Drawers look like this:

** This is a headline
Still outside the drawer
:DRAWERNAME:
This is inside the drawer.
:END:
After the drawer.

You can interactively insert a drawer at point by calling org-insert-drawer, which is bound to C-c C-x d. With an active region, this command puts the region inside the drawer. With a prefix argument, this command calls non-interactive function org-insert-property-drawer, which creates a ‘PROPERTIES’ drawer right below the current headline. Org mode uses this special drawer for storing properties (see Properties and Columns). You cannot use it for anything else.

Completion over drawer keywords is also possible using M-TAB16.

Visibility cycling (see Visibility Cycling) on the headline hides and shows the entry, but keeps the drawer collapsed to a single line. In order to look inside the drawer, you need to move point to the drawer line and press TAB there.

You can also arrange for state change notes (see Tracking TODO state changes) and clock times (see Clocking Work Time) to be stored in a ‘LOGBOOK’ drawer. If you want to store a quick note there, similarly to state changes, use

C-c C-z

Add a time-stamped note to the ‘LOGBOOK’ drawer.


Previous: Drawers, Up: Document Structure   [Contents][Index]

2.8 Blocks

Org mode uses ‘#+BEGIN’ … ‘#+END’ blocks for various purposes, from including source code examples (see Literal Examples) to capturing time logging information (see Clocking Work Time). These blocks can be folded and unfolded by pressing TAB in the ‘#+BEGIN’ line. You can also get all blocks folded at startup by configuring the variable org-hide-block-startup or on a per-file basis by using

#+STARTUP: hideblocks
#+STARTUP: nohideblocks

Next: Hyperlinks, Previous: Document Structure, Up: The Org Manual   [Contents][Index]

3 Tables

Org comes with a fast and intuitive table editor. Spreadsheet-like calculations are supported using the Emacs Calc package (see GNU Emacs Calculator Manual).


Next: Column Width and Alignment, Up: Tables   [Contents][Index]

3.1 Built-in Table Editor

Org makes it easy to format tables in plain ASCII. Any line with ‘|’ as the first non-whitespace character is considered part of a table. ‘|’ is also the column separator17. Moreover, a line starting with ‘|-’ is a horizontal rule. It separates rows explicitly. Rows before the first horizontal rule are header lines. A table might look like this:

| Name  | Phone | Age |
|-------+-------+-----|
| Peter |  1234 |  17 |
| Anna  |  4321 |  25 |

A table is re-aligned automatically each time you press TAB, RET, or C-c C-c inside the table. TAB also moves to the next field—RET to the next row—and creates new table rows at the end of the table or before horizontal lines. The indentation of the table is set by the first line. Horizontal rules are automatically expanded on every re-align to span the whole table width. So, to create the above table, you would only type

|Name|Phone|Age|
|-

and then press TAB to align the table and start filling in fields. Even faster would be to type ‘|Name|Phone|Age’ followed by C-c RET.

When typing text into a field, Org treats DEL, Backspace, and all character keys in a special way, so that inserting and deleting avoid shifting other fields. Also, when typing immediately after point was moved into a new field with TAB, S-TAB or RET, the field is automatically made blank. If this behavior is too unpredictable for you, configure the option org-table-auto-blank-field.

Creation and conversion

C-c | (org-table-create-or-convert-from-region)

Convert the active region to table. If every line contains at least one TAB character, the function assumes that the material is tab separated. If every line contains a comma, comma-separated values (CSV) are assumed. If not, lines are split at whitespace into fields. You can use a prefix argument to force a specific separator: C-u forces CSV, C-u C-u forces TAB, C-u C-u C-u prompts for a regular expression to match the separator, and a numeric argument N indicates that at least N consecutive spaces, or alternatively a TAB will be the separator.

If there is no active region, this command creates an empty Org table. But it is easier just to start typing, like | N a m e | P h o n e | A g e RET | - TAB.

Re-aligning and field motion

C-c C-c (org-table-align)

Re-align the table without moving point.

TAB (org-table-next-field)

Re-align the table, move to the next field. Creates a new row if necessary.

M-x org-table-blank-field

Blank the current table field or active region.

S-TAB (org-table-previous-field)

Re-align, move to previous field.

RET (org-table-next-row)

Re-align the table and move down to next row. Creates a new row if necessary. At the beginning or end of a line, RET still inserts a new line, so it can be used to split a table.

M-a (org-table-beginning-of-field)

Move to beginning of the current table field, or onto the previous field.

M-e (org-table-end-of-field)

Move to end of the current table field, or onto the next field.

Column and row editing

M-LEFT (org-table-move-column-left)

Move the current column left.

M-RIGHT (org-table-move-column-right)

Move the current column right.

M-S-LEFT (org-table-delete-column)

Kill the current column.

M-S-RIGHT (org-table-insert-column)

Insert a new column at point position. Move the current column and all cells to the right of this column to the right.

M-UP (org-table-move-row-up)

Move the current row up.

M-DOWN (org-table-move-row-down)

Move the current row down.

M-S-UP (org-table-kill-row)

Kill the current row or horizontal line.

S-UP (org-table-move-cell-up)

Move cell up by swapping with adjacent cell.

S-DOWN (org-table-move-cell-down)

Move cell down by swapping with adjacent cell.

S-LEFT (org-table-move-cell-left)

Move cell left by swapping with adjacent cell.

S-RIGHT (org-table-move-cell-right)

Move cell right by swapping with adjacent cell.

M-S-DOWN (org-table-insert-row)

Insert a new row above the current row. With a prefix argument, the line is created below the current one.

C-c - (org-table-insert-hline)

Insert a horizontal line below current row. With a prefix argument, the line is created above the current line.

C-c RET (org-table-hline-and-move)

Insert a horizontal line below current row, and move point into the row below that line.

C-c ^ (org-table-sort-lines)

Sort the table lines in the region. The position of point indicates the column to be used for sorting, and the range of lines is the range between the nearest horizontal separator lines, or the entire table. If point is before the first column, you are prompted for the sorting column. If there is an active region, the mark specifies the first line and the sorting column, while point should be in the last line to be included into the sorting. The command prompts for the sorting type, alphabetically, numerically, or by time. You can sort in normal or reverse order. You can also supply your own key extraction and comparison functions. When called with a prefix argument, alphabetic sorting is case-sensitive.

Regions

C-c C-x M-w (org-table-copy-region)

Copy a rectangular region from a table to a special clipboard. Point and mark determine edge fields of the rectangle. If there is no active region, copy just the current field. The process ignores horizontal separator lines.

C-c C-x C-w (org-table-cut-region)

Copy a rectangular region from a table to a special clipboard, and blank all fields in the rectangle. So this is the “cut” operation.

C-c C-x C-y (org-table-paste-rectangle)

Paste a rectangular region into a table. The upper left corner ends up in the current field. All involved fields are overwritten. If the rectangle does not fit into the present table, the table is enlarged as needed. The process ignores horizontal separator lines.

M-RET (org-table-wrap-region)

Split the current field at point position and move the rest to the line below. If there is an active region, and both point and mark are in the same column, the text in the column is wrapped to minimum width for the given number of lines. A numeric prefix argument may be used to change the number of desired lines. If there is no region, but you specify a prefix argument, the current field is made blank, and the content is appended to the field above.

Calculations

C-c + (org-table-sum)

Sum the numbers in the current column, or in the rectangle defined by the active region. The result is shown in the echo area and can be inserted with C-y.

S-RET (org-table-copy-down)

When the current field is empty, copy from the first non-empty field above. When it is not empty, copy the current field down to the next row and move point along with it.

Depending on the variable org-table-copy-increment, integer and time stamp field values, as well as fields prefixed or suffixed with a whole number, can be incremented during copy. Also, a 0 prefix argument temporarily disables the increment.

This key is also used by shift-selection and related modes (see Packages that conflict with Org mode).

Miscellaneous

C-c ` (org-table-edit-field)

Edit the current field in a separate window. This is useful for fields that are not fully visible (see Column Width and Alignment). When called with a C-u prefix, just make the full field visible, so that it can be edited in place. When called with two C-u prefixes, make the editor window follow point through the table and always show the current field. The follow mode exits automatically when point leaves the table, or when you repeat this command with C-u C-u C-c `.

M-x org-table-import

Import a file as a table. The table should be TAB- or whitespace-separated. Use, for example, to import a spreadsheet table or data from a database, because these programs generally can write TAB-separated text files. This command works by inserting the file into the buffer and then converting the region to a table. Any prefix argument is passed on to the converter, which uses it to determine the separator.

C-c | (org-table-create-or-convert-from-region)

Tables can also be imported by pasting tabular text into the Org buffer, selecting the pasted text with C-x C-x and then using the C-c | command (see Creation and conversion).

M-x org-table-export

Export the table, by default as a TAB-separated file. Use for data exchange with, for example, spreadsheet or database programs. The format used to export the file can be configured in the variable org-table-export-default-format. You may also use properties ‘TABLE_EXPORT_FILE’ and ‘TABLE_EXPORT_FORMAT’ to specify the file name and the format for table export in a subtree. Org supports quite general formats for exported tables. The exporter format is the same as the format used by Orgtbl radio tables, see Translator functions, for a detailed description.

M-x org-table-header-line-mode

Turn on the display of the first data row of the table at point in the window header line when this first row is not visible anymore in the buffer. You can activate this minor mode by default by setting the option org-table-header-line-p to t.

M-x org-table-transpose-table-at-point

Transpose the table at point and eliminate hlines.


Next: Column Groups, Previous: Built-in Table Editor, Up: Tables   [Contents][Index]

3.2 Column Width and Alignment

The width of columns is automatically determined by the table editor. The alignment of a column is determined automatically from the fraction of number-like versus non-number fields in the column.

Editing a field may modify the alignment of the table. Moving a contiguous row or column—i.e., using TAB or RET—automatically re-aligns it. If you want to disable this behavior, set org-table-automatic-realign to nil. In any case, you can always align manually a table:

C-c C-c (org-table-align)

Align the current table.

Setting the option org-startup-align-all-tables re-aligns all tables in a file upon visiting it. You can also set this option on a per-file basis with:

#+STARTUP: align
#+STARTUP: noalign

Sometimes a single field or a few fields need to carry more text, leading to inconveniently wide columns. Maybe you want to hide away several columns or display them with a fixed width, regardless of content, as shown in the following example.

|---+---------------------+--------|           |---+-------…+…|
|   | <6>                 |        |           |   | <6>   …|…|
| 1 | one                 | some   |   ----\   | 1 | one   …|…|
| 2 | two                 | boring |   ----/   | 2 | two   …|…|
| 3 | This is a long text | column |           | 3 | This i…|…|
|---+---------------------+--------|           |---+-------…+…|

To set the width of a column, one field anywhere in the column may contain just the string ‘<N>’ where N specifies the width as a number of characters. You control displayed width of columns with the following tools:

C-c TAB (org-table-toggle-column-width)

Shrink or expand current column.

If a width cookie specifies a width W for the column, shrinking it displays the first W visible characters only. Otherwise, the column is shrunk to a single character.

When called before the first column or after the last one, ask for a list of column ranges to operate on.

C-u C-c TAB (org-table-shrink)

Shrink all columns with a column width. Expand the others.

C-u C-u C-c TAB (org-table-expand)

Expand all columns.

To see the full text of a shrunk field, hold the mouse over it: a tooltip window then shows the full contents of the field. Alternatively, C-h . (display-local-help) reveals them, too. For convenience, any change near the shrunk part of a column expands it.

Setting the option org-startup-shrink-all-tables shrinks all columns containing a width cookie in a file the moment it is visited. You can also set this option on a per-file basis with:

#+STARTUP: shrink

If you would like to overrule the automatic alignment of number-rich columns to the right and of string-rich columns to the left, you can use ‘<r>’, ‘<c>’ or ‘<l>’ in a similar fashion. You may also combine alignment and field width like this: ‘<r10>’.

Lines which only contain these formatting cookies are removed automatically upon exporting the document.


Next: The Orgtbl Minor Mode, Previous: Column Width and Alignment, Up: Tables   [Contents][Index]

3.3 Column Groups

When Org exports tables, it does so by default without vertical lines because that is visually more satisfying in general. Occasionally, however, vertical lines can be useful to structure a table into groups of columns, much like horizontal lines can do for groups of rows. In order to specify column groups, you can use a special row where the first field contains only ‘/’. The further fields can either contain ‘<’ to indicate that this column should start a group, ‘>’ to indicate the end of a column, or ‘<>’ (no space between ‘<’ and ‘>’) to make a column a group of its own. Upon export, boundaries between column groups are marked with vertical lines. Here is an example:

| N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
|---+-----+-----+-----+---------+------------|
| / |  <  |     |  >  |       < |          > |
| 1 |  1  |  1  |  1  |       1 |          1 |
| 2 |  4  |  8  | 16  |  1.4142 |     1.1892 |
| 3 |  9  | 27  | 81  |  1.7321 |     1.3161 |
|---+-----+-----+-----+---------+------------|
#+TBLFM: $2=$1^2::$3=$1^3::$4=$1^4::$5=sqrt($1)::$6=sqrt(sqrt(($1)))

It is also sufficient to just insert the column group starters after every vertical line you would like to have:

| N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
|---+-----+-----+-----+---------+------------|
| / | <   |     |     | <       |            |

Next: The Spreadsheet, Previous: Column Groups, Up: Tables   [Contents][Index]

3.4 The Orgtbl Minor Mode

If you like the intuitive way the Org table editor works, you might also want to use it in other modes like Text mode or Mail mode. The minor mode Orgtbl mode makes this possible. You can always toggle the mode with M-x orgtbl-mode. To turn it on by default, for example in Message mode, use

(add-hook 'message-mode-hook #'turn-on-orgtbl)

Furthermore, with some special setup, it is possible to maintain tables in arbitrary syntax with Orgtbl mode. For example, it is possible to construct LaTeX tables with the underlying ease and power of Orgtbl mode, including spreadsheet capabilities. For details, see Tables in Arbitrary Syntax.


Next: Org Plot, Previous: The Orgtbl Minor Mode, Up: Tables   [Contents][Index]

3.5 The Spreadsheet

The table editor makes use of the Emacs Calc package to implement spreadsheet-like capabilities. It can also evaluate Emacs Lisp forms to derive fields from other fields. While fully featured, Org’s implementation is not identical to other spreadsheets. For example, Org knows the concept of a column formula that will be applied to all non-header fields in a column without having to copy the formula to each relevant field. There is also a formula debugger, and a formula editor with features for highlighting fields in the table corresponding to the references at point in the formula, moving these references by arrow keys.


Next: Formula syntax for Calc, Up: The Spreadsheet   [Contents][Index]

3.5.1 References

To compute fields in the table from other fields, formulas must reference other fields or ranges. In Org, fields can be referenced by name, by absolute coordinates, and by relative coordinates. To find out what the coordinates of a field are, press C-c ? in that field, or press C-c } to toggle the display of a grid.

Field references

Formulas can reference the value of another field in two ways. Like in any other spreadsheet, you may reference fields with a letter/number combination like ‘B3’, meaning the second field in the third row. However, Org prefers to use another, more general representation that looks like this:18

@ROW$COLUMN

Column specifications can be absolute like ‘$1’, ‘$2’, …, ‘$N’, or relative to the current column, i.e., the column of the field which is being computed, like ‘$+1’ or ‘$-2’. ‘$<’ and ‘$>’ are immutable references to the first and last column, respectively, and you can use ‘$>>>’ to indicate the third column from the right.

The row specification only counts data lines and ignores horizontal separator lines, or “hlines”. Like with columns, you can use absolute row numbers ‘@1’, ‘@2’, …, ‘@N’, and row numbers relative to the current row like ‘@+3’ or ‘@-1’. ‘@<’ and ‘@>’ are immutable references to the first and last row in the table, respectively. You may also specify the row relative to one of the hlines: ‘@I’ refers to the first hline, ‘@II’ to the second, etc. ‘@-I’ refers to the first such line above the current line, ‘@+I’ to the first such line below the current line. You can also write ‘@III+2’ which is the second data line after the third hline in the table.

@0’ and ‘$0’ refer to the current row and column, respectively, i.e., to the row/column for the field being computed. Also, if you omit either the column or the row part of the reference, the current row/column is implied.

Org’s references with unsigned numbers are fixed references in the sense that if you use the same reference in the formula for two different fields, the same field is referenced each time. Org’s references with signed numbers are floating references because the same reference operator can reference different fields depending on the field being calculated by the formula.

Here are a few examples:

@2$32nd row, 3rd column (same as ‘C2’)
$5column 5 in the current row (same as ‘E&’)
@2current column, row 2
@-1$-3field one row up, three columns to the left
@-I$2field just under hline above current row, column 2
@>$5field in the last row, in column 5

Range references

You may reference a rectangular range of fields by specifying two field references connected by two dots ‘..’. The ends are included in the range. If both fields are in the current row, you may simply use ‘$2..$7’, but if at least one field is in a different row, you need to use the general ‘@ROW$COLUMN’ format at least for the first field, i.e., the reference must start with ‘@’ in order to be interpreted correctly. Examples:

$1..$3first three fields in the current row
$P..$Qrange, using column names (see Advanced features)
$<<<..$>>start in third column, continue to the last but one
@2$1..@4$3nine fields between these two fields (same as ‘A2..C4’)
@-1$-2..@-13 fields in the row above, starting from 2 columns on the left
@I..IIbetween first and second hline, short for ‘@I..@II

Range references return a vector of values that can be fed into Calc vector functions. Empty fields in ranges are normally suppressed, so that the vector contains only the non-empty fields. For other options with the mode switches ‘E’, ‘N’ and examples, see Formula syntax for Calc.

Field coordinates in formulas

One of the very first actions during evaluation of Calc formulas and Lisp formulas is to substitute ‘@#’ and ‘$#’ in the formula with the row or column number of the field where the current result will go to. The traditional Lisp formula equivalents are org-table-current-dline and org-table-current-column. Examples:

if(@# % 2, $#, string(""))

Insert column number on odd rows, set field to empty on even rows.

$2 = '(identity remote(FOO, @@#$1))

Copy text or values of each row of column 1 of the table named FOO into column 2 of the current table.

@3 = 2 * remote(FOO, @1$$#)

Insert the doubled value of each column of row 1 of the table named FOO into row 3 of the current table.

For the second and third examples, table FOO must have at least as many rows or columns as the current table. Note that this is inefficient19 for a large number of rows.

Named references

$name’ is interpreted as the name of a column, parameter or constant. Constants are defined globally through the variable org-table-formula-constants, and locally—for the file—through a line like this example:

#+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6

Also, properties (see Properties and Columns) can be used as constants in table formulas: for a property ‘Xyz’ use the name ‘$PROP_Xyz’, and the property will be searched in the current outline entry and in the hierarchy above it. If you have the ‘constants.el’ package, it will also be used to resolve constants, including natural constants like ‘$h’ for Planck’s constant, and units like ‘$km’ for kilometers20. Column names and parameters can be specified in special table lines. These are described below, see Advanced features. All names must start with a letter, and further consist of letters and numbers.

Remote references

You may also reference constants, fields and ranges from a different table, either in the current file or even in a different file. The syntax is

remote(NAME,REF)

where NAME can be the name of a table in the current file as set by a ‘#+NAME:’ line before the table. It can also be the ID of an entry, even in a different file, and the reference then refers to the first table in that entry. REF is an absolute field or range reference as described above for example ‘@3$3’ or ‘$somename’, valid in the referenced table.

When NAME has the format ‘@ROW$COLUMN’, it is substituted with the name or ID found in this field of the current table. For example ‘remote($1, @@>$2)’ ⇒ ‘remote(year_2013, @@>$1)’. The format ‘B3’ is not supported because it cannot be distinguished from a plain table name or ID.


Next: Emacs Lisp forms as formulas, Previous: References, Up: The Spreadsheet   [Contents][Index]

3.5.2 Formula syntax for Calc

A formula can be any algebraic expression understood by the Emacs Calc package. Note that Calc has the non-standard convention that ‘/’ has lower precedence than ‘*’, so that ‘a/b*c’ is interpreted as ‘(a/(b*c))’. Before evaluation by calc-eval (see Calling Calc from Your Lisp Programs), variable substitution takes place according to the rules described above.

The range vectors can be directly fed into the Calc vector functions like vmean and vsum.

A formula can contain an optional mode string after a semicolon. This string consists of flags to influence Calc and other modes during execution. By default, Org uses the standard Calc modes (precision 12, angular units degrees, fraction and symbolic modes off). The display format, however, has been changed to ‘(float 8)’ to keep tables compact. The default settings can be configured using the variable org-calc-default-modes.

p20

Set the internal Calc calculation precision to 20 digits.

n3’, ‘s3’, ‘e2’, ‘f4

Normal, scientific, engineering or fixed format of the result of Calc passed back to Org. Calc formatting is unlimited in precision as long as the Calc calculation precision is greater.

D’, ‘R

Degree and radian angle modes of Calc.

F’, ‘S

Fraction and symbolic modes of Calc.

u

Units simplification mode of Calc. Calc is also a symbolic calculator and is capable of working with values having a unit, represented with numerals followed by a unit string in Org table cells. This mode instructs Calc to simplify the units in the computed expression before returning the result.

T’, ‘t’, ‘U

Duration computations in Calc or Lisp, Durations and time values.

E

If and how to consider empty fields. Without ‘E’ empty fields in range references are suppressed so that the Calc vector or Lisp list contains only the non-empty fields. With ‘E’ the empty fields are kept. For empty fields in ranges or empty field references the value ‘nan’ (not a number) is used in Calc formulas and the empty string is used for Lisp formulas. Add ‘N’ to use 0 instead for both formula types. For the value of a field the mode ‘N’ has higher precedence than ‘E’.

N

Interpret all fields as numbers, use 0 for non-numbers. See the next section to see how this is essential for computations with Lisp formulas. In Calc formulas it is used only occasionally because there number strings are already interpreted as numbers without ‘N’.

L

Literal, for Lisp formulas only. See the next section.

You may also provide a format specifier (similar to printf)21 to reformat the Calc result after it has been passed back to Org instead of letting Calc handle the formatting. A few examples:

$1+$2Sum of first and second field
$1+$2;%.2fSame, format result to two decimals
exp($2)+exp($1)Math functions can be used
$0;%.1fReformat current cell to 1 decimal
($3-32)*5/9Fahrenheit to Celsius conversion
$c/$1/$cmHertz to centimeter conversion using ‘constants.el
tan($1);Dp3s1Compute in degrees, precision 3, display SCI 1
sin($1);Dp3%.1eSame, but use format specifier for display
vmean($2..$7)Compute column range mean, using vector function
vmean($2..$7);ENSame, but treat empty fields as 0
taylor($3,x=7,2)Taylor series of $3, at x=7, second degree

Calc also contains a complete set of logical operations (see Logical Operations). For example

if($1 < 20, teen, string(""))

"teen"’ if age ‘$1’ is less than 20, else the Org table result field is set to empty with the empty string.

if("$1" =​= "nan" || "$2" =​= "nan", string(""), $1 + $2); E f-1

Sum of the first two columns. When at least one of the input fields is empty, the Org table result field is set to empty. ‘E’ is required to not convert empty fields to 0. ‘f-1’ is an optional Calc format string similar to ‘%.1f’ but leaves empty results empty.

if(typeof(vmean($1..$7)) =​= 12, string(""), vmean($1..$7)); E

Mean value of a range unless there is any empty field. Every field in the range that is empty is replaced by ‘nan’ which lets ‘vmean’ return ‘nan’. Then ‘typeof =’ 12= detects the ‘nan’ from vmean and the Org table result field is set to empty. Use this when the sample set is expected to never have missing values.

if("$1..$7" =​= "[]", string(""), vmean($1..$7))

Mean value of a range with empty fields skipped. Every field in the range that is empty is skipped. When all fields in the range are empty the mean value is not defined and the Org table result field is set to empty. Use this when the sample set can have a variable size.

vmean($1..$7); EN

To complete the previous example: Mean value of a range with empty fields counting as samples with value 0. Use this only when incomplete sample sets should be padded with 0 to the full size.

You can add your own Calc functions defined in Emacs Lisp with defmath and use them in formula syntax for Calc.


Next: Durations and time values, Previous: Formula syntax for Calc, Up: The Spreadsheet   [Contents][Index]

3.5.3 Emacs Lisp forms as formulas

It is also possible to write a formula in Emacs Lisp. This can be useful for string manipulation and control structures, if Calc’s functionality is not enough.

A formula is evaluated as a Lisp form when it starts with a single-quote followed by an opening parenthesis. Cell table references are interpolated into the Lisp form before execution. The evaluation should return either a string or a number. Evaluation modes and a format string (similar to printf)22 used to render the returned values can be specified after a semicolon.

By default, references are interpolated as literal Lisp strings: the field content is replaced in the Lisp form stripped of leading and trailing white space and surrounded in double-quotes. For example:

'(concat $1 $2)

concatenates the content of columns 1 and column 2.

When the ‘N’ flag is used, all referenced elements are parsed as numbers and interpolated as Lisp numbers, without quotes. Fields that cannot be parsed as numbers are interpolated as zeros. For example:

'(+ $1 $2);N

adds columns 1 and 2, equivalent to Calc’s ‘$1+$2’. Ranges are inserted as space-separated fields, so they can be embedded in list or vector syntax. For example:

'(apply '+ '($1..$4));N

computes the sum of columns 1 to 4, like Calc’s ‘vsum($1..$4)’.

When the ‘L’ flag is used, all fields are interpolated literally: the cell content is replaced in the Lisp form stripped of leading and trailing white space and without quotes. If a reference is intended to be interpreted as a string by the Lisp form, the reference operator itself should be enclosed in double-quotes, like ‘"$3"’. The ‘L’ flag is useful when strings and numbers are used in the same Lisp form. For example:

'(substring "$1" $2 $3);L

extracts the part of the string in column 1 between the character positions specified in the integers in column 2 and 3, and it is easier to read than the equivalent:

'(substring $1 (string-to-number $2) (string-to-number $3))

When the formula itself contains ‘;’ symbol, Org mode may incorrectly interpret everything past ‘;’ as format specifier:

'(concat $1 ";")

You can put an extra trailing ‘;’ to indicate that all the earlier instances of ‘;’ belong to the formula itself:

'(concat $1 ";");

Next: Field and range formulas, Previous: Emacs Lisp forms as formulas, Up: The Spreadsheet   [Contents][Index]

3.5.4 Durations and time values

If you want to compute time values use the ‘T’, ‘t’, or ‘U’ flag, either in Calc formulas or Elisp formulas:

|  Task 1 |   Task 2 |    Total |
|---------+----------+----------|
|    2:12 |     1:47 | 03:59:00 |
|    2:12 |     1:47 |    03:59 |
| 3:02:20 | -2:07:00 |     0.92 |
#+TBLFM: @2$3=$1+$2;T::@3$3=$1+$2;U::@4$3=$1+$2;t

Input duration values must be of the form ‘HH:MM[:SS]’, where seconds are optional. With the ‘T’ flag, computed durations are displayed as ‘HH:MM:SS’ (see the first formula above). With the ‘U’ flag, seconds are omitted so that the result is only ‘HH:MM’ (see second formula above). Zero-padding of the hours field depends upon the value of the variable org-table-duration-hour-zero-padding.

With the ‘t’ flag, computed durations are displayed according to the value of the option org-table-duration-custom-format, which defaults to hours and displays the result as a fraction of hours (see the third formula in the example above).

Negative duration values can be manipulated as well, and integers are considered as seconds in addition and subtraction.


Next: Column formulas, Previous: Durations and time values, Up: The Spreadsheet   [Contents][Index]

3.5.5 Field and range formulas

To assign a formula to a particular field, type it directly into the field, preceded by ‘:=’, for example ‘vsum(@II..III)’. When you press TAB or RET or C-c C-c with point still in the field, the formula is stored as the formula for this field, evaluated, and the current field is replaced with the result.

Formulas are stored in a special ‘TBLFM’ keyword located directly below the table. If you type the equation in the fourth field of the third data line in the table, the formula looks like ‘@3$4=$1+$2’. When inserting/deleting/swapping column and rows with the appropriate commands, absolute references (but not relative ones) in stored formulas are modified in order to still reference the same field. To avoid this from happening, in particular in range references, anchor ranges at the table borders (using ‘@<’, ‘@>’, ‘$<’, ‘$>’), or at hlines using the ‘@I’ notation. Automatic adaptation of field references does not happen if you edit the table structure with normal editing commands—you must fix the formulas yourself.

Instead of typing an equation into the field, you may also use the following command

C-u C-c = (org-table-eval-formula)

Install a new formula for the current field. The command prompts for a formula with default taken from the ‘TBLFM’ keyword, applies it to the current field, and stores it.

The left-hand side of a formula can also be a special expression in order to assign the formula to a number of different fields. There is no keyboard shortcut to enter such range formulas. To add them, use the formula editor (see Editing and debugging formulas) or edit the ‘TBLFM’ keyword directly.

$2=

Column formula, valid for the entire column. This is so common that Org treats these formulas in a special way, see Column formulas.

@3=

Row formula, applies to all fields in the specified row. ‘@>=’ means the last row.

@1$2..@4$3=

Range formula, applies to all fields in the given rectangular range. This can also be used to assign a formula to some but not all fields in a row.

$NAME=

Named field, see Advanced features.


Next: Lookup functions, Previous: Field and range formulas, Up: The Spreadsheet   [Contents][Index]

3.5.6 Column formulas

When you assign a formula to a simple column reference like ‘$3=’, the same formula is used in all fields of that column, with the following very convenient exceptions: (i) If the table contains horizontal separator hlines with rows above and below, everything before the first such hline is considered part of the table header and is not modified by column formulas. Therefore, a header is mandatory when you use column formulas and want to add hlines to group rows, like for example to separate a total row at the bottom from the summand rows above. (ii) Fields that already get a value from a field/range formula are left alone by column formulas. These conditions make column formulas very easy to use.

To assign a formula to a column, type it directly into any field in the column, preceded by an equal sign, like ‘=$1+$2’. When you press TAB or RET or C-c C-c with point still in the field, the formula is stored as the formula for the current column, evaluated and the current field replaced with the result. If the field contains only ‘=’, the previously stored formula for this column is used. For each column, Org only remembers the most recently used formula. In the ‘TBLFM’ keyword, column formulas look like ‘$4=$1+$2’. The left-hand side of a column formula cannot be the name of column, it must be the numeric column reference or ‘$>’.

Instead of typing an equation into the field, you may also use the following command:

C-c = (org-table-eval-formula)

Install a new formula for the current column and replace current field with the result of the formula. The command prompts for a formula, with default taken from the ‘TBLFM’ keyword, applies it to the current field and stores it. With a numeric prefix argument, e.g., C-5 C-c =, the command applies it to that many consecutive fields in the current column.


Next: Editing and debugging formulas, Previous: Column formulas, Up: The Spreadsheet   [Contents][Index]

3.5.7 Lookup functions

Org has three predefined Emacs Lisp functions for lookups in tables.

(org-lookup-first VAL S-LIST R-LIST &optional PREDICATE)

Searches for the first element S in list S-LIST for which

(PREDICATE VAL S)

is non-nil; returns the value from the corresponding position in list R-LIST. The default PREDICATE is equal. Note that the parameters VAL and S are passed to PREDICATE in the same order as the corresponding parameters are in the call to org-lookup-first, where VAL precedes S-LIST. If R-LIST is nil, the matching element S of S-LIST is returned.

(org-lookup-last VAL S-LIST R-LIST &optional PREDICATE)

Similar to org-lookup-first above, but searches for the last element for which PREDICATE is non-nil.

(org-lookup-all VAL S-LIST R-LIST &optional PREDICATE)

Similar to org-lookup-first, but searches for all elements for which PREDICATE is non-nil, and returns all corresponding values. This function cannot be used by itself in a formula, because it returns a list of values. However, powerful lookups can be built when this function is combined with other Emacs Lisp functions.

If the ranges used in these functions contain empty fields, the ‘E’ mode for the formula should usually be specified: otherwise empty fields are not included in S-LIST and/or R-LIST which can, for example, result in an incorrect mapping from an element of S-LIST to the corresponding element of R-LIST.

These three functions can be used to implement associative arrays, count matching cells, rank results, group data, etc. For practical examples see this tutorial on Worg.


Next: Updating the table, Previous: Lookup functions, Up: The Spreadsheet   [Contents][Index]

3.5.8 Editing and debugging formulas

You can edit individual formulas in the minibuffer or directly in the field. Org can also prepare a special buffer with all active formulas of a table. When offering a formula for editing, Org converts references to the standard format (like ‘B3’ or ‘D&’) if possible. If you prefer to only work with the internal format (like ‘@3$2’ or ‘$4’), configure the variable org-table-use-standard-references.

C-c = or C-u C-c = (org-table-eval-formula)

Edit the formula associated with the current column/field in the minibuffer. See Column formulas, and Field and range formulas.

C-u C-u C-c = (org-table-eval-formula)

Re-insert the active formula (either a field formula, or a column formula) into the current field, so that you can edit it directly in the field. The advantage over editing in the minibuffer is that you can use the command C-c ?.

C-c ? (org-table-field-info)

While editing a formula in a table field, highlight the field(s) referenced by the reference at point position in the formula.

C-c } (org-table-toggle-coordinate-overlays)

Toggle the display of row and column numbers for a table, using overlays. These are updated each time the table is aligned; you can force it with C-c C-c.

C-c { (org-table-toggle-formula-debugger)

Toggle the formula debugger on and off. See below.

C-c ' (org-table-edit-formulas)

Edit all formulas for the current table in a special buffer, where the formulas are displayed one per line. If the current field has an active formula, point in the formula editor marks it. While inside the special buffer, Org automatically highlights any field or range reference at point position. You may edit, remove and add formulas, and use the following commands:

C-c C-c or C-x C-s (org-table-fedit-finish)

Exit the formula editor and store the modified formulas. With C-u prefix, also apply the new formulas to the entire table.

C-c C-q (org-table-fedit-abort)

Exit the formula editor without installing changes.

C-c C-r (org-table-fedit-toggle-ref-type)

Toggle all references in the formula editor between standard (like ‘B3’) and internal (like ‘@3$2’).

TAB (org-table-fedit-lisp-indent)

Pretty-print or indent Lisp formula at point. When in a line containing a Lisp formula, format the formula according to Emacs Lisp rules. Another TAB collapses the formula back again. In the open formula, TAB re-indents just like in Emacs Lisp mode.

M-TAB (lisp-complete-symbol)

Complete Lisp symbols, just like in Emacs Lisp mode.

S-UP, S-DOWN, S-LEFT, S-RIGHT

Shift the reference at point. For example, if the reference is ‘B3’ and you press S-RIGHT, it becomes ‘C3’. This also works for relative references and for hline references.

M-S-UP (org-table-fedit-line-up)

Move the test line for column formulas up in the Org buffer.

M-S-DOWN (org-table-fedit-line-down)

Move the test line for column formulas down in the Org buffer.

M-UP (org-table-fedit-scroll-up)

Scroll up the window displaying the table.

M-DOWN (org-table-fedit-scroll-down)

Scroll down the window displaying the table.

C-c }

Turn the coordinate grid in the table on and off.

Making a table field blank does not remove the formula associated with the field, because that is stored in a different line—the ‘TBLFM’ keyword line. During the next recalculation, the field will be filled again. To remove a formula from a field, you have to give an empty reply when prompted for the formula, or to edit the ‘TBLFM’ keyword.

You may edit the ‘TBLFM’ keyword directly and re-apply the changed equations with C-c C-c in that line or with the normal recalculation commands in the table.

Using multiple ‘TBLFM’ lines

You may apply the formula temporarily. This is useful when you want to switch the formula applied to the table. Place multiple ‘TBLFM’ keywords right after the table, and then press C-c C-c on the formula to apply. Here is an example:

| x | y |
|---+---|
| 1 |   |
| 2 |   |
#+TBLFM: $2=$1*1
#+TBLFM: $2=$1*2

Pressing C-c C-c in the line of ‘#+TBLFM: $2=$1*2’ yields:

| x | y |
|---+---|
| 1 | 2 |
| 2 | 4 |
#+TBLFM: $2=$1*1
#+TBLFM: $2=$1*2

If you recalculate this table, with C-u C-c *, for example, you get the following result from applying only the first ‘TBLFM’ keyword.

| x | y |
|---+---|
| 1 | 1 |
| 2 | 2 |
#+TBLFM: $2=$1*1
#+TBLFM: $2=$1*2

Debugging formulas

When the evaluation of a formula leads to an error, the field content becomes the string ‘#ERROR’. If you want to see what is going on during variable substitution and calculation in order to find a bug, turn on formula debugging in the Tbl menu and repeat the calculation, for example by pressing C-u C-u C-c = RET in a field. Detailed information is displayed.


Next: Advanced features, Previous: Editing and debugging formulas, Up: The Spreadsheet   [Contents][Index]

3.5.9 Updating the table

Recalculation of a table is normally not automatic, but needs to be triggered by a command. To make recalculation at least semi-automatic, see Advanced features.

In order to recalculate a line of a table or the entire table, use the following commands:

C-c * (org-table-recalculate)

Recalculate the current row by first applying the stored column formulas from left to right, and all field/range formulas in the current row.

C-u C-c * or C-u C-c C-c

Recompute the entire table, line by line. Any lines before the first hline are left alone, assuming that these are part of the table header.

C-u C-u C-c * or C-u C-u C-c C-c (org-table-iterate)

Iterate the table by recomputing it until no further changes occur. This may be necessary if some computed fields use the value of other fields that are computed later in the calculation sequence.

M-x org-table-recalculate-buffer-tables

Recompute all tables in the current buffer.

M-x org-table-iterate-buffer-tables

Iterate all tables in the current buffer, in order to converge table-to-table dependencies.


Previous: Updating the table, Up: The Spreadsheet   [Contents][Index]

3.5.10 Advanced features

If you want the recalculation of fields to happen automatically, or if you want to be able to assign names23 to fields and columns, you need to reserve the first column of the table for special marking characters.

C-# (org-table-rotate-recalc-marks)

Rotate the calculation mark in first column through the states ‘#’, ‘*’, ‘!’, ‘$’. When there is an active region, change all marks in the region.

Here is an example of a table that collects exam results of students and makes use of these features:

|---+---------+--------+--------+--------+-------+------|
|   | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
|---+---------+--------+--------+--------+-------+------|
| ! |         |     P1 |     P2 |     P3 |   Tot |      |
| # | Maximum |     10 |     15 |     25 |    50 | 10.0 |
| ^ |         |     m1 |     m2 |     m3 |    mt |      |
|---+---------+--------+--------+--------+-------+------|
| # | Peter   |     10 |      8 |     23 |    41 |  8.2 |
| # | Sam     |      2 |      4 |      3 |     9 |  1.8 |
|---+---------+--------+--------+--------+-------+------|
|   | Average |        |        |        |  25.0 |      |
| ^ |         |        |        |        |    at |      |
| $ | max=50  |        |        |        |       |      |
|---+---------+--------+--------+--------+-------+------|
#+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(@-II..@-I);%.1f

Important: Please note that for these special tables, recalculating the table with C-u C-c * only affects rows that are marked ‘#’ or ‘*’, and fields that have a formula assigned to the field itself. The column formulas are not applied in rows with empty first field.

The marking characters have the following meaning:

!

The fields in this line define names for the columns, so that you may refer to a column as ‘$Tot’ instead of ‘$6’.

^

This row defines names for the fields above the row. With such a definition, any formula in the table may use ‘$m1’ to refer to the value ‘10’. Also, if you assign a formula to a names field, it is stored as ‘$name = ...’.

_

Similar to ‘^’, but defines names for the fields in the row below.

$

Fields in this row can define parameters for formulas. For example, if a field in a ‘$’ row contains ‘max=50’, then formulas in this table can refer to the value 50 using ‘$max’. Parameters work exactly like constants, only that they can be defined on a per-table basis.

#

Fields in this row are automatically recalculated when pressing TAB or RET or S-TAB in this row. Also, this row is selected for a global recalculation with C-u C-c *. Unmarked lines are left alone by this command.

*

Selects this line for global recalculation with C-u C-c *, but not for automatic recalculation. Use this when automatic recalculation slows down editing too much.

/

Do not export this line. Useful for lines that contain the narrowing ‘<N>’ markers or column group markers.

Finally, just to whet your appetite for what can be done with the fantastic Calc package, here is a table that computes the Taylor series of degree n at location x for a couple of functions.

|---+-------------+---+-----+--------------------------------------|
|   | Func        | n | x   | Result                               |
|---+-------------+---+-----+--------------------------------------|
| # | exp(x)      | 1 | x   | 1 + x                                |
| # | exp(x)      | 2 | x   | 1 + x + x^2 / 2                      |
| # | exp(x)      | 3 | x   | 1 + x + x^2 / 2 + x^3 / 6            |
| # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 |
| # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2    |
| * | tan(x)      | 3 | x   | 0.0175 x + 1.77e-6 x^3               |
|---+-------------+---+-----+--------------------------------------|
#+TBLFM: $5=taylor($2,$4,$3);n3

Previous: The Spreadsheet, Up: Tables   [Contents][Index]

3.6 Org Plot

Org Plot can produce graphs of information stored in Org tables, either graphically or in ASCII art.

Graphical plots using Gnuplot

Org Plot can produce 2D and 3D graphs of information stored in Org tables using Gnuplot and Gnuplot mode. To see this in action, ensure that you have both Gnuplot and Gnuplot mode installed on your system, then call C-c " g or M-x org-plot/gnuplot on the following table.

#+PLOT: title:"Citas" ind:1 deps:(3) type:2d with:histograms set:"yrange [0:]"
| Sede      | Max cites | H-index |
|-----------+-----------+---------|
| Chile     |    257.72 |   21.39 |
| Leeds     |    165.77 |   19.68 |
| Sao Paolo |     71.00 |   11.50 |
| Stockholm |    134.19 |   14.33 |
| Morelia   |    257.56 |   17.67 |

Org Plot supports a range of plot types, and provides the ability to add more. For example, a radar plot can be generated like so:

#+PLOT: title:"An evaluation of plaintext document formats" transpose:yes type:radar min:0 max:4
| Format            | Fine-grained-control | Initial Effort | Syntax simplicity | Editor Support | Integrations | Ease-of-referencing | Versatility |
|-------------------+----------------------+----------------+-------------------+----------------+--------------+---------------------+-------------|
| Word              |                    2 |              4 |                 4 |              2 |            3 |                   2 |           2 |
| LaTeX             |                    4 |              1 |                 1 |              3 |            2 |                   4 |           3 |
| Org Mode          |                    4 |              2 |               3.5 |              1 |            4 |                   4 |           4 |
| Markdown          |                    1 |              3 |                 3 |              4 |            3 |                   3 |           1 |
| Markdown + Pandoc |                  2.5 |            2.5 |               2.5 |              3 |            3 |                   3 |           2 |

Notice that Org Plot is smart enough to apply the table’s headers as labels. Further control over the labels, type, content, and appearance of plots can be exercised through the ‘PLOT’ keyword preceding a table. See below for a complete list of Org Plot options. For more information and examples see the Org Plot tutorial.

Plot options

set

Specify any Gnuplot option to be set when graphing.

title

Specify the title of the plot.

ind

Specify which column of the table to use as the ‘x’ axis.

timeind

Specify which column of the table to use as the ‘x’ axis as a time value.

deps

Specify the columns to graph as a Lisp style list, surrounded by parentheses and separated by spaces for example ‘dep:(3 4)’ to graph the third and fourth columns. Defaults to graphing all other columns aside from the ‘ind’ column.

transpose

When ‘y’, ‘yes’, or ‘t’ attempt to transpose the table data before plotting. Also recognizes the shorthand option ‘trans’.

type

Specify the type of the plot, by default one of ‘2d’, ‘3d’, ‘radar’, or ‘grid’. Available types can be customized with org-plot/preset-plot-types.

with

Specify a ‘with’ option to be inserted for every column being plotted, e.g., ‘lines’, ‘points’, ‘boxes’, ‘impulses’. Defaults to ‘lines’.

file

If you want to plot to a file, specify ‘"path/to/desired/output-file"’.

labels

List of labels to be used for the ‘deps’. Defaults to the column headers if they exist.

line

Specify an entire line to be inserted in the Gnuplot script.

map

When plotting ‘3d’ or ‘grid’ types, set this to ‘t’ to graph a flat mapping rather than a ‘3d’ slope.

min

Provides a minimum axis value that may be used by a plot type. Implicitly assumes the ‘y’ axis is being referred to. You can explicitly provide a value for the ‘x’ or ‘y’ axis with ‘xmin’ and ‘ymin’.

max

Provides a maximum axis value that may be used by a plot type. Implicitly assumes the ‘y’ axis is being referred to. You can explicitly provide a value for the ‘x’ or ‘y’ axis with ‘xmax’ and ‘ymax’.

ticks

Provides a desired number of axis ticks to display, that may be used by a plot type. If none is given a plot type that requires ticks will use org--plot/sensible-tick-num to try to determine a good value.

timefmt

Specify format of Org mode timestamps as they will be parsed by Gnuplot. Defaults to ‘%Y-%m-%d-%H:%M:%S’.

script

If you want total control, you can specify a script file—place the file name between double-quotes—which will be used to plot. Before plotting, every instance of ‘$datafile’ in the specified script will be replaced with the path to the generated data file. Note: even if you set this option, you may still want to specify the plot type, as that can impact the content of the data file.

ASCII bar plots

While point is on a column, typing C-c " a or M-x orgtbl-ascii-plot create a new column containing an ASCII-art bars plot. The plot is implemented through a regular column formula. When the source column changes, the bar plot may be updated by refreshing the table, for example typing C-u C-c *.

| Sede          | Max cites |              |
|---------------+-----------+--------------|
| Chile         |    257.72 | WWWWWWWWWWWW |
| Leeds         |    165.77 | WWWWWWWh     |
| Sao Paolo     |     71.00 | WWW;         |
| Stockholm     |    134.19 | WWWWWW:      |
| Morelia       |    257.56 | WWWWWWWWWWWH |
| Rochefourchat |      0.00 |              |
#+TBLFM: $3='(orgtbl-ascii-draw $2 0.0 257.72 12)

The formula is an Elisp call.

Function: orgtbl-ascii-draw value min max &optional width

Draw an ASCII bar in a table.

VALUE is the value to plot.

MIN is the value displayed as an empty bar. MAX is the value filling all the WIDTH. Source values outside this range are displayed as ‘too small’ or ‘too large’.

WIDTH is the number of characters of the bar plot. It defaults to ‘12’.


Next: TODO Items, Previous: Tables, Up: The Org Manual   [Contents][Index]

4 Hyperlinks

Like HTML, Org provides support for links inside a file, external links to other files, Usenet articles, emails, and much more.


Next: Internal Links, Up: Hyperlinks   [Contents][Index]

4.1 Link Format

Org recognizes plain URIs, possibly wrapped within angle brackets24, and activates them as clickable links.

The general link format, however, looks like this:

[[LINK][DESCRIPTION]]

or alternatively

[[LINK]]

Some ‘\’, ‘[’ and ‘]’ characters in the LINK part need to be “escaped”, i.e., preceded by another ‘\’ character. More specifically, only the following characters must be escaped:

  1. all ‘[’ and ‘]’ characters,
  2. every ‘\’ character preceding either ‘]’ or ‘[’,
  3. every ‘\’ character at the end of the link.

Functions inserting links (see Handling Links) properly escape ambiguous characters. You only need to bother about the rules above when inserting directly, or yanking, a URI within square brackets. When in doubt, you may use the function org-link-escape, which turns a link string into its escaped form.

Once a link in the buffer is complete, with all brackets present, Org changes the display so that ‘DESCRIPTION’ is displayed instead of ‘[[LINK][DESCRIPTION]]’ and ‘LINK’ is displayed instead of ‘[[LINK]]’. Links are highlighted in the org-link face, which, by default, is an underlined face.

You can directly edit the visible part of a link. This can be either the LINK part, if there is no description, or the DESCRIPTION part otherwise. To also edit the invisible LINK part, use C-c C-l with point on the link (see Handling Links).

If you place point at the beginning or just behind the end of the displayed text and press BS, you remove the—invisible—bracket at that location25. This makes the link incomplete and the internals are again displayed as plain text. Inserting the missing bracket hides the link internals again. To show the internal structure of all links, use the menu: Org → Hyperlinks → Literal links, customize org-link-descriptive, or use the ‘literallinksstartup option.


Next: Radio Targets, Previous: Link Format, Up: Hyperlinks   [Contents][Index]

4.2 Internal Links

A link that does not look like a URL—i.e., does not start with a known scheme or a file name—refers to the current document. You can follow it with C-c C-o when point is on the link, or with a mouse click (see Handling Links).

Org provides several refinements to internal navigation within a document. Most notably, a construct like ‘[[#my-custom-id]]’ specifically targets the entry with the ‘CUSTOM_ID’ property set to ‘my-custom-id’. Also, an internal link looking like ‘[[*Some section]]’ points to a headline with the name ‘Some section26.

When the link does not belong to any of the cases above, Org looks for a dedicated target: the same string in double angular brackets, like ‘<<My Target>>’.

If no dedicated target exists, the link tries to match the exact name of an element within the buffer. Naming is done, unsurprisingly, with the ‘NAME’ keyword, which has to be put in the line before the element it refers to, as in the following example

#+NAME: My Target
| a  | table      |
|----+------------|
| of | four cells |

Ultimately, if none of the above succeeds, Org searches for a headline that is exactly the link text but may also include a TODO keyword and tags, or initiates a plain text search, according to the value of org-link-search-must-match-exact-headline.

Note that you must make sure custom IDs, dedicated targets, and names are unique throughout the document. Org provides a linter to assist you in the process, if needed. See Org Syntax.

During export, internal links are used to mark objects and assign them a number. Marked objects are then referenced by links pointing to them. In particular, links without a description appear as the number assigned to the marked object27. In the following excerpt from an Org buffer

1. one item
2. <<target>>another item
Here we refer to item [[target]].

The last sentence will appear as ‘Here we refer to item 2’ when exported.

In non-Org files, the search looks for the words in the link text. In the above example, the search would be for ‘target’.

Following a link pushes a mark onto Org’s own mark ring. You can return to the previous position with C-c &. Using this command several times in direct succession goes back to positions recorded earlier.


Next: External Links, Previous: Internal Links, Up: Hyperlinks   [Contents][Index]

4.3 Radio Targets

Org can automatically turn any occurrences of certain target names in normal text into a link. So without explicitly creating a link, the text connects to the target radioing its position. Radio targets are enclosed by triple angular brackets. For example, a target ‘<<<My Target>>>’ causes each occurrence of ‘my target’ in normal text to become activated as a link. The Org file is scanned automatically for radio targets only when the file is first loaded into Emacs. To update the target list during editing, press C-c C-c with point on or at a target.


Next: Handling Links, Previous: Radio Targets, Up: Hyperlinks   [Contents][Index]

4.4 External Links

Org supports links to files, websites, Usenet and email messages, BBDB database entries and links to both IRC conversations and their logs. External links are URL-like locators. They start with a short identifying string followed by a colon. There can be no space after the colon.

Here is the full set of built-in link types:

file

File links. File name may be remote, absolute, or relative.

As a special case, the “file” prefix may be omitted if the file name is complete, e.g., it starts with ‘./’ or ‘/’.

attachment

Same as file links but for files and folders attached to the current node (see Attachments). Attachment links are intended to behave exactly as file links but for files relative to the attachment directory.

bbdb

Link to a BBDB record, with possible regexp completion.

docview

Link to a document opened with DocView mode. You may specify a page number.

doi

Link to an electronic resource, through its handle.

elisp

Execute an Elisp command upon activation.

gnus’, ‘rmail’, ‘mhe

Link to messages or folders from a given Emacs MUA.

help

Display documentation of a symbol in ‘*Help*’ buffer.

http’, ‘https

Web links.

id

Link to a specific headline by its ID property, in an Org file.

info

Link to an Info manual, or to a specific node.

irc

Link to an IRC channel.

mailto

Link to message composition.

news

Usenet links.

shell

Execute a shell command upon activation.

shortdoc

Link to short documentation summary for an Emacs Lisp function group. 28

For more information, see Name Help and Documentation Groups.

For ‘file:’ and ‘id:’ links, you can additionally specify a line number, or a text search string, separated by ‘::’. In Org files, you may link to a headline name, a custom ID, or a code reference instead.

The following table illustrates the link types above, along with their options:

Link TypeExample
httphttp://orgmode.org/
httpshttps://orgmode.org/
doidoi:10.1000/182
filefile:/home/dominik/images/jupiter.jpg
/home/dominik/images/jupiter.jpg’ (same as above)
file:papers/last.pdf
./papers/last.pdf’ (same as above)
file:/ssh:me@some.where:papers/last.pdf’ (remote)
/ssh:me@some.where:papers/last.pdf’ (same as above)
file:sometextfile::NNN’ (jump to line number)
file:projects.org
file:projects.org::some words’ (text search)29
file:projects.org::*task title’ (headline search)
file:projects.org::#custom-id’ (headline search)
attachmentattachment:projects.org
attachment:projects.org::some words’ (text search)
docviewdocview:papers/last.pdf::NNN
idid:B7423F4D-2E8A-471B-8810-C40F074717E9
id:B7423F4D-2E8A-471B-8810-C40F074717E9::*task’ (headline search)
newsnews:comp.emacs
mailtomailto:adent@galaxy.net
mhemhe:folder’ (folder link)
mhe:folder#id’ (message link)
rmailrmail:folder’ (folder link)
rmail:folder#id’ (message link)
gnusgnus:group’ (group link)
gnus:group#id’ (article link)
bbdbbbdb:R.*Stallman’ (record with regexp)
ircirc:/irc.com/#emacs/bob
helphelp:org-store-link
infoinfo:org#External links
shortdocshortdoc:text-properties
shortdoc:text-properties::#get-pos-property
shellshell:ls *.org’ (synchronous), ‘shell:inkscape&’ (asynchronous)
elispelisp:(find-file "Elisp.org")’ (Elisp form to evaluate)
elisp:org-agenda’ (interactive Elisp command)

On top of these built-in link types, additional ones are available through the ‘org-contrib’ repository (see Installation). For example, these links to VM or Wanderlust messages are available when you load the corresponding libraries from the ‘org-contrib’ repository:

vm:folderVM folder link
vm:folder#idVM message link
vm://myself@some.where.org/folder#idVM on remote machine
vm-imap:account:folderVM IMAP folder link
vm-imap:account:folder#idVM IMAP message link
wl:folderWanderlust folder link
wl:folder#idWanderlust message link

For information on customizing Org to add new link types, see Adding Hyperlink Types.

A link should be enclosed in double brackets and may contain descriptive text to be displayed instead of the URL (see Link Format), for example:

[[https://www.gnu.org/software/emacs/][GNU Emacs]]

If the description is a file name or URL that points to an image, HTML export (see HTML Export) inlines the image as a clickable button. If there is no description at all and the link points to an image, that image is inlined into the exported HTML file.

Org also recognizes external links amid normal text and activates them as links. If spaces must be part of the link (for example in ‘bbdb:R.*Stallman’), or if you need to remove ambiguities about the end of the link, enclose the link in square or angular brackets.


Next: Using Links Outside Org, Previous: External Links, Up: Hyperlinks   [Contents][Index]

4.5 Handling Links

Org provides methods to create a link in the correct syntax, to insert it into an Org file, and to follow the link.

The main function is org-store-link, called with M-x org-store-link. Because of its importance, we suggest binding it to a widely available key (see Activation). It stores a link to the current location. The link is stored for later insertion into an Org buffer—see below. The kind of link that is created depends on the current buffer:

Org mode buffers

For Org files, if there is a ‘<<target>>’ at point, the link points to the target. If there is a named block (using ‘#+name:’) at point, the link points to that name. Otherwise, it points to the current headline, which is also the description.

If the headline has a ‘CUSTOM_ID’ property, store a link to this custom ID. In addition or alternatively, depending on the value of org-id-link-to-org-use-id, create and/or use a globally unique ‘ID’ property for the link30. So using this command in Org buffers potentially creates two links: a human-readable link from the custom ID, and one that is globally unique and works even if the entry is moved from file to file. The ‘ID’ property can be either a UUID (default) or a timestamp, depending on org-id-method. Later, when inserting the link, you need to decide which one to use.

When org-id-link-consider-parent-id is t31, parent ‘ID’ properties are considered. This allows linking to specific targets, named blocks, or headlines (which may not have a globally unique ‘ID’ themselves) within the context of a parent headline or file which does.

For example, given this org file:

* Parent
:PROPERTIES:
:ID: abc
:END:
** Child 1
** Child 2

Storing a link with point at “Child 1” will produce a link ‘<id:abc::*Child 1>’, which precisely links to the “Child 1” headline even though it does not have its own ID.

Email/News clients: VM, Rmail, Wanderlust, MH-E, Gnus

Pretty much all Emacs mail clients are supported. The link points to the current article, or, in some Gnus buffers, to the group. The description is constructed according to the variable org-link-email-description-format. By default, it refers to the addressee and the subject.

Web browsers: W3M and EWW

Here the link is the current URL, with the page title as the description.

Contacts: BBDB

Links created in a BBDB buffer point to the current entry.

Chat: IRC

For IRC links, if the variable org-irc-link-to-logs is non-nil, create a ‘file’ style link to the relevant point in the logs for the current conversation. Otherwise, store an ‘irc’ style link to the user/channel/server under the point.

Other files

For any other file, the link points to the file, with a search string (see Search Options in File Links) pointing to the contents of the current line. If there is an active region, the selected words form the basis of the search string. You can write custom Lisp functions to select the search string and perform the search for particular file types (see Custom Searches).

You can also define dedicated links to other files. See Adding Hyperlink Types.

Agenda view

When point is in an agenda view, the created link points to the entry referenced by the current line.

From an Org buffer, the following commands create, navigate or, more generally, act on links.

C-c C-l (org-insert-link)

Insert a link32. This prompts for a link to be inserted into the buffer. You can just type a link, using text for an internal link, or one of the link type prefixes mentioned in the examples above. The link is inserted into the buffer, along with a descriptive text33. If some text was selected at this time, it becomes the default description.

Inserting stored links

All links stored during the current session are part of the history for this prompt, so you can access them with UP and DOWN (or M-p, M-n).

Completion support

Completion with TAB helps you to insert valid link prefixes like ‘http’ or ‘ftp’, including the prefixes defined through link abbreviations (see Link Abbreviations). If you press RET after inserting only the prefix, Org offers specific completion support for some link types34. For example, if you type f i l e RET—alternative access: C-u C-c C-l, see below—Org offers file name completion, and after b b d b RET you can complete contact names.

C-u C-c C-l

When C-c C-l is called with a C-u prefix argument, insert a link to a file. You may use file name completion to select the name of the file. The path to the file is inserted relative to the directory of the current Org file, if the linked file is in the current directory or in a subdirectory of it, or if the path is written relative to the current directory using ‘../’. Otherwise, an absolute path is used, if possible with ‘~/’ for your home directory. You can force an absolute path with two C-u prefixes.

C-c C-l (with point on existing link)

When point is on an existing link, C-c C-l allows you to edit the link and description parts of the link.

C-c C-o (org-open-at-point)

Open link at point. This launches a web browser for URL (using browse-url-at-point), runs VM/MH-E/Wanderlust/Rmail/Gnus/BBDB for the corresponding links, and executes the command in a shell link. When point is on an internal link, this command runs the corresponding search. When point is on the tags part of a headline, it creates the corresponding tags view (see Matching tags and properties). If point is on a timestamp, it compiles the agenda for that date. Furthermore, it visits text and remote files in ‘file’ links with Emacs and selects a suitable application for local non-text files. Classification of files is based on file extension only. See option org-file-apps. If you want to override the default application and visit the file with Emacs, use a C-u prefix. If you want to avoid opening in Emacs, use a C-u C-u prefix.

If point is on a headline, but not on a link, Org offers all links in the headline and entry text. If you want to set up the frame configuration for following links, customize org-link-frame-setup.

RET

When org-return-follows-link is set, RET also follows the link at point.

mouse-2 or mouse-1

On links, mouse-1 and mouse-2 open the link just as C-c C-o does.

mouse-3

Like mouse-2, but force file links to be opened with Emacs, and internal links to be displayed in another window35.

C-c % (org-mark-ring-push)

Push the current position onto the Org mark ring, to be able to return easily. Commands following an internal link do this automatically.

C-c & (org-mark-ring-goto)

Jump back to a recorded position. A position is recorded by the commands following internal links, and by C-c %. Using this command several times in direct succession moves through a ring of previously recorded positions.

C-c C-x C-n (org-next-link), C-c C-x C-p (org-previous-link)

Move forward/backward to the next/previous link in the buffer. At the limit of the buffer, the search fails once, and then wraps around. The key bindings for this are really too long; you might want to bind this also to M-n and M-p.

(with-eval-after-load 'org
  (define-key org-mode-map (kbd "M-n") #'org-next-link)
  (define-key org-mode-map (kbd "M-p") #'org-previous-link))

Next: Link Abbreviations, Previous: Handling Links, Up: Hyperlinks   [Contents][Index]

4.6 Using Links Outside Org

You can insert and follow links that have Org syntax not only in Org, but in any Emacs buffer. For this, Org provides two functions: org-insert-link-global and org-open-at-point-global.

You might want to bind them to globally available keys. See Activation for some advice.


Next: Search Options in File Links, Previous: Using Links Outside Org, Up: Hyperlinks   [Contents][Index]

4.7 Link Abbreviations

Long URLs can be cumbersome to type, and often many similar links are needed in a document. For this you can use link abbreviations. An abbreviated link looks like this

[[linkword:tag][description]]

where the tag is optional. The linkword must be a word, starting with a letter, followed by letters, numbers, ‘-’, and ‘_’. Abbreviations are resolved according to the information in the variable org-link-abbrev-alist that relates the linkwords to replacement text. Here is an example:

(setq org-link-abbrev-alist
      '(("bugzilla"        . "https://10.1.2.9/bugzilla/show_bug.cgi?id=")
        ("Nu Html Checker" . "https://validator.w3.org/nu/?doc=%h")
        ("duckduckgo"      . "https://duckduckgo.com/?q=%s")
        ("omap"            . "https://nominatim.openstreetmap.org/search?q=%s&polygon=1")
        ("ads"             . "https://ui.adsabs.harvard.edu/search/q=%20author%3A\"%s\"")))

If the replacement text contains the string ‘%s’, it is replaced with the tag. Using ‘%h’ instead of ‘%s’ percent-encodes the tag (see the example above, where we need to encode the URL parameter). Using ‘%(my-function)’ passes the tag to a custom Lisp function, and replaces it by the resulting string.

If the replacement text does not contain any specifier, it is simply appended to the string in order to create the link.

Instead of a string, you may also specify a Lisp function to create the link. Such a function will be called with the tag as the only argument.

With the above setting, you could link to a specific bug with ‘[[bugzilla:129]]’, search the web for ‘OrgMode’ with ‘[[duckduckgo:OrgMode]]’, show the map location of the Free Software Foundation ‘[[omap:31 Milk Street, Boston]]’ or of Carsten’s office ‘[[omap:Science Park 904, Amsterdam, The Netherlands]]’ and find out what the Org author is doing besides Emacs hacking with ‘[[ads:Dominik,C]]’.

If you need special abbreviations just for a single Org buffer, you can define them in the file with

#+LINK: bugzilla  https://10.1.2.9/bugzilla/show_bug.cgi?id=
#+LINK: duckduckgo https://duckduckgo.com/?q=%s
#+LINK: "Nu Html Checker" https://validator.w3.org/nu/?doc=%h

The abbreviations containing spaces must be quoted.

In-buffer completion (see Completion) can be used after ‘[’ to complete link abbreviations. You may also define a Lisp function that implements special (e.g., completion) support for inserting such a link with C-c C-l. Such a function should not accept any arguments, and should return the full link with a prefix. You can set the link completion function like this:

(org-link-set-parameter "type" :complete #'some-completion-function)

Next: Custom Searches, Previous: Link Abbreviations, Up: Hyperlinks   [Contents][Index]

4.8 Search Options in File Links

File links can contain additional information to make Emacs jump to a particular location in the file when following a link. This can be a line number or a search option after a double colon36. For example, when the command org-store-link creates a link (see Handling Links) to a file, it encodes the words in the current line as a search string that can be used to find this line back later when following the link with C-c C-o.

Note that all search options apply for Attachment and ID links in the same way that they apply for File links.

Here is the syntax of the different ways to attach a search to a file link, together with explanations for each:

[[file:~/code/main.c::255]]
[[file:~/xx.org::My Target]]
[[file:~/xx.org::*My Target]]
[[file:~/xx.org::#my-custom-id]]
[[file:~/xx.org::/regexp/]]
[[attachment:main.c::255]]
255

Jump to line 255.

My Target

Search for a link target ‘<<My Target>>’, or do a text search for ‘my target’, similar to the search in internal links, see Internal Links. In HTML export (see HTML Export), such a file link becomes an HTML reference to the corresponding named anchor in the linked file.

*My Target

In an Org file, restrict search to headlines.

#my-custom-id

Link to a heading with a ‘CUSTOM_ID’ property

/REGEXP/

Do a regular expression search for REGEXP (see Regular Expressions). This uses the Emacs command occur to list all matches in a separate window. If the target file is in Org mode, org-occur is used to create a sparse tree with the matches.

As a degenerate case, a file link with an empty file name can be used to search the current file. For example, ‘[[file:::find me]]’ does a search for ‘find me’ in the current file, just as ‘[[find me]]’ would.


Previous: Search Options in File Links, Up: Hyperlinks   [Contents][Index]

4.9 Custom Searches

The default mechanism for creating search strings and for doing the actual search related to a file link may not work correctly in all cases. For example, BibTeX database files have many entries like year="1993" which would not result in good search strings, because the only unique identification for a BibTeX entry is the citation key.

If you come across such a problem, you can write custom functions to set the right search string for a particular file type, and to do the search for the string in the file. Using add-hook, these functions need to be added to the hook variables org-create-file-search-functions and org-execute-file-search-functions. See the docstring for these variables for more information. Org actually uses this mechanism for BibTeX database files, and you can use the corresponding code as an implementation example. See the file ‘ol-bibtex.el’.


Next: Tags, Previous: Hyperlinks, Up: The Org Manual   [Contents][Index]

5 TODO Items

Org mode does not maintain TODO lists as separate documents37. Instead, TODO items are an integral part of the notes file, because TODO items usually come up while taking notes! With Org mode, simply mark any entry in a tree as being a TODO item. In this way, information is not duplicated, and the entire context from which the TODO item emerged is always present.

Of course, this technique for managing TODO items scatters them throughout your notes file. Org mode compensates for this by providing methods to give you an overview of all the things that you have to do.


Next: Extended Use of TODO Keywords, Up: TODO Items   [Contents][Index]

5.1 Basic TODO Functionality

Any headline becomes a TODO item when it starts with the word ‘TODO’, for example:

*** TODO Write letter to Sam Fortune

The most important commands to work with TODO entries are:

C-c C-t (org-todo)

Rotate the TODO state of the current item among

,-> (unmarked) -> TODO -> DONE --.
'--------------------------------'

If TODO keywords have fast access keys (see Fast access to TODO states), prompt for a TODO keyword through the fast selection interface; this is the default behavior when org-use-fast-todo-selection is non-nil.

The same state changing can also be done “remotely” from the agenda buffer with the t command key (see Commands in the Agenda Buffer).

S-RIGHT S-LEFT

Select the following/preceding TODO state, similar to cycling. Useful mostly if more than two TODO states are possible (see Extended Use of TODO Keywords). See also Packages that conflict with Org mode for a discussion of the interaction with shift-selection. See also the variable org-treat-S-cursor-todo-selection-as-state-change.

C-c / t (org-show-todo-tree)

View TODO items in a sparse tree (see Sparse Trees). Folds the entire buffer, but shows all TODO items—with a not-DONE state—and the headings hierarchy above them. With a prefix argument, or by using C-c / T, search for a specific TODO. You are prompted for the keyword, and you can also give a list of keywords like ‘KWD1|KWD2|...’ to list entries that match any one of these keywords. With a numeric prefix argument N, show the tree for the Nth keyword in the variable org-todo-keywords. With two prefix arguments, find all TODO states, both un-done and done.

M-x org-agenda t (org-todo-list)

Show the global TODO list. Collects the TODO items (with not-DONE states) from all agenda files (see Agenda Views) into a single buffer. The new buffer is in Org Agenda mode, which provides commands to examine and manipulate the TODO entries from the new buffer (see Commands in the Agenda Buffer). See The global TODO list for more information.

S-M-RET (org-insert-todo-heading)

Insert a new TODO entry below the current one.

Changing a TODO state can also trigger tag changes. See the docstring of the option org-todo-state-tags-triggers for details.


Next: Progress Logging, Previous: Basic TODO Functionality, Up: TODO Items   [Contents][Index]

5.2 Extended Use of TODO Keywords

By default, marked TODO entries have one of only two states: TODO and DONE. Org mode allows you to classify TODO items in more complex ways with TODO keywords (stored in org-todo-keywords). With special setup, the TODO keyword system can work differently in different files.

Note that tags are another way to classify headlines in general and TODO items in particular (see Tags).


Next: TODO keywords as types, Up: Extended Use of TODO Keywords   [Contents][Index]

5.2.1 TODO keywords as workflow states

You can use TODO keywords to indicate different, possibly sequential states in the process of working on an item, for example38:

(setq org-todo-keywords
      '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))

The vertical bar separates the TODO keywords (states that need action) from the DONE states (which need no further action). If you do not provide the separator bar, the last state is used as the DONE state.

With this setup, the command C-c C-t cycles an entry from ‘TODO’ to ‘FEEDBACK’, then to ‘VERIFY’, and finally to ‘DONE’ and ‘DELEGATED’. You may also use a numeric prefix argument to quickly select a specific state. For example C-3 C-c C-t changes the state immediately to ‘VERIFY’. Or you can use S-RIGHT and S-LEFT to go forward and backward through the states. If you define many keywords, you can use in-buffer completion (see Completion) or a special one-key selection scheme (see Fast access to TODO states) to insert these words into the buffer. Changing a TODO state can be logged with a timestamp; see Tracking TODO state changes for more information.


Next: Multiple keyword sets in one file, Previous: TODO keywords as workflow states, Up: Extended Use of TODO Keywords   [Contents][Index]

5.2.2 TODO keywords as types

The second possibility is to use TODO keywords to indicate different types of action items. For example, you might want to indicate that items are for “work” or “home”. Or, when you work with several people on a single project, you might want to assign action items directly to persons, by using their names as TODO keywords. This type of functionality is actually much better served by using tags (see Tags), so the TODO implementation is kept just for backward compatibility.

Using TODO types, it would be set up like this:

(setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))

In this case, different keywords do not indicate states, but rather different types. So the normal workflow would be to assign a task to a person, and later to mark it DONE. Org mode supports this style by adapting the working of the command C-c C-t39. When used several times in succession, it still cycles through all names, in order to first select the right type for a task. But when you return to the item after some time and execute C-c C-t again, it will switch from any name directly to ‘DONE’. Use prefix arguments or completion to quickly select a specific name. You can also review the items of a specific TODO type in a sparse tree by using a numeric prefix to C-c / t. For example, to see all things Lucy has to do, you would use C-3 C-c / t. To collect Lucy’s items from all agenda files into a single buffer, you would use the numeric prefix argument as well when creating the global TODO list: C-3 M-x org-agenda t.


Next: Fast access to TODO states, Previous: TODO keywords as types, Up: Extended Use of TODO Keywords   [Contents][Index]

5.2.3 Multiple keyword sets in one file

Sometimes you may want to use different sets of TODO keywords in parallel. For example, you may want to have the basic TODO/DONE, but also a workflow for bug fixing, and a separate state indicating that an item has been canceled—so it is not DONE, but also does not require action. Your setup would then look like this:

(setq org-todo-keywords
      '((sequence "TODO" "|" "DONE")
        (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED")
        (sequence "|" "CANCELED")))

The keywords should all be different, this helps Org mode keep track of which subsequence should be used for a given entry. In this setup, C-c C-t only operates within a sub-sequence, so it switches from ‘DONE’ to (nothing) to ‘TODO’, and from ‘FIXED’ to (nothing) to ‘REPORT’. Therefore, you need a mechanism to initially select the correct sequence. In addition to typing a keyword or using completion (see Completion), you may also apply the following commands:

C-u C-u C-c C-t, C-S-RIGHT, C-S-LEFT

These keys jump from one TODO sub-sequence to the next. In the above example, C-u C-u C-c C-t or C-S-RIGHT would jump from ‘TODO’ or ‘DONE’ to ‘REPORT’, and any of the words in the second row to ‘CANCELED’. Note that the C-S- key binding conflicts with shift-selection (see Packages that conflict with Org mode).

S-RIGHT, S-LEFT

S-LEFT and S-RIGHT walk through all keywords from all sub-sequences, so for example S-RIGHT would switch from ‘DONE’ to ‘REPORT’ in the example above. For a discussion of the interaction with shift-selection, see Packages that conflict with Org mode.


Next: Setting up keywords for individual files, Previous: Multiple keyword sets in one file, Up: Extended Use of TODO Keywords   [Contents][Index]

5.2.4 Fast access to TODO states

If you would like to quickly change an entry to an arbitrary TODO state instead of cycling through the states, you can set up keys for single-letter access to the states. This is done by adding the selection character after each keyword, in parentheses40. For example:

(setq org-todo-keywords
      '((sequence "TODO(t)" "|" "DONE(d)")
        (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
        (sequence "|" "CANCELED(c)")))

If you then press C-c C-t followed by the selection key, the entry is switched to this state. SPC can be used to remove any TODO keyword from an entry.


Next: Faces for TODO keywords, Previous: Fast access to TODO states, Up: Extended Use of TODO Keywords   [Contents][Index]

5.2.5 Setting up keywords for individual files

It can be very useful to use different aspects of the TODO mechanism in different files. For file-local settings, you need to add special lines to the file which set the keywords and interpretation for that file only. For example, to set one of the two examples discussed above, you need one of the following lines, starting in column zero anywhere in the file:

#+TODO: TODO FEEDBACK VERIFY | DONE CANCELED

You may also write ‘#+SEQ_TODO’ to be explicit about the interpretation, but it means the same as ‘#+TODO’, or

#+TYP_TODO: Fred Sara Lucy Mike | DONE

A setup for using several sets in parallel would be:

#+TODO: TODO(t) | DONE(d)
#+TODO: REPORT(r) BUG(b) KNOWNCAUSE(k) | FIXED(f)
#+TODO: | CANCELED(c)

To make sure you are using the correct keyword, type ‘#+’ into the buffer and then use M-TAB to complete it (see Completion).

Remember that the keywords after the vertical bar—or the last keyword if no bar is there—must always mean that the item is DONE, although you may use a different word. After changing one of these lines, use C-c C-c with point still in the line to make the changes known to Org mode41.


Next: TODO dependencies, Previous: Setting up keywords for individual files, Up: Extended Use of TODO Keywords   [Contents][Index]

5.2.6 Faces for TODO keywords

Org mode highlights TODO keywords with special faces: org-todo for keywords indicating that an item still has to be acted upon, and org-done for keywords indicating that an item is finished. If you are using more than two different states, you might want to use special faces for some of them. This can be done using the variable org-todo-keyword-faces. For example:

(setq org-todo-keyword-faces
      '(("TODO" . org-warning) ("STARTED" . "yellow")
        ("CANCELED" . (:foreground "blue" :weight bold))))

While using a list with face properties as shown for ‘CANCELEDshould work, this does not always seem to be the case. If necessary, define a special face and use that. A string is interpreted as a color. The variable org-faces-easy-properties determines if that color is interpreted as a foreground or a background color.


Previous: Faces for TODO keywords, Up: Extended Use of TODO Keywords   [Contents][Index]

5.2.7 TODO dependencies

The structure of Org files—hierarchy and lists—makes it easy to define TODO dependencies. Usually, a parent TODO task should not be marked as done until all TODO subtasks, or children tasks, are marked as done. Sometimes there is a logical sequence to (sub)tasks, so that one subtask cannot be acted upon before all siblings above it have been marked as done. If you customize the variable org-enforce-todo-dependencies, Org blocks entries from changing state to DONE while they have TODO children that are not DONE. Furthermore, if an entry has a property ‘ORDERED’, each of its TODO children is blocked until all earlier siblings are marked as done. Here is an example:

* TODO Blocked until (two) is done
** DONE one
** TODO two
* Parent
:PROPERTIES:
:ORDERED:  t
:END:
** TODO a
** TODO b, needs to wait for (a)
** TODO c, needs to wait for (a) and (b)

You can ensure an entry is never blocked by using the ‘NOBLOCKING’ property (see Properties and Columns):

* This entry is never blocked
:PROPERTIES:
:NOBLOCKING: t
:END:
C-c C-x o (org-toggle-ordered-property)

Toggle the ‘ORDERED’ property of the current entry. A property is used for this behavior because this should be local to the current entry, not inherited from entries above like a tag (see Tags). However, if you would like to track the value of this property with a tag for better visibility, customize the variable org-track-ordered-property-with-tag.

C-u C-u C-u C-c C-t

Change TODO state, regardless of any state blocking.

If you set the variable org-agenda-dim-blocked-tasks, TODO entries that cannot be marked as done because of unmarked children are shown in a dimmed font or even made invisible in agenda views (see Agenda Views).

You can also block changes of TODO states by using checkboxes (see Checkboxes). If you set the variable org-enforce-todo-checkbox-dependencies, an entry that has unchecked checkboxes is blocked from switching to DONE.

If you need more complex dependency structures, for example dependencies between entries in different trees or files, check out the module ‘org-depend.el’ in the ‘org-contrib’ repository.


Next: Priorities, Previous: Extended Use of TODO Keywords, Up: TODO Items   [Contents][Index]

5.3 Progress Logging

To record a timestamp and a note when changing a TODO state, call the command org-todo with a prefix argument.

C-u C-c C-t (org-todo)

Prompt for a note and record the time of the TODO state change. The note is inserted as a list item below the headline, but can also be placed into a drawer, see Tracking TODO state changes.

If you want to be more systematic, Org mode can automatically record a timestamp and optionally a note when you mark a TODO item as DONE, or even each time you change the state of a TODO item. This system is highly configurable, settings can be on a per-keyword basis and can be localized to a file or even a subtree. For information on how to clock working time for a task, see Clocking Work Time.


Next: Tracking TODO state changes, Up: Progress Logging   [Contents][Index]

5.3.1 Closing items

The most basic automatic logging is to keep track of when a certain TODO item was marked as done. This can be achieved with42

(setq org-log-done 'time)

Then each time you turn an entry from a TODO (not-done) state into any of the DONE states, a line ‘CLOSED: [timestamp]’ is inserted just after the headline. If you turn the entry back into a TODO item through further state cycling, that line is removed again. If you turn the entry back to a non-TODO state (by pressing C-c C-t SPC, for example), that line is also removed, unless you set org-closed-keep-when-no-todo to non-nil. If you want to record a note along with the timestamp, use43

(setq org-log-done 'note)

You are then prompted for a note, and that note is stored below the entry with a ‘Closing Note’ heading.


Next: Tracking your habits, Previous: Closing items, Up: Progress Logging   [Contents][Index]

5.3.2 Tracking TODO state changes

You might want to automatically keep track of when a state change occurred and maybe take a note about this change. You can either record just a timestamp, or a time-stamped note. These records are inserted after the headline as an itemized list, the newest first44. When taking a lot of notes, you might want to get the notes out of the way into a drawer (see Drawers). Customize the variable org-log-into-drawer to get this behavior—the recommended drawer for this is called ‘LOGBOOK45. You can also overrule the setting of this variable for a subtree by setting a ‘LOG_INTO_DRAWER’ property.

Since it is normally too much to record a note for every state, Org mode expects configuration on a per-keyword basis for this. This is achieved by adding special markers ‘!’ (for a timestamp) or ‘@’ (for a note with timestamp) in parentheses after each keyword. For example, with the setting

(setq org-todo-keywords
      '((sequence "TODO(t)" "WAIT(w@/!)" "|" "DONE(d!)" "CANCELED(c@)")))

You not only define global TODO keywords and fast access keys, but also request that a time is recorded when the entry is set to ‘DONE’, and that a note is recorded when switching to ‘WAIT’ or ‘CANCELED46. The setting for ‘WAIT’ is even more special: the ‘!’ after the slash means that in addition to the note taken when entering the state, a timestamp should be recorded when leaving the ‘WAIT’ state, if and only if the target state does not configure logging for entering it. So it has no effect when switching from ‘WAIT’ to ‘DONE’, because ‘DONE’ is configured to record only a timestamp. But when switching from ‘WAIT’ back to ‘TODO’, the ‘/!’ in the ‘WAIT’ setting now triggers a timestamp even though ‘TODO’ has no logging configured.

You can use the exact same syntax for setting logging preferences local to a buffer:

#+TODO: TODO(t) WAIT(w@/!) | DONE(d!) CANCELED(c@)

To record a timestamp without a note for TODO keywords configured with ‘@’, just type C-c C-c to enter a blank note when prompted.

In order to define logging settings that are local to a subtree or a single item, define a ‘LOGGING’ property in this entry. Any non-empty ‘LOGGING’ property resets all logging settings to nil. You may then turn on logging for this specific tree using ‘STARTUP’ keywords like ‘lognotedone’ or ‘logrepeat’, as well as adding state specific settings like ‘TODO(!)’. For example:

* TODO Log each state with only a time
  :PROPERTIES:
  :LOGGING: TODO(!) WAIT(!) DONE(!) CANCELED(!)
  :END:
* TODO Only log when switching to WAIT, and when repeating
  :PROPERTIES:
  :LOGGING: WAIT(@) logrepeat
  :END:
* TODO No logging at all
  :PROPERTIES:
  :LOGGING: nil
  :END:

Previous: Tracking TODO state changes, Up: Progress Logging   [Contents][Index]

5.3.3 Tracking your habits

Org has the ability to track the consistency of a special category of TODO, called “habits.” To use habits, you have to enable the habit module by customizing the variable org-modules.

A habit has the following properties:

  1. The habit is a TODO item, with a TODO keyword representing an open state.
  2. The property ‘STYLE’ is set to the value ‘habit’ (see Properties and Columns).
  3. The TODO has a scheduled date, usually with a ‘.+’ style repeat interval. A ‘++’ style may be appropriate for habits with time constraints, e.g., must be done on specific days of week (‘++1w’), or a ‘+’ style for an unusual habit that can have a backlog, e.g., weekly reports. See Repeated tasks for more details about repeat intervals.
  4. The TODO may also have minimum and maximum ranges specified by using the syntax ‘.+2d/3d’, which says that you want to do the task at least every three days, but, at most, every two days.
  5. State logging for the DONE state is enabled (see Tracking TODO state changes), in order for historical data to be represented in the consistency graph. If it is not enabled it is not an error, but the consistency graphs are largely meaningless.

To give you an idea of what the above rules look like in action, here’s an actual habit with some history:

** TODO Shave
   SCHEDULED: <2009-10-17 Sat .+2d/4d>
   :PROPERTIES:
   :STYLE:    habit
   :LAST_REPEAT: [2009-10-19 Mon 00:36]
   :END:
   - State "DONE"       from "TODO"       [2009-10-15 Thu]
   - State "DONE"       from "TODO"       [2009-10-12 Mon]
   - State "DONE"       from "TODO"       [2009-10-10 Sat]
   - State "DONE"       from "TODO"       [2009-10-04 Sun]
   - State "DONE"       from "TODO"       [2009-10-02 Fri]
   - State "DONE"       from "TODO"       [2009-09-29 Tue]
   - State "DONE"       from "TODO"       [2009-09-25 Fri]
   - State "DONE"       from "TODO"       [2009-09-19 Sat]
   - State "DONE"       from "TODO"       [2009-09-16 Wed]
   - State "DONE"       from "TODO"       [2009-09-12 Sat]

What this habit says is: I want to shave, at most, every 2 days—given by the ‘SCHEDULED’ date and repeat interval—and at least every 4 days. If today is the 15th, then the habit first appears in the agenda (see Agenda Views) on Oct 17, after the minimum of 2 days has elapsed, and will appear overdue on Oct 19, after four days have elapsed.

What’s really useful about habits is that they are displayed along with a consistency graph, to show how consistent you’ve been at getting that task done in the past. This graph shows every day that the task was done over the past three weeks, with colors for each day. The colors used are:

Blue

If the task was not to be done yet on that day.

Green

If the task could have been done on that day.

Yellow

If the task was going to be overdue the next day.

Red

If the task was overdue on that day.

In addition to coloring each day, the day is also marked with an asterisk if the task was actually done that day, and an exclamation mark to show where the current day falls in the graph.

There are several configuration variables that can be used to change the way habits are displayed in the agenda.

org-habit-graph-column

The buffer column at which the consistency graph should be drawn. This overwrites any text in that column, so it is a good idea to keep your habits’ titles brief and to the point.

org-habit-preceding-days

The amount of history, in days before today, to appear in consistency graphs.

org-habit-following-days

The number of days after today that appear in consistency graphs.

org-habit-show-habits-only-for-today

If non-nil, only show habits in today’s agenda view. The default value is t. Pressing C-u K in the agenda toggles this variable.

Lastly, pressing K in the agenda buffer causes habits to temporarily be disabled and do not appear at all. Press K again to bring them back. They are also subject to tag filtering, if you have habits which should only be done in certain contexts, for example.


Next: Breaking Down Tasks into Subtasks, Previous: Progress Logging, Up: TODO Items   [Contents][Index]

5.4 Priorities

If you use Org mode extensively, you may end up with enough TODO items that it starts to make sense to prioritize them. Prioritizing can be done by placing a priority cookie into the headline of a TODO item right after the TODO keyword, like this:

*** TODO [#A] Write letter to Sam Fortune

By default, Org mode supports three priorities: ‘A’, ‘B’, and ‘C’. ‘A’ is the highest priority. An entry without a cookie is treated as if it had priority ‘B’. Priorities make a difference only for sorting in the agenda (see Weekly/daily agenda). Outside the agenda, they have no inherent meaning to Org mode. The cookies are displayed with the face defined by the variable org-priority-faces, which can be customized.

You can also use numeric values for priorities, such as

*** TODO [#1] Write letter to Sam Fortune

When using numeric priorities, you need to set org-priority-highest, org-priority-lowest and org-priority-default to integers, which must all be a non-negative integer between 0 and 64, inclusive.

Priorities can be attached to any heading; they do not need to be TODO items.

C-c , (org-priority)

Set the priority of the current headline. The command prompts for a priority character ‘A’, ‘B’ or ‘C’. When you press SPC instead, the priority cookie, if one is set, is removed from the headline. The priorities can also be changed “remotely” from the agenda buffer with the , command (see Commands in the Agenda Buffer).

S-UP (org-priority-up)
S-DOWN (org-priority-down)

Increase/decrease the priority of the current headline47. Note that these keys are also used to modify timestamps (see Creating Timestamps). See also Packages that conflict with Org mode for a discussion of the interaction with shift-selection.

You can change the range of allowed priorities by setting the variables org-priority-highest, org-priority-lowest, and org-priority-default. Valid priority values are single uppercase Latin alphabetical characters A-Z, and non-negative integers in between 0 and 64, inclusive. For an individual buffer, you may set these values (highest, lowest, default) like this (please make sure that the highest priority is earlier in the alphabet than the lowest priority):

#+PRIORITIES: A C B

Or, using numeric values:

#+PRIORITIES: 1 10 5

Next: Checkboxes, Previous: Priorities, Up: TODO Items   [Contents][Index]

5.5 Breaking Down Tasks into Subtasks

It is often advisable to break down large tasks into smaller, manageable subtasks. You can do this by creating an outline tree below a TODO item, with detailed subtasks on the tree48. To keep an overview of the fraction of subtasks that have already been marked as done, insert either ‘[/]’ or ‘[%]’ anywhere in the headline. These cookies are updated each time the TODO status of a child changes, or when pressing C-c C-c on the cookie. For example:

* Organize Party [33%]
** TODO Call people [1/2]
*** TODO Peter
*** DONE Sarah
** TODO Buy food
** DONE Talk to neighbor

If a heading has both checkboxes and TODO children below it, the meaning of the statistics cookie becomes ambiguous. Set the property ‘COOKIE_DATA’ to either ‘checkbox’ or ‘todo’ to resolve this issue.

If you would like to have the statistics cookie count any TODO entries in the subtree (not just direct children), configure the variable org-hierarchical-todo-statistics. To do this for a single subtree, include the word ‘recursive’ into the value of the ‘COOKIE_DATA’ property.

* Parent capturing statistics [2/20]
  :PROPERTIES:
  :COOKIE_DATA: todo recursive
  :END:

If you would like a TODO entry to automatically change to DONE when all children are done, you can use the following setup:

(defun org-summary-todo (n-done n-not-done)
  "Switch entry to DONE when all subentries are done, to TODO otherwise."
  (let (org-log-done org-todo-log-states)   ; turn off logging
    (org-todo (if (= n-not-done 0) "DONE" "TODO"))))
(add-hook 'org-after-todo-statistics-hook #'org-summary-todo)

Another possibility is the use of checkboxes to identify (a hierarchy of) subtasks (see Checkboxes).


Previous: Breaking Down Tasks into Subtasks, Up: TODO Items   [Contents][Index]

5.6 Checkboxes

Every item in a plain list49 (see Plain Lists) can be made into a checkbox by starting it with the string ‘[ ]’. This feature is similar to TODO items (see TODO Items), but is more lightweight. Checkboxes are not included in the global TODO list, so they are often great to split a task into a number of simple steps. Or you can use them in a shopping list.

Here is an example of a checkbox list.

* TODO Organize party [2/4]
  - [-] call people [1/3]
    - [ ] Peter
    - [X] Sarah
    - [ ] Sam
  - [X] order food
  - [ ] think about what music to play
  - [X] talk to the neighbors

The ‘[2/4]’ and ‘[1/3]’ in the first and second line are cookies indicating how many of the checkboxes present in this entry have been checked off, and the total number of checkboxes present. This can give you an idea of how many checkboxes remain, even without opening a folded entry. The cookies can be placed into a headline or into (the first line of) a plain list item. Each cookie covers checkboxes of direct children structurally below the headline/item on which the cookie appears50. You have to insert the cookie yourself by typing either ‘[/]’ or ‘[%]’. With ‘[/]’ you get an ‘n out of m’ result, as in the examples above. With ‘[%]’ you get information about the percentage of checkboxes checked (in the above example, this would be ‘[50%]’ and ‘[33%]’, respectively). In a headline, a cookie can count either checkboxes below the heading or TODO states of children, and it displays whatever was changed last. Set the property ‘COOKIE_DATA’ to either ‘checkbox’ or ‘todo’ to resolve this issue.

If the current heading has an ‘ORDERED’ property, checkboxes must be checked off in sequence, and an error is thrown if you try to check off a box while there are unchecked boxes above it.

A checkbox can be in one of the three states:

  1. not checked ‘[ ]
  2. partially checked ‘[-]
  3. checked ‘[X]

Checkboxes work hierarchically, so if a checkbox item has children that are checkboxes, toggling one of the children checkboxes makes the parent checkbox reflect if none, some, or all of the children are checked.

If all child checkboxes are not checked, the parent checkbox is also not checked.

- [ ] call people
  - [ ] Peter
  - [ ] Sarah

If some but not all child checkboxes are checked, the parent checkbox is partially checked.

- [-] call people
  - [X] Peter
  - [ ] Sarah

If all child checkboxes are checked, the parent checkbox is also checked.

- [X] call people
  - [X] Peter
  - [X] Sarah

The following commands work with checkboxes:

C-c C-c (org-toggle-checkbox)

Toggle checkbox status or—with prefix argument—checkbox presence at point. With a single prefix argument, add an empty checkbox or remove the current one51. With a double prefix argument, set it to ‘[-]’, which is considered to be an intermediate state.

C-c C-x C-b (org-toggle-checkbox)

Toggle checkbox status or—with prefix argument—checkbox presence at point. With double prefix argument, set it to ‘[-]’, which is considered to be an intermediate state.

  • If there is an active region, toggle the first checkbox in the region and set all remaining boxes to the same status as the first. With a prefix argument, add or remove the checkbox for all items in the region.
  • If point is in a headline, toggle checkboxes in the region between this headline and the next—so not the entire subtree.
  • If there is no active region, just toggle the checkbox at point.
C-c C-x C-r (org-toggle-radio-button)

Toggle checkbox status by using the checkbox of the item at point as a radio button: when the checkbox is turned on, all other checkboxes on the same level will be turned off. With a universal prefix argument, toggle the presence of the checkbox. With a double prefix argument, set it to ‘[-]’.

C-c C-c can be told to consider checkboxes as radio buttons by setting ‘#+ATTR_ORG: :radio t’ right before the list or by calling M-x org-list-checkbox-radio-mode to activate this minor mode.

M-S-RET (org-insert-todo-heading)

Insert a new item with a checkbox. This works only if point is already in a plain list item (see Plain Lists).

C-c C-x o (org-toggle-ordered-property)

Toggle the ‘ORDERED’ property of the entry, to toggle if checkboxes must be checked off in sequence. A property is used for this behavior because this should be local to the current entry, not inherited like a tag. However, if you would like to track the value of this property with a tag for better visibility, customize org-track-ordered-property-with-tag.

C-c # (org-update-statistics-cookies)

Update the statistics cookie in the current outline entry. When called with a C-u prefix, update the entire file. Checkbox statistic cookies are updated automatically if you toggle checkboxes with C-c C-c and make new ones with M-S-RET. TODO statistics cookies update when changing TODO states. If you delete boxes/entries or add/change them by hand, use this command to get things back into sync.


Next: Dates and Times, Previous: Tags, Up: The Org Manual   [Contents][Index]

7 Properties and Columns

A property is a key-value pair associated with an entry. Properties can be set, so they are associated with a single entry, with every entry in a tree, or with the whole buffer.

There are two main applications for properties in Org mode. First, properties are like tags, but with a value. Imagine maintaining a file where you document bugs and plan releases for a piece of software. Instead of using tags like ‘release_1’, ‘release_2’, you can use a property, say ‘Release’, that in different subtrees has different values, such as ‘1.0’ or ‘2.0’. Second, you can use properties to implement (very basic) database capabilities in an Org buffer. Imagine keeping track of your music CDs, where properties could be things such as the album, artist, date of release, number of tracks, and so on.

Properties can be conveniently edited and viewed in column view (see Column View).


Next: Special Properties, Up: Properties and Columns   [Contents][Index]

7.1 Property Syntax

Properties are key–value pairs. When they are associated with a single entry or with a tree they need to be inserted into a special drawer (see Drawers) with the name ‘PROPERTIES’, which has to be located right below a headline, and its planning line (see Deadlines and Scheduling) when applicable. Each property is specified on a single line, with the key—surrounded by colons—first, and the value after it. Keys are case-insensitive. Here is an example:

* CD collection
** Classic
*** Goldberg Variations
    :PROPERTIES:
    :Title:     Goldberg Variations
    :Composer:  J.S. Bach
    :Artist:    Glenn Gould
    :Publisher: Deutsche Grammophon
    :NDisks:    1
    :END:

Depending on the value of org-use-property-inheritance, a property set this way is associated either with a single entry, or with the subtree defined by the entry, see Property Inheritance.

You may define the allowed values for a particular property ‘Xyz’ by setting a property ‘Xyz_ALL’. This special property is inherited, so if you set it in a level 1 entry, it applies to the entire tree. When allowed values are defined, setting the corresponding property becomes easier and is less prone to typing errors. For the example with the CD collection, we can pre-define publishers and the number of disks in a box like this:

* CD collection
  :PROPERTIES:
  :NDisks_ALL:  1 2 3 4
  :Publisher_ALL: "Deutsche Grammophon" Philips EMI
  :END:

Properties can be inserted at the buffer level. That means they apply before the first headline and can be inherited by all entries in a file. Property blocks defined before the first headline must be at the top of the buffer with only comments above them.

Properties can also be defined using lines like:

#+PROPERTY: NDisks_ALL 1 2 3 4

If you want to add to the value of an existing property, append a ‘+’ to the property name. The following results in the property ‘var’ having the values ‘foo’ and ‘bar’.

#+PROPERTY: var  foo
#+PROPERTY: var+ bar

Using the appended ‘+’, it is also possible to add to the values of inherited properties. The following results in the ‘Genres’ property having the values ‘Classic’, ‘Baroque’, and ‘Keyboard music’ under the ‘Goldberg Variations’ subtree.

* CD collection
** Classic
    :PROPERTIES:
    :Genres: Classic
    :END:
*** Goldberg Variations
    :PROPERTIES:
    :Title:     Goldberg Variations
    :Composer:  J.S. Bach
    :Artist:    Glenn Gould
    :Publisher: Deutsche Grammophon
    :NDisks:    1
    :Genres+:   Baroque
    :Genres+:   Keyboard music
    :END:

Note that a property can only have multiple entries per drawer when used with the appended ‘+’. When a property has multiple entries without ‘+’, the result is undefined.

Property values set with the global variable org-global-properties can be inherited by all entries in all Org files.

The following commands help to work with properties:

M-TAB (pcomplete)

After an initial colon in a line, complete property keys. All keys used in the current file are offered as possible completions.

C-c C-x p (org-set-property)

Set a property. This prompts for a property name and a value. If necessary, the property drawer is created as well.

C-u M-x org-insert-drawer

Insert a property drawer into the current entry. The drawer is inserted early in the entry, but after the lines with planning information like deadlines. If before first headline the drawer is inserted at the top of the drawer after any potential comments.

C-c C-c (org-property-action)

With point in a property drawer, this executes property commands.

C-c C-c s (org-set-property)

Set a property in the current entry. Both the property and the value can be inserted using completion.

S-RIGHT (org-property-next-allowed-value), S-LEFT (org-property-previous-allowed-value)

Switch property at point to the next/previous allowed value.

C-c C-c d (org-delete-property)

Remove a property from the current entry.

C-c C-c D (org-delete-property-globally)

Globally remove a property, from all entries in the current file.

C-c C-c c (org-compute-property-at-point)

Compute the property at point, using the operator and scope from the nearest column format definition.


Next: Property Searches, Previous: Property Syntax, Up: Properties and Columns   [Contents][Index]

7.2 Special Properties

Special properties provide an alternative access method to Org mode features, like the TODO state or the priority of an entry, discussed in the previous chapters. This interface exists so that you can include these states in a column view (see Column View), or to use them in queries. The following property names are special and should not be used as keys in the properties drawer:

ALLTAGSAll tags, including inherited ones.
BLOCKEDt if task is currently blocked by children or siblings.
CATEGORYThe category of an entry.
CLOCKSUMThe sum of CLOCK intervals in the subtree. org-clock-sum
must be run first to compute the values in the current buffer.
CLOCKSUM_TThe sum of CLOCK intervals in the subtree for today.
org-clock-sum-today must be run first to compute the
values in the current buffer.
CLOSEDWhen was this entry closed?
DEADLINEThe deadline timestamp.
FILEThe filename the entry is located in.
ITEMThe headline of the entry.
PRIORITYThe priority of the entry, a string with a single letter.
SCHEDULEDThe scheduling timestamp.
TAGSThe tags defined directly in the headline.
TIMESTAMPThe first active keyword-less timestamp in the entry.55
TIMESTAMP_IAThe first inactive keyword-less timestamp in the entry.
TODOThe TODO keyword of the entry.

Next: Property Inheritance, Previous: Special Properties, Up: Properties and Columns   [Contents][Index]

7.3 Property Searches

To create sparse trees and special lists with selection based on properties, the same commands are used as for tag searches (see Tag Searches).

C-c / m or C-c \ (org-match-sparse-tree)

Create a sparse tree with all matching entries. With a C-u prefix argument, ignore headlines that are not a TODO line.

M-x org-agenda m (org-tags-view)

Create a global list of tag/property matches from all agenda files.

M-x org-agenda M (org-tags-view)

Create a global list of tag matches from all agenda files, but check only TODO items.

The syntax for the search string is described in Matching tags and properties.

There is also a special command for creating sparse trees based on a single property:

C-c / p

Create a sparse tree based on the value of a property. This first prompts for the name of a property, and then for a value. A sparse tree is created with all entries that define this property with the given value. If you enclose the value in curly braces, it is interpreted as a regular expression and matched against the property values (see Regular Expressions).


Next: Column View, Previous: Property Searches, Up: Properties and Columns   [Contents][Index]

7.4 Property Inheritance

The outline structure of Org documents lends itself to an inheritance model of properties: if the parent in a tree has a certain property, the children can inherit this property. Org mode does not turn this on by default, because it can slow down property searches significantly and is often not needed. However, if you find inheritance useful, you can turn it on by setting the variable org-use-property-inheritance. It may be set to t to make all properties inherited from the parent, to a list of properties that should be inherited, or to a regular expression that matches inherited properties. If a property has the value nil, this is interpreted as an explicit un-define of the property, so that inheritance search stops at this value and returns nil.

Org mode has a few properties for which inheritance is hard-coded, at least for the special applications for which they are used:

COLUMNS

The ‘COLUMNS’ property defines the format of column view (see Column View). It is inherited in the sense that the level where a ‘COLUMNS’ property is defined is used as the starting point for a column view table, independently of the location in the subtree from where columns view is turned on.

CATEGORY

For agenda view, a category set through a ‘CATEGORY’ property applies to the entire subtree.

ARCHIVE

For archiving, the ‘ARCHIVE’ property may define the archive location for the entire subtree (see Moving a tree to an archive file).

LOGGING

The ‘LOGGING’ property may define logging settings for an entry or a subtree (see Tracking TODO state changes).


Previous: Property Inheritance, Up: Properties and Columns   [Contents][Index]

7.5 Column View

A great way to view and edit properties in an outline tree is column view. In column view, each heading is turned into a table row. Columns in this table provide access to properties of the entries. Org mode implements columns by overlaying a tabular structure over the headline of each item. While the headlines have been turned into a table row, you can still change the visibility of the outline tree. For example, you get a compact table by switching to “contents” view—S-TAB S-TAB, or simply c while column view is active—but you can still open, read, and edit the entry below each headline. Or, you can switch to column view after executing a sparse tree command and in this way get a table only for the selected items. Column view also works in agenda buffers (see Agenda Views) where queries have collected selected items, possibly from a number of files.


Next: Using column view, Up: Column View   [Contents][Index]

7.5.1 Defining columns

Setting up a column view first requires defining the columns. This is done by defining a column format line.


Next: Column attributes, Up: Defining columns   [Contents][Index]

7.5.1.1 Scope of column definitions

To specify a format that only applies to a specific tree, add a ‘COLUMNS’ property to the top node of that tree, for example:

** Top node for columns view
   :PROPERTIES:
   :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
   :END:

A ‘COLUMNS’ property within a property drawer before first headline will apply to the entire file. As an addition to property drawers, keywords can also be defined for an entire file using a line like:

#+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO

If a ‘COLUMNS’ property is present in an entry, it defines columns for the entry itself, and for the entire subtree below it. Since the column definition is part of the hierarchical structure of the document, you can define columns on level 1 that are general enough for all sublevels, and more specific columns further down, when you edit a deeper part of the tree.


Previous: Scope of column definitions, Up: Defining columns   [Contents][Index]

7.5.1.2 Column attributes

A column definition sets the attributes of a column. The general definition looks like this:

%[WIDTH]PROPERTY[(TITLE)][{SUMMARY-TYPE}]

Except for the percent sign and the property name, all items are optional. The individual parts have the following meaning:

WIDTH

An integer specifying the width of the column in characters. If omitted, the width is determined automatically.

PROPERTY

The property that should be edited in this column. Special properties representing metadata are allowed here as well (see Special Properties).

TITLE

The header text for the column. If omitted, the property name is used.

SUMMARY-TYPE

The summary type. If specified, the column values for parent headings are computed from the direct children. If there is any existing property defined for the parent nodes, it is not used in the calculations.

When there is an existing property in parent heading, Org does not only overlay the computed value in the column view, but also overwrites the property value in parent’s property drawer56.

Summary type is ignored for special properties.

Supported summary types are:

+Sum numbers in this column.
+;%.1fLike ‘+’, but format result with ‘%.1f’.
$Currency, short for ‘+;%.2f’.
minSmallest number in column.
maxLargest number.
meanArithmetic mean of numbers.
XCheckbox status, ‘[X]’ if all children are ‘[X]’.
X/Checkbox status, ‘[n/m]’.
X%Checkbox status, ‘[n%]’.
:Sum times, HH:MM, plain numbers are minutes.
:minSmallest time value in column.
:maxLargest time value.
:meanArithmetic mean of time values.
@minMinimum age57 (in days/hours/mins/seconds).
@maxMaximum age (in days/hours/mins/seconds).
@meanArithmetic mean of ages (in days/hours/mins/seconds).
est+Add low-high estimates.

You can also define custom summary types by setting org-columns-summary-types.

The ‘est+’ summary type requires further explanation. It is used for combining estimates, expressed as low-high ranges. For example, instead of estimating a particular task will take 5 days, you might estimate it as 5–6 days if you’re fairly confident you know how much work is required, or 1–10 days if you do not really know what needs to be done. Both ranges average at 5.5 days, but the first represents a more predictable delivery.

When combining a set of such estimates, simply adding the lows and highs produces an unrealistically wide result. Instead, ‘est+’ adds the statistical mean and variance of the subtasks, generating a final estimate from the sum. For example, suppose you had ten tasks, each of which was estimated at 0.5 to 2 days of work. Straight addition produces an estimate of 5 to 20 days, representing what to expect if everything goes either extremely well or extremely poorly. In contrast, ‘est+’ estimates the full job more realistically, at 10–15 days.

Here is an example for a complete columns definition, along with allowed values58.

:COLUMNS:  %25ITEM %9Approved(Approved?){X} %Owner %11Status \
                   %10Time_Estimate{:}
:Owner_ALL:    Tammy Mark Karl Lisa Don
:Status_ALL:   "In progress" "Not started yet" "Finished" ""
:Approved_ALL: "[ ]" "[X]"

The first column, ‘%25ITEM’, means the first 25 characters of the item itself, i.e., of the headline. You probably always should start the column definition with the ‘ITEM’ specifier. The other specifiers create columns ‘Owner’ with a list of names as allowed values, for ‘Status’ with four different possible values, and for a checkbox field ‘Approved’. When no width is given after the ‘%’ character, the column is exactly as wide as it needs to be in order to fully display all values. The ‘Approved’ column does have a modified title (‘Approved?’, with a question mark). Summaries are created for the ‘Time_Estimate’ column by adding time duration expressions like HH:MM, and for the ‘Approved’ column, by providing an ‘[X]’ status if all children have been checked.

The ‘CLOCKSUM’ and ‘CLOCKSUM_T’ column properties are special, they list the sums of ‘CLOCK:’ intervals in the subtree, either for all clocks (‘CLOCKSUM’) or just for today (‘CLOCKSUM_T’). Unlike ‘:’ summary type that ignores property values in parent headings, all the ‘CLOCK:’ intervals are summed up, including ‘CLOCK:’ lines within parent headings.

  1. Summaries in deeply nested hierarchy

    When computing summaries of deeply nested headings, the summaries are computed recursively, from the deepest level to the shallowest. Here is an example:

    #+BEGIN: columnview :indent t :format "%ITEM %EFFORT{:mean}" :id global
    | ITEM               | EFFORT  |
    |--------------------+---------|
    | Top level          | 3h 0min |
    | \_  Intermediate 1 | 1h 0min |
    | \_        Leaf 1   | 1h      |
    | \_    Leaf 2       | 1h      |
    | \_    Leaf 3       | 1h      |
    | \_  Intermediate 2 | 5h      |
    #+END:
    * Top level
    ** Intermediate 1
    :PROPERTIES:
    :EFFORT:   *unused*, will be set to 1h 0min (mean of the leaf nodes)
    :END:
    ***** Leaf 1
    :PROPERTIES:
    :EFFORT: 1h
    :END:
    *** Leaf 2
    :PROPERTIES:
    :EFFORT: 1h
    :END:
    *** Leaf 3
    :PROPERTIES:
    :EFFORT: 1h
    :END:
    ** Intermediate 2
    :PROPERTIES:
    :EFFORT: 5h
    :END:
    

Next: Capturing column view, Previous: Defining columns, Up: Column View   [Contents][Index]

7.5.2 Using column view

Turning column view on or off

C-c C-x C-c (org-columns)

Turn on column view. If point is before the first headline in the file, column view is turned on for the entire file, using the ‘#+COLUMNS’ definition. If point is somewhere inside the outline, this command searches the hierarchy, up from point, for a ‘COLUMNS’ property that defines a format. When one is found, the column view table is established for the tree starting at the entry that contains the ‘COLUMNS’ property. If no such property is found, the format is taken from the ‘#+COLUMNS’ line or from the variable org-columns-default-format, and column view is established for the current entry and its subtree.

r or g on a columns view line (org-columns-redo)

Recreate the column view, to include recent changes made in the buffer.

C-c C-c or q on a columns view line (org-columns-quit)

Exit column view.

Editing values

LEFT, RIGHT, UP, DOWN

Move through the column view from field to field.

1..9,0

Directly select the Nth allowed value, 0 selects the 10th value.

n or S-RIGHT (org-columns-next-allowed-value)
p or S-LEFT (org-columns-previous-allowed-value)

Switch to the next/previous allowed value of the field. For this, you have to have specified allowed values for a property.

e (org-columns-edit-value)

Edit the property at point. For the special properties, this invokes the same interface that you normally use to change that property. For example, the tag completion or fast selection interface pops up when editing a ‘TAGS’ property.

C-c C-c (org-columns-toggle-or-columns-quit)

When there is a checkbox at point, toggle it. Else exit column view.

v (org-columns-show-value)

View the full value of this property. This is useful if the width of the column is smaller than that of the value.

a (org-columns-edit-allowed)

Edit the list of allowed values for this property. If the list is found in the hierarchy, the modified values are stored there. If no list is found, the new value is stored in the first entry that is part of the current column view.

Modifying column view on-the-fly

< (org-columns-narrow)
> (org-columns-widen)

Make the column narrower/wider by one character.

S-M-RIGHT (org-columns-new)

Insert a new column, to the left of the current column.

S-M-LEFT (org-columns-delete)

Delete the current column.

M-LEFT (org-columns-move-left)

Move the current column left.

M-RIGHT (org-columns-move-right)

Move the current column right.

M-UP (org-columns-move-row-up)

Move the current row up.

M-DOWN (org-columns-move-row-down)

Move the current row down.


Previous: Using column view, Up: Column View   [Contents][Index]

7.5.3 Capturing column view

Since column view is just an overlay over a buffer, it cannot be exported or printed directly. If you want to capture a column view, use a ‘columnview’ dynamic block (see Dynamic Blocks). The frame of this block looks like this:

* The column view
#+BEGIN: columnview :hlines 1 :id "label"
#+END:

This dynamic block has the following parameters:

:id

This is the most important parameter. Column view is a feature that is often localized to a certain (sub)tree, and the capture block might be at a different location in the file. To identify the tree whose view to capture, you can use four values:

local

Use the tree in which the capture block is located.

global

Make a global view, including all headings in the file.

file:FILENAME

Run column view at the top of the FILENAME file.

LABEL

Call column view in the tree that has an ‘ID’ property with the value LABEL. You can use M-x org-id-copy to create a globally unique ID for the current entry and copy it to the kill-ring.

:match

When set to a string, use this as a tags/property match filter to select only a subset of the headlines in the scope set by the :id parameter.

:hlines

When t, insert an hline after every line. When a number N, insert an hline before each headline with level <= N.

:vlines

When non-nil, force column groups to get vertical lines.

:maxlevel

When set to a number, do not capture entries below this level.

:skip-empty-rows

When non-nil, skip rows where the only non-empty specifier of the column view is ‘ITEM’.

:exclude-tags

List of tags to exclude from column view table: entries with these tags will be excluded from the column view.

:indent

When non-nil, indent each ‘ITEM’ field according to its level.

:link

When non-nil, link the ‘ITEM’ headlines in the table to their origins.

:format

Specify a column attribute (see Column attributes) for the dynamic block.

:formatter

A function to format column view data and insert it into the buffer. See the option org-columns-dblock-formatter.

The following commands insert or update the dynamic block:

org-columns-insert-dblock

Insert a dynamic block capturing a column view. Prompt for the scope or ID of the view.

This command can be invoked by calling org-dynamic-block-insert-dblock (C-c C-x x) and selecting “columnview” (see Dynamic Blocks).

C-c C-c C-c C-x C-u (org-dblock-update)

Update dynamic block at point. Point needs to be on the ‘#+BEGIN’ line of the dynamic block.

C-u C-c C-x C-u (org-update-all-dblocks)

Update all dynamic blocks (see Dynamic Blocks). This is useful if you have several clock table blocks, column-capturing blocks or other dynamic blocks in a buffer.

You can add formulas to the column view table, and you may add plotting instructions in front of the table—these survive an update of the block. If there is a ‘TBLFM’ keyword after the table, the table is recalculated automatically after an update.

An alternative way to capture and process property values into a table is provided by Eric Schulte’s ‘org-collector.el’, which is a package in ‘org-contrib59. It provides a general API to collect properties from entries in a certain scope, and arbitrary Lisp expressions to process these values before inserting them into a table or a dynamic block.


Next: Refiling and Archiving, Previous: Properties and Columns, Up: The Org Manual   [Contents][Index]

8 Dates and Times

To assist project planning, TODO items can be labeled with a date and/or a time. The specially formatted string carrying the date and time information is called a timestamp in Org mode. This may be a little confusing because timestamp is often used as indicating when something was created or last changed. However, in Org mode this term is used in a much wider sense.

Timestamps can be used to plan appointments, schedule tasks, set deadlines, track time, and more. The following sections describe the timestamp format and tooling that Org mode provides for common use cases dealing with time and time intervals.


Next: Creating Timestamps, Up: Dates and Times   [Contents][Index]

8.1 Timestamps

A timestamp is a specification of a date—possibly with a time or time range—in a special format, either ‘<2003-09-16 Tue>’ or ‘<2003-09-16 Tue 09:39>’ or ‘<2003-09-16 Tue 12:00-12:30>60. A timestamp can appear anywhere in the headline or body of an Org tree entry. Its presence causes entries to be shown on specific dates in the agenda (see Weekly/daily agenda). We distinguish:

Plain timestamp; Event; Appointment

A simple timestamp just assigns a date/time to an item. This is just like writing down an appointment or event in a paper agenda. In the agenda display, the headline of an entry associated with a plain timestamp is shown exactly on that date. There can be multiple timestamps in an item.

* Meet Peter at the movies
  <2006-11-01 Wed 19:15>
* Discussion on climate change
  <2006-11-02 Thu 10:00-12:00>
* My days off
  <2006-11-03 Fri>
  <2006-11-06 Mon>
Timestamp with repeater interval

A timestamp may contain a repeater interval, indicating that it applies not only on the given date, but again and again after a certain interval of N hours (h), days (d), weeks (w), months (m), or years (y). The following shows up in the agenda every Wednesday:

* Pick up Sam at school
  <2007-05-16 Wed 12:30 +1w>
Diary-style expression entries

For more complex date specifications, Org mode supports using the special expression diary entries implemented in the Emacs Calendar package61. For example, with optional time:

* 22:00-23:00 The nerd meeting on every 2nd Thursday of the month
  <%%(diary-float t 4 2) 22:00-23:00>
Time range

Time range is a timestamp having two time units connected by ‘-

* Discussion on climate change
   <2006-11-02 Thu 10:00-12:00>
Time/Date range

Two timestamps connected by ‘--’ denote a range. In the agenda, the headline is shown on the first and last day of the range, and on any dates that are displayed and fall in the range. The first example specifies just the dates of the range while the second example specifies a time range for each date.

** Meeting in Amsterdam
   <2004-08-23 Mon>--<2004-08-26 Thu>
** This weeks committee meetings
   <2004-08-23 Mon 10:00-11:00>--<2004-08-26 Thu 10:00-11:00>
Inactive timestamp

Just like a plain timestamp, but with square brackets instead of angular ones. These timestamps are inactive in the sense that they do not trigger an entry to show up in the agenda.

* Gillian comes late for the fifth time
  [2006-11-01 Wed]

Next: Deadlines and Scheduling, Previous: Timestamps, Up: Dates and Times   [Contents][Index]

8.2 Creating Timestamps

For Org mode to recognize timestamps, they need to be in the specific format. All commands listed below produce timestamps in the correct format.

C-c . (org-timestamp)

Prompt for a date and insert a corresponding timestamp. When point is at an existing timestamp in the buffer, the comma

Read the original on gnu.org ↗