GNU Emacs
Org
Introduction

Introduction

Summary

Org Mode is an authoring tool and a TODO lists 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 lists manager, Org helps you organize your tasks in a flexible way, from daily needs to detailed project-planning, allowing logging, multiple views on 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 to 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 notes 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 in queries and 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, closed in 2009.

Installation

Org is included in distributions of GNU Emacs, 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 this 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.

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

Using Org's git repository

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

$ cd ~/src/
$ git clone https://git.savannah.gnu.org/git/emacs/org-mode.git
$ 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 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 enough valuable packages maintained outside of the Org repository. Worg has a list of org-contrib and external packages, certainly it is not exhaustive.

Activation

Org mode buffers need Font Lock to be turned on: this is the default in Emacs(note: If you do not use Font Lock globally turn it on in Org buffer with (add-hook 'org-mode-hook #'turn-on-font-lock).).

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 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.

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 has approved it(note: Please consider subscribing to the mailing list in order to minimize the work the mailing list moderators have to do.). 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 the response and followup 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 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 Org mode version from Git repository, you can start 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 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 the instructions 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 is becoming 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 most of the time to execute. To record the statistics, one can use so-called 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 command taking most of the time displayed on top.

    <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 sub-children items in the profiler. You can press B (profiler-report-render-reversed-calltree) to quickly reveal the actual function/command that takes most of the time to run.

    Pressing C profiler-report-render-calltree will recover the original view.

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

    Just save the data by issuing

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

    Then, you can attached the saved file to your email to the Org mailing list, alongside 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.

Typesetting Conventions Used in this Manual

TODO keywords, tags, properties, etc.

Org uses various syntactical 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, BEGINEND
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 a 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.

Manual
Org Mode 9.7.39
Source
View upstream