Release 5.06e
[org-mode.git] / org.texi
blob68faabb058920312783101034ab9f1a160b98006
1 \input texinfo
2 @c %**start of header
3 @setfilename ../info/org
4 @settitle Org Mode Manual
6 @set VERSION 5.06
7 @set DATE August 2007
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://www.astro.uva.nl/~dominik/Tools/org/,maintainers webpage}
16 @set AUTHOR Carsten Dominik
17 @set MAINTAINER Carsten Dominik
18 @set MAINTAINEREMAIL @email{dominik at science dot uva dot nl}
19 @set MAINTAINERCONTACT @uref{mailto:dominik at science dot uva dot nl,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-mode (version @value{VERSION}).
38 Copyright @copyright{} 2004, 2005, 2006, 2007 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 Org Mode 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::      
85 * Timestamps::                  Assign date and time to items
86 * Agenda views::                Collecting information into views
87 * Embedded LaTeX::              LaTeX fragments and formulas
88 * Exporting::                   Sharing and publishing of notes
89 * Publishing::                  Create a web site of linked Org-mode files
90 * Miscellaneous::               All the rest which did not fit elsewhere
91 * Extensions and Hacking::      It is possible to write add-on code
92 * History and Acknowledgments::  How Org-mode came into being 
93 * Index::                       The fast road to specific information
94 * Key Index::                   Key bindings and where they are described
96 @detailmenu
97  --- The Detailed Node Listing ---
99 Introduction
101 * Summary::                     Brief summary of what Org-mode does
102 * Installation::                How to install a downloaded version of Org-mode
103 * Activation::                  How to activate Org-mode for certain buffers.
104 * Feedback::                    Bug reports, ideas, patches etc.
106 Document Structure
108 * Outlines::                    Org-mode is based on outline-mode
109 * Headlines::                   How to typeset org-tree headlines
110 * Visibility cycling::          Show and hide, much simplified
111 * Motion::                      Jumping to other headlines
112 * Structure editing::           Changing sequence and level of headlines
113 * Archiving::                   Move done task trees to a different place
114 * Sparse trees::                Matches embedded in context
115 * Plain lists::                 Additional structure within an entry
116 * Drawers::                     Tucking stuff away
117 * orgstruct-mode::              Structure editing outside Org-mode
119 Archiving
121 * ARCHIVE tag::                 Marking a tree as inactive
122 * Moving subtrees::             Moving a tree to an archive file
124 Tables
126 * Built-in table editor::       Simple tables
127 * Narrow columns::              Stop wasting space in tables   
128 * Column groups::               Grouping to trigger vertical lines
129 * orgtbl-mode::                 The table editor as minor mode
130 * The spreadsheet::             The table editor has spreadsheet capabilities.
132 The spreadsheet
134 * References::                  How to refer to another field or range
135 * Formula syntax for Calc::     Using Calc to compute stuff
136 * Formula syntax for Lisp::     Writing formulas in Emacs Lisp
137 * Field formulas::              Formulas valid for a single field
138 * Column formulas::             Formulas valid for an entire column
139 * Editing and debugging formulas::  Fixing formulas
140 * Updating the table::          Recomputing all dependent fields
141 * Advanced features::           Field names, parameters and automatic recalc
143 Hyperlinks
145 * Link format::                 How links in Org-mode are formatted
146 * Internal links::              Links to other places in the current file
147 * External links::              URL-like links to the world
148 * Handling links::              Creating, inserting and following
149 * Using links outside Org-mode::  Linking from my C source code?
150 * Link abbreviations::          Shortcuts for writing complex links
151 * Search options::              Linking to a specific location
152 * Custom searches::             When the default search is not enough
153 * Remember::                    Org-trees store quick notes
155 Internal links
157 * Radio targets::               Make targets trigger links in plain text.
159 Remember
161 * Setting up remember::         Some code for .emacs to get things going
162 * Remember templates::          Define the outline of different note types
163 * Storing notes::               Directly get the note to where it belongs
165 TODO items
167 * TODO basics::                 Marking and displaying TODO entries
168 * TODO extensions::             Workflow and assignments
169 * Priorities::                  Some things are more important than others
170 * Breaking down tasks::         Splitting a task into manageable pieces
171 * Checkboxes::                  Tick-off lists
173 Extended use of TODO keywords
175 * Workflow states::             From TODO to DONE in steps
176 * TODO types::                  I do this, Fred the rest
177 * Multiple sets in one file::   Mixing it all, and still finding your way
178 * Per file keywords::           Different files, different requirements
180 Tags
182 * Tag inheritance::             Tags use the tree structure of the outline
183 * Setting tags::                How to assign tags to a headline
184 * Tag searches::                Searching for combinations of tags
186 Properties and Columns
188 * Property syntax::             How properties are spelled out
189 * Special properties::          Access to other Org-mode features
190 * Property searches::           Matching property values
191 * Column view::                 Tabular viewing and editing
192 * Property API::                Properties for Lisp programmers
194 Column View
196 * Defining columns::            The COLUMNS format property
197 * Using column view::           How to create and use column view
199 Defining Columns
201 * Scope of column definitions::  Where defined, where valid?
202 * Column attributes::           Appearance and content of a column
204 Timestamps
206 * Time stamps::                 Assigning a time to a tree entry
207 * Creating timestamps::         Commands which insert timestamps
208 * Deadlines and scheduling::    Planning your work
209 * Progress logging::            Documenting when what work was done.
211 Creating timestamps
213 * The date/time prompt::        How org-mode helps you entering date and time
214 * Custom time format::          Making dates look differently
216 Deadlines and Scheduling
218 * Inserting deadline/schedule::  Planning items
219 * Repeated tasks::              Items that show up again and again
221 Progress Logging
223 * Closing items::               When was this entry marked DONE?
224 * Tracking TODO state changes::  When did the status change?
225 * Clocking work time::          When exactly did you work on this item?
227 Agenda Views
229 * Agenda files::                Files being searched for agenda information
230 * Agenda dispatcher::           Keyboard access to agenda views
231 * Built-in agenda views::       What is available out of the box?
232 * Presentation and sorting::    How agenda items are prepared for display
233 * Agenda commands::             Remote editing of org trees
234 * Custom agenda views::         Defining special searches and views
236 The built-in agenda views
238 * Weekly/Daily agenda::         The calendar page with current tasks
239 * Global TODO list::            All unfinished action items
240 * Matching tags and properties::  Structured information with fine-tuned search
241 * Timeline::                    Time-sorted view for single file
242 * Stuck projects::              Find projects you need to review
244 Presentation and sorting
246 * Categories::                  Not all tasks are equal
247 * Time-of-day specifications::  How the agenda knows the time
248 * Sorting of agenda items::     The order of things
250 Custom agenda views
252 * Storing searches::            Type once, use often
253 * Block agenda::                All the stuff you need in a single buffer
254 * Setting Options::             Changing the rules
255 * Exporting Agenda Views::      Writing agendas to files.
256 * Extracting Agenda Information for other programs::  
258 Embedded LaTeX
260 * Math symbols::                TeX macros for symbols and Greek letters
261 * Subscripts and Superscripts::  Simple syntax for raising/lowering text
262 * LaTeX fragments::             Complex formulas made easy
263 * Processing LaTeX fragments::  Previewing LaTeX processing
264 * CDLaTeX mode::                Speed up entering of formulas
266 Exporting
268 * ASCII export::                Exporting to plain ASCII
269 * HTML export::                 Exporting to HTML
270 * LaTeX export::                Exporting to LaTeX
271 * XOXO export::                 Exporting to XOXO
272 * iCalendar export::            Exporting in iCalendar format
273 * Text interpretation::         How the exporter looks at the file
275 HTML export
277 * HTML Export commands::        How to invoke LaTeX export
278 * Quoting HTML tags::           Using direct HTML in Org-mode
279 * Links::                       Transformation of links for HTML
280 * Images::                      How to include images
281 * CSS support::                 Changing the appearence of the output
283 LaTeX export
285 * LaTeX export commands::       How to invoke LaTeX export
286 * Quoting LaTeX code::          Incorporating literal LaTeX code
288 Text interpretation by the exporter
290 * Comment lines::               Some lines will not be exported
291 * Initial text::                Text before the first headline
292 * Footnotes::                   Numbers like [1]
293 * Enhancing text::              Subscripts, symbols and more
294 * Export options::              How to influence the export settings
296 Publishing
298 * Configuration::               Defining projects
299 * Sample configuration::        Example projects
300 * Triggering publication::      Publication commands
302 Configuration
304 * Project alist::               The central configuration variable
305 * Sources and destinations::    From here to there
306 * Selecting files::             What files are part of the project?
307 * Publishing action::           Setting the function doing the publishing
308 * Publishing options::          Tweaking HTML export
309 * Publishing links::            Which links keep working after publishing?
310 * Project page index::          Publishing a list of project files
312 Sample configuration
314 * Simple example::              One-component publishing
315 * Complex example::             A multi-component publishing example
317 Miscellaneous
319 * Completion::                  M-TAB knows what you need
320 * Customization::               Adapting Org-mode to your taste
321 * In-buffer settings::          Overview of the #+KEYWORDS
322 * The very busy C-c C-c key::   When in doubt, press C-c C-c
323 * Clean view::                  Getting rid of leading stars in the outline
324 * TTY keys::                    Using Org-mode on a tty
325 * Interaction::                 Other Emacs packages
326 * Bugs::                        Things which do not work perfectly
328 Interaction with other packages
330 * Cooperation::                 Packages Org-mode cooperates with
331 * Conflicts::                   Packages that lead to conflicts
333 Extensions, Hooks and Hacking
335 * Extensions::                  Existing 3rd-part extensions
336 * Adding hyperlink types::      New custom link types
337 * Tables in arbitrary syntax::  Orgtbl for LaTeX and other programs
338 * Dynamic blocks::              Automatically filled blocks
339 * Special agenda views::        Customized views
340 * Using the property API::      Writing programs that use entry properties
342 Tables in arbitrary syntax
344 * Radio tables::                Sending and receiving
345 * A LaTeX example::             Step by step, almost a tutorial
346 * Translator functions::        Copy and modify
348 @end detailmenu
349 @end menu
351 @node Introduction, Document structure, Top, Top
352 @chapter Introduction
353 @cindex introduction
355 @menu
356 * Summary::                     Brief summary of what Org-mode does
357 * Installation::                How to install a downloaded version of Org-mode
358 * Activation::                  How to activate Org-mode for certain buffers.
359 * Feedback::                    Bug reports, ideas, patches etc.
360 @end menu
362 @node Summary, Installation, Introduction, Introduction
363 @section Summary
364 @cindex summary
366 Org-mode is a mode for keeping notes, maintaining TODO lists, and doing
367 project planning with a fast and effective plain-text system.
369 Org-mode develops organizational tasks around NOTES files that contain
370 lists or information about projects as plain text.  Org-mode is
371 implemented on top of outline-mode, which makes it possible to keep the
372 content of large files well structured.  Visibility cycling and
373 structure editing help to work with the tree.  Tables are easily created
374 with a built-in table editor.  Org-mode supports TODO items, deadlines,
375 time stamps, and scheduling.  It dynamically compiles entries into an
376 agenda that utilizes and smoothly integrates much of the Emacs calendar
377 and diary.  Plain text URL-like links connect to websites, emails,
378 Usenet messages, BBDB entries, and any files related to the projects.
379 For printing and sharing of notes, an Org-mode file can be exported as a
380 structured ASCII file, as HTML, or (todo and agenda items only) as an
381 iCalendar file.  It can also serve as a publishing tool for a set of
382 linked webpages.
384 An important design aspect that distinguishes Org-mode from for example
385 Planner/Muse is that it encourages to store every piece of information
386 only once.  In Planner, you have project pages, day pages and possibly
387 other files, duplicating some information such as tasks.  In Org-mode,
388 you only have notes files.  In your notes you mark entries as tasks,
389 label them with tags and timestamps.  All necessary lists like a
390 schedule for the day, the agenda for a meeting, tasks lists selected by
391 tags etc are created dynamically when you need them.
393 Org-mode keeps simple things simple.  When first fired up, it should
394 feel like a straightforward, easy to use outliner.  Complexity is not
395 imposed, but a large amount of functionality is available when you need
396 it.  Org-mode is a toolbox and can be used in different ways, for
397 example as:
399 @example
400 @r{@bullet{} outline extension with visibility cycling and structure editing}
401 @r{@bullet{} ASCII system and table editor for taking structured notes}
402 @r{@bullet{} ASCII table editor with spreadsheet-like capabilities}
403 @r{@bullet{} TODO list editor}
404 @r{@bullet{} full agenda and planner with deadlines and work scheduling}
405 @r{@bullet{} environment to implement David Allen's GTD system}
406 @r{@bullet{} a basic database application}
407 @r{@bullet{} simple hypertext system, with HTML export}
408 @r{@bullet{} publishing tool to create a set of interlinked webpages}
409 @end example
411 Org-mode's automatic, context sensitive table editor with spreadsheet
412 capabilities can be integrated into any major mode by activating the
413 minor Orgtbl-mode.  Using a translation step, it can be used to maintain
414 tables in arbitrary file types, for example in La@TeX{}.  The structure
415 editing and list creation capabilities can be used outside Org-mode with
416 the minor Orgstruct-mode.
418 @cindex FAQ
419 There is a website for Org-mode which provides links to the newest
420 version of Org-mode, as well as additional information, frequently asked
421 questions (FAQ), links to tutorials etc.  This page is located at
422 @uref{http://www.astro.uva.nl/~dominik/Tools/org/}.
424 @page
427 @node Installation, Activation, Summary, Introduction
428 @section Installation
429 @cindex installation
430 @cindex XEmacs
432 @b{Important:} @i{If Org-mode is part of the Emacs distribution or an
433 XEmacs package, please skip this section and go directly to
434 @ref{Activation}.}
436 If you have downloaded Org-mode from the Web, you must take the
437 following steps to install it: Go into the Org-mode distribution
438 directory and edit the top section of the file @file{Makefile}.  You
439 must set the name of the Emacs binary (likely either @file{emacs} or
440 @file{xemacs}), and the paths to the directories where local Lisp and
441 Info files are kept.  If you don't have access to the system-wide
442 directories, create your own two directories for these files, enter them
443 into the Makefile, and make sure Emacs finds the Lisp files by adding
444 the following line to @file{.emacs}:
446 @example
447 (setq load-path (cons "~/path/to/lispdir" load-path))
448 @end example
450 @b{XEmacs users now need to install the file @file{noutline.el} from
451 the @file{xemacs} subdirectory of the Org-mode distribution.  Use the
452 command:}
454 @example
455 @b{make install-noutline}
456 @end example
458 @noindent Now byte-compile and install the Lisp files with the shell
459 commands:
461 @example
462 make
463 make install
464 @end example
466 @noindent If you want to install the info documentation, use this command:
468 @example
469 make install-info
470 @end example
472 @noindent Then add to @file{.emacs}:
474 @lisp
475 ;; This line only if org-mode is not part of the X/Emacs distribution.
476 (require 'org-install)
477 @end lisp
479 @node Activation, Feedback, Installation, Introduction
480 @section Activation
481 @cindex activation
482 @cindex autoload
483 @cindex global keybindings
484 @cindex keybindings, global
486 @iftex
487 @b{Important:} @i{If you use copy-and-paste to copy lisp code from the
488 PDF documentation as viewed by Acrobat reader to your .emacs file, the
489 single quote character comes out incorrectly and the code will not work.
490 You need to fix the single quotes by hand, or copy from Info
491 documentation.}
492 @end iftex
494 Add the following lines to your @file{.emacs} file.  The last two lines
495 define @emph{global} keys for the commands @command{org-store-link} and
496 @command{org-agenda} - please choose suitable keys yourself.
498 @lisp
499 ;; The following lines are always needed.  Choose your own keys.
500 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
501 (define-key global-map "\C-cl" 'org-store-link)
502 (define-key global-map "\C-ca" 'org-agenda)
503 @end lisp
505 Furthermore, you must activate @code{font-lock-mode} in org-mode
506 buffers, because significant functionality depends on font-locking being
507 active.  You can do this with either one of the following two lines
508 (XEmacs user must use the second option):
509 @lisp
510 (global-font-lock-mode 1)                     ; for all buffers
511 (add-hook 'org-mode-hook 'turn-on-font-lock)  ; org-mode buffers only
512 @end lisp
514 @cindex org-mode, turning on
515 With this setup, all files with extension @samp{.org} will be put
516 into Org-mode.  As an alternative, make the first line of a file look
517 like this:
519 @example
520 MY PROJECTS    -*- mode: org; -*-
521 @end example
523 @noindent which will select Org-mode for this buffer no matter what
524 the file's name is.  See also the variable
525 @code{org-insert-mode-line-in-empty-file}.
527 @node Feedback,  , Activation, Introduction
528 @section Feedback
529 @cindex feedback
530 @cindex bug reports
531 @cindex maintainer
532 @cindex author
534 If you find problems with Org-mode, or if you have questions, remarks,
535 or ideas about it, please contact the maintainer @value{MAINTAINER} at
536 @value{MAINTAINEREMAIL}.
538 For bug reports, please provide as much information as possible,
539 including the version information of Emacs (@kbd{C-h v emacs-version
540 @key{RET}}) and Org-mode (@kbd{C-h v org-version @key{RET}}), as well as
541 the Org-mode related setup in @file{.emacs}.  If an error occurs, a
542 backtrace can be very useful (see below on how to create one).  Often a
543 small example file helps, along with clear information about:
545 @enumerate
546 @item What exactly did you do?
547 @item What did you expect to happen?
548 @item What happened instead?
549 @end enumerate
550 @noindent Thank you for helping to improve this mode.
552 @subsubheading How to create a useful backtrace
554 @cindex backtrace of an error
555 If working with Org-mode produces an error with a message you don't
556 understand, you may have hit a bug.  The best way to report this is by
557 providing, in addition to what was mentioned above, a @emph{Backtrace}.
558 This is information from the built-in debugger about where and how the
559 error occurred.  Here is how to produce a useful backtrace:
561 @enumerate
562 @item
563 Start a fresh Emacs or XEmacs, and make sure that it will load the
564 original Lisp code in @file{org.el} instead of the compiled version in
565 @file{org.elc}.  The backtrace contains much more information if it is
566 produced with uncompiled code.  To do this, either rename @file{org.elc}
567 to something else before starting Emacs, or ask Emacs explicitly to load
568 @file{org.el} by using the command line
569 @example
570 emacs -l /path/to/org.el
571 @end example
572 @item
573 Go to the @code{Options} menu and select @code{Enter Debugger on Error}
574 (XEmacs has this option in the @code{Troubleshooting} sub-menu).
575 @item
576 Do whatever you have to do to hit the error.  Don't forget to
577 document the steps you take.
578 @item
579 When you hit the error, a @file{*Backtrace*} buffer will appear on the
580 screen.  Save this buffer to a file (for example using @kbd{C-x C-w}) and
581 attach it to your bug report.
582 @end enumerate
584 @node Document structure, Tables, Introduction, Top
585 @chapter Document Structure
586 @cindex document structure
587 @cindex structure of document
589 Org-mode is based on outline mode and provides flexible commands to
590 edit the structure of the document.
592 @menu
593 * Outlines::                    Org-mode is based on outline-mode
594 * Headlines::                   How to typeset org-tree headlines
595 * Visibility cycling::          Show and hide, much simplified
596 * Motion::                      Jumping to other headlines
597 * Structure editing::           Changing sequence and level of headlines
598 * Archiving::                   Move done task trees to a different place
599 * Sparse trees::                Matches embedded in context
600 * Plain lists::                 Additional structure within an entry
601 * Drawers::                     Tucking stuff away
602 * orgstruct-mode::              Structure editing outside Org-mode
603 @end menu
605 @node Outlines, Headlines, Document structure, Document structure
606 @section Outlines
607 @cindex outlines
608 @cindex outline-mode
610 Org-mode is implemented on top of outline-mode.  Outlines allow a
611 document to be organized in a hierarchical structure, which (at least
612 for me) is the best representation of notes and thoughts.  An overview
613 of this structure is achieved by folding (hiding) large parts of the
614 document to show only the general document structure and the parts
615 currently being worked on.  Org-mode greatly simplifies the use of
616 outlines by compressing the entire show/hide functionality into a single
617 command @command{org-cycle}, which is bound to the @key{TAB} key.
619 @node Headlines, Visibility cycling, Outlines, Document structure
620 @section Headlines
621 @cindex headlines
622 @cindex outline tree
624 Headlines define the structure of an outline tree.  The headlines in
625 Org-mode start with one or more stars, on the left margin@footnote{See
626 the variable @code{org-special-ctrl-a/e} to configure special behavior
627 of @kbd{C-a} and @kbd{C-e} in headlines.}.  For example:
629 @example
630 * Top level headline
631 ** Second level
632 *** 3rd level
633     some text
634 *** 3rd level
635     more text
637 * Another top level headline
638 @end example
640 @noindent Some people find the many stars too noisy and would prefer an
641 outline that has whitespace followed by a single star as headline
642 starters.  @ref{Clean view} describes a setup to realize this.
644 An empty line after the end of a subtree is considered part of it and
645 will be hidden when the subtree is folded.  However, if you leave at
646 least two empty lines, one empty line will remain visible after folding
647 the subtree, in order to structure the collapsed view.  See the
648 variable @code{org-cycle-separator-lines} to modify this behavior.
650 @node Visibility cycling, Motion, Headlines, Document structure
651 @section Visibility cycling
652 @cindex cycling, visibility
653 @cindex visibility cycling
654 @cindex trees, visibility
655 @cindex show hidden text
656 @cindex hide text
658 Outlines make it possible to hide parts of the text in the buffer.
659 Org-mode uses just two commands, bound to @key{TAB} and
660 @kbd{S-@key{TAB}} to change the visibility in the buffer.
662 @cindex subtree visibility states
663 @cindex subtree cycling
664 @cindex folded, subtree visibility state
665 @cindex children, subtree visibility state
666 @cindex subtree, subtree visibility state
667 @table @kbd
668 @kindex @key{TAB}
669 @item @key{TAB}
670 @emph{Subtree cycling}: Rotate current subtree among the states
672 @example
673 ,-> FOLDED -> CHILDREN -> SUBTREE --.
674 '-----------------------------------'
675 @end example
677 The cursor must be on a headline for this to work@footnote{see, however,
678 the option @code{org-cycle-emulate-tab}.}.  When the cursor is at the
679 beginning of the buffer and the first line is not a headline, then
680 @key{TAB} actually runs global cycling (see below)@footnote{see the
681 option @code{org-cycle-global-at-bob}.}.  Also when called with a prefix
682 argument (@kbd{C-u @key{TAB}}), global cycling is invoked.
684 @cindex global visibility states
685 @cindex global cycling
686 @cindex overview, global visibility state
687 @cindex contents, global visibility state
688 @cindex show all, global visibility state
689 @kindex S-@key{TAB}
690 @item S-@key{TAB}
691 @itemx C-u @key{TAB}
692 @emph{Global cycling}: Rotate the entire buffer among the states
694 @example
695 ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
696 '--------------------------------------'
697 @end example
699 When @kbd{S-@key{TAB}} is called with a numerical prefix N, the CONTENTS
700 view up to headlines of level N will be shown.
701 Note that inside tables, @kbd{S-@key{TAB}} jumps to the previous field.
703 @cindex show all, command
704 @kindex C-c C-a
705 @item C-c C-a
706 Show all.
707 @kindex C-c C-r
708 @item C-c C-r
709 Reveal context around point, showing the current entry, the following
710 heading and the hierarchy above.  Useful for working near a location
711 exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda
712 command (@pxref{Agenda commands}).  With prefix arg show, on each
713 level, all sibling headings.
714 @kindex C-c C-x b
715 @item C-c C-x b
716 Show the current subtree in an indirect buffer@footnote{The indirect
717 buffer
718 @ifinfo
719 (@pxref{Indirect Buffers,,,emacs,GNU Emacs Manual})
720 @end ifinfo
721 @ifnotinfo
722 (see the Emacs manual for more information about indirect buffers)
723 @end ifnotinfo
724 will contain the entire buffer, but will be narrowed to the current
725 tree.  Editing the indirect buffer will also change the original buffer,
726 but without affecting visibility in that buffer.}.  With numerical
727 prefix ARG, go up to this level and then take that tree.  If ARG is
728 negative, go up that many levels.  With @kbd{C-u} prefix, do not remove
729 the previously used indirect buffer.
730 @end table
732 When Emacs first visits an Org-mode file, the global state is set to
733 OVERVIEW, i.e. only the top level headlines are visible.  This can be
734 configured through the variable @code{org-startup-folded}, or on a
735 per-file basis by adding one of the following lines anywhere in the
736 buffer:
738 @example
739 #+STARTUP: overview
740 #+STARTUP: content
741 #+STARTUP: showall
742 @end example
744 @node Motion, Structure editing, Visibility cycling, Document structure
745 @section Motion
746 @cindex motion, between headlines
747 @cindex jumping, to headlines
748 @cindex headline navigation
749 The following commands jump to other headlines in the buffer.
751 @table @kbd
752 @kindex C-c C-n
753 @item C-c C-n
754 Next heading.
755 @kindex C-c C-p
756 @item C-c C-p
757 Previous heading.
758 @kindex C-c C-f
759 @item C-c C-f
760 Next heading same level.
761 @kindex C-c C-b
762 @item C-c C-b
763 Previous heading same level.
764 @kindex C-c C-u
765 @item C-c C-u
766 Backward to higher level heading.
767 @kindex C-c C-j
768 @item C-c C-j
769 Jump to a different place without changing the current outline
770 visibility.  Shows the document structure in a temporary buffer, where
771 you can use the following keys to find your destination:
772 @example
773 @key{TAB}         @r{Cycle visibility.}
774 @key{down} / @key{up}   @r{Next/previous visible headline.}
775 n / p        @r{Next/previous visible headline.}
776 f / b        @r{Next/previous headline same level.}
777 u            @r{One level up.}
778 0-9          @r{Digit argument.}
779 @key{RET}         @r{Select this location.}
780 @end example
781 @end table
783 @node Structure editing, Archiving, Motion, Document structure
784 @section Structure editing
785 @cindex structure editing
786 @cindex headline, promotion and demotion
787 @cindex promotion, of subtrees
788 @cindex demotion, of subtrees
789 @cindex subtree, cut and paste
790 @cindex pasting, of subtrees
791 @cindex cutting, of subtrees
792 @cindex copying, of subtrees
793 @cindex subtrees, cut and paste
795 @table @kbd
796 @kindex M-@key{RET}
797 @item M-@key{RET}
798 Insert new heading with same level as current.  If the cursor is in a
799 plain list item, a new item is created (@pxref{Plain lists}).  To force
800 creation of a new headline, use a prefix arg, or first press @key{RET}
801 to get to the beginning of the next line.  When this command is used in
802 the middle of a line, the line is split and the rest of the line becomes
803 the new headline.  If the command is used at the beginning of a
804 headline, the new headline is created before the current line.  If at
805 the beginning of any other line, the content of that line is made the
806 new heading.  If the command is used at the end of a folded subtree
807 (i.e. behind the ellipses at the end of a headline), then a headline
808 like the current one will be inserted after the end of the subtree.
809 @kindex M-S-@key{RET}
810 @item M-S-@key{RET}
811 Insert new TODO entry with same level as current heading.
812 @kindex M-@key{left}
813 @item M-@key{left}
814 Promote current heading by one level.
815 @kindex M-@key{right}
816 @item M-@key{right}
817 Demote current heading by one level.
818 @kindex M-S-@key{left}
819 @item M-S-@key{left}
820 Promote the current subtree by one level.
821 @kindex M-S-@key{right}
822 @item M-S-@key{right}
823 Demote the current subtree by one level.
824 @kindex M-S-@key{up}
825 @item M-S-@key{up}
826 Move subtree up (swap with previous subtree of same
827 level).
828 @kindex M-S-@key{down}
829 @item M-S-@key{down}
830 Move subtree down (swap with next subtree of same level).
831 @kindex C-c C-x C-w
832 @kindex C-c C-x C-k
833 @item C-c C-x C-w
834 @itemx C-c C-x C-k
835 Kill subtree, i.e. remove it from buffer but save in kill ring.
836 @kindex C-c C-x M-w
837 @item C-c C-x M-w
838 Copy subtree to kill ring.
839 @kindex C-c C-x C-y
840 @item C-c C-x C-y
841 Yank subtree from kill ring.  This does modify the level of the subtree to
842 make sure the tree fits in nicely at the yank position.  The yank
843 level can also be specified with a prefix arg, or by yanking after a
844 headline marker like @samp{****}.
845 @kindex C-c ^
846 @item C-c ^
847 Sort same-level entries.  When there is an active region, all entries in
848 the region will be sorted.  Otherwise the children of the current
849 headline are sorted.  The command prompts for the sorting method, which
850 can be alphabetically, numerically, by time (using the first time stamp
851 in each entry), and each of these in reverse order.  With a @kbd{C-u}
852 prefix, sorting will be case-sensitive.  With two @kbd{C-u C-u}
853 prefixes, duplicate entries will also be removed.
854 @end table
856 @cindex region, active
857 @cindex active region
858 @cindex transient-mark-mode
859 When there is an active region (transient-mark-mode), promotion and
860 demotion work on all headlines in the region.  To select a region of
861 headlines, it is best to place both point and mark at the beginning of a
862 line, mark at the beginning of the first headline, and point at the line
863 just after the last headline to change.  Note that when the cursor is
864 inside a table (@pxref{Tables}), the Meta-Cursor keys have different
865 functionality.
867 @node Archiving, Sparse trees, Structure editing, Document structure
868 @section Archiving
869 @cindex archiving
871 When a project represented by a (sub)tree is finished, you may want
872 to move the tree out of the way and to stop it from contributing to the
873 agenda.  Org-mode knows two ways of archiving.  You can mark a tree with
874 the ARCHIVE tag, or you can move an entire (sub)tree to a different
875 location.
877 @menu
878 * ARCHIVE tag::                 Marking a tree as inactive
879 * Moving subtrees::             Moving a tree to an archive file
880 @end menu
882 @node ARCHIVE tag, Moving subtrees, Archiving, Archiving
883 @subsection The ARCHIVE tag
884 @cindex internal archiving
886 A headline that is marked with the ARCHIVE tag (@pxref{Tags}) stays at
887 its location in the outline tree, but behaves in the following way:
888 @itemize @minus
889 @item
890 It does not open when you attempt to do so with a visibility cycling
891 command (@pxref{Visibility cycling}).  You can force cycling archived
892 subtrees with @kbd{C-@key{TAB}}, or by setting the option
893 @code{org-cycle-open-archived-trees}.  Also normal outline commands like
894 @code{show-all} will open archived subtrees.
895 @item
896 During sparse tree construction (@pxref{Sparse trees}), matches in
897 archived subtrees are not exposed, unless you configure the option
898 @code{org-sparse-tree-open-archived-trees}.
899 @item
900 During agenda view construction (@pxref{Agenda views}), the content of
901 archived trees is ignored unless you configure the option
902 @code{org-agenda-skip-archived-trees}.
903 @item
904 Archived trees are not exported (@pxref{Exporting}), only the headline
905 is.  Configure the details using the variable
906 @code{org-export-with-archived-trees}.
907 @end itemize
909 The following commands help managing the ARCHIVE tag:
911 @table @kbd
912 @kindex C-c C-x C-a
913 @item C-c C-x C-a
914 Toggle the ARCHIVE tag for the current headline.  When the tag is set,
915 the headline changes to a shadowish face, and the subtree below it is
916 hidden.
917 @kindex C-u C-c C-x C-a
918 @item C-u C-c C-x C-a
919 Check if any direct children of the current headline should be archived.
920 To do this, each subtree is checked for open TODO entries.  If none are
921 found, the command offers to set the ARCHIVE tag for the child.  If the
922 cursor is @emph{not} on a headline when this command is invoked, the
923 level 1 trees will be checked.
924 @kindex C-@kbd{TAB}
925 @item C-@kbd{TAB}
926 Cycle a tree even if it is tagged with ARCHIVE.
927 @end table
929 @node Moving subtrees,  , ARCHIVE tag, Archiving
930 @subsection Moving subtrees
931 @cindex external archiving
933 Once an entire project is finished, you may want to move it to a
934 different location, either in the current file, or even in a different
935 file, the archive file.
937 @table @kbd
938 @kindex C-c C-x C-s
939 @item C-c C-x C-s
940 Archive the subtree starting at the cursor position to the location
941 given by @code{org-archive-location}.
942 @kindex C-u C-c C-x C-s
943 @item C-u C-c C-x C-s
944 Check if any direct children of the current headline could be moved to
945 the archive.  To do this, each subtree is checked for open TODO entries.
946 If none are found, the command offers to move it to the archive
947 location.  If the cursor is @emph{not} on a headline when this command
948 is invoked, the level 1 trees will be checked.
949 @end table
951 @cindex archive locations
952 The default archive location is a file in the same directory as the
953 current file, with the name derived by appending @file{_archive} to the
954 current file name.  For information and examples on how to change this,
955 see the documentation string of the variable
956 @code{org-archive-location}.  There is also an in-buffer option for
957 setting this variable, for example
959 @example
960 #+ARCHIVE: %s_done::
961 @end example
963 @noindent
964 You may have several such lines in the buffer, they will then be valid
965 for the entries following the line (the first will also apply to any
966 text before it).
968 @node Sparse trees, Plain lists, Archiving, Document structure
969 @section Sparse trees
970 @cindex sparse trees
971 @cindex trees, sparse
972 @cindex folding, sparse trees
973 @cindex occur, command
975 An important feature of Org-mode is the ability to construct
976 @emph{sparse trees} for selected information in an outline tree.  A
977 sparse tree means that the entire document is folded as much as
978 possible, but the selected information is made visible along with the
979 headline structure above it@footnote{See also the variables
980 @code{org-show-hierarchy-above}, @code{org-show-following-heading}, and
981 @code{org-show-siblings} for detailed control on how much context is
982 shown around each match.}.  Just try it out and you will see immediately
983 how it works.
985 Org-mode contains several commands creating such trees.  The most
986 basic one is @command{org-occur}:
988 @table @kbd
989 @kindex C-c /
990 @item C-c /
991 Occur.  Prompts for a regexp and shows a sparse tree with all matches.
992 If the match is in a headline, the headline is made visible.  If the
993 match is in the body of an entry, headline and body are made visible.
994 In order to provide minimal context, also the full hierarchy of
995 headlines above the match is shown, as well as the headline following
996 the match.  Each match is also highlighted; the highlights disappear
997 when the buffer is changed an editing command, or by pressing @kbd{C-c
998 C-c}.  When called with a @kbd{C-u} prefix argument, previous highlights
999 are kept, so several calls to this command can be stacked.
1000 @end table
1001 @noindent
1002 For frequently used sparse trees of specific search strings, you can
1003 use the variable @code{org-agenda-custom-commands} to define fast
1004 keyboard access to specific sparse trees.  These commands will then be
1005 accessible through the agenda dispatcher (@pxref{Agenda dispatcher}).
1006 For example:
1008 @lisp
1009 (setq org-agenda-custom-commands
1010       '(("f" occur-tree "FIXME")))
1011 @end lisp
1013 @noindent will define the key @kbd{C-c a f} as a shortcut for creating
1014 a sparse tree matching the string @samp{FIXME}.
1016 Other commands use sparse trees as well.  For example @kbd{C-c
1017 C-v} creates a sparse TODO tree (@pxref{TODO basics}).
1019 @kindex C-c C-e v
1020 @cindex printing sparse trees
1021 @cindex visible text, printing
1022 To print a sparse tree, you can use the Emacs command
1023 @code{ps-print-buffer-with-faces} which does not print invisible parts
1024 of the document @footnote{This does not work under XEmacs, because
1025 XEmacs uses selective display for outlining, not text properties.}.
1026 Or you can use the command @kbd{C-c C-e v} to export only the visible
1027 part of the document and print the resulting file.
1029 @node Plain lists, Drawers, Sparse trees, Document structure
1030 @section Plain lists
1031 @cindex plain lists
1032 @cindex lists, plain
1033 @cindex lists, ordered
1034 @cindex ordered lists
1036 Within an entry of the outline tree, hand-formatted lists can provide
1037 additional structure.  They also provide a way to create lists of
1038 checkboxes (@pxref{Checkboxes}).  Org-mode supports editing such lists,
1039 and the HTML exporter (@pxref{Exporting}) does parse and format them.
1041 Org-mode knows ordered and unordered lists.  Unordered list items start
1042 with @samp{-}, @samp{+}, or @samp{*}@footnote{When using @samp{*} as a
1043 bullet, lines must be indented or they will be seen as top-level
1044 headlines.  Also, when you are hiding leading stars to get a clean
1045 outline view, plain list items starting with a star are visually
1046 indistinguishable from true headlines.  In short: even though @samp{*}
1047 is supported, it may be better not to use it for plain list items.} as
1048 bullets.  Ordered list items start with @samp{1.} or @samp{1)}.  Items
1049 belonging to the same list must have the same indentation on the first
1050 line.  In particular, if an ordered list reaches number @samp{10.}, then
1051 the 2--digit numbers must be written left-aligned with the other numbers
1052 in the list.  Indentation also determines the end of a list item.  It
1053 ends before the next line that is indented like the bullet/number, or
1054 less.  Empty lines are part of the previous item, so you can have
1055 several paragraphs in one item.  If you would like an empty line to
1056 terminate all currently open plain lists, configure the variable
1057 @code{org-empty-line-terminates-plain-lists}.  Here is an example:
1059 @example
1060 @group
1061 ** Lord of the Rings
1062    My favorite scenes are (in this order)
1063    1. The attack of the Rohirrim
1064    2. Eowyns fight with the witch king
1065       + this was already my favorite scene in the book
1066       + I really like Miranda Otto.
1067    3. Peter Jackson being shot by Legolas
1068        - on DVD only
1069       He makes a really funny face when it happens.
1070    But in the end, not individual scenes matter but the film as a whole.
1071 @end group
1072 @end example
1074 Org-mode supports these lists by tuning filling and wrapping commands to
1075 deal with them correctly@footnote{Org-mode only changes the filling
1076 settings for Emacs.  For XEmacs, you should use Kyle E. Jones'
1077 @file{filladapt.el}.  To turn this on,  put into @file{.emacs}:
1078 @code{(require 'filladapt)}}. 
1080 The following commands act on items when the cursor is in the first line
1081 of an item (the line with the bullet or number).
1083 @table @kbd
1084 @kindex @key{TAB}
1085 @item @key{TAB}
1086 Items can be folded just like headline levels if you set the variable
1087 @code{org-cycle-include-plain-lists}.  The level of an item is then
1088 given by the indentation of the bullet/number.  Items are always
1089 subordinate to real headlines, however; the hierarchies remain
1090 completely separated.
1092 If @code{org-cycle-include-plain-lists} has not been set, @key{TAB}
1093 fixes the indentation of the curent line in a heuristic way.
1094 @kindex M-@key{RET}
1095 @item M-@key{RET}
1096 Insert new item at current level.  With prefix arg, force a new heading
1097 (@pxref{Structure editing}).  If this command is used in the middle of a
1098 line, the line is @emph{split} and the rest of the line becomes the new
1099 item.  If this command is executed in the @emph{whitespace before a bullet or
1100 number}, the new item is created @emph{before} the current item.  If the
1101 command is executed in the white space before the text that is part of
1102 an item but does not contain the bullet, a bullet is added to the
1103 current line.
1104 @kindex M-S-@key{RET}
1105 @item M-S-@key{RET}
1106 Insert a new item with a checkbox (@pxref{Checkboxes}).
1107 @kindex S-@key{up}
1108 @kindex S-@key{down}
1109 @item S-@key{up}
1110 @itemx S-@key{down}
1111 Jump to the previous/next item in the current list.
1112 @kindex M-S-@key{up}
1113 @kindex M-S-@key{down}
1114 @item M-S-@key{up}
1115 @itemx M-S-@key{down}
1116 Move the item including subitems up/down (swap with previous/next item
1117 of same indentation).  If the list is ordered, renumbering is
1118 automatic.
1119 @kindex M-S-@key{left}
1120 @kindex M-S-@key{right}
1121 @item M-S-@key{left}
1122 @itemx M-S-@key{right}
1123 Decrease/increase the indentation of the item, including subitems.
1124 Initially, the item tree is selected based on current indentation.
1125 When these commands are executed several times in direct succession,
1126 the initially selected region is used, even if the new indentation
1127 would imply a different hierarchy.  To use the new hierarchy, break
1128 the command chain with a cursor motion or so.
1129 @kindex C-c C-c
1130 @item C-c C-c
1131 If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the
1132 state of the checkbox.  If not, make this command makes sure that all
1133 the items on this list level use the same bullet.  Furthermore, if this
1134 is an ordered list, make sure the numbering is ok.
1135 @kindex C-c -
1136 @item C-c -
1137 Cycle the entire list level through the different itemize/enumerate
1138 bullets (@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}).
1139 With prefix arg, select the nth bullet from this list.
1140 @end table
1142 @node Drawers, orgstruct-mode, Plain lists, Document structure
1143 @section Drawers
1144 @cindex drawers
1145 @cindex visibility cycling, drawers
1147 Sometimes you want to keep information associated with an entry, but you
1148 normally don't want to see it.  For this, Org-mode has @emph{drawers}.
1149 Drawers need to be configured with the variable @code{org-drawers}, and
1150 look like this:
1152 @example
1153 ** This is a headline
1154    Still outside the drawer
1155    :DRAWERNAME:
1156       This is inside the drawer.
1157    :END:
1158    After the drawer.
1159 @end example
1161 Visibility cycling (@pxref{Visibility cycling}) on the headline will
1162 hide and show the entry, but keep the drawer collapsed to a single line.
1163 In order to look inside the drawer, you need to move the cursor to the
1164 drawer line and press @key{TAB} there.  Org-mode uses a drawer for
1165 storing properties (@pxref{Properties and columns}).
1167 @node orgstruct-mode,  , Drawers, Document structure
1168 @section The Orgstruct minor mode
1169 @cindex orgstruct-mode
1170 @cindex minor mode for structure editing
1172 If you like the intuitive way the Org-mode structure editing and list
1173 formatting works, you might want to use these commands in other modes
1174 like text-mode or mail-mode as well.  The minor mode Orgstruct-mode
1175 makes this possible.  You can always toggle the mode with @kbd{M-x
1176 orgstruct-mode}.  To turn it on by default, for example in mail mode,
1179 @lisp
1180 (add-hook 'mail-mode-hook 'turn-on-orgstruct)
1181 @end lisp
1183 When this mode is active and the cursor is on a line that looks to
1184 Org-mode like a headline of the first line of a list item, most
1185 structure editing commands will work, even if the same keys normally
1186 have different functionality in the major mode you are using.  If the
1187 cursor is not in one of those special lines, Orgstruct-mode lurks
1188 silently in the shadow.
1190 @node Tables, Hyperlinks, Document structure, Top
1191 @chapter Tables
1192 @cindex tables
1193 @cindex editing tables
1195 Org-mode has a very fast and intuitive table editor built-in.
1196 Spreadsheet-like calculations are supported in connection with the
1197 Emacs @file{calc} package.
1199 @menu
1200 * Built-in table editor::       Simple tables
1201 * Narrow columns::              Stop wasting space in tables   
1202 * Column groups::               Grouping to trigger vertical lines
1203 * orgtbl-mode::                 The table editor as minor mode
1204 * The spreadsheet::             The table editor has spreadsheet capabilities.
1205 @end menu
1207 @node Built-in table editor, Narrow columns, Tables, Tables
1208 @section The built-in table editor
1209 @cindex table editor, built-in
1211 Org-mode makes it easy to format tables in plain ASCII.  Any line with
1212 @samp{|} as the first non-whitespace character is considered part of a
1213 table.  @samp{|} is also the column separator.  A table might look like
1214 this:
1216 @example
1217 | Name  | Phone | Age |
1218 |-------+-------+-----|
1219 | Peter |  1234 |  17 |
1220 | Anna  |  4321 |  25 |
1221 @end example
1223 A table is re-aligned automatically each time you press @key{TAB} or
1224 @key{RET} or @kbd{C-c C-c} inside the table.  @key{TAB} also moves to
1225 the next field (@key{RET} to the next row) and creates new table rows
1226 at the end of the table or before horizontal lines.  The indentation
1227 of the table is set by the first line.  Any line starting with
1228 @samp{|-} is considered as a horizontal separator line and will be
1229 expanded on the next re-align to span the whole table width.  So, to
1230 create the above table, you would only type
1232 @example
1233 |Name|Phone|Age|
1235 @end example
1237 @noindent and then press @key{TAB} to align the table and start filling in
1238 fields.
1240 When typing text into a field, Org-mode treats @key{DEL},
1241 @key{Backspace}, and all character keys in a special way, so that
1242 inserting and deleting avoids shifting other fields.  Also, when
1243 typing @emph{immediately after the cursor was moved into a new field
1244 with @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the
1245 field is automatically made blank.  If this behavior is too
1246 unpredictable for you, configure the variables
1247 @code{org-enable-table-editor} and @code{org-table-auto-blank-field}.
1249 @table @kbd
1250 @tsubheading{Creation and conversion}
1251 @kindex C-c |
1252 @item C-c |
1253 Convert the active region to table. If every line contains at least one
1254 TAB character, the function assumes that the material is tab separated.
1255 If not, lines are split at whitespace into fields.  You can use a prefix
1256 argument to indicate the minimum number of consecutive spaces required
1257 to identify a field separator (default: just one).@* 
1258 If there is no active region, this command creates an empty Org-mode
1259 table.  But it's easier just to start typing, like
1260 @kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}.
1262 @tsubheading{Re-aligning and field motion}
1263 @kindex C-c C-c
1264 @item C-c C-c
1265 Re-align the table without moving the cursor.
1267 @kindex @key{TAB}
1268 @item @key{TAB}
1269 Re-align the table, move to the next field.  Creates a new row if
1270 necessary.
1272 @kindex S-@key{TAB}
1273 @item S-@key{TAB}
1274 Re-align, move to previous field.
1276 @kindex @key{RET}
1277 @item @key{RET}
1278 Re-align the table and move down to next row.  Creates a new row if
1279 necessary.  At the beginning or end of a line, @key{RET} still does
1280 NEWLINE, so it can be used to split a table.
1282 @tsubheading{Column and row editing}
1283 @kindex M-@key{left}
1284 @kindex M-@key{right}
1285 @item M-@key{left}
1286 @itemx M-@key{right}
1287 Move the current column left/right.
1289 @kindex M-S-@key{left}
1290 @item M-S-@key{left}
1291 Kill the current column.
1293 @kindex M-S-@key{right}
1294 @item M-S-@key{right}
1295 Insert a new column to the left of the cursor position.
1297 @kindex M-@key{up}
1298 @kindex M-@key{down}
1299 @item M-@key{up}
1300 @itemx M-@key{down}
1301 Move the current row up/down.
1303 @kindex M-S-@key{up}
1304 @item M-S-@key{up}
1305 Kill the current row or horizontal line.
1307 @kindex M-S-@key{down}
1308 @item M-S-@key{down}
1309 Insert a new row above (with arg: below) the current row.
1311 @kindex C-c -
1312 @item C-c -
1313 Insert a horizontal line below current row. With prefix arg, the line
1314 is created above the current line.
1316 @kindex C-c ^
1317 @item C-c ^
1318 Sort the table lines in the region.  The position of point indicates the
1319 column to be used for sorting, and the range of lines is the range
1320 between the nearest horizontal separator lines, or the entire table.  If
1321 point is before the first column, you will be prompted for the sorting
1322 column.  If there is an active region, the mark specifies the first line
1323 and the sorting column, while point should be in the last line to be
1324 included into the sorting.  The command prompts for the sorting type
1325 (alphabetically, numerically, or by time).  When called with a prefix
1326 argument, alphabetic sorting will be case-sensitive.
1328 @tsubheading{Regions}
1329 @kindex C-c C-x M-w
1330 @item C-c C-x M-w
1331 Copy a rectangular region from a table to a special clipboard.  Point
1332 and mark determine edge fields of the rectangle.  The process ignores
1333 horizontal separator lines.
1335 @kindex C-c C-x C-w
1336 @item C-c C-x C-w
1337 Copy a rectangular region from a table to a special clipboard, and
1338 blank all fields in the rectangle.  So this is the ``cut'' operation.
1340 @kindex C-c C-x C-y
1341 @item C-c C-x C-y
1342 Paste a rectangular region into a table.
1343 The upper right corner ends up in the current field.  All involved fields
1344 will be overwritten.  If the rectangle does not fit into the present table,
1345 the table is enlarged as needed.  The process ignores horizontal separator
1346 lines.
1348 @kindex C-c C-q
1349 @item C-c C-q
1350 Wrap several fields in a column like a paragraph.  If there is an active
1351 region, and both point and mark are in the same column, the text in the
1352 column is wrapped to minimum width for the given number of lines.  A
1353 prefix ARG may be used to change the number of desired lines.  If there
1354 is no region, the current field is split at the cursor position and the
1355 text fragment to the right of the cursor is prepended to the field one
1356 line down. If there is no region, but you specify a prefix ARG, the
1357 current field is made blank, and the content is appended to the field
1358 above.
1360 @tsubheading{Calculations}
1361 @cindex formula, in tables
1362 @cindex calculations, in tables
1363 @cindex region, active
1364 @cindex active region
1365 @cindex transient-mark-mode
1366 @kindex C-c +
1367 @item C-c +
1368 Sum the numbers in the current column, or in the rectangle defined by
1369 the active region.  The result is shown in the echo area and can
1370 be inserted with @kbd{C-y}.
1372 @kindex S-@key{RET}
1373 @item S-@key{RET}
1374 When current field is empty, copy from first non-empty field above.
1375 When not empty, copy current field down to next row and move cursor
1376 along with it.  Depending on the variable
1377 @code{org-table-copy-increment}, integer field values will be
1378 incremented during copy.  This key is also used by CUA-mode
1379 (@pxref{Cooperation}).
1381 @tsubheading{Miscellaneous}
1382 @kindex C-c `
1383 @item C-c `
1384 Edit the current field in a separate window.  This is useful for fields
1385 that are not fully visible (@pxref{Narrow columns}).  When called with a
1386 @kbd{C-u} prefix, just make the full field visible, so that it can be
1387 edited in place.
1389 @kindex C-c @key{TAB}
1390 @item C-c @key{TAB}
1391 This is an alias for @kbd{C-u C-c `} to make the current field fully
1392 visible.
1394 @item M-x org-table-import
1395 Import a file as a table.  The table should be TAB- or whitespace
1396 separated.  Useful, for example, to import an Excel table or data from a
1397 database, because these programs generally can write TAB-separated text
1398 files.  This command works by inserting the file into the buffer and
1399 then converting the region to a table.  Any prefix argument is passed on
1400 to the converter, which uses it to determine the separator.
1401 @item C-c |
1402 Tables can also be imported by pasting tabular text into the org-mode
1403 buffer, selecting the pasted text with @kbd{C-x C-x} and then using the
1404 @kbd{C-c |} command (see above under @i{Creation and conversion}.
1406 @item M-x org-table-export
1407 Export the table as a TAB-separated file.  Useful for data exchange with,
1408 for example, Excel or database programs.
1409 @end table
1411 If you don't like the automatic table editor because it gets in your
1412 way on lines which you would like to start with @samp{|}, you can turn
1413 it off with
1415 @lisp
1416 (setq org-enable-table-editor nil)
1417 @end lisp
1419 @noindent Then the only table command that still works is
1420 @kbd{C-c C-c} to do a manual re-align.
1422 @node Narrow columns, Column groups, Built-in table editor, Tables
1423 @section Narrow columns
1424 @cindex narrow columns in tables
1426 The width of columns is automatically determined by the table editor.
1427 Sometimes a single field or a few fields need to carry more text,
1428 leading to inconveniently wide columns.  To limit@footnote{This feature
1429 does not work on XEmacs.} the width of a column, one field anywhere in
1430 the column may contain just the string @samp{<N>} where @samp{N} is an
1431 integer specifying the width of the column in characters.  The next
1432 re-align will then set the width of this column to no more than this
1433 value.
1435 @example
1436 @group
1437 |---+------------------------------|               |---+--------|
1438 |   |                              |               |   | <6>    |
1439 | 1 | one                          |               | 1 | one    |
1440 | 2 | two                          |     ----\     | 2 | two    |
1441 | 3 | This is a long chunk of text |     ----/     | 3 | This=> |
1442 | 4 | four                         |               | 4 | four   |
1443 |---+------------------------------|               |---+--------|
1444 @end group
1445 @end example
1447 @noindent
1448 Fields that are wider become clipped and end in the string @samp{=>}.
1449 Note that the full text is still in the buffer, it is only invisible.
1450 To see the full text, hold the mouse over the field - a tool-tip window
1451 will show the full content.  To edit such a field, use the command
1452 @kbd{C-c `} (that is @kbd{C-c} followed by the backquote).  This will
1453 open a new window with the full field.  Edit it and finish with @kbd{C-c
1454 C-c}.
1456 When visiting a file containing a table with narrowed columns, the
1457 necessary character hiding has not yet happened, and the table needs to
1458 be aligned before it looks nice.  Setting the option
1459 @code{org-startup-align-all-tables} will realign all tables in a file
1460 upon visiting, but also slow down startup.  You can also set this option
1461 on a per-file basis with:
1463 @example
1464 #+STARTUP: align
1465 #+STARTUP: noalign
1466 @end example
1468 @node Column groups, orgtbl-mode, Narrow columns, Tables
1469 @section Column groups
1470 @cindex grouping columns in tables
1472 When Org-mode exports tables, it does so by default without vertical
1473 lines because that is visually more satisfying in general.  Occasionally
1474 however, vertical lines can be useful to structure a table into groups
1475 of columns, much like horizontal lines can do for groups of rows.  In
1476 order to specify column groups, you can use a special row where the
1477 first field contains only @samp{/}.  The further fields can either
1478 contain @samp{<} to indicate that this column should start a group,
1479 @samp{>} to indicate the end of a column, or @samp{<>} to make a column
1480 a group of its own.  Boundaries between colum groups will upon export be
1481 marked with vertical lines.  Here is an example:
1483 @example
1484 |   |  N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
1485 |---+----+-----+-----+-----+---------+------------|
1486 | / | <> |   < |     |   > |       < |          > |
1487 | # |  1 |   1 |   1 |   1 |       1 |          1 |
1488 | # |  2 |   4 |   8 |  16 |  1.4142 |     1.1892 |
1489 | # |  3 |   9 |  27 |  81 |  1.7321 |     1.3161 |
1490 |---+----+-----+-----+-----+---------+------------|
1491 #+TBLFM: $3=$2^2::$4=$2^3::$5=$2^4::$6=sqrt($2)::$7=sqrt(sqrt(($2))
1492 @end example
1494 It is also sufficient to just insert the colum group starters after
1495 every vertical line you'd like to have:
1497 @example
1498 |  N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
1499 |----+-----+-----+-----+---------+------------|
1500 | /  | <   |     |     | <       |            |
1501 @end example
1503 @node orgtbl-mode, The spreadsheet, Column groups, Tables
1504 @section The Orgtbl minor mode
1505 @cindex orgtbl-mode
1506 @cindex minor mode for tables
1508 If you like the intuitive way the Org-mode table editor works, you
1509 might also want to use it in other modes like text-mode or mail-mode.
1510 The minor mode Orgtbl-mode makes this possible.  You can always toggle
1511 the mode with @kbd{M-x orgtbl-mode}.  To turn it on by default, for
1512 example in mail mode, use
1514 @lisp
1515 (add-hook 'mail-mode-hook 'turn-on-orgtbl)
1516 @end lisp
1518 Furthermore, with some special setup, it is possible to maintain tables
1519 in arbitrary syntax with Orgtbl-mode.  For example, it is possible to
1520 construct La@TeX{} tables with the underlying ease and power of
1521 Orgtbl-mode, including spreadsheet capabilities.  For details, see
1522 @ref{Tables in arbitrary syntax}.
1524 @node The spreadsheet,  , orgtbl-mode, Tables
1525 @section The spreadsheet
1526 @cindex calculations, in tables
1527 @cindex spreadsheet capabilities
1528 @cindex @file{calc} package
1530 The table editor makes use of the Emacs @file{calc} package to implement
1531 spreadsheet-like capabilities.  It can also evaluate Emacs Lisp forms to
1532 derive fields from other fields.  While fully featured, Org-mode's
1533 implementation is not identical to other spreadsheets.  For example,
1534 Org-mode knows the concept of a @emph{column formula} that will be
1535 applied to all non-header fields in a column without having to copy the
1536 formula to each relevant field.
1538 @menu
1539 * References::                  How to refer to another field or range
1540 * Formula syntax for Calc::     Using Calc to compute stuff
1541 * Formula syntax for Lisp::     Writing formulas in Emacs Lisp
1542 * Field formulas::              Formulas valid for a single field
1543 * Column formulas::             Formulas valid for an entire column
1544 * Editing and debugging formulas::  Fixing formulas
1545 * Updating the table::          Recomputing all dependent fields
1546 * Advanced features::           Field names, parameters and automatic recalc
1547 @end menu
1549 @node References, Formula syntax for Calc, The spreadsheet, The spreadsheet
1550 @subsection References
1551 @cindex references
1553 To compute fields in the table from other fields, formulas must
1554 reference other fields or ranges.  In Org-mode, fields can be referenced
1555 by name, by absolute coordinates, and by relative coordinates.  To find
1556 out what the coordinates of a field are, press @kbd{C-c ?} in that
1557 field, or press @kbd{C-c @}} to toggle the display of a grid.
1559 @subsubheading Field references
1560 @cindex field references
1561 @cindex references, to fields
1563 Formulas can reference the value of another field in two ways.  Like in
1564 any other spreadsheet, you may reference fields with a letter/number
1565 combination like @code{B3}, meaning the 2nd field in the 3rd row.
1566 @c Such references are always fixed to that field, they don't change
1567 @c when you copy and paste a formula to a different field.  So
1568 @c Org-mode's @code{B3} behaves like @code{$B$3} in other spreadsheets.
1570 @noindent
1571 Org-mode also uses another, more general operator that looks like this:
1572 @example
1573 @@row$column
1574 @end example
1576 @noindent
1577 Column references can be absolute like @samp{1}, @samp{2},...@samp{N},
1578 or relative to the current column like @samp{+1} or @samp{-2}.
1580 The row specification only counts data lines and ignores horizontal
1581 separator lines (hlines).  You can use absolute row numbers
1582 @samp{1}...@samp{N}, and row numbers relative to the current row like
1583 @samp{+3} or @samp{-1}.  Or specify the row relative to one of the
1584 hlines: @samp{I} refers to the first hline, @samp{II} to the second etc.
1585 @samp{-I} refers to the first such line above the current line,
1586 @samp{+I} to the first such line below the current line.  You can also
1587 write @samp{III+2} which is the second data line after the third hline
1588 in the table.  Relative row numbers like @samp{-3} will not cross hlines
1589 if the current line is too close to the hline.  Instead, the value
1590 directly at the hline is used.
1592 @samp{0} refers to the current row and column.  Also, if you omit
1593 either the column or the row part of the reference, the current
1594 row/column is implied. 
1596 Org-mode's references with @emph{unsigned} numbers are fixed references
1597 in the sense that if you use the same reference in the formula for two
1598 different fields, the same field will be referenced each time.
1599 Org-mode's references with @emph{signed} numbers are floating
1600 references because the same reference operator can reference different
1601 fields depending on the field being calculated by the formula.
1603 Here are a few examples:
1605 @example
1606 @@2$3      @r{2nd row, 3rd column}
1607 C2        @r{same as previous}
1608 $5        @r{column 5 in the current row}
1609 E&        @r{same as previous}
1610 @@2        @r{current column, row 2}
1611 @@-1$-3    @r{the field one row up, three columns to the left}
1612 @@-I$2     @r{field just under hline above current row, column 2}
1613 @end example
1615 @subsubheading Range references
1616 @cindex range references
1617 @cindex references, to ranges
1619 You may reference a rectangular range of fields by specifying two field
1620 references connected by two dots @samp{..}.  If both fields are in the
1621 current row, you may simply use @samp{$2..$7}, but if at least one field
1622 is in a different row, you need to use the general @code{@@row$column}
1623 format at least for the first field (i.e the reference must start with
1624 @samp{@@} in order to be interpreted correctly).  Examples:
1626 @example
1627 $1..$3        @r{First three fields in the current row.}
1628 $P..$Q        @r{Range, using column names (see under Advanced)}
1629 @@2$1..@@4$3    @r{6 fields between these two fields.}
1630 A2..C4        @r{Same as above.}
1631 @@-1$-2..@@-1   @r{3 numbers from the column to the left, 2 up to current row}
1632 @end example
1634 @noindent Range references return a vector of values that can be fed
1635 into Calc vector functions.  Empty fields in ranges are normally
1636 suppressed, so that the vector contains only the non-empty fields (but
1637 see the @samp{E} mode switch below).  If there are no non-empty fields,
1638 @samp{[0]} is returned to avoid syntax errors in formulas.
1640 @subsubheading Named references
1641 @cindex named references
1642 @cindex references, named
1643 @cindex name, of column or field
1644 @cindex constants, in calculations
1646 @samp{$name} is interpreted as the name of a column, parameter or
1647 constant.  Constants are defined globally through the variable
1648 @code{org-table-formula-constants}, and locally (for the file) through a
1649 line like
1651 @example
1652 #+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6
1653 @end example
1655 @noindent
1656 Also properties (@pxref{Properties and columns}) can be used as
1657 constants in table formulas: For a property @samp{:XYZ:} use the name
1658 @samp{$PROP_XYZ}, and the property will be searched in the current
1659 outline entry and in the hierarchy above it.  If you have the
1660 @file{constants.el} package, it will also be used to resolve constants,
1661 including natural constants like @samp{$h} for Planck's constant, and
1662 units like @samp{$km} for kilometers@footnote{@file{Constant.el} can
1663 supply the values of constants in two different unit systems, @code{SI}
1664 and @code{cgs}.  Which one is used depends on the value of the variable
1665 @code{constants-unit-system}.  You can use the @code{#+STARTUP} options
1666 @code{constSI} and @code{constcgs} to set this value for the current
1667 buffer.}.  Column names and parameters can be specified in special table
1668 lines.  These are described below, see @ref{Advanced features}.  All
1669 names must start with a letter, and further consist of letters and
1670 numbers.
1672 @node Formula syntax for Calc, Formula syntax for Lisp, References, The spreadsheet
1673 @subsection Formula syntax for Calc
1674 @cindex formula syntax, Calc
1675 @cindex syntax, of formulas
1677 A formula can be any algebraic expression understood by the Emacs
1678 @file{Calc} package.  @b{Note that @file{calc} has the
1679 non-standard convention that @samp{/} has lower precedence than
1680 @samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.}  Before
1681 evaluation by @code{calc-eval} (@pxref{Calling Calc from
1682 Your Programs,calc-eval,Calling calc from Your Lisp Programs,calc,GNU
1683 Emacs Calc Manual}),
1684 @c FIXME:  The link to the calc manual in HTML does not work.
1685 variable substitution takes place according to the rules described above.
1686 @cindex vectors, in table calculations
1687 The range vectors can be directly fed into the calc vector functions
1688 like @samp{vmean} and @samp{vsum}.
1690 @cindex format specifier
1691 @cindex mode, for @file{calc}
1692 A formula can contain an optional mode string after a semicolon.  This
1693 string consists of flags to influence Calc and other modes during
1694 execution.  By default, Org-mode uses the standard calc modes (precision
1695 12, angular units degrees, fraction and symbolic modes off.  The display
1696 format, however, has been changed to @code{(float 5)} to keep tables
1697 compact.  The default settings can be configured using the variable
1698 @code{org-calc-default-modes}.
1700 @example
1701 p20           @r{switch the internal precision to 20 digits}
1702 n3 s3 e2 f4   @r{normal, scientific, engineering, or fixed display format}
1703 D R           @r{angle modes: degrees, radians}
1704 F S           @r{fraction and symbolic modes}
1705 N             @r{interpret all fields as numbers, use 0 for non-numbers}
1706 T             @r{force text interpretation}
1707 E             @r{keep empty fields in ranges}
1708 @end example
1710 @noindent
1711 In addition, you may provide a @code{printf} format specifier to
1712 reformat the final result.  A few examples:
1714 @example
1715 $1+$2                @r{Sum of first and second field}
1716 $1+$2;%.2f           @r{Same, format result to two decimals}
1717 exp($2)+exp($1)      @r{Math functions can be used}
1718 $0;%.1f              @r{Reformat current cell to 1 decimal}
1719 ($3-32)*5/9          @r{Degrees F -> C conversion}
1720 $c/$1/$cm            @r{Hz -> cm conversion, using @file{constants.el}}
1721 tan($1);Dp3s1        @r{Compute in degrees, precision 3, display SCI 1}
1722 sin($1);Dp3%.1e      @r{Same, but use printf specifier for display}
1723 vmean($2..$7)        @r{Compute column range mean, using vector function}
1724 vmean($2..$7);EN     @r{Same, but treat empty fields as 0}
1725 taylor($3,x=7,2)     @r{taylor series of $3, at x=7, second degree}
1726 @end example
1728 Calc also contains a complete set of logical operations.  For example
1730 @example
1731 if($1<20,teen,string(""))  @r{``teen'' if age $1 less than 20, else empty}
1732 @end example
1734 @node Formula syntax for Lisp, Field formulas, Formula syntax for Calc, The spreadsheet
1735 @subsection Emacs Lisp forms as formulas
1736 @cindex Lisp forms, as table formulas
1738 It is also possible to write a formula in Emacs Lisp; this can be useful
1739 for string manipulation and control structures, if the Calc's
1740 functionality is not enough.  If a formula starts with a single quote
1741 followed by an opening parenthesis, then it is evaluated as a lisp form.
1742 The evaluation should return either a string or a number.  Just as with
1743 @file{calc} formulas, you can specify modes and a printf format after a
1744 semicolon.  With Emacs Lisp forms, you need to be concious about the way
1745 field references are interpolated into the form.  By default, a
1746 reference will be interpolated as a Lisp string (in double quotes)
1747 containing the field.  If you provide the @samp{N} mode switch, all
1748 referenced elements will be numbers (non-number fields will be zero) and
1749 interpolated as Lisp numbers, without quotes.  If you provide the
1750 @samp{L} flag, all fields will be interpolated literally, without quotes.
1751 I.e., if you want a reference to be interpreted as a string by the Lisp
1752 form, enclode the reference operator itself in double quotes, like
1753 @code{"$3"}.  Ranges are inserted as space-separated fields, so you can
1754 embed them in list or vector syntax.  A few examples, note how the
1755 @samp{N} mode is used when we do computations in lisp.
1757 @example
1758 @r{Swap the first two characters of the content of column 1}
1759   '(concat (substring $1 1 2) (substring $1 0 1) (substring $1 2))
1760 @r{Add columns 1 and 2, equivalent to the Calc's @code{$1+$2}}
1761   '(+ $1 $2);N
1762 @r{Compute the sum of columns 1-4, like Calc's @code{vsum($1..$4)}}
1763   '(apply '+ '($1..$4));N
1764 @end example
1766 @node Field formulas, Column formulas, Formula syntax for Lisp, The spreadsheet
1767 @subsection Field formulas
1768 @cindex field formula
1769 @cindex formula, for individual table field
1771 To assign a formula to a particular field, type it directly into the
1772 field, preceded by @samp{:=}, for example @samp{:=$1+$2}.  When you
1773 press @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in
1774 the field, the formula will be stored as the formula for this field,
1775 evaluated, and the current field replaced with the result.
1777 Formulas are stored in a special line starting with @samp{#+TBLFM:}
1778 directly below the table.  If you typed the equation in the 4th field of
1779 the 3rd data line in the table, the formula will look like
1780 @samp{@@3$4=$1+$2}.  When inserting/deleting/swapping column and rows
1781 with the appropriate commands, @i{absolute references} (but not relative
1782 ones) in stored formulas are modified in order to still reference the
1783 same field.  Of cause this is not true if you edit the table structure
1784 with normal editing commands - then you must fix the equations yourself.
1786 Instead of typing an equation into the field, you may also use the
1787 following command
1789 @table @kbd
1790 @kindex C-u C-c =
1791 @item C-u C-c =
1792 Install a new formula for the current field.  The command prompts for a
1793 formula, with default taken from the @samp{#+TBLFM:} line, applies
1794 it to the current field and stores it.
1795 @end table
1797 @node Column formulas, Editing and debugging formulas, Field formulas, The spreadsheet
1798 @subsection Column formulas
1799 @cindex column formula
1800 @cindex formula, for table column
1802 Often in a table, the same formula should be used for all fields in a
1803 particular column.  Instead of having to copy the formula to all fields
1804 in that column, org-mode allows to assign a single formula to an entire
1805 column.  If the table contains horizontal separator hlines, everything
1806 before the first such line is considered part of the table @emph{header}
1807 and will not be modified by column formulas.
1809 To assign a formula to a column, type it directly into any field in the
1810 column, preceded by an equal sign, like @samp{=$1+$2}.  When you press
1811 @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in the
1812 field, the formula will be stored as the formula for the current column,
1813 evaluated and the current field replaced with the result.  If the field
1814 contains only @samp{=}, the previously stored formula for this column is
1815 used.  For each column, Org-mode will only remember the most recently
1816 used formula.  In the @samp{TBLFM:} line, column formulas will look like
1817 @samp{$4=$1+$2}.
1819 Instead of typing an equation into the field, you may also use the
1820 following command:
1822 @table @kbd
1823 @kindex C-c =
1824 @item C-c =
1825 Install a new formula for the current column and replace current field
1826 with the result of the formula.  The command prompts for a formula, with
1827 default taken from the @samp{#+TBLFM} line, applies it to the current
1828 field and stores it.  With a numerical prefix (e.g. @kbd{C-5 C-c =})
1829 will apply it to that many consecutive fields in the current column.
1830 @end table
1833 @node Editing and debugging formulas, Updating the table, Column formulas, The spreadsheet
1834 @subsection Editing and Debugging formulas
1835 @cindex formula editing
1836 @cindex editing, of table formulas
1838 You can edit individual formulas in the minibuffer or directly in the
1839 field.  Org-mode can also prepare a special buffer with all active
1840 formulas of a table.  When offering a formula for editing, Org-mode
1841 converts references to the standard format (like @code{B3} or @code{D&})
1842 if possible.  If you prefer to only work with the internal format (like
1843 @code{@@3$2} or @code{$4}), configure the variable
1844 @code{org-table-use-standard-references}.
1846 @table @kbd
1847 @kindex C-c =
1848 @kindex C-u C-c =
1849 @item C-c =
1850 @itemx C-u C-c =
1851 Edit the formula associated with the current column/field in the
1852 minibuffer.  See @ref{Column formulas} and @ref{Field formulas}.
1853 @kindex C-u C-u C-c =
1854 @item C-u C-u C-c =
1855 Re-insert the active formula (either a
1856 field formula, or a column formula) into the current field, so that you
1857 can edit it directly in the field.  The advantage over editing in the
1858 minibuffer is that you can use the command @kbd{C-c ?}.
1859 @kindex C-c ?
1860 @item C-c ?
1861 While editing a formula in a table field, highlight the field(s)
1862 referenced by the reference at the cursor position in the formula.
1863 @kindex C-c @}
1864 @item C-c @}
1865 Toggle the display of row and column numbers for a table, using
1866 overlays.  These are updated each time the table is aligned, you can
1867 force it with @kbd{C-c C-c}.
1868 @kindex C-c @{
1869 @item C-c @{
1870 Toggle the formula debugger on and off.  See below.
1871 @kindex C-c '
1872 @item C-c '
1873 Edit all formulas for the current table in a special buffer, where the
1874 formulas will be displayed one per line.  If the current field has an
1875 active formula, the cursor in the formula editor will mark it.
1876 While inside the special buffer, Org-mode will automatically highlight
1877 any field or range reference at the cursor position.  You may edit,
1878 remove and add formulas, and use the following commands:
1879 @table @kbd
1880 @kindex C-c C-c
1881 @kindex C-x C-s
1882 @item C-c C-c
1883 @itemx C-x C-s
1884 Exit the formula editor and store the modified formulas.  With @kbd{C-u}
1885 prefix, also apply the new formulas to the entire table.
1886 @kindex C-c C-q
1887 @item C-c C-q
1888 Exit the formula editor without installing changes.
1889 @kindex C-c C-r
1890 @item C-c C-r
1891 Toggle all references in the formula editor between standard (like
1892 @code{B3}) and internal (like @code{@@3$2}).
1893 @kindex @key{TAB}
1894 @item @key{TAB}
1895 Pretty-print or indent lisp formula at point.  When in a line containing
1896 a lisp formula, format the formula according to Emacs Lisp rules.
1897 Another @key{TAB} collapses the formula back again.  In the open
1898 formula, @key{TAB} re-indents just like in Emacs-lisp-mode.
1899 @kindex M-@key{TAB}
1900 @item M-@key{TAB}
1901 Complete Lisp symbols, just like in Emacs-lisp-mode.
1902 @kindex S-@key{up}
1903 @kindex S-@key{down}
1904 @kindex S-@key{left}
1905 @kindex S-@key{right}
1906 @item S-@key{up}/@key{down}/@key{left}/@key{right}
1907 Shift the reference at point.  For example, if the reference is
1908 @code{B3} and you press @kbd{S-@key{right}}, it will become @code{C3}.
1909 This also works for relative references, and for hline references.
1910 @kindex M-S-@key{up}
1911 @kindex M-S-@key{down}
1912 @item M-S-@key{up}/@key{down}
1913 Move the test line for column formulas in the Org-mode buffer up and
1914 down.
1915 @kindex M-@key{up}
1916 @kindex M-@key{down}
1917 @item M-@key{up}/@key{down}
1918 Scroll the window displaying the table.
1919 @kindex C-c @}
1920 @item C-c @}
1921 Turn the coordinate grid in the table on and off.
1922 @end table
1923 @end table
1925 Making a table field blank does not remove the formula associated with
1926 the field, because that is stored in a different line (the @samp{TBLFM}
1927 line) - during the next recalculation the field will be filled again.
1928 To remove a formula from a field, you have to give an empty reply when
1929 prompted for the formula, or to edit the @samp{#+TBLFM} line.
1931 @kindex C-c C-c
1932 You may edit the @samp{#+TBLFM} directly and re-apply the changed
1933 equations with @kbd{C-c C-c} in that line, or with the normal
1934 recalculation commands in the table.
1936 @subsubheading Debugging formulas
1937 @cindex formula debugging
1938 @cindex debugging, of table formulas
1939 When the evaluation of a formula leads to an error, the field content
1940 becomes the string @samp{#ERROR}.  If you would like see what is going
1941 on during variable substitution and calculation in order to find a bug,
1942 turn on formula debugging in the @code{Tbl} menu and repeat the
1943 calculation, for example by pressing @kbd{C-u C-u C-c = @key{RET}} in a
1944 field.  Detailed information will be displayed.
1946 @node Updating the table, Advanced features, Editing and debugging formulas, The spreadsheet
1947 @subsection Updating the Table
1948 @cindex recomputing table fields
1949 @cindex updating, table
1951 Recalculation of a table is normally not automatic, but needs to be
1952 triggered by a command.  See @ref{Advanced features} for a way to make
1953 recalculation at least semi-automatically.
1955 In order to recalculate a line of a table or the entire table, use the
1956 following commands:
1958 @table @kbd
1959 @kindex C-c *
1960 @item C-c *
1961 Recalculate the current row by first applying the stored column formulas
1962 from left to right, and all field formulas in the current row.
1964 @kindex C-u C-c *
1965 @item C-u C-c *
1966 @kindex C-u C-c C-c
1967 @itemx C-u C-c C-c
1968 Recompute the entire table, line by line.  Any lines before the first
1969 hline are left alone, assuming that these are part of the table header.
1971 @kindex C-u C-u C-c *
1972 @item C-u C-u C-c *
1973 Iterate the table by recomputing it until no further changes occur.
1974 This may be necessary if some computed fields use the value of other
1975 fields that are computed @i{later} in the calculation sequence.
1976 @end table
1978 @node Advanced features,  , Updating the table, The spreadsheet
1979 @subsection Advanced features
1981 If you want the recalculation of fields to happen automatically, or if
1982 you want to be able to assign @i{names} to fields and columns, you need
1983 to reserve the first column of the table for special marking characters.
1984 @table @kbd
1985 @kindex C-#
1986 @item C-#
1987 Rotate the calculation mark in first column through the states @samp{},
1988 @samp{#}, @samp{*}, @samp{!}, @samp{$}.  The meaning of these characters
1989 is discussed below.  When there is an active region, change all marks in
1990 the region.
1991 @end table
1993 Here is an example of a table that collects exam results of students and
1994 makes use of these features:
1996 @example
1997 @group
1998 |---+---------+--------+--------+--------+-------+------|
1999 |   | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
2000 |---+---------+--------+--------+--------+-------+------|
2001 | ! |         |     P1 |     P2 |     P3 |   Tot |      |
2002 | # | Maximum |     10 |     15 |     25 |    50 | 10.0 |
2003 | ^ |         |     m1 |     m2 |     m3 |    mt |      |
2004 |---+---------+--------+--------+--------+-------+------|
2005 | # | Peter   |     10 |      8 |     23 |    41 |  8.2 |
2006 | # | Sara    |      6 |     14 |     19 |    39 |  7.8 |
2007 | # | Sam     |      2 |      4 |      3 |     9 |  1.8 |
2008 |---+---------+--------+--------+--------+-------+------|
2009 |   | Average |        |        |        |  29.7 |      |
2010 | ^ |         |        |        |        |    at |      |
2011 | $ | max=50  |        |        |        |       |      |
2012 |---+---------+--------+--------+--------+-------+------|
2013 #+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(@@-II..@@-I);%.1f
2014 @end group
2015 @end example
2017 @noindent @b{Important}: Please note that for these special tables,
2018 recalculating the table with @kbd{C-u C-c *} will only affect rows that
2019 are marked @samp{#} or @samp{*}, and fields that have a formula assigned
2020 to the field itself.  The column formulas are not applied in rows with
2021 empty first field.
2023 @cindex marking characters, tables
2024 The marking characters have the following meaning:
2025 @table @samp
2026 @item !
2027 The fields in this line define names for the columns, so that you may
2028 refer to a column as @samp{$Tot} instead of @samp{$6}.
2029 @item ^
2030 This row defines names for the fields @emph{above} the row.  With such
2031 a definition, any formula in the table may use @samp{$m1} to refer to
2032 the value @samp{10}.  Also, if you assign a formula to a names field, it
2033 will be stored as @samp{$name=...}.
2034 @item _
2035 Similar to @samp{^}, but defines names for the fields in the row
2036 @emph{below}.
2037 @item $
2038 Fields in this row can define @emph{parameters} for formulas.  For
2039 example, if a field in a @samp{$} row contains @samp{max=50}, then
2040 formulas in this table can refer to the value 50 using @samp{$max}.
2041 Parameters work exactly like constants, only that they can be defined on
2042 a per-table basis.
2043 @item #
2044 Fields in this row are automatically recalculated when pressing
2045 @key{TAB} or @key{RET} or @kbd{S-@key{TAB}} in this row.  Also, this row
2046 is selected for a global recalculation with @kbd{C-u C-c *}.  Unmarked
2047 lines will be left alone by this command.
2048 @item *
2049 Selects this line for global recalculation with @kbd{C-u C-c *}, but
2050 not for automatic recalculation.  Use this when automatic
2051 recalculation slows down editing too much.
2052 @item
2053 Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}.
2054 All lines that should be recalculated should be marked with @samp{#}
2055 or @samp{*}.
2056 @item /
2057 Do not export this line.  Useful for lines that contain the narrowing
2058 @samp{<N>} markers.
2059 @end table
2061 Finally, just to whet your appetite on what can be done with the
2062 fantastic @file{calc} package, here is a table that computes the Taylor
2063 series of degree @code{n} at location @code{x} for a couple of functions
2064 (homework: try that with Excel :-)
2066 @example
2067 @group
2068 |---+-------------+---+-----+--------------------------------------|
2069 |   | Func        | n | x   | Result                               |
2070 |---+-------------+---+-----+--------------------------------------|
2071 | # | exp(x)      | 1 | x   | 1 + x                                |
2072 | # | exp(x)      | 2 | x   | 1 + x + x^2 / 2                      |
2073 | # | exp(x)      | 3 | x   | 1 + x + x^2 / 2 + x^3 / 6            |
2074 | # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 |
2075 | # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2    |
2076 | * | tan(x)      | 3 | x   | 0.0175 x + 1.77e-6 x^3               |
2077 |---+-------------+---+-----+--------------------------------------|
2078 #+TBLFM: $5=taylor($2,$4,$3);n3
2079 @end group
2080 @end example
2082 @node Hyperlinks, TODO items, Tables, Top
2083 @chapter Hyperlinks
2084 @cindex hyperlinks
2086 Just like HTML, Org-mode provides links inside a file, and external
2087 links to other files, Usenet articles, emails, and much more.
2089 @menu
2090 * Link format::                 How links in Org-mode are formatted
2091 * Internal links::              Links to other places in the current file
2092 * External links::              URL-like links to the world
2093 * Handling links::              Creating, inserting and following
2094 * Using links outside Org-mode::  Linking from my C source code?
2095 * Link abbreviations::          Shortcuts for writing complex links
2096 * Search options::              Linking to a specific location
2097 * Custom searches::             When the default search is not enough
2098 * Remember::                    Org-trees store quick notes
2099 @end menu
2101 @node Link format, Internal links, Hyperlinks, Hyperlinks
2102 @section Link format
2103 @cindex link format
2104 @cindex format, of links
2106 Org-mode will recognize plain URL-like links and activate them as
2107 clickable links.  The general link format, however, looks like this:
2109 @example
2110 [[link][description]]       @r{or alternatively}           [[link]]  
2111 @end example
2113 Once a link in the buffer is complete (all brackets present), Org-mode
2114 will change the display so that @samp{description} is displayed instead
2115 of @samp{[[link][description]]} and @samp{link} is displayed instead of
2116 @samp{[[link]]}.  Links will be highlighted in the face @code{org-link},
2117 which by default is an underlined face.  You can directly edit the
2118 visible part of a link.  Note that this can be either the @samp{link}
2119 part (if there is no description) or the @samp{description} part.  To
2120 edit also the invisible @samp{link} part, use @kbd{C-c C-l} with the
2121 cursor on the link.
2123 If you place the cursor at the beginning or just behind the end of the
2124 displayed text and press @key{BACKSPACE}, you will remove the
2125 (invisible) bracket at that location.  This makes the link incomplete
2126 and the internals are again displayed as plain text.  Inserting the
2127 missing bracket hides the link internals again.  To show the
2128 internal structure of all links, use the menu entry
2129 @code{Org->Hyperlinks->Literal links}.
2131 @node Internal links, External links, Link format, Hyperlinks
2132 @section Internal links
2133 @cindex internal links
2134 @cindex links, internal
2135 @cindex targets, for links
2137 If the link does not look like a URL, it is considered to be internal in
2138 the current file.  Links such as @samp{[[My Target]]} or @samp{[[My
2139 Target][Find my target]]} lead to a text search in the current file.
2140 The link can be followed with @kbd{C-c C-o} when the cursor is on the
2141 link, or with a mouse click (@pxref{Handling links}).  The preferred
2142 match for such a link is a dedicated target: the same string in double
2143 angular brackets.  Targets may be located anywhere; sometimes it is
2144 convenient to put them into a comment line. For example
2146 @example
2147 # <<My Target>>
2148 @end example
2150 @noindent In HTML export (@pxref{HTML export}), such targets will become
2151 named anchors for direct access through @samp{http} links@footnote{Note
2152 that text before the first headline is usually not exported, so the
2153 first such target should be after the first headline.}.
2155 If no dedicated target exists, Org-mode will search for the words in the
2156 link.  In the above example the search would be for @samp{my target}.
2157 Links starting with a star like @samp{*My Target} restrict the search to
2158 headlines.  When searching, Org-mode will first try an exact match, but
2159 then move on to more and more lenient searches.  For example, the link
2160 @samp{[[*My Targets]]} will find any of the following:
2162 @example
2163 ** My targets
2164 ** TODO my targets are bright
2165 ** my 20 targets are
2166 @end example
2168 To insert a link targeting a headline, in-buffer completion can be used.
2169 Just type a star followed by a few optional letters into the buffer and
2170 press @kbd{M-@key{TAB}}.  All headlines in the current buffer will be
2171 offered as completions.  @xref{Handling links}, for more commands
2172 creating links.
2174 Following a link pushes a mark onto Org-mode's own mark ring.  You can
2175 return to the previous position with @kbd{C-c &}.  Using this command
2176 several times in direct succession goes back to positions recorded
2177 earlier.
2179 @menu
2180 * Radio targets::               Make targets trigger links in plain text.
2181 @end menu
2183 @node Radio targets,  , Internal links, Internal links
2184 @subsection Radio targets
2185 @cindex radio targets
2186 @cindex targets, radio
2187 @cindex links, radio targets
2189 Org-mode can automatically turn any occurrences of certain target names
2190 in normal text into a link.  So without explicitly creating a link, the
2191 text connects to the target radioing its position.  Radio targets are
2192 enclosed by triple angular brackets.  For example, a target @samp{<<<My
2193 Target>>>} causes each occurrence of @samp{my target} in normal text to
2194 become activated as a link.  The Org-mode file is scanned automatically
2195 for radio targets only when the file is first loaded into Emacs.  To
2196 update the target list during editing, press @kbd{C-c C-c} with the
2197 cursor on or at a target.
2199 @node External links, Handling links, Internal links, Hyperlinks
2200 @section External links
2201 @cindex links, external
2202 @cindex external links
2203 @cindex links, external
2204 @cindex GNUS links
2205 @cindex BBDB links
2206 @cindex URL links
2207 @cindex file links
2208 @cindex VM links
2209 @cindex RMAIL links
2210 @cindex WANDERLUST links
2211 @cindex MH-E links
2212 @cindex USENET links
2213 @cindex SHELL links
2214 @cindex Info links
2215 @cindex elisp links
2217 Org-mode supports links to files, websites, Usenet and email messages,
2218 and BBDB database entries.  External links are URL-like locators.  They
2219 start with a short identifying string followed by a colon.  There can be
2220 no space after the colon.  The following list shows examples for each
2221 link type.
2223 @example
2224 http://www.astro.uva.nl/~dominik          @r{on the web}
2225 file:/home/dominik/images/jupiter.jpg     @r{file, absolute path}
2226 file:papers/last.pdf                      @r{file, relative path}
2227 news:comp.emacs                           @r{Usenet link}
2228 mailto:adent@@galaxy.net                   @r{Mail link}
2229 vm:folder                                 @r{VM folder link}
2230 vm:folder#id                              @r{VM message link}
2231 vm://myself@@some.where.org/folder#id      @r{VM on remote machine}
2232 wl:folder                                 @r{WANDERLUST folder link}
2233 wl:folder#id                              @r{WANDERLUST message link}
2234 mhe:folder                                @r{MH-E folder link}
2235 mhe:folder#id                             @r{MH-E message link}
2236 rmail:folder                              @r{RMAIL folder link}
2237 rmail:folder#id                           @r{RMAIL message link}
2238 gnus:group                                @r{GNUS group link}
2239 gnus:group#id                             @r{GNUS article link}
2240 bbdb:Richard Stallman                     @r{BBDB link}
2241 shell:ls *.org                            @r{A shell command}
2242 elisp:(find-file-other-frame "Elisp.org") @r{An elisp form to evaluate}
2243 @end example
2245 A link should be enclosed in double brackets and may contain a
2246 descriptive text to be displayed instead of the url (@pxref{Link
2247 format}), for example:
2249 @example
2250 [[http://www.gnu.org/software/emacs/][GNU Emacs]]
2251 @end example
2253 @noindent
2254 If the description is a file name or URL that points to an image, HTML
2255 export (@pxref{HTML export}) will inline the image as a clickable
2256 button.  If there is no description at all and the link points to an
2257 image,
2258 that image will be inlined into the exported HTML file.
2260 @cindex angular brackets, around links
2261 @cindex plain text external links
2262 Org-mode also finds external links in the normal text and activates them
2263 as links.  If spaces must be part of the link (for example in
2264 @samp{bbdb:Richard Stallman}), or if you need to remove ambiguities
2265 about the end of the link, enclose them in angular brackets.
2267 @node Handling links, Using links outside Org-mode, External links, Hyperlinks
2268 @section Handling links
2269 @cindex links, handling
2271 Org-mode provides methods to create a link in the correct syntax, to
2272 insert it into an org-mode file, and to follow the link.
2274 @table @kbd
2275 @kindex C-c l
2276 @cindex storing links
2277 @item C-c l
2278 Store a link to the current location.  This is a @emph{global} command
2279 which can be used in any buffer to create a link.  The link will be
2280 stored for later insertion into an Org-mode buffer (see below).  For
2281 Org-mode files, if there is a @samp{<<target>>} at the cursor, the link
2282 points to the target.  Otherwise it points to the current headline.  For
2283 VM, RMAIL, WANDERLUST, MH-E, GNUS and BBDB buffers, the link will
2284 indicate the current article/entry.  For W3 and W3M buffers, the link
2285 goes to the current URL.  For any other files, the link will point to
2286 the file, with a search string (@pxref{Search options}) pointing to the
2287 contents of the current line.  If there is an active region, the
2288 selected words will form the basis of the search string.  If the
2289 automatically created link is not working correctly or accurately
2290 enough, you can write custom functions to select the search string and
2291 to do the search for particular file types - see @ref{Custom searches}.
2292 The key binding @kbd{C-c l} is only a suggestion - see @ref{Installation}.
2294 @kindex C-c C-l
2295 @cindex link completion
2296 @cindex completion, of links
2297 @cindex inserting links
2298 @item C-c C-l
2299 Insert a link.  This prompts for a link to be inserted into the buffer.
2300 You can just type a link, using text for an internal link, or one of the
2301 link type prefixes mentioned in the examples above.  All links stored
2302 during the current session are part of the history for this prompt, so
2303 you can access them with @key{up} and @key{down}.  Completion, on the
2304 other hand, will help you to insert valid link prefixes like
2305 @samp{http:} or @samp{ftp:}, including the prefixes defined through link
2306 abbreviations (@pxref{Link abbreviations}).  The link will be inserted
2307 into the buffer@footnote{After insertion of a stored link, the link will
2308 be removed from the list of stored links.  To keep it in the list later
2309 use, use a triple @kbd{C-u} prefix to @kbd{C-c C-l}, or configure the
2310 option @code{org-keep-stored-link-after-insertion}.}, along with a
2311 descriptive text.  If some text was selected when this command is
2312 called, the selected text becomes the default description.@* Note that
2313 you don't have to use this command to insert a link.  Links in Org-mode
2314 are plain text, and you can type or paste them straight into the buffer.
2315 By using this command, the links are automatically enclosed in double
2316 brackets, and you will be asked for the optional descriptive text.
2318 @c  If the link is a @samp{file:} link and
2319 @c the linked file is located in the same directory as the current file or
2320 @c a subdirectory of it, the path of the file will be inserted relative to
2321 @c the current directory.
2323 @kindex C-u C-c C-l
2324 @cindex file name completion
2325 @cindex completion, of file names
2326 @item C-u C-c C-l
2327 When @kbd{C-c C-l} is called with a @kbd{C-u} prefix argument, a link to
2328 a file will be inserted and you may use file name completion to select
2329 the name of the file.  The path to the file is inserted relative to the
2330 directory of the current org file, if the linked file is in the current
2331 directory or in a subdirectory of it, or if the path is written relative
2332 to the current directory using @samp{../}.  Otherwise an absolute path
2333 is used, if possible with @samp{~/} for your home directory.  You can
2334 force an absolute path with two @kbd{C-u} prefixes.
2336 @item C-c C-l @r{(with cursor on existing link)}
2337 When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit the
2338 link and description parts of the link.
2340 @cindex following links
2341 @kindex C-c C-o
2342 @item C-c C-o
2343 Open link at point.  This will launch a web browser for URLs (using
2344 @command{browse-url-at-point}), run vm/mh-e/wanderlust/rmail/gnus/bbdb
2345 for the corresponding links, and execute the command in a shell link.
2346 When the cursor is on an internal link, this commands runs the
2347 corresponding search.  When the cursor is on a TAG list in a headline,
2348 it creates the corresponding TAGS view.  If the cursor is on a time
2349 stamp, it compiles the agenda for that date.  Furthermore, it will visit
2350 text and remote files in @samp{file:} links with Emacs and select a
2351 suitable application for local non-text files.  Classification of files
2352 is based on file extension only.  See option @code{org-file-apps}.  If
2353 you want to override the default application and visit the file with
2354 Emacs, use a @kbd{C-u} prefix.
2356 @kindex mouse-2
2357 @kindex mouse-1
2358 @item mouse-2
2359 @itemx mouse-1
2360 On links, @kbd{mouse-2} will open the link just as @kbd{C-c C-o}
2361 would.  Under Emacs 22, also @kbd{mouse-1} will follow a link.
2363 @kindex mouse-3
2364 @item mouse-3
2365 Like @kbd{mouse-2}, but force file links to be opened with Emacs, and
2366 internal links to be displayed in another window@footnote{See the
2367 variable @code{org-display-internal-link-with-indirect-buffer}}.
2369 @cindex mark ring
2370 @kindex C-c %
2371 @item C-c %
2372 Push the current position onto the mark ring, to be able to return
2373 easily. Commands following an internal link do this automatically.
2375 @cindex links, returning to
2376 @kindex C-c &
2377 @item C-c &
2378 Jump back to a recorded position.  A position is recorded by the
2379 commands following internal links, and by @kbd{C-c %}.  Using this
2380 command several times in direct succession moves through a ring of
2381 previously recorded positions.
2383 @kindex C-c C-x C-n
2384 @kindex C-c C-x C-p
2385 @cindex links, finding next/previous
2386 @item C-c C-x C-n
2387 @itemx C-c C-x C-p
2388 Move forward/backward to the next link in the buffer.  At the limit of
2389 the buffer, the search fails once, and then wraps around.  The key
2390 bindings for this are really too long, you might want to bind this also
2391 to @kbd{C-n} and @kbd{C-p}
2392 @lisp
2393 (add-hook 'org-load-hook
2394   (lambda ()
2395     (define-key 'org-mode-map "\C-n" 'org-next-link)
2396     (define-key 'org-mode-map "\C-p" 'org-previous-link)))
2397 @end lisp
2398 @end table
2400 @node Using links outside Org-mode, Link abbreviations, Handling links, Hyperlinks
2401 @section Using links outside Org-mode
2403 You can insert and follow links that have Org-mode syntax not only in
2404 Org-mode, but in any Emacs buffer.  For this, you should create two
2405 global commands, like this (please select suitable global keys
2406 yourself):
2408 @lisp
2409 (global-set-key "\C-c L" 'org-insert-link-global)
2410 (global-set-key "\C-c o" 'org-open-at-point-global)
2411 @end lisp
2413 @node Link abbreviations, Search options, Using links outside Org-mode, Hyperlinks
2414 @section Link abbreviations
2415 @cindex link abbreviations
2416 @cindex abbreviation, links
2418 Long URLs can be cumbersome to type, and often many similar links are
2419 needed in a document.  For this you can use link abbreviations.  An
2420 abbreviated link looks like this
2422 @example
2423 [[linkword:tag][description]]
2424 @end example
2426 @noindent
2427 where the tag is optional.  Such abbreviations are resolved according to
2428 the information in the variable @code{org-link-abbrev-alist} that
2429 relates the linkwords to replacement text.  Here is an example:
2431 @lisp
2432 @group
2433 (setq org-link-abbrev-alist
2434   '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
2435     ("google"   . "http://www.google.com/search?q=")
2436     ("ads"      . "http://adsabs.harvard.edu/cgi-bin/
2437                    nph-abs_connect?author=%s&db_key=AST")))
2438 @end group
2439 @end lisp
2441 If the replacement text contains the string @samp{%s}, it will be
2442 replaced with the tag.  Otherwise the tag will be appended to the string
2443 in order to create the link.  You may also specify a function that will
2444 be called with the tag as the only argument to create the link.
2446 With the above setting, you could link to a specific bug with
2447 @code{[[bugzilla:129]]}, search the web for @samp{OrgMode} with
2448 @code{[[google:OrgMode]]} and find out what the Org-mode author is
2449 doing besides Emacs hacking with @code{[[ads:Dominik,C]]}.
2451 If you need special abbreviations just for a single Org-mode buffer, you
2452 can define them in the file with
2454 @example
2455 #+LINK: bugzilla  http://10.1.2.9/bugzilla/show_bug.cgi?id=
2456 #+LINK: google    http://www.google.com/search?q=%s
2457 @end example
2459 @noindent
2460 In-buffer completion @pxref{Completion} can be used after @samp{[} to
2461 complete link abbreviations.
2463 @node Search options, Custom searches, Link abbreviations, Hyperlinks
2464 @section Search options in file links
2465 @cindex search option in file links
2466 @cindex file links, searching
2468 File links can contain additional information to make Emacs jump to a
2469 particular location in the file when following a link.  This can be a
2470 line number or a search option after a double@footnote{For backward
2471 compatibility, line numbers can also follow a single colon.} colon. For
2472 example, when the command @kbd{C-c l} creates a link (@pxref{Handling
2473 links}) to a file, it encodes the words in the current line as a search
2474 string that can be used to find this line back later when following the
2475 link with @kbd{C-c C-o}. 
2477 Here is the syntax of the different ways to attach a search to a file
2478 link, together with an explanation:
2480 @example
2481 [[file:~/code/main.c::255]]
2482 [[file:~/xx.org::My Target]]
2483 [[file:~/xx.org::*My Target]]
2484 [[file:~/xx.org::/regexp/]]
2485 @end example
2487 @table @code
2488 @item 255
2489 Jump to line 255.
2490 @item My Target
2491 Search for a link target @samp{<<My Target>>}, or do a text search for
2492 @samp{my target}, similar to the search in internal links, see
2493 @ref{Internal links}.  In HTML export (@pxref{HTML export}), such a file
2494 link will become an HTML reference to the corresponding named anchor in
2495 the linked file.
2496 @item *My Target
2497 In an Org-mode file, restrict search to headlines.
2498 @item /regexp/
2499 Do a regular expression search for @code{regexp}.  This uses the Emacs
2500 command @code{occur} to list all matches in a separate window.  If the
2501 target file is in Org-mode, @code{org-occur} is used to create a
2502 sparse tree with the matches.
2503 @c If the target file is a directory,
2504 @c @code{grep} will be used to search all files in the directory.
2505 @end table
2507 As a degenerate case, a file link with an empty file name can be used
2508 to search the current file.  For example, @code{[[file:::find me]]} does
2509 a search for @samp{find me} in the current file, just as
2510 @samp{[[find me]]} would.
2512 @node Custom searches, Remember, Search options, Hyperlinks
2513 @section Custom Searches
2514 @cindex custom search strings
2515 @cindex search strings, custom
2517 The default mechanism for creating search strings and for doing the
2518 actual search related to a file link may not work correctly in all
2519 cases.  For example, BibTeX database files have many entries like
2520 @samp{year="1993"} which would not result in good search strings,
2521 because the only unique identification for a BibTeX entry is the
2522 citation key.
2524 If you come across such a problem, you can write custom functions to set
2525 the right search string for a particular file type, and to do the search
2526 for the string in the file.  Using @code{add-hook}, these functions need
2527 to be added to the hook variables
2528 @code{org-create-file-search-functions} and
2529 @code{org-execute-file-search-functions}.  See the docstring for these
2530 variables for more information.  Org-mode actually uses this mechanism
2531 for Bib@TeX{} database files, and you can use the corresponding code as
2532 an implementation example.  Search for @samp{BibTeX links} in the source
2533 file.
2536 @node Remember,  , Custom searches, Hyperlinks
2537 @section Remember
2538 @cindex @file{remember.el}
2540 Another way to create org entries with links to other files is through
2541 the @i{remember} package by John Wiegley.  @i{Remember} lets you store
2542 quick notes with little interruption of your work flow.  See
2543 @uref{http://www.emacswiki.org/cgi-bin/wiki/RememberMode} for more
2544 information.  The notes produced by @i{Remember} can be stored in
2545 different ways, and Org-mode files are a good target.  Org-mode
2546 significantly expands the possibilities of @i{remember}: You may define
2547 templates for different note types, and to associate target files and
2548 headlines with specific templates.  It also allows you to select the
2549 location where a note should be stored interactively, on the fly.
2551 @menu
2552 * Setting up remember::         Some code for .emacs to get things going
2553 * Remember templates::          Define the outline of different note types
2554 * Storing notes::               Directly get the note to where it belongs
2555 @end menu
2557 @node Setting up remember, Remember templates, Remember, Remember
2558 @subsection Setting up remember
2560 The following customization will tell @i{remember} to use org files as
2561 target, and to create annotations compatible with Org-mode links.
2563 @example
2564 (setq org-directory "~/path/to/my/orgfiles/")
2565 (setq org-default-notes-file "~/.notes")
2566 (setq remember-annotation-functions '(org-remember-annotation))
2567 (setq remember-handler-functions '(org-remember-handler))
2568 (add-hook 'remember-mode-hook 'org-remember-apply-template)
2569 @end example
2571 @node Remember templates, Storing notes, Setting up remember, Remember
2572 @subsection Remember templates
2573 @cindex templates, for remember
2575 In combination with Org-mode, you can use templates to generate
2576 different types of @i{remember} notes.  For example, if you would like
2577 to use one template to create general TODO entries, another one for
2578 journal entries, and a third one for collecting random ideas, you could
2579 use:
2581 @example
2582 (setq org-remember-templates
2583  '((?t "* TODO %?\n  %i\n  %a" "~/org/TODO.org")
2584    (?j "* %U %?\n\n  %i\n  %a" "~/org/JOURNAL.org")
2585    (?i "* %^@{Title@}\n  %i\n  %a" "~/org/JOURNAL.org" "New Ideas")))
2586 @end example
2588 @noindent In these entries, the character specifies how to select the
2589 template.  The first string specifies the template.  Two more (optional)
2590 strings give the file in which, and the headline under which the new
2591 note should be stored.  The file defaults (if not present or @code{nil})
2592 to @code{org-default-notes-file}, the heading to
2593 @code{org-remember-default-headline}.  Both defaults help to get to the
2594 storing location quickly, but you can change the location interactively
2595 while storing the note.
2597 When you call @kbd{M-x remember} (or @kbd{M-x org-remember}) to remember
2598 something, org will prompt for a key to select the template (if you have
2599 more than one template) and then prepare the buffer like
2600 @example
2601 * TODO
2602   [[file:link to where you called remember]]
2603 @end example
2605 @noindent or
2607 @example
2608 * [2006-03-21 Tue 15:37]
2610   [[file:link to where you called remember]]
2611 @end example
2613 @noindent
2614 During expansion of the template, special @kbd{%}-escapes allow dynamic
2615 insertion of content:
2616 @example
2617 %^@{prompt@}  @r{prompt the user for a string and replace this sequence with it.}
2618 %t          @r{time stamp, date only}
2619 %T          @r{time stamp with date and time}
2620 %u, %U      @r{like the above, but inactive time stamps}
2621 %^t         @r{like @code{%t}, but prompt for date.  Similarly @code{%^T}, @code{%^u}, @code{%^U}}
2622             @r{You may define a prompt like @code{%^@{Birthday@}t}}
2623 %n          @r{user name (taken from @code{user-full-name})}
2624 %a          @r{annotation, normally the link created with @code{org-store-link}}
2625 %i          @r{initial content, the region when remember is called with C-u.}
2626             @r{The entire text will be indented like @code{%i} itself.}
2627 %^g         @r{prompt for tags, with completion on tags in target file.}
2628 %^G         @r{prompt for tags, with completion all tags in all agenda files.}
2629 %:keyword   @r{specific information for certain link types, see below}
2630 @end example
2632 @noindent
2633 For specific link types, the following keywords will be defined:
2635 @example
2636 Link type          |  Available keywords
2637 -------------------+----------------------------------------------
2638 bbdb               |  %:name %:company
2639 vm, wl, mh, rmail  |  %:type %:subject %:message-id
2640                    |  %:from %:fromname %:fromaddress
2641                    |  %:to   %:toname   %:toaddress
2642                    |  %: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}.}}       
2643 gnus               |  %:group, @r{for messages also all email fields}
2644 w3, w3m            |  %:url
2645 info               |  %:file %:node
2646 calendar           |  %:date"
2647 @end example
2649 @noindent
2650 To place the cursor after template expansion use:
2652 @example
2653 %?          @r{After completing the template, position cursor here.}
2654 @end example
2656 @noindent
2657 If you change you mind about which template to use, call
2658 @code{org-remember} in the remember buffer.  You may then select a new
2659 template that will be filled with the previous context information.
2661 @node Storing notes,  , Remember templates, Remember
2662 @subsection Storing notes
2664 When you are finished preparing a note with @i{remember}, you have to press
2665 @kbd{C-c C-c} to file the note away.  The handler first prompts for a
2666 target file - if you press @key{RET}, the value specified for the
2667 template is used.  Then the command offers the headings tree of the
2668 selected file, with the cursor position at the default headline (if you
2669 had specified one in the template).  You can either immediately press
2670 @key{RET} to get the note placed there.  Or you can use the following
2671 keys to find a better location:
2672 @example
2673 @key{TAB}         @r{Cycle visibility.}
2674 @key{down} / @key{up}   @r{Next/previous visible headline.}
2675 n / p        @r{Next/previous visible headline.}
2676 f / b        @r{Next/previous headline same level.}
2677 u            @r{One level up.}
2678 @c 0-9          @r{Digit argument.}
2679 @end example
2680 @noindent
2681 Pressing @key{RET} or @key{left} or @key{right}
2682 then leads to the following result.
2684 @multitable @columnfractions 0.2 0.15 0.65
2685 @item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted}
2686 @item buffer-start @tab @key{RET} @tab as level 2 heading at end of file
2687 @item on headline @tab @key{RET} @tab as sublevel of the heading at cursor
2688 @item             @tab @key{left}/@key{right} @tab as same level, before/after current heading
2689 @item not on headline @tab @key{RET}
2690       @tab at cursor position, level taken from context.
2691 @end multitable
2693 So a fast way to store the note to its default location is to press
2694 @kbd{C-c C-c @key{RET} @key{RET}}.  Even shorter would be @kbd{C-u C-c
2695 C-c}, which does the same without even asking for a file or showing the
2696 tree.
2698 Before inserting the text into a tree, the function ensures that the
2699 text has a headline, i.e. a first line that starts with a @samp{*}.
2700 If not, a headline is constructed from the current date and some
2701 additional data.  If the variable @code{org-adapt-indentation} is
2702 non-nil, the entire text is also indented so that it starts in the
2703 same column as the headline (after the asterisks).
2706 @node TODO items, Tags, Hyperlinks, Top
2707 @chapter TODO items
2708 @cindex TODO items
2710 Org-mode does not maintain TODO lists as a separate document.  TODO
2711 items are an integral part of the notes file, because TODO items
2712 usually come up while taking notes!  With Org-mode, you simply mark
2713 any entry in a tree as being a TODO item.  In this way, the
2714 information is not duplicated, and the entire context from which the
2715 item emerged is always present when you check.
2717 Of course, this technique causes TODO items to be scattered throughout
2718 your file.  Org-mode provides methods to give you an overview over all
2719 things you have to do.
2721 @menu
2722 * TODO basics::                 Marking and displaying TODO entries
2723 * TODO extensions::             Workflow and assignments
2724 * Priorities::                  Some things are more important than others
2725 * Breaking down tasks::         Splitting a task into manageable pieces
2726 * Checkboxes::                  Tick-off lists
2727 @end menu
2729 @node TODO basics, TODO extensions, TODO items, TODO items
2730 @section Basic TODO functionality
2732 Any headline can become a TODO item by starting it with the word TODO,
2733 for example:
2735 @example
2736 *** TODO Write letter to Sam Fortune
2737 @end example
2739 @noindent
2740 The most important commands to work with TODO entries are:
2742 @table @kbd
2743 @kindex C-c C-t
2744 @cindex cycling, of TODO states
2745 @item C-c C-t
2746 Rotate the TODO state of the current item among
2748 @example
2749 ,-> (unmarked) -> TODO -> DONE --.
2750 '--------------------------------'
2751 @end example
2753 The same rotation can also be done ``remotely'' from the timeline and
2754 agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
2755 @kindex S-@key{right}
2756 @kindex S-@key{left}
2757 @item S-@key{right}
2758 @itemx S-@key{left}
2759 Select the following/preceding TODO state, similar to cycling.  Mostly
2760 useful if more than two TODO states are possible (@pxref{TODO extensions}).
2761 @kindex C-c C-v
2762 @cindex sparse tree, for TODO
2763 @item C-c C-v
2764 View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}).  Folds
2765 the entire buffer, but shows all TODO items and the headings hierarchy
2766 above them.  With prefix arg, search for a specific TODO.  You will be
2767 prompted for the keyword, and you can also give a list of keywords like
2768 @code{kwd1|kwd2|...}.  With numerical prefix N, show the tree for the
2769 Nth keyword in the variable @code{org-todo-keywords}.  With two prefix
2770 args, find all TODO and DONE entries.
2771 @kindex C-c a t
2772 @item C-c a t
2773 Show the global TODO list.  This collects the TODO items from all
2774 agenda files (@pxref{Agenda views}) into a single buffer.  The buffer is in
2775 @code{agenda-mode}, so there are commands to examine and manipulate
2776 the TODO entries directly from that buffer (@pxref{Agenda commands}).
2777 @xref{Global TODO list}, for more information.
2778 @c @item @code{org-agenda-include-all-todo}
2779 @c If you would like to have all your TODO items listed as part of your
2780 @c agenda, customize the variable @code{org-agenda-include-all-todo}.
2781 @kindex S-M-@key{RET}
2782 @item S-M-@key{RET}
2783 Insert a new TODO entry below the current one.
2784 @end table
2786 @node TODO extensions, Priorities, TODO basics, TODO items
2787 @section Extended use of TODO keywords
2788 @cindex extended TODO keywords
2790 The default implementation of TODO entries is just two states: TODO and
2791 DONE.  You can use the TODO feature for more complicated things by
2792 configuring the variable @code{org-todo-keywords}.  With special setup,
2793 the TODO keyword system can work differently in different files.
2795 Note that @i{tags} are another way to classify headlines in general and
2796 TODO items in particular (@pxref{Tags}).
2798 @menu
2799 * Workflow states::             From TODO to DONE in steps
2800 * TODO types::                  I do this, Fred the rest
2801 * Multiple sets in one file::   Mixing it all, and still finding your way
2802 * Per file keywords::           Different files, different requirements
2803 @end menu
2805 @node Workflow states, TODO types, TODO extensions, TODO extensions
2806 @subsection TODO keywords as workflow states
2807 @cindex TODO workflow
2808 @cindex workflow states as TODO keywords
2810 You can use TODO keywords to indicate different @emph{sequential} states
2811 in the process of working on an item, for example@footnote{Changing
2812 this variable only becomes effective after restarting Org-mode in a
2813 buffer.}:
2815 @lisp
2816 (setq org-todo-keywords
2817   '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
2818 @end lisp
2820 The vertical bar separates the TODO keywords (states that @emph{need
2821 action}) from the DONE states (which need @emph{no further action}.  If
2822 you don't provide the separator bar, the last state is used as the DONE
2823 state.
2824 @cindex completion, of TODO keywords
2825 With this setup, the command @kbd{C-c C-t} will cycle an entry from TODO
2826 to FEEDBACK, then to VERIFY, and finally to DONE and DELEGATED.  You may
2827 also use a prefix argument to quickly select a specific state.  For
2828 example @kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
2829 If you define many keywords, you can use in-buffer completion (see
2830 @ref{Completion}) to insert these words into the buffer.  Changing a
2831 todo state can be logged with a timestamp, see @ref{Tracking TODO state
2832 changes} for more information.
2834 @node TODO types, Multiple sets in one file, Workflow states, TODO extensions
2835 @subsection TODO keywords as types
2836 @cindex TODO types
2837 @cindex names as TODO keywords
2838 @cindex types as TODO keywords
2840 The second possibility is to use TODO keywords to indicate different
2841 @emph{types} of action items.  For example, you might want to indicate
2842 that items are for ``work'' or ``home''.  Or, when you work with several
2843 people on a single project, you might want to assign action items
2844 directly to persons, by using their names as TODO keywords.  This would
2845 be set up like this:
2847 @lisp
2848 (setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))
2849 @end lisp
2851 In this case, different keywords do not indicate a sequence, but rather
2852 different types.  So the normal work flow would be to assign a task to a
2853 person, and later to mark it DONE.  Org-mode supports this style by
2854 adapting the workings of the command @kbd{C-c C-t}@footnote{This is also
2855 true for the @kbd{t} command in the timeline and agenda buffers.}.  When
2856 used several times in succession, it will still cycle through all names,
2857 in order to first select the right type for a task.  But when you return
2858 to the item after some time and execute @kbd{C-c C-t} again, it will
2859 switch from any name directly to DONE.  Use prefix arguments or
2860 completion to quickly select a specific name.  You can also review the
2861 items of a specific TODO type in a sparse tree by using a numeric prefix
2862 to @kbd{C-c C-v}.  For example, to see all things Lucy has to do, you
2863 would use @kbd{C-3 C-c C-v}.  To collect Lucy's items from all agenda
2864 files into a single buffer, you would use the prefix arg as well when
2865 creating the global todo list: @kbd{C-3 C-c t}.
2867 @node Multiple sets in one file, Per file keywords, TODO types, TODO extensions
2868 @subsection Multiple keyword sets in one file
2869 @cindex todo keyword sets
2871 Sometimes you may want to use different sets of TODO keywords in
2872 parallel.  For example, you may want to have the basic
2873 @code{TODO}/@code{DONE}, but also a workflow for bug fixing, and a
2874 separate state indicating that an item has been canceled (so it is not
2875 DONE, but also does not require action).  Your setup would then look
2876 like this:
2878 @lisp
2879 (setq org-todo-keywords
2880       '((sequence "TODO" "|" "DONE")
2881         (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED")
2882         (sequence "|" "CANCELED")))
2883 @end lisp
2885 The keywords should all be different, this helps Org-mode to keep track
2886 of which subsequence should be used for a given entry.  In this setup,
2887 @kbd{C-c C-t} only operates within a subsequence, so it switches from
2888 @code{DONE} to (nothing) to @code{TODO}, and from @code{FIXED} to
2889 (nothing) to @code{REPORT}.  Therefore you need a mechanism to initially
2890 select the correct sequence.  Besides the obvious ways like typing a
2891 keyword or using completion, you may also apply the following commands:
2893 @table @kbd
2894 @kindex C-S-@key{right}
2895 @kindex C-S-@key{left}
2896 @item C-S-@key{right}
2897 @itemx C-S-@key{left}
2898 These keys jump from one TODO subset to the next.  In the above example,
2899 @kbd{C-S-@key{right}} would jump from @code{TODO} or @code{DONE} to
2900 @code{REPORT}, and any of the words in the second row to @code{CANCELED}.
2901 @kindex S-@key{right}
2902 @kindex S-@key{left}
2903 @item S-@key{right}
2904 @itemx S-@key{left}
2905 @kbd{S-@key{<left>}} and @kbd{S-@key{<right>}} and walk through
2906 @emph{all} keywords from all sets, so for example @kbd{S-@key{<right>}}
2907 would switch from @code{DONE} to @code{REPORT} in the example above.
2908 @end table
2910 @node Per file keywords,  , Multiple sets in one file, TODO extensions
2911 @subsection Setting up keywords for individual files
2912 @cindex keyword options
2913 @cindex per file keywords
2915 It can be very useful to use different aspects of the TODO mechanism in
2916 different files.  For file-local settings, you need to add special lines
2917 to the file which set the keywords and interpretation for that file
2918 only.  For example, to set one of the two examples discussed above, you
2919 need one of the following lines, starting in column zero anywhere in the
2920 file:
2922 @example
2923 #+SEQ_TODO: TODO FEEDBACK VERIFY | DONE CANCELED
2924 @end example
2926 @example
2927 #+TYP_TODO: Fred Sara Lucy Mike | DONE
2928 @end example
2930 A setup for using several sets in parallel would be:
2932 @example
2933 #+SEQ_TODO: "TODO" "|" "DONE"
2934 #+SEQ_TODO: "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED"
2935 #+SEQ_TODO: "|" "CANCELED"
2936 @end example
2939 @cindex completion, of option keywords
2940 @kindex M-@key{TAB}
2941 @noindent To make sure you are using the correct keyword, type
2942 @samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
2944 @cindex DONE, final TODO keyword
2945 Remember that the keywords after the vertical bar (or the last keyword
2946 if no bar is there) must always mean that the item is DONE (although you
2947 may use a different word).  After changing one of these lines, use
2948 @kbd{C-c C-c} with the cursor still in the line to make the changes
2949 known to Org-mode@footnote{Org-mode parses these lines only when
2950 Org-mode is activated after visiting a file.  @kbd{C-c C-c} with the
2951 cursor in a line starting with @samp{#+} is simply restarting Org-mode
2952 for the current buffer.}.
2954 @node Priorities, Breaking down tasks, TODO extensions, TODO items
2955 @section Priorities
2956 @cindex priorities
2958 If you use Org-mode extensively to organize your work, you may end up
2959 with a number of TODO entries so large that you'd like to prioritize
2960 them.  This can be done by placing a @emph{priority cookie} into the
2961 headline, like this
2963 @example
2964 *** TODO [#A] Write letter to Sam Fortune
2965 @end example
2967 @noindent
2968 With its standard setup, Org-mode supports priorities @samp{A},
2969 @samp{B}, and @samp{C}.  @samp{A} is the highest priority.  An entry
2970 without a cookie is treated as priority @samp{B}.  Priorities make a
2971 difference only in the agenda (@pxref{Weekly/Daily agenda}).
2973 @table @kbd
2974 @kindex @kbd{C-c ,}
2975 @item @kbd{C-c ,}
2976 Set the priority of the current headline.  The command prompts for a
2977 priority character @samp{A}, @samp{B} or @samp{C}.  When you press
2978 @key{SPC} instead, the priority cookie is removed from the headline.
2979 The priorities can also be changed ``remotely'' from the timeline and
2980 agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
2982 @kindex S-@key{up}
2983 @kindex S-@key{down}
2984 @item S-@key{up}
2985 @itemx S-@key{down}
2986 Increase/decrease priority of current headline.  Note that these keys
2987 are also used to modify time stamps (@pxref{Creating timestamps}).
2988 Furthermore, these keys are also used by CUA-mode (@pxref{Conflicts}).
2989 @end table
2991 You can change the range of allowed priorities by setting the variables
2992 @code{org-highest-priority}, @code{org-lowest-priority}, and
2993 @code{org-default-priority}.  For an individual buffer, you may set
2994 these values (highest, lowest, default) like this (please make sure that
2995 the highest priority is earlier in the alphabet than the lowest
2996 priority):
2998 @example
2999 #+PRIORITIES: A C B
3000 @end example
3002 @node Breaking down tasks, Checkboxes, Priorities, TODO items
3003 @section Breaking tasks down into subtasks
3004 @cindex tasks, breaking down
3006 It is often advisable to break down large tasks into smaller, manageable
3007 subtasks.  You can do this by creating an outline tree below a TODO
3008 item, with detailed subtasks on the tree@footnote{To keep subtasks out
3009 of the global TODO list, see the
3010 @code{org-agenda-todo-list-sublevels}.}.  Another possibility is the use
3011 of checkboxes to identify (a hierarchy of) a large number of subtasks
3012 (@pxref{Checkboxes}).
3015 @node Checkboxes,  , Breaking down tasks, TODO items
3016 @section Checkboxes
3017 @cindex checkboxes
3019 Every item in a plain list (@pxref{Plain lists}) can be made a checkbox
3020 by starting it with the string @samp{[ ]}.  This feature is similar to
3021 TODO items (@pxref{TODO items}), but more lightweight.  Checkboxes are
3022 not included into the global TODO list, so they are often great to split
3023 a task into a number of simple steps.  Or you can use them in a shopping
3024 list.  To toggle a checkbox, use @kbd{C-c C-c}, or try Piotr Zielinski's
3025 @file{org-mouse.el}.  Here is an example of a checkbox list.
3027 @example
3028 * TODO Organize party [3/6]
3029   - call people [1/3]
3030     - [ ] Peter
3031     - [X] Sarah
3032     - [ ] Sam
3033   - [X] order food
3034   - [ ] think about what music to play
3035   - [X] talk to the neighbors
3036 @end example
3038 @cindex statistics, for checkboxes
3039 @cindex checkbox statistics
3040 The @samp{[3/6]} and @samp{[1/3]} in the first and second line are
3041 cookies indicating how many checkboxes are present in this entry, and
3042 how many of them have been checked off.  This can give you an idea on
3043 how many checkboxes remain, even without opening a folded entry.  The
3044 cookies can be placed into a headline or into (the first line of) a
3045 plain list item. Each cookie covers all checkboxes structurally below
3046 that headline/item.  You have to insert the cookie yourself by typing
3047 either @samp{[/]} or @samp{[%]}.  In the first case you get an @samp{n
3048 out of m} result, in the second case you get information about the
3049 percentage of checkboxes checked (in the above example, this would be
3050 @samp{[50%]} and @samp{[33%], respectively}).
3052 @noindent The following commands work with checkboxes:
3054 @table @kbd
3055 @kindex C-c C-c
3056 @item C-c C-c
3057 Toggle checkbox at point.  With prefix argument, set it to @samp{[-]},
3058 which is considered to be an intermediate state.
3059 @kindex C-c C-x C-b
3060 @item C-c C-x C-b
3061 Toggle checkbox at point.
3062 @itemize @minus
3063 @item
3064 If there is an active region, toggle the first checkbox in the region
3065 and set all remaining boxes to the same status as the first.  If you
3066 want to toggle all boxes in the region independently, use a prefix
3067 argument.
3068 @item
3069 If the cursor is in a headline, toggle checkboxes in the region between
3070 this headline and the next (so @emph{not} the entire subtree).
3071 @item
3072 If there is no active region, just toggle the checkbox at point.
3073 @end itemize
3074 @kindex M-S-@key{RET}
3075 @item M-S-@key{RET}
3076 Insert a new item with a checkbox.
3077 This works only if the cursor is already in a plain list item
3078 (@pxref{Plain lists}).
3079 @kindex C-c #
3080 @item C-c #
3081 Update the checkbox statistics in the current outline entry.  When
3082 called with a @kbd{C-u} prefix, update the entire file.  Checkbox
3083 statistic cookies are updated automatically if you toggle checkboxes
3084 with @kbd{C-c C-c} and make new ones with @kbd{M-S-@key{RET}}.  If you
3085 delete boxes or add/change them by hand, use this command to get things
3086 back into synch.  Or simply toggle any checkbox twice with @kbd{C-c C-c}.
3087 @end table
3090 @node Tags, Properties and columns, TODO items, Top
3091 @chapter Tags
3092 @cindex tags
3093 @cindex headline tagging
3094 @cindex matching, tags
3095 @cindex sparse tree, tag based
3097 If you wish to implement a system of labels and contexts for
3098 cross-correlating information, an excellent way is to assign @i{tags} to
3099 headlines.  Org-mode has extensive support for using tags.
3101 Every headline can contain a list of tags, at the end of the headline.
3102 Tags are normal words containing letters, numbers, @samp{_}, and
3103 @samp{@@}.  Tags must be preceded and followed by a single colon; like
3104 @samp{:WORK:}.  Several tags can be specified like @samp{:WORK:URGENT:}.
3106 @menu
3107 * Tag inheritance::             Tags use the tree structure of the outline
3108 * Setting tags::                How to assign tags to a headline
3109 * Tag searches::                Searching for combinations of tags
3110 @end menu
3112 @node Tag inheritance, Setting tags, Tags, Tags
3113 @section Tag inheritance
3114 @cindex inheritance, of tags
3115 @cindex sublevels, inclusion into tags match
3117 @i{Tags} make use of the hierarchical structure of outline trees.  If a
3118 heading has a certain tag, all subheadings will inherit the tag as
3119 well.  For example, in the list
3121 @example
3122 * Meeting with the French group      :WORK:
3123 ** Summary by Frank                  :BOSS:NOTES:
3124 *** TODO Prepare slides for him      :ACTION:
3125 @end example
3127 @noindent
3128 the final heading will have the tags @samp{:WORK:}, @samp{:BOSS:},
3129 @samp{:NOTES:}, and @samp{:ACTION:}.  When executing tag searches and
3130 Org-mode finds that a certain headline matches the search criterion, it
3131 will not check any sublevel headline, assuming that these likely also
3132 match, and that the list of matches can become very long.  This may
3133 not be what you want, however, and you can influence inheritance and
3134 searching using the variables @code{org-use-tag-inheritance} and
3135 @code{org-tags-match-list-sublevels}.
3137 @node Setting tags, Tag searches, Tag inheritance, Tags
3138 @section Setting tags
3139 @cindex setting tags
3140 @cindex tags, setting
3142 @kindex M-@key{TAB}
3143 Tags can simply be typed into the buffer at the end of a headline.
3144 After a colon, @kbd{M-@key{TAB}} offers completion on tags.  There is
3145 also a special command for inserting tags:
3147 @table @kbd
3148 @kindex C-c C-c
3149 @item C-c C-c
3150 @cindex completion, of tags
3151 Enter new tags for the current headline.  Org-mode will either offer
3152 completion or a special single-key interface for setting tags, see
3153 below.  After pressing @key{RET}, the tags will be inserted and aligned
3154 to @code{org-tags-column}.  When called with a @kbd{C-u} prefix, all
3155 tags in the current buffer will be aligned to that column, just to make
3156 things look nice.  TAGS are automatically realigned after promotion,
3157 demotion, and TODO state changes (@pxref{TODO basics}).
3158 @end table
3160 Org will support tag insertion based on a @emph{list of tags}.  By
3161 default this list is constructed dynamically, containing all tags
3162 currently used in the buffer.  You may also globally specify a hard list
3163 of tags with the variable @code{org-tag-alist}.  Finally you can set
3164 the default tags for a given file with lines like
3166 @example
3167 #+TAGS: @@WORK @@HOME @@TENNISCLUB
3168 #+TAGS: Laptop Car PC Sailboat
3169 @end example
3171 If you have globally defined your preferred set of tags using the
3172 variable @code{org-tag-alist}, but would like to use a dynamic tag list
3173 in a specific file: Just add an empty TAGS option line to that file:
3175 @example
3176 #+TAGS:
3177 @end example
3179 The default support method for entering tags is minibuffer completion.
3180 However, Org-mode also implements a much better method: @emph{fast tag
3181 selection}.  This method allows to select and deselect tags with a
3182 single key per tag.  To function efficiently, you should assign unique
3183 keys to most tags.  This can be done globally with
3185 @lisp
3186 (setq org-tag-alist '(("@@WORK" . ?w) ("@@HOME" . ?h) ("Laptop" . ?l)))
3187 @end lisp
3189 @noindent or on a per-file basis with
3191 @example
3192 #+TAGS: @@WORK(w)  @@HOME(h)  @@TENNISCLUB(t)  Laptop(l)  PC(p)
3193 @end example
3195 @noindent
3196 You can also group together tags that are mutually exclusive.  With
3197 curly braces@footnote{In @code{org-mode-alist} use
3198 @code{'(:startgroup)} and @code{'(:endgroup)}, respectively.  Several
3199 groups are allowed.}
3201 @example
3202 #+TAGS: @{ @@WORK(w)  @@HOME(h)  @@TENNISCLUB(t) @}  Laptop(l)  PC(p)
3203 @end example
3205 @noindent you indicate that at most one of @samp{@@WORK}, @samp{@@HOME},
3206 and @samp{@@TENNISCLUB} should be selected.
3208 @noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
3209 these lines to activate any changes.
3211 If at least one tag has a selection key, pressing @kbd{C-c C-c} will
3212 automatically present you with a special interface, listing inherited
3213 tags, the tags of the current headline, and a list of all legal tags
3214 with corresponding keys@footnote{Keys will automatically be assigned to
3215 tags which have no configured keys.}.  In this interface, you can use
3216 the following keys:
3218 @table @kbd
3219 @item a-z...
3220 Pressing keys assigned to tags will add or remove them from the list of
3221 tags in the current line.  Selecting a tag in a group of mutually
3222 exclusive tags will turn off any other tags from that group.
3223 @kindex @key{TAB}
3224 @item @key{TAB}
3225 Enter a tag in the minibuffer, even if the tag is not in the predefined
3226 list.  You will be able to complete on all tags present in the buffer.
3227 @kindex @key{SPC}
3228 @item @key{SPC}
3229 Clear all tags for this line.
3230 @kindex @key{RET}
3231 @item @key{RET}
3232 Accept the modified set.
3233 @item C-g
3234 Abort without installing changes.
3235 @item q
3236 If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}.
3237 @item !
3238 Turn off groups of mutually exclusive tags.  Use this to (as an
3239 exception) assign several tags from such a group.
3240 @item C-c
3241 Toggle auto-exit after the next change (see below).
3242 If you are using expert mode, the first @kbd{C-c} will display the
3243 selection window.
3244 @end table
3246 @noindent
3247 This method lets you assign tags to a headline with very few keys.  With
3248 the above setup, you could clear the current tags and set @samp{@@HOME},
3249 @samp{Laptop} and @samp{PC} tags with just the following keys: @kbd{C-c
3250 C-c @key{SPC} h l p @key{RET}}.  Switching from @samp{@@HOME} to
3251 @samp{@@WORK} would be done with @kbd{C-c C-c w @key{RET}} or
3252 alternatively with @kbd{C-c C-c C-c w}.  Adding the non-predefined tag
3253 @samp{Sarah} could be done with @kbd{C-c C-c @key{TAB} S a r a h
3254 @key{RET} @key{RET}}.
3256 If you find that most of the time, you need only a single keypress to
3257 modify your list of tags, set the variable
3258 @code{org-fast-tag-selection-single-key}.  Then you no longer have to
3259 press @key{RET} to exit fast tag selection - it will immediately exit
3260 after the first change.  If you then occasionally need more keys, press
3261 @kbd{C-c} to turn off auto-exit for the current tag selection process
3262 (in effect: start selection with @kbd{C-c C-c C-c} instead of @kbd{C-c
3263 C-c}).  If you set the variable to the value @code{expert}, the special
3264 window is not even shown for single-key tag selection, it comes up only
3265 when you press an extra @kbd{C-c}.
3267 @node Tag searches,  , Setting tags, Tags
3268 @section Tag searches
3269 @cindex tag searches
3270 @cindex searching for tags
3272 Once a tags system has been set up, it can be used to collect related
3273 information into special lists.
3275 @table @kbd
3276 @kindex C-c \
3277 @item C-c \
3278 Create a sparse tree with all headlines matching a tags search.  With a
3279 @kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
3280 @kindex C-c a m
3281 @item C-c a m
3282 Create a global list of tag matches from all agenda files.
3283 @xref{Matching tags and properties}.
3284 @kindex C-c a M
3285 @item C-c a M
3286 Create a global list of tag matches from all agenda files, but check
3287 only TODO items and force checking subitems (see variable
3288 @code{org-tags-match-list-sublevels}).
3289 @end table
3291 @cindex Boolean logic, for tag searches
3292 A @i{tags} search string can use Boolean operators @samp{&} for AND and
3293 @samp{|} for OR.  @samp{&} binds more strongly than @samp{|}.
3294 Parenthesis are currently not implemented.  A tag may also be preceded
3295 by @samp{-}, to select against it, and @samp{+} is syntactic sugar for
3296 positive selection.  The AND operator @samp{&} is optional when @samp{+}
3297 or @samp{-} is present.  Examples:
3299 @table @samp
3300 @item +WORK-BOSS
3301 Select headlines tagged @samp{:WORK:}, but discard those also tagged
3302 @samp{:BOSS:}.
3303 @item WORK|LAPTOP
3304 Selects lines tagged @samp{:WORK:} or @samp{:LAPTOP:}.
3305 @item WORK|LAPTOP&NIGHT
3306 Like before, but require the @samp{:LAPTOP:} lines to be tagged also
3307 @samp{NIGHT}.
3308 @end table
3310 @cindex TODO keyword matching, with tags search
3311 If you are using multi-state TODO keywords (@pxref{TODO extensions}), it
3312 can be useful to also match on the TODO keyword.  This can be done by
3313 adding a condition after a slash to a tags match.  The syntax is similar
3314 to the tag matches, but should be applied with consideration: For
3315 example, a positive selection on several TODO keywords can not
3316 meaningfully be combined with boolean AND.  However, @emph{negative
3317 selection} combined with AND can be meaningful.  To make sure that only
3318 lines are checked that actually have any TODO keyword, use @kbd{C-c a
3319 M}, or equivalently start the todo part after the slash with @samp{!}.
3320 Examples:
3322 @table @samp
3323 @item WORK/WAITING
3324 Select @samp{:WORK:}-tagged TODO lines with the specific TODO
3325 keyword @samp{WAITING}.
3326 @item WORK/!-WAITING-NEXT
3327 Select @samp{:WORK:}-tagged TODO lines that are neither @samp{WAITING}
3328 nor @samp{NEXT}
3329 @item WORK/+WAITING|+NEXT
3330 Select @samp{:WORK:}-tagged TODO lines that are either @samp{WAITING} or
3331 @samp{NEXT}.
3332 @end table
3334 @cindex regular expressions, with tags search
3335 Any element of the tag/todo match can be a regular expression - in this
3336 case it must be enclosed in curly braces.  For example,
3337 @samp{WORK+@{^BOSS.*@}} matches headlines that contain the tag
3338 @samp{WORK} and any tag @i{starting} with @samp{BOSS}.
3340 @cindex level, require for tags match
3341 You can also require a headline to be of a certain level, by writing
3342 instead of any TAG an expression like @samp{LEVEL=3}.  For example, a
3343 search @samp{+LEVEL=3+BOSS/-DONE} lists all level three headlines that
3344 have the tag BOSS and are @emph{not} marked with the todo keyword DONE.
3346 @node Properties and columns, Timestamps, Tags, Top
3347 @chapter Properties and Columns
3348 @cindex properties
3350 Properties are a set of key-value pairs associated with an entry.  There
3351 are two main applications for properties in Org-mode.  First, properties
3352 are like tags, but with a value.  For example, in a file where you
3353 document bugs and plan releases of a piece of software, instead of using
3354 tags like @code{:release_1:}, @code{:release_2:}, it can be more
3355 efficient to use a property @code{RELEASE} with a value @code{1.0} or
3356 @code{2.0}.  Second, you can use properties to implement (very basic)
3357 database capabilities in an Org-mode buffer, for example to create a
3358 list of Music CD's you own.  You can edit and view properties
3359 conveniently in column view (@pxref{Column view}).
3361 @menu
3362 * Property syntax::             How properties are spelled out
3363 * Special properties::          Access to other Org-mode features
3364 * Property searches::           Matching property values
3365 * Column view::                 Tabular viewing and editing
3366 * Property API::                Properties for Lisp programmers
3367 @end menu
3369 @node Property syntax, Special properties, Properties and columns, Properties and columns
3370 @section Property Syntax
3371 @cindex property syntax
3372 @cindex drawer, for properties
3374 Properties are key-value pairs.  They need to be inserted into a special
3375 drawer (@pxref{Drawers}) with the name @code{PROPERTIES}.  Each property
3376 is specified on a single line, with the key (surrounded by colons)
3377 first, and the value after it.  Here is an example:
3379 @example
3380 * CD collection
3381 ** Classic
3382 *** Goldberg Variations
3383     :PROPERTIES:
3384     :Title:     Goldberg Variations
3385     :Composer:  J.S. Bach
3386     :Artist:    Glen Gould 
3387     :Publisher: Deutsche Grammphon
3388     :NDisks:    1
3389     :END:       
3390 @end example
3392 You may define the allowed values for a particular property @samp{XYZ}
3393 by setting a property @samp{XYZ_ALL}.  This special property is
3394 @emph{inherited}, so if you set it in a level 1 entry, it will apply to
3395 the entire tree.  When allowed values are defined, setting the
3396 corresponding property becomes easier and is less prone to typing
3397 errors.  For the example with the CD collection, we can predefine
3398 publishers and the number of disks in a box like this:
3400 @example
3401 * CD collection
3402   :PROPERTIES:
3403   :NDisks_ALL:  1 2 3 4
3404   :Publisher_ALL: "Deutsche Grammophon" Phillips EMI
3405   :END:
3406 @end example
3408 If you want to set properties that can be inherited by any entry in a
3409 file, use a line like
3411 @example
3412 #+PROPERTY: NDisks_ALL 1 2 3 4
3413 @end example
3415 Property values set with the global variable
3416 @code{org-global-properties} can be inherited by all entries in all
3417 Org-mode files.
3419 @noindent
3420 The following commands help to work with properties:
3422 @table @kbd
3423 @kindex M-@key{TAB}
3424 @item M-@key{TAB}
3425 After an initial colon in a line, complete property keys.  All keys used
3426 in the current file will be offered as possible completions.
3427 @item M-x org-insert-property-drawer
3428 Insert a property drawer into the current entry.  The drawer will be
3429 inserted early in the entry, but after the lines with planning
3430 information like deadlines.
3431 @kindex C-c C-c
3432 @item C-c C-c
3433 With the cursor in a property drawer, this executes property commands.
3434 @item C-c C-c s
3435 Set a property in the current entry.  Both the property and the value
3436 can be inserted using completion.
3437 @kindex S-@key{right}
3438 @kindex S-@key{left}
3439 @item S-@key{left}/@key{right}
3440 Switch property at point to the next/previous allowed value.
3441 @item C-c C-c d
3442 Remove a property from the current entry.
3443 @item C-c C-c D
3444 Globally remove a property, from all entries in the current file.
3445 @end table
3447 @node Special properties, Property searches, Property syntax, Properties and columns
3448 @section Special Properties
3449 @cindex properties, special
3451 Special properties provide alternative access method to Org-mode
3452 features discussed in the previous chapters, like the TODO state or the
3453 priority of an entry.  This interface exists so that you can include
3454 these states into columns view (@pxref{Column view}).  The following
3455 property names are special and should not be used as keys in the
3456 properties drawer:
3458 @example
3459 TODO         @r{The TODO keyword of the entry.}
3460 TAGS         @r{The tags defined directly in the headline.}
3461 ALLTAGS      @r{All tags, including inherited ones.}
3462 PRIORITY     @r{The priority of the entry, a string with a single letter.}
3463 DEADLINE     @r{The deadline time string, without the angular brackets.}
3464 SCHEDULED    @r{The scheduling time stamp, without the angular brackets.}
3465 @end example
3467 @node Property searches, Column view, Special properties, Properties and columns
3468 @section Property searches
3469 @cindex properties, searching
3471 To create sparse trees and special lists with selection based on
3472 properties, the same commands are used as for tag searches (@pxref{Tag
3473 searches}), and the same logic applies.  For example, a search string
3475 @example
3476 +WORK-BOSS+PRIORITY="A"+coffee="unlimited"+with=@{Sarah\|Denny@}
3477 @end example
3479 @noindent
3480 finds entries tagged @samp{:WORK:} but not @samp{:BOSS:}, which
3481 also have a priority value @samp{A}, a @samp{:coffee:} property with the
3482 value @samp{unlimited}, and a @samp{:with:} property that is matched by
3483 the regular expression @samp{Sarah\|Denny}.
3485 @node Column view, Property API, Property searches, Properties and columns
3486 @section Column View
3488 A great way to view and edit properties in an outline tree is
3489 @emph{column view}.  In column view, each outline item is turned into a
3490 table row.  Columns in this table provide access to properties of the
3491 entries.  Org-mode implements columns by overlaying a tabular structure
3492 over the headline of each item.  While the headlines have been turned
3493 into a table row, you can still change the visibility of the outline
3494 tree.  For example, you get a compact table by switching to CONTENTS
3495 view (@kbd{S-@key{TAB} S-@key{TAB}}, or simply @kbd{c} while column view
3496 is active), but you can still open, read, and edit the entry below each
3497 headline.  Or, you can switch to column view after executing a sparse
3498 tree command and in this way get a table only for the selected items.
3499 Column view also works in agenda buffers (@pxref{Agenda views}) where
3500 queries have collected selected items, possibly from a number of files.
3502 @menu
3503 * Defining columns::            The COLUMNS format property
3504 * Using column view::           How to create and use column view
3505 @end menu
3507 @node Defining columns, Using column view, Column view, Column view
3508 @subsection Defining Columns
3509 @cindex column view, for properties
3510 @cindex properties, column view
3512 Setting up a column view first requires defining the columns.  This is
3513 done by defining a column format line.
3515 @menu
3516 * Scope of column definitions::  Where defined, where valid?
3517 * Column attributes::           Appearance and content of a column
3518 @end menu
3520 @node Scope of column definitions, Column attributes, Defining columns, Defining columns
3521 @subsubsection Scope of column definitions
3523 To define a column format for an entire file, use a line like
3525 @example
3526 #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
3527 @end example
3529 To specify a format that only applies to a specific tree, add a COLUMNS
3530 property to the top node of that tree, for example
3531 @example
3532 ** Top node for columns view
3533    :PROPERTIES:
3534    :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
3535    :END:
3536 @end example
3538 If a @code{COLUMNS} property is present in an entry, it defines columns
3539 for the entry itself, and for the entire subtree below it.  Since the
3540 column definition is part of the hierarchical structure of the document,
3541 you can define columns on level 1 that are general enough for all
3542 sublevels, and more specific columns further down, when you edit a
3543 deeper part of the tree.
3545 @node Column attributes,  , Scope of column definitions, Defining columns
3546 @subsubsection Column attributes
3547 A column definition sets the attributes of a column.  The general
3548 definition looks like this:
3550 @example
3551  %[width]property[(title)][@{summary-type@}]
3552 @end example
3554 @noindent
3555 Except for the percent sign and the property name, all items are
3556 optional.  The individual parts have the following meaning:
3558 @example
3559 width           @r{An integer specifying the width of the column in characters.}
3560                 @r{If omitted, the width will be determined automatically.}
3561 property        @r{The property that should be edited in this column.}
3562 (title)         @r{The header text for the column. If omitted, the}
3563                 @r{property name is used.}
3564 @{summary-type@}  @r{The summary type.  If specified, the column values for}
3565                 @r{parent nodes are computed from the children.}
3566                 @r{Supported summary types are:}
3567                 @{+@}  @r{Sum numbers in this column.}
3568                 @{:@}  @r{Sum times, HH:MM:SS, plain numbers are hours.}
3569                 @{X@}  @r{Checkbox status, [X] if all children are [X].}
3570 @end example
3572 @noindent
3573 Here is an example for a complete columns definition, along with allowed
3574 values.
3576 @example
3577 :COLUMNS:  %20ITEM %9Approved(Approved?)@{X@} %Owner %11Status %10Time_Spent@{:@}
3578 :Owner_ALL:    Tammy Mark Karl Lisa Don
3579 :Status_ALL:   "In progress" "Not started yet" "Finished" ""
3580 :Approved_ALL: "[ ]" "[X]"
3581 @end example
3583 The first column, @samp{%25ITEM}, means the first 25 characters of the
3584 item itself, i.e. of the headline.  You probably always should start the
3585 column definition with the ITEM specifier.  The other specifiers create
3586 columns @samp{Owner} with a list of names as allowed values, for
3587 @samp{Status} with four different possible values, and for a checkbox
3588 field @samp{Approved}.  When no width is given after the @samp{%}
3589 character, the column will be exactly as wide as it needs to be in order
3590 to fully display all values.  The @samp{Approved} column does have a
3591 modified title (@samp{Approved?}, with a question mark).  Summaries will
3592 be created for the @samp{Time_Spent} column by adding time duration
3593 expressions like HH:MM, and for the @samp{Approved} column, by providing
3594 an @samp{[X]} status if all children have been checked.
3596 @node Using column view,  , Defining columns, Column view
3597 @subsection Using Column View
3599 @table @kbd
3600 @tsubheading{Turning column view on and off}
3601 @kindex C-c C-x C-c
3602 @item C-c C-x C-c
3603 Create the column view for the local environment.  This command searches
3604 the hierarchy, up from point, for a @code{COLUMNS} property that defines
3605 a format.  When one is found, the column view table is established for
3606 the entire tree, starting from the entry that contains the @code{COLUMNS}
3607 property.  If none is found, the format is taken from the @code{#+COLUMNS}
3608 line or from the variable @code{org-columns-default-format}, and column
3609 view is established for the current entry and its subtree.
3610 @kindex q
3611 @item q
3612 Exit column view.
3613 @tsubheading{Editing values}
3614 @item @key{left} @key{right} @key{up} @key{down}
3615 Move through the column view from field to field.
3616 @kindex S-@key{left}
3617 @kindex S-@key{right}
3618 @item  S-@key{left}/@key{right}
3619 Switch to the next/previous allowed value of the field.  For this, you
3620 have to have specified allowed values for a property.
3621 @kindex n
3622 @kindex p
3623 @itemx  n / p
3624 Same as @kbd{S-@key{left}/@key{right}}
3625 @kindex e
3626 @item e
3627 Edit the property at point.  For the special properties, this will
3628 invoke the same interface that you normally use to change that
3629 property.  For example, when editing a TAGS property, the tag completion
3630 or fast selection interface will pop up.
3631 @kindex v
3632 @item v
3633 View the full value of this property.  This is useful if the width of
3634 the column is smaller than that of the value.
3635 @kindex a
3636 @item a
3637 Edit the list of allowed values for this property.  If the list is found
3638 in the hierarchy, the modified values is stored there.  If no list is
3639 found, the new value is stored in the first entry that is part of the
3640 current column view.
3641 @tsubheading{Modifying the table structure}
3642 @kindex <
3643 @kindex >
3644 @item < / >
3645 Make the column narrower/wider by one character.
3646 @kindex S-M-@key{right}
3647 @item S-M-@key{right}
3648 Insert a new column, to the right of the current column.
3649 @kindex S-M-@key{left}
3650 @item S-M-@key{left}
3651 Delete the current column.
3652 @end table
3654 @node Property API,  , Column view, Properties and columns
3655 @section The Property API
3656 @cindex properties, API
3657 @cindex API, for properties
3659 There is a full API for accessing and changing properties.  This API can
3660 be used by Emacs Lisp programs to work with properties and to implement
3661 features based on them.  For more information see @ref{Using the
3662 property API}.
3664 @node Timestamps, Agenda views, Properties and columns, Top
3665 @chapter Timestamps
3666 @cindex time stamps
3667 @cindex date stamps
3669 Items can be labeled with timestamps to make them useful for project
3670 planning.
3672 @menu
3673 * Time stamps::                 Assigning a time to a tree entry
3674 * Creating timestamps::         Commands which insert timestamps
3675 * Deadlines and scheduling::    Planning your work
3676 * Progress logging::            Documenting when what work was done.
3677 @end menu
3680 @node Time stamps, Creating timestamps, Timestamps, Timestamps
3681 @section Time stamps, deadlines and scheduling
3682 @cindex time stamps
3683 @cindex ranges, time
3684 @cindex date stamps
3685 @cindex deadlines
3686 @cindex scheduling
3688 A time stamp is a specification of a date (possibly with time or a range
3689 of times) in a special format, either @samp{<2003-09-16 Tue>} or
3690 @samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue
3691 12:00-12:30>}@footnote{This is the standard ISO date/time format.  If
3692 you cannot get used to these, see @ref{Custom time format}}.  A time
3693 stamp can appear anywhere in the headline or body of an org-tree entry.
3694 Its presence causes entries to be shown on specific dates in the agenda
3695 (@pxref{Weekly/Daily agenda}).  We distinguish:
3697 @table @var
3698 @item Plain time stamp
3699 @cindex timestamp
3700 A simple time stamp just assigns a date/time to an item.  This is just
3701 like writing down an appointment in a paper agenda, or like writing down
3702 an event in a diary, when you want to take note of when something
3703 happened.  In the timeline and agenda displays, the headline of an entry
3704 associated with a plain time stamp will be shown exactly on that date.
3706 @example
3707 * Meet Peter at the movies <2006-11-01 Wed 19:15>
3708 * Discussion on climate change <2006-11-02 Thu 20:00-22:00>
3709 @end example
3711 @item Time stamp with repeater interval
3712 @cindex timestamp, with repeater interval
3713 A time stamp may contain a @emph{repeater interval}, indicating that it
3714 applies not only on the given date, but again and again after a certain
3715 interval of N days (d), weeks (w), months(m), or years(y).  The
3716 following will show up in the agenda every Wednesday:
3718 @example
3719 * Pick up Sam at school <2007-05-16 Wed 12:30 +1w>
3720 @end example
3722 @item Diary-style sexp entries
3723 For more complex date specifications, Org-mode supports using the
3724 special sexp diary entries implemented in the Emacs calendar/diary
3725 package.  For example
3727 @example
3728 * The nerd meeting on every 2nd Thursday of the month
3729   <%%(diary-float t 4 2)>
3730 @end example
3732 @item Time/Date range
3733 @cindex timerange
3734 @cindex date range
3735 Two time stamps connected by @samp{--} denote a range.  The headline
3736 will be shown on the first and last day of the range, and on any dates
3737 that are displayed and fall in the range.  Here is an example:
3739 @example
3740 ** Meeting in Amsterdam
3741    <2004-08-23 Mon>--<2004-08-26 Thu>
3742 @end example
3744 @item Inactive time stamp
3745 @cindex timestamp, inactive
3746 @cindex inactive timestamp
3747 Just like a plain time stamp, but with square brackets instead of
3748 angular ones.  These time stamps are inactive in the sense that they do
3749 @emph{not} trigger an entry to show up in the agenda.
3751 @example
3752 * Gillian comes late for the fifth time [2006-11-01 Wed]
3753 @end example
3755 @end table
3757 @node Creating timestamps, Deadlines and scheduling, Time stamps, Timestamps
3758 @section Creating timestamps
3759 @cindex creating timestamps
3760 @cindex timestamps, creating
3762 For Org-mode to recognize time stamps, they need to be in the specific
3763 format.  All commands listed below produce time stamps in the correct
3764 format.
3766 @table @kbd
3767 @kindex C-c .
3768 @item C-c .
3769 Prompt for a date and insert a corresponding time stamp.  When the
3770 cursor is at a previously used time stamp, it is updated to NOW.  When
3771 this command is used twice in succession, a time range is inserted.
3773 @kindex C-u C-c .
3774 @item C-u C-c .
3775 Like @kbd{C-c .}, but use the alternative format which contains date
3776 and time.  The default time can be rounded to multiples of 5 minutes,
3777 see the option @code{org-time-stamp-rounding-minutes}.
3779 @kindex C-c !
3780 @item C-c !
3781 Like @kbd{C-c .}, but insert an inactive time stamp that will not cause
3782 an agenda entry.
3784 @kindex C-c <
3785 @item C-c <
3786 Insert a time stamp corresponding to the cursor date in the Calendar.
3788 @kindex C-c >
3789 @item C-c >
3790 Access the Emacs calendar for the current date.  If there is a
3791 timestamp in the current line, goto the corresponding date
3792 instead.
3794 @kindex C-c C-o
3795 @item C-c C-o
3796 Access the agenda for the date given by the time stamp or -range at
3797 point (@pxref{Weekly/Daily agenda}).
3799 @kindex S-@key{left}
3800 @kindex S-@key{right}
3801 @item S-@key{left}
3802 @itemx S-@key{right}
3803 Change date at cursor by one day.  These key bindings conflict with
3804 CUA-mode (@pxref{Conflicts}).
3806 @kindex S-@key{up}
3807 @kindex S-@key{down}
3808 @item S-@key{up}
3809 @itemx S-@key{down}
3810 Change the item under the cursor in a timestamp.  The cursor can be on a
3811 year, month, day, hour or minute.  Note that if the cursor is in a
3812 headline and not at a time stamp, these same keys modify the priority of
3813 an item.  (@pxref{Priorities}). The key bindings also conflict with
3814 CUA-mode (@pxref{Conflicts}).
3816 @kindex C-c C-y
3817 @cindex evaluate time range
3818 @item C-c C-y
3819 Evaluate a time range by computing the difference between start and
3820 end.  With prefix arg, insert result after the time range (in a table:
3821 into the following column).
3822 @end table
3825 @menu
3826 * The date/time prompt::        How org-mode helps you entering date and time
3827 * Custom time format::          Making dates look differently
3828 @end menu
3830 @node The date/time prompt, Custom time format, Creating timestamps, Creating timestamps
3831 @subsection The date/time prompt
3832 @cindex date, reading in minibuffer
3833 @cindex time, reading in minibuffer
3835 When Org-mode prompts for a date/time, the prompt suggests to enter an
3836 ISO date.  But it will in fact accept any string containing some date
3837 and/or time information.  You can, for example, use @kbd{C-y} to paste a
3838 (possibly multi-line) string copied from an email message.  Org-mode
3839 will find whatever information is in there and will replace anything not
3840 specified with the current date and time.  For example:
3842 @example
3843   3-2-5         --> 2003-02-05
3844   feb 15        --> currentyear-02-15
3845   sep 12 9      --> 2009-09-12
3846   12:45         --> today 12:45
3847   22 sept 0:34  --> currentyear-09-22 0:34
3848   12            --> currentyear-currentmonth-12
3849   Fri           --> nearest Friday (today or later)
3850   +4            --> 4 days from now (if +N is the only thing given)
3851 @end example
3853 The function understands English month and weekday abbreviations.  If
3854 you want to use unabbreviated names and/or other languages, configure
3855 the variables @code{parse-time-months} and @code{parse-time-weekdays}.
3857 @cindex calendar, for selecting date
3858 Parallel to the minibuffer prompt, a calendar is popped up@footnote{If
3859 you don't need/want the calendar, configure the variable
3860 @code{org-popup-calendar-for-date-prompt}.}.  When you exit the date
3861 prompt, either by clicking on a date in the calendar, or by pressing
3862 @key{RET}, the date selected in the calendar will be combined with the
3863 information entered at the prompt.  You can control the calendar fully
3864 from the minibuffer:
3866 @table @kbd
3867 @kindex <
3868 @item <
3869 Scroll calendar backwards by one month.
3870 @kindex >
3871 @item >
3872 Scroll calendar forwards by one month.
3873 @kindex mouse-1
3874 @item mouse-1
3875 Select date by clicking on it.
3876 @kindex S-@key{right}
3877 @item S-@key{right}
3878 One day forward.
3879 @kindex S-@key{left}
3880 @item S-@key{left}
3881 One day back.
3882 @kindex S-@key{down}
3883 @item S-@key{down}
3884 One week forward.
3885 @kindex S-@key{up}
3886 @item S-@key{up}
3887 One week back.
3888 @kindex M-S-@key{right}
3889 @item M-S-@key{right}
3890 One month forward.
3891 @kindex M-S-@key{left}
3892 @item M-S-@key{left}
3893 One month back.
3894 @kindex @key{RET}
3895 @item @key{RET}
3896 Choose date in calendar (only if nothing was typed into minibuffer).
3897 @end table
3899 @node Custom time format,  , The date/time prompt, Creating timestamps
3900 @subsection Custom time format
3901 @cindex custom date/time format
3902 @cindex time format, custom
3903 @cindex date format, custom
3905 Org-mode uses the standard ISO notation for dates and times as it is
3906 defined in ISO 8601.  If you cannot get used to this and require another
3907 representation of date and time to keep you happy, you can get it by
3908 customizing the variables @code{org-display-custom-times} and
3909 @code{org-time-stamp-custom-formats}.
3911 @table @kbd
3912 @kindex C-c C-x C-t
3913 @item C-c C-x C-t
3914 Toggle the display of custom formats for dates and times.
3915 @end table
3917 @noindent
3918 Org-mode needs the default format for scanning, so the custom date/time
3919 format does not @emph{replace} the default format - instead it is put
3920 @emph{over} the default format using text properties.  This has the
3921 following consequences:
3922 @itemize @bullet
3923 @item 
3924 You cannot place the cursor onto a time stamp anymore, only before or
3925 after.
3926 @item
3927 The @kbd{S-@key{up}/@key{down}} keys can no longer be used to adjust
3928 each component of a time stamp.  If the cursor is at the beginning of
3929 the stamp, @kbd{S-@key{up}/@key{down}} will change the stamp by one day,
3930 just like @kbd{S-@key{left}/@key{right}}.  At the end of the stamp, the
3931 time will be changed by one minute.
3932 @item
3933 If the time stamp contains a range of clock times or a repeater, these
3934 will not be overlayed, but remain in the buffer as they were.
3935 @item
3936 When you delete a time stamp character-by-character, it will only
3937 disappear from the buffer after @emph{all} (invisible) characters
3938 belonging to the ISO timestamp have been removed.
3939 @item
3940 If the custom time stamp format is longer than the default and you are
3941 using dates in tables, table alignment will be messed up.  If the custom
3942 format is shorter, things do work as expected.
3943 @end itemize
3946 @node Deadlines and scheduling, Progress logging, Creating timestamps, Timestamps
3947 @section Deadlines and Scheduling
3949 A time stamp may be preceded by special keywords to facilitate planning
3950 of work:
3952 @table @var
3953 @item DEADLINE
3954 @cindex DEADLINE keyword
3955 The task (most likely a TODO item) is supposed to be finished on that
3956 date, and it will be listed then.  In addition, the compilation for
3957 @emph{today} will carry a warning about the approaching or missed
3958 deadline, starting @code{org-deadline-warning-days} before the due date,
3959 and continuing until the entry is marked DONE.  An example:
3961 @example
3962 *** TODO write article about the Earth for the Guide
3963     The editor in charge is [[bbdb:Ford Prefect]]
3964     DEADLINE: <2004-02-29 Sun>
3965 @end example
3967 You can specify a different lead time for warnings for a specific
3968 deadlines using the following syntax.  Here is an example with a warning
3969 period of 5 days @code{DEADLINE: <2004-02-29 Sun -5d>}.
3971 @item SCHEDULED
3972 @cindex SCHEDULED keyword
3973 You are planning to start working on that task on the given date. The
3974 headline will be listed under the given date@footnote{It will still be
3975 listed on that date after it has been marked DONE.  If you don't like
3976 this, set the variable @code{org-agenda-skip-scheduled-if-done}.}.  In
3977 addition, a reminder that the scheduled date has passed will be present
3978 in the compilation for @emph{today}, until the entry is marked DONE.
3979 I.e., the task will automatically be forwarded until completed.
3981 @example
3982 *** TODO Call Trillian for a date on New Years Eve.
3983     SCHEDULED: <2004-12-25 Sat>
3984 @end example
3985 @end table
3987 @menu
3988 * Inserting deadline/schedule::  Planning items
3989 * Repeated tasks::              Items that show up again and again
3990 @end menu
3992 @node Inserting deadline/schedule, Repeated tasks, Deadlines and scheduling, Deadlines and scheduling
3993 @subsection Inserting deadline/schedule
3995 The following commands allow to quickly insert a deadline or to schedule
3996 an item:
3998 @table @kbd
4000 @kindex C-c C-d
4001 @item C-c C-d
4002 Insert @samp{DEADLINE} keyword along with a stamp.  The insertion will
4003 happen in the line directly following the headline.
4004 @c FIXME Any CLOSED timestamp will be removed.????????
4006 @kindex C-c C-w
4007 @cindex sparse tree, for deadlines
4008 @item C-c C-w
4009 Create a sparse tree with all deadlines that are either past-due, or
4010 which will become due within @code{org-deadline-warning-days}.
4011 With @kbd{C-u} prefix, show all deadlines in the file.  With a numeric
4012 prefix, check that many days.  For example, @kbd{C-1 C-c C-w} shows
4013 all deadlines due tomorrow.
4015 @kindex C-c C-s
4016 @item C-c C-s
4017 Insert @samp{SCHEDULED} keyword along with a stamp.  The insertion will
4018 happen in the line directly following the headline.  Any CLOSED
4019 timestamp will be removed.
4020 @end table
4022 @node Repeated tasks,  , Inserting deadline/schedule, Deadlines and scheduling
4023 @subsection Repeated Tasks
4025 Some tasks need to be repeated again and again, and Org-mode therefore
4026 allows to use a repeater in a DEADLINE or SCHEDULED time stamp, for
4027 example:
4028 @example
4029 ** TODO Pay the rent
4030    DEADLINE: <2005-10-01 Sat +1m>
4031 @end example
4033 Deadlines and scheduled items produce entries in the agenda when they
4034 are over-due, so it is important to be able to mark such an entry as
4035 completed once you have done so.  When you mark a DEADLINE or a SCHEDULE
4036 with the todo keyword DONE, it will no longer produce entries in the
4037 agenda. The problem with this is, however, that then also the
4038 @emph{next} instance of the repeated entry will not be active.  Org-mode
4039 deals with this in the following way: When you try to mark such an entry
4040 DONE (using @kbd{C-c C-t}), it will shift the base date of the repeating
4041 time stamp by the repeater interval, and immediately set the entry state
4042 back to TODO.  In the example above, setting the state to DONE would
4043 actually switch the date like this:
4045 @example
4046 ** TODO Pay the rent
4047    DEADLINE: <2005-11-01 Tue +1m>
4048 @end example
4050 You will also be prompted for a note that will be put under the DEADLINE
4051 line to keep a record that you actually acted on the previous instance
4052 of this deadline.
4054 As a consequence of shifting the base date, this entry will no longer be
4055 visible in the agenda when checking past dates, but all future instances
4056 will be visible.
4058 You may have both scheduling and deadline information for a specific
4059 task - just make sure that the repeater intervals on both are the same.
4061 @node Progress logging,  , Deadlines and scheduling, Timestamps
4062 @section Progress Logging
4063 @cindex progress logging
4064 @cindex logging, of progress
4066 Org-mode can automatically record a time stamp when you mark a TODO item
4067 as DONE, or even each time when you change the state of a TODO item.
4068 You can also measure precisely the time you spent on specific items in a
4069 project by starting and stopping a clock when you start and stop working
4070 on an aspect of a project.
4072 @menu
4073 * Closing items::               When was this entry marked DONE?
4074 * Tracking TODO state changes::  When did the status change?
4075 * Clocking work time::          When exactly did you work on this item?
4076 @end menu
4078 @node Closing items, Tracking TODO state changes, Progress logging, Progress logging
4079 @subsection Closing items
4081 If you want to keep track of @emph{when} a certain TODO item was
4082 finished, turn on logging with@footnote{The corresponding in-buffer
4083 setting is: @code{#+STARTUP: logdone}}
4085 @lisp
4086 (setq org-log-done t)
4087 @end lisp
4089 @noindent
4090 Then each time you turn a TODO entry into DONE using either @kbd{C-c
4091 C-t} in the Org-mode buffer or @kbd{t} in the agenda buffer, a line
4092 @samp{CLOSED: [timestamp]} will be inserted just after the headline.  If
4093 you turn the entry back into a TODO item through further state cycling,
4094 that line will be removed again.  In the timeline (@pxref{Timeline}) and
4095 in the agenda (@pxref{Weekly/Daily agenda}), you can then use the
4096 @kbd{l} key to display the TODO items closed on each day, giving you an
4097 overview of what has been done on a day.  If you want to record a note
4098 along with the timestamp, use@footnote{The corresponding in-buffer
4099 setting is: @code{#+STARTUP: lognotedone}}
4101 @lisp
4102 (setq org-log-done '(done))
4103 @end lisp
4105 @node Tracking TODO state changes, Clocking work time, Closing items, Progress logging
4106 @subsection Tracking TODO state changes
4108 When TODO keywords are used as workflow states (@pxref{Workflow
4109 states}), you might want to keep track of when a state change occurred,
4110 and you may even want to attach notes to that state change.  With the
4111 setting
4113 @lisp
4114 (setq org-log-done '(state))
4115 @end lisp
4117 @noindent
4118 each state change will prompt you for a note that will be attached to
4119 the current headline.  Very likely you do not want this verbose tracking
4120 all the time, so it is probably better to configure this behavior with
4121 in-buffer options.  For example, if you are tracking purchases, put
4122 these into a separate file that starts with:
4124 @example
4125 #+SEQ_TODO: TODO ORDERED INVOICE PAYED RECEIVED SENT
4126 #+STARTUP: lognotestate
4127 @end example
4130 @node Clocking work time,  , Tracking TODO state changes, Progress logging
4131 @subsection Clocking work time
4133 Org-mode allows you to clock the time you spent on specific tasks in a
4134 project.  When you start working on an item, you can start the clock.
4135 When you stop working on that task, or when you mark the task done, the
4136 clock is stopped and the corresponding time interval is recorded.  It
4137 also computes the total time spent on each subtree of a project.
4139 @table @kbd
4140 @kindex C-c C-x C-i
4141 @item C-c C-x C-i
4142 Start the clock on the current item (clock-in).  This inserts the CLOCK
4143 keyword together with a timestamp.
4144 @kindex C-c C-x C-o
4145 @item C-c C-x C-o
4146 Stop the clock (clock-out).  The inserts another timestamp at the same
4147 location where the clock was last started.  It also directly computes
4148 the resulting time in inserts it after the time range as @samp{=>
4149 HH:MM}.  See the variable @code{org-log-done} for the possibility to
4150 record an additional note together with the clock-out time
4151 stamp@footnote{The corresponding in-buffer setting is: @code{#+STARTUP:
4152 lognoteclock-out}}.
4153 @kindex C-c C-y
4154 @item C-c C-y
4155 Recompute the time interval after changing one of the time stamps.  This
4156 is only necessary if you edit the time stamps directly.  If you change
4157 them with @kbd{S-@key{cursor}} keys, the update is automatic.
4158 @kindex C-c C-t
4159 @item C-c C-t
4160 Changing the TODO state of an item to DONE automatically stops the clock
4161 if it is running in this same item.
4162 @kindex C-c C-x C-x
4163 @item C-c C-x C-x
4164 Cancel the current clock.  This is useful if a clock was started by
4165 mistake, or if you ended up working on something else.
4166 @kindex C-c C-x C-d
4167 @item C-c C-x C-d
4168 Display time summaries for each subtree in the current buffer.  This
4169 puts overlays at the end of each headline, showing the total time
4170 recorded under that heading, including the time of any subheadings. You
4171 can use visibility cycling to study the tree, but the overlays disappear
4172 when you change the buffer (see variable
4173 @code{org-remove-highlights-with-change}) or press @kbd{C-c C-c}.
4174 @kindex C-c C-x C-r
4175 @item C-c C-x C-r
4176 Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock
4177 report as an org-mode table into the current file.
4178 @example
4179 #+BEGIN: clocktable :maxlevel 2 :emphasize nil
4181 #+END: clocktable
4182 @end example
4183 @noindent
4184 If such a block already exists, its content is replaced by the new
4185 table.  The @samp{BEGIN} line can specify options:
4186 @example
4187 :maxlevels   @r{Maximum level depth to which times are listed in the table.}
4188 :emphasize   @r{When @code{t}, emphasize level one and level two items}
4189 :block       @r{The time block to consider.  This block is specified relative}
4190              @r{to the current time and may be any of these keywords:}
4191              @r{@code{today}, @code{yesterday}, @code{thisweek}, @code{lastweek},}
4192              @r{@code{thismonth}, @code{lastmonth}, @code{thisyear}, or @code{lastyear}}.
4193 :tstart      @r{A time string specifying when to start considering times}
4194 :tend        @r{A time string specifying when to stop considering times}
4195 @end example
4196 So to get a clock summary for the current day, you could write
4197 @example
4198 #+BEGIN: clocktable :maxlevel 2 :block today
4200 #+END: clocktable
4201 @end example
4202 and to use a specific time range you could write@footnote{Note that all
4203 parameters must be specified in a single line - the line is broken here
4204 only to fit it onto the manual.}
4205 @example
4206 #+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>" 
4207                     :tend "<2006-08-10 Thu 12:00>"
4209 #+END: clocktable
4210 @end example
4211 @kindex C-u C-c C-x C-u
4212 @item C-u C-c C-x C-u
4213 Update all dynamic blocks (@pxref{Dynamic blocks}).  This is useful if
4214 you have several clocktable blocks in a buffer.
4215 @end table
4217 The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
4218 the agenda (@pxref{Weekly/Daily agenda}) to show which tasks have been
4219 worked on or closed during a day.
4221 @node Agenda views, Embedded LaTeX, Timestamps, Top
4222 @chapter Agenda Views
4223 @cindex agenda views
4225 Due to the way Org-mode works, TODO items, time-stamped items, and
4226 tagged headlines can be scattered throughout a file or even a number of
4227 files.  To get an overview over open action items, or over events that
4228 are important for a particular date, this information must be collected,
4229 sorted and displayed in an organized way.
4231 Org-mode can select items based on various criteria, and display them
4232 in a separate buffer.  Six different view types are provided:
4234 @itemize @bullet
4235 @item
4236 an @emph{agenda} that is like a calendar and shows information
4237 for specific dates,
4238 @item
4239 a @emph{TODO list} that covers all unfinished
4240 action items,
4241 @item
4242 a @emph{tags view}, showings headlines based on
4243 the tags associated with them,
4244 @item
4245 a @emph{timeline view} that shows all events in a single Org-mode file,
4246 in time-sorted view,
4247 @item
4248 a @emph{stuck projects view} showing projects that currently don't move
4249 along, and
4250 @item
4251 @emph{custom views} that are special tag/keyword searches and
4252 combinations of different views.
4253 @end itemize
4255 @noindent
4256 The extracted information is displayed in a special @emph{agenda
4257 buffer}.  This buffer is read-only, but provides commands to visit the
4258 corresponding locations in the original Org-mode files, and even to
4259 edit these files remotely.  
4261 Two variables control how the agenda buffer is displayed and whether the
4262 window configuration is restored when the agenda exits:
4263 @code{org-agenda-window-setup} and
4264 @code{org-agenda-restore-windows-after-quit}.
4266 @menu
4267 * Agenda files::                Files being searched for agenda information
4268 * Agenda dispatcher::           Keyboard access to agenda views
4269 * Built-in agenda views::       What is available out of the box?
4270 * Presentation and sorting::    How agenda items are prepared for display
4271 * Agenda commands::             Remote editing of org trees
4272 * Custom agenda views::         Defining special searches and views
4273 @end menu
4275 @node Agenda files, Agenda dispatcher, Agenda views, Agenda views
4276 @section Agenda files
4277 @cindex agenda files
4278 @cindex files for agenda
4280 The information to be shown is collected from all @emph{agenda files},
4281 the files listed in the variable @code{org-agenda-files}@footnote{If the
4282 value of that variable is not a list, but a single file name, then the
4283 list of agenda files will be maintained in that external file.}.  Thus even
4284 if you only work with a single Org-mode file, this file should be put
4285 into that list@footnote{When using the dispatcher, pressing @kbd{1}
4286 before selecting a command will actually limit the command to the
4287 current file, and ignore @code{org-agenda-files} until the next
4288 dispatcher command.}.  You can customize @code{org-agenda-files}, but
4289 the easiest way to maintain it is through the following commands
4291 @cindex files, adding to agenda list
4292 @table @kbd
4293 @kindex C-c [
4294 @item C-c [
4295 Add current file to the list of agenda files.  The file is added to
4296 the front of the list.  If it was already in the list, it is moved to
4297 the front.  With prefix arg, file is added/moved to the end.
4298 @kindex C-c ]
4299 @item C-c ]
4300 Remove current file from the list of agenda files.
4301 @kindex C-,
4302 @kindex C-'
4303 @item C-,
4304 @itemx C-'
4305 Cycle through agenda file list, visiting one file after the other.
4306 @end table
4308 @noindent
4309 The Org menu contains the current list of files and can be used
4310 to visit any of them.
4312 @node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda views
4313 @section The agenda dispatcher
4314 @cindex agenda dispatcher
4315 @cindex dispatching agenda commands
4316 The views are created through a dispatcher that should be bound to a
4317 global key, for example @kbd{C-c a} (@pxref{Installation}).  In the
4318 following we will assume that @kbd{C-c a} is indeed how the dispatcher
4319 is accessed and list keyboard access to commands accordingly.  After
4320 pressing @kbd{C-c a}, an additional letter is required to execute a
4321 command.  The dispatcher offers the following default commands:
4322 @table @kbd
4323 @item a
4324 Create the calendar-like agenda (@pxref{Weekly/Daily agenda}).
4325 @item t @r{/} T
4326 Create a list of all TODO items (@pxref{Global TODO list}).
4327 @item m @r{/} M
4328 Create a list of headlines matching a TAGS expression (@pxref{Matching
4329 tags and properties}).
4330 @item L
4331 Create the timeline view for the current buffer (@pxref{Timeline}).
4332 @item # @r{/} !
4333 Create a list of stuck projects (@pxref{Stuck projects}).
4334 @item 1
4335 Restrict an agenda command to the current buffer.  After pressing
4336 @kbd{1}, you still need to press the character selecting the command.
4337 @item 0
4338 If there is an active region, restrict the following agenda command to
4339 the region.  Otherwise, restrict it to the current subtree.  After
4340 pressing @kbd{0}, you still need to press the character selecting the
4341 command.
4342 @end table
4344 You can also define custom commands that will be accessible through the
4345 dispatcher, just like the default commands.  This includes the
4346 possibility to create extended agenda buffers that contain several
4347 blocks together, for example the weekly agenda, the global TODO list and
4348 a number of special tags matches.  @xref{Custom agenda views}.
4350 @node Built-in agenda views, Presentation and sorting, Agenda dispatcher, Agenda views
4351 @section The built-in agenda views
4353 In this section we describe the built-in views.
4355 @menu
4356 * Weekly/Daily agenda::         The calendar page with current tasks
4357 * Global TODO list::            All unfinished action items
4358 * Matching tags and properties::  Structured information with fine-tuned search
4359 * Timeline::                    Time-sorted view for single file
4360 * Stuck projects::              Find projects you need to review
4361 @end menu
4363 @node Weekly/Daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views
4364 @subsection The weekly/daily agenda
4365 @cindex agenda
4366 @cindex weekly agenda
4367 @cindex daily agenda
4369 The purpose of the weekly/daily @emph{agenda} is to act like a page of a
4370 paper agenda, showing all the tasks for the current week or day.
4372 @table @kbd
4373 @cindex org-agenda, command
4374 @kindex C-c a a
4375 @item C-c a a
4376 Compile an agenda for the current week from a list of org files.  The
4377 agenda shows the entries for each day.  With a @kbd{C-u} prefix (or
4378 when the variable @code{org-agenda-include-all-todo} is @code{t}), all
4379 unfinished TODO items (including those without a date) are also listed at
4380 the beginning of the buffer, before the first date.@*
4381 @end table
4383 Remote editing from the agenda buffer means, for example, that you can
4384 change the dates of deadlines and appointments from the agenda buffer.
4385 The commands available in the Agenda buffer are listed in @ref{Agenda
4386 commands}.
4388 @subsubheading Calendar/Diary integration
4389 @cindex calendar integration
4390 @cindex diary integration
4392 Emacs contains the calendar and diary by Edward M. Reingold.  The
4393 calendar displays a three-month calendar with holidays from different
4394 countries and cultures.  The diary allows you to keep track of
4395 anniversaries, lunar phases, sunrise/set, recurrent appointments
4396 (weekly, monthly) and more.  In this way, it is quite complementary to
4397 Org-mode.  It can be very useful to combine output from Org-mode with
4398 the diary.
4400 In order to include entries from the Emacs diary into Org-mode's
4401 agenda, you only need to customize the variable
4403 @lisp
4404 (setq org-agenda-include-diary t)
4405 @end lisp
4407 @noindent After that, everything will happen automatically.  All diary
4408 entries including holidays, anniversaries etc will be included in the
4409 agenda buffer created by Org-mode.  @key{SPC}, @key{TAB}, and
4410 @key{RET} can be used from the agenda buffer to jump to the diary
4411 file in order to edit existing diary entries.  The @kbd{i} command to
4412 insert new entries for the current date works in the agenda buffer, as
4413 well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display
4414 Sunrise/Sunset times, show lunar phases and to convert to other
4415 calendars, respectively.  @kbd{c} can be used to switch back and forth
4416 between calendar and agenda.
4418 If you are using the diary only for sexp entries and holidays, it is
4419 faster to not use the above setting, but instead to copy or even move
4420 the entries into an Org-mode file. Org-mode evaluates diary-style sexp
4421 entries, and does it faster because there is no overhead for first
4422 creating the diary display.  Note that the sexp entries must start at
4423 the left margin, no white space is allowed before them.  For example,
4424 the following segment of an Org-mode file will be processed and entries
4425 will be made in the agenda:
4427 @example
4428 * Birthdays and similar stuff
4429 #+CATEGORY: Holiday
4430 %%(org-calendar-holiday)   ; special function for holiday names
4431 #+CATEGORY: Ann
4432 %%(diary-anniversary 14  5 1956) Arthur Dent is %d years old
4433 %%(diary-anniversary  2 10 1869) Mahatma Gandhi would be %d years old
4434 @end example
4436 @node Global TODO list, Matching tags and properties, Weekly/Daily agenda, Built-in agenda views
4437 @subsection The global TODO list
4438 @cindex global TODO list
4439 @cindex TODO list, global
4441 The global TODO list contains all unfinished TODO items, formatted and
4442 collected into a single place.
4444 @table @kbd
4445 @kindex C-c a t
4446 @item C-c a t
4447 Show the global TODO list.  This collects the TODO items from all
4448 agenda files (@pxref{Agenda views}) into a single buffer.  The buffer is in
4449 @code{agenda-mode}, so there are commands to examine and manipulate
4450 the TODO entries directly from that buffer (@pxref{Agenda commands}).
4451 @kindex C-c a T
4452 @item C-c a T
4453 @cindex TODO keyword matching
4454 Like the above, but allows selection of a specific TODO keyword.  You
4455 can also do this by specifying a prefix argument to @kbd{C-c a t}.  With
4456 a @kbd{C-u} prefix you are prompted for a keyword, and you may also
4457 specify several keywords by separating them with @samp{|} as boolean OR
4458 operator.  With a numeric prefix, the Nth keyword in
4459 @code{org-todo-keywords} is selected.
4460 @kindex r
4461 The @kbd{r} key in the agenda buffer regenerates it, and you can give
4462 a prefix argument to this command to change the selected TODO keyword,
4463 for example @kbd{3 r}.  If you often need a search for a specific
4464 keyword, define a custom command for it (@pxref{Agenda dispatcher}).@*
4465 Matching specific TODO keywords can also be done as part of a tags
4466 search (@pxref{Tag searches}).
4467 @end table
4469 Remote editing of TODO items means that you can change the state of a
4470 TODO entry with a single key press.  The commands available in the
4471 TODO list are described in @ref{Agenda commands}.
4473 @cindex sublevels, inclusion into todo list
4474 Normally the global todo list simply shows all headlines with TODO
4475 keywords.  This list can become very long.  There are two ways to keep
4476 it more compact:
4477 @itemize @minus
4478 @item
4479 Some people view a TODO item that has been @emph{scheduled} for
4480 execution (@pxref{Time stamps}) as no longer @emph{open}.  Configure the
4481 variable @code{org-agenda-todo-ignore-scheduled} to exclude scheduled
4482 items from the global TODO list.
4483 @item
4484 TODO items may have sublevels to break up the task into subtasks.  In
4485 such cases it may be enough to list only the highest level TODO headline
4486 and omit the sublevels from the global list.  Configure the variable
4487 @code{org-agenda-todo-list-sublevels} to get this behavior.
4488 @end itemize
4490 @node Matching tags and properties, Timeline, Global TODO list, Built-in agenda views
4491 @subsection Matching Tags and Properties
4492 @cindex matching, of tags
4493 @cindex matching, of properties
4494 @cindex tags view
4496 If headlines in the agenda files are marked with @emph{tags}
4497 (@pxref{Tags}), you can select headlines based on the tags that apply
4498 to them and collect them into an agenda buffer.
4500 @table @kbd
4501 @kindex C-c a m
4502 @item C-c a m
4503 Produce a list of all headlines that match a given set of tags.  The
4504 command prompts for a selection criterion, which is a boolean logic
4505 expression with tags, like @samp{+WORK+URGENT-WITHBOSS} or
4506 @samp{WORK|HOME} (@pxref{Tags}).  If you often need a specific search,
4507 define a custom command for it (@pxref{Agenda dispatcher}).
4508 @kindex C-c a M
4509 @item C-c a M
4510 Like @kbd{C-c a m}, but only select headlines that are also TODO items
4511 and force checking subitems (see variable
4512 @code{org-tags-match-list-sublevels}).  Matching specific todo keywords
4513 together with a tags match is also possible, see @ref{Tag searches}.
4514 @end table
4516 The commands available in the tags list are described in @ref{Agenda
4517 commands}.
4519 @node Timeline, Stuck projects, Matching tags and properties, Built-in agenda views
4520 @subsection Timeline for a single file
4521 @cindex timeline, single file
4522 @cindex time-sorted view
4524 The timeline summarizes all time-stamped items from a single Org-mode
4525 file in a @emph{time-sorted view}.  The main purpose of this command is
4526 to give an overview over events in a project.
4528 @table @kbd
4529 @kindex C-c a L
4530 @item C-c a L
4531 Show a time-sorted view of the org file, with all time-stamped items.
4532 When called with a @kbd{C-u} prefix, all unfinished TODO entries
4533 (scheduled or not) are also listed under the current date.
4534 @end table
4536 @noindent
4537 The commands available in the timeline buffer are listed in
4538 @ref{Agenda commands}.
4541 @node Stuck projects,  , Timeline, Built-in agenda views
4542 @subsection Stuck projects
4544 If you are following a system like David Allen's GTD to organize your
4545 work, one of the ``duties'' you have is a regular review to make sure
4546 that all projects move along.  A @emph{stuck} project is a project that
4547 has no defined next actions, so it will never show up in the TODO lists
4548 Org-mode produces.  During the review, you need to identify such
4549 projects and define next actions for them.
4551 @table @kbd
4552 @kindex C-c a #
4553 @item C-c a #
4554 List projects that are stuck.
4555 @kindex C-c a !
4556 @item C-c a !
4557 Customize the variable @code{org-stuck-projects} to define what a stuck
4558 project is and how to find it.
4559 @end table
4561 You almost certainly will have to configure this view before it will
4562 work for you.  The built-in default assumes that all your projects are
4563 level-2 headlines, and that a project is not stuck if it has at least
4564 one entry marked with a todo keyword TODO or NEXT or NEXTACTION.
4566 Lets assume that you, in your own way of using Org-mode, identify
4567 projects with a tag PROJECT, and that you use a todo keyword MAYBE to
4568 indicate a project that should not be considered yet.  Lets further
4569 assume that the todo keyword DONE marks finished projects, and that NEXT
4570 and TODO indicate next actions.  The tag @@SHOP indicates shopping and
4571 is a next action even without the NEXT tag.  Finally, if the project
4572 contains the special word IGNORE anywhere, it should not be listed
4573 either.  In this case you would start by identifying eligible projects
4574 with a tags/todo match @samp{+PROJECT/-MAYBE-DONE}, and then check for
4575 TODO, NEXT, @@SHOP, and IGNORE in the subtree to identify projects that
4576 are not stuck.  The correct customization for this is
4578 @lisp
4579 (setq org-stuck-projects
4580       '("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@@SHOP")
4581                                "\\<IGNORE\\>"))
4582 @end lisp
4585 @node Presentation and sorting, Agenda commands, Built-in agenda views, Agenda views
4586 @section Presentation and sorting
4587 @cindex presentation, of agenda items
4589 Before displaying items in an agenda view, Org-mode visually prepares
4590 the items and sorts them.  Each item occupies a single line.  The line
4591 starts with a @emph{prefix} that contains the @emph{category}
4592 (@pxref{Categories}) of the item and other important information.  You can
4593 customize the prefix using the option @code{org-agenda-prefix-format}.
4594 The prefix is followed by a cleaned-up version of the outline headline
4595 associated with the item.
4597 @menu
4598 * Categories::                  Not all tasks are equal
4599 * Time-of-day specifications::  How the agenda knows the time
4600 * Sorting of agenda items::     The order of things
4601 @end menu
4603 @node Categories, Time-of-day specifications, Presentation and sorting, Presentation and sorting
4604 @subsection Categories
4606 @cindex category
4607 The category is a broad label assigned to each agenda item.  By default,
4608 the category is simply derived from the file name, but you can also
4609 specify it with a special line in the buffer, like this:
4611 @example
4612 #+CATEGORY: Thesis
4613 @end example
4615 If there are several such lines in a file, each specifies the category
4616 for the text below it (but the first category also applies to any text
4617 before the first CATEGORY line).  The display in the agenda buffer looks
4618 best if the category is not longer than 10 characters.
4620 @node Time-of-day specifications, Sorting of agenda items, Categories, Presentation and sorting
4621 @subsection Time-of-Day Specifications
4622 @cindex time-of-day specification
4624 Org-mode checks each agenda item for a time-of-day specification.  The
4625 time can be part of the time stamp that triggered inclusion into the
4626 agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}.  Time
4627 ranges can be specified with two time stamps, like
4629 @w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
4631 In the headline of the entry itself, a time(range) may also appear as
4632 plain text (like @samp{12:45} or a @samp{8:30-1pm}.  If the agenda
4633 integrates the Emacs diary (@pxref{Weekly/Daily agenda}), time
4634 specifications in diary entries are recognized as well.
4636 For agenda display, Org-mode extracts the time and displays it in a
4637 standard 24 hour format as part of the prefix.  The example times in
4638 the previous paragraphs would end up in the agenda like this:
4640 @example
4641     8:30-13:00 Arthur Dent lies in front of the bulldozer
4642    12:45...... Ford Prefect arrives and takes Arthur to the pub
4643    19:00...... The Vogon reads his poem
4644    20:30-22:15 Marwin escorts the Hitchhikers to the bridge
4645 @end example
4647 @cindex time grid
4648 If the agenda is in single-day mode, or for the display of today, the
4649 timed entries are embedded in a time grid, like
4651 @example
4652     8:00...... ------------------
4653     8:30-13:00 Arthur Dent lies in front of the bulldozer
4654    10:00...... ------------------
4655    12:00...... ------------------
4656    12:45...... Ford Prefect arrives and takes Arthur to the pub
4657    14:00...... ------------------
4658    16:00...... ------------------
4659    18:00...... ------------------
4660    19:00...... The Vogon reads his poem
4661    20:00...... ------------------
4662    20:30-22:15 Marwin escorts the Hitchhikers to the bridge
4663 @end example
4665 The time grid can be turned on and off with the variable
4666 @code{org-agenda-use-time-grid}, and can be configured with
4667 @code{org-agenda-time-grid}.
4669 @node Sorting of agenda items,  , Time-of-day specifications, Presentation and sorting
4670 @subsection Sorting of agenda items
4671 @cindex sorting, of agenda items
4672 @cindex priorities, of agenda items
4673 Before being inserted into a view, the items are sorted.  How this is
4674 done depends on the type of view.
4675 @itemize @bullet
4676 @item
4677 For the daily/weekly agenda, the items for each day are sorted.  The
4678 default order is to first collect all items containing an explicit
4679 time-of-day specification.  These entries will be shown at the beginning
4680 of the list, as a @emph{schedule} for the day.  After that, items remain
4681 grouped in categories, in the sequence given by @code{org-agenda-files}.
4682 Within each category, items are sorted by priority (@pxref{Priorities}),
4683 which is composed of the base priority (2000 for priority @samp{A}, 1000
4684 for @samp{B}, and 0 for @samp{C}), plus additional increments for
4685 overdue scheduled or deadline items.
4686 @item 
4687 For the TODO list, items remain in the order of categories, but within
4688 each category, sorting takes place according to priority
4689 (@pxref{Priorities}).
4690 @item
4691 For tags matches, items are not sorted at all, but just appear in the
4692 sequence in which they are found in the agenda files.
4693 @end itemize
4695 Sorting can be customized using the variable
4696 @code{org-agenda-sorting-strategy}.
4699 @node Agenda commands, Custom agenda views, Presentation and sorting, Agenda views
4700 @section Commands in the agenda buffer
4701 @cindex commands, in agenda buffer
4703 Entries in the agenda buffer are linked back to the org file or diary
4704 file where they originate.  You are not allowed to edit the agenda
4705 buffer itself, but commands are provided to show and jump to the
4706 original entry location, and to edit the org-files ``remotely'' from
4707 the agenda buffer.  In this way, all information is stored only once,
4708 removing the risk that your agenda and note files may diverge.
4710 Some commands can be executed with mouse clicks on agenda lines.  For
4711 the other commands, the cursor needs to be in the desired line.
4713 @table @kbd
4714 @tsubheading{Motion}
4715 @cindex motion commands in agenda
4716 @kindex n
4717 @item n
4718 Next line (same as @key{up}).
4719 @kindex p
4720 @item p
4721 Previous line (same as @key{down}).
4722 @tsubheading{View/GoTo org file}
4723 @kindex mouse-3
4724 @kindex @key{SPC}
4725 @item mouse-3
4726 @itemx @key{SPC}
4727 Display the original location of the item in another window.
4729 @kindex L
4730 @item L
4731 Display original location and recenter that window.
4733 @kindex mouse-2
4734 @kindex mouse-1
4735 @kindex @key{TAB}
4736 @item mouse-2
4737 @itemx mouse-1
4738 @itemx @key{TAB}
4739 Go to the original location of the item in another window.  Under Emacs
4740 22, @kbd{mouse-1} will also works for this.
4742 @kindex @key{RET}
4743 @itemx @key{RET}
4744 Go to the original location of the item and delete other windows.
4746 @kindex f
4747 @item f
4748 Toggle Follow mode.  In Follow mode, as you move the cursor through
4749 the agenda buffer, the other window always shows the corresponding
4750 location in the org file.  The initial setting for this mode in new
4751 agenda buffers can be set with the variable
4752 @code{org-agenda-start-with-follow-mode}.
4754 @kindex b
4755 @item b
4756 Display the entire subtree of the current item in an indirect buffer.
4757 With numerical prefix ARG, go up to this level and then take that tree.
4758 If ARG is negative, go up that many levels.  With @kbd{C-u} prefix, do
4759 not remove the previously used indirect buffer.
4761 @kindex l
4762 @item l
4763 Toggle Logbook mode.  In Logbook mode, entries that where marked DONE while
4764 logging was on (variable @code{org-log-done}) are shown in the agenda,
4765 as are entries that have been clocked on that day.
4767 @tsubheading{Change display}
4768 @cindex display changing, in agenda
4769 @kindex o
4770 @item o
4771 Delete other windows.
4773 @kindex d
4774 @kindex w
4775 @kindex m
4776 @kindex y
4777 @item d w m y
4778 Switch to day/week/month/year view.  When switching to day or week view,
4779 this setting becomes the default for subseqent agenda commands.  Since
4780 month and year views are slow to create, the do not become the default.
4782 @kindex D
4783 @item D
4784 Toggle the inclusion of diary entries.  See @ref{Weekly/Daily agenda}.
4786 @kindex g
4787 @item g
4788 Toggle the time grid on and off.  See also the variables
4789 @code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
4791 @kindex r
4792 @item r
4793 Recreate the agenda buffer, for example to reflect the changes
4794 after modification of the time stamps of items with S-@key{left} and
4795 S-@key{right}.  When the buffer is the global todo list, a prefix
4796 argument is interpreted to create a selective list for a specific TODO
4797 keyword.
4799 @kindex s
4800 @item s
4801 Save all Org-mode buffers in the current Emacs session.
4803 @kindex @key{right}
4804 @item @key{right}
4805 Display the following @code{org-agenda-ndays} days.  For example, if
4806 the display covers a week, switch to the following week.  With prefix
4807 arg, go forward that many times @code{org-agenda-ndays} days.
4809 @kindex @key{left}
4810 @item @key{left}
4811 Display the previous dates.
4813 @kindex .
4814 @item .
4815 Goto today.
4817 @tsubheading{Remote editing}
4818 @cindex remote editing, from agenda
4820 @item 0-9
4821 Digit argument.
4823 @cindex undoing remote-editing events
4824 @cindex remote editing, undo
4825 @kindex C-_
4826 @item C-_
4827 Undo a change due to a remote editing command.  The change is undone
4828 both in the agenda buffer and in the remote buffer.
4830 @kindex t
4831 @item t
4832 Change the TODO state of the item, both in the agenda and in the
4833 original org file.
4835 @kindex C-k
4836 @item C-k
4837 Delete the current agenda item along with the entire subtree belonging
4838 to it in the original Org-mode file.  If the text to be deleted remotely
4839 is longer than one line, the kill needs to be confirmed by the user.  See
4840 variable @code{org-agenda-confirm-kill}.
4842 @kindex $
4843 @item $
4844 Archive the subtree corresponding to the current headline.
4846 @kindex T
4847 @item T
4848 Show all tags associated with the current item.  Because of
4849 inheritance, this may be more than the tags listed in the line itself.
4851 @kindex :
4852 @item :
4853 Set tags for the current headline.
4855 @kindex a
4856 @item a
4857 Toggle the ARCHIVE tag for the current headline.
4859 @kindex ,
4860 @item ,
4861 Set the priority for the current item.  Org-mode prompts for the
4862 priority character. If you reply with @key{SPC}, the priority cookie
4863 is removed from the entry.
4865 @kindex P
4866 @item P
4867 Display weighted priority of current item.
4869 @kindex +
4870 @kindex S-@key{up}
4871 @item +
4872 @itemx S-@key{up}
4873 Increase the priority of the current item.  The priority is changed in
4874 the original buffer, but the agenda is not resorted.  Use the @kbd{r}
4875 key for this.
4877 @kindex -
4878 @kindex S-@key{down}
4879 @item -
4880 @itemx S-@key{down}
4881 Decrease the priority of the current item.
4883 @kindex C-c C-s
4884 @item C-c C-s
4885 Schedule this item
4887 @kindex C-c C-d
4888 @item C-c C-d
4889 Set a deadline for this item.
4891 @kindex S-@key{right}
4892 @item S-@key{right}
4893 Change the time stamp associated with the current line by one day into
4894 the future.  With prefix argument, change it by that many days.  For
4895 example, @kbd{3 6 5 S-@key{right}} will change it by a year.  The
4896 stamp is changed in the original org file, but the change is not
4897 directly reflected in the agenda buffer.  Use the
4898 @kbd{r} key to update the buffer.
4900 @kindex S-@key{left}
4901 @item S-@key{left}
4902 Change the time stamp associated with the current line by one day
4903 into the past.
4905 @kindex >
4906 @item >
4907 Change the time stamp associated with the current line to today.
4908 The key @kbd{>} has been chosen, because it is the same as @kbd{S-.}
4909 on my keyboard.
4911 @kindex I
4912 @item I
4913 Start the clock on the current item.  If a clock is running already, it
4914 is stopped first.
4916 @kindex O
4917 @item O
4918 Stop the previously started clock.
4920 @kindex X
4921 @item X
4922 Cancel the currently running clock.
4924 @tsubheading{Calendar commands}
4925 @cindex calendar commands, from agenda
4926 @kindex c
4927 @item c
4928 Open the Emacs calendar and move to the date at the agenda cursor.
4930 @item c
4931 When in the calendar, compute and show the Org-mode agenda for the
4932 date at the cursor.
4934 @cindex diary entries, creating from agenda
4935 @kindex i
4936 @item i
4937 Insert a new entry into the diary.  Prompts for the type of entry
4938 (day, weekly, monthly, yearly, anniversary, cyclic) and creates a new
4939 entry in the diary, just as @kbd{i d} etc. would do in the calendar.
4940 The date is taken from the cursor position.
4942 @kindex M
4943 @item M
4944 Show the phases of the moon for the three months around current date.
4946 @kindex S
4947 @item S
4948 Show sunrise and sunset times.  The geographical location must be set
4949 with calendar variables, see documentation of the Emacs calendar.
4951 @kindex C
4952 @item C
4953 Convert the date at cursor into many other cultural and historic
4954 calendars.
4956 @kindex H
4957 @item H
4958 Show holidays for three month around the cursor date.
4960 @c FIXME:  This should be a different key.
4961 @kindex C-c C-x C-c
4962 @item C-c C-x C-c
4963 Export a single iCalendar file containing entries from all agenda files.
4965 @tsubheading{Exporting to a file}
4966 @kindex C-x C-w
4967 @item C-x C-w
4968 @cindex exporting agenda views
4969 @cindex agenda views, exporting
4970 Write the agenda view to a file.  Depending on the extension of the
4971 selected file name, the view will be exported as HTML (extension
4972 @file{.html} or @file{.htm}), Postscript (extension @file{.ps}), or
4973 plain text (any other extension).  Use the variable
4974 @code{org-agenda-exporter-settings} to set options for @file{ps-print}
4975 and for @file{htmlize} to be used during export.
4977 @tsubheading{Quit and Exit}
4978 @kindex q
4979 @item q
4980 Quit agenda, remove the agenda buffer.
4982 @kindex x
4983 @cindex agenda files, removing buffers
4984 @item x
4985 Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
4986 for the compilation of the agenda.  Buffers created by the user to
4987 visit org files will not be removed.
4988 @end table
4991 @node Custom agenda views,  , Agenda commands, Agenda views
4992 @section Custom agenda views
4993 @cindex custom agenda views
4994 @cindex agenda views, custom
4996 Custom agenda commands serve two purposes: to store and quickly access
4997 frequently used TODO and tags searches, and to create special composite
4998 agenda buffers.  Custom agenda commands will be accessible through the
4999 dispatcher (@pxref{Agenda dispatcher}), just like the default commands.
5001 @menu
5002 * Storing searches::            Type once, use often
5003 * Block agenda::                All the stuff you need in a single buffer
5004 * Setting Options::             Changing the rules
5005 * Exporting Agenda Views::      Writing agendas to files.
5006 * Extracting Agenda Information for other programs::  
5007 @end menu
5009 @node Storing searches, Block agenda, Custom agenda views, Custom agenda views
5010 @subsection Storing searches
5012 The first application of custom searches is the definition of keyboard
5013 shortcuts for frequently used searches, either creating an agenda
5014 buffer, or a sparse tree (the latter covering of course only the current
5015 buffer).
5016 @kindex C-c a C
5017 Custom commands are configured in the variable
5018 @code{org-agenda-custom-commands}.  You can customize this variable, for
5019 example by pressing @kbd{C-c a C}.  You can also directly set it with
5020 Emacs Lisp in @file{.emacs}.  The following example contains all valid
5021 search types:
5023 @lisp
5024 @group
5025 (setq org-agenda-custom-commands
5026       '(("w" todo "WAITING")
5027         ("W" todo-tree "WAITING")
5028         ("u" tags "+BOSS-URGENT")
5029         ("v" tags-todo "+BOSS-URGENT")
5030         ("U" tags-tree "+BOSS-URGENT")
5031         ("f" occur-tree "\\<FIXME\\>")))
5032 @end group
5033 @end lisp
5035 @noindent
5036 The initial single-character string in each entry defines the character
5037 you have to press after the dispatcher command @kbd{C-c a} in order to
5038 access the command.   The second parameter is the search type, followed
5039 by the string or regular expression to be used for the matching.  The
5040 example above will therefore define:
5042 @table @kbd
5043 @item C-c a w
5044 as a global search for TODO entries with @samp{WAITING} as the TODO
5045 keyword
5046 @item C-c a W
5047 as the same search, but only in the current buffer and displaying the
5048 results as a sparse tree
5049 @item C-c a u
5050 as a global tags search for headlines marked @samp{:BOSS:} but not
5051 @samp{:URGENT:}
5052 @item C-c a v
5053 as the same search as @kbd{C-c a u}, but limiting the search to
5054 headlines that are also TODO items
5055 @item C-c a U
5056 as the same search as @kbd{C-c a u}, but only in the current buffer and
5057 displaying the result as a sparse tree
5058 @item C-c a f
5059 to create a sparse tree (again: current buffer only) with all entries
5060 containing the word @samp{FIXME}.
5061 @end table
5063 @node Block agenda, Setting Options, Storing searches, Custom agenda views
5064 @subsection Block agenda
5065 @cindex block agenda
5066 @cindex agenda, with block views
5068 Another possibility is the construction of agenda views that comprise
5069 the results of @emph{several} commands, each of which creates a block in
5070 the agenda buffer.  The available commands include @code{agenda} for the
5071 daily or weekly agenda (as created with @kbd{C-c a a}), @code{alltodo}
5072 for the global todo list (as constructed with @kbd{C-c a t}), and the
5073 matching commands discussed above: @code{todo}, @code{tags}, and
5074 @code{tags-todo}.  Here are two examples:
5076 @lisp
5077 @group
5078 (setq org-agenda-custom-commands
5079       '(("h" "Agenda and Home-related tasks"
5080          ((agenda)
5081           (tags-todo "HOME")
5082           (tags "GARDEN")))
5083         ("o" "Agenda and Office-related tasks"
5084          ((agenda)
5085           (tags-todo "WORK")
5086           (tags "OFFICE")))))
5087 @end group
5088 @end lisp
5090 @noindent
5091 This will define @kbd{C-c a h} to create a multi-block view for stuff
5092 you need to attend to at home.  The resulting agenda buffer will contain
5093 your agenda for the current week, all TODO items that carry the tag
5094 @samp{HOME}, and also all lines tagged with @samp{GARDEN}.  Finally the
5095 command @kbd{C-c a o} provides a similar view for office tasks.
5098 @node Setting Options, Exporting Agenda Views, Block agenda, Custom agenda views
5099 @subsection Setting Options for custom commands
5100 @cindex options, for custom agenda views
5102 Org-mode contains a number of variables regulating agenda construction
5103 and display.  The global variables define the behavior for all agenda
5104 commands, including the custom commands.  However, if you want to change
5105 some settings just for a single custom view, you can do so.  Setting
5106 options requires inserting a list of variable names and values at the
5107 right spot in @code{org-agenda-custom-commands}.  For example:
5109 @lisp
5110 @group
5111 (setq org-agenda-custom-commands
5112       '(("w" todo "WAITING"
5113          ((org-agenda-sorting-strategy '(priority-down))
5114           (org-agenda-prefix-format "  Mixed: ")))
5115         ("U" tags-tree "+BOSS-URGENT"
5116          ((org-show-following-heading nil)
5117           (org-show-hierarchy-above nil)))))
5118 @end group
5119 @end lisp
5121 @noindent
5122 Now the @kbd{C-c a w} command will sort the collected entries only by
5123 priority, and the prefix format is modified to just say @samp{  Mixed:}
5124 instead of giving the category of the entry.  The sparse tags tree of
5125 @kbd{C-c a U} will now turn out ultra-compact, because neither the
5126 headline hierarchy above the match, nor the headline following the match
5127 will be shown.
5129 For command sets creating a block agenda,
5130 @code{org-agenda-custom-commands} has two separate spots for setting
5131 options.  You can add options that should be valid for just a single
5132 command in the set, and options that should be valid for all commands in
5133 the set.  The former are just added to the command entry, the latter
5134 must come after the list of command entries.  Going back to the block
5135 agenda example (@pxref{Block agenda}), let's change the sorting strategy
5136 for the @kbd{C-c a h} commands to @code{priority-down}, but let's sort
5137 the results for GARDEN tags query in the opposite order,
5138 @code{priority-up}.  This would look like this:
5140 @lisp
5141 @group
5142 (setq org-agenda-custom-commands
5143       '(("h" "Agenda and Home-related tasks"
5144          ((agenda)
5145           (tags-todo "HOME")
5146           (tags "GARDEN"
5147                 ((org-agenda-sorting-strategy '(priority-up)))))
5148          ((org-agenda-sorting-strategy '(priority-down))))
5149         ("o" "Agenda and Office-related tasks"
5150          ((agenda)
5151           (tags-todo "WORK")
5152           (tags "OFFICE")))))
5153 @end group
5154 @end lisp
5156 As you see, the values and parenthesis setting is a little complex.
5157 When in doubt, use the customize interface to set this variable - it
5158 fully supports its structure.  Just one caveat: When setting options in
5159 this interface, the @emph{values} are just lisp expressions.  So if the
5160 value is a string, you need to add the double quotes around the value
5161 yourself.
5164 @node Exporting Agenda Views, Extracting Agenda Information for other programs, Setting Options, Custom agenda views
5165 @subsection Exporting Agenda Views
5166 @cindex agenda views, exporting
5168 If you are away from your computer, it can be very useful to have a
5169 printed version of some agenda views to carry around.  Org-mode can
5170 export custom agenda views as plain text, HTML@footnote{You need to
5171 install Hrvoje Niksic' @file{htmlize.el}.} and postscript.  If you want
5172 to do this only occasionally, use the command
5174 @table @kbd
5175 @kindex C-x C-w
5176 @item C-x C-w
5177 @cindex exporting agenda views
5178 @cindex agenda views, exporting
5179 Write the agenda view to a file.  Depending on the extension of the
5180 selected file name, the view will be exported as HTML (extension
5181 @file{.html} or @file{.htm}), Postscript (extension @file{.ps}), or
5182 plain text (any other extension).  Use the variable
5183 @code{org-agenda-exporter-settings} to set options for @file{ps-print}
5184 and for @file{htmlize} to be used during export, for example
5185 @lisp
5186 (setq org-agenda-exporter-settings
5187       '((ps-number-of-columns 2)
5188         (ps-landscape-mode t)
5189         (htmlize-output-type 'css)))
5190 @end lisp
5191 @end table
5193 If you need to export certain agenda views frequently, you can associate
5194 any custom agenda command with a list of output file names
5195 @footnote{If you want to store standard views like the weekly agenda
5196 or the global TODO list as well, you need to define custom commands for
5197 them in order to be able to specify filenames.}.  Here is an example
5198 that first does define custom commands for the agenda and the global
5199 todo list, together with a number of files to which to export them.
5200 Then we define two block agenda commands and specify filenames for them
5201 as well.  File names can be relative to the current working directory,
5202 or absolute.
5204 @lisp
5205 @group
5206 (setq org-agenda-custom-commands
5207       '(("X" agenda "" nil ("agenda.html" "agenda.ps"))
5208         ("Y" alltodo "" nil ("todo.html" "todo.txt" "todo.ps"))
5209         ("h" "Agenda and Home-related tasks"
5210          ((agenda)
5211           (tags-todo "HOME")
5212           (tags "GARDEN"))
5213          nil
5214          ("~/views/home.html"))
5215         ("o" "Agenda and Office-related tasks"
5216          ((agenda)
5217           (tags-todo "WORK")
5218           (tags "OFFICE"))
5219          nil
5220          ("~/views/office.ps"))))
5221 @end group
5222 @end lisp
5224 The extension of the file name determines the type of export.  If it is
5225 @file{.html}, Org-mode will use the @file{htmlize.el} package to convert
5226 the buffer to HTML and save it to this file name.  If the extension is
5227 @file{.ps}, @code{ps-print-buffer-with-faces} is used to produce
5228 postscript output.  Any other extension produces a plain ASCII file.
5230 The export files are @emph{not} created when you use one of those
5231 commands interactively.  Instead, there is a special command to produce
5232 @emph{all} specified files in one step:
5234 @table @kbd
5235 @kindex C-c a e
5236 @item C-c a e
5237 Export all agenda views that have export filenames associated with
5238 them.
5239 @end table
5241 You can use the options section of the custom agenda commands to also
5242 set options for the export commands.  For example:
5244 @lisp
5245 (setq org-agenda-custom-commands
5246       '(("X" agenda ""
5247          ((ps-number-of-columns 2)
5248           (ps-landscape-mode t)
5249           (org-agenda-prefix-format " [ ] ")
5250           (org-agenda-with-colors nil)
5251           (org-agenda-remove-tags t))
5252          ("theagenda.ps"))))
5253 @end lisp
5255 @noindent
5256 This command sets two options for the postscript exporter, to make it
5257 print in two columns in landscape format - the resulting page can be cut
5258 in two and then used in a paper agenda.  The remaining settings modify
5259 the agenda prefix to omit category and scheduling information, and
5260 instead include a checkbox to check off items.  We also remove the tags
5261 to make the lines compact, and we don't want to use colors for the
5262 black-and-white printer.  Settings specified in
5263 @code{org-agenda-exporter-settings} will also apply, but the settings
5264 in @code{org-agenda-custom-commands} take precedence.
5266 @noindent
5267 From the command line you may also use
5268 @example
5269 emacs -f org-batch-store-agenda-views -kill
5270 @end example
5271 @noindent
5272 or, if you need to modify some parameters
5273 @example
5274 emacs -eval '(org-batch-store-agenda-views                      \
5275               org-agenda-ndays 30                               \
5276               org-agenda-include-diary nil                      \
5277               org-agenda-files (quote ("~/org/project.org")))'  \
5278       -kill
5279 @end example
5280 @noindent
5281 which will create the agenda views restricted to the file
5282 @file{~/org/project.org}, without diary entries and with 30 days
5283 extent. 
5285 @node Extracting Agenda Information for other programs,  , Exporting Agenda Views, Custom agenda views
5286 @subsection Extracting Agenda Information for other programs
5287 @cindex agenda, pipe
5288 @cindex Scripts, for agenda processing
5290 Org-mode provides commands to access agenda information for the command
5291 line in emacs batch mode.  This extracted information can be sent
5292 directly to a printer, or it can be read by a program that does further
5293 processing of the data.  The first of these commands is the function
5294 @code{org-batch-agenda}, that produces an agenda view and sends it as
5295 ASCII text to STDOUT.  The command takes a single string as parameter.
5296 If the string has length 1, it is used as a key to one of the commands
5297 you have configured in @code{org-agenda-custom-commands}, basically any
5298 key you can use after @kbd{C-c a}.  For example, to directly print the
5299 current TODO list, you could use
5301 @example
5302 emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
5303 @end example
5305 If the parameter is a string with 2 or more characters, it is used as a
5306 tags/todo match string.  For example, to print your local shopping list
5307 (all items with the tag @samp{shop}, but excluding the tag
5308 @samp{NewYork}), you could use
5310 @example
5311 emacs -batch -l ~/.emacs                                      \       
5312       -eval '(org-batch-agenda "+shop-NewYork")' | lpr
5313 @end example
5315 @noindent
5316 You may also modify parameters on the fly like this:
5318 @example
5319 emacs -batch -l ~/.emacs                                      \
5320    -eval '(org-batch-agenda "a"                               \
5321             org-agenda-ndays 30                               \
5322             org-agenda-include-diary nil                      \
5323             org-agenda-files (quote ("~/org/project.org")))'  \
5324    | lpr
5325 @end example
5327 @noindent
5328 which will produce a 30 day agenda, fully restricted to the Org file
5329 @file{~/org/projects.org}, not even including the diary.
5331 If you want to process the agenda data in more sophisticated ways, you
5332 can use the command @code{org-batch-agenda-csv} to get a comma-separated
5333 list of values for each agenda item.  Each line in the output will
5334 contain a number of fields separated by commas.  The fields in a line
5335 are:
5337 @example
5338 category     @r{The category of the item}
5339 head         @r{The headline, without TODO kwd, TAGS and PRIORITY}
5340 type         @r{The type of the agenda entry, can be}
5341                 todo               @r{selected in TODO match}
5342                 tagsmatch          @r{selected in tags match}
5343                 diary              @r{imported from diary}
5344                 deadline           @r{a deadline}
5345                 scheduled          @r{scheduled}
5346                 timestamp          @r{appointment, selected by timestamp}
5347                 closed             @r{entry was closed on date}
5348                 upcoming-deadline  @r{warning about nearing deadline}
5349                 past-scheduled     @r{forwarded scheduled item}
5350                 block              @r{entry has date block including date}
5351 todo         @r{The todo keyword, if any}
5352 tags         @r{All tags including inherited ones, separated by colons}
5353 date         @r{The relevant date, like 2007-2-14}
5354 time         @r{The time, like 15:00-16:50}
5355 extra        @r{String with extra planning info}
5356 priority-l   @r{The priority letter if any was given}
5357 priority-n   @r{The computed numerical priority}
5358 @end example
5360 @noindent
5361 Time and date will only be given if a timestamp (or deadline/scheduled)
5362 lead to the selection of the item.
5364 A CSV list like this is very easy to use in a post processing script.
5365 For example, here is a Perl program that gets the TODO list from
5366 Emacs/org-mode and prints all the items, preceded by a checkbox:
5368 @example
5369 @group
5370 #!/usr/bin/perl
5372 # define the Emacs command to run
5373 $cmd = "emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv \"t\")'";
5375 # run it and capture the output
5376 $agenda = qx@{$cmd 2>/dev/null@};
5378 # loop over all lines
5379 foreach $line (split(/\n/,$agenda)) @{
5381   # get the individual values
5382   ($category,$head,$type,$todo,$tags,$date,$time,$extra,
5383    $priority_l,$priority_n) = split(/,/,$line);
5385   # proccess and print
5386   print "[ ] $head\n";
5388 @end group
5389 @end example
5391 @node Embedded LaTeX, Exporting, Agenda views, Top
5392 @chapter Embedded LaTeX
5393 @cindex @TeX{} interpretation
5394 @cindex La@TeX{} interpretation
5396 Plain ASCII is normally sufficient for almost all note taking.  One
5397 exception, however, are scientific notes which need to be able to
5398 contain mathematical symbols and the occasional formula.
5399 La@TeX{}@footnote{La@TeX{} is a macro system based on Donald E. Knuth's
5400 @TeX{} system.  Many of the features described here as ``La@TeX{}'' are
5401 really from @TeX{}, but for simplicity I am blurring this distinction.}
5402 is widely used to typeset scientific documents. Org-mode supports
5403 embedding La@TeX{} code into its files, because many academics are used
5404 to read La@TeX{} source code, and because it can be readily processed
5405 into images for HTML production.
5407 It is not necessary to mark La@TeX{} macros and code in any special way.
5408 If you observe a few conventions, Org-mode knows how to find it and what
5409 to do with it.
5411 @menu
5412 * Math symbols::                TeX macros for symbols and Greek letters
5413 * Subscripts and Superscripts::  Simple syntax for raising/lowering text
5414 * LaTeX fragments::             Complex formulas made easy
5415 * Processing LaTeX fragments::  Previewing LaTeX processing
5416 * CDLaTeX mode::                Speed up entering of formulas
5417 @end menu
5419 @node Math symbols, Subscripts and Superscripts, Embedded LaTeX, Embedded LaTeX
5420 @section Math symbols
5421 @cindex math symbols
5422 @cindex TeX macros
5424 You can use La@TeX{} macros to insert special symbols like @samp{\alpha}
5425 to indicate the Greek letter, or @samp{\to} to indicate an arrow.
5426 Completion for these macros is available, just type @samp{\} and maybe a
5427 few letters, and press @kbd{M-@key{TAB}} to see possible completions.
5428 Unlike La@TeX{} code, Org-mode allows these macros to be present
5429 without surrounding math delimiters, for example:
5431 @example
5432 Angles are written as Greek letters \alpha, \beta and \gamma.
5433 @end example
5435 During HTML export (@pxref{HTML export}), these symbols are translated
5436 into the proper syntax for HTML, for the above examples this is
5437 @samp{&alpha;} and @samp{&rarr;}, respectively.
5439 @node Subscripts and Superscripts, LaTeX fragments, Math symbols, Embedded LaTeX
5440 @section Subscripts and Superscripts
5441 @cindex subscript
5442 @cindex superscript
5444 Just like in La@TeX{}, @samp{^} and @samp{_} are used to indicate super-
5445 and subscripts.  Again, these can be used without embedding them in
5446 math-mode delimiters.  To increase the readability of ASCII text, it is
5447 not necessary (but OK) to surround multi-character sub- and superscripts
5448 with curly braces.  For example
5450 @example
5451 The mass if the sun is M_sun = 1.989 x 10^30 kg.  The radius of
5452 the sun is R_@{sun@} = 6.96 x 10^8 m.
5453 @end example
5455 To avoid interpretation as raised or lowered text, you can quote
5456 @samp{^} and @samp{_} with a backslash: @samp{\_} and @samp{\^}.
5458 During HTML export (@pxref{HTML export}), subscript and superscripts
5459 are surrounded with @code{<sub>} and @code{<sup>} tags, respectively.
5461 @node LaTeX fragments, Processing LaTeX fragments, Subscripts and Superscripts, Embedded LaTeX
5462 @section LaTeX fragments
5463 @cindex LaTeX fragments
5465 With symbols, sub- and superscripts, HTML is pretty much at its end when
5466 it comes to representing mathematical formulas@footnote{Yes, there is
5467 MathML, but that is not yet fully supported by many browsers, and there
5468 is no decent converter for turning La@TeX{} or ASCII representations of
5469 formulas into MathML. So for the time being, converting formulas into
5470 images seems the way to go.}. More complex expressions need a dedicated
5471 formula processor. To this end, Org-mode can contain arbitrary La@TeX{}
5472 fragments. It provides commands to preview the typeset result of these
5473 fragments, and upon export to HTML, all fragments will be converted to
5474 images and inlined into the HTML document@footnote{The La@TeX{} export
5475 will not use images for displaying La@TeX{} fragments but include these
5476 fragments directly into the La@TeX{} code.}. For this to work you
5477 need to be on a system with a working La@TeX{} installation. You also
5478 need the @file{dvipng} program, available at
5479 @url{http://sourceforge.net/projects/dvipng/}. The La@TeX{} header that
5480 will be used when processing a fragment can be configured with the
5481 variable @code{org-format-latex-header}.
5483 La@TeX{} fragments don't need any special marking at all.  The following
5484 snippets will be identified as La@TeX{} source code:
5485 @itemize @bullet
5486 @item
5487 Environments of any kind.  The only requirement is that the
5488 @code{\begin} statement appears on a new line, preceded by only
5489 whitespace.
5490 @item
5491 Text within the usual La@TeX{} math delimiters.  To avoid conflicts with
5492 currency specifications, single @samp{$} characters are only recognized
5493 as math delimiters if the enclosed text contains at most two line breaks,
5494 is directly attached to the @samp{$} characters with no whitespace in
5495 between, and if the closing @samp{$} is followed by whitespace or
5496 punctuation.  For the other delimiters, there is no such restriction, so
5497 when in doubt, use @samp{\(...\)} as inline math delimiters.
5498 @end itemize
5500 @noindent For example:
5502 @example
5503 \begin@{equation@}                          % arbitrary environments,
5504 x=\sqrt@{b@}                                % even tables, figures
5505 \end@{equation@}                            % etc
5507 If $a^2=b$ and \( b=2 \), then the solution must be
5508 either $$ a=+\sqrt@{2@} $$ or \[ a=-\sqrt@{2@} \].
5509 @end example
5511 @noindent
5512 If you need any of the delimiter ASCII sequences for other purposes, you
5513 can configure the option @code{org-format-latex-options} to deselect the
5514 ones you do not wish to have interpreted by the La@TeX{} converter.
5516 @node Processing LaTeX fragments, CDLaTeX mode, LaTeX fragments, Embedded LaTeX
5517 @section Processing LaTeX fragments
5518 @cindex LaTeX fragments, preview
5520 La@TeX{} fragments can be processed to produce a preview images of the
5521 typeset expressions:
5523 @table @kbd
5524 @kindex C-c C-x C-l
5525 @item C-c C-x C-l
5526 Produce a preview image of the La@TeX{} fragment at point and overlay it
5527 over the source code.  If there is no fragment at point, process all
5528 fragments in the current entry (between two headlines).  When called
5529 with a prefix argument, process the entire subtree.  When called with
5530 two prefix arguments, or when the cursor is before the first headline,
5531 process the entire buffer.
5532 @kindex C-c C-c
5533 @item C-c C-c
5534 Remove the overlay preview images.
5535 @end table
5537 During HTML export (@pxref{HTML export}), all La@TeX{} fragments are
5538 converted into images and inlined into the document if the following
5539 setting is active:
5541 @lisp
5542 (setq org-export-with-LaTeX-fragments t)
5543 @end lisp
5545 @node CDLaTeX mode,  , Processing LaTeX fragments, Embedded LaTeX
5546 @section Using CDLaTeX to enter math
5547 @cindex CDLaTeX
5549 CDLaTeX-mode is a minor mode that is normally used in combination with a
5550 major La@TeX{} mode like AUCTeX in order to speed-up insertion of
5551 environments and math templates.  Inside Org-mode, you can make use of
5552 some of the features of cdlatex-mode.  You need to install
5553 @file{cdlatex.el} and @file{texmathp.el} (the latter comes also with
5554 AUCTeX) from @url{http://www.astro.uva.nl/~dominik/Tools/cdlatex}.
5555 Don't turn cdlatex-mode itself under Org-mode, but use the light
5556 version @code{org-cdlatex-mode} that comes as part of Org-mode.  Turn it
5557 on for the current buffer with @code{M-x org-cdlatex-mode}, or for all
5558 Org-mode files with
5560 @lisp
5561 (add-hook 'org-mode-hook 'turn-on-org-cdlatex)
5562 @end lisp
5564 When this mode is enabled, the following features are present (for more
5565 details see the documentation of cdlatex-mode):
5566 @itemize @bullet
5567 @kindex C-c @{
5568 @item
5569 Environment templates can be inserted with @kbd{C-c @{}.
5570 @item
5571 @kindex @key{TAB}
5572 The @key{TAB} key will do template expansion if the cursor is inside a
5573 La@TeX{} fragment@footnote{Org-mode has a method to test if the cursor is
5574 inside such a fragment, see the documentation of the function
5575 @code{org-inside-LaTeX-fragment-p}.}.  For example, @key{TAB} will
5576 expand @code{fr} to @code{\frac@{@}@{@}} and position the cursor
5577 correctly inside the first brace.  Another @key{TAB} will get you into
5578 the second brace.  Even outside fragments, @key{TAB} will expand
5579 environment abbreviations at the beginning of a line.  For example, if
5580 you write @samp{equ} at the beginning of a line and press @key{TAB},
5581 this abbreviation will be expanded to an @code{equation} environment.
5582 To get a list of all abbreviations, type @kbd{M-x cdlatex-command-help}.
5583 @item
5584 @kindex _
5585 @kindex ^
5586 Pressing @kbd{_} and @kbd{^} inside a La@TeX{} fragment will insert these
5587 characters together with a pair of braces.  If you use @key{TAB} to move
5588 out of the braces, and if the braces surround only a single character or
5589 macro, they are removed again (depending on the variable
5590 @code{cdlatex-simplify-sub-super-scripts}).
5591 @item
5592 @kindex `
5593 Pressing the backquote @kbd{`} followed by a character inserts math
5594 macros, also outside La@TeX{} fragments.  If you wait more than 1.5 seconds
5595 after the backquote, a help window will pop up.
5596 @item
5597 @kindex '
5598 Pressing the normal quote @kbd{'} followed by another character modifies
5599 the symbol before point with an accent or a font.  If you wait more than
5600 1.5 seconds after the backquote, a help window will pop up.  Character
5601 modification will work only inside La@TeX{} fragments, outside the quote
5602 is normal.
5603 @end itemize
5605 @node Exporting, Publishing, Embedded LaTeX, Top
5606 @chapter Exporting
5607 @cindex exporting
5609 Org-mode documents can be exported into a variety of other formats.  For
5610 printing and sharing of notes, ASCII export produces a readable and
5611 simple version of an Org-mode file.  HTML export allows you to publish a
5612 notes file on the web, while the XOXO format provides a solid base for
5613 exchange with a broad range of other applications. La@TeX{} export lets
5614 you use Org-mode and its structured editing functions to easily create
5615 La@TeX{} files.  To incorporate entries with associated times like
5616 deadlines or appointments into a desktop calendar program like iCal,
5617 Org-mode can also produce extracts in the iCalendar format.  Currently
5618 Org-mode only supports export, not import of these different formats.
5620 When exporting, Org-mode uses special conventions to enrich the output
5621 produced.  @xref{Text interpretation}, for more details.
5623 @table @kbd
5624 @kindex C-c C-e
5625 @item C-c C-e
5626 Dispatcher for export and publishing commands.  Displays a help-window
5627 listing the additional key(s) needed to launch an export or publishing
5628 command.
5629 @end table
5631 @menu
5632 * ASCII export::                Exporting to plain ASCII
5633 * HTML export::                 Exporting to HTML
5634 * LaTeX export::                Exporting to LaTeX
5635 * XOXO export::                 Exporting to XOXO
5636 * iCalendar export::            Exporting in iCalendar format
5637 * Text interpretation::         How the exporter looks at the file
5638 @end menu
5640 @node ASCII export, HTML export, Exporting, Exporting
5641 @section ASCII export
5642 @cindex ASCII export
5644 ASCII export produces a simple and very readable version of an Org-mode
5645 file.
5647 @cindex region, active
5648 @cindex active region
5649 @cindex transient-mark-mode
5650 @table @kbd
5651 @kindex C-c C-e a
5652 @item C-c C-e a
5653 Export as ASCII file.  For an org file @file{myfile.org}, the ASCII file
5654 will be @file{myfile.txt}.  The file will be overwritten without
5655 warning.  If there is an active region, only the region will be
5656 exported. If the selected region is a single tree, the tree head will
5657 become the document title.  If the tree head entry has or inherits an
5658 EXPORT_FILE_NAME property, that name will be used for the export.
5659 @kindex C-c C-e v a
5660 @item C-c C-e v a
5661 Export only the visible part of the document.
5662 @end table
5664 @cindex headline levels, for exporting
5665 In the exported version, the first 3 outline levels will become
5666 headlines, defining a general document structure.  Additional levels
5667 will be exported as itemized lists.  If you want that transition to occur
5668 at a different level, specify it with a prefix argument.  For example,
5670 @example
5671 @kbd{C-1 C-c C-e a}
5672 @end example
5674 @noindent
5675 creates only top level headlines and does the rest as items.  When
5676 headlines are converted to items, the indentation of the text following
5677 the headline is changed to fit nicely under the item.  This is done with
5678 the assumption that the first bodyline indicates the base indentation of
5679 the body text.  Any indentation larger than this is adjusted to preserve
5680 the layout relative to the first line.  Should there be lines with less
5681 indentation than the first, these are left alone.
5683 @node HTML export, LaTeX export, ASCII export, Exporting
5684 @section HTML export
5685 @cindex HTML export
5687 Org-mode contains an HTML (XHTML 1.0 strict) exporter with extensive
5688 HTML formatting, in ways similar to John Grubers @emph{markdown}
5689 language, but with additional support for tables.
5691 @menu
5692 * HTML Export commands::        How to invoke LaTeX export
5693 * Quoting HTML tags::           Using direct HTML in Org-mode
5694 * Links::                       Transformation of links for HTML
5695 * Images::                      How to include images
5696 * CSS support::                 Changing the appearence of the output
5697 @end menu
5699 @node HTML Export commands, Quoting HTML tags, HTML export, HTML export
5700 @subsection HTML export commands
5702 @cindex region, active
5703 @cindex active region
5704 @cindex transient-mark-mode
5705 @table @kbd
5706 @kindex C-c C-e h
5707 @item C-c C-e h
5708 Export as HTML file @file{myfile.html}.  For an org file
5709 @file{myfile.org}, the ASCII file will be @file{myfile.html}.  The file
5710 will be overwritten without warning.  If there is an active region, only
5711 the region will be exported. If the selected region is a single tree,
5712 the tree head will become the document title.  If the tree head entry
5713 has or inherits an EXPORT_FILE_NAME property, that name will be used for
5714 the export.
5715 @kindex C-c C-e b
5716 @item C-c C-e b
5717 Export as HTML file and immediately open it with a browser.
5718 @kindex C-c C-e H
5719 @item C-c C-e H
5720 Export to a temporary buffer, do not create a file.
5721 @kindex C-c C-e R
5722 @item C-c C-e H
5723 Export the active region to a temporary buffer.  With prefix arg, do not
5724 produce file header and foot, but just the plain HTML section for the
5725 region.  This is good for cut-and-paste operations.
5726 @kindex C-c C-e v h
5727 @kindex C-c C-e v b
5728 @kindex C-c C-e v H
5729 @kindex C-c C-e v R
5730 @item C-c C-e v h
5731 @item C-c C-e v b
5732 @item C-c C-e v H
5733 @item C-c C-e v R
5734 Export only the visible part of the document.
5735 @item M-x org-export-region-as-html
5736 Convert the region to HTML under the assumption that it was org-mode
5737 syntax before.  This is a global command that can be invoked in any
5738 buffer.
5739 @item M-x org-replace-region-by-HTML
5740 Replace the active region (assumed to be in Org-mode syntax) by HTML
5741 code.
5742 @end table
5744 @cindex headline levels, for exporting
5745 In the exported version, the first 3 outline levels will become
5746 headlines, defining a general document structure.  Additional levels
5747 will be exported as itemized lists.  If you want that transition to occur
5748 at a different level, specify it with a prefix argument.  For example,
5750 @example
5751 @kbd{C-2 C-c C-e b}
5752 @end example
5754 @noindent
5755 creates two levels of headings and does the rest as items.
5757 @node Quoting HTML tags, Links, HTML Export commands, HTML export
5758 @subsection Quoting HTML tags
5760 Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
5761 @samp{&gt;} in HTML export.  If you want to include simple HTML tags
5762 which should be interpreted as such, mark them with @samp{@@} as in
5763 @samp{@@<b>bold text@@</b>}.  Note that this really works only for
5764 simple tags.  For more extensive HTML that should be copied verbatim to
5765 the exported file use either
5767 @example
5768 #+HTML: Literal HTML code for export
5769 @end example
5771 @noindent or
5773 @example
5774 #+BEGIN_HTML
5775 All lines between these markers are exported literally
5776 #+END_HTML
5777 @end example
5780 @node Links, Images, Quoting HTML tags, HTML export
5781 @subsection Links
5783 @cindex links, in HTML export
5784 @cindex internal links, in HTML export
5785 @cindex external links, in HTML export
5786 Internal links (@pxref{Internal links}) will continue to work in HTML
5787 files only if they match a dedicated @samp{<<target>>}.  Automatic links
5788 created by radio targets (@pxref{Radio targets}) will also work in the
5789 HTML file.  Links to external files will still work if the HTML file is
5790 in the same directory as the Org-mode file.  Links to other @file{.org}
5791 files will be translated into HTML links under the assumption that an
5792 HTML version also exists of the linked file.  For information related to
5793 linking files while publishing them to a publishing directory see
5794 @ref{Publishing links}.
5796 @node Images, CSS support, Links, HTML export
5797 @subsection Images
5799 @cindex images, inline in HTML
5800 @cindex inlining images in HTML
5801 HTML export can inline images given as links in the Org-mode file, and
5802 it can make an image the clickable part of a link.  By
5803 default@footnote{but see the variable
5804 @code{org-export-html-inline-images}}, images are inlined if a link does
5805 not have a description.  So @samp{[[file:myimg.jpg]]} will be inlined,
5806 while @samp{[[file:myimg.jpg][the image]]} will just produce a link
5807 @samp{the image} that points to the image.  If the description part
5808 itself is a @code{file:} link or a @code{http:} URL pointing to an
5809 image, this image will be inlined and activated so that clicking on the
5810 image will activate the link.  For example, to include a thumbnail that
5811 will link to a high resolution version of the image, you could use:
5813 @example
5814 [[file:highres.jpg][file:thumb.jpg]]
5815 @end example
5817 @noindent
5818 and you could use @code{http} addresses just as well.
5820 @node CSS support,  , Images, HTML export
5821 @subsection CSS support
5823 You can also give style information for the exported file.  The HTML
5824 exporter assigns the following CSS classes to appropriate parts of the
5825 document - your style specifications may change these:
5826 @example
5827 .todo           @r{TODO keywords}
5828 .done           @r{the DONE keyword}
5829 .timestamp      @r{time stamp}
5830 .timestamp-kwd  @r{keyword associated with a time stamp, like SCHEDULED}
5831 .tag            @r{tag in a headline}
5832 .target         @r{target for links}
5833 @end example
5835 The default style specification can be configured through the option
5836 @code{org-export-html-style}.  If you want to use a file-local style,
5837 you may use file variables, best wrapped into a COMMENT section at the
5838 end of the outline tree.  For example@footnote{Under Emacs 21, the
5839 continuation lines for a variable value should have no @samp{#} at the
5840 start of the line.}:
5842 @example
5843 * COMMENT html style specifications
5845 # Local Variables:
5846 # org-export-html-style: "   <style type=\"text/css\">
5847 #       p @{font-weight: normal; color: gray; @}
5848 #       h1 @{color: black; @}
5849 #   </style>"
5850 # End:
5851 @end example
5853 Remember to execute @kbd{M-x normal-mode} after changing this to make
5854 the new style visible to Emacs.  This command restarts org-mode for the
5855 current buffer and forces Emacs to re-evaluate the local variables
5856 section in the buffer.
5858 @c FIXME: More about header and footer styles
5859 @c FIXME: Talk about links and targets.
5861 @node LaTeX export, XOXO export, HTML export, Exporting
5862 @section LaTeX export
5863 @cindex LaTeX export
5865 Org-mode contains a La@TeX{} exporter written by Bastien Guerry.
5867 @menu
5868 * LaTeX export commands::       How to invoke LaTeX export
5869 * Quoting LaTeX code::          Incorporating literal LaTeX code
5870 @end menu
5872 @node LaTeX export commands, Quoting LaTeX code, LaTeX export, LaTeX export
5873 @subsection LaTeX export commands
5875 @table @kbd
5876 @kindex C-c C-e l
5877 @item C-c C-e l
5878 Export as La@TeX{} file @file{myfile.tex}.
5879 @kindex C-c C-e L
5880 @item C-c C-e L
5881 Export to a temporary buffer, do not create a file.
5882 @kindex C-c C-e v l
5883 @kindex C-c C-e v L
5884 @item C-c C-e v l
5885 @item C-c C-e v L
5886 Export only the visible part of the document.
5887 @item M-x org-export-region-as-latex
5888 Convert the region to La@TeX{} under the assumption that it was org-mode
5889 syntax before.  This is a global command that can be invoked in any
5890 buffer.
5891 @item M-x org-replace-region-by-latex
5892 Replace the active region (assumed to be in Org-mode syntax) by La@TeX{}
5893 code.
5894 @end table
5896 @cindex headline levels, for exporting
5897 In the exported version, the first 3 outline levels will become
5898 headlines, defining a general document structure.  Additional levels
5899 will be exported as description lists.  The exporter can ignore them or
5900 convert them to a custom string depending on
5901 @code{org-latex-low-levels}.
5903 If you want that transition to occur at a different level, specify it
5904 with a prefix argument. For example,
5906 @example
5907 @kbd{C-2 C-c C-e l}
5908 @end example
5910 @noindent
5911 creates two levels of headings and does the rest as items.
5913 @node Quoting LaTeX code,  , LaTeX export commands, LaTeX export
5914 @subsection Quoting LaTeX code
5916 Embedded La@TeX{} as described in @ref{Embedded LaTeX} will be correctly
5917 inserted into the La@TeX{} file.  Forthermore, you can add special code
5918 that should only be present in La@TeX{} export with the following
5919 constructs:
5921 @example
5922 #+LaTeX: Literal LaTeX code for export
5923 @end example
5925 @noindent or
5927 @example
5928 #+BEGIN_LaTeX
5929 All lines between these markers are exported literally
5930 #+END_LaTeX
5931 @end example
5932 @node XOXO export, iCalendar export, LaTeX export, Exporting
5933 @section XOXO export
5934 @cindex XOXO export
5936 Org-mode contains an exporter that produces XOXO-style output.
5937 Currently, this exporter only handles the general outline structure and
5938 does not interpret any additional Org-mode features.
5940 @table @kbd
5941 @kindex C-c C-e x
5942 @item C-c C-e x
5943 Export as XOXO file @file{myfile.html}.
5944 @kindex C-c C-e v
5945 @item C-c C-e v x
5946 Export only the visible part of the document.
5947 @end table
5949 @node iCalendar export, Text interpretation, XOXO export, Exporting
5950 @section iCalendar export
5951 @cindex iCalendar export
5953 Some people like to use Org-mode for keeping track of projects, but
5954 still prefer a standard calendar application for anniversaries and
5955 appointments.  In this case it can be useful to have deadlines and
5956 other time-stamped items in Org-mode files show up in the calendar
5957 application.  Org-mode can export calendar information in the standard
5958 iCalendar format.  If you also want to have TODO entries included in the
5959 export, configure the variable @code{org-icalendar-include-todo}.
5961 @table @kbd
5962 @kindex C-c C-e i
5963 @item C-c C-e i
5964 Create iCalendar entries for the current file and store them in the same
5965 directory, using a file extension @file{.ics}.
5966 @kindex C-c C-e I
5967 @item C-c C-e I
5968 Like @kbd{C-c C-e i}, but do this for all files in
5969 @code{org-agenda-files}.  For each of these files, a separate iCalendar
5970 file will be written.
5971 @kindex C-c C-e c
5972 @item C-c C-e c
5973 Create a single large iCalendar file from all files in
5974 @code{org-agenda-files} and write it to the file given by
5975 @code{org-combined-agenda-icalendar-file}.
5976 @end table
5978 How this calendar is best read and updated, depends on the application
5979 you are using.  The FAQ covers this issue.
5982 @node Text interpretation,  , iCalendar export, Exporting
5983 @section Text interpretation by the exporter
5985 The exporter backends interpret additional structure in the Org-mode file
5986 in order to produce better output.
5988 @menu
5989 * Comment lines::               Some lines will not be exported
5990 * Initial text::                Text before the first headline
5991 * Footnotes::                   Numbers like [1]
5992 * Enhancing text::              Subscripts, symbols and more
5993 * Export options::              How to influence the export settings
5994 @end menu
5996 @node Comment lines, Initial text, Text interpretation, Text interpretation
5997 @subsection Comment lines
5998 @cindex comment lines
5999 @cindex exporting, not
6001 Lines starting with @samp{#} in column zero are treated as comments
6002 and will never be exported.  Also entire subtrees starting with the
6003 word @samp{COMMENT} will never be exported.
6005 @table @kbd
6006 @kindex C-c ;
6007 @item C-c ;
6008 Toggle the COMMENT keyword at the beginning of an entry.
6009 @end table
6011 @node Initial text, Footnotes, Comment lines, Text interpretation
6012 @subsection Text before the first headline
6014 Org-mode normally ignores any text before the first headline when
6015 exporting, leaving this region for internal links to speed up navigation
6016 etc.  However, in publishing-oriented files, you might want to have some
6017 text before the first headline, like a small introduction, special HTML
6018 code with a navigation bar, etc.  You can ask to have this part of the
6019 file exported as well by setting the variable
6020 @code{org-export-skip-text-before-1st-heading} to @code{nil}.  On a
6021 per-file basis, you can get the same effect with
6023 @example
6024 #+OPTIONS: skip:nil
6025 @end example
6027 The text before the first headline will be fully processed
6028 (@pxref{Enhancing text}), and the first non-comment line becomes the
6029 title of the exported document.  If you need to include literal HTML,
6030 use the special constructs described in @ref{Quoting HTML tags}.  The
6031 table of contents is normally inserted directly before the first
6032 headline of the file.  If you would like to get it to a different
6033 location, insert the string @code{[TABLE-OF-CONTENTS]} on a line by
6034 itself at the desired location.
6036 Finally, if you want to use the space before the first headline for
6037 internal purposes, but @emph{still} want to place something before the
6038 first headline when exporting the file, you can use the @code{#+TEXT}
6039 construct:
6041 @example
6042 #+OPTIONS: skip:t
6043 #+TEXT: This text will go before the *first* headline.
6044 #+TEXT: We place the table of contents here:
6045 #+TEXT: [TABLE-OF-CONTENTS]
6046 #+TEXT: This goes between the table of contents and the first headline
6047 @end example
6049 @node Footnotes, Enhancing text, Initial text, Text interpretation
6050 @subsection Footnotes
6051 @cindex footnotes
6052 @cindex @file{footnote.el}
6054 Numbers in square brackets are treated as footnotes, so that you can use
6055 the Emacs package @file{footnote.el} to create footnotes.  For example:
6057 @example
6058 The org-mode homepage[1] clearly needs help from
6059 a good web designer.
6061 [1] The link is: http://www.astro.uva.nl/~dominik/Tools/org
6062 @end example
6064 @noindent
6065 @kindex C-c !
6066 Note that the @file{footnote} package uses @kbd{C-c !} to invoke its
6067 commands.  This binding conflicts with the org-mode command for
6068 inserting inactive time stamps.  You could use the variable
6069 @code{footnote-prefix} to switch footnotes commands to another key.  Or,
6070 if you are too used to this binding, you could use
6071 @code{org-replace-disputed-keys} and @code{org-disputed-keys} to change
6072 the settings in Org-mode.
6074 @node Enhancing text, Export options, Footnotes, Text interpretation
6075 @subsection Enhancing text for export
6076 @cindex enhancing text
6077 @cindex richer text
6079 Some of the export backends of Org-mode allow for sophisticated text
6080 formatting, this is true in particular for the HTML and La@TeX{}
6081 backends. Org-mode has a number of typing conventions that allow to
6082 produce a richly formatted output.
6084 @itemize @bullet
6086 @cindex hand-formatted lists
6087 @cindex lists, hand-formatted
6088 @item
6089 Plain lists @samp{-}, @samp{*} or @samp{+} as bullet, or with @samp{1.}
6090 or @samp{2)} as enumerator will be recognized and transformed if the
6091 backend supports lists.  See @xref{Plain lists}.
6093 @cindex underlined text
6094 @cindex bold text
6095 @cindex italic text
6096 @item
6097 You can make words @b{*bold*}, @i{/italic/}, _underlined_,
6098 @code{=code=}, and even @samp{+strikethrough+}@footnote{but remember
6099 that strikethrough is typographically evil and should @i{never} be
6100 used.}.
6102 @cindex horizontal rules, in exported files
6103 @item
6104 A line consisting of only dashes, and at least 5 of them, will be
6105 exported as a horizontal line (@samp{<hr/>} in HTML).
6107 @cindex LaTeX fragments, export
6108 @cindex TeX macros, export
6109 @item
6110 Many @TeX{} macros and entire La@TeX{} fragments are converted into HTML
6111 entities or images (@pxref{Embedded LaTeX}).
6113 @cindex tables, export
6114 @item
6115 Tables are transformed into native tables under the exporter, if the
6116 export backend supports this. Data fields before the first horizontal
6117 separator line will be formatted as table header fields.
6119 @cindex fixed width
6120 @item
6121 If a headline starts with the word @samp{QUOTE}, the text below the
6122 headline will be typeset as fixed-width, to allow quoting of computer
6123 codes etc.  Lines starting with @samp{:} are also typeset in fixed-width
6124 font. 
6125 @table @kbd
6126 @kindex C-c :
6127 @item C-c :
6128 Toggle fixed-width for entry (QUOTE) or region, see below.
6129 @end table
6131 @cindex linebreak, forced
6132 @item 
6133 A double backslash @emph{at the end of a line} enforces a line break at
6134 this position.
6135 @end itemize
6137 If these conversions conflict with your habits of typing ASCII text,
6138 they can all be turned off with corresponding variables.  See the
6139 customization group @code{org-export-general}, and the following section
6140 which explains how to set export options with special lines in a
6141 buffer.
6144 @node Export options,  , Enhancing text, Text interpretation
6145 @subsection Export options
6146 @cindex options, for export
6148 @cindex completion, of option keywords
6149 The exporter recognizes special lines in the buffer which provide
6150 additional information.  These lines may be put anywhere in the file.
6151 The whole set of lines can be inserted into the buffer with @kbd{C-c
6152 C-e t}.  For individual lines, a good way to make sure the keyword is
6153 correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
6154 (@pxref{Completion}).
6156 @table @kbd
6157 @kindex C-c C-e t
6158 @item C-c C-e t
6159 Insert template with export options, see example below.
6160 @end table
6162 @example
6163 #+TITLE:     the title to be shown (default is the buffer name)
6164 #+AUTHOR:    the author (default taken from @code{user-full-name})
6165 #+EMAIL:     his/her email address (default from @code{user-mail-address})
6166 #+LANGUAGE:  language for HTML, e.g. @samp{en} (@code{org-export-default-language})
6167 #+TEXT:      Some descriptive text to be inserted at the beginning.
6168 #+TEXT:      Several lines may be given.
6169 #+OPTIONS:   H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t f:t TeX:t ...
6170 @end example
6172 @noindent
6173 The OPTIONS line is a compact form to specify export settings.  Here
6174 you can:
6175 @cindex headline levels
6176 @cindex section-numbers
6177 @cindex table of contents
6178 @cindex linebreak preservation
6179 @cindex quoted HTML tags
6180 @cindex fixed-width sections
6181 @cindex tables
6182 @cindex @TeX{}-like syntax for sub- and superscripts
6183 @cindex footnotes
6184 @cindex emphasized text
6185 @cindex @TeX{} macros
6186 @cindex La@TeX{} fragments
6187 @cindex author info, in export
6188 @cindex time info, in export
6189 @example
6190 H:         @r{set the number of headline levels for export}
6191 num:       @r{turn on/off section-numbers}
6192 toc:       @r{turn on/off table of contents, or set level limit (integer)}
6193 \n:        @r{turn on/off linebreak-preservation}
6194 @@:         @r{turn on/off quoted HTML tags}
6195 ::         @r{turn on/off fixed-width sections}
6196 |:         @r{turn on/off tables}
6197 ^:         @r{turn on/off @TeX{}-like syntax for sub- and superscripts.  If}
6198            @r{you write "^:@{@}", @code{a_@{b@}} will be interpreted, but}
6199            @r{the simple @code{a_b} will be left as it is.}
6200 f:         @r{turn on/off foototes like this[1].}
6201 *:         @r{turn on/off emphasized text (bold, italic, underlined)}
6202 TeX:       @r{turn on/off simple @TeX{} macros in plain text}
6203 LaTeX:     @r{turn on/off La@TeX{} fragments}
6204 skip:      @r{turn on/off skipping the text before the first heading}
6205 author:    @r{turn on/off inclusion of author name/email into exported file}
6206 timestamp: @r{turn on/off inclusion creation time into exported file}
6207 @end example
6209 These options take effect in both the HTML and La@TeX{} export, except
6210 for @code{TeX} and @code{LaTeX}, which are respectively @code{t} and
6211 @code{nil} for the La@TeX{} export.
6213 @node Publishing, Miscellaneous, Exporting, Top
6214 @chapter Publishing
6215 @cindex publishing
6217 Org-mode includes@footnote{@file{org-publish.el} is not distributed with
6218 Emacs 21, if you are still using Emacs 21, you need you need to download
6219 this file separately.} a publishing management system that allows you to
6220 configure automatic HTML conversion of @emph{projects} composed of
6221 interlinked org files.  This system is called @emph{org-publish}.  You can
6222 also configure org-publish to automatically upload your exported HTML
6223 pages and related attachments, such as images and source code files, to
6224 a web server. Org-publish turns org-mode into a web-site authoring tool.
6226 You can also use Org-publish to convert files into La@TeX{}, or even
6227 combine HTML and La@TeX{} conversion so that files are available in both
6228 formats on the server@footnote{Since La@TeX{} files on a server are not
6229 that helpful, you surely want to perform further conversion on them --
6230 e.g. convert them to @code{PDF} format.}.
6232 Org-publish has been contributed to Org-mode by David O'Toole.
6234 @menu
6235 * Configuration::               Defining projects
6236 * Sample configuration::        Example projects
6237 * Triggering publication::      Publication commands
6238 @end menu
6240 @node Configuration, Sample configuration, Publishing, Publishing
6241 @section Configuration
6243 Publishing needs significant configuration to specify files, destination
6244 and many other properties of a project.
6246 @menu
6247 * Project alist::               The central configuration variable
6248 * Sources and destinations::    From here to there
6249 * Selecting files::             What files are part of the project?
6250 * Publishing action::           Setting the function doing the publishing
6251 * Publishing options::          Tweaking HTML export
6252 * Publishing links::            Which links keep working after publishing?
6253 * Project page index::          Publishing a list of project files
6254 @end menu
6256 @node Project alist, Sources and destinations, Configuration, Configuration
6257 @subsection The variable @code{org-publish-project-alist}
6258 @cindex org-publish-project-alist
6259 @cindex projects, for publishing
6261 Org-publish is configured almost entirely through setting the value of
6262 one variable, called @code{org-publish-project-alist}.
6263 Each element of the list configures one project, and may be in one of
6264 the two following forms:
6266 @lisp
6267 ("project-name"  :property value :property value ...)
6269 @r{or} 
6271 ("project-name"  :components ("project-name" "project-name" ...))
6273 @end lisp
6275 In both cases, projects are configured by specifying property values.
6276 A project defines the set of files that will be published, as well as
6277 the publishing configuration to use when publishing those files.  When
6278 a project takes the second form listed above, the individual members
6279 of the ``components'' property are taken to be components of the
6280 project, which group together files requiring different publishing
6281 options. When you publish such a ``meta-project'' all the components
6282 will also publish.
6284 @node Sources and destinations, Selecting files, Project alist, Configuration
6285 @subsection Sources and destinations for files
6286 @cindex directories, for publishing
6288 Most properties are optional, but some should always be set. In
6289 particular, org-publish needs to know where to look for source files,
6290 and where to put published files.
6292 @multitable @columnfractions 0.3 0.7
6293 @item @code{:base-directory}
6294 @tab Directory containing publishing source files
6295 @item @code{:publishing-directory}
6296 @tab Directory (possibly remote) where output files will be published.
6297 @item @code{:preparation-function}
6298 @tab Function called before starting publishing process, for example to
6299 run @code{make} for updating files to be published.
6300 @end multitable
6301 @noindent
6303 @node Selecting files, Publishing action, Sources and destinations, Configuration
6304 @subsection Selecting files
6305 @cindex files, selecting for publishing
6307 By default, all files with extension @file{.org} in the base directory
6308 are considered part of the project.  This can be modified by setting the
6309 properties 
6310 @multitable @columnfractions 0.25 0.75
6311 @item @code{:base-extension}
6312 @tab Extension (without the dot!) of source files.  This actually is a
6313 regular expression.
6315 @item @code{:exclude} 
6316 @tab Regular expression to match file names that should not be
6317 published, even though they have been selected on the basis of their
6318 extension.
6320 @item @code{:include}
6321 @tab List of files to be included regardless of @code{:base-extension}
6322 and @code{:exclude}.
6323 @end multitable
6325 @node Publishing action, Publishing options, Selecting files, Configuration
6326 @subsection Publishing Action
6327 @cindex action, for publishing
6329 Publishing means that a file is copied to the destination directory and
6330 possibly transformed in the process.  The default transformation is to
6331 export Org-mode files as HTML files, and this is done by the function
6332 @code{org-publish-org-to-html} which calls the HTML exporter
6333 (@pxref{HTML export}). But you also can publish your files in La@TeX{} by
6334 using the function @code{org-publish-org-to-latex} instead. Other files
6335 like images only need to be copied to the publishing destination. For
6336 non-Org-mode files, you need to specify the publishing function.
6339 @multitable @columnfractions 0.3 0.7
6340 @item @code{:publishing-function}
6341 @tab Function executing the publication of a file.  This may also be a
6342 list of functions, which will all be called in turn.
6343 @end multitable
6345 The function must accept two arguments: a property list containing at
6346 least a @code{:publishing-directory} property, and the name of the file
6347 to be published.  It should take the specified file, make the necessary
6348 transformation (if any) and place the result into the destination folder.
6349 You can write your own publishing function, but @code{org-publish}
6350 provides one for attachments (files that only need to be copied):
6351 @code{org-publish-attachment}.
6353 @node Publishing options, Publishing links, Publishing action, Configuration
6354 @subsection Options for the HTML/LaTeX exporters
6355 @cindex options, for publishing
6357 The property list can be used to set many export options for the HTML
6358 and La@TeX{} exporters.  In most cases, these properties correspond to user
6359 variables in Org-mode.  The table below lists these properties along
6360 with the variable they belong to.  See the documentation string for the
6361 respective variable for details.
6363 @multitable @columnfractions 0.3 0.7
6364 @item @code{:language}              @tab @code{org-export-default-language}
6365 @item @code{:headline-levels}       @tab @code{org-export-headline-levels}
6366 @item @code{:section-numbers}       @tab @code{org-export-with-section-numbers}
6367 @item @code{:table-of-contents}     @tab @code{org-export-with-toc}
6368 @item @code{:archived-trees}        @tab @code{org-export-with-archived-trees}
6369 @item @code{:emphasize}             @tab @code{org-export-with-emphasize}
6370 @item @code{:sub-superscript}       @tab @code{org-export-with-sub-superscripts}
6371 @item @code{:TeX-macros}            @tab @code{org-export-with-TeX-macros}
6372 @item @code{:LaTeX-fragments}       @tab @code{org-export-with-LaTeX-fragments}
6373 @item @code{:fixed-width}           @tab @code{org-export-with-fixed-width}
6374 @item @code{:timestamps}           .@tab @code{org-export-with-timestamps}
6375 @item @code{:tags}                 .@tab @code{org-export-with-tags}
6376 @item @code{:tables}                @tab @code{org-export-with-tables}
6377 @item @code{:table-auto-headline}   @tab @code{org-export-highlight-first-table-line}
6378 @item @code{:style}                 @tab @code{org-export-html-style}
6379 @item @code{:convert-org-links}     @tab @code{org-export-html-link-org-files-as-html}
6380 @item @code{:inline-images}         @tab @code{org-export-html-inline-images}
6381 @item @code{:expand-quoted-html}    @tab @code{org-export-html-expand}
6382 @item @code{:timestamp}             @tab @code{org-export-html-with-timestamp}
6383 @item @code{:publishing-directory}  @tab @code{org-export-publishing-directory}
6384 @item @code{:preamble}              @tab @code{org-export-html-preamble}
6385 @item @code{:postamble}             @tab @code{org-export-html-postamble}
6386 @item @code{:auto-preamble}         @tab @code{org-export-html-auto-preamble}
6387 @item @code{:auto-postamble}        @tab @code{org-export-html-auto-postamble}
6388 @item @code{:author}                @tab @code{user-full-name}
6389 @item @code{:email}                 @tab @code{user-mail-address}
6390 @end multitable
6392 Most of the @code{org-export-with-*} variables have the same effect in
6393 both HTML and La@TeX{} exporters, except for @code{:TeX-macros} and
6394 @code{:LaTeX-fragments}, respectively @code{nil} and @code{t} in the
6395 La@TeX{} export.
6397 When a property is given a value in org-publish-project-alist, its
6398 setting overrides the value of the corresponding user variable (if any)
6399 during publishing.  Options set within a file (@pxref{Export
6400 options}), however, override everything.
6402 @node Publishing links, Project page index, Publishing options, Configuration
6403 @subsection Links between published files
6404 @cindex links, publishing
6406 To create a link from one Org-mode file to another, you would use
6407 something like @samp{[[file:foo.org][The foo]]} or simply
6408 @samp{file:foo.org.} (@pxref{Hyperlinks}).  Upon publishing this link
6409 becomes a link to @file{foo.html}.  In this way, you can interlink the
6410 pages of your "org web" project and the links will work as expected when
6411 you publish them to HTML.
6413 You may also link to related files, such as images. Provided you are
6414 careful with relative pathnames, and provided you have also configured
6415 org-publish to upload the related files, these links will work
6416 too. @ref{Complex example} for an example of this usage.
6418 Sometime an Org-mode file to be published may contain links that are
6419 only valid in your production environment, but not in the publishing
6420 location.  In this case, use the property 
6422 @multitable @columnfractions 0.4 0.6
6423 @item @code{:link-validation-function}
6424 @tab Function to validate links
6425 @end multitable
6427 @noindent
6428 to define a function for checking link validity.  This function must
6429 accept two arguments, the file name and a directory relative to which
6430 the file name is interpreted in the production environment.  If this
6431 function returns @code{nil}, then the HTML generator will only insert a
6432 description into the HTML file, but no link.  One option for this
6433 function is @code{org-publish-validate-link} which checks if the given
6434 file is part of any project in @code{org-publish-project-alist}.
6436 @node Project page index,  , Publishing links, Configuration
6437 @subsection Project page index
6438 @cindex index, of published pages
6440 The following properties may be used to control publishing of an
6441 index of files or summary page for a given project.
6443 @multitable @columnfractions 0.25 0.75
6444 @item @code{:auto-index}
6445 @tab When non-nil, publish an index during org-publish-current-project or
6446 org-publish-all.
6448 @item @code{:index-filename}
6449 @tab Filename for output of index. Defaults to @file{index.org} (which
6450 becomes @file{index.html}).
6452 @item @code{:index-title}
6453 @tab Title of index page. Defaults to name of file.
6455 @item @code{:index-function}
6456 @tab Plugin function to use for generation of index.
6457 Defaults to @code{org-publish-org-index}, which generates a plain list
6458 of links to all files in the project.
6459 @end multitable
6461 @node Sample configuration, Triggering publication, Configuration, Publishing
6462 @section Sample configuration
6464 Below we provide two example configurations.  The first one is a simple
6465 project publishing only a set of Org-mode files.  The second example is
6466 more complex, with a multi-component project.
6468 @menu
6469 * Simple example::              One-component publishing
6470 * Complex example::             A multi-component publishing example
6471 @end menu
6473 @node Simple example, Complex example, Sample configuration, Sample configuration
6474 @subsection Example: simple publishing configuration
6476 This example publishes a set of Org-mode files to the @file{public_html}
6477 directory on the local machine.
6479 @lisp
6480 (setq org-publish-project-alist
6481       '(("org" 
6482          :base-directory "~/org/"
6483          :publishing-directory "~/public_html"
6484          :section-numbers nil
6485          :table-of-contents nil
6486          :style "<link rel=stylesheet 
6487                 href=\"../other/mystyle.css\"
6488                 type=\"text/css\">")))
6489 @end lisp
6491 @node Complex example,  , Simple example, Sample configuration
6492 @subsection Example: complex publishing configuration
6494 This more complicated example publishes an entire website, including
6495 org files converted to HTML, image files, emacs lisp source code, and
6496 stylesheets. The publishing-directory is remote and private files are
6497 excluded.
6499 To ensure that links are preserved, care should be taken to replicate
6500 your directory structure on the web server, and to use relative file
6501 paths. For example, if your org files are kept in @file{~/org} and your
6502 publishable images in @file{~/images}, you'd link to an image with
6504 @example
6505 file:../images/myimage.png
6506 @end example
6508 On the web server, the relative path to the image should be the
6509 same. You can accomplish this by setting up an "images" folder in the
6510 right place on the webserver, and publishing images to it.
6512 @lisp
6513 (setq org-publish-project-alist
6514       '(("orgfiles"
6515           :base-directory "~/org/"
6516           :base-extension "org"
6517           :publishing-directory "/ssh:user@@host:~/html/notebook/"
6518           :publishing-function org-publish-org-to-html
6519           :exclude "PrivatePage.org"   ;; regexp
6520           :headline-levels 3
6521           :section-numbers nil
6522           :table-of-contents nil
6523           :style "<link rel=stylesheet 
6524                   href=\"../other/mystyle.css\" type=\"text/css\">"
6525           :auto-preamble t
6526           :auto-postamble nil)
6527          
6528          ("images"
6529           :base-directory "~/images/"
6530           :base-extension "jpg\\|gif\\|png"
6531           :publishing-directory "/ssh:user@@host:~/html/images/"
6532           :publishing-function org-publish-attachment)
6534          ("other"
6535           :base-directory "~/other/"
6536           :base-extension "css\\|el"
6537           :publishing-directory "/ssh:user@@host:~/html/other/"
6538           :publishing-function org-publish-attachment)
6539          ("website" :components ("orgfiles" "images" "other"))))
6540 @end lisp
6542 @node Triggering publication,  , Sample configuration, Publishing
6543 @section Triggering publication
6545 Once org-publish is properly configured, you can publish with the
6546 following functions: 
6548 @table @kbd
6549 @item C-c C-e C
6550 Prompt for a specific project and publish all files that belong to it.
6551 @item C-c C-e P
6552 Publish the project containing the current file.
6553 @item C-c C-e F
6554 Publish only the current file.
6555 @item C-c C-e A
6556 Publish all projects.
6557 @end table
6559 Org uses timestamps to track when a file has changed. The above
6560 functions normally only publish changed files. You can override this and
6561 force publishing of all files by giving a prefix argument.
6563 @node Miscellaneous, Extensions and Hacking, Publishing, Top
6564 @chapter Miscellaneous
6566 @menu
6567 * Completion::                  M-TAB knows what you need
6568 * Customization::               Adapting Org-mode to your taste
6569 * In-buffer settings::          Overview of the #+KEYWORDS
6570 * The very busy C-c C-c key::   When in doubt, press C-c C-c
6571 * Clean view::                  Getting rid of leading stars in the outline
6572 * TTY keys::                    Using Org-mode on a tty
6573 * Interaction::                 Other Emacs packages
6574 * Bugs::                        Things which do not work perfectly
6575 @end menu
6577 @node Completion, Customization, Miscellaneous, Miscellaneous
6578 @section Completion
6579 @cindex completion, of @TeX{} symbols
6580 @cindex completion, of TODO keywords
6581 @cindex completion, of dictionary words
6582 @cindex completion, of option keywords
6583 @cindex completion, of tags
6584 @cindex completion, of property keys
6585 @cindex completion, of link abbreviations
6586 @cindex @TeX{} symbol completion
6587 @cindex TODO keywords completion
6588 @cindex dictionary word completion
6589 @cindex option keyword completion
6590 @cindex tag completion
6591 @cindex link abbreviations, completion of
6593 Org-mode supports in-buffer completion.  This type of completion does
6594 not make use of the minibuffer.  You simply type a few letters into
6595 the buffer and use the key to complete text right there.
6597 @table @kbd
6598 @kindex M-@key{TAB}
6599 @item M-@key{TAB}
6600 Complete word at point
6601 @itemize @bullet
6602 @item
6603 At the beginning of a headline, complete TODO keywords.
6604 @item
6605 After @samp{\}, complete @TeX{} symbols supported by the exporter.
6606 @item
6607 After @samp{*}, complete headlines in the current buffer so that they
6608 can be used in search links like @samp{[[*find this headline]]}.
6609 @item
6610 After @samp{:} in a headline, complete tags.  The list of tags is taken
6611 from the variable @code{org-tag-alist} (possibly set through the
6612 @samp{#+TAGS} in-buffer option, @pxref{Setting tags}), or it is created
6613 dynamically from all tags used in the current buffer.
6614 @item
6615 After @samp{:} and not in a headline, complete property keys.  The list
6616 of keys is constructed dynamically from all keys used in the current
6617 buffer.
6618 @item
6619 After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}).
6620 @item
6621 After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
6622 @samp{OPTIONS} which set file-specific options for Org-mode.  When the
6623 option keyword is already complete, pressing @kbd{M-@key{TAB}} again
6624 will insert example settings for this keyword.
6625 @item
6626 In the line after @samp{#+STARTUP: }, complete startup keywords,
6627 i.e. valid keys for this line.
6628 @item
6629 Elsewhere, complete dictionary words using ispell.
6630 @end itemize
6631 @end table
6633 @node Customization, In-buffer settings, Completion, Miscellaneous
6634 @section Customization
6635 @cindex customization
6636 @cindex options, for customization
6637 @cindex variables, for customization
6639 There are more than 180 variables that can be used to customize
6640 Org-mode.  For the sake of compactness of the manual, I am not
6641 describing the variables here.  A structured overview of customization
6642 variables is available with @kbd{M-x org-customize}.  Or select
6643 @code{Browse Org Group} from the @code{Org->Customization} menu.  Many
6644 settings can also be activated on a per-file basis, by putting special
6645 lines into the buffer (@pxref{In-buffer settings}).
6647 @node In-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
6648 @section Summary of in-buffer settings
6649 @cindex in-buffer settings
6650 @cindex special keywords
6652 Org-mode uses special lines in the buffer to define settings on a
6653 per-file basis.  These lines start with a @samp{#+} followed by a
6654 keyword, a colon, and then individual words defining a setting.  Several
6655 setting words can be in the same line, but you can also have multiple
6656 lines for the keyword.  While these settings are described throughout
6657 the manual, here is a summary.  After changing any of those lines in the
6658 buffer, press @kbd{C-c C-c} with the cursor still in the line to
6659 activate the changes immediately.  Otherwise they become effective only
6660 when the file is visited again in a new Emacs session.
6662 @table @kbd
6663 @item #+ARCHIVE: %s_done::
6664 This line sets the archive location for the agenda file.  It applies for
6665 all subsequent lines until the next @samp{#+ARCHIVE} line, or the end
6666 of the file.  The first such line also applies to any entries before it.
6667 The corresponding variable is @code{org-archive-location}.
6668 @item #+CATEGORY:
6669 This line sets the category for the agenda file.  The category applies
6670 for all subsequent lines until the next @samp{#+CATEGORY} line, or the
6671 end of the file.  The first such line also applies to any entries before it.
6672 @item #+COLUMNS: %25ITEM .....
6673 Set the default format for columns view.  This format applies when
6674 columns view is invoked in location where no COLUMNS property applies.
6675 @item #+CONSTANTS: name1=value1 ...
6676 Set file-local values for constants to be used in table formulas.  This
6677 line set the local variable @code{org-table-formula-constants-local}.
6678 The global version of theis variable is
6679 @code{org-table-formula-constants}.
6680 corresponding 
6681 @item #+LINK:  linkword replace
6682 These lines (several are allowed) specify link abbreviations.
6683 @xref{Link abbreviations}.  The corresponding variable is
6684 @code{org-link-abbrev-alist}.
6685 @item #+PRIORITIES: highest lowest default
6686 This line sets the limits and the default for the priorities.  All three
6687 must be either letters A-Z or numbers 0-9.  The highest priority must
6688 have a lower ASCII number that the lowest priority.
6689 @item #+PROPERTY: Property_Name Value
6690 This line sets a default inheritance value for entries in the current
6691 buffer, most useful for specifying the allowed values of a property.
6692 @item #+STARTUP:
6693 This line sets options to be used at startup of Org-mode, when an
6694 Org-mode file is being visited.  The first set of options deals with the
6695 initial visibility of the outline tree.  The corresponding variable for
6696 global default settings is @code{org-startup-folded}, with a default
6697 value @code{t}, which means @code{overview}.
6698 @cindex @code{overview}, STARTUP keyword
6699 @cindex @code{content}, STARTUP keyword
6700 @cindex @code{showall}, STARTUP keyword
6701 @example
6702 overview   @r{top-level headlines only}
6703 content    @r{all headlines}
6704 showall    @r{no folding at all, show everything}
6705 @end example
6706 Then there are options for aligning tables upon visiting a file.  This
6707 is useful in files containing narrowed table columns.  The corresponding
6708 variable is @code{org-startup-align-all-tables}, with a default value
6709 @code{nil}. 
6710 @cindex @code{align}, STARTUP keyword
6711 @cindex @code{noalign}, STARTUP keyword
6712 @example
6713 align      @r{align all tables}
6714 noalign    @r{don't align tables on startup}
6715 @end example
6716 Logging TODO state changes and clock intervals (variable
6717 @code{org-log-done}) can be configured using these options.
6718 @cindex @code{logdone}, STARTUP keyword
6719 @cindex @code{nologging}, STARTUP keyword
6720 @cindex @code{lognotedone}, STARTUP keyword
6721 @cindex @code{lognoteclock-out}, STARTUP keyword
6722 @cindex @code{lognotestate}, STARTUP keyword
6723 @cindex @code{logrepeat}, STARTUP keyword
6724 @cindex @code{nologrepeat}, STARTUP keyword
6725 @example
6726 logging          @r{record a timestamp when an item is marked DONE}
6727 nologging        @r{don't record when items are marked DONE}
6728 lognotedone      @r{record timestamp and a note when DONE}
6729 lognotestate     @r{record timestamp and a note when TODO state changes}
6730 logrepeat        @r{record a note when re-instating a repeating item}
6731 nologrepeat      @r{do not record when re-instating repeating item}
6732 lognoteclock-out @r{record timestamp and a note when clocking out}
6733 @end example
6734 Here are the options for hiding leading stars in outline headings.  The
6735 corresponding variables are @code{org-hide-leading-stars} and
6736 @code{org-odd-levels-only}, both with a default setting @code{nil}
6737 (meaning @code{showstars} and @code{oddeven}).
6738 @cindex @code{hidestars}, STARTUP keyword
6739 @cindex @code{showstars}, STARTUP keyword
6740 @cindex @code{odd}, STARTUP keyword
6741 @cindex @code{even}, STARTUP keyword
6742 @example
6743 hidestars  @r{make all but one of the stars starting a headline invisible.}
6744 showstars  @r{show all stars starting a headline}
6745 odd        @r{allow only odd outline levels (1,3,...)}
6746 oddeven    @r{allow all outline levels}
6747 @end example
6748 To turn on custom format overlays over time stamps (variables
6749 @code{org-put-time-stamp-overlays} and
6750 @code{org-time-stamp-overlay-formats}), use
6751 @cindex @code{customtime}, STARTUP keyword
6752 @example
6753 customtime @r{overlay custom time format}
6754 @end example
6755 The following options influence the table spreadsheet (variable
6756 @code{constants-unit-system}).
6757 @cindex @code{constcgs}, STARTUP keyword
6758 @cindex @code{constSI}, STARTUP keyword
6759 @example
6760 constcgs   @r{@file{constants.el} should use the c-g-s unit system}
6761 constSI    @r{@file{constants.el} should use the SI unit system}
6762 @end example
6763 @item #+TAGS:  TAG1(c1) TAG2(c2)
6764 These lines (several such lines are allowed) specify the legal tags in
6765 this file, and (potentially) the corresponding @emph{fast tag selection}
6766 keys.  The corresponding variable is @code{org-tag-alist}.
6767 @item #+TBLFM:
6768 This line contains the formulas for the table directly above the line.
6769 @item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS:
6770 These lines provide settings for exporting files.  For more details see
6771 @ref{Export options}.
6772 @item #+SEQ_TODO:   #+TYP_TODO:
6773 These lines set the TODO keywords and their interpretation in the
6774 current file.  The corresponding variables are @code{org-todo-keywords}
6775 and @code{org-todo-interpretation}.
6776 @end table
6778 @node The very busy C-c C-c key, Clean view, In-buffer settings, Miscellaneous
6779 @section The very busy C-c C-c key
6780 @kindex C-c C-c
6781 @cindex C-c C-c, overview
6783 The key @kbd{C-c C-c} has many purposes in org-mode, which are all
6784 mentioned scattered throughout this manual.  One specific function of
6785 this key is to add @emph{tags} to a headline (@pxref{Tags}).  In many
6786 other circumstances it means something like @emph{Hey Org-mode, look
6787 here and update according to what you see here}.  Here is a summary of
6788 what this means in different contexts.
6790 @itemize @minus
6791 @item
6792 If there are highlights in the buffer from the creation of a sparse
6793 tree, or from clock display, remove these highlights.
6794 @item
6795 If the cursor is in one of the special @code{#+KEYWORD} lines, this
6796 triggers scanning the buffer for these lines and updating the
6797 information. 
6798 @item
6799 If the cursor is inside a table, realign the table.  This command
6800 works even if the automatic table editor has been turned off.
6801 @item
6802 If the cursor is on a @code{#+TBLFM} line, re-apply the formulas to
6803 the entire table.
6804 @item
6805 If the cursor is inside a table created by the @file{table.el} package,
6806 activate that table.
6807 @item
6808 If the current buffer is a remember buffer, close the note and file it.
6809 With a prefix argument, file it, without further interaction, to the
6810 default location.
6811 @item
6812 If the cursor is on a @code{<<<target>>>}, update radio targets and
6813 corresponding links in this buffer.
6814 @item
6815 If the cursor is in a property line or at the start or end of a property
6816 drawer, offer property commands.
6817 @item
6818 If the cursor is in a plain list item with a checkbox, toggle the status
6819 of the checkbox.
6820 @item
6821 If the cursor is on a numbered item in a plain list, renumber the
6822 ordered list.
6823 @end itemize
6825 @node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous
6826 @section A cleaner outline view
6827 @cindex hiding leading stars
6828 @cindex clean outline view
6830 Some people find it noisy and distracting that the Org-mode headlines
6831 are starting with a potentially large number of stars.  For example
6832 the tree from @ref{Headlines}:
6834 @example
6835 * Top level headline
6836 ** Second level
6837 *** 3rd level
6838     some text
6839 *** 3rd level
6840     more text
6841 * Another top level headline
6842 @end example
6844 @noindent
6845 Unfortunately this is deeply ingrained into the code of Org-mode and
6846 cannot be easily changed.  You can, however, modify the display in such
6847 a way that all leading stars become invisible and the outline more easy
6848 to read.  To do this, customize the variable
6849 @code{org-hide-leading-stars} like this:
6851 @lisp
6852 (setq org-hide-leading-stars t)
6853 @end lisp
6855 @noindent
6856 or change this on a per-file basis with one of the lines (anywhere in
6857 the buffer)
6859 @example
6860 #+STARTUP: showstars
6861 #+STARTUP: hidestars
6862 @end example
6864 @noindent
6865 Press @kbd{C-c C-c} with the cursor in a @samp{STARTUP} line to activate
6866 the modifications.
6868 With stars hidden, the tree becomes:
6870 @example
6871 * Top level headline
6872  * Second level
6873   * 3rd level
6874     some text
6875   * 3rd level
6876     more text
6877 * Another top level headline
6878 @end example
6880 @noindent
6881 Note that the leading stars are not truly replaced by whitespace, they
6882 are only fontified with the face @code{org-hide} that uses the
6883 background color as font color.  If you are not using either white or
6884 black background, you may have to customize this face to get the wanted
6885 effect.  Another possibility is to set this font such that the extra
6886 stars are @i{almost} invisible, for example using the color
6887 @code{grey90} on a white background.
6889 Things become cleaner still if you skip all the even levels and use only
6890 odd levels 1, 3, 5..., effectively adding two stars to go from one
6891 outline level to the next:
6893 @example
6894 * Top level headline
6895   * Second level
6896     * 3rd level
6897       some text
6898     * 3rd level
6899       more text
6900 * Another top level headline
6901 @end example
6903 @noindent
6904 In order to make the structure editing and export commands handle this
6905 convention correctly, use
6907 @lisp
6908 (setq org-odd-levels-only t)
6909 @end lisp
6911 @noindent
6912 or set this on a per-file basis with one of the following lines (don't
6913 forget to press @kbd{C-c C-c} with the cursor in the startup line to
6914 activate changes immediately).
6916 @example
6917 #+STARTUP: odd
6918 #+STARTUP: oddeven
6919 @end example
6921 You can convert an Org-mode file from single-star-per-level to the
6922 double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
6923 RET} in that file.  The reverse operation is @kbd{M-x
6924 org-convert-to-oddeven-levels}.
6926 @node TTY keys, Interaction, Clean view, Miscellaneous
6927 @section Using org-mode on a tty
6928 @cindex tty keybindings
6930 Org-mode uses a number of keys that are not accessible on a tty.  This
6931 applies to most special keys like cursor keys, @key{TAB} and
6932 @key{RET}, when these are combined with modifier keys like @key{Meta}
6933 and/or @key{Shift}.  Org-mode uses these bindings because it needs to
6934 provide keys for a large number of commands, and because these keys
6935 appeared particularly easy to remember.  In order to still be able to
6936 access the core functionality of Org-mode on a tty, alternative
6937 bindings are provided.  Here is a complete list of these bindings,
6938 which are obviously more cumbersome to use.  Note that sometimes a
6939 work-around can be better.  For example changing a time stamp is
6940 really only fun with @kbd{S-@key{cursor}} keys.  On a tty you would
6941 rather use @kbd{C-c .}  to re-insert the timestamp.
6943 @multitable @columnfractions 0.15 0.2 0.2
6944 @item @b{Default} @tab @b{Alternative 1} @tab @b{Alternative 2}
6945 @item @kbd{S-@key{TAB}}     @tab @kbd{C-u @key{TAB}}       @tab
6946 @item @kbd{M-@key{left}}    @tab @kbd{C-c C-x l}           @tab @kbd{@key{Esc} @key{left}}
6947 @item @kbd{M-S-@key{left}}  @tab @kbd{C-c C-x L}           @tab
6948 @item @kbd{M-@key{right}}   @tab @kbd{C-c C-x r}           @tab @kbd{@key{Esc} @key{right}}
6949 @item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R}           @tab
6950 @item @kbd{M-@key{up}}      @tab @kbd{C-c C-x u}           @tab @kbd{@key{Esc} @key{up}}
6951 @item @kbd{M-S-@key{up}}    @tab @kbd{C-c C-x U}           @tab
6952 @item @kbd{M-@key{down}}    @tab @kbd{C-c C-x d}           @tab @kbd{@key{Esc} @key{down}}
6953 @item @kbd{M-S-@key{down}}  @tab @kbd{C-c C-x D}           @tab
6954 @item @kbd{S-@key{RET}}     @tab @kbd{C-c C-x c}           @tab
6955 @item @kbd{M-@key{RET}}     @tab @kbd{C-c C-x m}           @tab @kbd{@key{Esc} @key{RET}}
6956 @item @kbd{M-S-@key{RET}}   @tab @kbd{C-c C-x M}           @tab
6957 @item @kbd{S-@key{left}}    @tab @kbd{C-c @key{left}}      @tab
6958 @item @kbd{S-@key{right}}   @tab @kbd{C-c @key{right}}     @tab
6959 @item @kbd{S-@key{up}}      @tab @kbd{C-c @key{up}}        @tab
6960 @item @kbd{S-@key{down}}    @tab @kbd{C-c @key{down}}      @tab
6961 @item @kbd{C-S-@key{left}}  @tab @kbd{C-c C-x @key{left}}  @tab
6962 @item @kbd{C-S-@key{right}} @tab @kbd{C-c C-x @key{right}} @tab
6963 @end multitable
6965 @node Interaction, Bugs, TTY keys, Miscellaneous
6966 @section Interaction with other packages
6967 @cindex packages, interaction with other
6968 Org-mode lives in the world of GNU Emacs and interacts in various ways
6969 with other code out there.
6971 @menu
6972 * Cooperation::                 Packages Org-mode cooperates with
6973 * Conflicts::                   Packages that lead to conflicts
6974 @end menu
6976 @node Cooperation, Conflicts, Interaction, Interaction
6977 @subsection Packages that Org-mode cooperates with
6979 @table @asis
6980 @cindex @file{calc.el}
6981 @item @file{calc.el} by Dave Gillespie
6982 Org-mode uses the calc package for implementing spreadsheet
6983 functionality in its tables (@pxref{The spreadsheet}).  Org-mode
6984 checks for the availability of calc by looking for the function
6985 @code{calc-eval} which should be autoloaded in your setup if calc has
6986 been installed properly.  As of Emacs 22, calc is part of the Emacs
6987 distribution.  Another possibility for interaction between the two
6988 packages is using calc for embedded calculations. @xref{Embedded Mode,
6989 , Embedded Mode, calc, GNU Emacs Calc Manual}.
6990 @cindex @file{constants.el}
6991 @item @file{constants.el} by Carsten Dominik
6992 In a table formula (@pxref{The spreadsheet}), it is possible to use
6993 names for natural constants or units.  Instead of defining your own
6994 constants in the variable @code{org-table-formula-constants}, install
6995 the @file{constants} package which defines a large number of constants
6996 and units, and lets you use unit prefixes like @samp{M} for
6997 @samp{Mega} etc.  You will need version 2.0 of this package, available
6998 at @url{http://www.astro.uva.nl/~dominik/Tools}. Org-mode checks for
6999 the function @code{constants-get}, which has to be autoloaded in your
7000 setup.  See the installation instructions in the file
7001 @file{constants.el}.
7002 @item @file{cdlatex.el} by Carsten Dominik
7003 @cindex @file{cdlatex.el}
7004 Org-mode can make use of the cdlatex package to efficiently enter
7005 La@TeX{} fragments into Org-mode files. See @ref{CDLaTeX mode}.
7006 @item @file{remember.el} by John Wiegley
7007 @cindex @file{remember.el}
7008 Org mode cooperates with remember, see @ref{Remember}.
7009 @file{Remember.el} is not part of Emacs, find it on the web.
7010 @cindex @file{table.el}
7011 @item @file{table.el} by Takaaki Ota
7012 @kindex C-c C-c
7013 @cindex table editor, @file{table.el}
7014 @cindex @file{table.el}
7016 Complex ASCII tables with automatic line wrapping, column- and
7017 row-spanning, and alignment can be created using the Emacs table
7018 package by Takaaki Ota (@uref{http://sourceforge.net/projects/table},
7019 and also part of Emacs 22).
7020 When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org-mode
7021 will call @command{table-recognize-table} and move the cursor into the
7022 table.  Inside a table, the keymap of Org-mode is inactive.  In order
7023 to execute Org-mode-related commands, leave the table.
7025 @table @kbd
7026 @kindex C-c C-c
7027 @item C-c C-c
7028 Recognize @file{table.el} table.  Works when the cursor is in a
7029 table.el table.
7031 @kindex C-c ~
7032 @item C-c ~
7033 Insert a table.el table.  If there is already a table at point, this
7034 command converts it between the table.el format and the Org-mode
7035 format.  See the documentation string of the command
7036 @code{org-convert-table} for the restrictions under which this is
7037 possible.
7038 @end table
7039 @file{table.el} is part of Emacs 22.
7040 @cindex @file{footnote.el}
7041 @item @file{footnote.el} by Steven L. Baur
7042 Org-mode recognizes numerical footnotes as provided by this package
7043 (@pxref{Footnotes}).
7044 @end table
7046 @node Conflicts,  , Cooperation, Interaction
7047 @subsection Packages that lead to conflicts with Org-mode
7049 @table @asis
7051 @cindex @file{allout.el}
7052 @item @file{allout.el} by Ken Manheimer
7053 Startup of Org-mode may fail with the error message
7054 @code{(wrong-type-argument keymapp nil)} when there is an outdated
7055 version @file{allout.el} on the load path, for example the version
7056 distributed with Emacs 21.x.  Upgrade to Emacs 22 and this problem will
7057 disappear.  If for some reason you cannot do this, make sure that org.el
7058 is loaded @emph{before} @file{allout.el}, for example by putting
7059 @code{(require 'org)} early enough into your @file{.emacs} file.
7061 @cindex @file{CUA.el}
7062 @item @file{CUA.el} by Kim. F. Storm
7063 Keybindings in Org-mode conflict with the @kbd{S-<cursor>} keys
7064 used by CUA-mode (as well as pc-select-mode and s-region-mode) to
7065 select and extend the region.  If you want to use one of these
7066 packages along with Org-mode, configure the variable
7067 @code{org-CUA-compatible}.  When set, Org-mode will move the following
7068 keybindings in Org-mode files, and in the agenda buffer (but not
7069 during date selection).
7071 @example
7072 S-UP    -> M-p             S-DOWN  -> M-n
7073 S-LEFT  -> M--             S-RIGHT -> M-+
7074 @end example
7076 Yes, these are unfortunately more difficult to remember.  If you want
7077 to have other replacement keys, look at the variable
7078 @code{org-disputed-keys}.
7079 @item @file{windmove.el} by Hovav Shacham
7080 @cindex @file{windmove.el}
7081 Also this package uses the @kbd{S-<cursor>} keys, so everything written
7082 in the paragraph above about CUA mode also applies here.
7084 @cindex @file{footnote.el}
7085 @item @file{footnote.el} by Steven L. Baur
7086 Org-mode supports the syntax of the footnote package, but only the
7087 numerical footnote markers.  Also, the default key for footnote
7088 commands, @kbd{C-c !} is already used by Org-mode.  You could use the
7089 variable @code{footnote-prefix} to switch footnotes commands to another
7090 key.  Or, you could use @code{org-replace-disputed-keys} and
7091 @code{org-disputed-keys} to change the settings in Org-mode.
7093 @end table
7096 @node Bugs,  , Interaction, Miscellaneous
7097 @section Bugs
7098 @cindex bugs
7100 Here is a list of things that should work differently, but which I
7101 have found too hard to fix.
7103 @itemize @bullet
7104 @item
7105 If a table field starts with a link, and if the corresponding table
7106 column is narrowed (@pxref{Narrow columns}) to a width too small to
7107 display the link, the field would look entirely empty even though it is
7108 not.  To prevent this, Org-mode throws an error.  The work-around is to
7109 make the column wide enough to fit the link, or to add some text (at
7110 least 2 characters) before the link in the same field.
7111 @item
7112 Narrowing table columns does not work on XEmacs, because the
7113 @code{format} function does not transport text properties.
7114 @item
7115 Text in an entry protected with the @samp{QUOTE} keyword should not
7116 autowrap.
7117 @item
7118 When the application called by @kbd{C-c C-o} to open a file link fails
7119 (for example because the application does not exist or refuses to open
7120 the file), it does so silently.  No error message is displayed.
7121 @item
7122 Recalculating a table line applies the formulas from left to right.
7123 If a formula uses @emph{calculated} fields further down the row,
7124 multiple recalculation may be needed to get all fields consistent.  You
7125 may use the command @code{org-table-iterate} (@kbd{C-u C-c *}) to
7126 recalculate until convergence.
7127 @item
7128 A single letter cannot be made bold, for example @samp{*a*}.
7129 @item
7130 The exporters work well, but could be made more efficient.
7131 @end itemize
7134 @node Extensions and Hacking, History and Acknowledgments, Miscellaneous, Top
7135 @appendix Extensions, Hooks and Hacking
7137 This appendix lists extensions for Org-mode written by other authors.
7138 It also covers some aspects where users can extend the functionality of
7139 Org-mode.
7141 @menu
7142 * Extensions::                  Existing 3rd-part extensions
7143 * Adding hyperlink types::      New custom link types
7144 * Tables in arbitrary syntax::  Orgtbl for LaTeX and other programs
7145 * Dynamic blocks::              Automatically filled blocks
7146 * Special agenda views::        Customized views
7147 * Using the property API::      Writing programs that use entry properties
7148 @end menu
7150 @node Extensions, Adding hyperlink types, Extensions and Hacking, Extensions and Hacking
7151 @section Third-party extensions for Org-mode
7152 @cindex extension, third-party
7154 The following extensions for Org-mode have been written by other people:
7156 @table @asis
7157 @cindex @file{org-publish.el}
7158 @item @file{org-publish.el} by David O'Toole
7159 This package provides facilities for publishing related sets of Org-mode
7160 files together with linked files like images as webpages.  It is
7161 highly configurable and can be used for other publishing purposes as
7162 well.  As of Org-mode version 4.30, @file{org-publish.el} is part of the
7163 Org-mode distribution.  It is not yet part of Emacs, however, a delay
7164 caused by the preparations for the 22.1 release.  In the mean time,
7165 @file{org-publish.el} can be downloaded from David's site:
7166 @url{http://dto.freeshell.org/e/org-publish.el}.
7167 @cindex @file{org-mouse.el}
7168 @item @file{org-mouse.el} by Piotr Zielinski
7169 This package implements extended mouse functionality for Org-mode.  It
7170 allows you to cycle visibility and to edit the document structure with
7171 the mouse.  Best of all, it provides a context-sensitive menu on
7172 @key{mouse-3} that changes depending on the context of a mouse-click.
7173 As of Org-mode version 4.53, @file{org-mouse.el} is part of the
7174 Org-mode distribution.  It is not yet part of Emacs, however, a delay
7175 caused by the preparations for the 22.1 release.  In the mean time,
7176 @file{org-mouse.el} can be downloaded from Piotr's site:
7177 @url{http://www.cl.cam.ac.uk/~pz215/files/org-mouse.el}.
7178 @cindex @file{org-blog.el}
7179 @item @file{org-blog.el} by David O'Toole
7180 A blogging plug-in for @file{org-publish.el}.@*
7181 @url{http://dto.freeshell.org/notebook/OrgMode.html}.
7182 @cindex @file{blorg.el}
7183 @item @file{blorg.el} by Bastien Guerry
7184 Publish Org-mode files as
7185 blogs. @url{http://www.cognition.ens.fr/~guerry/blorg.html}.
7186 @cindex @file{org2rem.el}
7187 @item @file{org2rem.el} by Bastien Guerry
7188 Translates Org-mode files into something readable by
7189 Remind. @url{http://www.cognition.ens.fr/~guerry/u/org2rem.el}.
7190 @end table
7192 @page
7194 @node Adding hyperlink types, Tables in arbitrary syntax, Extensions, Extensions and Hacking
7195 @section Adding hyperlink types
7196 @cindex hyperlinks, adding new types
7198 Org-mode has a large number of hyperlink types built-in
7199 (@pxref{Hyperlinks}).  If you would like to add new link types, it
7200 provides an interface for doing so.  Lets look at an example file
7201 @file{org-man.el} that will add support for creating links like
7202 @samp{[[man:printf][The printf manpage]]} to show unix manual pages inside
7203 emacs:
7205 @lisp
7206 ;;; org-man.el - Support for links to manpages in Org-mode
7208 (require 'org)
7210 (org-add-link-type "man" 'org-man-open)
7211 (add-hook 'org-store-link-functions 'org-man-store-link)
7213 (defcustom org-man-command 'man
7214   "The Emacs command to be used to display a man page."
7215   :group 'org-link
7216   :type '(choice (const man) (const woman)))
7218 (defun org-man-open (path)
7219   "Visit the manpage on PATH.
7220 PATH should be a topic that can be thrown at the man command."
7221   (funcall org-man-command path))
7223 (defun org-man-store-link ()
7224   "Store a link to a manpage."
7225   (when (memq major-mode '(Man-mode woman-mode))
7226     ;; This is a man page, we do make this link
7227     (let* ((page (org-man-get-page-name))
7228            (link (concat "man:" page))
7229            (description (format "Manpage for %s" page)))
7230       (org-store-link-props
7231        :type "man"
7232        :link link
7233        :description description))))
7235 (defun org-man-get-page-name ()
7236   "Extract the page name from the buffer name."
7237   ;; This works for both `Man-mode' and `woman-mode'.
7238   (if (string-match " \\(\\S-+\\)\\*" (buffer-name))
7239       (match-string 1 (buffer-name))
7240     (error "Cannot create link to this man page")))
7242 (provide 'org-man)
7244 ;;; org-man.el ends here
7245 @end lisp
7247 @noindent
7248 You would activate this new link type in @file{.emacs} with
7250 @lisp
7251 (require 'org-man)
7252 @end lisp
7254 @noindent
7255 Lets go through the file and see what it does.
7256 @enumerate
7257 @item 
7258 It does @code{(require 'org)} to make sure that @file{org.el} has been
7259 loaded.
7260 @item
7261 The next line calls @code{org-add-link-type} to define a new link type
7262 with prefix @samp{man}.  The call also contains the name of a function
7263 that will be called to follow such a link.
7264 @item
7265 The next line adds a function to @code{org-store-link-functions}, in
7266 order to allow the command @kbd{C-c l} to record a useful link in a
7267 buffer displaying a man page.
7268 @end enumerate
7270 The rest of the file defines the necessary variables and functions.
7271 First there is a customization variable that determines which emacs
7272 command should be used to display manpages.  There are two options,
7273 @code{man} and @code{woman}.  Then the function to follow a link is
7274 defined.  It gets the link path as an argument - in this case the link
7275 path is just a topic for the manual command.  The function calls the
7276 value of @code{org-man-command} to display the man page.
7278 Finally the function @code{org-man-store-link} is defined.  When you try
7279 to store a link with @kbd{C-c l}, also this function will be called to
7280 try to make a link.  The function must first decide if it is supposed to
7281 create the link for this buffer type, we do this by checking the value
7282 of the variable @code{major-mode}.  If not, the function must exit and
7283 retunr the value @code{nil}.  If yes, the link is created by getting the
7284 manual tpoic from the buffer name and prefixing it with the string
7285 @samp{man:}.  Then it must call the command @code{org-store-link-props}
7286 and set the @code{:type} and @code{:link} properties.  Optionally you
7287 can also set the @code{:description} property to provide a default for
7288 the link description when the link is later inserted into tan Org-mode
7289 buffer with @kbd{C-c C-l}.
7291 @node Tables in arbitrary syntax, Dynamic blocks, Adding hyperlink types, Extensions and Hacking
7292 @section Tables in arbitrary syntax
7293 @cindex tables, in other modes
7294 @cindex orgtbl-mode
7296 Since Orgtbl-mode can be used as a minor mode in arbitrary buffers, a
7297 frequent feature request has been to make it work with native tables in
7298 specific languages, for example La@TeX{}.  However, this is extremely hard
7299 to do in a general way, would lead to a customization nightmare, and
7300 would take away much of the simplicity of the Orgtbl-mode table editor.
7302 This appendix describes a different approach.  We keep the Orgtbl-mode
7303 table in its native format (the @i{source table}), and use a custom
7304 function to @i{translate} the table to the correct syntax, and to
7305 @i{install} it in the right location (the @i{target table}).  This puts
7306 the burden of writing conversion functions on the user, but it allows
7307 for a very flexible system.
7309 @menu
7310 * Radio tables::                Sending and receiving
7311 * A LaTeX example::             Step by step, almost a tutorial
7312 * Translator functions::        Copy and modify
7313 @end menu
7315 @node Radio tables, A LaTeX example, Tables in arbitrary syntax, Tables in arbitrary syntax
7316 @subsection Radio tables
7317 @cindex radio tables
7319 To define the location of the target table, you first need to create two
7320 lines that are comments in the current mode, but contain magic words for
7321 Orgtbl-mode to find.  Orgtbl-mode will insert the translated table
7322 between these lines, replacing whatever was there before.  For example:
7324 @example
7325 /* BEGIN RECEIVE ORGTBL table_name */
7326 /* END RECEIVE ORGTBL table_name */
7327 @end example
7329 @noindent
7330 Just above the source table, we put a special line that tells
7331 Orgtbl-mode how to translate this table and where to install it.  For
7332 example:
7333 @example
7334 #+ORGTBL: SEND table_name translation_function arguments....
7335 @end example
7337 @noindent
7338 @code{table_name} is the reference name for the table that is also used
7339 in the receiver lines. @code{translation_function} is the Lisp function
7340 that does the translation.  Furthermore, the line can contain a list of
7341 arguments (alternating key and value) at the end.  The arguments will be
7342 passed as a property list to the translation function for
7343 interpretation.  A few standard parameters are already recognized and
7344 acted upon before the translation function is called:
7346 @table @code
7347 @item :skip N
7348 Skip the first N lines of the table. Hlines do count!
7349 @item :skipcols (n1 n2 ...)
7350 List of columns that should be skipped.  If the table has a column with
7351 calculation marks, that column is automatically discarded as well.
7352 Please note that the translator function sees the table @emph{after} the
7353 removal of these columns, the function never knows that there have been
7354 additional columns.
7355 @end table
7357 @noindent
7358 The one problem remaining is how to keep the source table in the buffer
7359 without disturbing the normal workings of the file, for example during
7360 compilation of a C file or processing of a La@TeX{} file.  There are a
7361 number of different solutions:
7363 @itemize @bullet
7364 @item
7365 The table could be placed in a block comment if that is supported by the
7366 language.  For example, in C-mode you could wrap the table between
7367 @samp{/*} and @samp{*/} lines.
7368 @item 
7369 Sometimes it is possible to put the table after some kind of @i{END}
7370 statement, for example @samp{\bye} in TeX and @samp{\end@{document@}}
7371 in La@TeX{}.
7372 @item
7373 You can just comment the table line by line whenever you want to process
7374 the file, and uncomment it whenever you need to edit the table.  This
7375 only sounds tedious - the command @kbd{M-x orgtbl-toggle-comment} does
7376 make this comment-toggling very easy, in particular if you bind it to a
7377 key.
7378 @end itemize
7380 @node A LaTeX example, Translator functions, Radio tables, Tables in arbitrary syntax
7381 @subsection A LaTeX example
7382 @cindex LaTeX, and orgtbl-mode
7384 The best way to wrap the source table in La@TeX{} is to use the
7385 @code{comment} environment provided by @file{comment.sty}.  It has to be
7386 activated by placing @code{\usepackage@{comment@}} into the document
7387 header.  Orgtbl-mode can insert a radio table skeleton@footnote{By
7388 default this works only for La@TeX{}, HTML, and TeXInfo.  Configure the
7389 variable @code{orgtbl-radio-tables} to install templates for other
7390 modes.}  with the command @kbd{M-x orgtbl-insert-radio-table}.  You will
7391 be prompted for a table name, lets say we use @samp{salesfigures}.  You
7392 will then get the following template:
7394 @example
7395 % BEGIN RECEIVE ORGTBL salesfigures
7396 % END RECEIVE ORGTBL salesfigures
7397 \begin@{comment@}
7398 #+ORGTBL: SEND salesfigures orgtbl-to-latex
7399 | | |
7400 \end@{comment@}
7401 @end example
7403 @noindent
7404 The @code{#+ORGTBL: SEND} line tells orgtbl-mode to use the function
7405 @code{orgtbl-to-latex} to convert the table into La@TeX{} and to put it
7406 into the receiver location with name @code{salesfigures}.  You may now
7407 fill in the table, feel free to use the spreadsheet features@footnote{If
7408 the @samp{#+TBLFM} line contains an odd number of dollar characters,
7409 this may cause problems with font-lock in latex-mode.  As shown in the
7410 example you can fix this by adding an extra line inside the
7411 @code{comment} environment that is used to balance the dollar
7412 expressions.  If you are using AUCTeX with the font-latex library, a
7413 much better solution is to add the @code{comment} environment to the
7414 variable @code{LaTeX-verbatim-environments}.}:
7416 @example
7417 % BEGIN RECEIVE ORGTBL salesfigures
7418 % END RECEIVE ORGTBL salesfigures
7419 \begin@{comment@}
7420 #+ORGTBL: SEND salesfigures orgtbl-to-latex
7421 | Month | Days | Nr sold | per day |
7422 |-------+------+---------+---------|
7423 | Jan   |   23 |      55 |     2.4 |
7424 | Feb   |   21 |      16 |     0.8 |
7425 | March |   22 |     278 |    12.6 |
7426 #+TBLFM: $4=$3/$2;%.1f
7427 % $ (optional extra dollar to keep font-lock happy, see footnote)
7428 \end@{comment@}
7429 @end example
7431 @noindent
7432 When you are done, press @kbd{C-c C-c} in the table to get the converted
7433 table inserted between the two marker lines.
7435 Now lets assume you want to make the table header by hand, because you
7436 want to control how columns are aligned etc.  In this case we make sure
7437 that the table translator does skip the first 2 lines of the source
7438 table, and tell the command to work as a @i{splice}, i.e. to not produce
7439 header and footer commands of the target table:
7441 @example
7442 \begin@{tabular@}@{lrrr@}
7443 Month & \multicolumn@{1@}@{c@}@{Days@} & Nr.\ sold & per day\\
7444 % BEGIN RECEIVE ORGTBL salesfigures
7445 % END RECEIVE ORGTBL salesfigures
7446 \end@{tabular@}
7448 \begin@{comment@}
7449 #+ORGTBL: SEND salesfigures orgtbl-to-latex :splice t :skip 2
7450 | Month | Days | Nr sold | per day |
7451 |-------+------+---------+---------|
7452 | Jan   |   23 |      55 |     2.4 |
7453 | Feb   |   21 |      16 |     0.8 |
7454 | March |   22 |     278 |    12.6 |
7455 #+TBLFM: $4=$3/$2;%.1f
7456 \end@{comment@}
7457 @end example
7459 The La@TeX{} translator function @code{orgtbl-to-latex} is already part of
7460 Orgtbl-mode.  It uses a @code{tabular} environment to typeset the table
7461 and marks horizontal lines with @code{\hline}.  Furthermore, it
7462 interprets the following parameters:
7464 @table @code
7465 @item :splice nil/t
7466 When set to t, return only table body lines, don't wrap them into a
7467 tabular environment.  Default is nil.
7469 @item :fmt fmt
7470 A format to be used to wrap each field, should contain @code{%s} for the
7471 original field value.  For example, to wrap each field value in dollars,
7472 you could use @code{:fmt "$%s$"}.  This may also be a property list with
7473 column numbers and formats. for example @code{:fmt (2 "$%s$" 4 "%s\\%%")}.
7475 @item :efmt efmt
7476 Use this format to print numbers with exponentials.  The format should
7477 have @code{%s} twice for inserting mantissa and exponent, for example
7478 @code{"%s\\times10^@{%s@}"}.  The default is @code{"%s\\,(%s)"}.  This
7479 may also be a property list with column numbers and formats, for example
7480 @code{:efmt (2 "$%s\\times10^@{%s@}$" 4 "$%s\\cdot10^@{%s@}$")}.  After
7481 @code{efmt} has been applied to a value, @code{fmt} will also be
7482 applied.
7483 @end table
7485 @node Translator functions,  , A LaTeX example, Tables in arbitrary syntax
7486 @subsection Translator functions
7487 @cindex HTML, and orgtbl-mode
7488 @cindex translator function
7490 Orgtbl-mode has several translator functions built-in:
7491 @code{orgtbl-to-latex}, @code{orgtbl-to-html}, and
7492 @code{orgtbl-to-texinfo}.  Except for @code{orgtbl-to-html}@footnote{The
7493 HTML translator uses the same code that produces tables during HTML
7494 export.}, these all use a generic translator, @code{orgtbl-to-generic}.
7495 For example, @code{orgtbl-to-latex} itself is a very short function that
7496 computes the column definitions for the @code{tabular} environment,
7497 defines a few field and line separators and then hands over to the
7498 generic translator.  Here is the entire code:
7500 @lisp
7501 @group
7502 (defun orgtbl-to-latex (table params)
7503   "Convert the orgtbl-mode TABLE to LaTeX."
7504   (let* ((alignment (mapconcat (lambda (x) (if x "r" "l"))
7505                                org-table-last-alignment ""))
7506          (params2
7507           (list
7508            :tstart (concat "\\begin@{tabular@}@{" alignment "@}")
7509            :tend "\\end@{tabular@}"
7510            :lstart "" :lend " \\\\" :sep " & "
7511            :efmt "%s\\,(%s)" :hline "\\hline")))
7512     (orgtbl-to-generic table (org-combine-plists params2 params))))
7513 @end group
7514 @end lisp
7516 As you can see, the properties passed into the function (variable
7517 @var{PARAMS}) are combined with the ones newly defined in the function
7518 (variable @var{PARAMS2}).  The ones passed into the function (i.e. the
7519 ones set by the @samp{ORGTBL SEND} line) take precedence.  So if you
7520 would like to use the La@TeX{} translator, but wanted the line endings to
7521 be @samp{\\[2mm]} instead of the default @samp{\\}, you could just
7522 overrule the default with
7524 @example
7525 #+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]"
7526 @end example
7528 For a new language, you can either write your own converter function in
7529 analogy with the La@TeX{} translator, or you can use the generic function
7530 directly.  For example, if you have a language where a table is started
7531 with @samp{!BTBL!}, ended with @samp{!ETBL!}, and where table lines are
7532 started with @samp{!BL!}, ended with @samp{!EL!} and where the field
7533 separator is a TAB, you could call the generic translator like this (on
7534 a single line!):
7536 @example
7537 #+ORGTBL: SEND test orgtbl-to-generic :tstart "!BTBL!" :tend "!ETBL!"
7538                               :lstart "!BL! " :lend " !EL!" :sep "\t"
7539 @end example
7541 @noindent
7542 Please check the documentation string of the function
7543 @code{orgtbl-to-generic} for a full list of parameters understood by
7544 that function and remember that you can pass each of them into
7545 @code{orgtbl-to-latex}, @code{orgtbl-to-texinfo}, and any other function
7546 using the generic function.
7548 Of course you can also write a completely new function doing complicated
7549 things the generic translator cannot do.  A translator function takes
7550 two arguments.  The first argument is the table, a list of lines, each
7551 line either the symbol @code{hline} or a list of fields.  The second
7552 argument is the property list containing all parameters specified in the
7553 @samp{#+ORGTBL: SEND} line.  The function must return a single string
7554 containing the formatted table.  If you write a generally useful
7555 translator, please post it on @code{emacs-orgmode@@gnu.org} so that
7556 others can benefit from your work.
7558 @node Dynamic blocks, Special agenda views, Tables in arbitrary syntax, Extensions and Hacking
7559 @section Dynamic blocks
7560 @cindex dynamic blocks
7562 Org-mode documents can contain @emph{dynamic blocks}.  These are
7563 specially marked regions that are updated by some user-written function.
7564 A good example for such a block is the clock table inserted by the
7565 command @kbd{C-c C-x C-r} (@pxref{Clocking work time}).
7567 Dynamic block are enclosed by a BEGIN-END structure that assigns a name
7568 to the block and can also specify parameters for the function producing
7569 the content of the block.
7571 @example
7572 #+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
7574 #+END:
7575 @end example
7577 Dynamic blocks are updated with the following commands
7579 @table @kbd
7580 @kindex C-c C-x C-u
7581 @item C-c C-x C-u
7582 Update dynamic block at point.
7583 @kindex C-u C-c C-x C-u
7584 @item C-u C-c C-x C-u
7585 Update all dynamic blocks in the current file.
7586 @end table
7588 Updating a dynamic block means to remove all the text between BEGIN and
7589 END, parse the BEGIN line for parameters and then call the specific
7590 writer function for this block to insert the new content.  For a block
7591 with name @code{myblock}, the writer function is
7592 @code{org-dblock-write:myblock} with as only parameter a property list
7593 with the parameters given in the begin line.  Here is a trivial example
7594 of a block that keeps track of when the block update function was last
7595 run:
7597 @example
7598 #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
7600 #+END:
7601 @end example
7603 @noindent
7604 The corresponding block writer function could look like this:
7606 @lisp
7607 (defun org-dblock-write:block-update-time (params)
7608    (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
7609      (insert "Last block update at: "
7610              (format-time-string fmt (current-time)))))
7611 @end lisp
7613 If you want to make sure that all dynamic blocks are always up-to-date,
7614 you could add the function @code{org-update-all-dblocks} to a hook, for
7615 example @code{before-save-hook}.  @code{org-update-all-dblocks} is
7616 written in a way that is does nothing in buffers that are not in Org-mode.
7618 @node Special agenda views, Using the property API, Dynamic blocks, Extensions and Hacking
7619 @section Special Agenda Views
7620 @cindex agenda views, user-defined
7622 Org-mode provides a special hook that can be used to narrow down the
7623 selection made by any of the agenda views.  You may specify a function
7624 that is used at each match to verify if the match should indeed be part
7625 of the agenda view, and if not, how much should be skipped.
7627 Let's say you want to produce a list of projects that contain a WAITING
7628 tag anywhere in the project tree.  Let's further assume that you have
7629 marked all tree headings that define a project with the todo keyword
7630 PROJECT.  In this case you would run a todo search for the keyword
7631 PROJECT, but skip the match unless there is a WAITING tag anywhere in
7632 the subtree belonging to the project line.
7634 To achieve this, you must write a function that searches the subtree for
7635 the tag.  If the tag is found, the function must return @code{nil} to
7636 indicate that this match should not be skipped.  If there is no such
7637 tag, return the location of the end of the subtree, to indicate that
7638 search should continue from there.
7640 @lisp
7641 (defun my-skip-unless-waiting ()
7642   "Skip trees that are not waiting"
7643   (let ((subtree-end (save-excursion (org-end-of-subtree t))))
7644     (if (re-search-forward ":WAITING:" subtree-end t)
7645         nil          ; tag found, do not skip
7646       subtree-end))) ; tag not found, continue after end of subtree
7647 @end lisp
7649 Now you may use this function in an agenda custom command, for example
7650 like this:
7652 @lisp
7653 (org-add-agenda-custom-command
7654  '("b" todo "PROJECT"
7655    ((org-agenda-skip-function 'my-org-waiting-projects)
7656     (org-agenda-overriding-header "Projects waiting for something: "))))
7657 @end lisp
7659 Note that this also binds @code{org-agenda-overriding-header} to get a
7660 meaningful header in the agenda view.
7662 You may also put a Lisp form into @code{org-agenda-skip-function}.  In
7663 particular, you may use the functions @code{org-agenda-skip-entry-if}
7664 and @code{org-agenda-skip-subtree-if} in this form, for example:
7666 @table @code
7667 @item '(org-agenda-skip-entry-if 'scheduled)
7668 Skip current entry if it has been scheduled.
7669 @item '(org-agenda-skip-entry-if 'notscheduled)
7670 Skip current entry if it has not been scheduled.
7671 @item '(org-agenda-skip-entry-if 'deadline)
7672 Skip current entry if it has a deadline.
7673 @item '(org-agenda-skip-entry-if 'scheduled 'deadline)
7674 Skip current entry if it has a deadline, or if it is scheduled.
7675 @item '(org-agenda-skip-entry 'regexp "regular expression")
7676 Skip current entry if the regular expression contained in the variable
7677 @code{org-agenda-skip-regexp} matches in the entry.
7678 @item '(org-agenda-skip-subtree-if 'regexp "regular expression")
7679 Same as above, but check and skip the entire subtree.
7680 @end table
7682 Therefore we could also have written the search for WAITING projects
7683 like this, even without defining a special function:
7685 @lisp
7686 (org-add-agenda-custom-command
7687  '("b" todo "PROJECT"
7688    ((org-agenda-skip-function '(org-agenda-skip-subtree-if
7689                                 'regexp ":WAITING:"))
7690     (org-agenda-overriding-header "Projects waiting for something: "))))
7691 @end lisp
7694 @node Using the property API,  , Special agenda views, Extensions and Hacking
7695 @section Using the property API
7696 @cindex API, for properties
7697 @cindex properties, API
7699 Here is a description of the functions that can be used to work with
7700 properties.
7702 @defun org-entry-properties &optional pom which
7703 Get all properties of the entry at point-or-marker POM.
7704 This includes the TODO keyword, the tags, time strings for deadline,
7705 scheduled, and clocking, and any additional properties defined in the
7706 entry.  The return value is an alist, keys may occur multiple times
7707 if the property key was used several times.
7708 POM may also be nil, in which case the current entry is used.
7709 If WHICH is nil or `all', get all properties.  If WHICH is
7710 `special' or `standard', only get that subclass.
7711 @end defun
7712 @defun org-entry-get pom property &optional inherit
7713 Get value of PROPERTY for entry at point-or-marker POM.
7714 If INHERIT is non-nil and the entry does not have the property,
7715 then also check higher levels of the hierarchy.
7716 @end defun
7718 @defun org-entry-delete pom property
7719 Delete the property PROPERTY from entry at point-or-marker POM.
7720 @end defun
7722 @defun org-entry-put pom property value
7723 Set PROPERTY to VALUE for entry at point-or-marker POM.
7724 @end defun
7726 @defun org-buffer-property-keys &optional include-specials
7727 Get all property keys in the current buffer.
7728 @end defun
7730 @defun org-insert-property-drawer
7731 Insert a property drawer at point.
7732 @end defun
7734 @node History and Acknowledgments, Index, Extensions and Hacking, Top
7735 @appendix History and Acknowledgments
7736 @cindex acknowledgments
7737 @cindex history
7738 @cindex thanks
7740 Org-mode was borne in 2003, out of frustration over the user interface
7741 of the Emacs outline-mode.  I was trying to organize my notes and
7742 projects, and using Emacs seemed to be the natural way to go.  However,
7743 having to remember eleven different commands with two or three keys per
7744 command, only to hide and unhide parts of the outline tree, that seemed
7745 entirely unacceptable to me.  Also, when using outlines to take notes, I
7746 constantly want to restructure the tree, organizing it parallel to my
7747 thoughts and plans.  @emph{Visibility cycling} and @emph{structure
7748 editing} were originally implemented in the package
7749 @file{outline-magic.el}, but quickly moved to the more general
7750 @file{org.el}.  As this environment became comfortable for project
7751 planning, the next step was adding @emph{TODO entries}, basic @emph{time
7752 stamps}, and @emph{table support}.  These areas highlight the two main
7753 goals that Org-mode still has today: To create a new, outline-based,
7754 plain text mode with innovative and intuitive editing features, and to
7755 incorporate project planning functionality directly into a notes file.
7757 Since the first release, literally thousands of emails to me or on
7758 @code{emacs-orgmode@@gnu.org} have provided a constant stream of bug
7759 reports, feedback, new ideas, and sometimes patches and add-on code.
7760 Many thanks to everyone who has helped to improve this package.  I am
7761 trying to keep here a list of the people who had significant influence
7762 in shaping one or more aspects of Org-mode.  The list may not be
7763 complete, if I have forgotten someone, please accept my apologies and
7764 let me know.
7766 @itemize @bullet
7768 @item
7769 @i{Russel Adams} came up with the idea for drawers.
7770 @item
7771 @i{Thomas Baumann} contributed the code for links to the MH-E email
7772 system.
7773 @item
7774 @i{Alex Bochannek} provided a patch for rounding time stamps.
7775 @item
7776 @i{Charles Cave}'s suggestion sparked the implementation of templates
7777 for Remember.
7778 @item
7779 @i{Pavel Chalmoviansky} influenced the agenda treatment of items with
7780 specified time.
7781 @item
7782 @i{Gregory Chernov} patched support for lisp forms into table
7783 calculations and improved XEmacs compatibility, in particular by porting
7784 @file{nouline.el} to XEmacs.
7785 @item
7786 @i{Sacha Chua} suggested to copy some linking code from Planner.
7787 @item
7788 @i{Eddward DeVilla} proposed and tested checkbox statistics.  He also
7789 came up with the idea of properties, and that there should be an API for
7790 them.
7791 @item
7792 @i{Kees Dullemond} used to edit projects lists directly in HTML and so
7793 inspired some of the early development, including HTML export.  He also
7794 asked for a way to narrow wide table columns.
7795 @item
7796 @i{Christian Egli} converted the documentation into TeXInfo format,
7797 patched CSS formatting into the HTML exporter, and inspired the agenda.
7798 @item
7799 @i{David Emery} provided a patch for custom CSS support in exported
7800 HTML agendas.
7801 @item
7802 @i{Nic Ferrier} contributed mailcap and XOXO support.
7803 @item
7804 @i{John Foerch} figured out how to make incremental search show context
7805 around a match in a hidden outline tree.
7806 @item
7807 @i{Niels Giessen} had the idea to automatically archive DONE trees.
7808 @item
7809 @i{Bastien Guerry} wrote the La@TeX{} exporter and has been prolific
7810 with patches, ideas, and bug reports.
7811 to Org-mode.
7812 @item
7813 @i{Kai Grossjohann} pointed out key-binding conflicts with other packages.
7814 @item
7815 @i{Scott Jaderholm} proposed footnotes, control over whitespace between
7816 folded entries, and column view for properties.
7817 @item
7818 @i{Shidai Liu} ("Leo") asked for embedded La@TeX{} and tested it.  He also
7819 provided frequent feedback and some patches.
7820 @item
7821 @i{Jason F. McBrayer} suggested agenda export to CSV format.
7822 @item
7823 @i{Dmitri Minaev} sent a patch to set priority limits on a per-file
7824 basis.
7825 @item
7826 @i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler
7827 happy.
7828 @item
7829 @i{Rick Moynihan} proposed to allow multiple TODO sequences in a file.
7830 @item
7831 @i{Todd Neal} provided patches for links to Info files and elisp forms.
7832 @item
7833 @i{Tim O'Callaghan} suggested in-file links, search options for general
7834 file links, and TAGS.
7835 @item
7836 @i{Takeshi Okano} translated the manual and David O'Toole's tutorial
7837 into Japanese.
7838 @item
7839 @i{Oliver Oppitz} suggested multi-state TODO items.
7840 @item
7841 @i{Scott Otterson} sparked the introduction of descriptive text for
7842 links, among other things.
7843 @item
7844 @i{Pete Phillips} helped during the development of the TAGS feature, and
7845 provided frequent feedback.
7846 @item
7847 @i{T.V. Raman} reported bugs and suggested improvements.
7848 @item
7849 @i{Matthias Rempe} (Oelde) provided ideas, Windows support, and quality
7850 control.
7851 @item
7852 @i{Kevin Rogers} contributed code to access VM files on remote hosts.
7853 @item
7854 @i{Frank Ruell} solved the mystery of the @code{keymapp nil} bug, a
7855 conflict with @file{allout.el}.
7856 @item
7857 @i{Jason Riedy} sent a patch to fix a bug with export of TODO keywords.
7858 @item
7859 @i{Philip Rooke} created the Org-mode reference card and provided lots
7860 of feedback.
7861 @item
7862 @i{Christian Schlauer} proposed angular brackets around links, among
7863 other things.
7864 @item
7865 Linking to VM/BBDB/GNUS was inspired by @i{Tom Shannon}'s
7866 @file{organizer-mode.el}.
7867 @item
7868 @i{Daniel Sinder} came up with the idea of internal archiving by locking
7869 subtrees.
7870 @item
7871 @i{Dale Smith} proposed link abbreviations.
7872 @item
7873 @i{Adam Spiers} asked for global linking commands and inspired the link
7874 extension system.  support mairix.
7875 @item
7876 @i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
7877 chapter about publishing.
7878 @item
7879 @i{J@"urgen Vollmer} contributed code generating the table of contents
7880 in HTML output.
7881 @item
7882 @i{Chris Wallace} provided a patch implementing the @samp{QUOTE}
7883 keyword.
7884 @item
7885 @i{David Wainberg} suggested archiving, and improvements to the linking
7886 system.
7887 @item
7888 @i{John Wiegley} wrote @file{emacs-wiki.el} and @file{planner.el}.  The
7889 development of Org-mode was fully independent, and both systems are
7890 really different beasts in their basic ideas and implementation details.
7891 I later looked at John's code, however, and learned from his
7892 implementation of (i) links where the link itself is hidden and only a
7893 description is shown, and (ii) popping up a calendar to select a date.
7894 John has also contributed a number of great ideas directly to Org-mode.
7895 @item
7896 @i{Carsten Wimmer} suggested some changes and helped fix a bug in
7897 linking to GNUS.
7898 @item
7899 @i{Roland Winkler} requested additional keybindings to make Org-mode
7900 work on a tty.
7901 @item
7902 @i{Piotr Zielinski} wrote @file{org-mouse.el}, proposed agenda blocks
7903 and contributed various ideas and code snippets.
7904 @end itemize
7907 @node Index, Key Index, History and Acknowledgments, Top
7908 @unnumbered Index
7910 @printindex cp
7912 @node Key Index,  , Index, Top
7913 @unnumbered Key Index
7915 @printindex ky
7917 @bye
7919 @ignore
7920    arch-tag: 7893d1fe-cc57-4d13-b5e5-f494a1bcc7ac
7921 @end ignore