Add info about buffer widening to the documentation.
[org-mode/org-mode-NeilSmithlineMods.git] / doc / org.texi
blob86fbcb2c038e9e573b914c8b297bb64355f7ffc3
1 \input texinfo
2 @c %**start of header
3 @setfilename ../../info/org
4 @settitle The Org Manual
6 @set VERSION 6.04c
7 @set DATE May 2008
9 @dircategory Emacs
10 @direntry
11 * Org Mode: (org).      Outline-based notes management and organizer
12 @end direntry
14 @c Version and Contact Info
15 @set MAINTAINERSITE @uref{http://orgmode.org,maintainers webpage}
16 @set AUTHOR Carsten Dominik
17 @set MAINTAINER Carsten Dominik
18 @set MAINTAINEREMAIL @email{carsten at orgmode dot org}
19 @set MAINTAINERCONTACT @uref{mailto:carsten at orgmode dot org,contact the maintainer}
20 @c %**end of header
21 @finalout
23 @c Macro definitions
25 @c Subheadings inside a table.
26 @macro tsubheading{text}
27 @ifinfo
28 @subsubheading \text\
29 @end ifinfo
30 @ifnotinfo
31 @item @b{\text\}
32 @end ifnotinfo
33 @end macro
35 @copying
36 This manual is for Org (version @value{VERSION}).
38 Copyright @copyright{} 2004, 2005, 2006, 2007, 2008 Free Software Foundation
40 @quotation
41 Permission is granted to copy, distribute and/or modify this document
42 under the terms of the GNU Free Documentation License, Version 1.1 or
43 any later version published by the Free Software Foundation; with no
44 Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
45 and with the Back-Cover Texts as in (a) below.  A copy of the
46 license is included in the section entitled ``GNU Free Documentation
47 License.''
49 (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
50 this GNU Manual, like GNU software.  Copies published by the Free
51 Software Foundation raise funds for GNU development.''
52 @end quotation
53 @end copying
55 @titlepage
56 @title The Org Manual
58 @subtitle Release @value{VERSION}
59 @author by Carsten Dominik
61 @c The following two commands start the copyright page.
62 @page
63 @vskip 0pt plus 1filll
64 @insertcopying
65 @end titlepage
67 @c Output the table of contents at the beginning.
68 @contents
70 @ifnottex
71 @node Top, Introduction, (dir), (dir)
72 @top Org Mode Manual
74 @insertcopying
75 @end ifnottex
77 @menu
78 * Introduction::                Getting started
79 * Document Structure::          A tree works like your brain
80 * Tables::                      Pure magic for quick formatting
81 * Hyperlinks::                  Notes in context
82 * TODO Items::                  Every tree branch can be a TODO item
83 * Tags::                        Tagging headlines and matching sets of tags
84 * Properties and Columns::      Storing information about an entry
85 * Dates and Times::             Making items useful for planning
86 * Remember::                    Quickly adding nodes to the outline tree
87 * Agenda Views::                Collecting information into views
88 * Embedded LaTeX::              LaTeX fragments and formulas
89 * Exporting::                   Sharing and publishing of notes
90 * Publishing::                  Create a web site of linked Org files
91 * Miscellaneous::               All the rest which did not fit elsewhere
92 * Extionsions::                 
93 * Hacking::                     
94 * History and Acknowledgments::  How Org came into being
95 * Main Index::                  An index of Org's concepts and features
96 * Key Index::                   Key bindings and where they are described
98 @detailmenu
99  --- The Detailed Node Listing ---
101 Introduction
103 * Summary::                     Brief summary of what Org does
104 * Installation::                How to install a downloaded version of Org
105 * Activation::                  How to activate Org for certain buffers
106 * Feedback::                    Bug reports, ideas, patches etc.
107 * Conventions::                 Type-setting conventions in the manual
109 Document Structure
111 * Outlines::                    Org is based on Outline mode
112 * Headlines::                   How to typeset Org tree headlines
113 * Visibility cycling::          Show and hide, much simplified
114 * Motion::                      Jumping to other headlines
115 * Structure editing::           Changing sequence and level of headlines
116 * Archiving::                   Move done task trees to a different place
117 * Sparse trees::                Matches embedded in context
118 * Plain lists::                 Additional structure within an entry
119 * Drawers::                     Tucking stuff away
120 * Orgstruct mode::              Structure editing outside Org
122 Archiving
124 * ARCHIVE tag::                 Marking a tree as inactive
125 * Moving subtrees::             Moving a tree to an archive file
127 Tables
129 * Built-in table editor::       Simple tables
130 * Narrow columns::              Stop wasting space in tables
131 * Column groups::               Grouping to trigger vertical lines
132 * Orgtbl mode::                 The table editor as minor mode
133 * The spreadsheet::             The table editor has spreadsheet capabilities
135 The spreadsheet
137 * References::                  How to refer to another field or range
138 * Formula syntax for Calc::     Using Calc to compute stuff
139 * Formula syntax for Lisp::     Writing formulas in Emacs Lisp
140 * Field formulas::              Formulas valid for a single field
141 * Column formulas::             Formulas valid for an entire column
142 * Editing and debugging formulas::  Fixing formulas
143 * Updating the table::          Recomputing all dependent fields
144 * Advanced features::           Field names, parameters and automatic recalc
146 Hyperlinks
148 * Link format::                 How links in Org are formatted
149 * Internal links::              Links to other places in the current file
150 * External links::              URL-like links to the world
151 * Handling links::              Creating, inserting and following
152 * Using links outside Org::     Linking from my C source code?
153 * Link abbreviations::          Shortcuts for writing complex links
154 * Search options::              Linking to a specific location
155 * Custom searches::             When the default search is not enough
157 Internal links
159 * Radio targets::               Make targets trigger links in plain text
161 TODO Items
163 * TODO basics::                 Marking and displaying TODO entries
164 * TODO extensions::             Workflow and assignments
165 * Progress logging::            Dates and notes for progress
166 * Priorities::                  Some things are more important than others
167 * Breaking down tasks::         Splitting a task into manageable pieces
168 * Checkboxes::                  Tick-off lists
170 Extended use of TODO keywords
172 * Workflow states::             From TODO to DONE in steps
173 * TODO types::                  I do this, Fred does the rest
174 * Multiple sets in one file::   Mixing it all, and still finding your way
175 * Fast access to TODO states::  Single letter selection of a state
176 * Per-file keywords::           Different files, different requirements
177 * Faces for TODO keywords::     Highlighting states
179 Progress logging
181 * Closing items::               When was this entry marked DONE?
182 * Tracking TODO state changes::  When did the status change?
184 Tags
186 * Tag inheritance::             Tags use the tree structure of the outline
187 * Setting tags::                How to assign tags to a headline
188 * Tag searches::                Searching for combinations of tags
190 Properties and Columns
192 * Property syntax::             How properties are spelled out
193 * Special properties::          Access to other Org mode features
194 * Property searches::           Matching property values
195 * Property inheritance::        Passing values down the tree
196 * Column view::                 Tabular viewing and editing
197 * Property API::                Properties for Lisp programmers
199 Column view
201 * Defining columns::            The COLUMNS format property
202 * Using column view::           How to create and use column view
203 * Capturing column view::       A dynamic block for column view
205 Defining columns
207 * Scope of column definitions::  Where defined, where valid?
208 * Column attributes::           Appearance and content of a column
210 Dates and Times
212 * Timestamps::                  Assigning a time to a tree entry
213 * Creating timestamps::         Commands which insert timestamps
214 * Deadlines and scheduling::    Planning your work
215 * Clocking work time::          Tracking how long you spend on a task
216 * Effort estimates::            Planning work effort in advance
218 Creating timestamps
220 * The date/time prompt::        How Org mode helps you entering date and time
221 * Custom time format::          Making dates look different
223 Deadlines and scheduling
225 * Inserting deadline/schedule::  Planning items
226 * Repeated tasks::              Items that show up again and again
228 Remember
230 * Setting up Remember::         Some code for .emacs to get things going
231 * Remember templates::          Define the outline of different note types
232 * Storing notes::               Directly get the note to where it belongs
233 * Refiling notes::              Moving a note or task to a project
235 Agenda Views
237 * Agenda files::                Files being searched for agenda information
238 * Agenda dispatcher::           Keyboard access to agenda views
239 * Built-in agenda views::       What is available out of the box?
240 * Presentation and sorting::    How agenda items are prepared for display
241 * Agenda commands::             Remote editing of Org trees
242 * Custom agenda views::         Defining special searches and views
243 * Agenda column view::          Using column view for collected entries
245 The built-in agenda views
247 * Weekly/daily agenda::         The calendar page with current tasks
248 * Global TODO list::            All unfinished action items
249 * Matching tags and properties::  Structured information with fine-tuned search
250 * Timeline::                    Time-sorted view for single file
251 * Keyword search::              Finding entries by keyword
252 * Stuck projects::              Find projects you need to review
254 Presentation and sorting
256 * Categories::                  Not all tasks are equal
257 * Time-of-day specifications::  How the agenda knows the time
258 * Sorting of agenda items::     The order of things
260 Custom agenda views
262 * Storing searches::            Type once, use often
263 * Block agenda::                All the stuff you need in a single buffer
264 * Setting Options::             Changing the rules
265 * Exporting Agenda Views::      Writing agendas to files
266 * Using the agenda elsewhere::  Using agenda information in other programs
268 Embedded LaTeX
270 * Math symbols::                TeX macros for symbols and Greek letters
271 * Subscripts and superscripts::  Simple syntax for raising/lowering text
272 * LaTeX fragments::             Complex formulas made easy
273 * Processing LaTeX fragments::  Previewing LaTeX processing
274 * CDLaTeX mode::                Speed up entering of formulas
276 Exporting
278 * Markup rules::                Which structures are recognized?
279 * Export options::              Per-file export settings
280 * The export dispatcher::       How to access exporter commands
281 * ASCII export::                Exporting to plain ASCII
282 * HTML export::                 Exporting to HTML
283 * LaTeX export::                Exporting to LaTeX
284 * XOXO export::                 Exporting to XOXO
285 * iCalendar export::            Exporting in iCalendar format
287 Markup rules
289 * Document title::              How the document title is determined
290 * Headings and sections::       The main structure of the exported document
291 * Table of contents::           If, where, how to create a table of contents
292 * Initial text::                Text before the first headline
293 * Lists::                       Plain lists are exported
294 * Paragraphs::                  What determines beginning and ending
295 * Literal examples::            Source code and other examples
296 * Include files::               Include the contents of a file during export
297 * Tables exported::             Tables are exported richly
298 * Footnotes::                   Numbers like [1]
299 * Emphasis and monospace::      To bold or not to bold
300 * TeX macros and LaTeX fragments::  Create special, rich export.
301 * Horizontal rules::            A line across the page
302 * Comment lines::               Some lines will not be exported
304 HTML export
306 * HTML Export commands::        How to invoke HTML export
307 * Quoting HTML tags::           Using direct HTML in Org mode
308 * Links::                       Transformation of links for HTML
309 * Images::                      How to include images
310 * CSS support::                 Changing the appearance of the output
311 * Javascript support::          Info and Folding in a web browser
313 LaTeX export
315 * LaTeX export commands::       How to invoke LaTeX export
316 * Quoting LaTeX code::          Incorporating literal LaTeX code
317 * Sectioning structure::        Changing sectioning in LaTeX output
319 Publishing
321 * Configuration::               Defining projects
322 * Sample configuration::        Example projects
323 * Triggering publication::      Publication commands
325 Configuration
327 * Project alist::               The central configuration variable
328 * Sources and destinations::    From here to there
329 * Selecting files::             What files are part of the project?
330 * Publishing action::           Setting the function doing the publishing
331 * Publishing options::          Tweaking HTML export
332 * Publishing links::            Which links keep working after publishing?
333 * Project page index::          Publishing a list of project files
335 Sample configuration
337 * Simple example::              One-component publishing
338 * Complex example::             A multi-component publishing example
340 Miscellaneous
342 * Completion::                  M-TAB knows what you need
343 * Customization::               Adapting Org to your taste
344 * In-buffer settings::          Overview of the #+KEYWORDS
345 * The very busy C-c C-c key::   When in doubt, press C-c C-c
346 * Clean view::                  Getting rid of leading stars in the outline
347 * TTY keys::                    Using Org on a tty
348 * Interaction::                 Other Emacs packages
349 * Bugs::                        Things which do not work perfectly
351 Interaction with other packages
353 * Cooperation::                 Packages Org cooperates with
354 * Conflicts::                   Packages that lead to conflicts
356 Extensions
358 * Extensions in the contrib directory::  These come with the Org distro
359 * Other extensions::            These you have to find on the web.
361 Hacking
363 * Adding hyperlink types::      New custom link types
364 * Tables in arbitrary syntax::  Orgtbl for LaTeX and other programs
365 * Dynamic blocks::              Automatically filled blocks
366 * Special agenda views::        Customized views
367 * Using the property API::      Writing programs that use entry properties
368 * Using the mapping API::       Mapping over all or selected entries
370 Tables and lists in arbitrary syntax
372 * Radio tables::                Sending and receiving
373 * A LaTeX example::             Step by step, almost a tutorial
374 * Translator functions::        Copy and modify
375 * Radio lists::                 Doing the same for lists
377 @end detailmenu
378 @end menu
380 @node Introduction, Document Structure, Top, Top
381 @chapter Introduction
382 @cindex introduction
384 @menu
385 * Summary::                     Brief summary of what Org does
386 * Installation::                How to install a downloaded version of Org
387 * Activation::                  How to activate Org for certain buffers
388 * Feedback::                    Bug reports, ideas, patches etc.
389 * Conventions::                 Type-setting conventions in the manual
390 @end menu
392 @node Summary, Installation, Introduction, Introduction
393 @section Summary
394 @cindex summary
396 Org is a mode for keeping notes, maintaining TODO lists, and doing
397 project planning with a fast and effective plain-text system.
399 Org develops organizational tasks around NOTES files that contain
400 lists or information about projects as plain text.  Org is
401 implemented on top of Outline mode, which makes it possible to keep the
402 content of large files well structured.  Visibility cycling and
403 structure editing help to work with the tree.  Tables are easily created
404 with a built-in table editor.  Org supports TODO items, deadlines,
405 time stamps, and scheduling.  It dynamically compiles entries into an
406 agenda that utilizes and smoothly integrates much of the Emacs calendar
407 and diary.  Plain text URL-like links connect to websites, emails,
408 Usenet messages, BBDB entries, and any files related to the projects.
409 For printing and sharing of notes, an Org file can be exported as a
410 structured ASCII file, as HTML, or (TODO and agenda items only) as an
411 iCalendar file.  It can also serve as a publishing tool for a set of
412 linked web pages.
414 An important design aspect that distinguishes Org from for example
415 Planner/Muse is that it encourages to store every piece of information
416 only once.  In Planner, you have project pages, day pages and possibly
417 other files, duplicating some information such as tasks.  In Org,
418 you only have notes files.  In your notes you mark entries as tasks,
419 label them with tags and timestamps.  All necessary lists like a
420 schedule for the day, the agenda for a meeting, tasks lists selected by
421 tags etc are created dynamically when you need them.
423 Org keeps simple things simple.  When first fired up, it should
424 feel like a straightforward, easy to use outliner.  Complexity is not
425 imposed, but a large amount of functionality is available when you need
426 it.  Org is a toolbox and can be used in different ways, for
427 example as:
429 @example
430 @r{@bullet{} outline extension with visibility cycling and structure editing}
431 @r{@bullet{} ASCII system and table editor for taking structured notes}
432 @r{@bullet{} ASCII table editor with spreadsheet-like capabilities}
433 @r{@bullet{} TODO list editor}
434 @r{@bullet{} full agenda and planner with deadlines and work scheduling}
435 @r{@bullet{} environment to implement David Allen's GTD system}
436 @r{@bullet{} a basic database application}
437 @r{@bullet{} simple hypertext system, with HTML and LaTeX export}
438 @r{@bullet{} publishing tool to create a set of interlinked webpages}
439 @end example
441 Org's automatic, context sensitive table editor with spreadsheet
442 capabilities can be integrated into any major mode by activating the
443 minor Orgtbl mode.  Using a translation step, it can be used to maintain
444 tables in arbitrary file types, for example in La@TeX{}.  The structure
445 editing and list creation capabilities can be used outside Org with
446 the minor Orgstruct mode.
448 @cindex FAQ
449 There is a website for Org which provides links to the newest
450 version of Org, as well as additional information, frequently asked
451 questions (FAQ), links to tutorials etc.  This page is located at
452 @uref{http://orgmode.org}.
454 @page
457 @node Installation, Activation, Summary, Introduction
458 @section Installation
459 @cindex installation
460 @cindex XEmacs
462 @b{Important:} @i{If Org is part of the Emacs distribution or an
463 XEmacs package, please skip this section and go directly to
464 @ref{Activation}.}
466 If you have downloaded Org from the Web, either as a distribution @file{.zip}
467 or @file{.tar} file, or as a GIT archive, you must take the following steps
468 to install it: Go into the unpacked Org distribution directory and edit the
469 top section of the file @file{Makefile}.  You must set the name of the Emacs
470 binary (likely either @file{emacs} or @file{xemacs}), and the paths to the
471 directories where local Lisp and Info files are kept.  If you don't have
472 access to the system-wide directories, you can simply run Org directly from
473 the distribution directory by adding the @file{lisp} subdirectory to the
474 Emacs load path.  To do this, add the following line to @file{.emacs}:
476 @example
477 (setq load-path (cons "~/path/to/orgdir/lisp" load-path))
478 @end example
480 @noindent
481 If you plan to use code from the @file{contrib} subdirectory, do a similar
482 step for this directory:
484 @example
485 (setq load-path (cons "~/path/to/orgdir/contrib/lisp" load-path))
486 @end example
488 @b{XEmacs users now need to install the file @file{noutline.el} from
489 the @file{xemacs} sub-directory of the Org distribution.  Use the
490 command:}
492 @example
493 @b{make install-noutline}
494 @end example
496 @noindent Now byte-compile the Lisp files with the shell command:
498 @example
499 make
500 @end example
502 @noindent If you are running Org from the distribution directory, this is
503 all.  If you want to install into the system directories, use
505 @example
506 make install
507 make install-info
508 @end example
510 @noindent Then add to @file{.emacs}:
512 @lisp
513 ;; This line only if Org is not part of the X/Emacs distribution.
514 (require 'org-install)
515 @end lisp
518 @node Activation, Feedback, Installation, Introduction
519 @section Activation
520 @cindex activation
521 @cindex autoload
522 @cindex global key bindings
523 @cindex key bindings, global
525 @iftex
526 @b{Important:} @i{If you use copy-and-paste to copy lisp code from the
527 PDF documentation as viewed by Acrobat reader to your .emacs file, the
528 single quote character comes out incorrectly and the code will not work.
529 You need to fix the single quotes by hand, or copy from Info
530 documentation.}
531 @end iftex
533 Add the following lines to your @file{.emacs} file.  The last two lines
534 define @emph{global} keys for the commands @command{org-store-link},
535 @command{org-agenda}, and @command{org-iswitchb} - please choose suitable
536 keys yourself.
538 @lisp
539 ;; The following lines are always needed.  Choose your own keys.
540 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
541 (global-set-key "\C-cl" 'org-store-link)
542 (global-set-key "\C-ca" 'org-agenda)
543 (global-set-key "\C-cb" 'org-iswitchb)
544 @end lisp
546 Furthermore, you must activate @code{font-lock-mode} in Org
547 buffers, because significant functionality depends on font-locking being
548 active.  You can do this with either one of the following two lines
549 (XEmacs user must use the second option):
550 @lisp
551 (global-font-lock-mode 1)                     ; for all buffers
552 (add-hook 'org-mode-hook 'turn-on-font-lock)  ; Org buffers only
553 @end lisp
555 @cindex Org mode, turning on
556 With this setup, all files with extension @samp{.org} will be put
557 into Org mode.  As an alternative, make the first line of a file look
558 like this:
560 @example
561 MY PROJECTS    -*- mode: org; -*-
562 @end example
564 @noindent which will select Org mode for this buffer no matter what
565 the file's name is.  See also the variable
566 @code{org-insert-mode-line-in-empty-file}.
568 @node Feedback, Conventions, Activation, Introduction
569 @section Feedback
570 @cindex feedback
571 @cindex bug reports
572 @cindex maintainer
573 @cindex author
575 If you find problems with Org, or if you have questions, remarks, or ideas
576 about it, please mail to the Org mailing list @code{emacs-orgmode@@gnu.org}.
577 If you are not a member of the mailing list, your mail will be reviewed by a
578 moderator and then passed through to the list.
580 For bug reports, please provide as much information as possible,
581 including the version information of Emacs (@kbd{C-h v emacs-version
582 @key{RET}}) and Org (@kbd{C-h v org-version @key{RET}}), as well as
583 the Org related setup in @file{.emacs}.  If an error occurs, a
584 backtrace can be very useful (see below on how to create one).  Often a
585 small example file helps, along with clear information about:
587 @enumerate
588 @item What exactly did you do?
589 @item What did you expect to happen?
590 @item What happened instead?
591 @end enumerate
592 @noindent Thank you for helping to improve this mode.
594 @subsubheading How to create a useful backtrace
596 @cindex backtrace of an error
597 If working with Org produces an error with a message you don't
598 understand, you may have hit a bug.  The best way to report this is by
599 providing, in addition to what was mentioned above, a @emph{Backtrace}.
600 This is information from the built-in debugger about where and how the
601 error occurred.  Here is how to produce a useful backtrace:
603 @enumerate
604 @item
605 Start a fresh Emacs or XEmacs, and make sure that it will load the
606 original Lisp code in @file{org.el} instead of the compiled version in
607 @file{org.elc}.  The backtrace contains much more information if it is
608 produced with uncompiled code.  To do this, either rename @file{org.elc}
609 to something else before starting Emacs, or ask Emacs explicitly to load
610 @file{org.el} by using the command line
611 @example
612 emacs -l /path/to/org.el
613 @end example
614 @item
615 Go to the @code{Options} menu and select @code{Enter Debugger on Error}
616 (XEmacs has this option in the @code{Troubleshooting} sub-menu).
617 @item
618 Do whatever you have to do to hit the error.  Don't forget to
619 document the steps you take.
620 @item
621 When you hit the error, a @file{*Backtrace*} buffer will appear on the
622 screen.  Save this buffer to a file (for example using @kbd{C-x C-w}) and
623 attach it to your bug report.
624 @end enumerate
626 @node Conventions,  , Feedback, Introduction
627 @section Typesetting conventions used in this manual
629 Org uses three types of keywords: TODO keywords, tags, and property
630 names.  In this manual we use the following conventions:
632 @table @code
633 @item TODO
634 @itemx WAITING
635 TODO keywords are written with all capitals, even if they are
636 user-defined.
637 @item boss
638 @itemx ARCHIVE
639 User-defined tags are written in lowercase; built-in tags with special
640 meaning are written with all capitals.
641 @item Release
642 @itemx PRIORITY
643 User-defined properties are capitalized; built-in properties with
644 special meaning are written with all capitals.
645 @end table
647 @node Document Structure, Tables, Introduction, Top
648 @chapter Document Structure
649 @cindex document structure
650 @cindex structure of document
652 Org is based on outline mode and provides flexible commands to
653 edit the structure of the document.
655 @menu
656 * Outlines::                    Org is based on Outline mode
657 * Headlines::                   How to typeset Org tree headlines
658 * Visibility cycling::          Show and hide, much simplified
659 * Motion::                      Jumping to other headlines
660 * Structure editing::           Changing sequence and level of headlines
661 * Archiving::                   Move done task trees to a different place
662 * Sparse trees::                Matches embedded in context
663 * Plain lists::                 Additional structure within an entry
664 * Drawers::                     Tucking stuff away
665 * Orgstruct mode::              Structure editing outside Org
666 @end menu
668 @node Outlines, Headlines, Document Structure, Document Structure
669 @section Outlines
670 @cindex outlines
671 @cindex Outline mode
673 Org is implemented on top of Outline mode.  Outlines allow a
674 document to be organized in a hierarchical structure, which (at least
675 for me) is the best representation of notes and thoughts.  An overview
676 of this structure is achieved by folding (hiding) large parts of the
677 document to show only the general document structure and the parts
678 currently being worked on.  Org greatly simplifies the use of
679 outlines by compressing the entire show/hide functionality into a single
680 command @command{org-cycle}, which is bound to the @key{TAB} key.
682 @node Headlines, Visibility cycling, Outlines, Document Structure
683 @section Headlines
684 @cindex headlines
685 @cindex outline tree
687 Headlines define the structure of an outline tree.  The headlines in
688 Org start with one or more stars, on the left margin@footnote{See
689 the variable @code{org-special-ctrl-a/e} to configure special behavior
690 of @kbd{C-a} and @kbd{C-e} in headlines.}.  For example:
692 @example
693 * Top level headline
694 ** Second level
695 *** 3rd level
696     some text
697 *** 3rd level
698     more text
700 * Another top level headline
701 @end example
703 @noindent Some people find the many stars too noisy and would prefer an
704 outline that has whitespace followed by a single star as headline
705 starters.  @ref{Clean view} describes a setup to realize this.
707 An empty line after the end of a subtree is considered part of it and
708 will be hidden when the subtree is folded.  However, if you leave at
709 least two empty lines, one empty line will remain visible after folding
710 the subtree, in order to structure the collapsed view.  See the
711 variable @code{org-cycle-separator-lines} to modify this behavior.
713 @node Visibility cycling, Motion, Headlines, Document Structure
714 @section Visibility cycling
715 @cindex cycling, visibility
716 @cindex visibility cycling
717 @cindex trees, visibility
718 @cindex show hidden text
719 @cindex hide text
721 Outlines make it possible to hide parts of the text in the buffer.
722 Org uses just two commands, bound to @key{TAB} and
723 @kbd{S-@key{TAB}} to change the visibility in the buffer.
725 @cindex subtree visibility states
726 @cindex subtree cycling
727 @cindex folded, subtree visibility state
728 @cindex children, subtree visibility state
729 @cindex subtree, subtree visibility state
730 @table @kbd
731 @kindex @key{TAB}
732 @item @key{TAB}
733 @emph{Subtree cycling}: Rotate current subtree among the states
735 @example
736 ,-> FOLDED -> CHILDREN -> SUBTREE --.
737 '-----------------------------------'
738 @end example
740 The cursor must be on a headline for this to work@footnote{see, however,
741 the option @code{org-cycle-emulate-tab}.}.  When the cursor is at the
742 beginning of the buffer and the first line is not a headline, then
743 @key{TAB} actually runs global cycling (see below)@footnote{see the
744 option @code{org-cycle-global-at-bob}.}.  Also when called with a prefix
745 argument (@kbd{C-u @key{TAB}}), global cycling is invoked.
747 @cindex global visibility states
748 @cindex global cycling
749 @cindex overview, global visibility state
750 @cindex contents, global visibility state
751 @cindex show all, global visibility state
752 @kindex S-@key{TAB}
753 @item S-@key{TAB}
754 @itemx C-u @key{TAB}
755 @emph{Global cycling}: Rotate the entire buffer among the states
757 @example
758 ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
759 '--------------------------------------'
760 @end example
762 When @kbd{S-@key{TAB}} is called with a numeric prefix argument N, the
763 CONTENTS view up to headlines of level N will be shown.  Note that inside
764 tables, @kbd{S-@key{TAB}} jumps to the previous field.
766 @cindex show all, command
767 @kindex C-c C-a
768 @item C-c C-a
769 Show all.
770 @kindex C-c C-r
771 @item C-c C-r
772 Reveal context around point, showing the current entry, the following heading
773 and the hierarchy above.  Useful for working near a location that has been
774 exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda command
775 (@pxref{Agenda commands}).  With a prefix argument show, on each
776 level, all sibling headings.
777 @kindex C-c C-x b
778 @item C-c C-x b
779 Show the current subtree in an indirect buffer@footnote{The indirect
780 buffer
781 @ifinfo
782 (@pxref{Indirect Buffers,,,emacs,GNU Emacs Manual})
783 @end ifinfo
784 @ifnotinfo
785 (see the Emacs manual for more information about indirect buffers)
786 @end ifnotinfo
787 will contain the entire buffer, but will be narrowed to the current
788 tree.  Editing the indirect buffer will also change the original buffer,
789 but without affecting visibility in that buffer.}.  With a numeric
790 prefix argument N, go up to level N and then take that tree.  If N is
791 negative then go up that many levels.  With a @kbd{C-u} prefix, do not remove
792 the previously used indirect buffer.
793 @end table
795 When Emacs first visits an Org file, the global state is set to
796 OVERVIEW, i.e. only the top level headlines are visible.  This can be
797 configured through the variable @code{org-startup-folded}, or on a
798 per-file basis by adding one of the following lines anywhere in the
799 buffer:
801 @example
802 #+STARTUP: overview
803 #+STARTUP: content
804 #+STARTUP: showall
805 @end example
807 @noindent
808 Forthermore, any entries with a @samp{VISIBILITY} property (@pxref{Properties
809 and Columns}) will get their visibility adapted accordingly.  Allowed values
810 for this property are @code{folded}, @code{children}, @code{content}, and
811 @code{all}.
812 @table @kbd
813 @kindex C-u C-u @key{TAB}
814 @item C-u C-u @key{TAB}
815 Switch back to the startup visibility of the buffer, i.e. whatever is
816 requested by startup options and @samp{VISIBILITY} properties in individual
817 entries.
818 @end table
820 @node Motion, Structure editing, Visibility cycling, Document Structure
821 @section Motion
822 @cindex motion, between headlines
823 @cindex jumping, to headlines
824 @cindex headline navigation
825 The following commands jump to other headlines in the buffer.
827 @table @kbd
828 @kindex C-c C-n
829 @item C-c C-n
830 Next heading.
831 @kindex C-c C-p
832 @item C-c C-p
833 Previous heading.
834 @kindex C-c C-f
835 @item C-c C-f
836 Next heading same level.
837 @kindex C-c C-b
838 @item C-c C-b
839 Previous heading same level.
840 @kindex C-c C-u
841 @item C-c C-u
842 Backward to higher level heading.
843 @kindex C-c C-j
844 @item C-c C-j
845 Jump to a different place without changing the current outline
846 visibility.  Shows the document structure in a temporary buffer, where
847 you can use the following keys to find your destination:
848 @example
849 @key{TAB}         @r{Cycle visibility.}
850 @key{down} / @key{up}   @r{Next/previous visible headline.}
851 n / p        @r{Next/previous visible headline.}
852 f / b        @r{Next/previous headline same level.}
853 u            @r{One level up.}
854 0-9          @r{Digit argument.}
855 @key{RET}         @r{Select this location.}
856 @end example
857 @end table
859 @node Structure editing, Archiving, Motion, Document Structure
860 @section Structure editing
861 @cindex structure editing
862 @cindex headline, promotion and demotion
863 @cindex promotion, of subtrees
864 @cindex demotion, of subtrees
865 @cindex subtree, cut and paste
866 @cindex pasting, of subtrees
867 @cindex cutting, of subtrees
868 @cindex copying, of subtrees
869 @cindex subtrees, cut and paste
871 @table @kbd
872 @kindex M-@key{RET}
873 @item M-@key{RET}
874 Insert new heading with same level as current.  If the cursor is in a
875 plain list item, a new item is created (@pxref{Plain lists}).  To force
876 creation of a new headline, use a prefix argument, or first press @key{RET}
877 to get to the beginning of the next line.  When this command is used in
878 the middle of a line, the line is split and the rest of the line becomes
879 the new headline@footnote{If you do not want the line to be split,
880 customize the variable @code{org-M-RET-may-split-line}.}.  If the
881 command is used at the beginning of a headline, the new headline is
882 created before the current line.  If at the beginning of any other line,
883 the content of that line is made the new heading.  If the command is
884 used at the end of a folded subtree (i.e. behind the ellipses at the end
885 of a headline), then a headline like the current one will be inserted
886 after the end of the subtree.
887 @kindex C-@key{RET}
888 @item C-@key{RET}
889 Insert a new heading after the current subtree, same level as the
890 current headline.  This command works from anywhere in the entry.
891 @kindex M-S-@key{RET}
892 @item M-S-@key{RET}
893 Insert new TODO entry with same level as current heading.
894 @kindex M-@key{left}
895 @item M-@key{left}
896 Promote current heading by one level.
897 @kindex M-@key{right}
898 @item M-@key{right}
899 Demote current heading by one level.
900 @kindex M-S-@key{left}
901 @item M-S-@key{left}
902 Promote the current subtree by one level.
903 @kindex M-S-@key{right}
904 @item M-S-@key{right}
905 Demote the current subtree by one level.
906 @kindex M-S-@key{up}
907 @item M-S-@key{up}
908 Move subtree up (swap with previous subtree of same
909 level).
910 @kindex M-S-@key{down}
911 @item M-S-@key{down}
912 Move subtree down (swap with next subtree of same level).
913 @kindex C-c C-x C-w
914 @kindex C-c C-x C-k
915 @item C-c C-x C-w
916 @itemx C-c C-x C-k
917 Kill subtree, i.e. remove it from buffer but save in kill ring.
918 With a numeric prefix argument N, kill N sequential subtrees.
919 @kindex C-c C-x M-w
920 @item C-c C-x M-w
921 Copy subtree to kill ring.  With a numeric prefix argument N, copy the N
922 sequential subtrees.
923 @kindex C-c C-x C-y
924 @item C-c C-x C-y
925 Yank subtree from kill ring.  This does modify the level of the subtree to
926 make sure the tree fits in nicely at the yank position.  The yank level can
927 also be specified with a numeric prefix argument, or by yanking after a
928 headline marker like @samp{****}.
929 @kindex C-c C-w
930 @item C-c C-w
931 Refile entry to a different location.  @xref{Refiling notes}.
932 @kindex C-c ^
933 @item C-c ^
934 Sort same-level entries.  When there is an active region, all entries in the
935 region will be sorted.  Otherwise the children of the current headline are
936 sorted.  The command prompts for the sorting method, which can be
937 alphabetically, numerically, by time (using the first time stamp in each
938 entry), by priority, or by TODO keyword (in the sequence the keywords have
939 been defined in the setup).  Reverse sorting is possible as well.  You can
940 also supply your own function to extract the sorting key.  With a @kbd{C-u}
941 prefix, sorting will be case-sensitive.  With two @kbd{C-u C-u} prefixes,
942 duplicate entries will also be removed.
943 @kindex C-x n s
944 @item C-x n s
945 Narrow buffer to current subtree.
946 @kindex C-x n w
947 @item C-x n w
948 Widen buffer to remove a narrowing.
949 @kindex C-c *
950 @item C-c *
951 Turn a normal line or plain list item into a headline (so that it
952 becomes a subheading at its location).  Also turn a headline into a
953 normal line by removing the stars.  If there is an active region, turn
954 all lines in the region into headlines.  Or, if the first line is a
955 headline, remove the stars from all headlines in the region.
956 @end table
958 @cindex region, active
959 @cindex active region
960 @cindex Transient mark mode
961 When there is an active region (Transient mark mode), promotion and
962 demotion work on all headlines in the region.  To select a region of
963 headlines, it is best to place both point and mark at the beginning of a
964 line, mark at the beginning of the first headline, and point at the line
965 just after the last headline to change.  Note that when the cursor is
966 inside a table (@pxref{Tables}), the Meta-Cursor keys have different
967 functionality.
969 @node Archiving, Sparse trees, Structure editing, Document Structure
970 @section Archiving
971 @cindex archiving
973 When a project represented by a (sub)tree is finished, you may want
974 to move the tree out of the way and to stop it from contributing to the
975 agenda.  Org mode knows two ways of archiving.  You can mark a tree with
976 the ARCHIVE tag, or you can move an entire (sub)tree to a different
977 location.
979 @menu
980 * ARCHIVE tag::                 Marking a tree as inactive
981 * Moving subtrees::             Moving a tree to an archive file
982 @end menu
984 @node ARCHIVE tag, Moving subtrees, Archiving, Archiving
985 @subsection The ARCHIVE tag
986 @cindex internal archiving
988 A headline that is marked with the ARCHIVE tag (@pxref{Tags}) stays at
989 its location in the outline tree, but behaves in the following way:
990 @itemize @minus
991 @item
992 It does not open when you attempt to do so with a visibility cycling
993 command (@pxref{Visibility cycling}).  You can force cycling archived
994 subtrees with @kbd{C-@key{TAB}}, or by setting the option
995 @code{org-cycle-open-archived-trees}.  Also normal outline commands like
996 @code{show-all} will open archived subtrees.
997 @item
998 During sparse tree construction (@pxref{Sparse trees}), matches in
999 archived subtrees are not exposed, unless you configure the option
1000 @code{org-sparse-tree-open-archived-trees}.
1001 @item
1002 During agenda view construction (@pxref{Agenda Views}), the content of
1003 archived trees is ignored unless you configure the option
1004 @code{org-agenda-skip-archived-trees}.
1005 @item
1006 Archived trees are not exported (@pxref{Exporting}), only the headline
1007 is.  Configure the details using the variable
1008 @code{org-export-with-archived-trees}.
1009 @end itemize
1011 The following commands help managing the ARCHIVE tag:
1013 @table @kbd
1014 @kindex C-c C-x a
1015 @item C-c C-x a
1016 Toggle the ARCHIVE tag for the current headline.  When the tag is set,
1017 the headline changes to a shadowed face, and the subtree below it is
1018 hidden.
1019 @kindex C-u C-c C-x a
1020 @item C-u C-c C-x a
1021 Check if any direct children of the current headline should be archived.
1022 To do this, each subtree is checked for open TODO entries.  If none are
1023 found, the command offers to set the ARCHIVE tag for the child.  If the
1024 cursor is @emph{not} on a headline when this command is invoked, the
1025 level 1 trees will be checked.
1026 @kindex C-@kbd{TAB}
1027 @item C-@kbd{TAB}
1028 Cycle a tree even if it is tagged with ARCHIVE.
1029 @end table
1031 @node Moving subtrees,  , ARCHIVE tag, Archiving
1032 @subsection Moving subtrees
1033 @cindex external archiving
1035 Once an entire project is finished, you may want to move it to a different
1036 location.  Org can move it to an @emph{Attic Sibling} in the same tree, to a
1037 different tree in the current file, or to a different file, the archive file.
1039 @table @kbd
1040 @kindex C-c C-x A
1041 @item C-c C-x A
1042 Move the current entry to the @emph{Attic Sibling}.  This is a sibling of the
1043 entry with the heading @samp{Attic} and the tag @samp{ARCHIVE}
1044 (@pxref{ARCHIVE tag}).  The entry becomes a child of that sibling and in this
1045 way retains a lot of its original context, including inherited tags and
1046 approximate position in the outline.
1047 @kindex C-c C-x C-s
1048 @item C-c C-x C-s
1049 Archive the subtree starting at the cursor position to the location
1050 given by @code{org-archive-location}.  Context information that could be
1051 lost like the file name, the category, inherited tags, and the TODO
1052 state will be store as properties in the entry.
1053 @kindex C-u C-c C-x C-s
1054 @item C-u C-c C-x C-s
1055 Check if any direct children of the current headline could be moved to
1056 the archive.  To do this, each subtree is checked for open TODO entries.
1057 If none are found, the command offers to move it to the archive
1058 location.  If the cursor is @emph{not} on a headline when this command
1059 is invoked, the level 1 trees will be checked.
1060 @end table
1062 @cindex archive locations
1063 The default archive location is a file in the same directory as the
1064 current file, with the name derived by appending @file{_archive} to the
1065 current file name.  For information and examples on how to change this,
1066 see the documentation string of the variable
1067 @code{org-archive-location}.  There is also an in-buffer option for
1068 setting this variable, for example@footnote{For backward compatibility,
1069 the following also works: If there are several such lines in a file,
1070 each specifies the archive location for the text below it.  The first
1071 such line also applies to any text before its definition.  However,
1072 using this method is @emph{strongly} deprecated as it is incompatible
1073 with the outline structure of the document.  The correct method for
1074 setting multiple archive locations in a buffer is using a property.}:
1076 @example
1077 #+ARCHIVE: %s_done::
1078 @end example
1080 @noindent
1081 If you would like to have a special ARCHIVE location for a single entry
1082 or a (sub)tree, give the entry an @code{:ARCHIVE:} property with the
1083 location as the value (@pxref{Properties and Columns}).
1085 When a subtree is moved, it receives a number of special properties that
1086 record context information like the file from where the entry came, it's
1087 outline path the archiving time etc.  Configure the variable
1088 @code{org-archive-save-context-info} to adjust the amount of information
1089 added.
1091 @node Sparse trees, Plain lists, Archiving, Document Structure
1092 @section Sparse trees
1093 @cindex sparse trees
1094 @cindex trees, sparse
1095 @cindex folding, sparse trees
1096 @cindex occur, command
1098 An important feature of Org mode is the ability to construct @emph{sparse
1099 trees} for selected information in an outline tree, so that the entire
1100 document is folded as much as possible, but the selected information is made
1101 visible along with the headline structure above it@footnote{See also the
1102 variables @code{org-show-hierarchy-above}, @code{org-show-following-heading},
1103 @code{org-show-siblings}, and @code{org-show-entry-below} for detailed
1104 control on how much context is shown around each match.}.  Just try it out
1105 and you will see immediately how it works.
1107 Org mode contains several commands creating such trees, all these
1108 commands can be accessed through a dispatcher:
1110 @table @kbd
1111 @kindex C-c /
1112 @item C-c /
1113 This prompts for an extra key to select a sparse-tree creating command.
1114 @kindex C-c / r
1115 @item C-c / r
1116 Occur.  Prompts for a regexp and shows a sparse tree with all matches.
1117 If the match is in a headline, the headline is made visible.  If the
1118 match is in the body of an entry, headline and body are made visible.
1119 In order to provide minimal context, also the full hierarchy of
1120 headlines above the match is shown, as well as the headline following
1121 the match.  Each match is also highlighted; the highlights disappear
1122 when the buffer is changed by an editing command, or by pressing
1123 @kbd{C-c C-c}.  When called with a @kbd{C-u} prefix argument, previous
1124 highlights are kept, so several calls to this command can be stacked.
1125 @end table
1127 @noindent
1128 For frequently used sparse trees of specific search strings, you can
1129 use the variable @code{org-agenda-custom-commands} to define fast
1130 keyboard access to specific sparse trees.  These commands will then be
1131 accessible through the agenda dispatcher (@pxref{Agenda dispatcher}).
1132 For example:
1134 @lisp
1135 (setq org-agenda-custom-commands
1136       '(("f" occur-tree "FIXME")))
1137 @end lisp
1139 @noindent will define the key @kbd{C-c a f} as a shortcut for creating
1140 a sparse tree matching the string @samp{FIXME}.
1142 The other sparse tree commands select headings based on TODO keywords,
1143 tags, or properties and will be discussed later in this manual.
1145 @kindex C-c C-e v
1146 @cindex printing sparse trees
1147 @cindex visible text, printing
1148 To print a sparse tree, you can use the Emacs command
1149 @code{ps-print-buffer-with-faces} which does not print invisible parts
1150 of the document @footnote{This does not work under XEmacs, because
1151 XEmacs uses selective display for outlining, not text properties.}.
1152 Or you can use the command @kbd{C-c C-e v} to export only the visible
1153 part of the document and print the resulting file.
1155 @node Plain lists, Drawers, Sparse trees, Document Structure
1156 @section Plain lists
1157 @cindex plain lists
1158 @cindex lists, plain
1159 @cindex lists, ordered
1160 @cindex ordered lists
1162 Within an entry of the outline tree, hand-formatted lists can provide
1163 additional structure.  They also provide a way to create lists of
1164 checkboxes (@pxref{Checkboxes}).  Org supports editing such lists,
1165 and the HTML exporter (@pxref{Exporting}) parses and formats them.
1167 Org knows ordered lists, unordered lists, and description lists.
1168 @itemize @bullet
1169 @item
1170 @emph{Unordered} list items start with @samp{-}, @samp{+}, or
1171 @samp{*}@footnote{When using @samp{*} as a bullet, lines must be indented or
1172 they will be seen as top-level headlines.  Also, when you are hiding leading
1173 stars to get a clean outline view, plain list items starting with a star are
1174 visually indistinguishable from true headlines.  In short: even though
1175 @samp{*} is supported, it may be better to not use it for plain list items.}
1176 as bullets.
1177 @item
1178 @emph{Ordered} list items start with a numeral followed by either a period or
1179 a right parenthesis, such as @samp{1.} or @samp{1)}.
1180 @item
1181 @emph{Description} list items are like unordered list items, but contain the
1182 separator @samp{ :: } to separate the description @emph{term} from the
1183 desciption.
1184 @end itemize
1186 Items belonging to the same list must have the same indentation on the first
1187 line.  In particular, if an ordered list reaches number @samp{10.}, then the
1188 2--digit numbers must be written left-aligned with the other numbers in the
1189 list.  Indentation also determines the end of a list item.  It ends before
1190 the next line that is indented like the bullet/number, or less.  Empty lines
1191 are part of the previous item, so you can have several paragraphs in one
1192 item.  If you would like an empty line to terminate all currently open plain
1193 lists, configure the variable @code{org-empty-line-terminates-plain-lists}.
1194 Here is an example:
1196 @example
1197 @group
1198 ** Lord of the Rings
1199    My favorite scenes are (in this order)
1200    1. The attack of the Rohirrim
1201    2. Eowyns fight with the witch king
1202       + this was already my favorite scene in the book
1203       + I really like Miranda Otto.
1204    3. Peter Jackson being shot by Legolas
1205        - on DVD only
1206       He makes a really funny face when it happens.
1207    But in the end, not individual scenes matter but the film as a whole.
1208    Important actors in this film are:
1209    - @b{Elijah Wood} :: He plays the Frodo
1210    - @b{Sean Austin} :: He plays the Sam, Frodos friend.  I still remember
1211      him very well from his role as Mikey Walsh a in the Goonies.
1212 @end group
1213 @end example
1215 Org supports these lists by tuning filling and wrapping commands to
1216 deal with them correctly@footnote{Org only changes the filling
1217 settings for Emacs.  For XEmacs, you should use Kyle E. Jones'
1218 @file{filladapt.el}.  To turn this on,  put into @file{.emacs}:
1219 @code{(require 'filladapt)}}, and by exporting them properly
1220 (@pxref{Exporting}).
1222 The following commands act on items when the cursor is in the first line
1223 of an item (the line with the bullet or number).
1225 @table @kbd
1226 @kindex @key{TAB}
1227 @item @key{TAB}
1228 Items can be folded just like headline levels if you set the variable
1229 @code{org-cycle-include-plain-lists}.  The level of an item is then
1230 given by the indentation of the bullet/number.  Items are always
1231 subordinate to real headlines, however; the hierarchies remain
1232 completely separated.
1234 If @code{org-cycle-include-plain-lists} has not been set, @key{TAB}
1235 fixes the indentation of the current line in a heuristic way.
1236 @kindex M-@key{RET}
1237 @item M-@key{RET}
1238 Insert new item at current level.  With a prefix argument, force a new
1239 heading (@pxref{Structure editing}).  If this command is used in the middle
1240 of a line, the line is @emph{split} and the rest of the line becomes the new
1241 item@footnote{If you do not want the line to be split, customize the variable
1242 @code{org-M-RET-may-split-line}.}.  If this command is executed in the
1243 @emph{whitespace before a bullet or number}, the new item is created
1244 @emph{before} the current item.  If the command is executed in the white
1245 space before the text that is part of an item but does not contain the
1246 bullet, a bullet is added to the current line.
1247 @kindex M-S-@key{RET}
1248 @item M-S-@key{RET}
1249 Insert a new item with a checkbox (@pxref{Checkboxes}).
1250 @kindex S-@key{up}
1251 @kindex S-@key{down}
1252 @item S-@key{up}
1253 @itemx S-@key{down}
1254 Jump to the previous/next item in the current list.
1255 @kindex M-S-@key{up}
1256 @kindex M-S-@key{down}
1257 @item M-S-@key{up}
1258 @itemx M-S-@key{down}
1259 Move the item including subitems up/down (swap with previous/next item
1260 of same indentation).  If the list is ordered, renumbering is
1261 automatic.
1262 @kindex M-S-@key{left}
1263 @kindex M-S-@key{right}
1264 @item M-S-@key{left}
1265 @itemx M-S-@key{right}
1266 Decrease/increase the indentation of the item, including subitems.
1267 Initially, the item tree is selected based on current indentation.
1268 When these commands are executed several times in direct succession,
1269 the initially selected region is used, even if the new indentation
1270 would imply a different hierarchy.  To use the new hierarchy, break
1271 the command chain with a cursor motion or so.
1272 @kindex C-c C-c
1273 @item C-c C-c
1274 If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the
1275 state of the checkbox.  If not, this command makes sure that all the
1276 items on this list level use the same bullet.  Furthermore, if this is
1277 an ordered list, make sure the numbering is OK.
1278 @kindex C-c -
1279 @item C-c -
1280 Cycle the entire list level through the different itemize/enumerate bullets
1281 (@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}).  With a numeric prefix
1282 argument N, select the Nth bullet from this list.  If there is an active
1283 region when calling this, all lines will be converted to list items.  If the
1284 first line already was a list item, any item markers will be removed from the
1285 list.  Finally, even without an active region, a normal line will be
1286 converted into a list item.
1287 @end table
1289 @node Drawers, Orgstruct mode, Plain lists, Document Structure
1290 @section Drawers
1291 @cindex drawers
1292 @cindex visibility cycling, drawers
1294 Sometimes you want to keep information associated with an entry, but you
1295 normally don't want to see it.  For this, Org mode has @emph{drawers}.
1296 Drawers need to be configured with the variable
1297 @code{org-drawers}@footnote{You can define drawers on a per-file basis
1298 with a line like @code{#+DRAWERS: HIDDEN PROPERTIES STATE}}.  Drawers
1299 look like this:
1301 @example
1302 ** This is a headline
1303    Still outside the drawer
1304    :DRAWERNAME:
1305       This is inside the drawer.
1306    :END:
1307    After the drawer.
1308 @end example
1310 Visibility cycling (@pxref{Visibility cycling}) on the headline will
1311 hide and show the entry, but keep the drawer collapsed to a single line.
1312 In order to look inside the drawer, you need to move the cursor to the
1313 drawer line and press @key{TAB} there.  Org mode uses a drawer for
1314 storing properties (@pxref{Properties and Columns}), and another one for
1315 storing clock times (@pxref{Clocking work time}).
1317 @node Orgstruct mode,  , Drawers, Document Structure
1318 @section The Orgstruct minor mode
1319 @cindex Orgstruct mode
1320 @cindex minor mode for structure editing
1322 If you like the intuitive way the Org mode structure editing and list
1323 formatting works, you might want to use these commands in other modes
1324 like Text mode or Mail mode as well.  The minor mode Orgstruct mode
1325 makes this possible.  You can always toggle the mode with @kbd{M-x
1326 orgstruct-mode}.  To turn it on by default, for example in Mail mode,
1329 @lisp
1330 (add-hook 'mail-mode-hook 'turn-on-orgstruct)
1331 @end lisp
1333 When this mode is active and the cursor is on a line that looks to
1334 Org like a headline of the first line of a list item, most
1335 structure editing commands will work, even if the same keys normally
1336 have different functionality in the major mode you are using.  If the
1337 cursor is not in one of those special lines, Orgstruct mode lurks
1338 silently in the shadow.
1340 @node Tables, Hyperlinks, Document Structure, Top
1341 @chapter Tables
1342 @cindex tables
1343 @cindex editing tables
1345 Org comes with a fast and intuitive table editor.  Spreadsheet-like
1346 calculations are supported in connection with the Emacs @file{calc}
1347 package
1348 @ifinfo
1349 (@pxref{Top,Calc,,Calc,Gnu Emacs Calculator Manual}).
1350 @end ifinfo
1351 @ifnotinfo
1352 (see the Emacs Calculator manual for more information about the Emacs
1353 calculator).
1354 @end ifnotinfo
1356 @menu
1357 * Built-in table editor::       Simple tables
1358 * Narrow columns::              Stop wasting space in tables
1359 * Column groups::               Grouping to trigger vertical lines
1360 * Orgtbl mode::                 The table editor as minor mode
1361 * The spreadsheet::             The table editor has spreadsheet capabilities
1362 @end menu
1364 @node Built-in table editor, Narrow columns, Tables, Tables
1365 @section The built-in table editor
1366 @cindex table editor, built-in
1368 Org makes it easy to format tables in plain ASCII.  Any line with
1369 @samp{|} as the first non-whitespace character is considered part of a
1370 table.  @samp{|} is also the column separator.  A table might look like
1371 this:
1373 @example
1374 | Name  | Phone | Age |
1375 |-------+-------+-----|
1376 | Peter |  1234 |  17 |
1377 | Anna  |  4321 |  25 |
1378 @end example
1380 A table is re-aligned automatically each time you press @key{TAB} or
1381 @key{RET} or @kbd{C-c C-c} inside the table.  @key{TAB} also moves to
1382 the next field (@key{RET} to the next row) and creates new table rows
1383 at the end of the table or before horizontal lines.  The indentation
1384 of the table is set by the first line.  Any line starting with
1385 @samp{|-} is considered as a horizontal separator line and will be
1386 expanded on the next re-align to span the whole table width.  So, to
1387 create the above table, you would only type
1389 @example
1390 |Name|Phone|Age|
1392 @end example
1394 @noindent and then press @key{TAB} to align the table and start filling in
1395 fields.
1397 When typing text into a field, Org treats @key{DEL},
1398 @key{Backspace}, and all character keys in a special way, so that
1399 inserting and deleting avoids shifting other fields.  Also, when
1400 typing @emph{immediately after the cursor was moved into a new field
1401 with @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the
1402 field is automatically made blank.  If this behavior is too
1403 unpredictable for you, configure the variables
1404 @code{org-enable-table-editor} and @code{org-table-auto-blank-field}.
1406 @table @kbd
1407 @tsubheading{Creation and conversion}
1408 @kindex C-c |
1409 @item C-c |
1410 Convert the active region to table. If every line contains at least one
1411 TAB character, the function assumes that the material is tab separated.
1412 If every line contains a comma, comma-separated values (CSV) are assumed.
1413 If not, lines are split at whitespace into fields.  You can use a prefix
1414 argument to force a specific separator: @kbd{C-u} forces CSV, @kbd{C-u
1415 C-u} forces TAB, and a numeric argument N indicates that at least N
1416 consecutive spaces, or alternatively a TAB will be the separator.
1418 If there is no active region, this command creates an empty Org
1419 table.  But it's easier just to start typing, like
1420 @kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}.
1422 @tsubheading{Re-aligning and field motion}
1423 @kindex C-c C-c
1424 @item C-c C-c
1425 Re-align the table without moving the cursor.
1427 @kindex @key{TAB}
1428 @item @key{TAB}
1429 Re-align the table, move to the next field.  Creates a new row if
1430 necessary.
1432 @kindex S-@key{TAB}
1433 @item S-@key{TAB}
1434 Re-align, move to previous field.
1436 @kindex @key{RET}
1437 @item @key{RET}
1438 Re-align the table and move down to next row.  Creates a new row if
1439 necessary.  At the beginning or end of a line, @key{RET} still does
1440 NEWLINE, so it can be used to split a table.
1442 @tsubheading{Column and row editing}
1443 @kindex M-@key{left}
1444 @kindex M-@key{right}
1445 @item M-@key{left}
1446 @itemx M-@key{right}
1447 Move the current column left/right.
1449 @kindex M-S-@key{left}
1450 @item M-S-@key{left}
1451 Kill the current column.
1453 @kindex M-S-@key{right}
1454 @item M-S-@key{right}
1455 Insert a new column to the left of the cursor position.
1457 @kindex M-@key{up}
1458 @kindex M-@key{down}
1459 @item M-@key{up}
1460 @itemx M-@key{down}
1461 Move the current row up/down.
1463 @kindex M-S-@key{up}
1464 @item M-S-@key{up}
1465 Kill the current row or horizontal line.
1467 @kindex M-S-@key{down}
1468 @item M-S-@key{down}
1469 Insert a new row above the current row.  With a prefix argument, the line is
1470 created below the current one.
1472 @kindex C-c -
1473 @item C-c -
1474 Insert a horizontal line below current row. With a prefix argument, the line
1475 is created above the current line.
1477 @kindex C-c ^
1478 @item C-c ^
1479 Sort the table lines in the region.  The position of point indicates the
1480 column to be used for sorting, and the range of lines is the range
1481 between the nearest horizontal separator lines, or the entire table.  If
1482 point is before the first column, you will be prompted for the sorting
1483 column.  If there is an active region, the mark specifies the first line
1484 and the sorting column, while point should be in the last line to be
1485 included into the sorting.  The command prompts for the sorting type
1486 (alphabetically, numerically, or by time).  When called with a prefix
1487 argument, alphabetic sorting will be case-sensitive.
1489 @tsubheading{Regions}
1490 @kindex C-c C-x M-w
1491 @item C-c C-x M-w
1492 Copy a rectangular region from a table to a special clipboard.  Point
1493 and mark determine edge fields of the rectangle.  The process ignores
1494 horizontal separator lines.
1496 @kindex C-c C-x C-w
1497 @item C-c C-x C-w
1498 Copy a rectangular region from a table to a special clipboard, and
1499 blank all fields in the rectangle.  So this is the ``cut'' operation.
1501 @kindex C-c C-x C-y
1502 @item C-c C-x C-y
1503 Paste a rectangular region into a table.
1504 The upper right corner ends up in the current field.  All involved fields
1505 will be overwritten.  If the rectangle does not fit into the present table,
1506 the table is enlarged as needed.  The process ignores horizontal separator
1507 lines.
1509 @kindex C-c C-q
1510 @kindex M-@key{RET}
1511 @item C-c C-q
1512 @itemx M-@kbd{RET}
1513 Wrap several fields in a column like a paragraph.  If there is an active
1514 region, and both point and mark are in the same column, the text in the
1515 column is wrapped to minimum width for the given number of lines.  A numeric
1516 prefix argument may be used to change the number of desired lines.  If there
1517 is no region, the current field is split at the cursor position and the text
1518 fragment to the right of the cursor is prepended to the field one line
1519 down. If there is no region, but you specify a prefix argument, the current
1520 field is made blank, and the content is appended to the field above.
1522 @tsubheading{Calculations}
1523 @cindex formula, in tables
1524 @cindex calculations, in tables
1525 @cindex region, active
1526 @cindex active region
1527 @cindex Transient mark mode
1528 @kindex C-c +
1529 @item C-c +
1530 Sum the numbers in the current column, or in the rectangle defined by
1531 the active region.  The result is shown in the echo area and can
1532 be inserted with @kbd{C-y}.
1534 @kindex S-@key{RET}
1535 @item S-@key{RET}
1536 When current field is empty, copy from first non-empty field above.
1537 When not empty, copy current field down to next row and move cursor
1538 along with it.  Depending on the variable
1539 @code{org-table-copy-increment}, integer field values will be
1540 incremented during copy.  This key is also used by CUA mode
1541 (@pxref{Cooperation}).
1543 @tsubheading{Miscellaneous}
1544 @kindex C-c `
1545 @item C-c `
1546 Edit the current field in a separate window.  This is useful for fields
1547 that are not fully visible (@pxref{Narrow columns}).  When called with a
1548 @kbd{C-u} prefix, just make the full field visible, so that it can be
1549 edited in place.
1551 @item M-x org-table-import
1552 Import a file as a table.  The table should be TAB- or whitespace
1553 separated.  Useful, for example, to import a spreadsheet table or data
1554 from a database, because these programs generally can write
1555 TAB-separated text files.  This command works by inserting the file into
1556 the buffer and then converting the region to a table.  Any prefix
1557 argument is passed on to the converter, which uses it to determine the
1558 separator.
1559 @item C-c |
1560 Tables can also be imported by pasting tabular text into the Org
1561 buffer, selecting the pasted text with @kbd{C-x C-x} and then using the
1562 @kbd{C-c |} command (see above under @i{Creation and conversion}.
1564 @item M-x org-table-export
1565 Export the table, by default as a TAB-separated file.  Useful for data
1566 exchange with, for example, spreadsheet or database programs.  The format
1567 used to export the file can be configured in the variable
1568 @code{org-table-export-default-format}.  You may also use properties
1569 @code{TABLE_EXPORT_FILE} and @code{TABLE_EXPORT_FORMAT} to specify the file
1570 name and the format for table export in a subtree.  Org supports quite
1571 general formats for exported tables.  The exporter format is the same as the
1572 format used by Orgtbl radio tables, see @ref{Translator functions} for a
1573 detailed description.
1574 @end table
1576 If you don't like the automatic table editor because it gets in your
1577 way on lines which you would like to start with @samp{|}, you can turn
1578 it off with
1580 @lisp
1581 (setq org-enable-table-editor nil)
1582 @end lisp
1584 @noindent Then the only table command that still works is
1585 @kbd{C-c C-c} to do a manual re-align.
1587 @node Narrow columns, Column groups, Built-in table editor, Tables
1588 @section Narrow columns
1589 @cindex narrow columns in tables
1591 The width of columns is automatically determined by the table editor.
1592 Sometimes a single field or a few fields need to carry more text,
1593 leading to inconveniently wide columns.  To limit@footnote{This feature
1594 does not work on XEmacs.} the width of a column, one field anywhere in
1595 the column may contain just the string @samp{<N>} where @samp{N} is an
1596 integer specifying the width of the column in characters.  The next
1597 re-align will then set the width of this column to no more than this
1598 value.
1600 @example
1601 @group
1602 |---+------------------------------|               |---+--------|
1603 |   |                              |               |   | <6>    |
1604 | 1 | one                          |               | 1 | one    |
1605 | 2 | two                          |     ----\     | 2 | two    |
1606 | 3 | This is a long chunk of text |     ----/     | 3 | This=> |
1607 | 4 | four                         |               | 4 | four   |
1608 |---+------------------------------|               |---+--------|
1609 @end group
1610 @end example
1612 @noindent
1613 Fields that are wider become clipped and end in the string @samp{=>}.
1614 Note that the full text is still in the buffer, it is only invisible.
1615 To see the full text, hold the mouse over the field - a tool-tip window
1616 will show the full content.  To edit such a field, use the command
1617 @kbd{C-c `} (that is @kbd{C-c} followed by the backquote).  This will
1618 open a new window with the full field.  Edit it and finish with @kbd{C-c
1619 C-c}.
1621 When visiting a file containing a table with narrowed columns, the
1622 necessary character hiding has not yet happened, and the table needs to
1623 be aligned before it looks nice.  Setting the option
1624 @code{org-startup-align-all-tables} will realign all tables in a file
1625 upon visiting, but also slow down startup.  You can also set this option
1626 on a per-file basis with:
1628 @example
1629 #+STARTUP: align
1630 #+STARTUP: noalign
1631 @end example
1633 @node Column groups, Orgtbl mode, Narrow columns, Tables
1634 @section Column groups
1635 @cindex grouping columns in tables
1637 When Org exports tables, it does so by default without vertical
1638 lines because that is visually more satisfying in general.  Occasionally
1639 however, vertical lines can be useful to structure a table into groups
1640 of columns, much like horizontal lines can do for groups of rows.  In
1641 order to specify column groups, you can use a special row where the
1642 first field contains only @samp{/}.  The further fields can either
1643 contain @samp{<} to indicate that this column should start a group,
1644 @samp{>} to indicate the end of a column, or @samp{<>} to make a column
1645 a group of its own.  Boundaries between column groups will upon export be
1646 marked with vertical lines.  Here is an example:
1648 @example
1649 |   |  N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
1650 |---+----+-----+-----+-----+---------+------------|
1651 | / | <> |   < |     |   > |       < |          > |
1652 | # |  1 |   1 |   1 |   1 |       1 |          1 |
1653 | # |  2 |   4 |   8 |  16 |  1.4142 |     1.1892 |
1654 | # |  3 |   9 |  27 |  81 |  1.7321 |     1.3161 |
1655 |---+----+-----+-----+-----+---------+------------|
1656 #+TBLFM: $3=$2^2::$4=$2^3::$5=$2^4::$6=sqrt($2)::$7=sqrt(sqrt(($2))
1657 @end example
1659 It is also sufficient to just insert the column group starters after
1660 every vertical line you'd like to have:
1662 @example
1663 |  N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
1664 |----+-----+-----+-----+---------+------------|
1665 | /  | <   |     |     | <       |            |
1666 @end example
1668 @node Orgtbl mode, The spreadsheet, Column groups, Tables
1669 @section The Orgtbl minor mode
1670 @cindex Orgtbl mode
1671 @cindex minor mode for tables
1673 If you like the intuitive way the Org table editor works, you
1674 might also want to use it in other modes like Text mode or Mail mode.
1675 The minor mode Orgtbl mode makes this possible.  You can always toggle
1676 the mode with @kbd{M-x orgtbl-mode}.  To turn it on by default, for
1677 example in mail mode, use
1679 @lisp
1680 (add-hook 'mail-mode-hook 'turn-on-orgtbl)
1681 @end lisp
1683 Furthermore, with some special setup, it is possible to maintain tables
1684 in arbitrary syntax with Orgtbl mode.  For example, it is possible to
1685 construct La@TeX{} tables with the underlying ease and power of
1686 Orgtbl mode, including spreadsheet capabilities.  For details, see
1687 @ref{Tables in arbitrary syntax}.
1689 @node The spreadsheet,  , Orgtbl mode, Tables
1690 @section The spreadsheet
1691 @cindex calculations, in tables
1692 @cindex spreadsheet capabilities
1693 @cindex @file{calc} package
1695 The table editor makes use of the Emacs @file{calc} package to implement
1696 spreadsheet-like capabilities.  It can also evaluate Emacs Lisp forms to
1697 derive fields from other fields.  While fully featured, Org's
1698 implementation is not identical to other spreadsheets.  For example,
1699 Org knows the concept of a @emph{column formula} that will be
1700 applied to all non-header fields in a column without having to copy the
1701 formula to each relevant field.
1703 @menu
1704 * References::                  How to refer to another field or range
1705 * Formula syntax for Calc::     Using Calc to compute stuff
1706 * Formula syntax for Lisp::     Writing formulas in Emacs Lisp
1707 * Field formulas::              Formulas valid for a single field
1708 * Column formulas::             Formulas valid for an entire column
1709 * Editing and debugging formulas::  Fixing formulas
1710 * Updating the table::          Recomputing all dependent fields
1711 * Advanced features::           Field names, parameters and automatic recalc
1712 @end menu
1714 @node References, Formula syntax for Calc, The spreadsheet, The spreadsheet
1715 @subsection References
1716 @cindex references
1718 To compute fields in the table from other fields, formulas must
1719 reference other fields or ranges.  In Org, fields can be referenced
1720 by name, by absolute coordinates, and by relative coordinates.  To find
1721 out what the coordinates of a field are, press @kbd{C-c ?} in that
1722 field, or press @kbd{C-c @}} to toggle the display of a grid.
1724 @subsubheading Field references
1725 @cindex field references
1726 @cindex references, to fields
1728 Formulas can reference the value of another field in two ways.  Like in
1729 any other spreadsheet, you may reference fields with a letter/number
1730 combination like @code{B3}, meaning the 2nd field in the 3rd row.
1731 @c Such references are always fixed to that field, they don't change
1732 @c when you copy and paste a formula to a different field.  So
1733 @c Org's @code{B3} behaves like @code{$B$3} in other spreadsheets.
1735 @noindent
1736 Org also uses another, more general operator that looks like this:
1737 @example
1738 @@row$column
1739 @end example
1741 @noindent
1742 Column references can be absolute like @samp{1}, @samp{2},...@samp{N},
1743 or relative to the current column like @samp{+1} or @samp{-2}.
1745 The row specification only counts data lines and ignores horizontal
1746 separator lines (hlines).  You can use absolute row numbers
1747 @samp{1}...@samp{N}, and row numbers relative to the current row like
1748 @samp{+3} or @samp{-1}.  Or specify the row relative to one of the
1749 hlines: @samp{I} refers to the first hline@footnote{Note that only
1750 hlines are counted that @emph{separate} table lines.  If the table
1751 starts with a hline above the header, it does not count.}, @samp{II} to
1752 the second etc.  @samp{-I} refers to the first such line above the
1753 current line, @samp{+I} to the first such line below the current line.
1754 You can also write @samp{III+2} which is the second data line after the
1755 third hline in the table.  Relative row numbers like @samp{-3} will not
1756 cross hlines if the current line is too close to the hline.  Instead,
1757 the value directly at the hline is used.
1759 @samp{0} refers to the current row and column.  Also, if you omit
1760 either the column or the row part of the reference, the current
1761 row/column is implied.
1763 Org's references with @emph{unsigned} numbers are fixed references
1764 in the sense that if you use the same reference in the formula for two
1765 different fields, the same field will be referenced each time.
1766 Org's references with @emph{signed} numbers are floating
1767 references because the same reference operator can reference different
1768 fields depending on the field being calculated by the formula.
1770 Here are a few examples:
1772 @example
1773 @@2$3      @r{2nd row, 3rd column}
1774 C2        @r{same as previous}
1775 $5        @r{column 5 in the current row}
1776 E&        @r{same as previous}
1777 @@2        @r{current column, row 2}
1778 @@-1$-3    @r{the field one row up, three columns to the left}
1779 @@-I$2     @r{field just under hline above current row, column 2}
1780 @end example
1782 @subsubheading Range references
1783 @cindex range references
1784 @cindex references, to ranges
1786 You may reference a rectangular range of fields by specifying two field
1787 references connected by two dots @samp{..}.  If both fields are in the
1788 current row, you may simply use @samp{$2..$7}, but if at least one field
1789 is in a different row, you need to use the general @code{@@row$column}
1790 format at least for the first field (i.e the reference must start with
1791 @samp{@@} in order to be interpreted correctly).  Examples:
1793 @example
1794 $1..$3        @r{First three fields in the current row.}
1795 $P..$Q        @r{Range, using column names (see under Advanced)}
1796 @@2$1..@@4$3    @r{6 fields between these two fields.}
1797 A2..C4        @r{Same as above.}
1798 @@-1$-2..@@-1   @r{3 numbers from the column to the left, 2 up to current row}
1799 @end example
1801 @noindent Range references return a vector of values that can be fed
1802 into Calc vector functions.  Empty fields in ranges are normally
1803 suppressed, so that the vector contains only the non-empty fields (but
1804 see the @samp{E} mode switch below).  If there are no non-empty fields,
1805 @samp{[0]} is returned to avoid syntax errors in formulas.
1807 @subsubheading Named references
1808 @cindex named references
1809 @cindex references, named
1810 @cindex name, of column or field
1811 @cindex constants, in calculations
1813 @samp{$name} is interpreted as the name of a column, parameter or
1814 constant.  Constants are defined globally through the variable
1815 @code{org-table-formula-constants}, and locally (for the file) through a
1816 line like
1818 @example
1819 #+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6
1820 @end example
1822 @noindent
1823 Also properties (@pxref{Properties and Columns}) can be used as
1824 constants in table formulas: For a property @samp{:Xyz:} use the name
1825 @samp{$PROP_Xyz}, and the property will be searched in the current
1826 outline entry and in the hierarchy above it.  If you have the
1827 @file{constants.el} package, it will also be used to resolve constants,
1828 including natural constants like @samp{$h} for Planck's constant, and
1829 units like @samp{$km} for kilometers@footnote{@file{Constant.el} can
1830 supply the values of constants in two different unit systems, @code{SI}
1831 and @code{cgs}.  Which one is used depends on the value of the variable
1832 @code{constants-unit-system}.  You can use the @code{#+STARTUP} options
1833 @code{constSI} and @code{constcgs} to set this value for the current
1834 buffer.}.  Column names and parameters can be specified in special table
1835 lines.  These are described below, see @ref{Advanced features}.  All
1836 names must start with a letter, and further consist of letters and
1837 numbers.
1839 @node Formula syntax for Calc, Formula syntax for Lisp, References, The spreadsheet
1840 @subsection Formula syntax for Calc
1841 @cindex formula syntax, Calc
1842 @cindex syntax, of formulas
1844 A formula can be any algebraic expression understood by the Emacs
1845 @file{Calc} package.  @b{Note that @file{calc} has the
1846 non-standard convention that @samp{/} has lower precedence than
1847 @samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.}  Before
1848 evaluation by @code{calc-eval} (@pxref{Calling Calc from
1849 Your Programs,calc-eval,Calling Calc from Your Lisp Programs,Calc,GNU
1850 Emacs Calc Manual}),
1851 @c FIXME:  The link to the Calc manual in HTML does not work.
1852 variable substitution takes place according to the rules described above.
1853 @cindex vectors, in table calculations
1854 The range vectors can be directly fed into the Calc vector functions
1855 like @samp{vmean} and @samp{vsum}.
1857 @cindex format specifier
1858 @cindex mode, for @file{calc}
1859 A formula can contain an optional mode string after a semicolon.  This
1860 string consists of flags to influence Calc and other modes during
1861 execution.  By default, Org uses the standard Calc modes (precision
1862 12, angular units degrees, fraction and symbolic modes off.  The display
1863 format, however, has been changed to @code{(float 5)} to keep tables
1864 compact.  The default settings can be configured using the variable
1865 @code{org-calc-default-modes}.
1867 @example
1868 p20           @r{switch the internal precision to 20 digits}
1869 n3 s3 e2 f4   @r{normal, scientific, engineering, or fixed display format}
1870 D R           @r{angle modes: degrees, radians}
1871 F S           @r{fraction and symbolic modes}
1872 N             @r{interpret all fields as numbers, use 0 for non-numbers}
1873 T             @r{force text interpretation}
1874 E             @r{keep empty fields in ranges}
1875 @end example
1877 @noindent
1878 In addition, you may provide a @code{printf} format specifier to
1879 reformat the final result.  A few examples:
1881 @example
1882 $1+$2                @r{Sum of first and second field}
1883 $1+$2;%.2f           @r{Same, format result to two decimals}
1884 exp($2)+exp($1)      @r{Math functions can be used}
1885 $0;%.1f              @r{Reformat current cell to 1 decimal}
1886 ($3-32)*5/9          @r{Degrees F -> C conversion}
1887 $c/$1/$cm            @r{Hz -> cm conversion, using @file{constants.el}}
1888 tan($1);Dp3s1        @r{Compute in degrees, precision 3, display SCI 1}
1889 sin($1);Dp3%.1e      @r{Same, but use printf specifier for display}
1890 vmean($2..$7)        @r{Compute column range mean, using vector function}
1891 vmean($2..$7);EN     @r{Same, but treat empty fields as 0}
1892 taylor($3,x=7,2)     @r{taylor series of $3, at x=7, second degree}
1893 @end example
1895 Calc also contains a complete set of logical operations.  For example
1897 @example
1898 if($1<20,teen,string(""))  @r{``teen'' if age $1 less than 20, else empty}
1899 @end example
1901 @node Formula syntax for Lisp, Field formulas, Formula syntax for Calc, The spreadsheet
1902 @subsection Emacs Lisp forms as formulas
1903 @cindex Lisp forms, as table formulas
1905 It is also possible to write a formula in Emacs Lisp; this can be useful
1906 for string manipulation and control structures, if the Calc's
1907 functionality is not enough.  If a formula starts with a single quote
1908 followed by an opening parenthesis, then it is evaluated as a lisp form.
1909 The evaluation should return either a string or a number.  Just as with
1910 @file{calc} formulas, you can specify modes and a printf format after a
1911 semicolon.  With Emacs Lisp forms, you need to be conscious about the way
1912 field references are interpolated into the form.  By default, a
1913 reference will be interpolated as a Lisp string (in double quotes)
1914 containing the field.  If you provide the @samp{N} mode switch, all
1915 referenced elements will be numbers (non-number fields will be zero) and
1916 interpolated as Lisp numbers, without quotes.  If you provide the
1917 @samp{L} flag, all fields will be interpolated literally, without quotes.
1918 I.e., if you want a reference to be interpreted as a string by the Lisp
1919 form, enclose the reference operator itself in double quotes, like
1920 @code{"$3"}.  Ranges are inserted as space-separated fields, so you can
1921 embed them in list or vector syntax.  A few examples, note how the
1922 @samp{N} mode is used when we do computations in lisp.
1924 @example
1925 @r{Swap the first two characters of the content of column 1}
1926   '(concat (substring $1 1 2) (substring $1 0 1) (substring $1 2))
1927 @r{Add columns 1 and 2, equivalent to the Calc's @code{$1+$2}}
1928   '(+ $1 $2);N
1929 @r{Compute the sum of columns 1-4, like Calc's @code{vsum($1..$4)}}
1930   '(apply '+ '($1..$4));N
1931 @end example
1933 @node Field formulas, Column formulas, Formula syntax for Lisp, The spreadsheet
1934 @subsection Field formulas
1935 @cindex field formula
1936 @cindex formula, for individual table field
1938 To assign a formula to a particular field, type it directly into the
1939 field, preceded by @samp{:=}, for example @samp{:=$1+$2}.  When you
1940 press @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in
1941 the field, the formula will be stored as the formula for this field,
1942 evaluated, and the current field replaced with the result.
1944 Formulas are stored in a special line starting with @samp{#+TBLFM:}
1945 directly below the table.  If you typed the equation in the 4th field of
1946 the 3rd data line in the table, the formula will look like
1947 @samp{@@3$4=$1+$2}.  When inserting/deleting/swapping column and rows
1948 with the appropriate commands, @i{absolute references} (but not relative
1949 ones) in stored formulas are modified in order to still reference the
1950 same field.  Of cause this is not true if you edit the table structure
1951 with normal editing commands - then you must fix the equations yourself.
1953 Instead of typing an equation into the field, you may also use the
1954 following command
1956 @table @kbd
1957 @kindex C-u C-c =
1958 @item C-u C-c =
1959 Install a new formula for the current field.  The command prompts for a
1960 formula, with default taken from the @samp{#+TBLFM:} line, applies
1961 it to the current field and stores it.
1962 @end table
1964 @node Column formulas, Editing and debugging formulas, Field formulas, The spreadsheet
1965 @subsection Column formulas
1966 @cindex column formula
1967 @cindex formula, for table column
1969 Often in a table, the same formula should be used for all fields in a
1970 particular column.  Instead of having to copy the formula to all fields
1971 in that column, Org allows to assign a single formula to an entire
1972 column.  If the table contains horizontal separator hlines, everything
1973 before the first such line is considered part of the table @emph{header}
1974 and will not be modified by column formulas.
1976 To assign a formula to a column, type it directly into any field in the
1977 column, preceded by an equal sign, like @samp{=$1+$2}.  When you press
1978 @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in the
1979 field, the formula will be stored as the formula for the current column,
1980 evaluated and the current field replaced with the result.  If the field
1981 contains only @samp{=}, the previously stored formula for this column is
1982 used.  For each column, Org will only remember the most recently
1983 used formula.  In the @samp{TBLFM:} line, column formulas will look like
1984 @samp{$4=$1+$2}.
1986 Instead of typing an equation into the field, you may also use the
1987 following command:
1989 @table @kbd
1990 @kindex C-c =
1991 @item C-c =
1992 Install a new formula for the current column and replace current field with
1993 the result of the formula.  The command prompts for a formula, with default
1994 taken from the @samp{#+TBLFM} line, applies it to the current field and
1995 stores it.  With a numeric prefix argument(e.g. @kbd{C-5 C-c =}) the command
1996 will apply it to that many consecutive fields in the current column.
1997 @end table
1999 @node Editing and debugging formulas, Updating the table, Column formulas, The spreadsheet
2000 @subsection Editing and debugging formulas
2001 @cindex formula editing
2002 @cindex editing, of table formulas
2004 You can edit individual formulas in the minibuffer or directly in the
2005 field.  Org can also prepare a special buffer with all active
2006 formulas of a table.  When offering a formula for editing, Org
2007 converts references to the standard format (like @code{B3} or @code{D&})
2008 if possible.  If you prefer to only work with the internal format (like
2009 @code{@@3$2} or @code{$4}), configure the variable
2010 @code{org-table-use-standard-references}.
2012 @table @kbd
2013 @kindex C-c =
2014 @kindex C-u C-c =
2015 @item C-c =
2016 @itemx C-u C-c =
2017 Edit the formula associated with the current column/field in the
2018 minibuffer.  See @ref{Column formulas} and @ref{Field formulas}.
2019 @kindex C-u C-u C-c =
2020 @item C-u C-u C-c =
2021 Re-insert the active formula (either a
2022 field formula, or a column formula) into the current field, so that you
2023 can edit it directly in the field.  The advantage over editing in the
2024 minibuffer is that you can use the command @kbd{C-c ?}.
2025 @kindex C-c ?
2026 @item C-c ?
2027 While editing a formula in a table field, highlight the field(s)
2028 referenced by the reference at the cursor position in the formula.
2029 @kindex C-c @}
2030 @item C-c @}
2031 Toggle the display of row and column numbers for a table, using
2032 overlays.  These are updated each time the table is aligned, you can
2033 force it with @kbd{C-c C-c}.
2034 @kindex C-c @{
2035 @item C-c @{
2036 Toggle the formula debugger on and off.  See below.
2037 @kindex C-c '
2038 @item C-c '
2039 Edit all formulas for the current table in a special buffer, where the
2040 formulas will be displayed one per line.  If the current field has an
2041 active formula, the cursor in the formula editor will mark it.
2042 While inside the special buffer, Org will automatically highlight
2043 any field or range reference at the cursor position.  You may edit,
2044 remove and add formulas, and use the following commands:
2045 @table @kbd
2046 @kindex C-c C-c
2047 @kindex C-x C-s
2048 @item C-c C-c
2049 @itemx C-x C-s
2050 Exit the formula editor and store the modified formulas.  With @kbd{C-u}
2051 prefix, also apply the new formulas to the entire table.
2052 @kindex C-c C-q
2053 @item C-c C-q
2054 Exit the formula editor without installing changes.
2055 @kindex C-c C-r
2056 @item C-c C-r
2057 Toggle all references in the formula editor between standard (like
2058 @code{B3}) and internal (like @code{@@3$2}).
2059 @kindex @key{TAB}
2060 @item @key{TAB}
2061 Pretty-print or indent lisp formula at point.  When in a line containing
2062 a lisp formula, format the formula according to Emacs Lisp rules.
2063 Another @key{TAB} collapses the formula back again.  In the open
2064 formula, @key{TAB} re-indents just like in Emacs lisp mode.
2065 @kindex M-@key{TAB}
2066 @item M-@key{TAB}
2067 Complete Lisp symbols, just like in Emacs lisp mode.
2068 @kindex S-@key{up}
2069 @kindex S-@key{down}
2070 @kindex S-@key{left}
2071 @kindex S-@key{right}
2072 @item S-@key{up}/@key{down}/@key{left}/@key{right}
2073 Shift the reference at point.  For example, if the reference is
2074 @code{B3} and you press @kbd{S-@key{right}}, it will become @code{C3}.
2075 This also works for relative references, and for hline references.
2076 @kindex M-S-@key{up}
2077 @kindex M-S-@key{down}
2078 @item M-S-@key{up}/@key{down}
2079 Move the test line for column formulas in the Org buffer up and
2080 down.
2081 @kindex M-@key{up}
2082 @kindex M-@key{down}
2083 @item M-@key{up}/@key{down}
2084 Scroll the window displaying the table.
2085 @kindex C-c @}
2086 @item C-c @}
2087 Turn the coordinate grid in the table on and off.
2088 @end table
2089 @end table
2091 Making a table field blank does not remove the formula associated with
2092 the field, because that is stored in a different line (the @samp{TBLFM}
2093 line) - during the next recalculation the field will be filled again.
2094 To remove a formula from a field, you have to give an empty reply when
2095 prompted for the formula, or to edit the @samp{#+TBLFM} line.
2097 @kindex C-c C-c
2098 You may edit the @samp{#+TBLFM} directly and re-apply the changed
2099 equations with @kbd{C-c C-c} in that line, or with the normal
2100 recalculation commands in the table.
2102 @subsubheading Debugging formulas
2103 @cindex formula debugging
2104 @cindex debugging, of table formulas
2105 When the evaluation of a formula leads to an error, the field content
2106 becomes the string @samp{#ERROR}.  If you would like see what is going
2107 on during variable substitution and calculation in order to find a bug,
2108 turn on formula debugging in the @code{Tbl} menu and repeat the
2109 calculation, for example by pressing @kbd{C-u C-u C-c = @key{RET}} in a
2110 field.  Detailed information will be displayed.
2112 @node Updating the table, Advanced features, Editing and debugging formulas, The spreadsheet
2113 @subsection Updating the table
2114 @cindex recomputing table fields
2115 @cindex updating, table
2117 Recalculation of a table is normally not automatic, but needs to be
2118 triggered by a command.  See @ref{Advanced features} for a way to make
2119 recalculation at least semi-automatically.
2121 In order to recalculate a line of a table or the entire table, use the
2122 following commands:
2124 @table @kbd
2125 @kindex C-c *
2126 @item C-c *
2127 Recalculate the current row by first applying the stored column formulas
2128 from left to right, and all field formulas in the current row.
2130 @kindex C-u C-c *
2131 @item C-u C-c *
2132 @kindex C-u C-c C-c
2133 @itemx C-u C-c C-c
2134 Recompute the entire table, line by line.  Any lines before the first
2135 hline are left alone, assuming that these are part of the table header.
2137 @kindex C-u C-u C-c *
2138 @kindex C-u C-u C-c C-c
2139 @item C-u C-u C-c *
2140 @itemx C-u C-u C-c C-c
2141 Iterate the table by recomputing it until no further changes occur.
2142 This may be necessary if some computed fields use the value of other
2143 fields that are computed @i{later} in the calculation sequence.
2144 @end table
2146 @node Advanced features,  , Updating the table, The spreadsheet
2147 @subsection Advanced features
2149 If you want the recalculation of fields to happen automatically, or if
2150 you want to be able to assign @i{names} to fields and columns, you need
2151 to reserve the first column of the table for special marking characters.
2152 @table @kbd
2153 @kindex C-#
2154 @item C-#
2155 Rotate the calculation mark in first column through the states @samp{},
2156 @samp{#}, @samp{*}, @samp{!}, @samp{$}.  The meaning of these characters
2157 is discussed below.  When there is an active region, change all marks in
2158 the region.
2159 @end table
2161 Here is an example of a table that collects exam results of students and
2162 makes use of these features:
2164 @example
2165 @group
2166 |---+---------+--------+--------+--------+-------+------|
2167 |   | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
2168 |---+---------+--------+--------+--------+-------+------|
2169 | ! |         |     P1 |     P2 |     P3 |   Tot |      |
2170 | # | Maximum |     10 |     15 |     25 |    50 | 10.0 |
2171 | ^ |         |     m1 |     m2 |     m3 |    mt |      |
2172 |---+---------+--------+--------+--------+-------+------|
2173 | # | Peter   |     10 |      8 |     23 |    41 |  8.2 |
2174 | # | Sara    |      6 |     14 |     19 |    39 |  7.8 |
2175 | # | Sam     |      2 |      4 |      3 |     9 |  1.8 |
2176 |---+---------+--------+--------+--------+-------+------|
2177 |   | Average |        |        |        |  29.7 |      |
2178 | ^ |         |        |        |        |    at |      |
2179 | $ | max=50  |        |        |        |       |      |
2180 |---+---------+--------+--------+--------+-------+------|
2181 #+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(@@-II..@@-I);%.1f
2182 @end group
2183 @end example
2185 @noindent @b{Important}: Please note that for these special tables,
2186 recalculating the table with @kbd{C-u C-c *} will only affect rows that
2187 are marked @samp{#} or @samp{*}, and fields that have a formula assigned
2188 to the field itself.  The column formulas are not applied in rows with
2189 empty first field.
2191 @cindex marking characters, tables
2192 The marking characters have the following meaning:
2193 @table @samp
2194 @item !
2195 The fields in this line define names for the columns, so that you may
2196 refer to a column as @samp{$Tot} instead of @samp{$6}.
2197 @item ^
2198 This row defines names for the fields @emph{above} the row.  With such
2199 a definition, any formula in the table may use @samp{$m1} to refer to
2200 the value @samp{10}.  Also, if you assign a formula to a names field, it
2201 will be stored as @samp{$name=...}.
2202 @item _
2203 Similar to @samp{^}, but defines names for the fields in the row
2204 @emph{below}.
2205 @item $
2206 Fields in this row can define @emph{parameters} for formulas.  For
2207 example, if a field in a @samp{$} row contains @samp{max=50}, then
2208 formulas in this table can refer to the value 50 using @samp{$max}.
2209 Parameters work exactly like constants, only that they can be defined on
2210 a per-table basis.
2211 @item #
2212 Fields in this row are automatically recalculated when pressing
2213 @key{TAB} or @key{RET} or @kbd{S-@key{TAB}} in this row.  Also, this row
2214 is selected for a global recalculation with @kbd{C-u C-c *}.  Unmarked
2215 lines will be left alone by this command.
2216 @item *
2217 Selects this line for global recalculation with @kbd{C-u C-c *}, but
2218 not for automatic recalculation.  Use this when automatic
2219 recalculation slows down editing too much.
2220 @item
2221 Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}.
2222 All lines that should be recalculated should be marked with @samp{#}
2223 or @samp{*}.
2224 @item /
2225 Do not export this line.  Useful for lines that contain the narrowing
2226 @samp{<N>} markers.
2227 @end table
2229 Finally, just to whet your appetite on what can be done with the
2230 fantastic @file{calc} package, here is a table that computes the Taylor
2231 series of degree @code{n} at location @code{x} for a couple of
2232 functions.
2234 @example
2235 @group
2236 |---+-------------+---+-----+--------------------------------------|
2237 |   | Func        | n | x   | Result                               |
2238 |---+-------------+---+-----+--------------------------------------|
2239 | # | exp(x)      | 1 | x   | 1 + x                                |
2240 | # | exp(x)      | 2 | x   | 1 + x + x^2 / 2                      |
2241 | # | exp(x)      | 3 | x   | 1 + x + x^2 / 2 + x^3 / 6            |
2242 | # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 |
2243 | # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2    |
2244 | * | tan(x)      | 3 | x   | 0.0175 x + 1.77e-6 x^3               |
2245 |---+-------------+---+-----+--------------------------------------|
2246 #+TBLFM: $5=taylor($2,$4,$3);n3
2247 @end group
2248 @end example
2250 @node Hyperlinks, TODO Items, Tables, Top
2251 @chapter Hyperlinks
2252 @cindex hyperlinks
2254 Like HTML, Org provides links inside a file, external links to
2255 other files, Usenet articles, emails, and much more.
2257 @menu
2258 * Link format::                 How links in Org are formatted
2259 * Internal links::              Links to other places in the current file
2260 * External links::              URL-like links to the world
2261 * Handling links::              Creating, inserting and following
2262 * Using links outside Org::     Linking from my C source code?
2263 * Link abbreviations::          Shortcuts for writing complex links
2264 * Search options::              Linking to a specific location
2265 * Custom searches::             When the default search is not enough
2266 @end menu
2268 @node Link format, Internal links, Hyperlinks, Hyperlinks
2269 @section Link format
2270 @cindex link format
2271 @cindex format, of links
2273 Org will recognize plain URL-like links and activate them as
2274 clickable links.  The general link format, however, looks like this:
2276 @example
2277 [[link][description]]       @r{or alternatively}           [[link]]
2278 @end example
2280 Once a link in the buffer is complete (all brackets present), Org
2281 will change the display so that @samp{description} is displayed instead
2282 of @samp{[[link][description]]} and @samp{link} is displayed instead of
2283 @samp{[[link]]}.  Links will be highlighted in the face @code{org-link},
2284 which by default is an underlined face.  You can directly edit the
2285 visible part of a link.  Note that this can be either the @samp{link}
2286 part (if there is no description) or the @samp{description} part.  To
2287 edit also the invisible @samp{link} part, use @kbd{C-c C-l} with the
2288 cursor on the link.
2290 If you place the cursor at the beginning or just behind the end of the
2291 displayed text and press @key{BACKSPACE}, you will remove the
2292 (invisible) bracket at that location.  This makes the link incomplete
2293 and the internals are again displayed as plain text.  Inserting the
2294 missing bracket hides the link internals again.  To show the
2295 internal structure of all links, use the menu entry
2296 @code{Org->Hyperlinks->Literal links}.
2298 @node Internal links, External links, Link format, Hyperlinks
2299 @section Internal links
2300 @cindex internal links
2301 @cindex links, internal
2302 @cindex targets, for links
2304 If the link does not look like a URL, it is considered to be internal in
2305 the current file.  Links such as @samp{[[My Target]]} or @samp{[[My
2306 Target][Find my target]]} lead to a text search in the current file.
2307 The link can be followed with @kbd{C-c C-o} when the cursor is on the
2308 link, or with a mouse click (@pxref{Handling links}).  The preferred
2309 match for such a link is a dedicated target: the same string in double
2310 angular brackets.  Targets may be located anywhere; sometimes it is
2311 convenient to put them into a comment line. For example
2313 @example
2314 # <<My Target>>
2315 @end example
2317 @noindent In HTML export (@pxref{HTML export}), such targets will become
2318 named anchors for direct access through @samp{http} links@footnote{Note
2319 that text before the first headline is usually not exported, so the
2320 first such target should be after the first headline.}.
2322 If no dedicated target exists, Org will search for the words in the
2323 link.  In the above example the search would be for @samp{my target}.
2324 Links starting with a star like @samp{*My Target} restrict the search to
2325 headlines.  When searching, Org mode will first try an exact match, but
2326 then move on to more and more lenient searches.  For example, the link
2327 @samp{[[*My Targets]]} will find any of the following:
2329 @example
2330 ** My targets
2331 ** TODO my targets are bright
2332 ** my 20 targets are
2333 @end example
2335 To insert a link targeting a headline, in-buffer completion can be used.
2336 Just type a star followed by a few optional letters into the buffer and
2337 press @kbd{M-@key{TAB}}.  All headlines in the current buffer will be
2338 offered as completions.  @xref{Handling links}, for more commands
2339 creating links.
2341 Following a link pushes a mark onto Org's own mark ring.  You can
2342 return to the previous position with @kbd{C-c &}.  Using this command
2343 several times in direct succession goes back to positions recorded
2344 earlier.
2346 @menu
2347 * Radio targets::               Make targets trigger links in plain text
2348 @end menu
2350 @node Radio targets,  , Internal links, Internal links
2351 @subsection Radio targets
2352 @cindex radio targets
2353 @cindex targets, radio
2354 @cindex links, radio targets
2356 Org can automatically turn any occurrences of certain target names
2357 in normal text into a link.  So without explicitly creating a link, the
2358 text connects to the target radioing its position.  Radio targets are
2359 enclosed by triple angular brackets.  For example, a target @samp{<<<My
2360 Target>>>} causes each occurrence of @samp{my target} in normal text to
2361 become activated as a link.  The Org file is scanned automatically
2362 for radio targets only when the file is first loaded into Emacs.  To
2363 update the target list during editing, press @kbd{C-c C-c} with the
2364 cursor on or at a target.
2366 @node External links, Handling links, Internal links, Hyperlinks
2367 @section External links
2368 @cindex links, external
2369 @cindex external links
2370 @cindex links, external
2371 @cindex Gnus links
2372 @cindex BBDB links
2373 @cindex IRC links
2374 @cindex URL links
2375 @cindex file links
2376 @cindex VM links
2377 @cindex RMAIL links
2378 @cindex WANDERLUST links
2379 @cindex MH-E links
2380 @cindex USENET links
2381 @cindex SHELL links
2382 @cindex Info links
2383 @cindex elisp links
2385 Org supports links to files, websites, Usenet and email messages,
2386 BBDB database entries and links to both IRC conversations and their
2387 logs.  External links are URL-like locators.  They start with a short
2388 identifying string followed by a colon.  There can be no space after
2389 the colon.  The following list shows examples for each link type.
2391 @example
2392 http://www.astro.uva.nl/~dominik          @r{on the web}
2393 file:/home/dominik/images/jupiter.jpg     @r{file, absolute path}
2394 file:papers/last.pdf                      @r{file, relative path}
2395 news:comp.emacs                           @r{Usenet link}
2396 mailto:adent@@galaxy.net                  @r{Mail link}
2397 vm:folder                                 @r{VM folder link}
2398 vm:folder#id                              @r{VM message link}
2399 vm://myself@@some.where.org/folder#id     @r{VM on remote machine}
2400 wl:folder                                 @r{WANDERLUST folder link}
2401 wl:folder#id                              @r{WANDERLUST message link}
2402 mhe:folder                                @r{MH-E folder link}
2403 mhe:folder#id                             @r{MH-E message link}
2404 rmail:folder                              @r{RMAIL folder link}
2405 rmail:folder#id                           @r{RMAIL message link}
2406 gnus:group                                @r{Gnus group link}
2407 gnus:group#id                             @r{Gnus article link}
2408 bbdb:Richard Stallman                     @r{BBDB link}
2409 irc:/irc.com/#emacs/bob                   @r{IRC link}
2410 shell:ls *.org                            @r{A shell command}
2411 elisp:(find-file-other-frame "Elisp.org") @r{An elisp form to evaluate}
2412 @end example
2414 A link should be enclosed in double brackets and may contain a
2415 descriptive text to be displayed instead of the URL (@pxref{Link
2416 format}), for example:
2418 @example
2419 [[http://www.gnu.org/software/emacs/][GNU Emacs]]
2420 @end example
2422 @noindent
2423 If the description is a file name or URL that points to an image, HTML
2424 export (@pxref{HTML export}) will inline the image as a clickable
2425 button.  If there is no description at all and the link points to an
2426 image,
2427 that image will be inlined into the exported HTML file.
2429 @cindex angular brackets, around links
2430 @cindex plain text external links
2431 Org also finds external links in the normal text and activates them
2432 as links.  If spaces must be part of the link (for example in
2433 @samp{bbdb:Richard Stallman}), or if you need to remove ambiguities
2434 about the end of the link, enclose them in angular brackets.
2436 @node Handling links, Using links outside Org, External links, Hyperlinks
2437 @section Handling links
2438 @cindex links, handling
2440 Org provides methods to create a link in the correct syntax, to
2441 insert it into an Org file, and to follow the link.
2443 @table @kbd
2444 @kindex C-c l
2445 @cindex storing links
2446 @item C-c l
2447 Store a link to the current location.  This is a @emph{global} command
2448 which can be used in any buffer to create a link.  The link will be
2449 stored for later insertion into an Org buffer (see below).  For
2450 Org files, if there is a @samp{<<target>>} at the cursor, the
2451 link points to the target.  Otherwise it points to the current
2452 headline.  For VM, Rmail, Wanderlust, MH-E, Gnus and BBDB buffers, the
2453 link will indicate the current article/entry.  For W3 and W3M buffers,
2454 the link goes to the current URL.  For IRC links, if you set the
2455 variable @code{org-irc-link-to-logs} to non-nil then @kbd{C-c l} will
2456 store a @samp{file:/} style link to the relevant point in the logs for
2457 the current conversation. Otherwise an @samp{irc:/} style link to the
2458 user/channel/server under the point will be stored.  For any other
2459 files, the link will point to the file, with a search string
2460 (@pxref{Search options}) pointing to the contents of the current line.
2461 If there is an active region, the selected words will form the basis
2462 of the search string.  If the automatically created link is not
2463 working correctly or accurately enough, you can write custom functions
2464 to select the search string and to do the search for particular file
2465 types - see @ref{Custom searches}.  The key binding @kbd{C-c l} is
2466 only a suggestion - see @ref{Installation}.
2468 @kindex C-c C-l
2469 @cindex link completion
2470 @cindex completion, of links
2471 @cindex inserting links
2472 @item C-c C-l
2473 Insert a link.  This prompts for a link to be inserted into the buffer.  You
2474 can just type a link, using text for an internal link, or one of the link
2475 type prefixes mentioned in the examples above.  All links stored during the
2476 current session are part of the history for this prompt, so you can access
2477 them with @key{up} and @key{down} (or @kbd{M-p/n}).  Completion, on the other
2478 hand, will help you to insert valid link prefixes like @samp{http:} or
2479 @samp{ftp:}, including the prefixes defined through link abbreviations
2480 (@pxref{Link abbreviations}).  The link will be inserted into the
2481 buffer@footnote{After insertion of a stored link, the link will be removed
2482 from the list of stored links.  To keep it in the list later use, use a
2483 triple @kbd{C-u} prefix argument to @kbd{C-c C-l}, or configure the option
2484 @code{org-keep-stored-link-after-insertion}.}, along with a descriptive text.
2485 If some text was selected when this command is called, the selected text
2486 becomes the default description.@* Note that you don't have to use this
2487 command to insert a link.  Links in Org are plain text, and you can type
2488 or paste them straight into the buffer.  By using this command, the links are
2489 automatically enclosed in double brackets, and you will be asked for the
2490 optional descriptive text.
2492 @c  If the link is a @samp{file:} link and
2493 @c the linked file is located in the same directory as the current file or
2494 @c a subdirectory of it, the path of the file will be inserted relative to
2495 @c the current directory.
2497 @kindex C-u C-c C-l
2498 @cindex file name completion
2499 @cindex completion, of file names
2500 @item C-u C-c C-l
2501 When @kbd{C-c C-l} is called with a @kbd{C-u} prefix argument, a link to
2502 a file will be inserted and you may use file name completion to select
2503 the name of the file.  The path to the file is inserted relative to the
2504 directory of the current org file, if the linked file is in the current
2505 directory or in a sub-directory of it, or if the path is written relative
2506 to the current directory using @samp{../}.  Otherwise an absolute path
2507 is used, if possible with @samp{~/} for your home directory.  You can
2508 force an absolute path with two @kbd{C-u} prefixes.
2510 @item C-c C-l @r{(with cursor on existing link)}
2511 When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit the
2512 link and description parts of the link.
2514 @cindex following links
2515 @kindex C-c C-o
2516 @item C-c C-o
2517 Open link at point.  This will launch a web browser for URLs (using
2518 @command{browse-url-at-point}), run VM/MH-E/Wanderlust/Rmail/Gnus/BBDB
2519 for the corresponding links, and execute the command in a shell link.
2520 When the cursor is on an internal link, this commands runs the
2521 corresponding search.  When the cursor is on a TAG list in a headline,
2522 it creates the corresponding TAGS view.  If the cursor is on a time
2523 stamp, it compiles the agenda for that date.  Furthermore, it will visit
2524 text and remote files in @samp{file:} links with Emacs and select a
2525 suitable application for local non-text files.  Classification of files
2526 is based on file extension only.  See option @code{org-file-apps}.  If
2527 you want to override the default application and visit the file with
2528 Emacs, use a @kbd{C-u} prefix.
2530 @kindex mouse-2
2531 @kindex mouse-1
2532 @item mouse-2
2533 @itemx mouse-1
2534 On links, @kbd{mouse-2} will open the link just as @kbd{C-c C-o}
2535 would.  Under Emacs 22, also @kbd{mouse-1} will follow a link.
2537 @kindex mouse-3
2538 @item mouse-3
2539 Like @kbd{mouse-2}, but force file links to be opened with Emacs, and
2540 internal links to be displayed in another window@footnote{See the
2541 variable @code{org-display-internal-link-with-indirect-buffer}}.
2543 @cindex mark ring
2544 @kindex C-c %
2545 @item C-c %
2546 Push the current position onto the mark ring, to be able to return
2547 easily. Commands following an internal link do this automatically.
2549 @cindex links, returning to
2550 @kindex C-c &
2551 @item C-c &
2552 Jump back to a recorded position.  A position is recorded by the
2553 commands following internal links, and by @kbd{C-c %}.  Using this
2554 command several times in direct succession moves through a ring of
2555 previously recorded positions.
2557 @kindex C-c C-x C-n
2558 @kindex C-c C-x C-p
2559 @cindex links, finding next/previous
2560 @item C-c C-x C-n
2561 @itemx C-c C-x C-p
2562 Move forward/backward to the next link in the buffer.  At the limit of
2563 the buffer, the search fails once, and then wraps around.  The key
2564 bindings for this are really too long, you might want to bind this also
2565 to @kbd{C-n} and @kbd{C-p}
2566 @lisp
2567 (add-hook 'org-load-hook
2568   (lambda ()
2569     (define-key 'org-mode-map "\C-n" 'org-next-link)
2570     (define-key 'org-mode-map "\C-p" 'org-previous-link)))
2571 @end lisp
2572 @end table
2574 @node Using links outside Org, Link abbreviations, Handling links, Hyperlinks
2575 @section Using links outside Org
2577 You can insert and follow links that have Org syntax not only in
2578 Org, but in any Emacs buffer.  For this, you should create two
2579 global commands, like this (please select suitable global keys
2580 yourself):
2582 @lisp
2583 (global-set-key "\C-c L" 'org-insert-link-global)
2584 (global-set-key "\C-c o" 'org-open-at-point-global)
2585 @end lisp
2587 @node Link abbreviations, Search options, Using links outside Org, Hyperlinks
2588 @section Link abbreviations
2589 @cindex link abbreviations
2590 @cindex abbreviation, links
2592 Long URLs can be cumbersome to type, and often many similar links are
2593 needed in a document.  For this you can use link abbreviations.  An
2594 abbreviated link looks like this
2596 @example
2597 [[linkword:tag][description]]
2598 @end example
2600 @noindent
2601 where the tag is optional.  Such abbreviations are resolved according to
2602 the information in the variable @code{org-link-abbrev-alist} that
2603 relates the linkwords to replacement text.  Here is an example:
2605 @lisp
2606 @group
2607 (setq org-link-abbrev-alist
2608   '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
2609     ("google"   . "http://www.google.com/search?q=")
2610     ("ads"      . "http://adsabs.harvard.edu/cgi-bin/
2611                    nph-abs_connect?author=%s&db_key=AST")))
2612 @end group
2613 @end lisp
2615 If the replacement text contains the string @samp{%s}, it will be
2616 replaced with the tag.  Otherwise the tag will be appended to the string
2617 in order to create the link.  You may also specify a function that will
2618 be called with the tag as the only argument to create the link.
2620 With the above setting, you could link to a specific bug with
2621 @code{[[bugzilla:129]]}, search the web for @samp{OrgMode} with
2622 @code{[[google:OrgMode]]} and find out what the Org author is
2623 doing besides Emacs hacking with @code{[[ads:Dominik,C]]}.
2625 If you need special abbreviations just for a single Org buffer, you
2626 can define them in the file with
2628 @example
2629 #+LINK: bugzilla  http://10.1.2.9/bugzilla/show_bug.cgi?id=
2630 #+LINK: google    http://www.google.com/search?q=%s
2631 @end example
2633 @noindent
2634 In-buffer completion @pxref{Completion} can be used after @samp{[} to
2635 complete link abbreviations.
2637 @node Search options, Custom searches, Link abbreviations, Hyperlinks
2638 @section Search options in file links
2639 @cindex search option in file links
2640 @cindex file links, searching
2642 File links can contain additional information to make Emacs jump to a
2643 particular location in the file when following a link.  This can be a
2644 line number or a search option after a double@footnote{For backward
2645 compatibility, line numbers can also follow a single colon.} colon. For
2646 example, when the command @kbd{C-c l} creates a link (@pxref{Handling
2647 links}) to a file, it encodes the words in the current line as a search
2648 string that can be used to find this line back later when following the
2649 link with @kbd{C-c C-o}.
2651 Here is the syntax of the different ways to attach a search to a file
2652 link, together with an explanation:
2654 @example
2655 [[file:~/code/main.c::255]]
2656 [[file:~/xx.org::My Target]]
2657 [[file:~/xx.org::*My Target]]
2658 [[file:~/xx.org::/regexp/]]
2659 @end example
2661 @table @code
2662 @item 255
2663 Jump to line 255.
2664 @item My Target
2665 Search for a link target @samp{<<My Target>>}, or do a text search for
2666 @samp{my target}, similar to the search in internal links, see
2667 @ref{Internal links}.  In HTML export (@pxref{HTML export}), such a file
2668 link will become an HTML reference to the corresponding named anchor in
2669 the linked file.
2670 @item *My Target
2671 In an Org file, restrict search to headlines.
2672 @item /regexp/
2673 Do a regular expression search for @code{regexp}.  This uses the Emacs
2674 command @code{occur} to list all matches in a separate window.  If the
2675 target file is in Org mode, @code{org-occur} is used to create a
2676 sparse tree with the matches.
2677 @c If the target file is a directory,
2678 @c @code{grep} will be used to search all files in the directory.
2679 @end table
2681 As a degenerate case, a file link with an empty file name can be used
2682 to search the current file.  For example, @code{[[file:::find me]]} does
2683 a search for @samp{find me} in the current file, just as
2684 @samp{[[find me]]} would.
2686 @node Custom searches,  , Search options, Hyperlinks
2687 @section Custom Searches
2688 @cindex custom search strings
2689 @cindex search strings, custom
2691 The default mechanism for creating search strings and for doing the
2692 actual search related to a file link may not work correctly in all
2693 cases.  For example, BibTeX database files have many entries like
2694 @samp{year="1993"} which would not result in good search strings,
2695 because the only unique identification for a BibTeX entry is the
2696 citation key.
2698 If you come across such a problem, you can write custom functions to set
2699 the right search string for a particular file type, and to do the search
2700 for the string in the file.  Using @code{add-hook}, these functions need
2701 to be added to the hook variables
2702 @code{org-create-file-search-functions} and
2703 @code{org-execute-file-search-functions}.  See the docstring for these
2704 variables for more information.  Org actually uses this mechanism
2705 for Bib@TeX{} database files, and you can use the corresponding code as
2706 an implementation example.  Search for @samp{BibTeX links} in the source
2707 file.
2709 @node TODO Items, Tags, Hyperlinks, Top
2710 @chapter TODO Items
2711 @cindex TODO items
2713 Org mode does not maintain TODO lists as separate documents.  Instead,
2714 TODO items are an integral part of the notes file, because TODO items
2715 usually come up while taking notes!  With Org mode, simply mark any
2716 entry in a tree as being a TODO item.  In this way, information is not
2717 duplicated, and the entire context from which the TODO item emerged is
2718 always present.
2720 Of course, this technique for managing TODO items scatters them
2721 throughout your notes file.  Org mode compensates for this by providing
2722 methods to give you an overview of all the things that you have to do.
2724 @menu
2725 * TODO basics::                 Marking and displaying TODO entries
2726 * TODO extensions::             Workflow and assignments
2727 * Progress logging::            Dates and notes for progress
2728 * Priorities::                  Some things are more important than others
2729 * Breaking down tasks::         Splitting a task into manageable pieces
2730 * Checkboxes::                  Tick-off lists
2731 @end menu
2733 @node TODO basics, TODO extensions, TODO Items, TODO Items
2734 @section Basic TODO functionality
2736 Any headline becomes a TODO item when it starts with the word
2737 @samp{TODO}, for example:
2739 @example
2740 *** TODO Write letter to Sam Fortune
2741 @end example
2743 @noindent
2744 The most important commands to work with TODO entries are:
2746 @table @kbd
2747 @kindex C-c C-t
2748 @cindex cycling, of TODO states
2749 @item C-c C-t
2750 Rotate the TODO state of the current item among
2752 @example
2753 ,-> (unmarked) -> TODO -> DONE --.
2754 '--------------------------------'
2755 @end example
2757 The same rotation can also be done ``remotely'' from the timeline and
2758 agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
2760 @kindex C-u C-c C-t
2761 @item C-u C-c C-t
2762 Select a specific keyword using completion or (if it has been set up)
2763 the fast selection interface.  For the latter, you need to assign keys
2764 to TODO states, see @ref{Per-file keywords} and @ref{Setting tags} for
2765 more information.
2767 @kindex S-@key{right}
2768 @kindex S-@key{left}
2769 @item S-@key{right}
2770 @itemx S-@key{left}
2771 Select the following/preceding TODO state, similar to cycling.  Useful
2772 mostly if more than two TODO states are possible (@pxref{TODO
2773 extensions}).
2774 @kindex C-c C-v
2775 @kindex C-c / t
2776 @cindex sparse tree, for TODO
2777 @item C-c C-v
2778 @itemx C-c / t
2779 View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}).  Folds
2780 the entire buffer, but shows all TODO items and the headings hierarchy
2781 above them.  With a prefix argument, search for a specific TODO.  You will be
2782 prompted for the keyword, and you can also give a list of keywords like
2783 @code{KWD1|KWD2|...}.  With numeric prefix argument N, show the tree for the
2784 Nth keyword in the variable @code{org-todo-keywords}.  With two prefix
2785 arguments, find all TODO and DONE entries.
2786 @kindex C-c a t
2787 @item C-c a t
2788 Show the global TODO list.  Collects the TODO items from all agenda
2789 files (@pxref{Agenda Views}) into a single buffer.  The new buffer will
2790 be in @code{agenda-mode}, which provides commands to examine and
2791 manipulate the TODO entries from the new buffer (@pxref{Agenda
2792 commands}).  @xref{Global TODO list}, for more information.
2793 @kindex S-M-@key{RET}
2794 @item S-M-@key{RET}
2795 Insert a new TODO entry below the current one.
2796 @end table
2798 @node TODO extensions, Progress logging, TODO basics, TODO Items
2799 @section Extended use of TODO keywords
2800 @cindex extended TODO keywords
2802 By default, marked TODO entries have one of only two states: TODO and
2803 DONE.  Org mode allows you to classify TODO items in more complex ways
2804 with @emph{TODO keywords} (stored in @code{org-todo-keywords}).  With
2805 special setup, the TODO keyword system can work differently in different
2806 files.
2808 Note that @i{tags} are another way to classify headlines in general and
2809 TODO items in particular (@pxref{Tags}).
2811 @menu
2812 * Workflow states::             From TODO to DONE in steps
2813 * TODO types::                  I do this, Fred does the rest
2814 * Multiple sets in one file::   Mixing it all, and still finding your way
2815 * Fast access to TODO states::  Single letter selection of a state
2816 * Per-file keywords::           Different files, different requirements
2817 * Faces for TODO keywords::     Highlighting states
2818 @end menu
2820 @node Workflow states, TODO types, TODO extensions, TODO extensions
2821 @subsection TODO keywords as workflow states
2822 @cindex TODO workflow
2823 @cindex workflow states as TODO keywords
2825 You can use TODO keywords to indicate different @emph{sequential} states
2826 in the process of working on an item, for example@footnote{Changing
2827 this variable only becomes effective after restarting Org mode in a
2828 buffer.}:
2830 @lisp
2831 (setq org-todo-keywords
2832   '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
2833 @end lisp
2835 The vertical bar separates the TODO keywords (states that @emph{need
2836 action}) from the DONE states (which need @emph{no further action}.  If
2837 you don't provide the separator bar, the last state is used as the DONE
2838 state.
2839 @cindex completion, of TODO keywords
2840 With this setup, the command @kbd{C-c C-t} will cycle an entry from TODO
2841 to FEEDBACK, then to VERIFY, and finally to DONE and DELEGATED.  You may
2842 also use a numeric prefix argument to quickly select a specific state.  For
2843 example @kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
2844 Or you can use @kbd{S-left} to go backward through the sequence.  If you
2845 define many keywords, you can use in-buffer completion
2846 (@pxref{Completion}) or even a special one-key selection scheme
2847 (@pxref{Fast access to TODO states}) to insert these words into the
2848 buffer.  Changing a TODO state can be logged with a timestamp, see
2849 @ref{Tracking TODO state changes} for more information.
2851 @node TODO types, Multiple sets in one file, Workflow states, TODO extensions
2852 @subsection TODO keywords as types
2853 @cindex TODO types
2854 @cindex names as TODO keywords
2855 @cindex types as TODO keywords
2857 The second possibility is to use TODO keywords to indicate different
2858 @emph{types} of action items.  For example, you might want to indicate
2859 that items are for ``work'' or ``home''.  Or, when you work with several
2860 people on a single project, you might want to assign action items
2861 directly to persons, by using their names as TODO keywords.  This would
2862 be set up like this:
2864 @lisp
2865 (setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))
2866 @end lisp
2868 In this case, different keywords do not indicate a sequence, but rather
2869 different types.  So the normal work flow would be to assign a task to a
2870 person, and later to mark it DONE.  Org mode supports this style by adapting
2871 the workings of the command @kbd{C-c C-t}@footnote{This is also true for the
2872 @kbd{t} command in the timeline and agenda buffers.}.  When used several
2873 times in succession, it will still cycle through all names, in order to first
2874 select the right type for a task.  But when you return to the item after some
2875 time and execute @kbd{C-c C-t} again, it will switch from any name directly
2876 to DONE.  Use prefix arguments or completion to quickly select a specific
2877 name.  You can also review the items of a specific TODO type in a sparse tree
2878 by using a numeric prefix to @kbd{C-c C-v}.  For example, to see all things
2879 Lucy has to do, you would use @kbd{C-3 C-c C-v}.  To collect Lucy's items
2880 from all agenda files into a single buffer, you would use the numeric prefix
2881 argument as well when creating the global TODO list: @kbd{C-3 C-c t}.
2883 @node Multiple sets in one file, Fast access to TODO states, TODO types, TODO extensions
2884 @subsection Multiple keyword sets in one file
2885 @cindex TODO keyword sets
2887 Sometimes you may want to use different sets of TODO keywords in
2888 parallel.  For example, you may want to have the basic
2889 @code{TODO}/@code{DONE}, but also a workflow for bug fixing, and a
2890 separate state indicating that an item has been canceled (so it is not
2891 DONE, but also does not require action).  Your setup would then look
2892 like this:
2894 @lisp
2895 (setq org-todo-keywords
2896       '((sequence "TODO" "|" "DONE")
2897         (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED")
2898         (sequence "|" "CANCELED")))
2899 @end lisp
2901 The keywords should all be different, this helps Org mode to keep track
2902 of which subsequence should be used for a given entry.  In this setup,
2903 @kbd{C-c C-t} only operates within a subsequence, so it switches from
2904 @code{DONE} to (nothing) to @code{TODO}, and from @code{FIXED} to
2905 (nothing) to @code{REPORT}.  Therefore you need a mechanism to initially
2906 select the correct sequence.  Besides the obvious ways like typing a
2907 keyword or using completion, you may also apply the following commands:
2909 @table @kbd
2910 @kindex C-S-@key{right}
2911 @kindex C-S-@key{left}
2912 @item C-S-@key{right}
2913 @itemx C-S-@key{left}
2914 These keys jump from one TODO subset to the next.  In the above example,
2915 @kbd{C-S-@key{right}} would jump from @code{TODO} or @code{DONE} to
2916 @code{REPORT}, and any of the words in the second row to @code{CANCELED}.
2917 @kindex S-@key{right}
2918 @kindex S-@key{left}
2919 @item S-@key{right}
2920 @itemx S-@key{left}
2921 @kbd{S-@key{<left>}} and @kbd{S-@key{<right>}} and walk through
2922 @emph{all} keywords from all sets, so for example @kbd{S-@key{<right>}}
2923 would switch from @code{DONE} to @code{REPORT} in the example above.
2924 @end table
2926 @node Fast access to TODO states, Per-file keywords, Multiple sets in one file, TODO extensions
2927 @subsection Fast access to TODO states
2929 If you would like to quickly change an entry to an arbitrary TODO state
2930 instead of cycling through the states, you can set up keys for
2931 single-letter access to the states.  This is done by adding the section
2932 key after each keyword, in parenthesis.  For example:
2934 @lisp
2935 (setq org-todo-keywords
2936       '((sequence "TODO(t)" "|" "DONE(d)")
2937         (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
2938         (sequence "|" "CANCELED(c)")))
2939 @end lisp
2941 If you then press @code{C-u C-c C-t} followed by the selection key, the
2942 entry will be switched to this state.  @key{SPC} can be used to remove
2943 any TODO keyword from an entry.  Should you like this way of selecting
2944 TODO states a lot, you might want to set the variable
2945 @code{org-use-fast-todo-selection} to @code{t} and make this behavior
2946 the default.  Check also the variable
2947 @code{org-fast-tag-selection-include-todo}, it allows to change the TODO
2948 state through the tags interface (@pxref{Setting tags}), in case you
2949 like to mingle the two concepts.
2951 @node Per-file keywords, Faces for TODO keywords, Fast access to TODO states, TODO extensions
2952 @subsection Setting up keywords for individual files
2953 @cindex keyword options
2954 @cindex per-file keywords
2956 It can be very useful to use different aspects of the TODO mechanism in
2957 different files.  For file-local settings, you need to add special lines
2958 to the file which set the keywords and interpretation for that file
2959 only.  For example, to set one of the two examples discussed above, you
2960 need one of the following lines, starting in column zero anywhere in the
2961 file:
2963 @example
2964 #+SEQ_TODO: TODO FEEDBACK VERIFY | DONE CANCELED
2965 @end example
2967 @example
2968 #+TYP_TODO: Fred Sara Lucy Mike | DONE
2969 @end example
2971 A setup for using several sets in parallel would be:
2973 @example
2974 #+SEQ_TODO: TODO | DONE
2975 #+SEQ_TODO: REPORT BUG KNOWNCAUSE | FIXED
2976 #+SEQ_TODO: | CANCELED
2977 @end example
2979 @cindex completion, of option keywords
2980 @kindex M-@key{TAB}
2981 @noindent To make sure you are using the correct keyword, type
2982 @samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
2984 @cindex DONE, final TODO keyword
2985 Remember that the keywords after the vertical bar (or the last keyword
2986 if no bar is there) must always mean that the item is DONE (although you
2987 may use a different word).  After changing one of these lines, use
2988 @kbd{C-c C-c} with the cursor still in the line to make the changes
2989 known to Org mode@footnote{Org mode parses these lines only when
2990 Org mode is activated after visiting a file.  @kbd{C-c C-c} with the
2991 cursor in a line starting with @samp{#+} is simply restarting Org mode
2992 for the current buffer.}.
2994 @node Faces for TODO keywords,  , Per-file keywords, TODO extensions
2995 @subsection Faces for TODO keywords
2996 @cindex faces, for TODO keywords
2998 Org mode highlights TODO keywords with special faces: @code{org-todo}
2999 for keywords indicating that an item still has to be acted upon, and
3000 @code{org-done} for keywords indicating that an item is finished.  If
3001 you are using more than 2 different states, you might want to use
3002 special faces for some of them.  This can be done using the variable
3003 @code{org-todo-keyword-faces}.  For example:
3005 @lisp
3006 (setq org-todo-keyword-faces
3007       '(("TODO"      . org-warning)
3008         ("DEFERRED"  . shadow)
3009         ("CANCELED"  . (:foreground "blue" :weight bold))))
3010 @end lisp
3012 While using a list with face properties as shown for CANCELED
3013 @emph{should} work, this does not aways seem to be the case.  If
3014 necessary, define a special face and use that.
3016 @page
3017 @node Progress logging, Priorities, TODO extensions, TODO Items
3018 @section Progress logging
3019 @cindex progress logging
3020 @cindex logging, of progress
3022 Org mode can automatically record a time stamp and possibly a note when
3023 you mark a TODO item as DONE, or even each time you change the state of
3024 a TODO item.  This system is highly configurable, settings can be on a
3025 per-keyword basis and can be localized to a file or even a subtree.  For
3026 information on how to clock working time for a task, see @ref{Clocking
3027 work time}.
3029 @menu
3030 * Closing items::               When was this entry marked DONE?
3031 * Tracking TODO state changes::  When did the status change?
3032 @end menu
3034 @node Closing items, Tracking TODO state changes, Progress logging, Progress logging
3035 @subsection Closing items
3037 The most basic logging is to keep track of @emph{when} a certain TODO
3038 item was finished.  This is achieved with@footnote{The corresponding
3039 in-buffer setting is: @code{#+STARTUP: logdone}}.
3041 @lisp
3042 (setq org-log-done 'time)
3043 @end lisp
3045 @noindent
3046 Then each time you turn an entry from a TODO (not-done) state into any
3047 of the DONE states, a line @samp{CLOSED: [timestamp]} will be inserted
3048 just after the headline.  If you turn the entry back into a TODO item
3049 through further state cycling, that line will be removed again.  If you
3050 want to record a note along with the timestamp, use@footnote{The
3051 corresponding in-buffer setting is: @code{#+STARTUP: lognotedone}}
3053 @lisp
3054 (setq org-log-done 'note)
3055 @end lisp
3057 @noindent
3058 You will then be prompted for a note, and that note will be stored below
3059 the entry with a @samp{Closing Note} heading.
3061 In the timeline (@pxref{Timeline}) and in the agenda
3062 (@pxref{Weekly/daily agenda}), you can then use the @kbd{l} key to
3063 display the TODO items with a @samp{CLOSED} timestamp on each day,
3064 giving you an overview of what has been done.
3066 @node Tracking TODO state changes,  , Closing items, Progress logging
3067 @subsection Tracking TODO state changes
3069 When TODO keywords are used as workflow states (@pxref{Workflow
3070 states}), you might want to keep track of when a state change occurred
3071 and maybe take a note about this change.  Since it is normally too much
3072 to record a note for every state, Org mode expects configuration on a
3073 per-keyword basis for this.  This is achieved by adding special markers
3074 @samp{!} (for a time stamp) and @samp{@@} (for a note) in parenthesis
3075 after each keyword.  For example, with the setting
3077 @lisp
3078 (setq org-todo-keywords
3079   '((sequence "TODO(t)" "WAIT(w@@/!)" "|" "DONE(d!)" "CANCELED(c@@)")))
3080 @end lisp
3082 @noindent
3083 you not only define global TODO keywords and fast access keys, but also
3084 request that a time is recorded when the entry is turned into
3085 DONE@footnote{It is possible that Org mode will record two time stamps
3086 when you are using both @code{org-log-done} and state change logging.
3087 However, it will never prompt for two notes - if you have configured
3088 both, the state change recording note will take precedence and cancel
3089 the @samp{Closing Note}.}, and that a note is recorded when switching to
3090 WAIT or CANCELED.  The setting for WAIT is even more special: The
3091 @samp{!} after the slash means that in addition to the note taken when
3092 entering the state, a time stamp should be recorded when @i{leaving} the
3093 WAIT state, if and only if the @i{target} state does not configure
3094 logging for entering it.  So it has no effect when switching from WAIT
3095 to DONE, because DONE is configured to record a timestamp only.  But
3096 when switching from WAIT back to TODO, the @samp{/!} in the WAIT
3097 setting now triggers a timestamp even though TODO has no logging
3098 configured.
3100 You can use the exact same syntax for setting logging preferences local
3101 to a buffer:
3102 @example
3103 #+SEQ_TODO: TODO(t) WAIT(w@@/!) | DONE(d!) CANCELED(c@@)
3104 @end example
3106 In order to define logging settings that are local to a subtree or a
3107 single item, define a LOGGING property in this entry.  Any non-empty
3108 LOGGING property resets all logging settings to nil.  You may then turn
3109 on logging for this specific tree using STARTUP keywords like
3110 @code{lognotedone} or @code{logrepeat}, as well as adding state specific
3111 settings like @code{TODO(!)}.  For example
3113 @example
3114 * TODO Log each state with only a time
3115   :PROPERTIES:
3116   :LOGGING: TODO(!) WAIT(!) DONE(!) CANCELED(!)
3117   :END:
3118 * TODO Only log when switching to WAIT, and when repeating
3119   :PROPERTIES:
3120   :LOGGING: WAIT(@@) logrepeat
3121   :END:
3122 * TODO No logging at all
3123   :PROPERTIES:
3124   :LOGGING: nil
3125   :END:
3126 @end example
3129 @node Priorities, Breaking down tasks, Progress logging, TODO Items
3130 @section Priorities
3131 @cindex priorities
3133 If you use Org mode extensively, you may end up enough TODO items that
3134 it starts to make sense to prioritize them.  Prioritizing can be done by
3135 placing a @emph{priority cookie} into the headline of a TODO item, like
3136 this
3138 @example
3139 *** TODO [#A] Write letter to Sam Fortune
3140 @end example
3142 @noindent
3143 By default, Org mode supports three priorities: @samp{A}, @samp{B}, and
3144 @samp{C}.  @samp{A} is the highest priority.  An entry without a cookie
3145 is treated as priority @samp{B}.  Priorities make a difference only in
3146 the agenda (@pxref{Weekly/daily agenda}); outside the agenda, they have
3147 no inherent meaning to Org mode.
3149 Priorities can be attached to any outline tree entries; they do not need
3150 to be TODO items.
3152 @table @kbd
3153 @kindex @kbd{C-c ,}
3154 @item @kbd{C-c ,}
3155 Set the priority of the current headline.  The command prompts for a
3156 priority character @samp{A}, @samp{B} or @samp{C}.  When you press
3157 @key{SPC} instead, the priority cookie is removed from the headline.
3158 The priorities can also be changed ``remotely'' from the timeline and
3159 agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
3161 @kindex S-@key{up}
3162 @kindex S-@key{down}
3163 @item S-@key{up}
3164 @itemx S-@key{down}
3165 Increase/decrease priority of current headline@footnote{See also the
3166 option @code{org-priority-start-cycle-with-default'}.}.  Note that these
3167 keys are also used to modify time stamps (@pxref{Creating timestamps}).
3168 Furthermore, these keys are also used by CUA mode (@pxref{Conflicts}).
3169 @end table
3171 You can change the range of allowed priorities by setting the variables
3172 @code{org-highest-priority}, @code{org-lowest-priority}, and
3173 @code{org-default-priority}.  For an individual buffer, you may set
3174 these values (highest, lowest, default) like this (please make sure that
3175 the highest priority is earlier in the alphabet than the lowest
3176 priority):
3178 @example
3179 #+PRIORITIES: A C B
3180 @end example
3182 @node Breaking down tasks, Checkboxes, Priorities, TODO Items
3183 @section Breaking tasks down into subtasks
3184 @cindex tasks, breaking down
3186 It is often advisable to break down large tasks into smaller, manageable
3187 subtasks.  You can do this by creating an outline tree below a TODO item,
3188 with detailed subtasks on the tree@footnote{To keep subtasks out of the
3189 global TODO list, see the @code{org-agenda-todo-list-sublevels}.}.  To keep
3190 the overview over the fraction of subtasks that are already completed, insert
3191 either @samp{[/]} or @samp{[%]} anywhere in the headline.  These cookies will
3192 be updates each time the todo status of a child changes.  For example:
3194 @example
3195 * Organize Party [33%]
3196 ** TODO Call people [1/2]
3197 *** TODO Peter
3198 *** DONE Sarah
3199 ** TODO Buy food
3200 ** DONE Talk to neighbor
3201 @end example
3203 If you would like a TODO entry to automatically change to DONE when all
3204 chilrden are done, you can use the following setup:
3206 @example
3207 (defun org-summary-todo (n-done n-not-done)
3208   "Switch entry to DONE when all subentries are done, to TODO otherwise."
3209   (let (org-log-done org-log-states)   ; turn off logging
3210     (org-todo (if (= n-not-done 0) "DONE" "TODO"))))
3212 (add-hook 'org-after-todo-statistics-hook 'org-summary-todo)
3213 @end example
3216 Another possibility is the use of checkboxes to identify (a hierarchy of) a
3217 large number of subtasks (@pxref{Checkboxes}).
3220 @node Checkboxes,  , Breaking down tasks, TODO Items
3221 @section Checkboxes
3222 @cindex checkboxes
3224 Every item in a plain list (@pxref{Plain lists}) can be made into a
3225 checkbox by starting it with the string @samp{[ ]}.  This feature is
3226 similar to TODO items (@pxref{TODO Items}), but is more lightweight.
3227 Checkboxes are not included into the global TODO list, so they are often
3228 great to split a task into a number of simple steps.  Or you can use
3229 them in a shopping list.  To toggle a checkbox, use @kbd{C-c C-c}, or
3230 use the mouse (thanks to Piotr Zielinski's @file{org-mouse.el}).
3232 Here is an example of a checkbox list.
3234 @example
3235 * TODO Organize party [2/4]
3236   - [-] call people [1/3]
3237     - [ ] Peter
3238     - [X] Sarah
3239     - [ ] Sam
3240   - [X] order food
3241   - [ ] think about what music to play
3242   - [X] talk to the neighbors
3243 @end example
3245 Checkboxes work hierarchically, so if a checkbox item has children that
3246 are checkboxes, toggling one of the children checkboxes will make the
3247 parent checkbox reflect if none, some, or all of the children are
3248 checked.
3250 @cindex statistics, for checkboxes
3251 @cindex checkbox statistics
3252 The @samp{[2/4]} and @samp{[1/3]} in the first and second line are
3253 cookies indicating how many checkboxes present in this entry have been
3254 checked off, and the total number of checkboxes are present.  This can
3255 give you an idea on how many checkboxes remain, even without opening a
3256 folded entry.  The cookies can be placed into a headline or into (the
3257 first line of) a plain list item. Each cookie covers all checkboxes
3258 structurally below the headline/item on which the cookie appear.  You
3259 have to insert the cookie yourself by typing either @samp{[/]} or
3260 @samp{[%]}.  With @samp{[/]} you get an @samp{n out of m} result, as in
3261 the examples above.  With @samp{[%]} you get information about the
3262 percentage of checkboxes checked (in the above example, this would be
3263 @samp{[50%]} and @samp{[33%]}, respectively).
3265 @noindent The following commands work with checkboxes:
3267 @table @kbd
3268 @kindex C-c C-c
3269 @item C-c C-c
3270 Toggle checkbox at point.  With a prefix argument, set it to @samp{[-]},
3271 which is considered to be an intermediate state.
3272 @kindex C-c C-x C-b
3273 @item C-c C-x C-b
3274 Toggle checkbox at point.
3275 @itemize @minus
3276 @item
3277 If there is an active region, toggle the first checkbox in the region
3278 and set all remaining boxes to the same status as the first.  If you
3279 want to toggle all boxes in the region independently, use a prefix
3280 argument.
3281 @item
3282 If the cursor is in a headline, toggle checkboxes in the region between
3283 this headline and the next (so @emph{not} the entire subtree).
3284 @item
3285 If there is no active region, just toggle the checkbox at point.
3286 @end itemize
3287 @kindex M-S-@key{RET}
3288 @item M-S-@key{RET}
3289 Insert a new item with a checkbox.
3290 This works only if the cursor is already in a plain list item
3291 (@pxref{Plain lists}).
3292 @kindex C-c #
3293 @item C-c #
3294 Update the checkbox statistics in the current outline entry.  When
3295 called with a @kbd{C-u} prefix, update the entire file.  Checkbox
3296 statistic cookies are updated automatically if you toggle checkboxes
3297 with @kbd{C-c C-c} and make new ones with @kbd{M-S-@key{RET}}.  If you
3298 delete boxes or add/change them by hand, use this command to get things
3299 back into synch.  Or simply toggle any checkbox twice with @kbd{C-c C-c}.
3300 @end table
3302 @node Tags, Properties and Columns, TODO Items, Top
3303 @chapter Tags
3304 @cindex tags
3305 @cindex headline tagging
3306 @cindex matching, tags
3307 @cindex sparse tree, tag based
3309 An excellent way to implement labels and contexts for cross-correlating
3310 information is to assign @i{tags} to headlines.  Org mode has extensive
3311 support for tags.
3313 Every headline can contain a list of tags; they occur at the end of the
3314 headline.  Tags are normal words containing letters, numbers, @samp{_},
3315 and @samp{@@}.  Tags must be preceded and followed by a single colon,
3316 e.g., @samp{:WORK:}.  Several tags can be specified, as in
3317 @samp{:work:URGENT:}.
3319 @menu
3320 * Tag inheritance::             Tags use the tree structure of the outline
3321 * Setting tags::                How to assign tags to a headline
3322 * Tag searches::                Searching for combinations of tags
3323 @end menu
3325 @node Tag inheritance, Setting tags, Tags, Tags
3326 @section Tag inheritance
3327 @cindex tag inheritance
3328 @cindex inheritance, of tags
3329 @cindex sublevels, inclusion into tags match
3331 @i{Tags} make use of the hierarchical structure of outline trees.  If a
3332 heading has a certain tag, all subheadings will inherit the tag as
3333 well.  For example, in the list
3335 @example
3336 * Meeting with the French group      :work:
3337 ** Summary by Frank                  :boss:notes:
3338 *** TODO Prepare slides for him      :action:
3339 @end example
3341 @noindent
3342 the final heading will have the tags @samp{:work:}, @samp{:boss:},
3343 @samp{:notes:}, and @samp{:action:} even though the final heading is not
3344 explicitly marked with those tags.  You can also set tags that all entries in
3345 a file should inherit as if these tags would be defined in a hypothetical
3346 level zero that surounds the entire file.
3348 @example
3349 #+FILETAGS: :Peter:Boss:Secret:
3350 @end example
3352 @noindent
3353 To limit tag inheritance to specific tags, or to turn it off entirely, use
3354 the variable @code{org-use-tag-inheritance}.
3356 When a headline matches during a tags search while tag inheritance is turned
3357 on, all the sublevels in the same tree will match as well@footnote{This is
3358 only true if the the search does not involve more complex tests including
3359 properties (@pxref{Property searches}).}.  The list of matches may then
3360 become very long.  If you only want to see the first tags match in a subtree,
3361 configure the variable @code{org-tags-match-list-sublevels}.
3363 @node Setting tags, Tag searches, Tag inheritance, Tags
3364 @section Setting tags
3365 @cindex setting tags
3366 @cindex tags, setting
3368 @kindex M-@key{TAB}
3369 Tags can simply be typed into the buffer at the end of a headline.
3370 After a colon, @kbd{M-@key{TAB}} offers completion on tags.  There is
3371 also a special command for inserting tags:
3373 @table @kbd
3374 @kindex C-c C-c
3375 @item C-c C-c
3376 @cindex completion, of tags
3377 Enter new tags for the current headline.  Org mode will either offer
3378 completion or a special single-key interface for setting tags, see
3379 below.  After pressing @key{RET}, the tags will be inserted and aligned
3380 to @code{org-tags-column}.  When called with a @kbd{C-u} prefix, all
3381 tags in the current buffer will be aligned to that column, just to make
3382 things look nice.  TAGS are automatically realigned after promotion,
3383 demotion, and TODO state changes (@pxref{TODO basics}).
3384 @end table
3386 Org will support tag insertion based on a @emph{list of tags}.  By
3387 default this list is constructed dynamically, containing all tags
3388 currently used in the buffer.  You may also globally specify a hard list
3389 of tags with the variable @code{org-tag-alist}.  Finally you can set
3390 the default tags for a given file with lines like
3392 @example
3393 #+TAGS: @@work @@home @@tennisclub
3394 #+TAGS: laptop car pc sailboat
3395 @end example
3397 If you have globally defined your preferred set of tags using the
3398 variable @code{org-tag-alist}, but would like to use a dynamic tag list
3399 in a specific file, add an empty TAGS option line to that file:
3401 @example
3402 #+TAGS:
3403 @end example
3405 By default Org mode uses the standard minibuffer completion facilities for
3406 entering tags.  However, it also implements another, quicker, tag selection
3407 method called @emph{fast tag selection}.  This allows you to select and
3408 deselect tags with just a single key press.  For this to work well you should
3409 assign unique letters to most of your commonly used tags.  You can do this
3410 globally by configuring the variable @code{org-tag-alist} in your
3411 @file{.emacs} file.  For example, you may find the need to tag many items in
3412 different files with @samp{:@@home:}.  In this case you can set something
3413 like:
3415 @lisp
3416 (setq org-tag-alist '(("@@work" . ?w) ("@@home" . ?h) ("laptop" . ?l)))
3417 @end lisp
3419 @noindent If the tag is only relevant to the file you are working on then you
3420 can, instead, set the TAGS option line as:
3422 @example
3423 #+TAGS: @@work(w)  @@home(h)  @@tennisclub(t)  laptop(l)  pc(p)
3424 @end example
3426 @noindent
3427 You can also group together tags that are mutually exclusive.  By using
3428 braces, as in:
3430 @example
3431 #+TAGS: @{ @@work(w)  @@home(h)  @@tennisclub(t) @}  laptop(l)  pc(p)
3432 @end example
3434 @noindent you indicate that at most one of @samp{@@work}, @samp{@@home},
3435 and @samp{@@tennisclub} should be selected.  Multiple such groups are allowed.
3437 @noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
3438 these lines to activate any changes.
3440 @noindent
3441 To set these mutually exclusive groups in the variable @code{org-mode-alist}
3442 you must use the dummy tags @code{:startgroup} and @code{:endgroup} instead
3443 of the braces.  The previous example would be set globally by the following
3444 configuration:
3446 @lisp
3447 (setq org-tag-alist '((:startgroup . nil)
3448                       ("@@work" . ?w) ("@@home" . ?h)
3449                       ("@@tennisclub" . ?t)
3450                       (:endgroup . nil)
3451                       ("laptop" . ?l) ("pc" . ?p)))
3452 @end lisp
3454 If at least one tag has a selection key then pressing @kbd{C-c C-c} will
3455 automatically present you with a special interface, listing inherited tags,
3456 the tags of the current headline, and a list of all valid tags with
3457 corresponding keys@footnote{Keys will automatically be assigned to tags which
3458 have no configured keys.}.  In this interface, you can use the following
3459 keys:
3461 @table @kbd
3462 @item a-z...
3463 Pressing keys assigned to tags will add or remove them from the list of
3464 tags in the current line.  Selecting a tag in a group of mutually
3465 exclusive tags will turn off any other tags from that group.
3466 @kindex @key{TAB}
3467 @item @key{TAB}
3468 Enter a tag in the minibuffer, even if the tag is not in the predefined
3469 list.  You will be able to complete on all tags present in the buffer.
3470 @kindex @key{SPC}
3471 @item @key{SPC}
3472 Clear all tags for this line.
3473 @kindex @key{RET}
3474 @item @key{RET}
3475 Accept the modified set.
3476 @item C-g
3477 Abort without installing changes.
3478 @item q
3479 If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}.
3480 @item !
3481 Turn off groups of mutually exclusive tags.  Use this to (as an
3482 exception) assign several tags from such a group.
3483 @item C-c
3484 Toggle auto-exit after the next change (see below).
3485 If you are using expert mode, the first @kbd{C-c} will display the
3486 selection window.
3487 @end table
3489 @noindent
3490 This method lets you assign tags to a headline with very few keys.  With
3491 the above setup, you could clear the current tags and set @samp{@@home},
3492 @samp{laptop} and @samp{pc} tags with just the following keys: @kbd{C-c
3493 C-c @key{SPC} h l p @key{RET}}.  Switching from @samp{@@home} to
3494 @samp{@@work} would be done with @kbd{C-c C-c w @key{RET}} or
3495 alternatively with @kbd{C-c C-c C-c w}.  Adding the non-predefined tag
3496 @samp{Sarah} could be done with @kbd{C-c C-c @key{TAB} S a r a h
3497 @key{RET} @key{RET}}.
3499 If you find that most of the time, you need only a single key press to
3500 modify your list of tags, set the variable
3501 @code{org-fast-tag-selection-single-key}.  Then you no longer have to
3502 press @key{RET} to exit fast tag selection - it will immediately exit
3503 after the first change.  If you then occasionally need more keys, press
3504 @kbd{C-c} to turn off auto-exit for the current tag selection process
3505 (in effect: start selection with @kbd{C-c C-c C-c} instead of @kbd{C-c
3506 C-c}).  If you set the variable to the value @code{expert}, the special
3507 window is not even shown for single-key tag selection, it comes up only
3508 when you press an extra @kbd{C-c}.
3510 @node Tag searches,  , Setting tags, Tags
3511 @section Tag searches
3512 @cindex tag searches
3513 @cindex searching for tags
3515 Once a system of tags has been set up, it can be used to collect related
3516 information into special lists.
3518 @table @kbd
3519 @kindex C-c \
3520 @kindex C-c / T
3521 @item C-c \
3522 @itemx C-c / T
3523 Create a sparse tree with all headlines matching a tags search.  With a
3524 @kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
3525 @kindex C-c a m
3526 @item C-c a m
3527 Create a global list of tag matches from all agenda files.
3528 @xref{Matching tags and properties}.
3529 @kindex C-c a M
3530 @item C-c a M
3531 Create a global list of tag matches from all agenda files, but check
3532 only TODO items and force checking subitems (see variable
3533 @code{org-tags-match-list-sublevels}).
3534 @end table
3536 @cindex Boolean logic, for tag searches
3537 A @i{tags} search string can use Boolean operators @samp{&} for AND and
3538 @samp{|} for OR.  @samp{&} binds more strongly than @samp{|}.
3539 Parenthesis are currently not implemented.  A tag may also be preceded
3540 by @samp{-}, to select against it, and @samp{+} is syntactic sugar for
3541 positive selection.  The AND operator @samp{&} is optional when @samp{+}
3542 or @samp{-} is present.  Examples:
3544 @table @samp
3545 @item +work-boss
3546 Select headlines tagged @samp{:work:}, but discard those also tagged
3547 @samp{:boss:}.
3548 @item work|laptop
3549 Selects lines tagged @samp{:work:} or @samp{:laptop:}.
3550 @item work|laptop&night
3551 Like before, but require the @samp{:laptop:} lines to be tagged also
3552 @samp{:night:}.
3553 @end table
3555 @cindex TODO keyword matching, with tags search
3556 If you are using multi-state TODO keywords (@pxref{TODO extensions}), it
3557 can be useful to also match on the TODO keyword.  This can be done by
3558 adding a condition after a slash to a tags match.  The syntax is similar
3559 to the tag matches, but should be applied with consideration: For
3560 example, a positive selection on several TODO keywords can not
3561 meaningfully be combined with boolean AND.  However, @emph{negative
3562 selection} combined with AND can be meaningful.  To make sure that only
3563 lines are checked that actually have any TODO keyword, use @kbd{C-c a
3564 M}, or equivalently start the TODO part after the slash with @samp{!}.
3565 Examples:
3567 @table @samp
3568 @item work/WAITING
3569 Select @samp{:work:}-tagged TODO lines with the specific TODO
3570 keyword @samp{WAITING}.
3571 @item work/!-WAITING-NEXT
3572 Select @samp{:work:}-tagged TODO lines that are neither @samp{WAITING}
3573 nor @samp{NEXT}
3574 @item work/+WAITING|+NEXT
3575 Select @samp{:work:}-tagged TODO lines that are either @samp{WAITING} or
3576 @samp{NEXT}.
3577 @end table
3579 @cindex regular expressions, with tags search
3580 Any element of the tag/todo match can be a regular expression - in this
3581 case it must be enclosed in curly braces.  For example,
3582 @samp{work+@{^boss.*@}} matches headlines that contain the tag
3583 @samp{:work:} and any tag @i{starting} with @samp{boss}.
3585 @cindex level, require for tags/property match
3586 @cindex category, require for tags/property match
3587 You can also require a headline to be of a certain level or category, by
3588 writing instead of any TAG an expression like @samp{LEVEL=3} or
3589 @samp{CATEGORY="work"}, respectively.  For example, a search
3590 @samp{+LEVEL=3+boss/-DONE} lists all level three headlines that have the
3591 tag @samp{boss} and are @emph{not} marked with the TODO keyword DONE.
3593 @node Properties and Columns, Dates and Times, Tags, Top
3594 @chapter Properties and Columns
3595 @cindex properties
3597 Properties are a set of key-value pairs associated with an entry.  There
3598 are two main applications for properties in Org mode.  First, properties
3599 are like tags, but with a value.  Second, you can use properties to
3600 implement (very basic) database capabilities in an Org buffer.  For
3601 an example of the first application, imagine maintaining a file where
3602 you document bugs and plan releases of a piece of software.  Instead of
3603 using tags like @code{:release_1:}, @code{:release_2:}, one can use a
3604 property, say @code{:Release:}, that in different subtrees has different
3605 values, such as @code{1.0} or @code{2.0}.  For an example of the second
3606 application of properties, imagine keeping track of your music CD's,
3607 where properties could be things such as the album artist, date of
3608 release, number of tracks, and so on.
3610 Properties can be conveniently edited and viewed in column view
3611 (@pxref{Column view}).
3613 Properties are like tags, but with a value.  For example, in a file
3614 where you document bugs and plan releases of a piece of software,
3615 instead of using tags like @code{:release_1:}, @code{:release_2:}, it
3616 can be more efficient to use a property @code{:Release:} with a value
3617 @code{1.0} or @code{2.0}.  Second, you can use properties to implement
3618 (very basic) database capabilities in an Org buffer, for example to
3619 create a list of Music CD's you own.  You can edit and view properties
3620 conveniently in column view (@pxref{Column view}).
3622 @menu
3623 * Property syntax::             How properties are spelled out
3624 * Special properties::          Access to other Org mode features
3625 * Property searches::           Matching property values
3626 * Property inheritance::        Passing values down the tree
3627 * Column view::                 Tabular viewing and editing
3628 * Property API::                Properties for Lisp programmers
3629 @end menu
3631 @node Property syntax, Special properties, Properties and Columns, Properties and Columns
3632 @section Property syntax
3633 @cindex property syntax
3634 @cindex drawer, for properties
3636 Properties are key-value pairs.  They need to be inserted into a special
3637 drawer (@pxref{Drawers}) with the name @code{PROPERTIES}.  Each property
3638 is specified on a single line, with the key (surrounded by colons)
3639 first, and the value after it.  Here is an example:
3641 @example
3642 * CD collection
3643 ** Classic
3644 *** Goldberg Variations
3645     :PROPERTIES:
3646     :Title:     Goldberg Variations
3647     :Composer:  J.S. Bach
3648     :Artist:    Glen Gould
3649     :Publisher: Deutsche Grammphon
3650     :NDisks:    1
3651     :END:
3652 @end example
3654 You may define the allowed values for a particular property @samp{:Xyz:}
3655 by setting a property @samp{:Xyz_ALL:}.  This special property is
3656 @emph{inherited}, so if you set it in a level 1 entry, it will apply to
3657 the entire tree.  When allowed values are defined, setting the
3658 corresponding property becomes easier and is less prone to typing
3659 errors.  For the example with the CD collection, we can predefine
3660 publishers and the number of disks in a box like this:
3662 @example
3663 * CD collection
3664   :PROPERTIES:
3665   :NDisks_ALL:  1 2 3 4
3666   :Publisher_ALL: "Deutsche Grammophon" Phillips EMI
3667   :END:
3668 @end example
3670 If you want to set properties that can be inherited by any entry in a
3671 file, use a line like
3673 @example
3674 #+PROPERTY: NDisks_ALL 1 2 3 4
3675 @end example
3677 Property values set with the global variable
3678 @code{org-global-properties} can be inherited by all entries in all
3679 Org files.
3681 @noindent
3682 The following commands help to work with properties:
3684 @table @kbd
3685 @kindex M-@key{TAB}
3686 @item M-@key{TAB}
3687 After an initial colon in a line, complete property keys.  All keys used
3688 in the current file will be offered as possible completions.
3689 @kindex C-c C-x p
3690 @item C-c C-x p
3691 Set a property.  This prompts for a property name and a value.  If
3692 necessary, the property drawer is created as well.
3693 @item M-x org-insert-property-drawer
3694 Insert a property drawer into the current entry.  The drawer will be
3695 inserted early in the entry, but after the lines with planning
3696 information like deadlines.
3697 @kindex C-c C-c
3698 @item C-c C-c
3699 With the cursor in a property drawer, this executes property commands.
3700 @item C-c C-c s
3701 Set a property in the current entry.  Both the property and the value
3702 can be inserted using completion.
3703 @kindex S-@key{right}
3704 @kindex S-@key{left}
3705 @item S-@key{left}/@key{right}
3706 Switch property at point to the next/previous allowed value.
3707 @item C-c C-c d
3708 Remove a property from the current entry.
3709 @item C-c C-c D
3710 Globally remove a property, from all entries in the current file.
3711 @item C-c C-c c
3712 Compute the property at point, using the operator and scope from the
3713 nearest column format definition.
3714 @end table
3716 @node Special properties, Property searches, Property syntax, Properties and Columns
3717 @section Special properties
3718 @cindex properties, special
3720 Special properties provide alternative access method to Org mode
3721 features discussed in the previous chapters, like the TODO state or the
3722 priority of an entry.  This interface exists so that you can include
3723 these states into columns view (@pxref{Column view}), or to use them in
3724 queries.  The following property names are special and should not be
3725 used as keys in the properties drawer:
3727 @example
3728 TODO         @r{The TODO keyword of the entry.}
3729 TAGS         @r{The tags defined directly in the headline.}
3730 ALLTAGS      @r{All tags, including inherited ones.}
3731 PRIORITY     @r{The priority of the entry, a string with a single letter.}
3732 DEADLINE     @r{The deadline time string, without the angular brackets.}
3733 SCHEDULED    @r{The scheduling time stamp, without the angular brackets.}
3734 TIMESTAMP    @r{The first keyword-less time stamp in the entry.}
3735 TIMESTAMP_IA @r{The first inactive time stamp in the entry.}
3736 CLOCKSUM     @r{The sum of CLOCK intervals in the subtree.  @code{org-clock-sum}}
3737              @r{must be run first to compute the values.}
3738 @end example
3740 @node Property searches, Property inheritance, Special properties, Properties and Columns
3741 @section Property searches
3742 @cindex properties, searching
3743 @cindex searching, of properties
3745 To create sparse trees and special lists with selection based on properties,
3746 the same commands are used as for tag searches (@pxref{Tag searches}), and
3747 the same logic applies.  For example, here is a search string:
3749 @example
3750 +work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2+With=@{Sarah\|Denny@}
3751 @end example
3753 @noindent
3754 If the comparison value is a plain number, a numerical comparison is done,
3755 and the allowed operators are @samp{<}, @samp{=}, @samp{>}, @samp{<=},
3756 @samp{>=}, and @samp{<>}.  If the comparison value is enclosed in double
3757 quotes, a string comparison is done, and the same operators are allowed.  If
3758 the comparison value is enclosed in curly braces, a regexp match is
3759 performed, with @samp{=} meaning that the regexp matches the property value,
3760 and @samp{<>} meaning that it does not match.  So the search string in the
3761 example finds entries tagged @samp{:work:} but not @samp{:boss:}, which also
3762 have a priority value @samp{A}, a @samp{:Coffee:} property with the value
3763 @samp{unlimited}, an @samp{Effort} property that is numerically smaller than
3764 2, and a @samp{:With:} property that is matched by the regular expression
3765 @samp{Sarah\|Denny}.
3767 You can configure Org mode to use property inheritance during a search, but
3768 beware that this can slow down searches considerably.  See @ref{Property
3769 inheritance} for details.
3771 There is also a special command for creating sparse trees based on a
3772 single property:
3774 @table @kbd
3775 @kindex C-c / p
3776 @item C-c / p
3777 Create a sparse tree based on the value of a property.  This first
3778 prompts for the name of a property, and then for a value.  A sparse tree
3779 is created with all entries that define this property with the given
3780 value.  If you enclose the value into curly braces, it is interpreted as
3781 a regular expression and matched against the property values.
3782 @end table
3784 @node Property inheritance, Column view, Property searches, Properties and Columns
3785 @section Property Inheritance
3786 @cindex properties, inheritance
3787 @cindex inheritance, of properties
3789 The outline structure of Org mode documents lends itself for an
3790 inheritance model of properties: If the parent in a tree has a certain
3791 property, the children can inherit this property.  Org mode does not
3792 turn this on by default, because it can slow down property searches
3793 significantly and is often not needed.  However, if you find inheritance
3794 useful, you can turn it on by setting the variable
3795 @code{org-use-property-inheritance}.  It may be set to @code{t}, to make
3796 all properties inherited from the parent, to a list of properties
3797 that should be inherited, or to a regular expression that matches
3798 inherited properties.
3800 Org mode has a few properties for which inheritance is hard-coded, at
3801 least for the special applications for which they are used:
3803 @table @code
3804 @item COLUMNS
3805 The @code{:COLUMNS:} property defines the format of column view
3806 (@pxref{Column view}).  It is inherited in the sense that the level
3807 where a @code{:COLUMNS:} property is defined is used as the starting
3808 point for a column view table, independently of the location in the
3809 subtree from where columns view is turned on.
3810 @item CATEGORY
3811 For agenda view, a category set through a @code{:CATEGORY:} property
3812 applies to the entire subtree.
3813 @item ARCHIVE
3814 For archiving, the @code{:ARCHIVE:} property may define the archive
3815 location for the entire subtree (@pxref{Moving subtrees}).
3816 @item LOGGING
3817 The LOGGING property may define logging settings for an entry or a
3818 subtree (@pxref{Tracking TODO state changes}).
3819 @end table
3821 @node Column view, Property API, Property inheritance, Properties and Columns
3822 @section Column view
3824 A great way to view and edit properties in an outline tree is
3825 @emph{column view}.  In column view, each outline item is turned into a
3826 table row.  Columns in this table provide access to properties of the
3827 entries.  Org mode implements columns by overlaying a tabular structure
3828 over the headline of each item.  While the headlines have been turned
3829 into a table row, you can still change the visibility of the outline
3830 tree.  For example, you get a compact table by switching to CONTENTS
3831 view (@kbd{S-@key{TAB} S-@key{TAB}}, or simply @kbd{c} while column view
3832 is active), but you can still open, read, and edit the entry below each
3833 headline.  Or, you can switch to column view after executing a sparse
3834 tree command and in this way get a table only for the selected items.
3835 Column view also works in agenda buffers (@pxref{Agenda Views}) where
3836 queries have collected selected items, possibly from a number of files.
3838 @menu
3839 * Defining columns::            The COLUMNS format property
3840 * Using column view::           How to create and use column view
3841 * Capturing column view::       A dynamic block for column view
3842 @end menu
3844 @node Defining columns, Using column view, Column view, Column view
3845 @subsection Defining columns
3846 @cindex column view, for properties
3847 @cindex properties, column view
3849 Setting up a column view first requires defining the columns.  This is
3850 done by defining a column format line.
3852 @menu
3853 * Scope of column definitions::  Where defined, where valid?
3854 * Column attributes::           Appearance and content of a column
3855 @end menu
3857 @node Scope of column definitions, Column attributes, Defining columns, Defining columns
3858 @subsubsection Scope of column definitions
3860 To define a column format for an entire file, use a line like
3862 @example
3863 #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
3864 @end example
3866 To specify a format that only applies to a specific tree, add a
3867 @code{:COLUMNS:} property to the top node of that tree, for example:
3869 @example
3870 ** Top node for columns view
3871    :PROPERTIES:
3872    :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
3873    :END:
3874 @end example
3876 If a @code{:COLUMNS:} property is present in an entry, it defines columns
3877 for the entry itself, and for the entire subtree below it.  Since the
3878 column definition is part of the hierarchical structure of the document,
3879 you can define columns on level 1 that are general enough for all
3880 sublevels, and more specific columns further down, when you edit a
3881 deeper part of the tree.
3883 @node Column attributes,  , Scope of column definitions, Defining columns
3884 @subsubsection Column attributes
3885 A column definition sets the attributes of a column.  The general
3886 definition looks like this:
3888 @example
3889  %[width]property[(title)][@{summary-type@}]
3890 @end example
3892 @noindent
3893 Except for the percent sign and the property name, all items are
3894 optional.  The individual parts have the following meaning:
3896 @example
3897 width           @r{An integer specifying the width of the column in characters.}
3898                 @r{If omitted, the width will be determined automatically.}
3899 property        @r{The property that should be edited in this column.}
3900 (title)         @r{The header text for the column. If omitted, the}
3901                 @r{property name is used.}
3902 @{summary-type@}  @r{The summary type.  If specified, the column values for}
3903                 @r{parent nodes are computed from the children.}
3904                 @r{Supported summary types are:}
3905                 @{+@}       @r{Sum numbers in this column.}
3906                 @{+;%.1f@}  @r{Like @samp{+}, but format result with @samp{%.1f}.}
3907                 @{$@}       @r{Currency, short for @samp{+;%.2f}.}
3908                 @{:@}       @r{Sum times, HH:MM:SS, plain numbers are hours.}
3909                 @{X@}       @r{Checkbox status, [X] if all children are [X].}
3910                 @{X/@}      @r{Checkbox status, [n/m].}
3911                 @{X%@}      @r{Checkbox status, [n%].}
3912 @end example
3914 @noindent
3915 Here is an example for a complete columns definition, along with allowed
3916 values.
3918 @example
3919 :COLUMNS:  %20ITEM %9Approved(Approved?)@{X@} %Owner %11Status \@footnote{Please note that the COLUMNS definition must be on a single line - it is wrapped here only because of formatting constraints.}
3920                    %10Time_Estimate@{:@} %CLOCKSUM
3921 :Owner_ALL:    Tammy Mark Karl Lisa Don
3922 :Status_ALL:   "In progress" "Not started yet" "Finished" ""
3923 :Approved_ALL: "[ ]" "[X]"
3924 @end example
3926 The first column, @samp{%25ITEM}, means the first 25 characters of the
3927 item itself, i.e. of the headline.  You probably always should start the
3928 column definition with the @samp{ITEM} specifier.  The other specifiers
3929 create columns @samp{Owner} with a list of names as allowed values, for
3930 @samp{Status} with four different possible values, and for a checkbox
3931 field @samp{Approved}.  When no width is given after the @samp{%}
3932 character, the column will be exactly as wide as it needs to be in order
3933 to fully display all values.  The @samp{Approved} column does have a
3934 modified title (@samp{Approved?}, with a question mark).  Summaries will
3935 be created for the @samp{Time_Estimate} column by adding time duration
3936 expressions like HH:MM, and for the @samp{Approved} column, by providing
3937 an @samp{[X]} status if all children have been checked.  The
3938 @samp{CLOCKSUM} column is special, it lists the sum of CLOCK intervals
3939 in the subtree.
3941 @node Using column view, Capturing column view, Defining columns, Column view
3942 @subsection Using column view
3944 @table @kbd
3945 @tsubheading{Turning column view on and off}
3946 @kindex C-c C-x C-c
3947 @item C-c C-x C-c
3948 Create the column view for the local environment.  This command searches
3949 the hierarchy, up from point, for a @code{:COLUMNS:} property that defines
3950 a format.  When one is found, the column view table is established for
3951 the entire tree, starting from the entry that contains the @code{:COLUMNS:}
3952 property.  If none is found, the format is taken from the @code{#+COLUMNS}
3953 line or from the variable @code{org-columns-default-format}, and column
3954 view is established for the current entry and its subtree.
3955 @kindex r
3956 @item r
3957 Recreate the column view, to include recent changes made in the buffer.
3958 @kindex g
3959 @item g
3960 Same as @kbd{r}.
3961 @kindex q
3962 @item q
3963 Exit column view.
3964 @tsubheading{Editing values}
3965 @item @key{left} @key{right} @key{up} @key{down}
3966 Move through the column view from field to field.
3967 @kindex S-@key{left}
3968 @kindex S-@key{right}
3969 @item  S-@key{left}/@key{right}
3970 Switch to the next/previous allowed value of the field.  For this, you
3971 have to have specified allowed values for a property.
3972 @item 1..9,0
3973 Directly select the nth allowed value, @kbd{0} selects the 10th value.
3974 @kindex n
3975 @kindex p
3976 @itemx  n / p
3977 Same as @kbd{S-@key{left}/@key{right}}
3978 @kindex e
3979 @item e
3980 Edit the property at point.  For the special properties, this will
3981 invoke the same interface that you normally use to change that
3982 property.  For example, when editing a TAGS property, the tag completion
3983 or fast selection interface will pop up.
3984 @kindex C-c C-c
3985 @item C-c C-c
3986 When there is a checkbox at point, toggle it.
3987 @kindex v
3988 @item v
3989 View the full value of this property.  This is useful if the width of
3990 the column is smaller than that of the value.
3991 @kindex a
3992 @item a
3993 Edit the list of allowed values for this property.  If the list is found
3994 in the hierarchy, the modified values is stored there.  If no list is
3995 found, the new value is stored in the first entry that is part of the
3996 current column view.
3997 @tsubheading{Modifying the table structure}
3998 @kindex <
3999 @kindex >
4000 @item < / >
4001 Make the column narrower/wider by one character.
4002 @kindex S-M-@key{right}
4003 @item S-M-@key{right}
4004 Insert a new column, to the right of the current column.
4005 @kindex S-M-@key{left}
4006 @item S-M-@key{left}
4007 Delete the current column.
4008 @end table
4010 @node Capturing column view,  , Using column view, Column view
4011 @subsection Capturing column view
4013 Since column view is just an overlay over a buffer, it cannot be
4014 exported or printed directly.  If you want to capture a column view, use
4015 this @code{columnview} dynamic block (@pxref{Dynamic blocks}).  The frame
4016 of this block looks like this:
4018 @cindex #+BEGIN: columnview
4019 @example
4020 * The column view
4021 #+BEGIN: columnview :hlines 1 :id "label"
4023 #+END:
4024 @end example
4026 @noindent This dynamic block has the following parameters:
4028 @table @code
4029 @item :id
4030 This is most important parameter.  Column view is a feature that is
4031 often localized to a certain (sub)tree, and the capture block might be
4032 in a different location in the file.  To identify the tree whose view to
4033 capture, you can use 3 values:
4034 @example
4035 local     @r{use the tree in which the capture block is located}
4036 global    @r{make a global view, including all headings in the file}
4037 "label"   @r{call column view in the tree that has an @code{:ID:}}
4038           @r{property with the value @i{label}.  You can use}
4039           @r{@kbd{M-x org-id-copy} to create a globally unique ID for}
4040           @r{the current entry and copy it to the kill-ring.}
4041 @end example
4042 @item :hlines
4043 When @code{t}, insert a hline after every line.  When a number N, insert
4044 a hline before each headline with level @code{<= N}.
4045 @item :vlines
4046 When set to @code{t}, enforce column groups to get vertical lines.
4047 @item :maxlevel
4048 When set to a number, don't capture entries below this level.
4049 @item :skip-empty-rows
4050 When set to @code{t}, skip row where the only non-empty specifier of the
4051 column view is @code{ITEM}.
4053 @end table
4055 @noindent
4056 The following commands insert or update the dynamic block:
4058 @table @kbd
4059 @kindex C-c C-x r
4060 @item C-c C-x r
4061 Insert a dynamic block capturing a column view.  You will be prompted
4062 for the scope or id of the view.
4063 @kindex C-c C-c
4064 @item C-c C-c
4065 @kindex C-c C-x C-u
4066 @itemx C-c C-x C-u
4067 Update dynamical block at point.  The cursor needs to be in the
4068 @code{#+BEGIN} line of the dynamic block.
4069 @kindex C-u C-c C-x C-u
4070 @item C-u C-c C-x C-u
4071 Update all dynamic blocks (@pxref{Dynamic blocks}).  This is useful if
4072 you have several clock table blocks in a buffer.
4073 @end table
4075 @node Property API,  , Column view, Properties and Columns
4076 @section The Property API
4077 @cindex properties, API
4078 @cindex API, for properties
4080 There is a full API for accessing and changing properties.  This API can
4081 be used by Emacs Lisp programs to work with properties and to implement
4082 features based on them.  For more information see @ref{Using the
4083 property API}.
4085 @node Dates and Times, Remember, Properties and Columns, Top
4086 @chapter Dates and Times
4087 @cindex dates
4088 @cindex times
4089 @cindex time stamps
4090 @cindex date stamps
4092 To assist project planning, TODO items can be labeled with a date and/or
4093 a time.  The specially formatted string carrying the date and time
4094 information is called a @emph{timestamp} in Org mode.  This may be a
4095 little confusing because timestamp is often used as indicating when
4096 something was created or last changed.  However, in Org mode this term
4097 is used in a much wider sense.
4099 @menu
4100 * Timestamps::                  Assigning a time to a tree entry
4101 * Creating timestamps::         Commands which insert timestamps
4102 * Deadlines and scheduling::    Planning your work
4103 * Clocking work time::          Tracking how long you spend on a task
4104 * Effort estimates::            Planning work effort in advance
4105 @end menu
4108 @node Timestamps, Creating timestamps, Dates and Times, Dates and Times
4109 @section Timestamps, deadlines and scheduling
4110 @cindex time stamps
4111 @cindex ranges, time
4112 @cindex date stamps
4113 @cindex deadlines
4114 @cindex scheduling
4116 A time stamp is a specification of a date (possibly with time or a range
4117 of times) in a special format, either @samp{<2003-09-16 Tue>} or
4118 @samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue
4119 12:00-12:30>}@footnote{This is the standard ISO date/time format.  To
4120 use an alternative format, see @ref{Custom time format}.}.  A time stamp
4121 can appear anywhere in the headline or body of an Org tree entry.  Its
4122 presence causes entries to be shown on specific dates in the agenda
4123 (@pxref{Weekly/daily agenda}).  We distinguish:
4125 @table @var
4126 @item Plain time stamp; Event; Appointment
4127 @cindex timestamp
4128 A simple time stamp just assigns a date/time to an item.  This is just
4129 like writing down an appointment or event in a paper agenda.  In the
4130 timeline and agenda displays, the headline of an entry associated with a
4131 plain time stamp will be shown exactly on that date.
4133 @example
4134 * Meet Peter at the movies <2006-11-01 Wed 19:15>
4135 * Discussion on climate change <2006-11-02 Thu 20:00-22:00>
4136 @end example
4138 @item Time stamp with repeater interval
4139 @cindex timestamp, with repeater interval
4140 A time stamp may contain a @emph{repeater interval}, indicating that it
4141 applies not only on the given date, but again and again after a certain
4142 interval of N days (d), weeks (w), months(m), or years(y).  The
4143 following will show up in the agenda every Wednesday:
4145 @example
4146 * Pick up Sam at school <2007-05-16 Wed 12:30 +1w>
4147 @end example
4149 @item Diary-style sexp entries
4150 For more complex date specifications, Org mode supports using the
4151 special sexp diary entries implemented in the Emacs calendar/diary
4152 package.  For example
4154 @example
4155 * The nerd meeting on every 2nd Thursday of the month
4156   <%%(diary-float t 4 2)>
4157 @end example
4159 @item Time/Date range
4160 @cindex timerange
4161 @cindex date range
4162 Two time stamps connected by @samp{--} denote a range.  The headline
4163 will be shown on the first and last day of the range, and on any dates
4164 that are displayed and fall in the range.  Here is an example:
4166 @example
4167 ** Meeting in Amsterdam
4168    <2004-08-23 Mon>--<2004-08-26 Thu>
4169 @end example
4171 @item Inactive time stamp
4172 @cindex timestamp, inactive
4173 @cindex inactive timestamp
4174 Just like a plain time stamp, but with square brackets instead of
4175 angular ones.  These time stamps are inactive in the sense that they do
4176 @emph{not} trigger an entry to show up in the agenda.
4178 @example
4179 * Gillian comes late for the fifth time [2006-11-01 Wed]
4180 @end example
4182 @end table
4184 @node Creating timestamps, Deadlines and scheduling, Timestamps, Dates and Times
4185 @section Creating timestamps
4186 @cindex creating timestamps
4187 @cindex timestamps, creating
4189 For Org mode to recognize time stamps, they need to be in the specific
4190 format.  All commands listed below produce time stamps in the correct
4191 format.
4193 @table @kbd
4194 @kindex C-c .
4195 @item C-c .
4196 Prompt for a date and insert a corresponding time stamp.  When the
4197 cursor is at a previously used time stamp, it is updated to NOW.  When
4198 this command is used twice in succession, a time range is inserted.
4200 @kindex C-u C-c .
4201 @item C-u C-c .
4202 Like @kbd{C-c .}, but use the alternative format which contains date
4203 and time.  The default time can be rounded to multiples of 5 minutes,
4204 see the option @code{org-time-stamp-rounding-minutes}.
4206 @kindex C-c !
4207 @item C-c !
4208 Like @kbd{C-c .}, but insert an inactive time stamp that will not cause
4209 an agenda entry.
4211 @kindex C-c <
4212 @item C-c <
4213 Insert a time stamp corresponding to the cursor date in the Calendar.
4215 @kindex C-c >
4216 @item C-c >
4217 Access the Emacs calendar for the current date.  If there is a
4218 timestamp in the current line, go to the corresponding date
4219 instead.
4221 @kindex C-c C-o
4222 @item C-c C-o
4223 Access the agenda for the date given by the time stamp or -range at
4224 point (@pxref{Weekly/daily agenda}).
4226 @kindex S-@key{left}
4227 @kindex S-@key{right}
4228 @item S-@key{left}
4229 @itemx S-@key{right}
4230 Change date at cursor by one day.  These key bindings conflict with
4231 CUA mode (@pxref{Conflicts}).
4233 @kindex S-@key{up}
4234 @kindex S-@key{down}
4235 @item S-@key{up}
4236 @itemx S-@key{down}
4237 Change the item under the cursor in a timestamp.  The cursor can be on a
4238 year, month, day, hour or minute.  Note that if the cursor is in a
4239 headline and not at a time stamp, these same keys modify the priority of
4240 an item.  (@pxref{Priorities}). The key bindings also conflict with
4241 CUA mode (@pxref{Conflicts}).
4243 @kindex C-c C-y
4244 @cindex evaluate time range
4245 @item C-c C-y
4246 Evaluate a time range by computing the difference between start and end.
4247 With a prefix argument, insert result after the time range (in a table: into
4248 the following column).
4249 @end table
4252 @menu
4253 * The date/time prompt::        How Org mode helps you entering date and time
4254 * Custom time format::          Making dates look different
4255 @end menu
4257 @node The date/time prompt, Custom time format, Creating timestamps, Creating timestamps
4258 @subsection The date/time prompt
4259 @cindex date, reading in minibuffer
4260 @cindex time, reading in minibuffer
4262 When Org mode prompts for a date/time, the default is shown as an ISO
4263 date, and the prompt therefore seems to ask for an ISO date.  But it
4264 will in fact accept any string containing some date and/or time
4265 information, and it is really smart about interpreting your input.  You
4266 can, for example, use @kbd{C-y} to paste a (possibly multi-line) string
4267 copied from an email message.  Org mode will find whatever information
4268 is in there and derive anything you have not specified from the
4269 @emph{default date and time}.  The default is usually the current date
4270 and time, but when modifying an existing time stamp, or when entering
4271 the second stamp of a range, it is taken from the stamp in the buffer.
4272 When filling in information, Org mode assumes that most of the time you
4273 will want to enter a date in the future: If you omit the month/year and
4274 the given day/month is @i{before} today, it will assume that you mean a
4275 future date@footnote{See the variable
4276 @code{org-read-date-prefer-future}.}.
4278 For example, lets assume that today is @b{June 13, 2006}.  Here is how
4279 various inputs will be interpreted, the items filled in by Org mode are
4280 in @b{bold}.
4282 @example
4283 3-2-5         --> 2003-02-05
4284 14            --> @b{2006}-@b{06}-14
4285 12            --> @b{2006}-@b{07}-12
4286 Fri           --> nearest Friday (defaultdate or later)
4287 sep 15        --> @b{2006}-11-15
4288 feb 15        --> @b{2007}-02-15
4289 sep 12 9      --> 2009-09-12
4290 12:45         --> @b{2006}-@b{06}-@b{13} 12:45
4291 22 sept 0:34  --> @b{2006}-09-22 0:34
4292 w4            --> ISO week for of the current year @b{2006}
4293 2012 w4 fri   --> Friday of ISO week 4 in 2012
4294 2012-w04-5    --> Same as above
4295 @end example
4297 Furthermore you can specify a relative date by giving, as the
4298 @emph{first} thing in the input: a plus/minus sign, a number and a
4299 letter [dwmy] to indicate change in days weeks, months, years.  With a
4300 single plus or minus, the date is always relative to today.  With a
4301 double plus or minus, it is relative to the default date.  If instead of
4302 a single letter, you use the abbreviation of day name, the date will be
4303 the nth such day.  E.g.
4305 @example
4306 +0            --> today
4307 .             --> today
4308 +4d           --> four days from today
4309 +4            --> same as above
4310 +2w           --> two weeks from today
4311 ++5           --> five days from default date
4312 +2tue         --> second tuesday from now.
4313 @end example
4315 The function understands English month and weekday abbreviations.  If
4316 you want to use unabbreviated names and/or other languages, configure
4317 the variables @code{parse-time-months} and @code{parse-time-weekdays}.
4319 @cindex calendar, for selecting date
4320 Parallel to the minibuffer prompt, a calendar is popped up@footnote{If
4321 you don't need/want the calendar, configure the variable
4322 @code{org-popup-calendar-for-date-prompt}.}.  When you exit the date
4323 prompt, either by clicking on a date in the calendar, or by pressing
4324 @key{RET}, the date selected in the calendar will be combined with the
4325 information entered at the prompt.  You can control the calendar fully
4326 from the minibuffer:
4328 @kindex <
4329 @kindex >
4330 @kindex mouse-1
4331 @kindex S-@key{right}
4332 @kindex S-@key{left}
4333 @kindex S-@key{down}
4334 @kindex S-@key{up}
4335 @kindex M-S-@key{right}
4336 @kindex M-S-@key{left}
4337 @kindex @key{RET}
4338 @example
4339 > / <          @r{Scroll calendar forward/backward by one month.}
4340 mouse-1        @r{Select date by clicking on it.}
4341 S-@key{right}/@key{left}     @r{One day forward/backward.}
4342 S-@key{down}/@key{up}     @r{One week forward/backward.}
4343 M-S-@key{right}/@key{left}   @r{One month forward/backward.}
4344 @key{RET}           @r{Choose date in calendar.}
4345 @end example
4347 The actions of the date/time prompt may seem complex, but I assure you they
4348 will grow on you, and you will start getting annoyed by pretty much any other
4349 way of entering a date/time out there.  To help you understand what is going
4350 on, the current interpretation of your input will be displayed live in the
4351 minibuffer@footnote{If you find this distracting, turn the display of with
4352 @code{org-read-date-display-live}.}.
4354 @node Custom time format,  , The date/time prompt, Creating timestamps
4355 @subsection Custom time format
4356 @cindex custom date/time format
4357 @cindex time format, custom
4358 @cindex date format, custom
4360 Org mode uses the standard ISO notation for dates and times as it is
4361 defined in ISO 8601.  If you cannot get used to this and require another
4362 representation of date and time to keep you happy, you can get it by
4363 customizing the variables @code{org-display-custom-times} and
4364 @code{org-time-stamp-custom-formats}.
4366 @table @kbd
4367 @kindex C-c C-x C-t
4368 @item C-c C-x C-t
4369 Toggle the display of custom formats for dates and times.
4370 @end table
4372 @noindent
4373 Org mode needs the default format for scanning, so the custom date/time
4374 format does not @emph{replace} the default format - instead it is put
4375 @emph{over} the default format using text properties.  This has the
4376 following consequences:
4377 @itemize @bullet
4378 @item
4379 You cannot place the cursor onto a time stamp anymore, only before or
4380 after.
4381 @item
4382 The @kbd{S-@key{up}/@key{down}} keys can no longer be used to adjust
4383 each component of a time stamp.  If the cursor is at the beginning of
4384 the stamp, @kbd{S-@key{up}/@key{down}} will change the stamp by one day,
4385 just like @kbd{S-@key{left}/@key{right}}.  At the end of the stamp, the
4386 time will be changed by one minute.
4387 @item
4388 If the time stamp contains a range of clock times or a repeater, these
4389 will not be overlayed, but remain in the buffer as they were.
4390 @item
4391 When you delete a time stamp character-by-character, it will only
4392 disappear from the buffer after @emph{all} (invisible) characters
4393 belonging to the ISO timestamp have been removed.
4394 @item
4395 If the custom time stamp format is longer than the default and you are
4396 using dates in tables, table alignment will be messed up.  If the custom
4397 format is shorter, things do work as expected.
4398 @end itemize
4401 @node Deadlines and scheduling, Clocking work time, Creating timestamps, Dates and Times
4402 @section Deadlines and scheduling
4404 A time stamp may be preceded by special keywords to facilitate planning:
4406 @table @var
4407 @item DEADLINE
4408 @cindex DEADLINE keyword
4410 Meaning: the task (most likely a TODO item, though not necessarily) is supposed
4411 to be finished on that date.
4413 On the deadline date, the task will be listed in the agenda.  In
4414 addition, the agenda for @emph{today} will carry a warning about the
4415 approaching or missed deadline, starting
4416 @code{org-deadline-warning-days} before the due date, and continuing
4417 until the entry is marked DONE.  An example:
4419 @example
4420 *** TODO write article about the Earth for the Guide
4421     The editor in charge is [[bbdb:Ford Prefect]]
4422     DEADLINE: <2004-02-29 Sun>
4423 @end example
4425 You can specify a different lead time for warnings for a specific
4426 deadlines using the following syntax.  Here is an example with a warning
4427 period of 5 days @code{DEADLINE: <2004-02-29 Sun -5d>}.
4429 @item SCHEDULED
4430 @cindex SCHEDULED keyword
4432 Meaning: you are planning to start working on that task on the given
4433 date.
4435 The headline will be listed under the given date@footnote{It will still
4436 be listed on that date after it has been marked DONE.  If you don't like
4437 this, set the variable @code{org-agenda-skip-scheduled-if-done}.}.  In
4438 addition, a reminder that the scheduled date has passed will be present
4439 in the compilation for @emph{today}, until the entry is marked DONE.
4440 I.e., the task will automatically be forwarded until completed.
4442 @example
4443 *** TODO Call Trillian for a date on New Years Eve.
4444     SCHEDULED: <2004-12-25 Sat>
4445 @end example
4447 @noindent
4448 @b{Important:} Scheduling an item in Org mode should @i{not} be
4449 understood in the same way that we understand @i{scheduling a meeting}.
4450 Setting a date for a meeting is just a simple appointment, you should
4451 mark this entry with a simple plain time stamp, to get this item shown
4452 on the date where it applies.  This is a frequent mis-understanding from
4453 Org-users.  In Org mode, @i{scheduling} means setting a date when you
4454 want to start working on an action item.
4455 @end table
4457 You may use time stamps with repeaters in scheduling and deadline
4458 entries.  Org mode will issue early and late warnings based on the
4459 assumption that the time stamp represents the @i{nearest instance} of
4460 the repeater.  However, the use of diary sexp entries like
4462 @code{<%%(diary-float t 42)>}
4464 in scheduling and deadline timestamps is limited.  Org mode does not
4465 know enough about the internals of each sexp function to issue early and
4466 late warnings.  However, it will show the item on each day where the
4467 sexp entry matches.
4469 @menu
4470 * Inserting deadline/schedule::  Planning items
4471 * Repeated tasks::              Items that show up again and again
4472 @end menu
4474 @node Inserting deadline/schedule, Repeated tasks, Deadlines and scheduling, Deadlines and scheduling
4475 @subsection Inserting deadlines or schedules
4477 The following commands allow to quickly insert a deadline or to schedule
4478 an item:
4480 @table @kbd
4482 @kindex C-c C-d
4483 @item C-c C-d
4484 Insert @samp{DEADLINE} keyword along with a stamp.  The insertion will
4485 happen in the line directly following the headline.  When called with a
4486 prefix arg, an existing deadline will be removed from the entry.
4487 @c FIXME Any CLOSED timestamp will be removed.????????
4489 @kindex C-c / d
4490 @cindex sparse tree, for deadlines
4491 @item C-c / d
4492 Create a sparse tree with all deadlines that are either past-due, or
4493 which will become due within @code{org-deadline-warning-days}.
4494 With @kbd{C-u} prefix, show all deadlines in the file.  With a numeric
4495 prefix, check that many days.  For example, @kbd{C-1 C-c / d} shows
4496 all deadlines due tomorrow.
4498 @kindex C-c C-s
4499 @item C-c C-s
4500 Insert @samp{SCHEDULED} keyword along with a stamp.  The insertion will
4501 happen in the line directly following the headline.  Any CLOSED
4502 timestamp will be removed.  When called with a prefix argument, remove
4503 the scheduling date from the entry.
4504 @end table
4506 @node Repeated tasks,  , Inserting deadline/schedule, Deadlines and scheduling
4507 @subsection Repeated tasks
4509 Some tasks need to be repeated again and again.  Org mode helps to
4510 organize such tasks using a so-called repeater in a DEADLINE, SCHEDULED,
4511 or plain time stamp.  In the following example
4512 @example
4513 ** TODO Pay the rent
4514    DEADLINE: <2005-10-01 Sat +1m>
4515 @end example
4516 the @code{+1m} is a repeater; the intended interpretation is that the
4517 task has a deadline on <2005-10-01> and repeats itself every (one) month
4518 starting from that time.  If you need both a repeater and a special
4519 warning period in a deadline entry, the repeater comes first and the
4520 warning period last: @code{DEADLINE: <2005-10-01 Sat +1m -3d>}.
4522 Deadlines and scheduled items produce entries in the agenda when they
4523 are over-due, so it is important to be able to mark such an entry as
4524 completed once you have done so.  When you mark a DEADLINE or a SCHEDULE
4525 with the TODO keyword DONE, it will no longer produce entries in the
4526 agenda.  The problem with this is, however, that then also the
4527 @emph{next} instance of the repeated entry will not be active.  Org mode
4528 deals with this in the following way: When you try to mark such an entry
4529 DONE (using @kbd{C-c C-t}), it will shift the base date of the repeating
4530 time stamp by the repeater interval, and immediately set the entry state
4531 back to TODO.  In the example above, setting the state to DONE would
4532 actually switch the date like this:
4534 @example
4535 ** TODO Pay the rent
4536    DEADLINE: <2005-11-01 Tue +1m>
4537 @end example
4539 A timestamp@footnote{You can change this using the option
4540 @code{org-log-repeat}, or the @code{#+STARTUP} options @code{logrepeat},
4541 @code{lognoterepeat}, and @code{nologrepeat}.  With @code{lognoterepeat}, you
4542 will aslo be prompted for a note.} will be added under the deadline, to keep
4543 a record that you actually acted on the previous instance of this deadline.
4545 As a consequence of shifting the base date, this entry will no longer be
4546 visible in the agenda when checking past dates, but all future instances
4547 will be visible.
4549 With the @samp{+1m} cookie, the date shift will always be exactly one
4550 month.  So if you have not payed the rent for three months, marking this
4551 entry DONE will still keep it as an overdue deadline.  Depending on the
4552 task, this may not be the best way to handle it.  For example, if you
4553 forgot to call you father for 3 weeks, it does not make sense to call
4554 him 3 times in a single day to make up for it.  Finally, there are tasks
4555 like changing batteries which should always repeat a certain time
4556 @i{after} the last time you did it.  For these tasks, Org mode has
4557 special repeaters markers with @samp{++} and @samp{.+}.  For example:
4559 @example
4560 ** TODO Call Father
4561    DEADLINE: <2008-02-10 Sun ++1w>
4562    Marking this DONE will shift the date by at least one week,
4563    but also by as many weeks as it takes to get this date into
4564    the future.  However, it stays on a Sunday, even if you called
4565    and marked it done on Saturday.
4566 ** TODO Check the batteries in the smoke detectors
4567    DEADLINE: <2005-11-01 Tue .+1m>
4568    Marking this DONE will shift the date to one month after
4569    today.
4570 @end example
4572 You may have both scheduling and deadline information for a specific
4573 task - just make sure that the repeater intervals on both are the same.
4575 @node Clocking work time, Effort estimates, Deadlines and scheduling, Dates and Times
4576 @section Clocking work time
4578 Org mode allows you to clock the time you spent on specific tasks in a
4579 project.  When you start working on an item, you can start the clock.
4580 When you stop working on that task, or when you mark the task done, the
4581 clock is stopped and the corresponding time interval is recorded.  It
4582 also computes the total time spent on each subtree of a project.
4584 @table @kbd
4585 @kindex C-c C-x C-i
4586 @item C-c C-x C-i
4587 Start the clock on the current item (clock-in).  This inserts the CLOCK
4588 keyword together with a timestamp.  If this is not the first clocking of
4589 this item, the multiple CLOCK lines will be wrapped into a
4590 @code{:CLOCK:} drawer (see also the variable
4591 @code{org-clock-into-drawer}).  When called with a @kbd{C-u} prefix argument,
4592 select the task from a list of recently clocked tasks.  With two @kbd{C-u
4593 C-u} prefixes, clock into the task at point and mark it as the default task.
4594 The default task will always be available when selecting a clocking task,
4595 with letter @kbd{d}.
4596 @kindex C-c C-x C-o
4597 @item C-c C-x C-o
4598 Stop the clock (clock-out).  The inserts another timestamp at the same
4599 location where the clock was last started.  It also directly computes
4600 the resulting time in inserts it after the time range as @samp{=>
4601 HH:MM}.  See the variable @code{org-log-note-clock-out} for the
4602 possibility to record an additional note together with the clock-out
4603 time stamp@footnote{The corresponding in-buffer setting is:
4604 @code{#+STARTUP: lognoteclock-out}}.
4605 @kindex C-c C-y
4606 @item C-c C-y
4607 Recompute the time interval after changing one of the time stamps.  This
4608 is only necessary if you edit the time stamps directly.  If you change
4609 them with @kbd{S-@key{cursor}} keys, the update is automatic.
4610 @kindex C-c C-t
4611 @item C-c C-t
4612 Changing the TODO state of an item to DONE automatically stops the clock
4613 if it is running in this same item.
4614 @kindex C-c C-x C-x
4615 @item C-c C-x C-x
4616 Cancel the current clock.  This is useful if a clock was started by
4617 mistake, or if you ended up working on something else.
4618 @kindex C-c C-x C-j
4619 @item C-c C-x C-j
4620 Jump to the entry that contains the currently running clock.  With a
4621 @kbd{C-u} prefix arg, select the target task from a list of recently clocked
4622 tasks.
4623 @kindex C-c C-x C-d
4624 @item C-c C-x C-d
4625 Display time summaries for each subtree in the current buffer.  This
4626 puts overlays at the end of each headline, showing the total time
4627 recorded under that heading, including the time of any subheadings. You
4628 can use visibility cycling to study the tree, but the overlays disappear
4629 when you change the buffer (see variable
4630 @code{org-remove-highlights-with-change}) or press @kbd{C-c C-c}.
4631 @kindex C-c C-x C-r
4632 @item C-c C-x C-r
4633 Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock
4634 report as an Org mode table into the current file.  When the cursor is
4635 at an existing clock table, just update it.  When called with a prefix
4636 argument, jump to the first clock report in the current document and
4637 update it.
4638 @cindex #+BEGIN: clocktable
4639 @example
4640 #+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
4641 #+END: clocktable
4642 @end example
4643 @noindent
4644 If such a block already exists at point, its content is replaced by the
4645 new table.  The @samp{BEGIN} line can specify options:
4646 @example
4647 :maxlevel    @r{Maximum level depth to which times are listed in the table.}
4648 :emphasize   @r{When @code{t}, emphasize level one and level two items}
4649 :scope       @r{The scope to consider.  This can be any of the following:}
4650              nil        @r{the current buffer or narrowed region}
4651              file       @r{the full current buffer}
4652              subtree    @r{the subtree where the clocktable is located}
4653              treeN      @r{the surrounding level N tree, for example @code{tree3}}
4654              tree       @r{the surrounding level 1 tree}
4655              agenda     @r{all agenda files}
4656              ("file"..) @r{scan these files}
4657              file-with-archives    @r{current file and its archives}
4658              agenda-with-archives  @r{all agenda files, including archives}
4659 :block       @r{The time block to consider.  This block is specified either}
4660              @r{absolute, or relative to the current time and may be any of}
4661              @r{these formats:}
4662              2007-12-31    @r{New year eve 2007}
4663              2007-12       @r{December 2007}
4664              2007-W50      @r{ISO-week 50 in 2007}
4665              2007          @r{the year 2007}
4666              today, yesterday, today-N          @r{a relative day}
4667              thisweek, lastweek, thisweek-N     @r{a relative week}
4668              thismonth, lastmonth, thismonth-N  @r{a relative month}
4669              thisyear, lastyear, thisyear-N     @r{a relative year}
4670              @r{Use @kbd{S-@key{left}/@key{right}} keys to shift the time interval.}
4671 :tstart      @r{A time string specifying when to start considering times}
4672 :tend        @r{A time string specifying when to stop considering times}
4673 :step        @r{@code{week} or @code{day}, to split the table into chunks.}
4674              @r{To use this, @code{:block} or @code{:tstart}, @code{:tend} are needed.}
4675 :link        @r{Link the item headlines in the table to their origins}
4676 @end example
4677 So to get a clock summary of the current level 1 tree, for the current
4678 day, you could write
4679 @example
4680 #+BEGIN: clocktable :maxlevel 2 :block today :scope tree1 :link t
4681 #+END: clocktable
4682 @end example
4683 and to use a specific time range you could write@footnote{Note that all
4684 parameters must be specified in a single line - the line is broken here
4685 only to fit it onto the manual.}
4686 @example
4687 #+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>"
4688                     :tend "<2006-08-10 Thu 12:00>"
4689 #+END: clocktable
4690 @end example
4691 @kindex C-c C-c
4692 @item C-c C-c
4693 @kindex C-c C-x C-u
4694 @itemx C-c C-x C-u
4695 Update dynamical block at point.  The cursor needs to be in the
4696 @code{#+BEGIN} line of the dynamic block.
4697 @kindex C-u C-c C-x C-u
4698 @item C-u C-c C-x C-u
4699 Update all dynamic blocks (@pxref{Dynamic blocks}).  This is useful if
4700 you have several clock table blocks in a buffer.
4701 @kindex S-@key{left}
4702 @kindex S-@key{right}
4703 @item S-@key{left}
4704 @itemx S-@key{right}
4705 Shift the current @code{:block} interval and update the table.  The cursor
4706 needs to be in the @code{#+BEGIN: clocktable} line for this command.  If
4707 @code{:block} is @code{today}, it will be shifted to @code{today-1} etc.
4708 @end table
4710 The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
4711 the agenda (@pxref{Weekly/daily agenda}) to show which tasks have been
4712 worked on or closed during a day.
4714 @node Effort estimates,  , Clocking work time, Dates and Times
4715 @section Effort estimates
4716 @cindex Effort estimates
4718 If you want to plan your work in a very detailed way, or if you need to
4719 produce offers with quotations of the estimated work effort, you may want to
4720 assign effort estimates to entries.  If you are also clocking your work, you
4721 may later want to compare the planned effort with the actual working time, a
4722 great way to improve planning estimates.  Effort estimates are stored in a
4723 special property @samp{Effort}@footnote{You may change the property being
4724 used with the variable @code{org-effort-property}.}.  Clearly the best way to
4725 work with effort estimates is through column view (@pxref{Column view}).  You
4726 should start by setting up discrete values for effort estimates, and a
4727 @code{COLUMNS} format that displays these values together with clock sums (if
4728 you want to clock your time).  For a specific buffer you can use
4730 @example
4731 #+PROPERTY: Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 8:00
4732 #+COLUMNS: %40ITEM(Task) %17Effort(Estimated Effort)@{:@} %CLOCKSUM
4733 @end example
4735 @noindent
4736 or you can set up these values globally by customizing the variables
4737 @code{org-global-properties} and @code{org-columns-default-format}.  In
4738 particular if you want to use this setup also in the agenda, a global setup
4739 may be advised.
4741 The way to assign estimates to individual items is then to switch to column
4742 mode, and to use @kbd{S-@key{right}} and @kbd{S-@key{left}} to change the
4743 value.  The values you enter will immediately be summed up in the hierarchy.
4744 In the column next to it, any clocked time will be displayed.
4746 If you switch to column view in the daily/weekly agenda, the effort column
4747 will summarize the estimated work effort for each day@footnote{Please note
4748 the pitfalls of summing hierarchical data in a flat list (@pxref{Agenda
4749 column view}).}, and you can use this to find space in your schedule.  To get
4750 an overview of the entire part of the day that is committed, you can set the
4751 option @code{org-agenda-columns-add-appointments-to-effort-sum}.  The
4752 appointments on a day that take place over a specified time interval will
4753 then also be added to the load estimate of the day.
4755 @node Remember, Agenda Views, Dates and Times, Top
4756 @chapter Remember
4757 @cindex @file{remember.el}
4759 The @i{Remember} package by John Wiegley lets you store quick notes with
4760 little interruption of your work flow.  See
4761 @uref{http://www.emacswiki.org/cgi-bin/wiki/RememberMode} for more
4762 information.  It is an excellent way to add new notes and tasks to
4763 Org files.  Org significantly expands the possibilities of
4764 @i{remember}: You may define templates for different note types, and
4765 associate target files and headlines with specific templates.  It also
4766 allows you to select the location where a note should be stored
4767 interactively, on the fly.
4769 @menu
4770 * Setting up Remember::         Some code for .emacs to get things going
4771 * Remember templates::          Define the outline of different note types
4772 * Storing notes::               Directly get the note to where it belongs
4773 * Refiling notes::              Moving a note or task to a project
4774 @end menu
4776 @node Setting up Remember, Remember templates, Remember, Remember
4777 @section Setting up Remember
4779 The following customization will tell @i{remember} to use org files as
4780 target, and to create annotations compatible with Org links.
4782 @example
4783 (org-remember-insinuate)
4784 (setq org-directory "~/path/to/my/orgfiles/")
4785 (setq org-default-notes-file (concat org-directory "/notes.org"))
4786 (define-key global-map "\C-cr" 'org-remember)
4787 @end example
4789 The last line binds the command @code{org-remember} to a global
4790 key@footnote{Please select your own key, @kbd{C-c r} is only a
4791 suggestion.}.  @code{org-remember} basically just calls @code{remember},
4792 but it makes a few things easier: If there is an active region, it will
4793 automatically copy the region into the remember buffer.  It also allows
4794 to jump to the buffer and location where remember notes are being
4795 stored: Just call @code{org-remember} with a prefix argument.  If you
4796 use two prefix arguments, Org jumps to the location where the last
4797 remember note was stored.
4799 @node Remember templates, Storing notes, Setting up Remember, Remember
4800 @section Remember templates
4801 @cindex templates, for remember
4803 In combination with Org, you can use templates to generate
4804 different types of @i{remember} notes.  For example, if you would like
4805 to use one template to create general TODO entries, another one for
4806 journal entries, and a third one for collecting random ideas, you could
4807 use:
4809 @example
4810 (setq org-remember-templates
4811  '(("Todo" ?t "* TODO %?\n  %i\n  %a" "~/org/TODO.org" "Tasks")
4812    ("Journal" ?j "* %U %?\n\n  %i\n  %a" "~/org/JOURNAL.org")
4813    ("Idea" ?i "* %^@{Title@}\n  %i\n  %a" "~/org/JOURNAL.org" "New Ideas")))
4814 @end example
4816 @noindent In these entries, the first string is just a name, and the
4817 character specifies how to select the template.  It is useful if the
4818 character is also the first letter of the name.  The next string
4819 specifies the template.  Two more (optional) strings give the file in
4820 which, and the headline under which the new note should be stored.  The
4821 file (if not present or @code{nil}) defaults to
4822 @code{org-default-notes-file}, the heading to
4823 @code{org-remember-default-headline}.  If the file name is not an
4824 absolute path, it will be interpreted relative to @code{org-directory}.
4826 An optional sixth element specifies the contexts in which the user can
4827 select the template.  This element can be either a list of major modes
4828 or a function.  @code{org-remember} will first check whether the function
4829 returns @code{t} or if we are in any of the listed major mode, and select
4830 the template accordingly.
4832 So for example:
4834 @example
4835 (setq org-remember-templates
4836  '(("Bug" ?b "* BUG %?\n  %i\n  %a" "~/org/BUGS.org" "Bugs" (emacs-lisp-mode))
4837    ("Journal" ?j "* %U %?\n\n  %i\n  %a" "~/org/JOURNAL.org" my-check)
4838    ("Idea" ?i "* %^@{Title@}\n  %i\n  %a" "~/org/JOURNAL.org" "New Ideas")))
4839 @end example
4841 The first template will only be available when invoking @code{org-remember}
4842 from an buffer in @code{emacs-lisp-mode}.  The second template will only be
4843 available when the function @code{my-check} returns @code{t}.  The third
4844 template will be proposed in any context.
4846 When you call @kbd{M-x org-remember} (or @kbd{M-x remember}) to remember
4847 something, Org will prompt for a key to select the template (if you have
4848 more than one template) and then prepare the buffer like
4849 @example
4850 * TODO
4851   [[file:link to where you called remember]]
4852 @end example
4854 @noindent
4855 During expansion of the template, special @kbd{%}-escapes allow dynamic
4856 insertion of content:
4857 @example
4858 %^@{prompt@}  @r{prompt the user for a string and replace this sequence with it.}
4859             @r{You may specify a default value and a completion table with}
4860             @r{%^@{prompt|default|completion2|completion3...@}}
4861             @r{The arrow keys access a prompt-specific history.}
4862 %t          @r{time stamp, date only}
4863 %T          @r{time stamp with date and time}
4864 %u, %U      @r{like the above, but inactive time stamps}
4865 %^t         @r{like @code{%t}, but prompt for date.  Similarly @code{%^T}, @code{%^u}, @code{%^U}}
4866             @r{You may define a prompt like @code{%^@{Birthday@}t}}
4867 %n          @r{user name (taken from @code{user-full-name})}
4868 %a          @r{annotation, normally the link created with @code{org-store-link}}
4869 %A          @r{like @code{%a}, but prompt for the description part}
4870 %i          @r{initial content, the region when remember is called with C-u.}
4871             @r{The entire text will be indented like @code{%i} itself.}
4872 %c          @r{Current kill ring head.}
4873 %x          @r{Content of the X clipboard.}
4874 %^C         @r{Interactive selection of which kill or clip to use.}
4875 %^L         @r{Like @code{%^C}, but insert as link.}
4876 %^g         @r{prompt for tags, with completion on tags in target file.}
4877 %^G         @r{prompt for tags, with completion all tags in all agenda files.}
4878 %:keyword   @r{specific information for certain link types, see below}
4879 %[pathname] @r{insert the contents of the file given by @code{pathname}}
4880 %(sexp)     @r{evaluate elisp @code{(sexp)} and replace with the result}
4881 %!          @r{immediately store note after completing the template}
4882             @r{(skipping the @kbd{C-c C-c} that normally triggers storing)}
4883 %&          @r{jump to target location immediately after storing note}
4884 @end example
4886 @noindent
4887 For specific link types, the following keywords will be
4888 defined@footnote{If you define your own link types (@pxref{Adding
4889 hyperlink types}), any property you store with
4890 @code{org-store-link-props} can be accessed in remember templates in a
4891 similar way.}:
4893 @example
4894 Link type          |  Available keywords
4895 -------------------+----------------------------------------------
4896 bbdb               |  %:name %:company
4897 bbdb               |  %::server %:port %:nick
4898 vm, wl, mh, rmail  |  %:type %:subject %:message-id
4899                    |  %:from %:fromname %:fromaddress
4900                    |  %:to   %:toname   %:toaddress
4901                    |  %:fromto @r{(either "to NAME" or "from NAME")@footnote{This will always be the other, not the user.  See the variable @code{org-from-is-user-regexp}.}}
4902 gnus               |  %:group, @r{for messages also all email fields}
4903 w3, w3m            |  %:url
4904 info               |  %:file %:node
4905 calendar           |  %:date"
4906 @end example
4908 @noindent
4909 To place the cursor after template expansion use:
4911 @example
4912 %?          @r{After completing the template, position cursor here.}
4913 @end example
4915 @noindent
4916 If you change your mind about which template to use, call
4917 @code{org-remember} in the remember buffer.  You may then select a new
4918 template that will be filled with the previous context information.
4920 @node Storing notes, Refiling notes, Remember templates, Remember
4921 @section Storing notes
4923 When you are finished preparing a note with @i{remember}, you have to press
4924 @kbd{C-c C-c} to file the note away.  If you have started the clock in the
4925 remember buffer, you will first be asked if you want to clock out
4926 now@footnote{To avoid this query, configure the variable
4927 @code{org-remember-clock-out-on-exit}.}.  If you answer @kbd{n}, the clock
4928 will continue to run after the note is filed away.
4930 The handler will then store the note in the file and under the headline
4931 specified in the template, or it will use the default file and headlines.
4932 The window configuration will be restored, sending you back to the working
4933 context before the call to @code{remember}.  To re-use the location found
4934 during the last call to @code{remember}, exit the remember buffer with
4935 @kbd{C-u C-u C-c C-c}, i.e. specify a double prefix argument to @kbd{C-c
4936 C-c}.
4938 If you want to store the note directly to a different place, use
4939 @kbd{C-u C-c C-c} instead to exit remember@footnote{Configure the
4940 variable @code{org-remember-store-without-prompt} to make this behavior
4941 the default.}.  The handler will then first prompt for a target file -
4942 if you press @key{RET}, the value specified for the template is used.
4943 Then the command offers the headings tree of the selected file, with the
4944 cursor position at the default headline (if you had specified one in the
4945 template).  You can either immediately press @key{RET} to get the note
4946 placed there.  Or you can use the following keys to find a different
4947 location:
4948 @example
4949 @key{TAB}         @r{Cycle visibility.}
4950 @key{down} / @key{up}   @r{Next/previous visible headline.}
4951 n / p        @r{Next/previous visible headline.}
4952 f / b        @r{Next/previous headline same level.}
4953 u            @r{One level up.}
4954 @c 0-9          @r{Digit argument.}
4955 @end example
4956 @noindent
4957 Pressing @key{RET} or @key{left} or @key{right}
4958 then leads to the following result.
4960 @multitable @columnfractions 0.2 0.15 0.65
4961 @item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted}
4962 @item on headline     @tab @key{RET}              @tab as sublevel of the heading at cursor, first or last
4963 @item                 @tab                        @tab depending on @code{org-reverse-note-order}.
4964 @item                 @tab @key{left}/@key{right} @tab as same level, before/after current heading
4965 @item buffer-start    @tab @key{RET} @tab as level 2 heading at end of file or level 1 at beginning
4966 @item                 @tab @tab depending on @code{org-reverse-note-order}.
4967 @item not on headline @tab @key{RET}
4968       @tab at cursor position, level taken from context.
4969 @end multitable
4971 Before inserting the text into a tree, the function ensures that the
4972 text has a headline, i.e. a first line that starts with a @samp{*}.  If
4973 not, a headline is constructed from the current date and some additional
4974 data.  If you have indented the text of the note below the headline, the
4975 indentation will be adapted if inserting the note into the tree requires
4976 demotion from level 1.
4978 @node Refiling notes,  , Storing notes, Remember
4979 @section Refiling notes
4980 @cindex refiling notes
4982 Remember is usually used to quickly capture notes and tasks into one or
4983 a few capture lists.  When reviewing the captured data, you may want to
4984 refile some of the entries into a different list, for example into a
4985 project.  Cutting, finding the right location and then pasting the note
4986 is cumbersome.  To simplify this process, you can use the following
4987 special command:
4989 @table @kbd
4990 @kindex C-c C-w
4991 @item C-c C-w
4992 Refile the entry at point.  This command offers possible locations for
4993 refiling the entry and lets you select one with completion.  The item is
4994 filed below the target heading as a subitem.  Depending on
4995 @code{org-reverse-note-order}, it will be either the first of last
4996 subitem.@* By default, all level 1 headlines in the current buffer are
4997 considered to be targets, but you can have more complex definitions
4998 across a number of files.  See the variable @code{org-refile-targets}
4999 for details.  If you would like to select a location via a file-pathlike
5000 completion along the outline path, see the variable
5001 @code{org-refile-use-outline-path}.
5002 @kindex C-u C-c C-w
5003 @item C-u C-c C-w
5004 Use the refile interface to jump to a heading.
5005 @kindex C-u C-u C-c C-w
5006 @item C-u C-u C-c C-w
5007 Jump to the location where @code{org-refile} last moved a tree to.
5008 @end table
5010 @node Agenda Views, Embedded LaTeX, Remember, Top
5011 @chapter Agenda Views
5012 @cindex agenda views
5014 Due to the way Org works, TODO items, time-stamped items, and
5015 tagged headlines can be scattered throughout a file or even a number of
5016 files.  To get an overview of open action items, or of events that are
5017 important for a particular date, this information must be collected,
5018 sorted and displayed in an organized way.
5020 Org can select items based on various criteria, and display them
5021 in a separate buffer.  Seven different view types are provided:
5023 @itemize @bullet
5024 @item
5025 an @emph{agenda} that is like a calendar and shows information
5026 for specific dates,
5027 @item
5028 a @emph{TODO list} that covers all unfinished
5029 action items,
5030 @item
5031 a @emph{tags view}, showings headlines based on
5032 the tags associated with them,
5033 @item
5034 a @emph{timeline view} that shows all events in a single Org file,
5035 in time-sorted view,
5036 @item
5037 a @emph{keyword search view} that shows all entries from multiple files
5038 that contain specified keywords.
5039 @item
5040 a @emph{stuck projects view} showing projects that currently don't move
5041 along, and
5042 @item
5043 @emph{custom views} that are special tag/keyword searches and
5044 combinations of different views.
5045 @end itemize
5047 @noindent
5048 The extracted information is displayed in a special @emph{agenda
5049 buffer}.  This buffer is read-only, but provides commands to visit the
5050 corresponding locations in the original Org files, and even to
5051 edit these files remotely.
5053 Two variables control how the agenda buffer is displayed and whether the
5054 window configuration is restored when the agenda exits:
5055 @code{org-agenda-window-setup} and
5056 @code{org-agenda-restore-windows-after-quit}.
5058 @menu
5059 * Agenda files::                Files being searched for agenda information
5060 * Agenda dispatcher::           Keyboard access to agenda views
5061 * Built-in agenda views::       What is available out of the box?
5062 * Presentation and sorting::    How agenda items are prepared for display
5063 * Agenda commands::             Remote editing of Org trees
5064 * Custom agenda views::         Defining special searches and views
5065 * Agenda column view::          Using column view for collected entries
5066 @end menu
5068 @node Agenda files, Agenda dispatcher, Agenda Views, Agenda Views
5069 @section Agenda files
5070 @cindex agenda files
5071 @cindex files for agenda
5073 The information to be shown is normally collected from all @emph{agenda
5074 files}, the files listed in the variable
5075 @code{org-agenda-files}@footnote{If the value of that variable is not a
5076 list, but a single file name, then the list of agenda files will be
5077 maintained in that external file.}. If a directory is part of this list,
5078 all files with the extension @file{.org} in this directory will be part
5079 of the list.
5081 Thus even if you only work with a single Org file, this file should
5082 be put into that list@footnote{When using the dispatcher, pressing
5083 @kbd{<} before selecting a command will actually limit the command to
5084 the current file, and ignore @code{org-agenda-files} until the next
5085 dispatcher command.}.  You can customize @code{org-agenda-files}, but
5086 the easiest way to maintain it is through the following commands
5088 @cindex files, adding to agenda list
5089 @table @kbd
5090 @kindex C-c [
5091 @item C-c [
5092 Add current file to the list of agenda files.  The file is added to
5093 the front of the list.  If it was already in the list, it is moved to
5094 the front.  With a prefix argument, file is added/moved to the end.
5095 @kindex C-c ]
5096 @item C-c ]
5097 Remove current file from the list of agenda files.
5098 @kindex C-,
5099 @kindex C-'
5100 @item C-,
5101 @itemx C-'
5102 Cycle through agenda file list, visiting one file after the other.
5103 @kindex M-x org-iswitchb
5104 @item M-x org-iswitchb
5105 Command to use an @code{iswitchb}-like interface to switch to and between Org
5106 buffers.
5107 @end table
5109 @noindent
5110 The Org menu contains the current list of files and can be used
5111 to visit any of them.
5113 If you would like to focus the agenda temporarily onto a file not in
5114 this list, or onto just one file in the list or even only a subtree in a
5115 file, this can be done in different ways.  For a single agenda command,
5116 you may press @kbd{<} once or several times in the dispatcher
5117 (@pxref{Agenda dispatcher}).  To restrict the agenda scope for an
5118 extended period, use the following commands:
5120 @table @kbd
5121 @kindex C-c C-x <
5122 @item C-c C-x <
5123 Permanently restrict the agenda to the current subtree.  When with a
5124 prefix argument, or with the cursor before the first headline in a file,
5125 the agenda scope is set to the entire file.  This restriction remains in
5126 effect until removed with @kbd{C-c C-x >}, or by typing either @kbd{<}
5127 or @kbd{>} in the agenda dispatcher.  If there is a window displaying an
5128 agenda view, the new restriction takes effect immediately.
5129 @kindex C-c C-x <
5130 @item C-c C-x <
5131 Remove the permanent restriction created by @kbd{C-c C-x <}.
5132 @end table
5134 @noindent
5135 When working with @file{Speedbar}, you can use the following commands in
5136 the Speedbar frame:
5137 @table @kbd
5138 @kindex <
5139 @item < @r{in the speedbar frame}
5140 Permanently restrict the agenda to the item at the cursor in the
5141 Speedbar frame, either an Org file or a subtree in such a file.
5142 If there is a window displaying an agenda view, the new restriction takes
5143 effect immediately.
5144 @kindex <
5145 @item > @r{in the speedbar frame}
5146 Lift the restriction again.
5147 @end table
5149 @node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda Views
5150 @section The agenda dispatcher
5151 @cindex agenda dispatcher
5152 @cindex dispatching agenda commands
5153 The views are created through a dispatcher that should be bound to a
5154 global key, for example @kbd{C-c a} (@pxref{Installation}).  In the
5155 following we will assume that @kbd{C-c a} is indeed how the dispatcher
5156 is accessed and list keyboard access to commands accordingly.  After
5157 pressing @kbd{C-c a}, an additional letter is required to execute a
5158 command.  The dispatcher offers the following default commands:
5159 @table @kbd
5160 @item a
5161 Create the calendar-like agenda (@pxref{Weekly/daily agenda}).
5162 @item t @r{/} T
5163 Create a list of all TODO items (@pxref{Global TODO list}).
5164 @item m @r{/} M
5165 Create a list of headlines matching a TAGS expression (@pxref{Matching
5166 tags and properties}).
5167 @item L
5168 Create the timeline view for the current buffer (@pxref{Timeline}).
5169 @item s
5170 Create a list of entries selected by a boolean expression of keywords
5171 and/or regular expressions that must or must not occur in the entry.
5172 @item /
5173 Search for a regular expression in all agenda files and additionally in
5174 the files listed in @code{org-agenda-multi-occur-extra-files}.  This
5175 uses the Emacs command @code{multi-occur}.  A prefix argument can be
5176 used to specify the number of context lines for each match, default is
5178 @item # @r{/} !
5179 Create a list of stuck projects (@pxref{Stuck projects}).
5180 @item <
5181 Restrict an agenda command to the current buffer@footnote{For backward
5182 compatibility, you can also press @kbd{1} to restrict to the current
5183 buffer.}.  After pressing @kbd{<}, you still need to press the character
5184 selecting the command.
5185 @item < <
5186 If there is an active region, restrict the following agenda command to
5187 the region.  Otherwise, restrict it to the current subtree@footnote{For
5188 backward compatibility, you can also press @kbd{0} to restrict to the
5189 current buffer.}.  After pressing @kbd{< <}, you still need to press the
5190 character selecting the command.
5191 @end table
5193 You can also define custom commands that will be accessible through the
5194 dispatcher, just like the default commands.  This includes the
5195 possibility to create extended agenda buffers that contain several
5196 blocks together, for example the weekly agenda, the global TODO list and
5197 a number of special tags matches.  @xref{Custom agenda views}.
5199 @node Built-in agenda views, Presentation and sorting, Agenda dispatcher, Agenda Views
5200 @section The built-in agenda views
5202 In this section we describe the built-in views.
5204 @menu
5205 * Weekly/daily agenda::         The calendar page with current tasks
5206 * Global TODO list::            All unfinished action items
5207 * Matching tags and properties::  Structured information with fine-tuned search
5208 * Timeline::                    Time-sorted view for single file
5209 * Keyword search::              Finding entries by keyword
5210 * Stuck projects::              Find projects you need to review
5211 @end menu
5213 @node Weekly/daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views
5214 @subsection The weekly/daily agenda
5215 @cindex agenda
5216 @cindex weekly agenda
5217 @cindex daily agenda
5219 The purpose of the weekly/daily @emph{agenda} is to act like a page of a
5220 paper agenda, showing all the tasks for the current week or day.
5222 @table @kbd
5223 @cindex org-agenda, command
5224 @kindex C-c a a
5225 @item C-c a a
5226 Compile an agenda for the current week from a list of org files.  The
5227 agenda shows the entries for each day.  With a numeric
5228 prefix@footnote{For backward compatibility, the universal prefix
5229 @kbd{C-u} causes all TODO entries to be listed before the agenda.  This
5230 feature is deprecated, use the dedicated TODO list, or a block agenda
5231 instead.}  (like @kbd{C-u 2 1 C-c a a}) you may set the number of days
5232 to be displayed (see also the variable @code{org-agenda-ndays})
5233 @end table
5235 Remote editing from the agenda buffer means, for example, that you can
5236 change the dates of deadlines and appointments from the agenda buffer.
5237 The commands available in the Agenda buffer are listed in @ref{Agenda
5238 commands}.
5240 @subsubheading Calendar/Diary integration
5241 @cindex calendar integration
5242 @cindex diary integration
5244 Emacs contains the calendar and diary by Edward M. Reingold.  The
5245 calendar displays a three-month calendar with holidays from different
5246 countries and cultures.  The diary allows you to keep track of
5247 anniversaries, lunar phases, sunrise/set, recurrent appointments
5248 (weekly, monthly) and more.  In this way, it is quite complementary to
5249 Org.  It can be very useful to combine output from Org with
5250 the diary.
5252 In order to include entries from the Emacs diary into Org mode's
5253 agenda, you only need to customize the variable
5255 @lisp
5256 (setq org-agenda-include-diary t)
5257 @end lisp
5259 @noindent After that, everything will happen automatically.  All diary
5260 entries including holidays, anniversaries etc will be included in the
5261 agenda buffer created by Org mode.  @key{SPC}, @key{TAB}, and
5262 @key{RET} can be used from the agenda buffer to jump to the diary
5263 file in order to edit existing diary entries.  The @kbd{i} command to
5264 insert new entries for the current date works in the agenda buffer, as
5265 well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display
5266 Sunrise/Sunset times, show lunar phases and to convert to other
5267 calendars, respectively.  @kbd{c} can be used to switch back and forth
5268 between calendar and agenda.
5270 If you are using the diary only for sexp entries and holidays, it is
5271 faster to not use the above setting, but instead to copy or even move
5272 the entries into an Org file. Org mode evaluates diary-style sexp
5273 entries, and does it faster because there is no overhead for first
5274 creating the diary display.  Note that the sexp entries must start at
5275 the left margin, no white space is allowed before them.  For example,
5276 the following segment of an Org file will be processed and entries
5277 will be made in the agenda:
5279 @example
5280 * Birthdays and similar stuff
5281 #+CATEGORY: Holiday
5282 %%(org-calendar-holiday)   ; special function for holiday names
5283 #+CATEGORY: Ann
5284 %%(diary-anniversary 14  5 1956) Arthur Dent is %d years old
5285 %%(diary-anniversary  2 10 1869) Mahatma Gandhi would be %d years old
5286 @end example
5288 @subsubheading Appointment reminders
5289 @cindex @file{appt.el}
5290 @cindex appointment reminders
5292 Org can interact with Emacs appointments notification facility.
5294 To add all the appointments of your agenda files, use the command
5295 @code{org-agenda-to-appt}.  This commands also lets you filter through
5296 the list of your appointments and add only those belonging to a specific
5297 category or matching a regular expression. See the docstring for
5298 details.
5300 @node Global TODO list, Matching tags and properties, Weekly/daily agenda, Built-in agenda views
5301 @subsection The global TODO list
5302 @cindex global TODO list
5303 @cindex TODO list, global
5305 The global TODO list contains all unfinished TODO items, formatted and
5306 collected into a single place.
5308 @table @kbd
5309 @kindex C-c a t
5310 @item C-c a t
5311 Show the global TODO list.  This collects the TODO items from all
5312 agenda files (@pxref{Agenda Views}) into a single buffer.  The buffer is in
5313 @code{agenda-mode}, so there are commands to examine and manipulate
5314 the TODO entries directly from that buffer (@pxref{Agenda commands}).
5315 @kindex C-c a T
5316 @item C-c a T
5317 @cindex TODO keyword matching
5318 Like the above, but allows selection of a specific TODO keyword.  You
5319 can also do this by specifying a prefix argument to @kbd{C-c a t}.  With
5320 a @kbd{C-u} prefix you are prompted for a keyword, and you may also
5321 specify several keywords by separating them with @samp{|} as boolean OR
5322 operator.  With a numeric prefix, the Nth keyword in
5323 @code{org-todo-keywords} is selected.
5324 @kindex r
5325 The @kbd{r} key in the agenda buffer regenerates it, and you can give
5326 a prefix argument to this command to change the selected TODO keyword,
5327 for example @kbd{3 r}.  If you often need a search for a specific
5328 keyword, define a custom command for it (@pxref{Agenda dispatcher}).@*
5329 Matching specific TODO keywords can also be done as part of a tags
5330 search (@pxref{Tag searches}).
5331 @end table
5333 Remote editing of TODO items means that you can change the state of a
5334 TODO entry with a single key press.  The commands available in the
5335 TODO list are described in @ref{Agenda commands}.
5337 @cindex sublevels, inclusion into TODO list
5338 Normally the global TODO list simply shows all headlines with TODO
5339 keywords.  This list can become very long.  There are two ways to keep
5340 it more compact:
5341 @itemize @minus
5342 @item
5343 Some people view a TODO item that has been @emph{scheduled} for
5344 execution (@pxref{Timestamps}) as no longer @emph{open}.  Configure the
5345 variable @code{org-agenda-todo-ignore-scheduled} to exclude scheduled
5346 items from the global TODO list.
5347 @item
5348 TODO items may have sublevels to break up the task into subtasks.  In
5349 such cases it may be enough to list only the highest level TODO headline
5350 and omit the sublevels from the global list.  Configure the variable
5351 @code{org-agenda-todo-list-sublevels} to get this behavior.
5352 @end itemize
5354 @node Matching tags and properties, Timeline, Global TODO list, Built-in agenda views
5355 @subsection Matching tags and properties
5356 @cindex matching, of tags
5357 @cindex matching, of properties
5358 @cindex tags view
5360 If headlines in the agenda files are marked with @emph{tags}
5361 (@pxref{Tags}), you can select headlines based on the tags that apply
5362 to them and collect them into an agenda buffer.
5364 @table @kbd
5365 @kindex C-c a m
5366 @item C-c a m
5367 Produce a list of all headlines that match a given set of tags.  The
5368 command prompts for a selection criterion, which is a boolean logic
5369 expression with tags, like @samp{+work+urgent-withboss} or
5370 @samp{work|home} (@pxref{Tags}).  If you often need a specific search,
5371 define a custom command for it (@pxref{Agenda dispatcher}).
5372 @kindex C-c a M
5373 @item C-c a M
5374 Like @kbd{C-c a m}, but only select headlines that are also TODO items
5375 and force checking subitems (see variable
5376 @code{org-tags-match-list-sublevels}).  Matching specific TODO keywords
5377 together with a tags match is also possible, see @ref{Tag searches}.
5378 @end table
5380 The commands available in the tags list are described in @ref{Agenda
5381 commands}.
5383 @node Timeline, Keyword search, Matching tags and properties, Built-in agenda views
5384 @subsection Timeline for a single file
5385 @cindex timeline, single file
5386 @cindex time-sorted view
5388 The timeline summarizes all time-stamped items from a single Org mode
5389 file in a @emph{time-sorted view}.  The main purpose of this command is
5390 to give an overview over events in a project.
5392 @table @kbd
5393 @kindex C-c a L
5394 @item C-c a L
5395 Show a time-sorted view of the org file, with all time-stamped items.
5396 When called with a @kbd{C-u} prefix, all unfinished TODO entries
5397 (scheduled or not) are also listed under the current date.
5398 @end table
5400 @noindent
5401 The commands available in the timeline buffer are listed in
5402 @ref{Agenda commands}.
5404 @node Keyword search, Stuck projects, Timeline, Built-in agenda views
5405 @subsection Keyword search
5406 @cindex keyword search
5407 @cindex searching, for keywords
5409 This agenda view is a general text search facility for Org mode entries.
5410 It is particularly useful to find notes.
5412 @table @kbd
5413 @kindex C-c a s
5414 @item C-c a s
5415 This is a special search that lets you select entries by keywords or
5416 regular expression, using a boolean logic.  For example, the search
5417 string
5419 @example
5420 +computer +wifi -ethernet -@{8\.11[bg]@}
5421 @end example
5423 @noindent
5424 will search for note entries that contain the keywords @code{computer}
5425 and @code{wifi}, but not the keyword @code{ethernet}, and which are also
5426 not matched by the regular expression @code{8\.11[bg]}, meaning to
5427 exclude both 8.11b and 8.11g.
5429 Note that in addition to the agenda files, this command will also search
5430 the files listed in @code{org-agenda-text-search-extra-files}.
5431 @end table
5433 @node Stuck projects,  , Keyword search, Built-in agenda views
5434 @subsection Stuck projects
5436 If you are following a system like David Allen's GTD to organize your
5437 work, one of the ``duties'' you have is a regular review to make sure
5438 that all projects move along.  A @emph{stuck} project is a project that
5439 has no defined next actions, so it will never show up in the TODO lists
5440 Org mode produces.  During the review, you need to identify such
5441 projects and define next actions for them.
5443 @table @kbd
5444 @kindex C-c a #
5445 @item C-c a #
5446 List projects that are stuck.
5447 @kindex C-c a !
5448 @item C-c a !
5449 Customize the variable @code{org-stuck-projects} to define what a stuck
5450 project is and how to find it.
5451 @end table
5453 You almost certainly will have to configure this view before it will
5454 work for you.  The built-in default assumes that all your projects are
5455 level-2 headlines, and that a project is not stuck if it has at least
5456 one entry marked with a TODO keyword TODO or NEXT or NEXTACTION.
5458 Lets assume that you, in your own way of using Org mode, identify
5459 projects with a tag PROJECT, and that you use a TODO keyword MAYBE to
5460 indicate a project that should not be considered yet.  Lets further
5461 assume that the TODO keyword DONE marks finished projects, and that NEXT
5462 and TODO indicate next actions.  The tag @@SHOP indicates shopping and
5463 is a next action even without the NEXT tag.  Finally, if the project
5464 contains the special word IGNORE anywhere, it should not be listed
5465 either.  In this case you would start by identifying eligible projects
5466 with a tags/todo match @samp{+PROJECT/-MAYBE-DONE}, and then check for
5467 TODO, NEXT, @@SHOP, and IGNORE in the subtree to identify projects that
5468 are not stuck.  The correct customization for this is
5470 @lisp
5471 (setq org-stuck-projects
5472       '("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@@SHOP")
5473                                "\\<IGNORE\\>"))
5474 @end lisp
5477 @node Presentation and sorting, Agenda commands, Built-in agenda views, Agenda Views
5478 @section Presentation and sorting
5479 @cindex presentation, of agenda items
5481 Before displaying items in an agenda view, Org mode visually prepares
5482 the items and sorts them.  Each item occupies a single line.  The line
5483 starts with a @emph{prefix} that contains the @emph{category}
5484 (@pxref{Categories}) of the item and other important information.  You can
5485 customize the prefix using the option @code{org-agenda-prefix-format}.
5486 The prefix is followed by a cleaned-up version of the outline headline
5487 associated with the item.
5489 @menu
5490 * Categories::                  Not all tasks are equal
5491 * Time-of-day specifications::  How the agenda knows the time
5492 * Sorting of agenda items::     The order of things
5493 @end menu
5495 @node Categories, Time-of-day specifications, Presentation and sorting, Presentation and sorting
5496 @subsection Categories
5498 @cindex category
5499 The category is a broad label assigned to each agenda item.  By default,
5500 the category is simply derived from the file name, but you can also
5501 specify it with a special line in the buffer, like this@footnote{For
5502 backward compatibility, the following also works: If there are several
5503 such lines in a file, each specifies the category for the text below it.
5504 The first category also applies to any text before the first CATEGORY
5505 line.  However, using this method is @emph{strongly} deprecated as it is
5506 incompatible with the outline structure of the document.  The correct
5507 method for setting multiple categories in a buffer is using a
5508 property.}:
5510 @example
5511 #+CATEGORY: Thesis
5512 @end example
5514 @noindent
5515 If you would like to have a special CATEGORY for a single entry or a
5516 (sub)tree, give the entry a @code{:CATEGORY:} property with the location
5517 as the value (@pxref{Properties and Columns}).
5519 @noindent
5520 The display in the agenda buffer looks best if the category is not
5521 longer than 10 characters.
5523 @node Time-of-day specifications, Sorting of agenda items, Categories, Presentation and sorting
5524 @subsection Time-of-day specifications
5525 @cindex time-of-day specification
5527 Org mode checks each agenda item for a time-of-day specification.  The
5528 time can be part of the time stamp that triggered inclusion into the
5529 agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}.  Time
5530 ranges can be specified with two time stamps, like
5532 @w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
5534 In the headline of the entry itself, a time(range) may also appear as
5535 plain text (like @samp{12:45} or a @samp{8:30-1pm}.  If the agenda
5536 integrates the Emacs diary (@pxref{Weekly/daily agenda}), time
5537 specifications in diary entries are recognized as well.
5539 For agenda display, Org mode extracts the time and displays it in a
5540 standard 24 hour format as part of the prefix.  The example times in
5541 the previous paragraphs would end up in the agenda like this:
5543 @example
5544     8:30-13:00 Arthur Dent lies in front of the bulldozer
5545    12:45...... Ford Prefect arrives and takes Arthur to the pub
5546    19:00...... The Vogon reads his poem
5547    20:30-22:15 Marwin escorts the Hitchhikers to the bridge
5548 @end example
5550 @cindex time grid
5551 If the agenda is in single-day mode, or for the display of today, the
5552 timed entries are embedded in a time grid, like
5554 @example
5555     8:00...... ------------------
5556     8:30-13:00 Arthur Dent lies in front of the bulldozer
5557    10:00...... ------------------
5558    12:00...... ------------------
5559    12:45...... Ford Prefect arrives and takes Arthur to the pub
5560    14:00...... ------------------
5561    16:00...... ------------------
5562    18:00...... ------------------
5563    19:00...... The Vogon reads his poem
5564    20:00...... ------------------
5565    20:30-22:15 Marwin escorts the Hitchhikers to the bridge
5566 @end example
5568 The time grid can be turned on and off with the variable
5569 @code{org-agenda-use-time-grid}, and can be configured with
5570 @code{org-agenda-time-grid}.
5572 @node Sorting of agenda items,  , Time-of-day specifications, Presentation and sorting
5573 @subsection Sorting of agenda items
5574 @cindex sorting, of agenda items
5575 @cindex priorities, of agenda items
5576 Before being inserted into a view, the items are sorted.  How this is
5577 done depends on the type of view.
5578 @itemize @bullet
5579 @item
5580 For the daily/weekly agenda, the items for each day are sorted.  The
5581 default order is to first collect all items containing an explicit
5582 time-of-day specification.  These entries will be shown at the beginning
5583 of the list, as a @emph{schedule} for the day.  After that, items remain
5584 grouped in categories, in the sequence given by @code{org-agenda-files}.
5585 Within each category, items are sorted by priority (@pxref{Priorities}),
5586 which is composed of the base priority (2000 for priority @samp{A}, 1000
5587 for @samp{B}, and 0 for @samp{C}), plus additional increments for
5588 overdue scheduled or deadline items.
5589 @item
5590 For the TODO list, items remain in the order of categories, but within
5591 each category, sorting takes place according to priority
5592 (@pxref{Priorities}).
5593 @item
5594 For tags matches, items are not sorted at all, but just appear in the
5595 sequence in which they are found in the agenda files.
5596 @end itemize
5598 Sorting can be customized using the variable
5599 @code{org-agenda-sorting-strategy}, and may also include criteria based on
5600 the estimated effort of an entry.
5601 @c FIXME: link!!!!!!!!
5604 @node Agenda commands, Custom agenda views, Presentation and sorting, Agenda Views
5605 @section Commands in the agenda buffer
5606 @cindex commands, in agenda buffer
5608 Entries in the agenda buffer are linked back to the org file or diary
5609 file where they originate.  You are not allowed to edit the agenda
5610 buffer itself, but commands are provided to show and jump to the
5611 original entry location, and to edit the org-files ``remotely'' from
5612 the agenda buffer.  In this way, all information is stored only once,
5613 removing the risk that your agenda and note files may diverge.
5615 Some commands can be executed with mouse clicks on agenda lines.  For
5616 the other commands, the cursor needs to be in the desired line.
5618 @table @kbd
5619 @tsubheading{Motion}
5620 @cindex motion commands in agenda
5621 @kindex n
5622 @item n
5623 Next line (same as @key{up} and @kbd{C-p}).
5624 @kindex p
5625 @item p
5626 Previous line (same as @key{down} and @kbd{C-n}).
5627 @tsubheading{View/Go to org file}
5628 @kindex mouse-3
5629 @kindex @key{SPC}
5630 @item mouse-3
5631 @itemx @key{SPC}
5632 Display the original location of the item in another window.
5634 @kindex L
5635 @item L
5636 Display original location and recenter that window.
5638 @kindex mouse-2
5639 @kindex mouse-1
5640 @kindex @key{TAB}
5641 @item mouse-2
5642 @itemx mouse-1
5643 @itemx @key{TAB}
5644 Go to the original location of the item in another window.  Under Emacs
5645 22, @kbd{mouse-1} will also works for this.
5647 @kindex @key{RET}
5648 @itemx @key{RET}
5649 Go to the original location of the item and delete other windows.
5651 @kindex f
5652 @item f
5653 Toggle Follow mode.  In Follow mode, as you move the cursor through
5654 the agenda buffer, the other window always shows the corresponding
5655 location in the org file.  The initial setting for this mode in new
5656 agenda buffers can be set with the variable
5657 @code{org-agenda-start-with-follow-mode}.
5659 @kindex b
5660 @item b
5661 Display the entire subtree of the current item in an indirect buffer.  With a
5662 numeric prefix argument N, go up to level N and then take that tree.  If N is
5663 negative, go up that many levels.  With a @kbd{C-u} prefix, do not remove the
5664 previously used indirect buffer.
5666 @kindex l
5667 @item l
5668 Toggle Logbook mode.  In Logbook mode, entries that where marked DONE while
5669 logging was on (variable @code{org-log-done}) are shown in the agenda,
5670 as are entries that have been clocked on that day.
5672 @kindex R
5673 @item R
5674 Toggle Clockreport mode.  In clockreport mode, the daily/weekly agenda will
5675 always show a table with the clocked times for the timespan and file scope
5676 covered by the current agenda view.  The initial setting for this mode in new
5677 agenda buffers can be set with the variable
5678 @code{org-agenda-start-with-clockreport-mode}.
5680 @tsubheading{Change display}
5681 @cindex display changing, in agenda
5682 @kindex o
5683 @item o
5684 Delete other windows.
5686 @kindex d
5687 @kindex w
5688 @kindex m
5689 @kindex y
5690 @item d w m y
5691 Switch to day/week/month/year view.  When switching to day or week view,
5692 this setting becomes the default for subsequent agenda commands.  Since
5693 month and year views are slow to create, they do not become the default.
5694 A numeric prefix argument may be used to jump directly to a specific day
5695 of the year, ISO week, month, or year, respectively.  For example,
5696 @kbd{32 d} jumps to February 1st, @kbd{9 w} to ISO week number 9.  When
5697 setting day, week, or month view, a year may be encoded in the prefix
5698 argument as well.  For example, @kbd{200712 w} will jump to week 12 in
5699 2007.  If such a year specification has only one or two digits, it will
5700 be mapped to the interval 1938-2037.
5702 @kindex D
5703 @item D
5704 Toggle the inclusion of diary entries.  See @ref{Weekly/daily agenda}.
5706 @kindex G
5707 @item G
5708 Toggle the time grid on and off.  See also the variables
5709 @code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
5711 @kindex r
5712 @item r
5713 Recreate the agenda buffer, for example to reflect the changes
5714 after modification of the time stamps of items with S-@key{left} and
5715 S-@key{right}.  When the buffer is the global TODO list, a prefix
5716 argument is interpreted to create a selective list for a specific TODO
5717 keyword.
5718 @kindex g
5719 @item g
5720 Same as @kbd{r}.
5722 @kindex s
5723 @kindex C-x C-s
5724 @item s
5725 @itemx C-x C-s
5726 Save all Org buffers in the current Emacs session.
5728 @kindex @key{right}
5729 @item @key{right}
5730 Display the following @code{org-agenda-ndays} days.  For example, if
5731 the display covers a week, switch to the following week.  With prefix
5732 arg, go forward that many times @code{org-agenda-ndays} days.
5734 @kindex @key{left}
5735 @item @key{left}
5736 Display the previous dates.
5738 @kindex .
5739 @item .
5740 Go to today.
5742 @kindex C-c C-x C-c
5743 @item C-c C-x C-c
5744 Invoke column view (@pxref{Column view}) in the agenda buffer.  The column
5745 view format is taken from the entry at point, or (if there is no entry at
5746 point), from the first entry in the agenda view.  So whatever the format for
5747 that entry would be in the original buffer (taken from a property, from a
5748 @code{#+COLUMNS} line, or from the default variable
5749 @code{org-columns-default-format}), will be used in the agenda.
5751 @tsubheading{Query editing}
5752 @cindex query editing, in agenda
5754 @kindex [
5755 @kindex ]
5756 @kindex @{
5757 @kindex @}
5758 @item [ ] @{ @}
5759 In the @i{search view} (@pxref{Keyword search}), these keys add new
5760 search words (@kbd{[} and @kbd{]}) or new regular expressions (@kbd{@{}
5761 and @kbd{@}}) to the query string.  The opening bracket/brace will add a
5762 positive search term prefixed by @samp{+}, indicating that this search
5763 term @i{must} occur/match in the entry.  Closing bracket/brace add a
5764 negative search term which @i{must not} occur/match in the entry for it
5765 to be selected.
5768 @tsubheading{Remote editing}
5769 @cindex remote editing, from agenda
5771 @item 0-9
5772 Digit argument.
5774 @cindex undoing remote-editing events
5775 @cindex remote editing, undo
5776 @kindex C-_
5777 @item C-_
5778 Undo a change due to a remote editing command.  The change is undone
5779 both in the agenda buffer and in the remote buffer.
5781 @kindex t
5782 @item t
5783 Change the TODO state of the item, both in the agenda and in the
5784 original org file.
5786 @kindex C-k
5787 @item C-k
5788 Delete the current agenda item along with the entire subtree belonging
5789 to it in the original Org file.  If the text to be deleted remotely
5790 is longer than one line, the kill needs to be confirmed by the user.  See
5791 variable @code{org-agenda-confirm-kill}.
5793 @kindex a
5794 @item a
5795 Toggle the ARCHIVE tag for the current headline.
5797 @kindex A
5798 @item A
5799 Move the subtree corresponding to the current entry to its @emph{Archive
5800 Sibling}.
5802 @kindex $
5803 @item $
5804 Archive the subtree corresponding to the current headline.  This means the
5805 entry will be moved to the configured archive location, most likely a
5806 different file.
5808 @kindex T
5809 @item T
5810 Show all tags associated with the current item.  Because of
5811 inheritance, this may be more than the tags listed in the line itself.
5813 @kindex :
5814 @item :
5815 Set tags for the current headline.  If there is an active region in the
5816 agenda, change a tag for all headings in the region.
5818 @kindex ,
5819 @item ,
5820 Set the priority for the current item.  Org mode prompts for the
5821 priority character. If you reply with @key{SPC}, the priority cookie
5822 is removed from the entry.
5824 @kindex P
5825 @item P
5826 Display weighted priority of current item.
5828 @kindex +
5829 @kindex S-@key{up}
5830 @item +
5831 @itemx S-@key{up}
5832 Increase the priority of the current item.  The priority is changed in
5833 the original buffer, but the agenda is not resorted.  Use the @kbd{r}
5834 key for this.
5836 @kindex -
5837 @kindex S-@key{down}
5838 @item -
5839 @itemx S-@key{down}
5840 Decrease the priority of the current item.
5842 @kindex C-c C-s
5843 @item C-c C-s
5844 Schedule this item
5846 @kindex C-c C-d
5847 @item C-c C-d
5848 Set a deadline for this item.
5850 @kindex S-@key{right}
5851 @item S-@key{right}
5852 Change the time stamp associated with the current line by one day into the
5853 future.  With a numeric prefix argument, change it by that many days.  For
5854 example, @kbd{3 6 5 S-@key{right}} will change it by a year.  The stamp is
5855 changed in the original org file, but the change is not directly reflected in
5856 the agenda buffer.  Use the @kbd{r} key to update the buffer.
5858 @kindex S-@key{left}
5859 @item S-@key{left}
5860 Change the time stamp associated with the current line by one day
5861 into the past.
5863 @kindex >
5864 @item >
5865 Change the time stamp associated with the current line to today.
5866 The key @kbd{>} has been chosen, because it is the same as @kbd{S-.}
5867 on my keyboard.
5869 @kindex I
5870 @item I
5871 Start the clock on the current item.  If a clock is running already, it
5872 is stopped first.
5874 @kindex O
5875 @item O
5876 Stop the previously started clock.
5878 @kindex X
5879 @item X
5880 Cancel the currently running clock.
5882 @kindex J
5883 @item J
5884 Jump to the running clock in another window.
5886 @tsubheading{Calendar commands}
5887 @cindex calendar commands, from agenda
5888 @kindex c
5889 @item c
5890 Open the Emacs calendar and move to the date at the agenda cursor.
5892 @item c
5893 When in the calendar, compute and show the Org mode agenda for the
5894 date at the cursor.
5896 @cindex diary entries, creating from agenda
5897 @kindex i
5898 @item i
5899 Insert a new entry into the diary.  Prompts for the type of entry
5900 (day, weekly, monthly, yearly, anniversary, cyclic) and creates a new
5901 entry in the diary, just as @kbd{i d} etc. would do in the calendar.
5902 The date is taken from the cursor position.
5904 @kindex M
5905 @item M
5906 Show the phases of the moon for the three months around current date.
5908 @kindex S
5909 @item S
5910 Show sunrise and sunset times.  The geographical location must be set
5911 with calendar variables, see documentation of the Emacs calendar.
5913 @kindex C
5914 @item C
5915 Convert the date at cursor into many other cultural and historic
5916 calendars.
5918 @kindex H
5919 @item H
5920 Show holidays for three month around the cursor date.
5922 @item M-x org-export-icalendar-combine-agenda-files
5923 Export a single iCalendar file containing entries from all agenda files.
5924 This is a globally available command, and also available in the agenda menu.
5926 @tsubheading{Exporting to a file}
5927 @kindex C-x C-w
5928 @item C-x C-w
5929 @cindex exporting agenda views
5930 @cindex agenda views, exporting
5931 Write the agenda view to a file.  Depending on the extension of the
5932 selected file name, the view will be exported as HTML (extension
5933 @file{.html} or @file{.htm}), Postscript (extension @file{.ps}), or
5934 plain text (any other extension).  Use the variable
5935 @code{org-agenda-exporter-settings} to set options for @file{ps-print}
5936 and for @file{htmlize} to be used during export.
5938 @tsubheading{Quit and Exit}
5939 @kindex q
5940 @item q
5941 Quit agenda, remove the agenda buffer.
5943 @kindex x
5944 @cindex agenda files, removing buffers
5945 @item x
5946 Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
5947 for the compilation of the agenda.  Buffers created by the user to
5948 visit org files will not be removed.
5949 @end table
5952 @node Custom agenda views, Agenda column view, Agenda commands, Agenda Views
5953 @section Custom agenda views
5954 @cindex custom agenda views
5955 @cindex agenda views, custom
5957 Custom agenda commands serve two purposes: to store and quickly access
5958 frequently used TODO and tags searches, and to create special composite
5959 agenda buffers.  Custom agenda commands will be accessible through the
5960 dispatcher (@pxref{Agenda dispatcher}), just like the default commands.
5962 @menu
5963 * Storing searches::            Type once, use often
5964 * Block agenda::                All the stuff you need in a single buffer
5965 * Setting Options::             Changing the rules
5966 * Exporting Agenda Views::      Writing agendas to files
5967 * Using the agenda elsewhere::  Using agenda information in other programs
5968 @end menu
5970 @node Storing searches, Block agenda, Custom agenda views, Custom agenda views
5971 @subsection Storing searches
5973 The first application of custom searches is the definition of keyboard
5974 shortcuts for frequently used searches, either creating an agenda
5975 buffer, or a sparse tree (the latter covering of course only the current
5976 buffer).
5977 @kindex C-c a C
5978 Custom commands are configured in the variable
5979 @code{org-agenda-custom-commands}.  You can customize this variable, for
5980 example by pressing @kbd{C-c a C}.  You can also directly set it with
5981 Emacs Lisp in @file{.emacs}.  The following example contains all valid
5982 search types:
5984 @lisp
5985 @group
5986 (setq org-agenda-custom-commands
5987       '(("w" todo "WAITING")
5988         ("W" todo-tree "WAITING")
5989         ("u" tags "+boss-urgent")
5990         ("v" tags-todo "+boss-urgent")
5991         ("U" tags-tree "+boss-urgent")
5992         ("f" occur-tree "\\<FIXME\\>")
5993         ("h" . "HOME+Name tags searches") ; description for "h" prefix
5994         ("hl" tags "+home+Lisa")
5995         ("hp" tags "+home+Peter")
5996         ("hk" tags "+home+Kim")))
5997 @end group
5998 @end lisp
6000 @noindent
6001 The initial string in each entry defines the keys you have to press
6002 after the dispatcher command @kbd{C-c a} in order to access the command.
6003 Usually this will be just a single character, but if you have many
6004 similar commands, you can also define two-letter combinations where the
6005 first character is the same in several combinations and serves as a
6006 prefix key@footnote{You can provide a description for a prefix key by
6007 inserting a cons cell with the prefix and the description.}.  The second
6008 parameter is the search type, followed by the string or regular
6009 expression to be used for the matching.  The example above will
6010 therefore define:
6012 @table @kbd
6013 @item C-c a w
6014 as a global search for TODO entries with @samp{WAITING} as the TODO
6015 keyword
6016 @item C-c a W
6017 as the same search, but only in the current buffer and displaying the
6018 results as a sparse tree
6019 @item C-c a u
6020 as a global tags search for headlines marked @samp{:boss:} but not
6021 @samp{:urgent:}
6022 @item C-c a v
6023 as the same search as @kbd{C-c a u}, but limiting the search to
6024 headlines that are also TODO items
6025 @item C-c a U
6026 as the same search as @kbd{C-c a u}, but only in the current buffer and
6027 displaying the result as a sparse tree
6028 @item C-c a f
6029 to create a sparse tree (again: current buffer only) with all entries
6030 containing the word @samp{FIXME}
6031 @item C-c a h
6032 as a prefix command for a HOME tags search where you have to press an
6033 additional key (@kbd{l}, @kbd{p} or @kbd{k}) to select a name (Lisa,
6034 Peter, or Kim) as additional tag to match.
6035 @end table
6037 @node Block agenda, Setting Options, Storing searches, Custom agenda views
6038 @subsection Block agenda
6039 @cindex block agenda
6040 @cindex agenda, with block views
6042 Another possibility is the construction of agenda views that comprise
6043 the results of @emph{several} commands, each of which creates a block in
6044 the agenda buffer.  The available commands include @code{agenda} for the
6045 daily or weekly agenda (as created with @kbd{C-c a a}), @code{alltodo}
6046 for the global TODO list (as constructed with @kbd{C-c a t}), and the
6047 matching commands discussed above: @code{todo}, @code{tags}, and
6048 @code{tags-todo}.  Here are two examples:
6050 @lisp
6051 @group
6052 (setq org-agenda-custom-commands
6053       '(("h" "Agenda and Home-related tasks"
6054          ((agenda "")
6055           (tags-todo "home")
6056           (tags "garden")))
6057         ("o" "Agenda and Office-related tasks"
6058          ((agenda "")
6059           (tags-todo "work")
6060           (tags "office")))))
6061 @end group
6062 @end lisp
6064 @noindent
6065 This will define @kbd{C-c a h} to create a multi-block view for stuff
6066 you need to attend to at home.  The resulting agenda buffer will contain
6067 your agenda for the current week, all TODO items that carry the tag
6068 @samp{home}, and also all lines tagged with @samp{garden}.  Finally the
6069 command @kbd{C-c a o} provides a similar view for office tasks.
6071 @node Setting Options, Exporting Agenda Views, Block agenda, Custom agenda views
6072 @subsection Setting options for custom commands
6073 @cindex options, for custom agenda views
6075 Org mode contains a number of variables regulating agenda construction
6076 and display.  The global variables define the behavior for all agenda
6077 commands, including the custom commands.  However, if you want to change
6078 some settings just for a single custom view, you can do so.  Setting
6079 options requires inserting a list of variable names and values at the
6080 right spot in @code{org-agenda-custom-commands}.  For example:
6082 @lisp
6083 @group
6084 (setq org-agenda-custom-commands
6085       '(("w" todo "WAITING"
6086          ((org-agenda-sorting-strategy '(priority-down))
6087           (org-agenda-prefix-format "  Mixed: ")))
6088         ("U" tags-tree "+boss-urgent"
6089          ((org-show-following-heading nil)
6090           (org-show-hierarchy-above nil)))
6091         ("N" search ""
6092          ((org-agenda-files '("~org/notes.org"))
6093           (org-agenda-text-search-extra-files nil)))))
6094 @end group
6095 @end lisp
6097 @noindent
6098 Now the @kbd{C-c a w} command will sort the collected entries only by
6099 priority, and the prefix format is modified to just say @samp{  Mixed: }
6100 instead of giving the category of the entry.  The sparse tags tree of
6101 @kbd{C-c a U} will now turn out ultra-compact, because neither the
6102 headline hierarchy above the match, nor the headline following the match
6103 will be shown.  The command @kbd{C-c a N} will do a text search limited
6104 to only a single file.
6106 For command sets creating a block agenda,
6107 @code{org-agenda-custom-commands} has two separate spots for setting
6108 options.  You can add options that should be valid for just a single
6109 command in the set, and options that should be valid for all commands in
6110 the set.  The former are just added to the command entry, the latter
6111 must come after the list of command entries.  Going back to the block
6112 agenda example (@pxref{Block agenda}), let's change the sorting strategy
6113 for the @kbd{C-c a h} commands to @code{priority-down}, but let's sort
6114 the results for GARDEN tags query in the opposite order,
6115 @code{priority-up}.  This would look like this:
6117 @lisp
6118 @group
6119 (setq org-agenda-custom-commands
6120       '(("h" "Agenda and Home-related tasks"
6121          ((agenda)
6122           (tags-todo "home")
6123           (tags "garden"
6124                 ((org-agenda-sorting-strategy '(priority-up)))))
6125          ((org-agenda-sorting-strategy '(priority-down))))
6126         ("o" "Agenda and Office-related tasks"
6127          ((agenda)
6128           (tags-todo "work")
6129           (tags "office")))))
6130 @end group
6131 @end lisp
6133 As you see, the values and parenthesis setting is a little complex.
6134 When in doubt, use the customize interface to set this variable - it
6135 fully supports its structure.  Just one caveat: When setting options in
6136 this interface, the @emph{values} are just lisp expressions.  So if the
6137 value is a string, you need to add the double quotes around the value
6138 yourself.
6141 @node Exporting Agenda Views, Using the agenda elsewhere, Setting Options, Custom agenda views
6142 @subsection Exporting Agenda Views
6143 @cindex agenda views, exporting
6145 If you are away from your computer, it can be very useful to have a
6146 printed version of some agenda views to carry around.  Org mode can
6147 export custom agenda views as plain text, HTML@footnote{You need to
6148 install Hrvoje Niksic' @file{htmlize.el}.} postscript, and iCalendar
6149 files.  If you want to do this only occasionally, use the command
6151 @table @kbd
6152 @kindex C-x C-w
6153 @item C-x C-w
6154 @cindex exporting agenda views
6155 @cindex agenda views, exporting
6156 Write the agenda view to a file.  Depending on the extension of the
6157 selected file name, the view will be exported as HTML (extension
6158 @file{.html} or @file{.htm}), Postscript (extension @file{.ps}),
6159 iCalendar (extension @file{.ics}), or plain text (any other extension).
6160 Use the variable @code{org-agenda-exporter-settings} to
6161 set options for @file{ps-print} and for @file{htmlize} to be used during
6162 export, for example
6164 @lisp
6165 (setq org-agenda-exporter-settings
6166       '((ps-number-of-columns 2)
6167         (ps-landscape-mode t)
6168         (htmlize-output-type 'css)))
6169 @end lisp
6170 @end table
6172 If you need to export certain agenda views frequently, you can associate
6173 any custom agenda command with a list of output file names
6174 @footnote{If you want to store standard views like the weekly agenda
6175 or the global TODO list as well, you need to define custom commands for
6176 them in order to be able to specify file names.}.  Here is an example
6177 that first does define custom commands for the agenda and the global
6178 todo list, together with a number of files to which to export them.
6179 Then we define two block agenda commands and specify file names for them
6180 as well.  File names can be relative to the current working directory,
6181 or absolute.
6183 @lisp
6184 @group
6185 (setq org-agenda-custom-commands
6186       '(("X" agenda "" nil ("agenda.html" "agenda.ps"))
6187         ("Y" alltodo "" nil ("todo.html" "todo.txt" "todo.ps"))
6188         ("h" "Agenda and Home-related tasks"
6189          ((agenda "")
6190           (tags-todo "home")
6191           (tags "garden"))
6192          nil
6193          ("~/views/home.html"))
6194         ("o" "Agenda and Office-related tasks"
6195          ((agenda)
6196           (tags-todo "work")
6197           (tags "office"))
6198          nil
6199          ("~/views/office.ps" "~/calendars/office.ics"))))
6200 @end group
6201 @end lisp
6203 The extension of the file name determines the type of export.  If it is
6204 @file{.html}, Org mode will use the @file{htmlize.el} package to convert
6205 the buffer to HTML and save it to this file name.  If the extension is
6206 @file{.ps}, @code{ps-print-buffer-with-faces} is used to produce
6207 postscript output.  If the extension is @file{.ics}, iCalendar export is
6208 run export over all files that were used to construct the agenda, and
6209 limit the export to entries listed in the agenda now.  Any other
6210 extension produces a plain ASCII file.
6212 The export files are @emph{not} created when you use one of those
6213 commands interactively because this might use too much overhead.
6214 Instead, there is a special command to produce @emph{all} specified
6215 files in one step:
6217 @table @kbd
6218 @kindex C-c a e
6219 @item C-c a e
6220 Export all agenda views that have export file names associated with
6221 them.
6222 @end table
6224 You can use the options section of the custom agenda commands to also
6225 set options for the export commands.  For example:
6227 @lisp
6228 (setq org-agenda-custom-commands
6229       '(("X" agenda ""
6230          ((ps-number-of-columns 2)
6231           (ps-landscape-mode t)
6232           (org-agenda-prefix-format " [ ] ")
6233           (org-agenda-with-colors nil)
6234           (org-agenda-remove-tags t))
6235          ("theagenda.ps"))))
6236 @end lisp
6238 @noindent
6239 This command sets two options for the postscript exporter, to make it
6240 print in two columns in landscape format - the resulting page can be cut
6241 in two and then used in a paper agenda.  The remaining settings modify
6242 the agenda prefix to omit category and scheduling information, and
6243 instead include a checkbox to check off items.  We also remove the tags
6244 to make the lines compact, and we don't want to use colors for the
6245 black-and-white printer.  Settings specified in
6246 @code{org-agenda-exporter-settings} will also apply, but the settings
6247 in @code{org-agenda-custom-commands} take precedence.
6249 @noindent
6250 From the command line you may also use
6251 @example
6252 emacs -f org-batch-store-agenda-views -kill
6253 @end example
6254 @noindent
6255 or, if you need to modify some parameters
6256 @example
6257 emacs -eval '(org-batch-store-agenda-views                      \
6258               org-agenda-ndays 30                               \
6259               org-agenda-start-day "2007-11-01"                 \
6260               org-agenda-include-diary nil                      \
6261               org-agenda-files (quote ("~/org/project.org")))'  \
6262       -kill
6263 @end example
6264 @noindent
6265 which will create the agenda views restricted to the file
6266 @file{~/org/project.org}, without diary entries and with 30 days
6267 extent.
6269 @node Using the agenda elsewhere,  , Exporting Agenda Views, Custom agenda views
6270 @subsection Using agenda information outside of Org
6271 @cindex agenda, pipe
6272 @cindex Scripts, for agenda processing
6274 Org provides commands to access agenda information for the command
6275 line in emacs batch mode.  This extracted information can be sent
6276 directly to a printer, or it can be read by a program that does further
6277 processing of the data.  The first of these commands is the function
6278 @code{org-batch-agenda}, that produces an agenda view and sends it as
6279 ASCII text to STDOUT.  The command takes a single string as parameter.
6280 If the string has length 1, it is used as a key to one of the commands
6281 you have configured in @code{org-agenda-custom-commands}, basically any
6282 key you can use after @kbd{C-c a}.  For example, to directly print the
6283 current TODO list, you could use
6285 @example
6286 emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
6287 @end example
6289 If the parameter is a string with 2 or more characters, it is used as a
6290 tags/todo match string.  For example, to print your local shopping list
6291 (all items with the tag @samp{shop}, but excluding the tag
6292 @samp{NewYork}), you could use
6294 @example
6295 emacs -batch -l ~/.emacs                                      \
6296       -eval '(org-batch-agenda "+shop-NewYork")' | lpr
6297 @end example
6299 @noindent
6300 You may also modify parameters on the fly like this:
6302 @example
6303 emacs -batch -l ~/.emacs                                      \
6304    -eval '(org-batch-agenda "a"                               \
6305             org-agenda-ndays 30                               \
6306             org-agenda-include-diary nil                      \
6307             org-agenda-files (quote ("~/org/project.org")))'  \
6308    | lpr
6309 @end example
6311 @noindent
6312 which will produce a 30 day agenda, fully restricted to the Org file
6313 @file{~/org/projects.org}, not even including the diary.
6315 If you want to process the agenda data in more sophisticated ways, you
6316 can use the command @code{org-batch-agenda-csv} to get a comma-separated
6317 list of values for each agenda item.  Each line in the output will
6318 contain a number of fields separated by commas.  The fields in a line
6319 are:
6321 @example
6322 category     @r{The category of the item}
6323 head         @r{The headline, without TODO kwd, TAGS and PRIORITY}
6324 type         @r{The type of the agenda entry, can be}
6325                 todo               @r{selected in TODO match}
6326                 tagsmatch          @r{selected in tags match}
6327                 diary              @r{imported from diary}
6328                 deadline           @r{a deadline}
6329                 scheduled          @r{scheduled}
6330                 timestamp          @r{appointment, selected by timestamp}
6331                 closed             @r{entry was closed on date}
6332                 upcoming-deadline  @r{warning about nearing deadline}
6333                 past-scheduled     @r{forwarded scheduled item}
6334                 block              @r{entry has date block including date}
6335 todo         @r{The TODO keyword, if any}
6336 tags         @r{All tags including inherited ones, separated by colons}
6337 date         @r{The relevant date, like 2007-2-14}
6338 time         @r{The time, like 15:00-16:50}
6339 extra        @r{String with extra planning info}
6340 priority-l   @r{The priority letter if any was given}
6341 priority-n   @r{The computed numerical priority}
6342 @end example
6344 @noindent
6345 Time and date will only be given if a timestamp (or deadline/scheduled)
6346 lead to the selection of the item.
6348 A CSV list like this is very easy to use in a post processing script.
6349 For example, here is a Perl program that gets the TODO list from
6350 Emacs/Org and prints all the items, preceded by a checkbox:
6352 @example
6353 @group
6354 #!/usr/bin/perl
6356 # define the Emacs command to run
6357 $cmd = "emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv \"t\")'";
6359 # run it and capture the output
6360 $agenda = qx@{$cmd 2>/dev/null@};
6362 # loop over all lines
6363 foreach $line (split(/\n/,$agenda)) @{
6365   # get the individual values
6366   ($category,$head,$type,$todo,$tags,$date,$time,$extra,
6367    $priority_l,$priority_n) = split(/,/,$line);
6369   # proccess and print
6370   print "[ ] $head\n";
6372 @end group
6373 @end example
6375 @node Agenda column view,  , Custom agenda views, Agenda Views
6376 @section Using column view in the agenda
6377 @cindex column view, in agenda
6378 @cindex agenda, column view
6380 Column view (@pxref{Column view}) is normally used to view and edit
6381 properties embedded in the hierarchical structure of an Org file.  It can be
6382 quite useful to use column view also from the agenda, where entries are
6383 collected by certain criteria.
6385 @table @kbd
6386 @kindex C-c C-x C-c
6387 @item C-c C-x C-c
6388 Turn on column view in the agenda.
6389 @end table
6391 To understand how to use this properly, it is important to realize that the
6392 entries in the agenda are no longer in their proper outline environment.
6393 This causes the following issues:
6395 @enumerate
6396 @item
6397 Org needs to make a decision which @code{COLUMNS} format to use.  Since the
6398 entries in the agenda are collected from different files, and different files
6399 may have different @code{COLUMNS} formats, this is a non-trivial problem.
6400 Org first checks if the variable @code{org-overriding-columns-format} is
6401 currently set, and if yes takes the format from there.  Otherwise it takes
6402 the format associated with the first item in the agenda, or, if that item
6403 does not have a specific format (defined in a property, or in it's file), it
6404 uses @code{org-columns-default-format}.
6405 @item
6406 If any of the columns has a summary type defined (@pxref{Column attributes}),
6407 turning on column view in the agenda will visit all relevant agenda files and
6408 make sure that the computations of this property are up to date.  This is
6409 also true for the special @code{CLOCKSUM} property.  Org will then sum the
6410 values displayed in the agenda.  In the daily/weekly agenda, the sums will
6411 cover a single day, in all other views they cover the entire block.  It is
6412 vital to realize that the agenda may show the same entry @emph{twice} (for
6413 example as scheduled and as a deadline), and it may show two entries from the
6414 same hierarchy (for example a @emph{parent} and it's @emph{child}).  In these
6415 cases, the summation in the agenda will lead to incorrect results because
6416 some values will count double.
6417 @item
6418 When the column view in the agenda shows the @code{CLOCKSUM}, that is always
6419 the entire clocked time for this item.  So even in the daily/weekly agenda,
6420 the clocksum listed in column view may originate from times outside the
6421 current view.  This has the advantage that you can compare these values with
6422 a column listing the planned total effort for a task - one of the major
6423 applications for column view in the agenda.  If you want information about
6424 clocked time in the displayed period use clock table mode (press @kbd{R} in
6425 the agenda).
6426 @end enumerate
6429 @node Embedded LaTeX, Exporting, Agenda Views, Top
6430 @chapter Embedded LaTeX
6431 @cindex @TeX{} interpretation
6432 @cindex La@TeX{} interpretation
6434 Plain ASCII is normally sufficient for almost all note taking.  One
6435 exception, however, are scientific notes which need to be able to contain
6436 mathematical symbols and the occasional formula.  La@TeX{}@footnote{La@TeX{}
6437 is a macro system based on Donald E. Knuth's @TeX{} system.  Many of the
6438 features described here as ``La@TeX{}'' are really from @TeX{}, but for
6439 simplicity I am blurring this distinction.}  is widely used to typeset
6440 scientific documents. Org mode supports embedding La@TeX{} code into its
6441 files, because many academics are used to reading La@TeX{} source code, and
6442 because it can be readily processed into images for HTML production.
6444 It is not necessary to mark La@TeX{} macros and code in any special way.
6445 If you observe a few conventions, Org mode knows how to find it and what
6446 to do with it.
6448 @menu
6449 * Math symbols::                TeX macros for symbols and Greek letters
6450 * Subscripts and superscripts::  Simple syntax for raising/lowering text
6451 * LaTeX fragments::             Complex formulas made easy
6452 * Processing LaTeX fragments::  Previewing LaTeX processing
6453 * CDLaTeX mode::                Speed up entering of formulas
6454 @end menu
6456 @node Math symbols, Subscripts and superscripts, Embedded LaTeX, Embedded LaTeX
6457 @section Math symbols
6458 @cindex math symbols
6459 @cindex TeX macros
6461 You can use La@TeX{} macros to insert special symbols like @samp{\alpha}
6462 to indicate the Greek letter, or @samp{\to} to indicate an arrow.
6463 Completion for these macros is available, just type @samp{\} and maybe a
6464 few letters, and press @kbd{M-@key{TAB}} to see possible completions.
6465 Unlike La@TeX{} code, Org mode allows these macros to be present
6466 without surrounding math delimiters, for example:
6468 @example
6469 Angles are written as Greek letters \alpha, \beta and \gamma.
6470 @end example
6472 During HTML export (@pxref{HTML export}), these symbols are translated
6473 into the proper syntax for HTML, for the above examples this is
6474 @samp{&alpha;} and @samp{&rarr;}, respectively.
6476 @node Subscripts and superscripts, LaTeX fragments, Math symbols, Embedded LaTeX
6477 @section Subscripts and superscripts
6478 @cindex subscript
6479 @cindex superscript
6481 Just like in La@TeX{}, @samp{^} and @samp{_} are used to indicate super-
6482 and subscripts.  Again, these can be used without embedding them in
6483 math-mode delimiters.  To increase the readability of ASCII text, it is
6484 not necessary (but OK) to surround multi-character sub- and superscripts
6485 with curly braces.  For example
6487 @example
6488 The mass if the sun is M_sun = 1.989 x 10^30 kg.  The radius of
6489 the sun is R_@{sun@} = 6.96 x 10^8 m.
6490 @end example
6492 To avoid interpretation as raised or lowered text, you can quote
6493 @samp{^} and @samp{_} with a backslash: @samp{\_} and @samp{\^}.
6495 During HTML export (@pxref{HTML export}), subscript and superscripts
6496 are surrounded with @code{<sub>} and @code{<sup>} tags, respectively.
6498 @node LaTeX fragments, Processing LaTeX fragments, Subscripts and superscripts, Embedded LaTeX
6499 @section LaTeX fragments
6500 @cindex LaTeX fragments
6502 With symbols, sub- and superscripts, HTML is pretty much at its end when
6503 it comes to representing mathematical formulas@footnote{Yes, there is
6504 MathML, but that is not yet fully supported by many browsers, and there
6505 is no decent converter for turning La@TeX{} or ASCII representations of
6506 formulas into MathML. So for the time being, converting formulas into
6507 images seems the way to go.}. More complex expressions need a dedicated
6508 formula processor. To this end, Org mode can contain arbitrary La@TeX{}
6509 fragments. It provides commands to preview the typeset result of these
6510 fragments, and upon export to HTML, all fragments will be converted to
6511 images and inlined into the HTML document@footnote{The La@TeX{} export
6512 will not use images for displaying La@TeX{} fragments but include these
6513 fragments directly into the La@TeX{} code.}. For this to work you
6514 need to be on a system with a working La@TeX{} installation. You also
6515 need the @file{dvipng} program, available at
6516 @url{http://sourceforge.net/projects/dvipng/}. The La@TeX{} header that
6517 will be used when processing a fragment can be configured with the
6518 variable @code{org-format-latex-header}.
6520 La@TeX{} fragments don't need any special marking at all.  The following
6521 snippets will be identified as La@TeX{} source code:
6522 @itemize @bullet
6523 @item
6524 Environments of any kind.  The only requirement is that the
6525 @code{\begin} statement appears on a new line, preceded by only
6526 whitespace.
6527 @item
6528 Text within the usual La@TeX{} math delimiters.  To avoid conflicts with
6529 currency specifications, single @samp{$} characters are only recognized
6530 as math delimiters if the enclosed text contains at most two line breaks,
6531 is directly attached to the @samp{$} characters with no whitespace in
6532 between, and if the closing @samp{$} is followed by whitespace or
6533 punctuation.  For the other delimiters, there is no such restriction, so
6534 when in doubt, use @samp{\(...\)} as inline math delimiters.
6535 @end itemize
6537 @noindent For example:
6539 @example
6540 \begin@{equation@}                          % arbitrary environments,
6541 x=\sqrt@{b@}                                % even tables, figures
6542 \end@{equation@}                            % etc
6544 If $a^2=b$ and \( b=2 \), then the solution must be
6545 either $$ a=+\sqrt@{2@} $$ or \[ a=-\sqrt@{2@} \].
6546 @end example
6548 @noindent
6549 If you need any of the delimiter ASCII sequences for other purposes, you
6550 can configure the option @code{org-format-latex-options} to deselect the
6551 ones you do not wish to have interpreted by the La@TeX{} converter.
6553 @node Processing LaTeX fragments, CDLaTeX mode, LaTeX fragments, Embedded LaTeX
6554 @section Processing LaTeX fragments
6555 @cindex LaTeX fragments, preview
6557 La@TeX{} fragments can be processed to produce a preview images of the
6558 typeset expressions:
6560 @table @kbd
6561 @kindex C-c C-x C-l
6562 @item C-c C-x C-l
6563 Produce a preview image of the La@TeX{} fragment at point and overlay it
6564 over the source code.  If there is no fragment at point, process all
6565 fragments in the current entry (between two headlines).  When called
6566 with a prefix argument, process the entire subtree.  When called with
6567 two prefix arguments, or when the cursor is before the first headline,
6568 process the entire buffer.
6569 @kindex C-c C-c
6570 @item C-c C-c
6571 Remove the overlay preview images.
6572 @end table
6574 During HTML export (@pxref{HTML export}), all La@TeX{} fragments are
6575 converted into images and inlined into the document if the following
6576 setting is active:
6578 @lisp
6579 (setq org-export-with-LaTeX-fragments t)
6580 @end lisp
6582 @node CDLaTeX mode,  , Processing LaTeX fragments, Embedded LaTeX
6583 @section Using CDLaTeX to enter math
6584 @cindex CDLaTeX
6586 CDLaTeX mode is a minor mode that is normally used in combination with a
6587 major La@TeX{} mode like AUCTeX in order to speed-up insertion of
6588 environments and math templates.  Inside Org mode, you can make use of
6589 some of the features of CDLaTeX mode.  You need to install
6590 @file{cdlatex.el} and @file{texmathp.el} (the latter comes also with
6591 AUCTeX) from @url{http://www.astro.uva.nl/~dominik/Tools/cdlatex}.
6592 Don't use CDLaTeX mode itself under Org mode, but use the light
6593 version @code{org-cdlatex-mode} that comes as part of Org mode.  Turn it
6594 on for the current buffer with @code{M-x org-cdlatex-mode}, or for all
6595 Org files with
6597 @lisp
6598 (add-hook 'org-mode-hook 'turn-on-org-cdlatex)
6599 @end lisp
6601 When this mode is enabled, the following features are present (for more
6602 details see the documentation of CDLaTeX mode):
6603 @itemize @bullet
6604 @kindex C-c @{
6605 @item
6606 Environment templates can be inserted with @kbd{C-c @{}.
6607 @item
6608 @kindex @key{TAB}
6609 The @key{TAB} key will do template expansion if the cursor is inside a
6610 La@TeX{} fragment@footnote{Org mode has a method to test if the cursor is
6611 inside such a fragment, see the documentation of the function
6612 @code{org-inside-LaTeX-fragment-p}.}.  For example, @key{TAB} will
6613 expand @code{fr} to @code{\frac@{@}@{@}} and position the cursor
6614 correctly inside the first brace.  Another @key{TAB} will get you into
6615 the second brace.  Even outside fragments, @key{TAB} will expand
6616 environment abbreviations at the beginning of a line.  For example, if
6617 you write @samp{equ} at the beginning of a line and press @key{TAB},
6618 this abbreviation will be expanded to an @code{equation} environment.
6619 To get a list of all abbreviations, type @kbd{M-x cdlatex-command-help}.
6620 @item
6621 @kindex _
6622 @kindex ^
6623 Pressing @kbd{_} and @kbd{^} inside a La@TeX{} fragment will insert these
6624 characters together with a pair of braces.  If you use @key{TAB} to move
6625 out of the braces, and if the braces surround only a single character or
6626 macro, they are removed again (depending on the variable
6627 @code{cdlatex-simplify-sub-super-scripts}).
6628 @item
6629 @kindex `
6630 Pressing the backquote @kbd{`} followed by a character inserts math
6631 macros, also outside La@TeX{} fragments.  If you wait more than 1.5 seconds
6632 after the backquote, a help window will pop up.
6633 @item
6634 @kindex '
6635 Pressing the normal quote @kbd{'} followed by another character modifies
6636 the symbol before point with an accent or a font.  If you wait more than
6637 1.5 seconds after the backquote, a help window will pop up.  Character
6638 modification will work only inside La@TeX{} fragments, outside the quote
6639 is normal.
6640 @end itemize
6642 @node Exporting, Publishing, Embedded LaTeX, Top
6643 @chapter Exporting
6644 @cindex exporting
6646 Org mode documents can be exported into a variety of other formats.  For
6647 printing and sharing of notes, ASCII export produces a readable and
6648 simple version of an Org file.  HTML export allows you to publish a
6649 notes file on the web, while the XOXO format provides a solid base for
6650 exchange with a broad range of other applications. La@TeX{} export lets
6651 you use Org mode and its structured editing functions to easily create
6652 La@TeX{} files.  To incorporate entries with associated times like
6653 deadlines or appointments into a desktop calendar program like iCal,
6654 Org mode can also produce extracts in the iCalendar format.  Currently
6655 Org mode only supports export, not import of these different formats.
6657 @menu
6658 * Markup rules::                Which structures are recognized?
6659 * Export options::              Per-file export settings
6660 * The export dispatcher::       How to access exporter commands
6661 * ASCII export::                Exporting to plain ASCII
6662 * HTML export::                 Exporting to HTML
6663 * LaTeX export::                Exporting to LaTeX
6664 * XOXO export::                 Exporting to XOXO
6665 * iCalendar export::            Exporting in iCalendar format
6666 @end menu
6668 @node Markup rules, Export options, Exporting, Exporting
6669 @section Markup rules
6671 When exporting Org mode documents,  the exporter tries to reflect the
6672 structure of the document as accurately as possible in the back-end.  Since
6673 export targets like HTML or La@TeX{} allow much richer formatting, Org mode
6674 has rules how to prepare text for rich export.  This section summarizes the
6675 markup rule used in an Org mode buffer.
6677 @menu
6678 * Document title::              How the document title is determined
6679 * Headings and sections::       The main structure of the exported document
6680 * Table of contents::           If, where, how to create a table of contents
6681 * Initial text::                Text before the first headline
6682 * Lists::                       Plain lists are exported
6683 * Paragraphs::                  What determines beginning and ending
6684 * Literal examples::            Source code and other examples
6685 * Include files::               Include the contents of a file during export
6686 * Tables exported::             Tables are exported richly
6687 * Footnotes::                   Numbers like [1]
6688 * Emphasis and monospace::      To bold or not to bold
6689 * TeX macros and LaTeX fragments::  Create special, rich export.
6690 * Horizontal rules::            A line across the page
6691 * Comment lines::               Some lines will not be exported
6692 @end menu
6694 @node Document title, Headings and sections, Markup rules, Markup rules
6695 @subheading Document title
6696 @cindex document title, markup rules
6698 @noindent
6699 The title of the exported document is taken from the special line
6701 @example
6702 #+TITLE: This is the title of the document
6703 @end example
6705 @noindent
6706 If this line does not exist, the title is derived from the first non-empty,
6707 non-comment line in the buffer.  If no such line exists, or if you have
6708 turned off exporting of the text before the first headline (see below), the
6709 title will be the file name without extension.
6711 If you are exporting only a subtree by marking is as the region, the heading
6712 of the subtree will become the title of the document.  If the subtree has a
6713 property @code{EXPORT_TITLE}, that will take precedence.
6715 @node Headings and sections, Table of contents, Document title, Markup rules
6716 @subheading Headings and sections
6717 @cindex headings and sections, markup rules
6719 The outline structure of the document as described in @ref{Document
6720 Structure} forms the basis for defining sections of the exported document.
6721 However, since the outline structure is also used for (for example) lists of
6722 tasks, only the first three outline levels will be used as headings.  Deeper
6723 levels will become itemized lists.  You can change the location of this
6724 switch, globally by setting the variable @code{org-headline-levels}, or on a
6725 per file basis with a line
6727 @example
6728 #+OPTIONS: H:4
6729 @end example
6731 @node Table of contents, Initial text, Headings and sections, Markup rules
6732 @subheading Table of contents
6733 @cindex table of contents, markup rules
6735 The table of contents is normally inserted directly before the first headline
6736 of the file.  If you would like to get it to a different location, insert the
6737 string @code{[TABLE-OF-CONTENTS]} on a line by itself at the desired
6738 location.  The depth of the table of contents is by default the same as the
6739 number of headline levels, but you can choose a smaller number or turn off
6740 the table of contents entirely by configuring the variable
6741 @code{org-export-with-toc}, or on a per-file basis with a line like
6743 @example
6744 #+OPTIONS: toc:2          (only to two levels in TOC)
6745 #+OPTIONS: toc:nil        (no TOC at all)
6746 @end example
6748 @node Initial text, Lists, Table of contents, Markup rules
6749 @subheading Text before the first headline
6750 @cindex text before first headline, markup rules
6751 @cindex #+TEXT
6753 Org mode normally exports the text before the first headline, and even uses
6754 the first line as the document title.  The text will be fully marked up.  If
6755 you need to include literal HTML or La@TeX{} code, use the special constructs
6756 described below in the sections for the individual exporters.
6758 Some people like to use the space before the first headline for setup and
6759 internal links and therefore would like to control the exported text before
6760 the first headline in a different way.  You can do so by setting the variable
6761 @code{org-export-skip-text-before-1st-heading} to @code{t}.  On a per-file
6762 basis, you can get the same effect with @samp{#+OPTIONS: skip:t}.
6764 @noindent
6765 If you still want to have some text before the first headline, use the
6766 @code{#+TEXT} construct:
6768 @example
6769 #+OPTIONS: skip:t
6770 #+TEXT: This text will go before the *first* headline.
6771 #+TEXT: [TABLE-OF-CONTENTS]
6772 #+TEXT: This goes between the table of contents and the first headline
6773 @end example
6775 @node Lists, Paragraphs, Initial text, Markup rules
6776 @subheading Lists
6777 @cindex lists, markup rules
6779 Plain lists as described in @ref{Plain lists} are translated to the back-ends
6780 syntax for such lists.  Most back-ends support unordered, ordered, and
6781 description lists.
6783 @node Paragraphs, Literal examples, Lists, Markup rules
6784 @subheading Paragraphs, line breaks, and quoting
6785 @cindex paragraphs, markup rules
6787 Paragraphs are separated by at least one empty line.  If you need to enforce
6788 a line break within a paragraph, use @samp{\\} at the end of a line.
6790 To keep the line breaks in a region, but otherwise use normal formatting, you
6791 can use this construct, which can also be used to format poetry.
6793 @example
6794 #+BEGIN_VERSE
6795 Everything should be made as simple as possible,
6796 but not any simpler -- Albert Einstein
6797 #+END_VERSE
6798 @end example
6800 When quoting a passage from another document, it is customary to format this
6801 as a paragraph that is indented on both the left and the right margin.  You
6802 can include quotations in Org mode documents like this:
6804 @example
6805 #+BEGIN_QUOTE
6806 Everything should be made as simple as possible,
6807 but not any simpler -- Albert Einstein
6808 #+END_QUOTE
6809 @end example
6812 @node Literal examples, Include files, Paragraphs, Markup rules
6813 @subheading Literal examples
6814 @cindex literal examples, markup rules
6816 You can include literal examples that should not be subjected to
6817 markup.  Such examples will be typeset in monospace, so this is well suited
6818 for source code and similar examples.
6819 @cindex #+BEGIN_EXAMPLE
6821 @example
6822 #+BEGIN_EXAMPLE
6823 Some example from a text file.
6824 #+END_EXAMPLE
6825 @end example
6827 For simplicity when using small examples, you can also start the example
6828 lines with a colon:
6830 @example
6831 : Some example from a text file.
6832 @end example
6834 @cindex formatting source code, markup rules
6835 If the example is source code from a programming language, or any other text
6836 that can be marked up by font-lock in Emacs, you can ask for the example to
6837 look like the fontified Emacs buffer@footnote{Currently this works only for
6838 the HTML back-end, and requires the @file{htmlize.el} package version 1.34 or
6839 later.}.  This is done with the @samp{src} block, where you also need to
6840 specify the name of the major mode that should be used to fontify the
6841 example:
6842 @cindex #+BEGIN_SRC
6844 @example
6845 #+BEGIN_SRC emacs-lisp
6846 (defun org-xor (a b)
6847    "Exclusive or."
6848    (if a (not b) b))
6849 #+END_SRC
6850 @end example
6852 @table @kbd
6853 @kindex C-c '
6854 @item C-c '
6855 Edit the source code example at point in its native mode.  This works by
6856 switching to an indirect buffer, narrowing the buffer and switching to the
6857 other mode.  You need to exit by pressing @kbd{C-c '} again.
6858 @end table
6861 @node Include files, Tables exported, Literal examples, Markup rules
6862 @subheading Include files
6863 @cindex include files, markup rules
6865 During export, you can include the content of another file.  For example, to
6866 include your .emacs file, you could use:
6867 @cindex #+INCLUDE
6869 @example
6870 #+INCLUDE: "~/.emacs" src emacs-lisp
6871 @end example
6873 The optional second and third parameter are the markup (@samp{quote},
6874 @samp{example}, or @samp{src}), and, if the markup is @samp{src}, the
6875 language for formatting the contents.  The markup is optional, if it is not
6876 given, the text will be assumed to be in Org mode format and will be
6877 processed normally.
6879 @table @kbd
6880 @kindex C-c '
6881 @item C-c '
6882 Visit the include file at point.
6883 @end table
6885 @node Tables exported, Footnotes, Include files, Markup rules
6886 @subheading Tables
6887 @cindex tables, markup rules
6889 Both the native Org mode tables (@pxref{Tables}) and tables formatted with
6890 the @file{table.el} package will be exported properly.  For Org mode tables,
6891 the lines before the first horizontal separator line will become table header
6892 lines.
6894 @node Footnotes, Emphasis and monospace, Tables exported, Markup rules
6895 @subheading Footnotes
6896 @cindex footnotes, markup rules
6897 @cindex @file{footnote.el}
6899 @kindex C-c !
6900 Numbers in square brackets are treated as footnote markers, and lines
6901 starting with such a marker are interpreted as the footnote itself.  You can
6902 use the Emacs package @file{footnote.el} to create footnotes@footnote{The
6903 @file{footnote} package uses @kbd{C-c !} to invoke its commands.  This
6904 binding conflicts with the Org mode command for inserting inactive time
6905 stamps.  You could use the variable @code{footnote-prefix} to switch
6906 footnotes commands to another key.  Or, if you are too used to this binding,
6907 you could use @code{org-replace-disputed-keys} and @code{org-disputed-keys}
6908 to change the settings in Org.}.  For example:
6910 @example
6911 The Org homepage[1] now looks a lot better than it used to.
6913 [1] The link is: http://orgmode.org
6914 @end example
6916 @node Emphasis and monospace, TeX macros and LaTeX fragments, Footnotes, Markup rules
6917 @subheading Emphasis and monospace
6919 @cindex underlined text, markup rules
6920 @cindex bold text, markup rules
6921 @cindex italic text, markup rules
6922 @cindex verbatim text, markup rules
6923 @cindex code text, markup rules
6924 @cindex strike-through text, markup rules
6925 You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=code=}
6926 and @code{~verbatim~}, and, if you must, @samp{+strike-through+}.  Text
6927 in the code and verbatim string is not processed for Org mode specific
6928 syntax, it is exported verbatim.
6930 @node TeX macros and LaTeX fragments, Horizontal rules, Emphasis and monospace, Markup rules
6931 @subheading @TeX{} macros and La@TeX{} fragments
6932 @cindex LaTeX fragments, markup rules
6933 @cindex TeX macros, markup rules
6934 @cindex HTML entities
6935 @cindex LaTeX entities
6937 A @TeX{}-like syntax is used to specify special characters.  Where possible,
6938 these will be transformed into the native format of the exporter back-end.
6939 Strings like @code{\alpha} will be exported as @code{&alpha;} in the HTML
6940 output, and as @code{$\alpha$} in the La@TeX{} output.  Similarly,
6941 @code{\nbsp} will become @code{&nbsp;} in HTML and @code{~} in La@TeX{}.
6942 This applies for a large number of entities, with names taken from both HTML
6943 and La@TeX{}, see the variable @code{org-html-entities} for the complete
6944 list.  If you are unsure about a name, use @kbd{M-@key{TAB}} for completion
6945 after having types the backslash and maybe a few characters
6946 (@pxref{Completion}).
6948 La@TeX{} fragments are converted into images for HTML export, and they are
6949 written literally into the La@TeX{} export.  See also @ref{Embedded LaTeX}.
6951 Finally, @samp{\-} is treated as a shy hyphen, and @samp{--}, @samp{---}, and
6952 @samp{...} are all converted into special commands creating hyphens of
6953 different lengths or a compact set of dots.
6955 @node Horizontal rules, Comment lines, TeX macros and LaTeX fragments, Markup rules
6956 @subheading  Horizontal rules
6957 @cindex horizontal rules, markup rules
6958 A line consisting of only dashes, and at least 5 of them, will be
6959 exported as a horizontal line (@samp{<hr/>} in HTML).
6961 @node Comment lines,  , Horizontal rules, Markup rules
6962 @subheading Comment lines
6963 @cindex comment lines
6964 @cindex exporting, not
6966 Lines starting with @samp{#} in column zero are treated as comments and will
6967 never be exported.  Also entire subtrees starting with the word
6968 @samp{COMMENT} will never be exported.  Finally, regions surrounded by
6969 @samp{#+BEGIN_COMMENT} ... @samp{#+END_COMMENT} will not be exported.
6971 @table @kbd
6972 @kindex C-c ;
6973 @item C-c ;
6974 Toggle the COMMENT keyword at the beginning of an entry.
6975 @end table
6977 @node Export options, The export dispatcher, Markup rules, Exporting
6978 @section Export options
6979 @cindex options, for export
6981 @cindex completion, of option keywords
6982 The exporter recognizes special lines in the buffer which provide
6983 additional information.  These lines may be put anywhere in the file.
6984 The whole set of lines can be inserted into the buffer with @kbd{C-c
6985 C-e t}.  For individual lines, a good way to make sure the keyword is
6986 correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
6987 (@pxref{Completion}).
6989 @table @kbd
6990 @kindex C-c C-e t
6991 @item C-c C-e t
6992 Insert template with export options, see example below.
6993 @end table
6995 @cindex #+TITLE:
6996 @cindex #+AUTHOR:
6997 @cindex #+DATE:
6998 @cindex #+EMAIL:
6999 @cindex #+LANGUAGE:
7000 @cindex #+TEXT:
7001 @cindex #+OPTIONS:
7002 @cindex #+LINK_UP:
7003 @cindex #+LINK_HOME:
7004 @example
7005 #+TITLE:     the title to be shown (default is the buffer name)
7006 #+AUTHOR:    the author (default taken from @code{user-full-name})
7007 #+DATE:      A date, fixed, of a format string for @code{format-time-string}
7008 #+EMAIL:     his/her email address (default from @code{user-mail-address})
7009 #+LANGUAGE:  language for HTML, e.g. @samp{en} (@code{org-export-default-language})
7010 #+TEXT:      Some descriptive text to be inserted at the beginning.
7011 #+TEXT:      Several lines may be given.
7012 #+OPTIONS:   H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t f:t TeX:t ...
7013 #+LINK_UP:   the ``up'' link of an exported page
7014 #+LINK_HOME: the ``home'' link of an exported page
7015 @end example
7017 @noindent
7018 The OPTIONS line is a compact@footnote{If you want to configure many options
7019 this way, you can use several OPTIONS lines.} form to specify export settings.  Here
7020 you can:
7021 @cindex headline levels
7022 @cindex section-numbers
7023 @cindex table of contents
7024 @cindex line-break preservation
7025 @cindex quoted HTML tags
7026 @cindex fixed-width sections
7027 @cindex tables
7028 @cindex @TeX{}-like syntax for sub- and superscripts
7029 @cindex footnotes
7030 @cindex special strings
7031 @cindex emphasized text
7032 @cindex @TeX{} macros
7033 @cindex La@TeX{} fragments
7034 @cindex author info, in export
7035 @cindex time info, in export
7036 @example
7037 H:         @r{set the number of headline levels for export}
7038 num:       @r{turn on/off section-numbers}
7039 toc:       @r{turn on/off table of contents, or set level limit (integer)}
7040 \n:        @r{turn on/off line-break-preservation}
7041 @@:         @r{turn on/off quoted HTML tags}
7042 ::         @r{turn on/off fixed-width sections}
7043 |:         @r{turn on/off tables}
7044 ^:         @r{turn on/off @TeX{}-like syntax for sub- and superscripts.  If}
7045            @r{you write "^:@{@}", @code{a_@{b@}} will be interpreted, but}
7046            @r{the simple @code{a_b} will be left as it is.}
7047 -:         @r{turn on/off conversion of special strings.}
7048 f:         @r{turn on/off footnotes like this[1].}
7049 *:         @r{turn on/off emphasized text (bold, italic, underlined)}
7050 TeX:       @r{turn on/off simple @TeX{} macros in plain text}
7051 LaTeX:     @r{turn on/off La@TeX{} fragments}
7052 skip:      @r{turn on/off skipping the text before the first heading}
7053 author:    @r{turn on/off inclusion of author name/email into exported file}
7054 timestamp: @r{turn on/off inclusion creation time into exported file}
7055 d:         @r{turn on/off inclusion of drawers}
7056 @end example
7058 These options take effect in both the HTML and La@TeX{} export, except
7059 for @code{TeX} and @code{LaTeX}, which are respectively @code{t} and
7060 @code{nil} for the La@TeX{} export.
7062 When exporting only a single subtree by selecting it with @kbd{C-c @@} before
7063 calling an export command, the subtree can overrule some of the file's export
7064 settings with properties @code{EXPORT_FILE_NAME}, @code{EXPORT_TITLE},
7065 @code{EXPORT_TEXT}, and @code{EXPORT_OPTIONS}.
7067 @node The export dispatcher, ASCII export, Export options, Exporting
7068 @section The export dispatcher
7069 @cindex dispatcher, for export commands
7071 All export commands can be reached using the export dispatcher, which is a
7072 prefix key that prompts for an additional key specifying the command.
7073 Normally the entire file is exported, but if there is an active region that
7074 contains one outline tree, the first heading is used as document title and
7075 the subtrees are exported.
7077 @table @kbd
7078 @kindex C-c C-e
7079 @item C-c C-e
7080 Dispatcher for export and publishing commands.  Displays a help-window
7081 listing the additional key(s) needed to launch an export or publishing
7082 command.  The prefix arg is passed through to the exporter.  If the option
7083 @code{org-export-run-in-background} is set, Org will run the command in the
7084 background if that seems useful for the specific command (i.e. commands that
7085 write to a file).
7086 @kindex C-c C-e v
7087 @item C-c C-e v
7088 Like @kbd{C-c C-e}, but only export the text that is currently visible
7089 (i.e. not hidden by outline visibility).
7090 @kindex C-u C-u C-c C-e
7091 @item C-u C-u C-c C-e
7092 Call an the exporter, but reverse the setting of
7093 @code{org-export-run-in-background}, i.e. request background processing if
7094 not set, or force processing in the current Emacs process if st.
7095 @end table
7097 @node ASCII export, HTML export, The export dispatcher, Exporting
7098 @section ASCII export
7099 @cindex ASCII export
7101 ASCII export produces a simple and very readable version of an Org mode
7102 file.
7104 @cindex region, active
7105 @cindex active region
7106 @cindex Transient mark mode
7107 @table @kbd
7108 @kindex C-c C-e a
7109 @item C-c C-e a
7110 Export as ASCII file.  For an org file @file{myfile.org}, the ASCII file
7111 will be @file{myfile.txt}.  The file will be overwritten without
7112 warning.  If there is an active region, only the region will be
7113 exported. If the selected region is a single tree@footnote{To select the
7114 current subtree, use @kbd{C-c @@}.}, the tree head will
7115 become the document title.  If the tree head entry has or inherits an
7116 @code{EXPORT_FILE_NAME} property, that name will be used for the
7117 export.
7118 @kindex C-c C-e v a
7119 @item C-c C-e v a
7120 Export only the visible part of the document.
7121 @end table
7123 @cindex headline levels, for exporting
7124 In the exported version, the first 3 outline levels will become
7125 headlines, defining a general document structure.  Additional levels
7126 will be exported as itemized lists.  If you want that transition to occur
7127 at a different level, specify it with a prefix argument.  For example,
7129 @example
7130 @kbd{C-1 C-c C-e a}
7131 @end example
7133 @noindent
7134 creates only top level headlines and does the rest as items.  When
7135 headlines are converted to items, the indentation of the text following
7136 the headline is changed to fit nicely under the item.  This is done with
7137 the assumption that the first body line indicates the base indentation of
7138 the body text.  Any indentation larger than this is adjusted to preserve
7139 the layout relative to the first line.  Should there be lines with less
7140 indentation than the first, these are left alone.
7142 @node HTML export, LaTeX export, ASCII export, Exporting
7143 @section HTML export
7144 @cindex HTML export
7146 Org mode contains an HTML (XHTML 1.0 strict) exporter with extensive
7147 HTML formatting, in ways similar to John Grubers @emph{markdown}
7148 language, but with additional support for tables.
7150 @menu
7151 * HTML Export commands::        How to invoke HTML export
7152 * Quoting HTML tags::           Using direct HTML in Org mode
7153 * Links::                       Transformation of links for HTML
7154 * Images::                      How to include images
7155 * CSS support::                 Changing the appearance of the output
7156 * Javascript support::          Info and Folding in a web browser
7157 @end menu
7159 @node HTML Export commands, Quoting HTML tags, HTML export, HTML export
7160 @subsection HTML export commands
7162 @cindex region, active
7163 @cindex active region
7164 @cindex Transient mark mode
7165 @table @kbd
7166 @kindex C-c C-e h
7167 @item C-c C-e h
7168 Export as HTML file @file{myfile.html}.  For an org file @file{myfile.org},
7169 the ASCII file will be @file{myfile.html}.  The file will be overwritten
7170 without warning.  If there is an active region, only the region will be
7171 exported. If the selected region is a single tree@footnote{To select the
7172 current subtree, use @kbd{C-c @@}.}, the tree head will become the document
7173 title.  If the tree head entry has or inherits an @code{EXPORT_FILE_NAME}
7174 property, that name will be used for the export.
7175 @kindex C-c C-e b
7176 @item C-c C-e b
7177 Export as HTML file and immediately open it with a browser.
7178 @kindex C-c C-e H
7179 @item C-c C-e H
7180 Export to a temporary buffer, do not create a file.
7181 @kindex C-c C-e R
7182 @item C-c C-e R
7183 Export the active region to a temporary buffer.  With a prefix argument, do
7184 not produce the file header and footer, but just the plain HTML section for
7185 the region.  This is good for cut-and-paste operations.
7186 @kindex C-c C-e v h
7187 @kindex C-c C-e v b
7188 @kindex C-c C-e v H
7189 @kindex C-c C-e v R
7190 @item C-c C-e v h
7191 @item C-c C-e v b
7192 @item C-c C-e v H
7193 @item C-c C-e v R
7194 Export only the visible part of the document.
7195 @item M-x org-export-region-as-html
7196 Convert the region to HTML under the assumption that it was Org mode
7197 syntax before.  This is a global command that can be invoked in any
7198 buffer.
7199 @item M-x org-replace-region-by-HTML
7200 Replace the active region (assumed to be in Org mode syntax) by HTML
7201 code.
7202 @end table
7204 @cindex headline levels, for exporting
7205 In the exported version, the first 3 outline levels will become headlines,
7206 defining a general document structure.  Additional levels will be exported as
7207 itemized lists.  If you want that transition to occur at a different level,
7208 specify it with a numeric prefix argument.  For example,
7210 @example
7211 @kbd{C-2 C-c C-e b}
7212 @end example
7214 @noindent
7215 creates two levels of headings and does the rest as items.
7217 @node Quoting HTML tags, Links, HTML Export commands, HTML export
7218 @subsection Quoting HTML tags
7220 Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
7221 @samp{&gt;} in HTML export.  If you want to include simple HTML tags
7222 which should be interpreted as such, mark them with @samp{@@} as in
7223 @samp{@@<b>bold text@@</b>}.  Note that this really works only for
7224 simple tags.  For more extensive HTML that should be copied verbatim to
7225 the exported file use either
7227 @example
7228 #+HTML: Literal HTML code for export
7229 @end example
7231 @noindent or
7232 @cindex #+BEGIN_HTML
7234 @example
7235 #+BEGIN_HTML
7236 All lines between these markers are exported literally
7237 #+END_HTML
7238 @end example
7241 @node Links, Images, Quoting HTML tags, HTML export
7242 @subsection Links
7244 @cindex links, in HTML export
7245 @cindex internal links, in HTML export
7246 @cindex external links, in HTML export
7247 Internal links (@pxref{Internal links}) will continue to work in HTML
7248 files only if they match a dedicated @samp{<<target>>}.  Automatic links
7249 created by radio targets (@pxref{Radio targets}) will also work in the
7250 HTML file.  Links to external files will still work if the HTML file is
7251 in the same directory as the Org file.  Links to other @file{.org}
7252 files will be translated into HTML links under the assumption that an
7253 HTML version also exists of the linked file.  For information related to
7254 linking files while publishing them to a publishing directory see
7255 @ref{Publishing links}.
7257 @node Images, CSS support, Links, HTML export
7258 @subsection Images
7260 @cindex images, inline in HTML
7261 @cindex inlining images in HTML
7262 HTML export can inline images given as links in the Org file, and
7263 it can make an image the clickable part of a link.  By
7264 default@footnote{but see the variable
7265 @code{org-export-html-inline-images}}, images are inlined if a link does
7266 not have a description.  So @samp{[[file:myimg.jpg]]} will be inlined,
7267 while @samp{[[file:myimg.jpg][the image]]} will just produce a link
7268 @samp{the image} that points to the image.  If the description part
7269 itself is a @code{file:} link or a @code{http:} URL pointing to an
7270 image, this image will be inlined and activated so that clicking on the
7271 image will activate the link.  For example, to include a thumbnail that
7272 will link to a high resolution version of the image, you could use:
7274 @example
7275 [[file:highres.jpg][file:thumb.jpg]]
7276 @end example
7278 @noindent
7279 and you could use @code{http} addresses just as well.
7281 @node CSS support, Javascript support, Images, HTML export
7282 @subsection CSS support
7283 @cindex CSS, for HTML export
7284 @cindex HTML export, CSS
7286 You can also give style information for the exported file.  The HTML
7287 exporter assigns the following CSS classes to appropriate parts of the
7288 document - your style specifications may change these:
7289 @example
7290 .todo           @r{TODO keywords}
7291 .done           @r{the DONE keyword}
7292 .timestamp      @r{time stamp}
7293 .timestamp-kwd  @r{keyword associated with a time stamp, like SCHEDULED}
7294 .tag            @r{tag in a headline}
7295 .target         @r{target for links}
7296 @end example
7298 The default style specification can be configured through the option
7299 @code{org-export-html-style}.  If you want to use a file-local style,
7300 you may use file variables, best wrapped into a COMMENT section at the
7301 end of the outline tree.  For example@footnote{Under Emacs 21, the
7302 continuation lines for a variable value should have no @samp{#} at the
7303 start of the line.}:
7305 @example
7306 * COMMENT html style specifications
7308 # Local Variables:
7309 # org-export-html-style: "   <style type=\"text/css\">
7310 #       p @{font-weight: normal; color: gray; @}
7311 #       h1 @{color: black; @}
7312 #   </style>"
7313 # End:
7314 @end example
7316 Remember to execute @kbd{M-x normal-mode} after changing this to make
7317 the new style visible to Emacs.  This command restarts Org mode for the
7318 current buffer and forces Emacs to re-evaluate the local variables
7319 section in the buffer.
7321 @c FIXME: More about header and footer styles
7322 @c FIXME: Talk about links and targets.
7324 @node Javascript support,  , CSS support, HTML export
7325 @subsection Javascript supported display of web pages
7327 @emph{Sebastian Rose} has written a JavaScript program especially designed to
7328 enhance the web viewing experience of HTML files created with Org.  This
7329 program allows to view large files in two different ways.  The first one is
7330 an @emph{Info}-like mode where each section is displayed separately and
7331 navigation can be done with the @kbd{n} and @kbd{p} keys (and some other keys
7332 as well, press @kbd{?} for an overview of the available keys).  The second
7333 view type is a @emph{folding} view much like Org provides it inside Emacs.
7334 The script is available at @url{http://orgmode.org/org-info.js} and you can
7335 find the documentation for it at
7336 @url{http://orgmode.org/worg/code/org-info-js/org-info.js.html}.  We are
7337 serving the script from our site, but if you use it a lot, you might not want
7338 to be dependent on @url{orgmode.org} and prefer to install a local copy on
7339 your own web server.
7341 To use the script, you need to make sure that the @file{org-jsinfo.el} module
7342 gets loaded.  It should be loaded by default, try @kbd{M-x customize-variable
7343 @key{RET} org-modules @key{RET}} to convince yourself that this is indeed the
7344 case.  All it then takes to make use of the program is adding a single line
7345 to the Org file:
7347 @example
7348 #+INFOJS_OPT: view:info toc:nil
7349 @end example
7351 @noindent
7352 If this line is found, the HTML header will automatically contain the code
7353 needed to invoke the script.  Using the line above, you can set the following
7354 viewing options:
7356 @example
7357 path:    @r{The path to the script.  The default is to grab the script from}
7358          @r{@url{http://orgmode.org/org-info.js}, but you might want to have}
7359          @r{a local copy and use a path like @samp{../scripts/org-info.js}.}
7360 view:    @r{Initial view when website is first shown.  Possible values are:}
7361          info      @r{Info-like interface with one section per page.}
7362          overview  @r{Folding interface, initially showing only top-level.}
7363          content   @r{Folding interface, starting with all headlines visible.}
7364          showall   @r{Folding interface, all headlines and text visible.}
7365 sdepth:  @r{Maximum headline level that will still become an independent}
7366          @r{section for info and folding modes.  The default is taken from}
7367          @r{@code{org-headline-levels} (= the @code{H} switch in @code{#+OPTIONS}).}
7368          @r{If this is smaller than in @code{org-headline-levels}, each}
7369          @r{info/folding section can still contain children headlines.}
7370 toc:     @r{Should the table of content @emph{initially} be visible?}
7371          @r{Even when @code{nil}, you can always get to the toc with @kbd{i}.}
7372 tdepth:  @r{The depth of the table of contents.  The defaults are taken from}
7373          @r{the variables @code{org-headline-levels} and @code{org-export-with-toc}.}
7374 ftoc:    @r{Does the css of the page specify a fixed position for the toc?}
7375          @r{If yes, the toc will never be displayed as a section.}
7376 ltoc:    @r{Should there be short contents (children) in each section?}
7377 mouse:   @r{Headings are highlighted when the mouse is over them.  Should be}
7378          @r{@samp{underline} (default) or a background color like @samp{#cccccc}.}
7379 buttons: @r{Should view-toggle buttons be everywhere?  When @code{nil} (the}
7380          @r{default), only one such button will be present.}
7381 @end example
7383 You can choose default values for these options by customizing the variable
7384 @code{org-infojs-options}.  If you always want to apply the script to your
7385 pages, configure the variable @code{org-export-html-use-infojs}.
7387 @node LaTeX export, XOXO export, HTML export, Exporting
7388 @section LaTeX export
7389 @cindex LaTeX export
7391 Org mode contains a La@TeX{} exporter written by Bastien Guerry.
7393 @menu
7394 * LaTeX export commands::       How to invoke LaTeX export
7395 * Quoting LaTeX code::          Incorporating literal LaTeX code
7396 * Sectioning structure::        Changing sectioning in LaTeX output
7397 @end menu
7399 @node LaTeX export commands, Quoting LaTeX code, LaTeX export, LaTeX export
7400 @subsection LaTeX export commands
7402 @table @kbd
7403 @kindex C-c C-e l
7404 @item C-c C-e l
7405 Export as La@TeX{} file @file{myfile.tex}.  For an org file
7406 @file{myfile.org}, the ASCII file will be @file{myfile.tex}.  The file will
7407 be overwritten without warning.  If there is an active region, only the
7408 region will be exported. If the selected region is a single tree@footnote{To
7409 select the current subtree, use @kbd{C-c @@}.}, the tree head will become the
7410 document title.  If the tree head entry has or inherits an
7411 @code{EXPORT_FILE_NAME} property, that name will be used for the export.
7412 @kindex C-c C-e L
7413 @item C-c C-e L
7414 Export to a temporary buffer, do not create a file.
7415 @kindex C-c C-e v l
7416 @kindex C-c C-e v L
7417 @item C-c C-e v l
7418 @item C-c C-e v L
7419 Export only the visible part of the document.
7420 @item M-x org-export-region-as-latex
7421 Convert the region to La@TeX{} under the assumption that it was Org mode
7422 syntax before.  This is a global command that can be invoked in any
7423 buffer.
7424 @item M-x org-replace-region-by-latex
7425 Replace the active region (assumed to be in Org mode syntax) by La@TeX{}
7426 code.
7427 @end table
7429 @cindex headline levels, for exporting
7430 In the exported version, the first 3 outline levels will become
7431 headlines, defining a general document structure.  Additional levels
7432 will be exported as description lists.  The exporter can ignore them or
7433 convert them to a custom string depending on
7434 @code{org-latex-low-levels}.
7436 If you want that transition to occur at a different level, specify it
7437 with a numeric prefix argument. For example,
7439 @example
7440 @kbd{C-2 C-c C-e l}
7441 @end example
7443 @noindent
7444 creates two levels of headings and does the rest as items.
7446 @node Quoting LaTeX code, Sectioning structure, LaTeX export commands, LaTeX export
7447 @subsection Quoting LaTeX code
7449 Embedded La@TeX{} as described in @ref{Embedded LaTeX} will be correctly
7450 inserted into the La@TeX{} file.  Furthermore, you can add special code
7451 that should only be present in La@TeX{} export with the following
7452 constructs:
7454 @example
7455 #+LaTeX: Literal LaTeX code for export
7456 @end example
7458 @noindent or
7459 @cindex #+BEGIN_LaTeX
7461 @example
7462 #+BEGIN_LaTeX
7463 All lines between these markers are exported literally
7464 #+END_LaTeX
7465 @end example
7467 @node   Sectioning structure,  , Quoting LaTeX code, LaTeX export
7468 @subsection Sectioning structure
7469 @cindex LaTeX class
7470 @cindex LaTeX sectioning structure
7472 By default, the La@TeX{} output uses the class @code{article}.
7474 You can change this globally by setting a different value for
7475 @code{org-export-latex-default-class} or locally by adding an option
7476 like @code{#+LaTeX_CLASS: myclass} in your file.  The class should be
7477 listed in @code{org-export-latex-classes}, where you can also define the
7478 sectioning structure for each class.
7481 @node XOXO export, iCalendar export, LaTeX export, Exporting
7482 @section XOXO export
7483 @cindex XOXO export
7485 Org mode contains an exporter that produces XOXO-style output.
7486 Currently, this exporter only handles the general outline structure and
7487 does not interpret any additional Org mode features.
7489 @table @kbd
7490 @kindex C-c C-e x
7491 @item C-c C-e x
7492 Export as XOXO file @file{myfile.html}.
7493 @kindex C-c C-e v
7494 @item C-c C-e v x
7495 Export only the visible part of the document.
7496 @end table
7498 @node iCalendar export,  , XOXO export, Exporting
7499 @section iCalendar export
7500 @cindex iCalendar export
7502 Some people like to use Org mode for keeping track of projects, but
7503 still prefer a standard calendar application for anniversaries and
7504 appointments.  In this case it can be useful to have deadlines and
7505 other time-stamped items in Org files show up in the calendar
7506 application.  Org mode can export calendar information in the standard
7507 iCalendar format.  If you also want to have TODO entries included in the
7508 export, configure the variable @code{org-icalendar-include-todo}.
7510 The iCalendar standard requires each entry to have a globally unique
7511 identifier (UID).  Org creates these identifiers during export.  If you set
7512 the variable @code{org-icalendar-store-UID}, the UID will be stored in the
7513 @code{:ID:} property of the entry and re-used next time you report this
7514 entry.  Since a single entry can give rise to multiple iCalendar entries (as
7515 a timestamp, a deadline, a scheduled item, and as a TODO item), Org adds
7516 prefixes to the UID, depending on what triggered the inclusion of the entry.
7517 In this way the UID remains unique, but a synchronization program can still
7518 figure out from which entry all the different instances originate.
7520 @table @kbd
7521 @kindex C-c C-e i
7522 @item C-c C-e i
7523 Create iCalendar entries for the current file and store them in the same
7524 directory, using a file extension @file{.ics}.
7525 @kindex C-c C-e I
7526 @item C-c C-e I
7527 Like @kbd{C-c C-e i}, but do this for all files in
7528 @code{org-agenda-files}.  For each of these files, a separate iCalendar
7529 file will be written.
7530 @kindex C-c C-e c
7531 @item C-c C-e c
7532 Create a single large iCalendar file from all files in
7533 @code{org-agenda-files} and write it to the file given by
7534 @code{org-combined-agenda-icalendar-file}.
7535 @end table
7537 The export will honor SUMMARY, DESCRIPTION and LOCATION properties if
7538 the selected entries have them.  If not, the summary will be derived
7539 from the headline, and the description from the body (limited to
7540 @code{org-icalendar-include-body} characters).
7542 How this calendar is best read and updated, depends on the application
7543 you are using.  The FAQ covers this issue.
7545 @node Publishing, Miscellaneous, Exporting, Top
7546 @chapter Publishing
7547 @cindex publishing
7549 Org includes@footnote{@file{org-publish.el} is not distributed with
7550 Emacs 21, if you are still using Emacs 21, you need you need to download
7551 this file separately.} a publishing management system that allows you to
7552 configure automatic HTML conversion of @emph{projects} composed of
7553 interlinked org files.  This system is called @emph{org-publish}.  You can
7554 also configure org-publish to automatically upload your exported HTML
7555 pages and related attachments, such as images and source code files, to
7556 a web server. Org-publish turns Org into a web-site authoring tool.
7558 You can also use Org-publish to convert files into La@TeX{}, or even
7559 combine HTML and La@TeX{} conversion so that files are available in both
7560 formats on the server@footnote{Since La@TeX{} files on a server are not
7561 that helpful, you surely want to perform further conversion on them --
7562 e.g. convert them to @code{PDF} format.}.
7564 Org-publish has been contributed to Org by David O'Toole.
7566 @menu
7567 * Configuration::               Defining projects
7568 * Sample configuration::        Example projects
7569 * Triggering publication::      Publication commands
7570 @end menu
7572 @node Configuration, Sample configuration, Publishing, Publishing
7573 @section Configuration
7575 Publishing needs significant configuration to specify files, destination
7576 and many other properties of a project.
7578 @menu
7579 * Project alist::               The central configuration variable
7580 * Sources and destinations::    From here to there
7581 * Selecting files::             What files are part of the project?
7582 * Publishing action::           Setting the function doing the publishing
7583 * Publishing options::          Tweaking HTML export
7584 * Publishing links::            Which links keep working after publishing?
7585 * Project page index::          Publishing a list of project files
7586 @end menu
7588 @node Project alist, Sources and destinations, Configuration, Configuration
7589 @subsection The variable @code{org-publish-project-alist}
7590 @cindex org-publish-project-alist
7591 @cindex projects, for publishing
7593 Org-publish is configured almost entirely through setting the value of
7594 one variable, called @code{org-publish-project-alist}.
7595 Each element of the list configures one project, and may be in one of
7596 the two following forms:
7598 @lisp
7599 ("project-name" :property value :property value ...)
7601 @r{or}
7603 ("project-name" :components ("project-name" "project-name" ...))
7605 @end lisp
7607 In both cases, projects are configured by specifying property values.
7608 A project defines the set of files that will be published, as well as
7609 the publishing configuration to use when publishing those files.  When
7610 a project takes the second form listed above, the individual members
7611 of the ``components'' property are taken to be components of the
7612 project, which group together files requiring different publishing
7613 options. When you publish such a ``meta-project'' all the components
7614 will also publish.
7616 @node Sources and destinations, Selecting files, Project alist, Configuration
7617 @subsection Sources and destinations for files
7618 @cindex directories, for publishing
7620 Most properties are optional, but some should always be set. In
7621 particular, org-publish needs to know where to look for source files,
7622 and where to put published files.
7624 @multitable @columnfractions 0.3 0.7
7625 @item @code{:base-directory}
7626 @tab Directory containing publishing source files
7627 @item @code{:publishing-directory}
7628 @tab Directory (possibly remote) where output files will be published.
7629 @item @code{:preparation-function}
7630 @tab Function called before starting publishing process, for example to
7631 run @code{make} for updating files to be published.
7632 @end multitable
7633 @noindent
7635 @node Selecting files, Publishing action, Sources and destinations, Configuration
7636 @subsection Selecting files
7637 @cindex files, selecting for publishing
7639 By default, all files with extension @file{.org} in the base directory
7640 are considered part of the project.  This can be modified by setting the
7641 properties
7642 @multitable @columnfractions 0.25 0.75
7643 @item @code{:base-extension}
7644 @tab Extension (without the dot!) of source files.  This actually is a
7645 regular expression.
7647 @item @code{:exclude}
7648 @tab Regular expression to match file names that should not be
7649 published, even though they have been selected on the basis of their
7650 extension.
7652 @item @code{:include}
7653 @tab List of files to be included regardless of @code{:base-extension}
7654 and @code{:exclude}.
7655 @end multitable
7657 @node Publishing action, Publishing options, Selecting files, Configuration
7658 @subsection Publishing action
7659 @cindex action, for publishing
7661 Publishing means that a file is copied to the destination directory and
7662 possibly transformed in the process.  The default transformation is to
7663 export Org files as HTML files, and this is done by the function
7664 @code{org-publish-org-to-html} which calls the HTML exporter
7665 (@pxref{HTML export}). But you also can publish your files in La@TeX{} by
7666 using the function @code{org-publish-org-to-latex} instead. Other files
7667 like images only need to be copied to the publishing destination. For
7668 non-Org files, you need to specify the publishing function.
7671 @multitable @columnfractions 0.3 0.7
7672 @item @code{:publishing-function}
7673 @tab Function executing the publication of a file.  This may also be a
7674 list of functions, which will all be called in turn.
7675 @end multitable
7677 The function must accept two arguments: a property list containing at
7678 least a @code{:publishing-directory} property, and the name of the file
7679 to be published.  It should take the specified file, make the necessary
7680 transformation (if any) and place the result into the destination folder.
7681 You can write your own publishing function, but @code{org-publish}
7682 provides one for attachments (files that only need to be copied):
7683 @code{org-publish-attachment}.
7685 @node Publishing options, Publishing links, Publishing action, Configuration
7686 @subsection Options for the HTML/LaTeX exporters
7687 @cindex options, for publishing
7689 The property list can be used to set many export options for the HTML
7690 and La@TeX{} exporters.  In most cases, these properties correspond to user
7691 variables in Org.  The table below lists these properties along
7692 with the variable they belong to.  See the documentation string for the
7693 respective variable for details.
7695 @multitable @columnfractions 0.3 0.7
7696 @item @code{:language}              @tab @code{org-export-default-language}
7697 @item @code{:headline-levels}       @tab @code{org-export-headline-levels}
7698 @item @code{:section-numbers}       @tab @code{org-export-with-section-numbers}
7699 @item @code{:table-of-contents}     @tab @code{org-export-with-toc}
7700 @item @code{:archived-trees}        @tab @code{org-export-with-archived-trees}
7701 @item @code{:emphasize}             @tab @code{org-export-with-emphasize}
7702 @item @code{:sub-superscript}       @tab @code{org-export-with-sub-superscripts}
7703 @item @code{:special-strings}       @tab @code{org-export-with-special-strings}
7704 @item @code{:TeX-macros}            @tab @code{org-export-with-TeX-macros}
7705 @item @code{:LaTeX-fragments}       @tab @code{org-export-with-LaTeX-fragments}
7706 @item @code{:fixed-width}           @tab @code{org-export-with-fixed-width}
7707 @item @code{:timestamps}           .@tab @code{org-export-with-timestamps}
7708 @item @code{:tags}                 .@tab @code{org-export-with-tags}
7709 @item @code{:tables}                @tab @code{org-export-with-tables}
7710 @item @code{:table-auto-headline}   @tab @code{org-export-highlight-first-table-line}
7711 @item @code{:style}                 @tab @code{org-export-html-style}
7712 @item @code{:convert-org-links}     @tab @code{org-export-html-link-org-files-as-html}
7713 @item @code{:inline-images}         @tab @code{org-export-html-inline-images}
7714 @item @code{:expand-quoted-html}    @tab @code{org-export-html-expand}
7715 @item @code{:timestamp}             @tab @code{org-export-html-with-timestamp}
7716 @item @code{:publishing-directory}  @tab @code{org-export-publishing-directory}
7717 @item @code{:preamble}              @tab @code{org-export-html-preamble}
7718 @item @code{:postamble}             @tab @code{org-export-html-postamble}
7719 @item @code{:auto-preamble}         @tab @code{org-export-html-auto-preamble}
7720 @item @code{:auto-postamble}        @tab @code{org-export-html-auto-postamble}
7721 @item @code{:author}                @tab @code{user-full-name}
7722 @item @code{:email}                 @tab @code{user-mail-address}
7723 @end multitable
7725 If you use several email addresses, separate them by a semi-column.
7727 Most of the @code{org-export-with-*} variables have the same effect in
7728 both HTML and La@TeX{} exporters, except for @code{:TeX-macros} and
7729 @code{:LaTeX-fragments}, respectively @code{nil} and @code{t} in the
7730 La@TeX{} export.
7732 When a property is given a value in @code{org-publish-project-alist},
7733 its setting overrides the value of the corresponding user variable (if
7734 any) during publishing.  Options set within a file (@pxref{Export
7735 options}), however, override everything.
7737 @node Publishing links, Project page index, Publishing options, Configuration
7738 @subsection Links between published files
7739 @cindex links, publishing
7741 To create a link from one Org file to another, you would use
7742 something like @samp{[[file:foo.org][The foo]]} or simply
7743 @samp{file:foo.org.} (@pxref{Hyperlinks}).  Upon publishing this link
7744 becomes a link to @file{foo.html}.  In this way, you can interlink the
7745 pages of your "org web" project and the links will work as expected when
7746 you publish them to HTML.
7748 You may also link to related files, such as images. Provided you are
7749 careful with relative pathnames, and provided you have also configured
7750 @code{org-publish} to upload the related files, these links will work
7751 too. @ref{Complex example} for an example of this usage.
7753 Sometime an Org file to be published may contain links that are
7754 only valid in your production environment, but not in the publishing
7755 location.  In this case, use the property
7757 @multitable @columnfractions 0.4 0.6
7758 @item @code{:link-validation-function}
7759 @tab Function to validate links
7760 @end multitable
7762 @noindent
7763 to define a function for checking link validity.  This function must
7764 accept two arguments, the file name and a directory relative to which
7765 the file name is interpreted in the production environment.  If this
7766 function returns @code{nil}, then the HTML generator will only insert a
7767 description into the HTML file, but no link.  One option for this
7768 function is @code{org-publish-validate-link} which checks if the given
7769 file is part of any project in @code{org-publish-project-alist}.
7771 @node Project page index,  , Publishing links, Configuration
7772 @subsection Project page index
7773 @cindex index, of published pages
7775 The following properties may be used to control publishing of an
7776 index of files or summary page for a given project.
7778 @multitable @columnfractions 0.25 0.75
7779 @item @code{:auto-index}
7780 @tab When non-nil, publish an index during org-publish-current-project or
7781 org-publish-all.
7783 @item @code{:index-filename}
7784 @tab Filename for output of index. Defaults to @file{index.org} (which
7785 becomes @file{index.html}).
7787 @item @code{:index-title}
7788 @tab Title of index page. Defaults to name of file.
7790 @item @code{:index-function}
7791 @tab Plug-in function to use for generation of index.
7792 Defaults to @code{org-publish-org-index}, which generates a plain list
7793 of links to all files in the project.
7794 @end multitable
7796 @node Sample configuration, Triggering publication, Configuration, Publishing
7797 @section Sample configuration
7799 Below we provide two example configurations.  The first one is a simple
7800 project publishing only a set of Org files.  The second example is
7801 more complex, with a multi-component project.
7803 @menu
7804 * Simple example::              One-component publishing
7805 * Complex example::             A multi-component publishing example
7806 @end menu
7808 @node Simple example, Complex example, Sample configuration, Sample configuration
7809 @subsection Example: simple publishing configuration
7811 This example publishes a set of Org files to the @file{public_html}
7812 directory on the local machine.
7814 @lisp
7815 (setq org-publish-project-alist
7816       '(("org"
7817          :base-directory "~/org/"
7818          :publishing-directory "~/public_html"
7819          :section-numbers nil
7820          :table-of-contents nil
7821          :style "<link rel=stylesheet
7822                 href=\"../other/mystyle.css\"
7823                 type=\"text/css\">")))
7824 @end lisp
7826 @node Complex example,  , Simple example, Sample configuration
7827 @subsection Example: complex publishing configuration
7829 This more complicated example publishes an entire website, including
7830 org files converted to HTML, image files, emacs lisp source code, and
7831 style sheets. The publishing-directory is remote and private files are
7832 excluded.
7834 To ensure that links are preserved, care should be taken to replicate
7835 your directory structure on the web server, and to use relative file
7836 paths. For example, if your org files are kept in @file{~/org} and your
7837 publishable images in @file{~/images}, you'd link to an image with
7839 @example
7840 file:../images/myimage.png
7841 @end example
7843 On the web server, the relative path to the image should be the
7844 same. You can accomplish this by setting up an "images" folder in the
7845 right place on the web server, and publishing images to it.
7847 @lisp
7848 (setq org-publish-project-alist
7849       '(("orgfiles"
7850           :base-directory "~/org/"
7851           :base-extension "org"
7852           :publishing-directory "/ssh:user@@host:~/html/notebook/"
7853           :publishing-function org-publish-org-to-html
7854           :exclude "PrivatePage.org"   ;; regexp
7855           :headline-levels 3
7856           :section-numbers nil
7857           :table-of-contents nil
7858           :style "<link rel=stylesheet
7859                   href=\"../other/mystyle.css\" type=\"text/css\">"
7860           :auto-preamble t
7861           :auto-postamble nil)
7863          ("images"
7864           :base-directory "~/images/"
7865           :base-extension "jpg\\|gif\\|png"
7866           :publishing-directory "/ssh:user@@host:~/html/images/"
7867           :publishing-function org-publish-attachment)
7869          ("other"
7870           :base-directory "~/other/"
7871           :base-extension "css\\|el"
7872           :publishing-directory "/ssh:user@@host:~/html/other/"
7873           :publishing-function org-publish-attachment)
7874          ("website" :components ("orgfiles" "images" "other"))))
7875 @end lisp
7877 @node Triggering publication,  , Sample configuration, Publishing
7878 @section Triggering publication
7880 Once org-publish is properly configured, you can publish with the
7881 following functions:
7883 @table @kbd
7884 @item C-c C-e C
7885 Prompt for a specific project and publish all files that belong to it.
7886 @item C-c C-e P
7887 Publish the project containing the current file.
7888 @item C-c C-e F
7889 Publish only the current file.
7890 @item C-c C-e A
7891 Publish all projects.
7892 @end table
7894 Org uses timestamps to track when a file has changed. The above
7895 functions normally only publish changed files. You can override this and
7896 force publishing of all files by giving a prefix argument.
7898 @node Miscellaneous, Extionsions, Publishing, Top
7899 @chapter Miscellaneous
7901 @menu
7902 * Completion::                  M-TAB knows what you need
7903 * Customization::               Adapting Org to your taste
7904 * In-buffer settings::          Overview of the #+KEYWORDS
7905 * The very busy C-c C-c key::   When in doubt, press C-c C-c
7906 * Clean view::                  Getting rid of leading stars in the outline
7907 * TTY keys::                    Using Org on a tty
7908 * Interaction::                 Other Emacs packages
7909 * Bugs::                        Things which do not work perfectly
7910 @end menu
7912 @node Completion, Customization, Miscellaneous, Miscellaneous
7913 @section Completion
7914 @cindex completion, of @TeX{} symbols
7915 @cindex completion, of TODO keywords
7916 @cindex completion, of dictionary words
7917 @cindex completion, of option keywords
7918 @cindex completion, of tags
7919 @cindex completion, of property keys
7920 @cindex completion, of link abbreviations
7921 @cindex @TeX{} symbol completion
7922 @cindex TODO keywords completion
7923 @cindex dictionary word completion
7924 @cindex option keyword completion
7925 @cindex tag completion
7926 @cindex link abbreviations, completion of
7928 Org supports in-buffer completion.  This type of completion does
7929 not make use of the minibuffer.  You simply type a few letters into
7930 the buffer and use the key to complete text right there.
7932 @table @kbd
7933 @kindex M-@key{TAB}
7934 @item M-@key{TAB}
7935 Complete word at point
7936 @itemize @bullet
7937 @item
7938 At the beginning of a headline, complete TODO keywords.
7939 @item
7940 After @samp{\}, complete @TeX{} symbols supported by the exporter.
7941 @item
7942 After @samp{*}, complete headlines in the current buffer so that they
7943 can be used in search links like @samp{[[*find this headline]]}.
7944 @item
7945 After @samp{:} in a headline, complete tags.  The list of tags is taken
7946 from the variable @code{org-tag-alist} (possibly set through the
7947 @samp{#+TAGS} in-buffer option, @pxref{Setting tags}), or it is created
7948 dynamically from all tags used in the current buffer.
7949 @item
7950 After @samp{:} and not in a headline, complete property keys.  The list
7951 of keys is constructed dynamically from all keys used in the current
7952 buffer.
7953 @item
7954 After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}).
7955 @item
7956 After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
7957 @samp{OPTIONS} which set file-specific options for Org mode.  When the
7958 option keyword is already complete, pressing @kbd{M-@key{TAB}} again
7959 will insert example settings for this keyword.
7960 @item
7961 In the line after @samp{#+STARTUP: }, complete startup keywords,
7962 i.e. valid keys for this line.
7963 @item
7964 Elsewhere, complete dictionary words using Ispell.
7965 @end itemize
7966 @end table
7968 @node Customization, In-buffer settings, Completion, Miscellaneous
7969 @section Customization
7970 @cindex customization
7971 @cindex options, for customization
7972 @cindex variables, for customization
7974 There are more than 180 variables that can be used to customize
7975 Org.  For the sake of compactness of the manual, I am not
7976 describing the variables here.  A structured overview of customization
7977 variables is available with @kbd{M-x org-customize}.  Or select
7978 @code{Browse Org Group} from the @code{Org->Customization} menu.  Many
7979 settings can also be activated on a per-file basis, by putting special
7980 lines into the buffer (@pxref{In-buffer settings}).
7982 @node In-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
7983 @section Summary of in-buffer settings
7984 @cindex in-buffer settings
7985 @cindex special keywords
7987 Org mode uses special lines in the buffer to define settings on a
7988 per-file basis.  These lines start with a @samp{#+} followed by a
7989 keyword, a colon, and then individual words defining a setting.  Several
7990 setting words can be in the same line, but you can also have multiple
7991 lines for the keyword.  While these settings are described throughout
7992 the manual, here is a summary.  After changing any of those lines in the
7993 buffer, press @kbd{C-c C-c} with the cursor still in the line to
7994 activate the changes immediately.  Otherwise they become effective only
7995 when the file is visited again in a new Emacs session.
7997 @table @kbd
7998 @item #+ARCHIVE: %s_done::
7999 This line sets the archive location for the agenda file.  It applies for
8000 all subsequent lines until the next @samp{#+ARCHIVE} line, or the end
8001 of the file.  The first such line also applies to any entries before it.
8002 The corresponding variable is @code{org-archive-location}.
8003 @item #+CATEGORY:
8004 This line sets the category for the agenda file.  The category applies
8005 for all subsequent lines until the next @samp{#+CATEGORY} line, or the
8006 end of the file.  The first such line also applies to any entries before it.
8007 @item #+COLUMNS: %25ITEM .....
8008 Set the default format for columns view.  This format applies when
8009 columns view is invoked in location where no @code{COLUMNS} property
8010 applies.
8011 @item #+CONSTANTS: name1=value1 ...
8012 Set file-local values for constants to be used in table formulas.  This
8013 line set the local variable @code{org-table-formula-constants-local}.
8014 The global version of this variable is
8015 @code{org-table-formula-constants}.
8016 @item #+FILETAGS: :tag1:tag2:tag3:
8017 Set tags that can be inherited by any entry in the file, including the
8018 top-level entries.
8019 @item #+DRAWERS: NAME1 .....
8020 Set the file-local set of drawers.  The corresponding global variable is
8021 @code{org-drawers}.
8022 @item #+LINK:  linkword replace
8023 These lines (several are allowed) specify link abbreviations.
8024 @xref{Link abbreviations}.  The corresponding variable is
8025 @code{org-link-abbrev-alist}.
8026 @item #+PRIORITIES: highest lowest default
8027 This line sets the limits and the default for the priorities.  All three
8028 must be either letters A-Z or numbers 0-9.  The highest priority must
8029 have a lower ASCII number that the lowest priority.
8030 @item #+PROPERTY: Property_Name Value
8031 This line sets a default inheritance value for entries in the current
8032 buffer, most useful for specifying the allowed values of a property.
8033 @item #+SETUPFILE: file
8034 This line defines a file that holds more in-buffer setup.  Normally this is
8035 entirely ignored.  Only when the buffer is parsed for option-setting lines
8036 (i.e. when starting Org mode for a file, when pressing @kbd{C-c C-c} in a
8037 settings line, or when exporting), then the contents of this file are parsed
8038 as if they had been included in the buffer.  In particlar, the file can be
8039 any other Org mode file with internal setup.  You can visit the file the
8040 cursor is in the line with @kbd{C-c '}.
8041 @item #+STARTUP:
8042 This line sets options to be used at startup of Org mode, when an
8043 Org file is being visited.  The first set of options deals with the
8044 initial visibility of the outline tree.  The corresponding variable for
8045 global default settings is @code{org-startup-folded}, with a default
8046 value @code{t}, which means @code{overview}.
8047 @cindex @code{overview}, STARTUP keyword
8048 @cindex @code{content}, STARTUP keyword
8049 @cindex @code{showall}, STARTUP keyword
8050 @example
8051 overview   @r{top-level headlines only}
8052 content    @r{all headlines}
8053 showall    @r{no folding at all, show everything}
8054 @end example
8055 Then there are options for aligning tables upon visiting a file.  This
8056 is useful in files containing narrowed table columns.  The corresponding
8057 variable is @code{org-startup-align-all-tables}, with a default value
8058 @code{nil}.
8059 @cindex @code{align}, STARTUP keyword
8060 @cindex @code{noalign}, STARTUP keyword
8061 @example
8062 align      @r{align all tables}
8063 noalign    @r{don't align tables on startup}
8064 @end example
8065 Logging closing and reinstating TODO items, and clock intervals
8066 (variables @code{org-log-done}, @code{org-log-note-clock-out}, and
8067 @code{org-log-repeat}) can be configured using these options.
8068 @cindex @code{logdone}, STARTUP keyword
8069 @cindex @code{lognotedone}, STARTUP keyword
8070 @cindex @code{nologdone}, STARTUP keyword
8071 @cindex @code{lognoteclock-out}, STARTUP keyword
8072 @cindex @code{nolognoteclock-out}, STARTUP keyword
8073 @cindex @code{logrepeat}, STARTUP keyword
8074 @cindex @code{lognoterepeat}, STARTUP keyword
8075 @cindex @code{nologrepeat}, STARTUP keyword
8076 @example
8077 logdone            @r{record a timestamp when an item is marked DONE}
8078 lognotedone        @r{record timestamp and a note when DONE}
8079 nologdone          @r{don't record when items are marked DONE}
8080 logrepeat          @r{record a time when reinstating a repeating item}
8081 lognoterepeat      @r{record a note when reinstating a repeating item}
8082 nologrepeat        @r{do not record when reinstating repeating item}
8083 lognoteclock-out   @r{record a note when clocking out}
8084 nolognoteclock-out @r{don't record a note when clocking out}
8085 @end example
8086 Here are the options for hiding leading stars in outline headings, and for
8087 indenting outlines.  The corresponding variables are
8088 @code{org-hide-leading-stars} and @code{org-odd-levels-only}, both with a
8089 default setting @code{nil} (meaning @code{showstars} and @code{oddeven}).
8090 @cindex @code{hidestars}, STARTUP keyword
8091 @cindex @code{showstars}, STARTUP keyword
8092 @cindex @code{odd}, STARTUP keyword
8093 @cindex @code{even}, STARTUP keyword
8094 @example
8095 hidestars  @r{make all but one of the stars starting a headline invisible.}
8096 showstars  @r{show all stars starting a headline}
8097 indent     @r{virtual indentation according to outline level}
8098 noindent   @r{no virtual indentation according to outline level}
8099 odd        @r{allow only odd outline levels (1,3,...)}
8100 oddeven    @r{allow all outline levels}
8101 @end example
8102 To turn on custom format overlays over time stamps (variables
8103 @code{org-put-time-stamp-overlays} and
8104 @code{org-time-stamp-overlay-formats}), use
8105 @cindex @code{customtime}, STARTUP keyword
8106 @example
8107 customtime @r{overlay custom time format}
8108 @end example
8109 The following options influence the table spreadsheet (variable
8110 @code{constants-unit-system}).
8111 @cindex @code{constcgs}, STARTUP keyword
8112 @cindex @code{constSI}, STARTUP keyword
8113 @example
8114 constcgs   @r{@file{constants.el} should use the c-g-s unit system}
8115 constSI    @r{@file{constants.el} should use the SI unit system}
8116 @end example
8117 @item #+TAGS:  TAG1(c1) TAG2(c2)
8118 These lines (several such lines are allowed) specify the valid tags in
8119 this file, and (potentially) the corresponding @emph{fast tag selection}
8120 keys.  The corresponding variable is @code{org-tag-alist}.
8121 @item #+TBLFM:
8122 This line contains the formulas for the table directly above the line.
8123 @item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS, #+DATE:
8124 These lines provide settings for exporting files.  For more details see
8125 @ref{Export options}.
8126 @item #+SEQ_TODO:   #+TYP_TODO:
8127 These lines set the TODO keywords and their interpretation in the
8128 current file.  The corresponding variables are @code{org-todo-keywords}
8129 and @code{org-todo-interpretation}.
8130 @end table
8132 @node The very busy C-c C-c key, Clean view, In-buffer settings, Miscellaneous
8133 @section The very busy C-c C-c key
8134 @kindex C-c C-c
8135 @cindex C-c C-c, overview
8137 The key @kbd{C-c C-c} has many purposes in Org, which are all
8138 mentioned scattered throughout this manual.  One specific function of
8139 this key is to add @emph{tags} to a headline (@pxref{Tags}).  In many
8140 other circumstances it means something like @emph{Hey Org, look
8141 here and update according to what you see here}.  Here is a summary of
8142 what this means in different contexts.
8144 @itemize @minus
8145 @item
8146 If there are highlights in the buffer from the creation of a sparse
8147 tree, or from clock display, remove these highlights.
8148 @item
8149 If the cursor is in one of the special @code{#+KEYWORD} lines, this
8150 triggers scanning the buffer for these lines and updating the
8151 information.
8152 @item
8153 If the cursor is inside a table, realign the table.  This command
8154 works even if the automatic table editor has been turned off.
8155 @item
8156 If the cursor is on a @code{#+TBLFM} line, re-apply the formulas to
8157 the entire table.
8158 @item
8159 If the cursor is inside a table created by the @file{table.el} package,
8160 activate that table.
8161 @item
8162 If the current buffer is a remember buffer, close the note and file it.
8163 With a prefix argument, file it, without further interaction, to the
8164 default location.
8165 @item
8166 If the cursor is on a @code{<<<target>>>}, update radio targets and
8167 corresponding links in this buffer.
8168 @item
8169 If the cursor is in a property line or at the start or end of a property
8170 drawer, offer property commands.
8171 @item
8172 If the cursor is in a plain list item with a checkbox, toggle the status
8173 of the checkbox.
8174 @item
8175 If the cursor is on a numbered item in a plain list, renumber the
8176 ordered list.
8177 @item
8178 If the cursor is on the @code{#+BEGIN} line of a dynamical block, the
8179 block is updated.
8180 @end itemize
8182 @node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous
8183 @section A cleaner outline view
8184 @cindex hiding leading stars
8185 @cindex dynamic indentation
8186 @cindex odd-levels-only outlines
8187 @cindex clean outline view
8189 Some people find it noisy and distracting that the Org headlines are starting
8190 with a potentially large number of stars, and that text below the headlines
8191 is not indented.  This is not really a problem when you are writing a book
8192 where the outline headings are really section headlines.  However, in a more
8193 list-oriented outline, it is clear that an indented structure is a lot
8194 cleaner, as can be seen by comparing the two columns in the following
8195 example: 
8197 @example
8198 @group
8199 * Top level headline             |    * Top level headline
8200 ** Second level                  |      * Second level
8201 *** 3rd level                    |        * 3rd level
8202 some text                        |          some text
8203 *** 3rd level                    |        * 3rd level
8204 more text                        |          more text
8205 * Another top level headline     |    * Another top level headline
8206 @end group
8207 @end example
8209 @noindent
8210 It is non-trivial to make such a look work in Emacs, but Org contains three
8211 separate features that, combined, achieve just that.
8213 @enumerate
8214 @item 
8215 @emph{Indentation of text below headlines}@*
8216 You may indent text below each headline to make the left boundary line up
8217 with the headline, like
8219 @example
8220 *** 3rd level
8221     more text, now indented
8222 @end example
8224 A good way to get this indentation is by hand, and Org supports this with
8225 paragraph filling, line wrapping, and structure editing@footnote{See also the
8226 variable @code{org-adapt-indentation}.} preserving or adapting the
8227 indentation appropriate.  A different approach would be to have a way to
8228 automatically indent lines according to outline structure by adding overlays
8229 or text properties.  But I have not yet found a robust and efficient way to
8230 do this in large files.
8232 @item
8233 @emph{Hiding leading stars}@* You can modify the display in such a way that
8234 all leading stars become invisible.  To do this in a global way, configure
8235 the variable @code{org-hide-leading-stars} or change this on a per-file basis
8236 with
8238 @example
8239 #+STARTUP: showstars
8240 #+STARTUP: hidestars
8241 @end example
8243 With hidden stars, the tree becomes:
8245 @example
8246 @group
8247 * Top level headline
8248  * Second level
8249   * 3rd level
8250   ...
8251 @end group
8252 @end example
8254 @noindent
8255 Note that the leading stars are not truly replaced by whitespace, they
8256 are only fontified with the face @code{org-hide} that uses the
8257 background color as font color.  If you are not using either white or
8258 black background, you may have to customize this face to get the wanted
8259 effect.  Another possibility is to set this font such that the extra
8260 stars are @i{almost} invisible, for example using the color
8261 @code{grey90} on a white background.
8263 @item
8264 Things become cleaner still if you skip all the even levels and use only odd
8265 levels 1, 3, 5..., effectively adding two stars to go from one outline level
8266 to the next.  In this way we get the outline view shown at the beginning of
8267 this section.  In order to make the structure editing and export commands
8268 handle this convention correctly, configure the variable
8269 @code{org-odd-levels-only}, or set this on a per-file basis with one of the
8270 following lines:
8272 @example
8273 #+STARTUP: odd
8274 #+STARTUP: oddeven
8275 @end example
8277 You can convert an Org file from single-star-per-level to the
8278 double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
8279 RET} in that file.  The reverse operation is @kbd{M-x
8280 org-convert-to-oddeven-levels}.
8281 @end enumerate
8283 @node TTY keys, Interaction, Clean view, Miscellaneous
8284 @section Using Org on a tty
8285 @cindex tty key bindings
8287 Because Org contains a large number of commands, by default much of
8288 Org's core commands are bound to keys that are generally not
8289 accessible on a tty, such as the cursor keys (@key{left}, @key{right},
8290 @key{up}, @key{down}), @key{TAB} and @key{RET}, in particular when used
8291 together with modifiers like @key{Meta} and/or @key{Shift}.  To access
8292 these commands on a tty when special keys are unavailable, the following
8293 alternative bindings can be used.  The tty bindings below will likely be
8294 more cumbersome; you may find for some of the bindings below that a
8295 customized work-around suits you better.  For example, changing a time
8296 stamp is really only fun with @kbd{S-@key{cursor}} keys, whereas on a
8297 tty you would rather use @kbd{C-c .} to re-insert the timestamp.
8299 @multitable @columnfractions 0.15 0.2 0.2
8300 @item @b{Default} @tab @b{Alternative 1} @tab @b{Alternative 2}
8301 @item @kbd{S-@key{TAB}}     @tab @kbd{C-u @key{TAB}}       @tab
8302 @item @kbd{M-@key{left}}    @tab @kbd{C-c C-x l}           @tab @kbd{@key{Esc} @key{left}}
8303 @item @kbd{M-S-@key{left}}  @tab @kbd{C-c C-x L}           @tab
8304 @item @kbd{M-@key{right}}   @tab @kbd{C-c C-x r}           @tab @kbd{@key{Esc} @key{right}}
8305 @item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R}           @tab
8306 @item @kbd{M-@key{up}}      @tab @kbd{C-c C-x u}           @tab @kbd{@key{Esc} @key{up}}
8307 @item @kbd{M-S-@key{up}}    @tab @kbd{C-c C-x U}           @tab
8308 @item @kbd{M-@key{down}}    @tab @kbd{C-c C-x d}           @tab @kbd{@key{Esc} @key{down}}
8309 @item @kbd{M-S-@key{down}}  @tab @kbd{C-c C-x D}           @tab
8310 @item @kbd{S-@key{RET}}     @tab @kbd{C-c C-x c}           @tab
8311 @item @kbd{M-@key{RET}}     @tab @kbd{C-c C-x m}           @tab @kbd{@key{Esc} @key{RET}}
8312 @item @kbd{M-S-@key{RET}}   @tab @kbd{C-c C-x M}           @tab
8313 @item @kbd{S-@key{left}}    @tab @kbd{C-c @key{left}}      @tab
8314 @item @kbd{S-@key{right}}   @tab @kbd{C-c @key{right}}     @tab
8315 @item @kbd{S-@key{up}}      @tab @kbd{C-c @key{up}}        @tab
8316 @item @kbd{S-@key{down}}    @tab @kbd{C-c @key{down}}      @tab
8317 @item @kbd{C-S-@key{left}}  @tab @kbd{C-c C-x @key{left}}  @tab
8318 @item @kbd{C-S-@key{right}} @tab @kbd{C-c C-x @key{right}} @tab
8319 @end multitable
8321 @node Interaction, Bugs, TTY keys, Miscellaneous
8322 @section Interaction with other packages
8323 @cindex packages, interaction with other
8324 Org lives in the world of GNU Emacs and interacts in various ways
8325 with other code out there.
8327 @menu
8328 * Cooperation::                 Packages Org cooperates with
8329 * Conflicts::                   Packages that lead to conflicts
8330 @end menu
8332 @node Cooperation, Conflicts, Interaction, Interaction
8333 @subsection Packages that Org cooperates with
8335 @table @asis
8336 @cindex @file{calc.el}
8337 @item @file{calc.el} by Dave Gillespie
8338 Org uses the Calc package for implementing spreadsheet
8339 functionality in its tables (@pxref{The spreadsheet}).  Org
8340 checks for the availability of Calc by looking for the function
8341 @code{calc-eval} which should be autoloaded in your setup if Calc has
8342 been installed properly.  As of Emacs 22, Calc is part of the Emacs
8343 distribution.  Another possibility for interaction between the two
8344 packages is using Calc for embedded calculations. @xref{Embedded Mode,
8345 , Embedded Mode, Calc, GNU Emacs Calc Manual}.
8346 @cindex @file{constants.el}
8347 @item @file{constants.el} by Carsten Dominik
8348 In a table formula (@pxref{The spreadsheet}), it is possible to use
8349 names for natural constants or units.  Instead of defining your own
8350 constants in the variable @code{org-table-formula-constants}, install
8351 the @file{constants} package which defines a large number of constants
8352 and units, and lets you use unit prefixes like @samp{M} for
8353 @samp{Mega} etc.  You will need version 2.0 of this package, available
8354 at @url{http://www.astro.uva.nl/~dominik/Tools}. Org checks for
8355 the function @code{constants-get}, which has to be autoloaded in your
8356 setup.  See the installation instructions in the file
8357 @file{constants.el}.
8358 @item @file{cdlatex.el} by Carsten Dominik
8359 @cindex @file{cdlatex.el}
8360 Org mode can make use of the CDLaTeX package to efficiently enter
8361 La@TeX{} fragments into Org files. See @ref{CDLaTeX mode}.
8362 @item @file{imenu.el} by Ake Stenhoff and Lars Lindberg
8363 @cindex @file{imenu.el}
8364 Imenu allows menu access to an index of items in a file.  Org mode
8365 supports Imenu - all you need to do to get the index is the following:
8366 @lisp
8367 (add-hook 'org-mode-hook
8368           (lambda () (imenu-add-to-menubar "Imenu")))
8369 @end lisp
8370 By default the index is two levels deep - you can modify the depth using
8371 the option @code{org-imenu-depth}.
8372 @item @file{remember.el} by John Wiegley
8373 @cindex @file{remember.el}
8374 Org cooperates with remember, see @ref{Remember}.
8375 @file{Remember.el} is not part of Emacs, find it on the web.
8376 @item @file{speedbar.el} by Eric M. Ludlam
8377 @cindex @file{speedbar.el}
8378 Speedbar is a package that creates a special frame displaying files and
8379 index items in files.  Org mode supports Speedbar and allows you to
8380 drill into Org files directly from the Speedbar.  It also allows to
8381 restrict the scope of agenda commands to a file or a subtree by using
8382 the command @kbd{<} in the Speedbar frame.
8383 @cindex @file{table.el}
8384 @item @file{table.el} by Takaaki Ota
8385 @kindex C-c C-c
8386 @cindex table editor, @file{table.el}
8387 @cindex @file{table.el}
8389 Complex ASCII tables with automatic line wrapping, column- and
8390 row-spanning, and alignment can be created using the Emacs table
8391 package by Takaaki Ota (@uref{http://sourceforge.net/projects/table},
8392 and also part of Emacs 22).
8393 When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org mode
8394 will call @command{table-recognize-table} and move the cursor into the
8395 table.  Inside a table, the keymap of Org mode is inactive.  In order
8396 to execute Org mode-related commands, leave the table.
8398 @table @kbd
8399 @kindex C-c C-c
8400 @item C-c C-c
8401 Recognize @file{table.el} table.  Works when the cursor is in a
8402 table.el table.
8404 @kindex C-c ~
8405 @item C-c ~
8406 Insert a table.el table.  If there is already a table at point, this
8407 command converts it between the table.el format and the Org mode
8408 format.  See the documentation string of the command
8409 @code{org-convert-table} for the restrictions under which this is
8410 possible.
8411 @end table
8412 @file{table.el} is part of Emacs 22.
8413 @cindex @file{footnote.el}
8414 @item @file{footnote.el} by Steven L. Baur
8415 Org mode recognizes numerical footnotes as provided by this package
8416 (@pxref{Footnotes}).
8417 @end table
8419 @node Conflicts,  , Cooperation, Interaction
8420 @subsection Packages that lead to conflicts with Org mode
8422 @table @asis
8424 @cindex @file{allout.el}
8425 @item @file{allout.el} by Ken Manheimer
8426 Startup of Org may fail with the error message
8427 @code{(wrong-type-argument keymapp nil)} when there is an outdated
8428 version @file{allout.el} on the load path, for example the version
8429 distributed with Emacs 21.x.  Upgrade to Emacs 22 and this problem will
8430 disappear.  If for some reason you cannot do this, make sure that org.el
8431 is loaded @emph{before} @file{allout.el}, for example by putting
8432 @code{(require 'org)} early enough into your @file{.emacs} file.
8434 @cindex @file{CUA.el}
8435 @item @file{CUA.el} by Kim. F. Storm
8436 Key bindings in Org conflict with the @kbd{S-<cursor>} keys used by
8437 CUA mode (as well as pc-select-mode and s-region-mode) to select and
8438 extend the region.  If you want to use one of these packages along with
8439 Org, configure the variable @code{org-replace-disputed-keys}.  When
8440 set, Org will move the following key bindings in Org files, and
8441 in the agenda buffer (but not during date selection).
8443 @example
8444 S-UP    -> M-p             S-DOWN  -> M-n
8445 S-LEFT  -> M--             S-RIGHT -> M-+
8446 @end example
8448 Yes, these are unfortunately more difficult to remember.  If you want
8449 to have other replacement keys, look at the variable
8450 @code{org-disputed-keys}.
8451 @item @file{windmove.el} by Hovav Shacham
8452 @cindex @file{windmove.el}
8453 Also this package uses the @kbd{S-<cursor>} keys, so everything written
8454 in the paragraph above about CUA mode also applies here.
8456 @cindex @file{footnote.el}
8457 @item @file{footnote.el} by Steven L. Baur
8458 Org supports the syntax of the footnote package, but only the
8459 numerical footnote markers.  Also, the default key for footnote
8460 commands, @kbd{C-c !} is already used by Org.  You could use the
8461 variable @code{footnote-prefix} to switch footnotes commands to another
8462 key.  Or, you could use @code{org-replace-disputed-keys} and
8463 @code{org-disputed-keys} to change the settings in Org.
8465 @end table
8468 @node Bugs,  , Interaction, Miscellaneous
8469 @section Bugs
8470 @cindex bugs
8472 Here is a list of things that should work differently, but which I
8473 have found too hard to fix.
8475 @itemize @bullet
8476 @item
8477 If a table field starts with a link, and if the corresponding table
8478 column is narrowed (@pxref{Narrow columns}) to a width too small to
8479 display the link, the field would look entirely empty even though it is
8480 not.  To prevent this, Org throws an error.  The work-around is to
8481 make the column wide enough to fit the link, or to add some text (at
8482 least 2 characters) before the link in the same field.
8483 @item
8484 Narrowing table columns does not work on XEmacs, because the
8485 @code{format} function does not transport text properties.
8486 @item
8487 Text in an entry protected with the @samp{QUOTE} keyword should not
8488 autowrap.
8489 @item
8490 When the application called by @kbd{C-c C-o} to open a file link fails
8491 (for example because the application does not exist or refuses to open
8492 the file), it does so silently.  No error message is displayed.
8493 @item
8494 Recalculating a table line applies the formulas from left to right.
8495 If a formula uses @emph{calculated} fields further down the row,
8496 multiple recalculation may be needed to get all fields consistent.  You
8497 may use the command @code{org-table-iterate} (@kbd{C-u C-c *}) to
8498 recalculate until convergence.
8499 @item
8500 The exporters work well, but could be made more efficient.
8501 @end itemize
8504 @node Extionsions, Hacking, Miscellaneous, Top
8505 @appendix Extensions
8507 This appendix lists the extension modules that have been written for Org.
8508 Many of these extensions live in the @file{contrib} directory of the Org
8509 distribution, others are available somewhere on the web.
8511 @menu
8512 * Extensions in the contrib directory::  These come with the Org distro
8513 * Other extensions::            These you have to find on the web.
8514 @end menu
8516 @node Extensions in the contrib directory, Other extensions, Extionsions, Extionsions
8517 @section Extensions in the @file{contrib} directory
8519 @table @asis
8520 @item @file{org-annotate-file.el} by @i{Philip Jackson}
8521       Annotate a file with org syntax, in a separate file, with links back to
8522       the annotated file.
8523 @item @file{org-annotation-helper.el} by @i{Bastien Guerry and Daniel E. German} 
8524       Call @i{remember} directly from Firefox/Opera, or from Adobe Reader.
8525       When activating a special link or bookmark, Emacs receives a trigger to
8526       create a note with a link back to the website.  Requires some setup, a
8527       detailes description is in
8528       @file{contrib/packages/org-annotation-helper}.
8529 @item @file{org-bookmark.el} by @i{Tokuya Kameshima}
8530       Support for links to Emacs bookmarks.
8531 @item @file{org-depend.el} by @i{Carsten Dominik}
8532       TODO dependencies for Org-mode.  Make TODO state changes in one entry
8533       trigger changes in another, or be blocked by the state of another
8534       entry.  Also, easily create chains of TODO items with exactly one
8535       active item at any time.
8536 @item @file{org-elisp-symbol.el} by @i{Bastien Guerry}
8537       Org links to emacs-lisp symbols.  This can create annotated links that
8538       exactly point to the definition location of a variable of function.
8539 @item @file{org-eval.el} by @i{Carsten Dominik}
8540       The @code{<lisp>} tag, adapted from Emacs Wiki and Emacs Muse, allows
8541       to include text in a document that is the result of evaluating some
8542       code.  Other scripting languages like @code{perl} can be supported with
8543       this package as well.
8544 @item @file{org-expiry.el} by @i{Bastien Guerry}
8545       Expiry mechanism for Org entries.
8546 @item @file{org-indent.el} by @i{Carsten Dominik}
8547       Dynamic indentation of Org outlines.  The plan is to indent an outline
8548       according to level, but so far this is too hard for a proper and stable
8549       implementation.  Still, it works somewhat.
8550 @item @file{org-interactive-query.el} by @i{Christopher League}
8551       Interactive modification of tags queries.  After running a general
8552       query in Org, this package allows to narrow down the results by adding
8553       more tags or keywords.
8554 @item @file{org-mairix.el} by @i{Georg C. F. Greve}
8555       Hook mairix search into Org for different MUAs.
8556 @item @file{org-man.el} by @i{Carsten Dominik}
8557       Support for links to manpages in Org-mode.
8558 @item @file{org-mtags.el} by @i{Carsten Dominik}
8559       Support for some Muse-like tags in Org-mode.  This package allows you
8560       to write @code{<example>} and @code{<src>} and other syntax copied from
8561       Emacs Muse, right inside an Org file.  The goal here is to make it easy
8562       to publish the same file using either org-publish or Muse.
8563 @item @file{org-panel.el} by @i{Lennard Borgman}
8564       Simplified and display-aided access to some Org commands.
8565 @item @file{org-registry.el} by @i{Bastien Guerry}
8566       A registry for Org links, to find out from where links point to a given
8567       file or location.
8568 @item @file{org2rem.el} by @i{Bastien Guerry}
8569       Convert org appointments into reminders for the @file{remind} program.
8570 @item @file{org-screen.el} by @i{Andrew Hyatt}
8571       Visit screen sessions through Org-mode links.
8572 @item @file{org-toc.el} by @i{Bastien Guerry}
8573       Table of contents in a separate buffer, with fast access to sections
8574       and easy visibility cycling.
8575 @item @file{orgtbl-sqlinsert.el} by @i{Jason Riedy}
8576       Convert Org-mode tables to SQL insertions.  Documentation for this can
8577       be found on the Worg pages.
8578 @end table
8581 @node Other extensions,  , Extensions in the contrib directory, Extionsions
8582 @section Other extensions
8584 @i{TO BE DONE}
8586 @node Hacking, History and Acknowledgments, Extionsions, Top
8587 @appendix Hacking
8589 This appendix covers some aspects where users can extend the functionality of
8590 Org.
8592 @menu
8593 * Adding hyperlink types::      New custom link types
8594 * Tables in arbitrary syntax::  Orgtbl for LaTeX and other programs
8595 * Dynamic blocks::              Automatically filled blocks
8596 * Special agenda views::        Customized views
8597 * Using the property API::      Writing programs that use entry properties
8598 * Using the mapping API::       Mapping over all or selected entries
8599 @end menu
8601 @node Adding hyperlink types, Tables in arbitrary syntax, Hacking, Hacking
8602 @section Adding hyperlink types
8603 @cindex hyperlinks, adding new types
8605 Org has a large number of hyperlink types built-in
8606 (@pxref{Hyperlinks}).  If you would like to add new link types, it
8607 provides an interface for doing so.  Lets look at an example file
8608 @file{org-man.el} that will add support for creating links like
8609 @samp{[[man:printf][The printf manpage]]} to show Unix manual pages inside
8610 emacs:
8612 @lisp
8613 ;;; org-man.el - Support for links to manpages in Org
8615 (require 'org)
8617 (org-add-link-type "man" 'org-man-open)
8618 (add-hook 'org-store-link-functions 'org-man-store-link)
8620 (defcustom org-man-command 'man
8621   "The Emacs command to be used to display a man page."
8622   :group 'org-link
8623   :type '(choice (const man) (const woman)))
8625 (defun org-man-open (path)
8626   "Visit the manpage on PATH.
8627 PATH should be a topic that can be thrown at the man command."
8628   (funcall org-man-command path))
8630 (defun org-man-store-link ()
8631   "Store a link to a manpage."
8632   (when (memq major-mode '(Man-mode woman-mode))
8633     ;; This is a man page, we do make this link
8634     (let* ((page (org-man-get-page-name))
8635            (link (concat "man:" page))
8636            (description (format "Manpage for %s" page)))
8637       (org-store-link-props
8638        :type "man"
8639        :link link
8640        :description description))))
8642 (defun org-man-get-page-name ()
8643   "Extract the page name from the buffer name."
8644   ;; This works for both `Man-mode' and `woman-mode'.
8645   (if (string-match " \\(\\S-+\\)\\*" (buffer-name))
8646       (match-string 1 (buffer-name))
8647     (error "Cannot create link to this man page")))
8649 (provide 'org-man)
8651 ;;; org-man.el ends here
8652 @end lisp
8654 @noindent
8655 You would activate this new link type in @file{.emacs} with
8657 @lisp
8658 (require 'org-man)
8659 @end lisp
8661 @noindent
8662 Lets go through the file and see what it does.
8663 @enumerate
8664 @item
8665 It does @code{(require 'org)} to make sure that @file{org.el} has been
8666 loaded.
8667 @item
8668 The next line calls @code{org-add-link-type} to define a new link type
8669 with prefix @samp{man}.  The call also contains the name of a function
8670 that will be called to follow such a link.
8671 @item
8672 The next line adds a function to @code{org-store-link-functions}, in
8673 order to allow the command @kbd{C-c l} to record a useful link in a
8674 buffer displaying a man page.
8675 @end enumerate
8677 The rest of the file defines the necessary variables and functions.
8678 First there is a customization variable that determines which emacs
8679 command should be used to display man pages.  There are two options,
8680 @code{man} and @code{woman}.  Then the function to follow a link is
8681 defined.  It gets the link path as an argument - in this case the link
8682 path is just a topic for the manual command.  The function calls the
8683 value of @code{org-man-command} to display the man page.
8685 Finally the function @code{org-man-store-link} is defined.  When you try
8686 to store a link with @kbd{C-c l}, also this function will be called to
8687 try to make a link.  The function must first decide if it is supposed to
8688 create the link for this buffer type, we do this by checking the value
8689 of the variable @code{major-mode}.  If not, the function must exit and
8690 return the value @code{nil}.  If yes, the link is created by getting the
8691 manual topic from the buffer name and prefixing it with the string
8692 @samp{man:}.  Then it must call the command @code{org-store-link-props}
8693 and set the @code{:type} and @code{:link} properties.  Optionally you
8694 can also set the @code{:description} property to provide a default for
8695 the link description when the link is later inserted into an Org
8696 buffer with @kbd{C-c C-l}.
8698 @node Tables in arbitrary syntax, Dynamic blocks, Adding hyperlink types, Hacking
8699 @section Tables and lists in arbitrary syntax
8700 @cindex tables, in other modes
8701 @cindex lists, in other modes
8702 @cindex Orgtbl mode
8704 Since Orgtbl mode can be used as a minor mode in arbitrary buffers, a
8705 frequent feature request has been to make it work with native tables in
8706 specific languages, for example La@TeX{}.  However, this is extremely
8707 hard to do in a general way, would lead to a customization nightmare,
8708 and would take away much of the simplicity of the Orgtbl mode table
8709 editor.
8712 This appendix describes a different approach.  We keep the Orgtbl mode
8713 table in its native format (the @i{source table}), and use a custom
8714 function to @i{translate} the table to the correct syntax, and to
8715 @i{install} it in the right location (the @i{target table}).  This puts
8716 the burden of writing conversion functions on the user, but it allows
8717 for a very flexible system.
8719 Bastien added the ability to do the same with lists.  You can use Org's
8720 facilities to edit and structure lists by turning @code{orgstruct-mode}
8721 on, then locally exporting such lists in another format (HTML, La@TeX{}
8722 or Texinfo.)
8725 @menu
8726 * Radio tables::                Sending and receiving
8727 * A LaTeX example::             Step by step, almost a tutorial
8728 * Translator functions::        Copy and modify
8729 * Radio lists::                 Doing the same for lists
8730 @end menu
8732 @node Radio tables, A LaTeX example, Tables in arbitrary syntax, Tables in arbitrary syntax
8733 @subsection Radio tables
8734 @cindex radio tables
8736 To define the location of the target table, you first need to create two
8737 lines that are comments in the current mode, but contain magic words for
8738 Orgtbl mode to find.  Orgtbl mode will insert the translated table
8739 between these lines, replacing whatever was there before.  For example:
8741 @example
8742 /* BEGIN RECEIVE ORGTBL table_name */
8743 /* END RECEIVE ORGTBL table_name */
8744 @end example
8746 @noindent
8747 Just above the source table, we put a special line that tells
8748 Orgtbl mode how to translate this table and where to install it.  For
8749 example:
8750 @example
8751 #+ORGTBL: SEND table_name translation_function arguments....
8752 @end example
8754 @noindent
8755 @code{table_name} is the reference name for the table that is also used
8756 in the receiver lines. @code{translation_function} is the Lisp function
8757 that does the translation.  Furthermore, the line can contain a list of
8758 arguments (alternating key and value) at the end.  The arguments will be
8759 passed as a property list to the translation function for
8760 interpretation.  A few standard parameters are already recognized and
8761 acted upon before the translation function is called:
8763 @table @code
8764 @item :skip N
8765 Skip the first N lines of the table.  Hlines do count as separate lines for
8766 this parameter!
8768 @item :skipcols (n1 n2 ...)
8769 List of columns that should be skipped.  If the table has a column with
8770 calculation marks, that column is automatically discarded as well.
8771 Please note that the translator function sees the table @emph{after} the
8772 removal of these columns, the function never knows that there have been
8773 additional columns.
8774 @end table
8776 @noindent
8777 The one problem remaining is how to keep the source table in the buffer
8778 without disturbing the normal workings of the file, for example during
8779 compilation of a C file or processing of a La@TeX{} file.  There are a
8780 number of different solutions:
8782 @itemize @bullet
8783 @item
8784 The table could be placed in a block comment if that is supported by the
8785 language.  For example, in C mode you could wrap the table between
8786 @samp{/*} and @samp{*/} lines.
8787 @item
8788 Sometimes it is possible to put the table after some kind of @i{END}
8789 statement, for example @samp{\bye} in TeX and @samp{\end@{document@}}
8790 in La@TeX{}.
8791 @item
8792 You can just comment the table line by line whenever you want to process
8793 the file, and uncomment it whenever you need to edit the table.  This
8794 only sounds tedious - the command @kbd{M-x orgtbl-toggle-comment} does
8795 make this comment-toggling very easy, in particular if you bind it to a
8796 key.
8797 @end itemize
8799 @node A LaTeX example, Translator functions, Radio tables, Tables in arbitrary syntax
8800 @subsection A LaTeX example of radio tables
8801 @cindex LaTeX, and Orgtbl mode
8803 The best way to wrap the source table in La@TeX{} is to use the
8804 @code{comment} environment provided by @file{comment.sty}.  It has to be
8805 activated by placing @code{\usepackage@{comment@}} into the document
8806 header.  Orgtbl mode can insert a radio table skeleton@footnote{By
8807 default this works only for La@TeX{}, HTML, and Texinfo.  Configure the
8808 variable @code{orgtbl-radio-tables} to install templates for other
8809 modes.}  with the command @kbd{M-x orgtbl-insert-radio-table}.  You will
8810 be prompted for a table name, lets say we use @samp{salesfigures}.  You
8811 will then get the following template:
8813 @cindex #+ORGTBL: SEND
8814 @example
8815 % BEGIN RECEIVE ORGTBL salesfigures
8816 % END RECEIVE ORGTBL salesfigures
8817 \begin@{comment@}
8818 #+ORGTBL: SEND salesfigures orgtbl-to-latex
8819 | | |
8820 \end@{comment@}
8821 @end example
8823 @noindent
8824 The @code{#+ORGTBL: SEND} line tells Orgtbl mode to use the function
8825 @code{orgtbl-to-latex} to convert the table into La@TeX{} and to put it
8826 into the receiver location with name @code{salesfigures}.  You may now
8827 fill in the table, feel free to use the spreadsheet features@footnote{If
8828 the @samp{#+TBLFM} line contains an odd number of dollar characters,
8829 this may cause problems with font-lock in LaTeX mode.  As shown in the
8830 example you can fix this by adding an extra line inside the
8831 @code{comment} environment that is used to balance the dollar
8832 expressions.  If you are using AUCTeX with the font-latex library, a
8833 much better solution is to add the @code{comment} environment to the
8834 variable @code{LaTeX-verbatim-environments}.}:
8836 @example
8837 % BEGIN RECEIVE ORGTBL salesfigures
8838 % END RECEIVE ORGTBL salesfigures
8839 \begin@{comment@}
8840 #+ORGTBL: SEND salesfigures orgtbl-to-latex
8841 | Month | Days | Nr sold | per day |
8842 |-------+------+---------+---------|
8843 | Jan   |   23 |      55 |     2.4 |
8844 | Feb   |   21 |      16 |     0.8 |
8845 | March |   22 |     278 |    12.6 |
8846 #+TBLFM: $4=$3/$2;%.1f
8847 % $ (optional extra dollar to keep font-lock happy, see footnote)
8848 \end@{comment@}
8849 @end example
8851 @noindent
8852 When you are done, press @kbd{C-c C-c} in the table to get the converted
8853 table inserted between the two marker lines.
8855 Now lets assume you want to make the table header by hand, because you
8856 want to control how columns are aligned etc.  In this case we make sure
8857 that the table translator does skip the first 2 lines of the source
8858 table, and tell the command to work as a @i{splice}, i.e. to not produce
8859 header and footer commands of the target table:
8861 @example
8862 \begin@{tabular@}@{lrrr@}
8863 Month & \multicolumn@{1@}@{c@}@{Days@} & Nr.\ sold & per day\\
8864 % BEGIN RECEIVE ORGTBL salesfigures
8865 % END RECEIVE ORGTBL salesfigures
8866 \end@{tabular@}
8868 \begin@{comment@}
8869 #+ORGTBL: SEND salesfigures orgtbl-to-latex :splice t :skip 2
8870 | Month | Days | Nr sold | per day |
8871 |-------+------+---------+---------|
8872 | Jan   |   23 |      55 |     2.4 |
8873 | Feb   |   21 |      16 |     0.8 |
8874 | March |   22 |     278 |    12.6 |
8875 #+TBLFM: $4=$3/$2;%.1f
8876 \end@{comment@}
8877 @end example
8879 The La@TeX{} translator function @code{orgtbl-to-latex} is already part of
8880 Orgtbl mode.  It uses a @code{tabular} environment to typeset the table
8881 and marks horizontal lines with @code{\hline}.  Furthermore, it
8882 interprets the following parameters (see also @ref{Translator functions}):
8884 @table @code
8885 @item :splice nil/t
8886 When set to t, return only table body lines, don't wrap them into a
8887 tabular environment.  Default is nil.
8889 @item :fmt fmt
8890 A format to be used to wrap each field, should contain @code{%s} for the
8891 original field value.  For example, to wrap each field value in dollars,
8892 you could use @code{:fmt "$%s$"}.  This may also be a property list with
8893 column numbers and formats. for example @code{:fmt (2 "$%s$" 4 "%s\\%%")}.
8894 A function of one argument can be used in place of the strings; the
8895 function must return a formatted string.
8897 @item :efmt efmt
8898 Use this format to print numbers with exponentials.  The format should
8899 have @code{%s} twice for inserting mantissa and exponent, for example
8900 @code{"%s\\times10^@{%s@}"}.  The default is @code{"%s\\,(%s)"}.  This
8901 may also be a property list with column numbers and formats, for example
8902 @code{:efmt (2 "$%s\\times10^@{%s@}$" 4 "$%s\\cdot10^@{%s@}$")}.  After
8903 @code{efmt} has been applied to a value, @code{fmt} will also be
8904 applied.  Similar to @code{fmt}, functions of two arguments can be
8905 supplied instead of strings.
8906 @end table
8908 @node Translator functions, Radio lists, A LaTeX example, Tables in arbitrary syntax
8909 @subsection Translator functions
8910 @cindex HTML, and Orgtbl mode
8911 @cindex translator function
8913 Orgtbl mode has several translator functions built-in: @code{orgtbl-to-csv}
8914 (comma-separated values), @code{orgtbl-to-tsv} (TAB-separated values)
8915 @code{orgtbl-to-latex}, @code{orgtbl-to-html}, and @code{orgtbl-to-texinfo}.
8916 Except for @code{orgtbl-to-html}@footnote{The HTML translator uses the same
8917 code that produces tables during HTML export.}, these all use a generic
8918 translator, @code{orgtbl-to-generic}.  For example, @code{orgtbl-to-latex}
8919 itself is a very short function that computes the column definitions for the
8920 @code{tabular} environment, defines a few field and line separators and then
8921 hands over to the generic translator.  Here is the entire code:
8923 @lisp
8924 @group
8925 (defun orgtbl-to-latex (table params)
8926   "Convert the Orgtbl mode TABLE to LaTeX."
8927   (let* ((alignment (mapconcat (lambda (x) (if x "r" "l"))
8928                                org-table-last-alignment ""))
8929          (params2
8930           (list
8931            :tstart (concat "\\begin@{tabular@}@{" alignment "@}")
8932            :tend "\\end@{tabular@}"
8933            :lstart "" :lend " \\\\" :sep " & "
8934            :efmt "%s\\,(%s)" :hline "\\hline")))
8935     (orgtbl-to-generic table (org-combine-plists params2 params))))
8936 @end group
8937 @end lisp
8939 As you can see, the properties passed into the function (variable
8940 @var{PARAMS}) are combined with the ones newly defined in the function
8941 (variable @var{PARAMS2}).  The ones passed into the function (i.e. the
8942 ones set by the @samp{ORGTBL SEND} line) take precedence.  So if you
8943 would like to use the La@TeX{} translator, but wanted the line endings to
8944 be @samp{\\[2mm]} instead of the default @samp{\\}, you could just
8945 overrule the default with
8947 @example
8948 #+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]"
8949 @end example
8951 For a new language, you can either write your own converter function in
8952 analogy with the La@TeX{} translator, or you can use the generic function
8953 directly.  For example, if you have a language where a table is started
8954 with @samp{!BTBL!}, ended with @samp{!ETBL!}, and where table lines are
8955 started with @samp{!BL!}, ended with @samp{!EL!} and where the field
8956 separator is a TAB, you could call the generic translator like this (on
8957 a single line!):
8959 @example
8960 #+ORGTBL: SEND test orgtbl-to-generic :tstart "!BTBL!" :tend "!ETBL!"
8961                               :lstart "!BL! " :lend " !EL!" :sep "\t"
8962 @end example
8964 @noindent
8965 Please check the documentation string of the function
8966 @code{orgtbl-to-generic} for a full list of parameters understood by
8967 that function and remember that you can pass each of them into
8968 @code{orgtbl-to-latex}, @code{orgtbl-to-texinfo}, and any other function
8969 using the generic function.
8971 Of course you can also write a completely new function doing complicated
8972 things the generic translator cannot do.  A translator function takes
8973 two arguments.  The first argument is the table, a list of lines, each
8974 line either the symbol @code{hline} or a list of fields.  The second
8975 argument is the property list containing all parameters specified in the
8976 @samp{#+ORGTBL: SEND} line.  The function must return a single string
8977 containing the formatted table.  If you write a generally useful
8978 translator, please post it on @code{emacs-orgmode@@gnu.org} so that
8979 others can benefit from your work.
8981 @node  Radio lists,  , Translator functions, Tables in arbitrary syntax
8982 @subsection Radio lists
8983 @cindex radio lists
8984 @cindex org-list-insert-radio-list
8986 Sending and receiving radio lists works exactly the same way than
8987 sending and receiving radio tables (@pxref{Radio tables}) @footnote{You
8988 need to load the @code{org-export-latex.el} package to use radio lists
8989 since the relevant code is there for now.}.  As for radio tables, you
8990 can insert radio lists templates in HTML, La@TeX{} and Texinfo modes by
8991 calling @code{org-list-insert-radio-list}.
8993 Here are the differences with radio tables:
8995 @itemize @minus
8996 @item
8997 Use @code{ORGLST} instead of @code{ORGTBL}.
8998 @item
8999 The available translation functions for radio lists don't take
9000 parameters.
9001 @item
9002 `C-c C-c' will work when pressed on the first item of the list.
9003 @end itemize
9005 Here is a La@TeX{} example.  Let's say that you have this in your
9006 La@TeX{} file:
9008 @example
9009 % BEGIN RECEIVE ORGLST to-buy
9010 % END RECEIVE ORGLST to-buy
9011 \begin@{comment@}
9012 #+ORGLIST: SEND to-buy orgtbl-to-latex
9013 - a new house
9014 - a new computer
9015   + a new keyboard
9016   + a new mouse
9017 - a new life
9018 \end@{comment@}
9019 @end example
9021 Pressing `C-c C-c' on @code{a new house} and will insert the converted
9022 La@TeX{} list between the two marker lines.
9024 @node Dynamic blocks, Special agenda views, Tables in arbitrary syntax, Hacking
9025 @section Dynamic blocks
9026 @cindex dynamic blocks
9028 Org documents can contain @emph{dynamic blocks}.  These are
9029 specially marked regions that are updated by some user-written function.
9030 A good example for such a block is the clock table inserted by the
9031 command @kbd{C-c C-x C-r} (@pxref{Clocking work time}).
9033 Dynamic block are enclosed by a BEGIN-END structure that assigns a name
9034 to the block and can also specify parameters for the function producing
9035 the content of the block.
9037 #+BEGIN:dynamic block
9038 @example
9039 #+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
9041 #+END:
9042 @end example
9044 Dynamic blocks are updated with the following commands
9046 @table @kbd
9047 @kindex C-c C-x C-u
9048 @item C-c C-x C-u
9049 Update dynamic block at point.
9050 @kindex C-u C-c C-x C-u
9051 @item C-u C-c C-x C-u
9052 Update all dynamic blocks in the current file.
9053 @end table
9055 Updating a dynamic block means to remove all the text between BEGIN and
9056 END, parse the BEGIN line for parameters and then call the specific
9057 writer function for this block to insert the new content.  If you want
9058 to use the original content in the writer function, you can use the
9059 extra parameter @code{:content}.
9061 For a block with name @code{myblock}, the writer function is
9062 @code{org-dblock-write:myblock} with as only parameter a property list
9063 with the parameters given in the begin line.  Here is a trivial example
9064 of a block that keeps track of when the block update function was last
9065 run:
9067 @example
9068 #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
9070 #+END:
9071 @end example
9073 @noindent
9074 The corresponding block writer function could look like this:
9076 @lisp
9077 (defun org-dblock-write:block-update-time (params)
9078    (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
9079      (insert "Last block update at: "
9080              (format-time-string fmt (current-time)))))
9081 @end lisp
9083 If you want to make sure that all dynamic blocks are always up-to-date,
9084 you could add the function @code{org-update-all-dblocks} to a hook, for
9085 example @code{before-save-hook}.  @code{org-update-all-dblocks} is
9086 written in a way that is does nothing in buffers that are not in
9087 @code{org-mode}.
9089 @node Special agenda views, Using the property API, Dynamic blocks, Hacking
9090 @section Special agenda views
9091 @cindex agenda views, user-defined
9093 Org provides a special hook that can be used to narrow down the
9094 selection made by any of the agenda views.  You may specify a function
9095 that is used at each match to verify if the match should indeed be part
9096 of the agenda view, and if not, how much should be skipped.
9098 Let's say you want to produce a list of projects that contain a WAITING
9099 tag anywhere in the project tree.  Let's further assume that you have
9100 marked all tree headings that define a project with the TODO keyword
9101 PROJECT.  In this case you would run a TODO search for the keyword
9102 PROJECT, but skip the match unless there is a WAITING tag anywhere in
9103 the subtree belonging to the project line.
9105 To achieve this, you must write a function that searches the subtree for
9106 the tag.  If the tag is found, the function must return @code{nil} to
9107 indicate that this match should not be skipped.  If there is no such
9108 tag, return the location of the end of the subtree, to indicate that
9109 search should continue from there.
9111 @lisp
9112 (defun my-skip-unless-waiting ()
9113   "Skip trees that are not waiting"
9114   (let ((subtree-end (save-excursion (org-end-of-subtree t))))
9115     (if (re-search-forward ":waiting:" subtree-end t)
9116         nil          ; tag found, do not skip
9117       subtree-end))) ; tag not found, continue after end of subtree
9118 @end lisp
9120 Now you may use this function in an agenda custom command, for example
9121 like this:
9123 @lisp
9124 (org-add-agenda-custom-command
9125  '("b" todo "PROJECT"
9126    ((org-agenda-skip-function 'my-org-waiting-projects)
9127     (org-agenda-overriding-header "Projects waiting for something: "))))
9128 @end lisp
9130 Note that this also binds @code{org-agenda-overriding-header} to get a
9131 meaningful header in the agenda view.
9133 A general way to create custom searches is to base them on a search for
9134 entries with a certain level limit.  If you want to study all entries with
9135 your custom search function, simply do a search for @samp{LEVEL>0}, and then
9136 use @code{org-agenda-skip-function} to select the entries you really want to
9137 have.
9139 You may also put a Lisp form into @code{org-agenda-skip-function}.  In
9140 particular, you may use the functions @code{org-agenda-skip-entry-if}
9141 and @code{org-agenda-skip-subtree-if} in this form, for example:
9143 @table @code
9144 @item '(org-agenda-skip-entry-if 'scheduled)
9145 Skip current entry if it has been scheduled.
9146 @item '(org-agenda-skip-entry-if 'notscheduled)
9147 Skip current entry if it has not been scheduled.
9148 @item '(org-agenda-skip-entry-if 'deadline)
9149 Skip current entry if it has a deadline.
9150 @item '(org-agenda-skip-entry-if 'scheduled 'deadline)
9151 Skip current entry if it has a deadline, or if it is scheduled.
9152 @item '(org-agenda-skip-entry 'regexp "regular expression")
9153 Skip current entry if the regular expression matches in the entry.
9154 @item '(org-agenda-skip-entry 'notregexp "regular expression")
9155 Skip current entry unless the regular expression matches.
9156 @item '(org-agenda-skip-subtree-if 'regexp "regular expression")
9157 Same as above, but check and skip the entire subtree.
9158 @end table
9160 Therefore we could also have written the search for WAITING projects
9161 like this, even without defining a special function:
9163 @lisp
9164 (org-add-agenda-custom-command
9165  '("b" todo "PROJECT"
9166    ((org-agenda-skip-function '(org-agenda-skip-subtree-if
9167                                 'regexp ":waiting:"))
9168     (org-agenda-overriding-header "Projects waiting for something: "))))
9169 @end lisp
9171 @node Using the property API, Using the mapping API, Special agenda views, Hacking
9172 @section Using the property API
9173 @cindex API, for properties
9174 @cindex properties, API
9176 Here is a description of the functions that can be used to work with
9177 properties.
9179 @defun org-entry-properties &optional pom which
9180 Get all properties of the entry at point-or-marker POM.
9181 This includes the TODO keyword, the tags, time strings for deadline,
9182 scheduled, and clocking, and any additional properties defined in the
9183 entry.  The return value is an alist, keys may occur multiple times
9184 if the property key was used several times.
9185 POM may also be nil, in which case the current entry is used.
9186 If WHICH is nil or `all', get all properties.  If WHICH is
9187 `special' or `standard', only get that subclass.
9188 @end defun
9189 @defun org-entry-get pom property &optional inherit
9190 Get value of PROPERTY for entry at point-or-marker POM.  By default,
9191 this only looks at properties defined locally in the entry.  If INHERIT
9192 is non-nil and the entry does not have the property, then also check
9193 higher levels of the hierarchy.  If INHERIT is the symbol
9194 @code{selective}, use inheritance if and only if the setting of
9195 @code{org-use-property-inheritance} selects PROPERTY for inheritance.
9196 @end defun
9198 @defun org-entry-delete pom property
9199 Delete the property PROPERTY from entry at point-or-marker POM.
9200 @end defun
9202 @defun org-entry-put pom property value
9203 Set PROPERTY to VALUE for entry at point-or-marker POM.
9204 @end defun
9206 @defun org-buffer-property-keys &optional include-specials
9207 Get all property keys in the current buffer.
9208 @end defun
9210 @defun org-insert-property-drawer
9211 Insert a property drawer at point.
9212 @end defun
9214 @defun org-entry-add-to-multivalued-property pom property value
9215 Treat the value of the property PROPERTY as a whitespace-separated list of
9216 values and make sure that VALUE is in this list.
9217 @end defun
9219 @defun org-entry-remove-from-multivalued-property pom property value
9220 Treat the value of the property PROPERTY as a whitespace-separated list of
9221 values and make sure that VALUE is @emph{not} in this list.
9222 @end defun
9224 @defun org-entry-member-in-multivalued-property pom property value
9225 Treat the value of the property PROPERTY as a whitespace-separated list of
9226 values and check if VALUE is in this list.
9227 @end defun
9229 @node Using the mapping API,  , Using the property API, Hacking
9230 @section Using the mapping API
9231 @cindex API, for mapping
9232 @cindex mapping entries, API
9234 Org has sophisticated mapping capabilities to find all entries satisfying
9235 certain criteria.  Internally, this functionality is used to produce agenda
9236 views, but there is also an API that can be used to execute arbitrary
9237 functions for each or selected entries.  The main entry point for this API
9238 is: 
9240 @defun org-map-entries func &optional match scope &rest skip
9241 Call FUNC at each headline selected by MATCH in SCOPE.
9243 FUNC is a function or a lisp form.  The function will be called without
9244 arguments, with the cursor positioned at the beginning of the headline.
9245 The return values of all calls to the function will be collected and
9246 returned as a list.
9248 MATCH is a tags/property/todo match as it is used in the agenda tags view.
9249 Only headlines that are matched by this query will be considered during
9250 the iteration.  When MATCH is nil or t, all headlines will be
9251 visited by the iteration.
9253 SCOPE determines the scope of this command.  It can be any of:
9255 @example
9256 nil     @r{the current buffer, respecting the restriction if any}
9257 tree    @r{the subtree started with the entry at point}
9258 file    @r{the current buffer, without restriction}
9259 file-with-archives
9260         @r{the current buffer, and any archives associated with it}
9261 agenda  @r{all agenda files}
9262 agenda-with-archives
9263         @r{all agenda files with any archive files associated with them}
9264 (file1 file2 ...)
9265         @r{if this is a list, all files in the list will be scanned}
9266 @end example
9268 The remaining args are treated as settings for the skipping facilities of
9269 the scanner.  The following items can be given here:
9271 @example
9272 archive   @r{skip trees with the archive tag}
9273 comment   @r{skip trees with the COMMENT keyword}
9274 function or Lisp form
9275           @r{will be used as value for @code{org-agenda-skip-function},}
9276           @r{so whenever the the function returns t, FUNC}
9277           @r{will not be called for that entry and search will}
9278           @r{continue from the point where the function leaves it}
9279 @end example
9280 @end defun
9282 The function given to that mapping routine can really do anything you like.
9283 It can uce the property API (@pxref{Using the property API}) to gather more
9284 information about the entry, or in order to change metadate in the entry.
9285 Here are a couple of functions that might be handy:
9287 @defun org-todo &optional arg
9288 Change the TODO state of the entry, see the docstring of the functions for
9289 the many possible values for the argument ARG.
9290 @end defun
9292 @defun org-priority &optional action
9293 Change the priority of the entry, see the docstring of this function for the
9294 possible values for ACTION.
9295 @end defun
9297 @defun org-toggle-tag tag &optional onoff
9298 Toggle the tag TAG in the current entry.  Setting ONOFF to either @code{on}
9299 or @code{off} will not toggle tag, but ensure that it is either on or off.
9300 @end defun
9302 @defun org-promote
9303 Promote the current entry.
9304 @end defun
9306 @defun org-demote
9307 Demote the current entry.
9308 @end defun
9310 Here is a simple example that will turn all entries in the current file with
9311 a tag @code{TOMORROW} into TODO entries with the keyword @code{UPCOMING}
9312 Entries in comment trees and in archive trees will be ignored.
9314 @lisp
9315 (org-map-entries
9316    '(org-todo "UPCOMING")
9317    "+TOMORROW" 'file 'archive 'comment)
9318 @end lisp
9320 The following example counts the number of entries with TODO keyword
9321 @code{WAITING}, in all agenda files.
9323 @lisp
9324 (length (org-map-entries t nil 'agenda))
9325 @end lisp
9327 @node History and Acknowledgments, Main Index, Hacking, Top
9328 @appendix History and Acknowledgments
9329 @cindex acknowledgments
9330 @cindex history
9331 @cindex thanks
9333 Org was borne in 2003, out of frustration over the user interface
9334 of the Emacs Outline mode.  I was trying to organize my notes and
9335 projects, and using Emacs seemed to be the natural way to go.  However,
9336 having to remember eleven different commands with two or three keys per
9337 command, only to hide and show parts of the outline tree, that seemed
9338 entirely unacceptable to me.  Also, when using outlines to take notes, I
9339 constantly want to restructure the tree, organizing it parallel to my
9340 thoughts and plans.  @emph{Visibility cycling} and @emph{structure
9341 editing} were originally implemented in the package
9342 @file{outline-magic.el}, but quickly moved to the more general
9343 @file{org.el}.  As this environment became comfortable for project
9344 planning, the next step was adding @emph{TODO entries}, basic @emph{time
9345 stamps}, and @emph{table support}.  These areas highlight the two main
9346 goals that Org still has today: To create a new, outline-based,
9347 plain text mode with innovative and intuitive editing features, and to
9348 incorporate project planning functionality directly into a notes file.
9350 A special thanks goes to @i{Bastien Guerry} who has not only writen a large
9351 number of extensions to Org (most of them integrated into the core by now),
9352 but has also helped the development and maintenance of Org so much that he
9353 should be considered co-author of this package.
9355 Since the first release, literally thousands of emails to me or on
9356 @code{emacs-orgmode@@gnu.org} have provided a constant stream of bug
9357 reports, feedback, new ideas, and sometimes patches and add-on code.
9358 Many thanks to everyone who has helped to improve this package.  I am
9359 trying to keep here a list of the people who had significant influence
9360 in shaping one or more aspects of Org.  The list may not be
9361 complete, if I have forgotten someone, please accept my apologies and
9362 let me know.
9364 @itemize @bullet
9366 @item
9367 @i{Russel Adams} came up with the idea for drawers.
9368 @item
9369 @i{Thomas Baumann} wrote @file{org-bbdb.el} and @file{org-mhe.el}.
9370 @item
9371 @i{Alex Bochannek} provided a patch for rounding time stamps.
9372 @item
9373 @i{Charles Cave}'s suggestion sparked the implementation of templates
9374 for Remember.
9375 @item
9376 @i{Pavel Chalmoviansky} influenced the agenda treatment of items with
9377 specified time.
9378 @item
9379 @i{Gregory Chernov} patched support for lisp forms into table
9380 calculations and improved XEmacs compatibility, in particular by porting
9381 @file{nouline.el} to XEmacs.
9382 @item
9383 @i{Sacha Chua} suggested to copy some linking code from Planner.
9384 @item
9385 @i{Eddward DeVilla} proposed and tested checkbox statistics.  He also
9386 came up with the idea of properties, and that there should be an API for
9387 them.
9388 @item
9389 @i{Kees Dullemond} used to edit projects lists directly in HTML and so
9390 inspired some of the early development, including HTML export.  He also
9391 asked for a way to narrow wide table columns.
9392 @item
9393 @i{Christian Egli} converted the documentation into Texinfo format,
9394 patched CSS formatting into the HTML exporter, and inspired the agenda.
9395 @item
9396 @i{David Emery} provided a patch for custom CSS support in exported
9397 HTML agendas.
9398 @item
9399 @i{Nic Ferrier} contributed mailcap and XOXO support.
9400 @item
9401 @i{Miguel A. Figueroa-Villanueva} implemented hierarchical checkboxes.
9402 @item
9403 @i{John Foerch} figured out how to make incremental search show context
9404 around a match in a hidden outline tree.
9405 @item
9406 @i{Niels Giesen} had the idea to automatically archive DONE trees.
9407 @item
9408 @i{Bastien Guerry} wrote the La@TeX{} exporter and @file{org-bibtex.el}, and
9409 has been prolific with patches, ideas, and bug reports.
9410 @item
9411 @i{Kai Grossjohann} pointed out key-binding conflicts with other packages.
9412 @item
9413 @i{Bernt Hansen} has driven much of the support for auto-repeating tasks,
9414 task state change logging, and the clocktable.  His clear explanations have
9415 been critical when we started to adopt the GIT version control system.
9416 @item
9417 @i{Phil Jackson} wrote @file{org-irc.el}.
9418 @item
9419 @i{Scott Jaderholm} proposed footnotes, control over whitespace between
9420 folded entries, and column view for properties.
9421 @item
9422 @i{Tokuya Kameshima} wrote @file{org-wl.el} and @file{org-mew.el}.
9423 @item
9424 @i{Shidai Liu} ("Leo") asked for embedded La@TeX{} and tested it.  He also
9425 provided frequent feedback and some patches.
9426 @item
9427 @i{Jason F. McBrayer} suggested agenda export to CSV format.
9428 @item
9429 @i{Max Mikhanosha} came up with the idea of refiling.
9430 @item
9431 @i{Dmitri Minaev} sent a patch to set priority limits on a per-file
9432 basis.
9433 @item
9434 @i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler
9435 happy.
9436 @item
9437 @i{Rick Moynihan} proposed to allow multiple TODO sequences in a file
9438 and to be able to quickly restrict the agenda to a subtree.
9439 @item
9440 @i{Todd Neal} provided patches for links to Info files and elisp forms.
9441 @item
9442 @i{Tim O'Callaghan} suggested in-file links, search options for general
9443 file links, and TAGS.
9444 @item
9445 @i{Takeshi Okano} translated the manual and David O'Toole's tutorial
9446 into Japanese.
9447 @item
9448 @i{Oliver Oppitz} suggested multi-state TODO items.
9449 @item
9450 @i{Scott Otterson} sparked the introduction of descriptive text for
9451 links, among other things.
9452 @item
9453 @i{Pete Phillips} helped during the development of the TAGS feature, and
9454 provided frequent feedback.
9455 @item
9456 @i{T.V. Raman} reported bugs and suggested improvements.
9457 @item
9458 @i{Matthias Rempe} (Oelde) provided ideas, Windows support, and quality
9459 control.
9460 @item
9461 @i{Kevin Rogers} contributed code to access VM files on remote hosts.
9462 @item
9463 @i{Sebastian Rose} wrote @file{org-info.js}, a Java script for displaying
9464 webpages derived from Org using an Info-like, or a folding interface with
9465 single key navigation.
9466 @item
9467 @i{Frank Ruell} solved the mystery of the @code{keymapp nil} bug, a
9468 conflict with @file{allout.el}.
9469 @item
9470 @i{Jason Riedy} generalized the send-receive mechanism for orgtbl tables with
9471 extensive patches.
9472 @item
9473 @i{Philip Rooke} created the Org reference card, provided lots
9474 of feedback, developed and applied standards to the Org documentation and
9475 wrote the manual for the contributed packages.
9476 @item
9477 @i{Christian Schlauer} proposed angular brackets around links, among
9478 other things.
9479 @item
9480 Linking to VM/BBDB/Gnus was first inspired by @i{Tom Shannon}'s
9481 @file{organizer-mode.el}.
9482 @item
9483 @i{Ilya Shlyakhter} proposed the Archive Sibling.
9484 @item
9485 @i{Daniel Sinder} came up with the idea of internal archiving by locking
9486 subtrees.
9487 @item
9488 @i{Dale Smith} proposed link abbreviations.
9489 @item
9490 @i{Adam Spiers} asked for global linking commands, inspired the link
9491 extension system, added support for mairix, and proposed the mapping API.
9492 @item
9493 @i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
9494 chapter about publishing.
9495 @item
9496 @i{J@"urgen Vollmer} contributed code generating the table of contents
9497 in HTML output.
9498 @item
9499 @i{Chris Wallace} provided a patch implementing the @samp{QUOTE}
9500 keyword.
9501 @item
9502 @i{David Wainberg} suggested archiving, and improvements to the linking
9503 system.
9504 @item
9505 @i{John Wiegley} wrote @file{emacs-wiki.el}, @file{planner.el}, and
9506 @file{muse.el}, which have similar goals as Org.  Initially the development
9507 of Org was fully independent because I was not aware of the existence of
9508 these packages.  But with time I have accasionally looked at John's code and
9509 learned a lot from it.  John has also contributed a number of great ideas and
9510 patches directly to Org, including the file @code{org-mac-message.el}'
9511 @item
9512 @i{Carsten Wimmer} suggested some changes and helped fix a bug in
9513 linking to Gnus.
9514 @item
9515 @i{Roland Winkler} requested additional key bindings to make Org
9516 work on a tty.
9517 @item
9518 @i{Piotr Zielinski} wrote @file{org-mouse.el}, proposed agenda blocks
9519 and contributed various ideas and code snippets.
9520 @end itemize
9523 @node Main Index, Key Index, History and Acknowledgments, Top
9524 @unnumbered The Main Index
9526 @printindex cp
9528 @node Key Index,  , Main Index, Top
9529 @unnumbered Key Index
9531 @printindex ky
9533 @bye
9535 @ignore
9536         arch-tag: 7893d1Fe-cc57-4d13-b5e5-f494a1CBC7ac
9537 @end ignore
9539 @c Local variables:
9540 @c ispell-local-dictionary: "en_US-w_accents"
9541 @c ispell-local-pdict: "./.aspell.org.pws"
9542 @c fill-column: 77
9543 @c End: