Release 4.69
[org-mode/org-tableheadings.git] / org.texi
blobfaa54fd53339b9d448154a249f4ffe47d5c668a6
1 \input texinfo
2 @c %**start of header
3 @setfilename ../info/org
4 @settitle Org Mode Manual
6 @set VERSION 4.69
7 @set DATE March 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 * Timestamps::                  Assign date and time to items
84 * Tags::                        Tagging headlines and matching sets of tags
85 * Agenda views::                Collecting information into views
86 * Embedded LaTeX::              LaTeX fragments and formulas
87 * Exporting::                   Sharing and publishing of notes
88 * Publishing::                  Create a web site of linked Org-mode files
89 * Miscellaneous::               All the rest which did not fit elsewhere
90 * Extensions and Hacking::      It is possible to write add-on code
91 * History and Acknowledgments::  How Org-mode came into being 
92 * Index::                       The fast road to specific information
93 * Key Index::                   Key bindings and where they are described
95 @detailmenu
96  --- The Detailed Node Listing ---
98 Introduction
100 * Summary::                     Brief summary of what Org-mode does
101 * Installation::                How to install a downloaded version of Org-mode
102 * Activation::                  How to activate Org-mode for certain buffers.
103 * Feedback::                    Bug reports, ideas, patches etc.
105 Document Structure
107 * Outlines::                    Org-mode is based on outline-mode
108 * Headlines::                   How to typeset org-tree headlines
109 * Visibility cycling::          Show and hide, much simplified
110 * Motion::                      Jumping to other headlines
111 * Structure editing::           Changing sequence and level of headlines
112 * Archiving::                   Move done task trees to a different place
113 * Sparse trees::                Matches embedded in context
114 * Plain lists::                 Additional structure within an entry
116 Archiving
118 * ARCHIVE tag::                 Marking a tree as inactive
119 * Moving subtrees::             Moving a tree to an archive file
121 Tables
123 * Built-in table editor::       Simple tables
124 * Narrow columns::              Stop wasting space in tables   
125 * orgtbl-mode::                 The table editor as minor mode
126 * The spreadsheet::             The table editor has spreadsheet capabilities.
128 The spreadsheet
130 * References::                  How to refer to another field or range
131 * Formula syntax for Calc::     Using Calc to compute stuff
132 * Formula syntax for Lisp::     Writing formulas in Emacs Lisp
133 * Field formulas::              Formulas valid for a single field
134 * Column formulas::             Formulas valid for an entire column
135 * Editing and debugging formulas::  Fixing formulas
136 * Updating the table::          Recomputing all dependent fields
137 * Advanced features::           Field names, parameters and automatic recalc
139 Hyperlinks
141 * Link format::                 How links in Org-mode are formatted
142 * Internal links::              Links to other places in the current file
143 * External links::              URL-like links to the world
144 * Handling links::              Creating, inserting and following
145 * Link abbreviations::          Shortcuts for writing complex links
146 * Search options::              Linking to a specific location
147 * Custom searches::             When the default search is not enough
148 * Remember::                    Org-trees store quick notes
150 Internal links
152 * Radio targets::               Make targets trigger links in plain text.
154 Remember
156 * Setting up remember::         Some code for .emacs to get things going
157 * Remember templates::          Define the outline of different note types
158 * Storing notes::               Directly get the note to where it belongs
160 TODO items
162 * TODO basics::                 Marking and displaying TODO entries
163 * TODO extensions::             Workflow and assignments
164 * Priorities::                  Some things are more important than others
165 * Breaking down tasks::         Splitting a task into manageable pieces
166 * Checkboxes::                  Tick-off lists
168 Extended use of TODO keywords
170 * Workflow states::             From TODO to DONE in steps
171 * TODO types::                  I do this, Fred the rest
172 * Per file keywords::           Different files, different requirements
173 * Multiple sets in one file::   Mixing it all, and still finding your way
175 Timestamps
177 * Time stamps::                 Assigning a time to a tree entry
178 * Creating timestamps::         Commands which insert timestamps
179 * Custom time format::          If you cannot work with the ISO format
180 * Repeating items::             Deadlines that come back again and again
181 * Progress logging::            Documenting when what work was done.
183 Creating timestamps
185 * The date/time prompt::        How org-mode helps you entering date and time
187 Progress Logging
189 * Closing items::               When was this entry marked DONE?
190 * Tracking TODO state changes::  When did the status change?
191 * Clocking work time::          When exactly did you work on this item?
193 Tags
195 * Tag inheritance::             Tags use the tree structure of the outline
196 * Setting tags::                How to assign tags to a headline
197 * Tag searches::                Searching for combinations of tags
199 Agenda Views
201 * Agenda files::                Files being searched for agenda information
202 * Agenda dispatcher::           Keyboard access to agenda views
203 * Built-in agenda views::       What is available out of the box?
204 * Presentation and sorting::    How agenda items are prepared for display
205 * Agenda commands::             Remote editing of org trees
206 * Custom agenda views::         Defining special searches and views
208 The built-in agenda views
210 * Weekly/Daily agenda::         The calendar page with current tasks
211 * Global TODO list::            All unfinished action items
212 * Matching headline tags::      Structured information with fine-tuned search
213 * Timeline::                    Time-sorted view for single file
214 * Stuck projects::              Find projects you need to review
216 Presentation and sorting
218 * Categories::                  Not all tasks are equal
219 * Time-of-day specifications::  How the agenda knows the time
220 * Sorting of agenda items::     The order of things
222 Custom agenda views
224 * Storing searches::            Type once, use often
225 * Block agenda::                All the stuff you need in a single buffer
226 * Setting Options::             Changing the rules
227 * Batch processing::            Agenda views from the command line
229 Embedded LaTeX
231 * Math symbols::                TeX macros for symbols and Greek letters
232 * Subscripts and Superscripts::  Simple syntax for raising/lowering text
233 * LaTeX fragments::             Complex formulas made easy
234 * Processing LaTeX fragments::  Previewing LaTeX processing
235 * CDLaTeX mode::                Speed up entering of formulas
237 Exporting
239 * ASCII export::                Exporting to plain ASCII
240 * HTML export::                 Exporting to HTML
241 * XOXO export::                 Exporting to XOXO
242 * iCalendar export::            Exporting in iCalendar format
243 * Text interpretation::         How the exporter looks at the file
245 HTML export
247 * Export commands::             How to invoke HTML export
248 * Quoting HTML tags::           Using direct HTML in Org-mode
249 * Links::                       How hyperlinks get transferred to HTML
250 * Images::                      To inline or not to inline?
251 * CSS support::                 Style specifications
253 Text interpretation by the exporter
255 * Comment lines::               Some lines will not be exported
256 * Initial text::                Text before the first headline
257 * Enhancing text::              Subscripts, symbols and more
258 * Export options::              How to influence the export settings
260 Publishing
262 * Configuration::               Defining projects
263 * Sample configuration::        Example projects
264 * Triggering publication::      Publication commands
266 Configuration
268 * Project alist::               The central configuration variable
269 * Sources and destinations::    From here to there
270 * Selecting files::             What files are part of the project?
271 * Publishing action::           Setting the function doing the publishing
272 * Publishing options::          Tweaking HTML export
273 * Publishing links::            Which links keep working after publishing?
274 * Project page index::          Publishing a list of project files
276 Sample configuration
278 * Simple example::              One-component publishing
279 * Complex example::             A multi-component publishing example
281 Miscellaneous
283 * Completion::                  M-TAB knows what you need
284 * Customization::               Adapting Org-mode to your taste
285 * In-buffer settings::          Overview of the #+KEYWORDS
286 * The very busy C-c C-c key::   When in doubt, press C-c C-c
287 * Clean view::                  Getting rid of leading stars in the outline
288 * TTY keys::                    Using Org-mode on a tty
289 * Interaction::                 Other Emacs packages
290 * Bugs::                        Things which do not work perfectly
292 Interaction with other packages
294 * Cooperation::                 Packages Org-mode cooperates with
295 * Conflicts::                   Packages that lead to conflicts
297 Extensions, Hooks and Hacking
299 * Extensions::                  Existing 3rd-part extensions
300 * Tables in arbitrary syntax::  Orgtbl for LaTeX and other programs
301 * Dynamic blocks::              Automatically filled blocks
302 * Special agenda views::        Customized views
304 Tables in arbitrary syntax
306 * Radio tables::                Sending and receiving
307 * A LaTeX example::             Step by step, almost a tutorial
308 * Translator functions::        Copy and modify
310 @end detailmenu
311 @end menu
313 @node Introduction, Document structure, Top, Top
314 @chapter Introduction
315 @cindex introduction
317 @menu
318 * Summary::                     Brief summary of what Org-mode does
319 * Installation::                How to install a downloaded version of Org-mode
320 * Activation::                  How to activate Org-mode for certain buffers.
321 * Feedback::                    Bug reports, ideas, patches etc.
322 @end menu
324 @node Summary, Installation, Introduction, Introduction
325 @section Summary
326 @cindex summary
328 Org-mode is a mode for keeping notes, maintaining ToDo lists, and doing
329 project planning with a fast and effective plain-text system.
331 Org-mode develops organizational tasks around NOTES files that contain
332 lists or information about projects as plain text.  Org-mode is
333 implemented on top of outline-mode, which makes it possible to keep the
334 content of large files well structured.  Visibility cycling and
335 structure editing help to work with the tree.  Tables are easily created
336 with a built-in table editor.  Org-mode supports ToDo items, deadlines,
337 time stamps, and scheduling.  It dynamically compiles entries into an
338 agenda that utilizes and smoothly integrates much of the Emacs calendar
339 and diary.  Plain text URL-like links connect to websites, emails,
340 Usenet messages, BBDB entries, and any files related to the projects.
341 For printing and sharing of notes, an Org-mode file can be exported as a
342 structured ASCII file, as HTML, or (todo and agenda items only) as an
343 iCalendar file.  It can also serve as a publishing tool for a set of
344 linked webpages.
346 An important design aspect that distinguishes Org-mode from for example
347 Planner/Muse is that it encourages to store every piece of information
348 only once.  In Planner, you have project pages, day pages and possibly
349 other files, duplicating some information such as tasks.  In Org-mode,
350 you only have notes files.  In your notes you mark entries as tasks,
351 label them with tags and timestamps.  All necessary lists like a
352 schedule for the day, the agenda for a meeting, tasks lists selected by
353 tags etc are created dynamically when you need them.
355 Org-mode keeps simple things simple.  When first fired up, it should
356 feel like a straightforward, easy to use outliner.  Complexity is not
357 imposed, but a large amount of functionality is available when you need
358 it.  Org-mode can be used on different levels and in different ways, for
359 example as:
361 @example
362 @r{@bullet{} outline extension with visibility cycling and structure editing}
363 @r{@bullet{} ASCII system and table editor for taking structured notes}
364 @r{@bullet{} ASCII table editor with spreadsheet-like capabilities}
365 @r{@bullet{} TODO list editor}
366 @r{@bullet{} full agenda and planner with deadlines and work scheduling}
367 @r{@bullet{} environment to implement David Allen's GTD system}
368 @r{@bullet{} simple hypertext system, with HTML export}
369 @r{@bullet{} publishing tool to create a set of interlinked webpages}
370 @end example
372 Org-mode's automatic, context sensitive table editor with spreadsheet
373 capabilities can be integrated into any major mode by activating the
374 minor Orgtbl-mode.  Using a translation step, it can be used to maintain
375 tables in arbitrary file types, for example in LaTeX.
377 @cindex FAQ
378 There is a website for Org-mode which provides links to the newest
379 version of Org-mode, as well as additional information, frequently asked
380 questions (FAQ), links to tutorials etc.  This page is located at
381 @uref{http://www.astro.uva.nl/~dominik/Tools/org/}.
383 @page
386 @node Installation, Activation, Summary, Introduction
387 @section Installation
388 @cindex installation
389 @cindex XEmacs
391 @b{Important:} @i{If Org-mode is part of the Emacs distribution or an
392 XEmacs package, please skip this section and go directly to
393 @ref{Activation}.}
395 If you have downloaded Org-mode from the Web, you must take the
396 following steps to install it: Go into the Org-mode distribution
397 directory and edit the top section of the file @file{Makefile}.  You
398 must set the name of the Emacs binary (likely either @file{emacs} or
399 @file{xemacs}), and the paths to the directories where local Lisp and
400 Info files are kept.  If you don't have access to the system-wide
401 directories, create your own two directories for these files, enter them
402 into the Makefile, and make sure Emacs finds the Lisp files by adding
403 the following line to @file{.emacs}:
405 @example
406 (setq load-path (cons "~/path/to/lispdir" load-path))
407 @end example
409 @b{XEmacs users now need to install the file @file{noutline.el} from
410 the @file{xemacs} subdirectory of the Org-mode distribution.  Use the
411 command:}
413 @example
414 @b{make install-noutline}
415 @end example
417 @noindent Now byte-compile and install the Lisp files with the shell
418 commands:
420 @example
421 make
422 make install
423 @end example
425 @noindent If you want to install the info documentation, use this command:
427 @example
428 make install-info
429 @end example
431 @noindent Then add to @file{.emacs}:
433 @lisp
434 ;; This line only if org-mode is not part of the X/Emacs distribution.
435 (require 'org-install)
436 @end lisp
438 @node Activation, Feedback, Installation, Introduction
439 @section Activation
440 @cindex activation
441 @cindex autoload
442 @cindex global keybindings
443 @cindex keybindings, global
445 @iftex
446 @b{Important:} @i{If you use copy-and-paste to copy lisp code from the
447 PDF documentation to your .emacs file, the single quote character comes
448 out incorrectly and the code will not work.  You need to fix the single
449 quotes by hand, or copy from Info documentation.}
450 @end iftex
452 Add the following lines to your @file{.emacs} file.  The last two lines
453 define @emph{global} keys for the commands @command{org-store-link} and
454 @command{org-agenda} - please choose suitable keys yourself.
456 @lisp
457 ;; The following lines are always needed.  Choose your own keys.
458 (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
459 (define-key global-map "\C-cl" 'org-store-link)
460 (define-key global-map "\C-ca" 'org-agenda)
461 @end lisp
463 Furthermore, you must activate @code{font-lock-mode} in org-mode
464 buffers, because significant functionality depends on font-locking being
465 active.  You can do this with either one of the following two lines
466 (XEmacs user must use the second option):
467 @lisp
468 (global-font-lock-mode 1)                     ; for all buffers
469 (add-hook 'org-mode-hook 'turn-on-font-lock)  ; org-mode buffers only
470 @end lisp
472 @cindex org-mode, turning on
473 With this setup, all files with extension @samp{.org} will be put
474 into Org-mode.  As an alternative, make the first line of a file look
475 like this:
477 @example
478 MY PROJECTS    -*- mode: org; -*-
479 @end example
481 @noindent which will select Org-mode for this buffer no matter what
482 the file's name is.  See also the variable
483 @code{org-insert-mode-line-in-empty-file}.
485 @node Feedback,  , Activation, Introduction
486 @section Feedback
487 @cindex feedback
488 @cindex bug reports
489 @cindex maintainer
490 @cindex author
492 If you find problems with Org-mode, or if you have questions, remarks,
493 or ideas about it, please contact the maintainer @value{MAINTAINER} at
494 @value{MAINTAINEREMAIL}.
496 For bug reports, please provide as much information as possible,
497 including the version information of Emacs (@kbd{C-h v emacs-version
498 @key{RET}}) and Org-mode (@kbd{C-h v org-version @key{RET}}), as well as
499 the Org-mode related setup in @file{.emacs}.  If an error occurs, a
500 backtrace can be very useful (see below on how to create one).  Often a
501 small example file helps, along with clear information about:
503 @enumerate
504 @item What exactly did you do?
505 @item What did you expect to happen?
506 @item What happened instead?
507 @end enumerate
508 @noindent Thank you for helping to improve this mode.
510 @subsubheading How to create a useful backtrace
512 @cindex backtrace of an error
513 If working with Org-mode produces an error with a message you don't
514 understand, you may have hit a bug.  The best way to report this is by
515 providing, in addition to what was mentioned above, a @emph{Backtrace}.
516 This is information from the built-in debugger about where and how the
517 error occurred.  Here is how to produce a useful backtrace:
519 @enumerate
520 @item
521 Start a fresh Emacs or XEmacs, and make sure that it will load the
522 original Lisp code in @file{org.el} instead of the compiled version in
523 @file{org.elc}.  The backtrace contains much more information if it is
524 produced with uncompiled code.  To do this, either rename @file{org.elc}
525 to something else before starting Emacs, or ask Emacs explicitly to load
526 @file{org.el} by using the command line
527 @example
528 emacs -l /path/to/org.el
529 @end example
530 @item
531 Go to the @code{Options} menu and select @code{Enter Debugger on Error}
532 (XEmacs has this option in the @code{Troubleshooting} sub-menu).
533 @item
534 Do whatever you have to do to hit the error.  Don't forget to
535 document the steps you take.
536 @item
537 When you hit the error, a @file{*Backtrace*} buffer will appear on the
538 screen.  Save this buffer to a file (for example using @kbd{C-x C-w}) and
539 attach it to your bug report.
540 @end enumerate
542 @node Document structure, Tables, Introduction, Top
543 @chapter Document Structure
544 @cindex document structure
545 @cindex structure of document
547 Org-mode is based on outline mode and provides flexible commands to
548 edit the structure of the document.
550 @menu
551 * Outlines::                    Org-mode is based on outline-mode
552 * Headlines::                   How to typeset org-tree headlines
553 * Visibility cycling::          Show and hide, much simplified
554 * Motion::                      Jumping to other headlines
555 * Structure editing::           Changing sequence and level of headlines
556 * Archiving::                   Move done task trees to a different place
557 * Sparse trees::                Matches embedded in context
558 * Plain lists::                 Additional structure within an entry
559 @end menu
561 @node Outlines, Headlines, Document structure, Document structure
562 @section Outlines
563 @cindex outlines
564 @cindex outline-mode
566 Org-mode is implemented on top of outline-mode.  Outlines allow to
567 organize a document in a hierarchical structure, which (at least for
568 me) is the best representation of notes and thoughts.  Overview over
569 this structure is achieved by folding (hiding) large parts of the
570 document to show only the general document structure and the parts
571 currently being worked on.  Org-mode greatly simplifies the use of
572 outlines by compressing the entire show/hide functionality into a
573 single command @command{org-cycle}, which is bound to the @key{TAB}
574 key.
576 @node Headlines, Visibility cycling, Outlines, Document structure
577 @section Headlines
578 @cindex headlines
579 @cindex outline tree
581 Headlines define the structure of an outline tree.  The headlines in
582 Org-mode start with one or more stars, on the left margin.  For
583 example:
585 @example
586 * Top level headline
587 ** Second level
588 *** 3rd level
589     some text
590 *** 3rd level
591     more text
592 * Another top level headline
593 @end example
595 @noindent Some people find the many stars too noisy and would prefer an
596 outline that has whitespace followed by a single star as headline
597 starters.  @ref{Clean view} describes a setup to realize this.
599 @node Visibility cycling, Motion, Headlines, Document structure
600 @section Visibility cycling
601 @cindex cycling, visibility
602 @cindex visibility cycling
603 @cindex trees, visibility
604 @cindex show hidden text
605 @cindex hide text
607 Outlines make it possible to hide parts of the text in the buffer.
608 Org-mode uses just two commands, bound to @key{TAB} and
609 @kbd{S-@key{TAB}} to change the visibility in the buffer.
611 @cindex subtree visibility states
612 @cindex subtree cycling
613 @cindex folded, subtree visibility state
614 @cindex children, subtree visibility state
615 @cindex subtree, subtree visibility state
616 @table @kbd
617 @kindex @key{TAB}
618 @item @key{TAB}
619 @emph{Subtree cycling}: Rotate current subtree between the states
621 @example
622 ,-> FOLDED -> CHILDREN -> SUBTREE --.
623 '-----------------------------------'
624 @end example
626 The cursor must be on a headline for this to work@footnote{see, however,
627 the option @code{org-cycle-emulate-tab}.}.  When the cursor is at the
628 beginning of the buffer and the first line is not a headline, then
629 @key{TAB} actually runs global cycling (see below)@footnote{see the
630 option @code{org-cycle-global-at-bob}.}.  Also when called with a prefix
631 argument (@kbd{C-u @key{TAB}}), global cycling is invoked.
633 @cindex global visibility states
634 @cindex global cycling
635 @cindex overview, global visibility state
636 @cindex contents, global visibility state
637 @cindex show all, global visibility state
638 @kindex S-@key{TAB}
639 @item S-@key{TAB}
640 @itemx C-u @key{TAB}
641 @emph{Global cycling}: Rotate the entire buffer between the states
643 @example
644 ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
645 '--------------------------------------'
646 @end example
648 When @kbd{S-@key{TAB}} is called with a numerical prefix N, the CONTENTS
649 view up to headlines of level N will be shown.
650 Note that inside tables, @kbd{S-@key{TAB}} jumps to the previous field.
652 @cindex show all, command
653 @kindex C-c C-a
654 @item C-c C-a
655 Show all.
656 @kindex C-c C-r
657 @item C-c C-r
658 Reveal context around point, showing the current entry, the following
659 heading and the hierarchy above.  Useful for working near a location
660 exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda
661 command (@pxref{Agenda commands}).  With prefix arg show, on each
662 level, all sibling headings.
663 @kindex C-c C-x b
664 @item C-c C-x b
665 Show the current subtree in an indirect buffer@footnote{The indirect
666 buffer (@pxref{Indirect Buffers,Indirect Buffers,Indirect
667 Buffers,emacs,GNU Emacs Manual}) will contain the entire buffer, but
668 will be narrowed to the current tree.  Editing the indirect buffer will
669 also change the original buffer, but without affecting visibility in
670 that buffer.}.  With numerical prefix ARG, go up to this level and then
671 take that tree.  If ARG is negative, go up that many levels.  With
672 @kbd{C-u} prefix, do not remove the previously used indirect buffer.
673 @end table
675 When Emacs first visits an Org-mode file, the global state is set to
676 OVERVIEW, i.e. only the top level headlines are visible.  This can be
677 configured through the variable @code{org-startup-folded}, or on a
678 per-file basis by adding one of the following lines anywhere in the
679 buffer:
681 @example
682 #+STARTUP: overview
683 #+STARTUP: content
684 #+STARTUP: showall
685 @end example
687 @node Motion, Structure editing, Visibility cycling, Document structure
688 @section Motion
689 @cindex motion, between headlines
690 @cindex jumping, to headlines
691 @cindex headline navigation
692 The following commands jump to other headlines in the buffer.
694 @table @kbd
695 @kindex C-c C-n
696 @item C-c C-n
697 Next heading.
698 @kindex C-c C-p
699 @item C-c C-p
700 Previous heading.
701 @kindex C-c C-f
702 @item C-c C-f
703 Next heading same level.
704 @kindex C-c C-b
705 @item C-c C-b
706 Previous heading same level.
707 @kindex C-c C-u
708 @item C-c C-u
709 Backward to higher level heading.
710 @kindex C-c C-j
711 @item C-c C-j
712 Jump to a different place without changing the current outline
713 visibility.  Shows the document structure in a temporary buffer, where
714 you can use visibility cycling (@key{TAB}) to find your destination.
715 After pressing @key{RET}, the cursor moves to the selected location in
716 the original buffer, and the headings hierarchy above it is made
717 visible.
718 @end table
720 @node Structure editing, Archiving, Motion, Document structure
721 @section Structure editing
722 @cindex structure editing
723 @cindex headline, promotion and demotion
724 @cindex promotion, of subtrees
725 @cindex demotion, of subtrees
726 @cindex subtree, cut and paste
727 @cindex pasting, of subtrees
728 @cindex cutting, of subtrees
729 @cindex copying, of subtrees
730 @cindex subtrees, cut and paste
732 @table @kbd
733 @kindex M-@key{RET}
734 @item M-@key{RET}
735 Insert new heading with same level as current.  If the cursor is in a
736 plain list item, a new item is created (@pxref{Plain lists}).  To force
737 creation of a new headline, use a prefix arg, or first press @key{RET}
738 to get to the beginning of the next line.  When this command is used in
739 the middle of a line, the line is split and the rest of the line becomes
740 the new headline.  If the command is used at the beginning of a
741 headline, the new headline is created before the current line.  If at
742 the beginning of any other line, the content of that line is made the
743 new heading.  If the command is used at the end of a folded subtree
744 (i.e. behind the ellipses at the end of a headline), then a headline
745 like the current one will be inserted after the end of the subtree.
746 @kindex M-S-@key{RET}
747 @item M-S-@key{RET}
748 Insert new TODO entry with same level as current heading.
749 @kindex M-@key{left}
750 @item M-@key{left}
751 Promote current heading by one level.
752 @kindex M-@key{right}
753 @item M-@key{right}
754 Demote current heading by one level.
755 @kindex M-S-@key{left}
756 @item M-S-@key{left}
757 Promote the current subtree by one level.
758 @kindex M-S-@key{right}
759 @item M-S-@key{right}
760 Demote the current subtree by one level.
761 @kindex M-S-@key{up}
762 @item M-S-@key{up}
763 Move subtree up (swap with previous subtree of same
764 level).
765 @kindex M-S-@key{down}
766 @item M-S-@key{down}
767 Move subtree down (swap with next subtree of same level).
768 @kindex C-c C-x C-w
769 @kindex C-c C-x C-k
770 @item C-c C-x C-w
771 @itemx C-c C-x C-k
772 Kill subtree, i.e. remove it from buffer but save in kill ring.
773 @kindex C-c C-x M-w
774 @item C-c C-x M-w
775 Copy subtree to kill ring.
776 @kindex C-c C-x C-y
777 @item C-c C-x C-y
778 Yank subtree from kill ring.  This does modify the level of the subtree to
779 make sure the tree fits in nicely at the yank position.  The yank
780 level can also be specified with a prefix arg, or by yanking after a
781 headline marker like @samp{****}.
782 @kindex C-c ^
783 @item C-c ^
784 Sort same-level entries.  When there is an active region, all entries in
785 the region will be sorted.  Otherwise the children of the current
786 headline are sorted.  The command prompts for the sorting method, which
787 can be alphabetically, numerically, by time (using the first time stamp
788 in each entry), and each of these in reverse order.  With a @kbd{C-u}
789 prefix, sorting will be case-sensitive.  With two @kbd{C-u C-u}
790 prefixes, duplicate entries will also be removed.
791 @end table
793 @cindex region, active
794 @cindex active region
795 @cindex transient-mark-mode
796 When there is an active region (transient-mark-mode), promotion and
797 demotion work on all headlines in the region.  To select a region of
798 headlines, it is best to place both point and mark at the beginning of a
799 line, mark at the beginning of the first headline, and point at the line
800 just after the last headline to change.  Note that when the cursor is
801 inside a table (@pxref{Tables}), the Meta-Cursor keys have different
802 functionality.
804 @node Archiving, Sparse trees, Structure editing, Document structure
805 @section Archiving
806 @cindex archiving
808 When a project represented by a (sub)tree is finished, you may want
809 to move the tree out of the way and to stop it from contributing to the
810 agenda.  Org-mode knows two ways of archiving.  You can mark a tree with
811 the ARCHIVE tag, or you can move an entire (sub)tree to a different
812 location.
814 @menu
815 * ARCHIVE tag::                 Marking a tree as inactive
816 * Moving subtrees::             Moving a tree to an archive file
817 @end menu
819 @node ARCHIVE tag, Moving subtrees, Archiving, Archiving
820 @subsection The ARCHIVE tag
821 @cindex internal archiving
823 A headline that is marked with the ARCHIVE tag (@pxref{Tags}) stays at
824 its location in the outline tree, but behaves in the following way:
825 @itemize @minus
826 @item
827 It does not open when you attempt to do so with a visibility cycling
828 command (@pxref{Visibility cycling}).  You can force cycling archived
829 subtrees with @kbd{C-@key{TAB}}, or by setting the option
830 @code{org-cycle-open-archived-trees}.  Also normal outline commands like
831 @code{show-all} will open archived subtrees.
832 @item
833 During sparse tree construction (@pxref{Sparse trees}), matches in
834 archived subtrees are not exposed, unless you configure the option
835 @code{org-sparse-tree-open-archived-trees}.
836 @item
837 During agenda view construction (@pxref{Agenda views}), the content of
838 archived trees is ignored unless you configure the option
839 @code{org-agenda-skip-archived-trees}.
840 @item
841 Archived trees are not exported (@pxref{Exporting}), only the headline
842 is.  Configure the details using the variable
843 @code{org-export-with-archived-trees}.
844 @end itemize
846 The following commands help managing the ARCHIVE tag:
848 @table @kbd
849 @kindex C-c C-x C-a
850 @item C-c C-x C-a
851 Toggle the ARCHIVE tag for the current headline.  When the tag is set,
852 the headline changes to a shadowish face, and the subtree below it is
853 hidden.
854 @kindex C-u C-c C-x C-a
855 @item C-u C-c C-x C-a
856 Check if any direct children of the current headline should be archived.
857 To do this, each subtree is checked for open TODO entries.  If none are
858 found, the command offers to set the ARCHIVE tag for the child.  If the
859 cursor is @emph{not} on a headline when this command is invoked, the
860 level 1 trees will be checked.
861 @kindex C-@kbd{TAB}
862 @item C-@kbd{TAB}
863 Cycle a tree even if it is tagged with ARCHIVE.
864 @end table
866 @node Moving subtrees,  , ARCHIVE tag, Archiving
867 @subsection Moving subtrees
868 @cindex external archiving
870 Once an entire project is finished, you may want to move it to a
871 different location, either in the current file, or even in a different
872 file, the archive file.
874 @table @kbd
875 @kindex C-c C-x C-s
876 @item C-c C-x C-s
877 Archive the subtree starting at the cursor position to the location
878 given by @code{org-archive-location}.
879 @kindex C-u C-c C-x C-s
880 @item C-u C-c C-x C-s
881 Check if any direct children of the current headline could be moved to
882 the archive.  To do this, each subtree is checked for open TODO entries.
883 If none are found, the command offers to move it to the archive
884 location.  If the cursor is @emph{not} on a headline when this command
885 is invoked, the level 1 trees will be checked.
886 @end table
888 @cindex archive locations
889 The default archive location is a file in the same directory as the
890 current file, with the name derived by appending @file{_archive} to the
891 current file name.  For information and examples on how to change this,
892 see the documentation string of the variable
893 @code{org-archive-location}.  There is also an in-buffer option for
894 setting this variable, for example
896 @example
897 #+ARCHIVE: %s_done::
898 @end example
900 @noindent
901 You may have several such lines in the buffer, they will then be valid
902 for the entries following the line (the first will also apply to any
903 text before it).
905 @node Sparse trees, Plain lists, Archiving, Document structure
906 @section Sparse trees
907 @cindex sparse trees
908 @cindex trees, sparse
909 @cindex folding, sparse trees
910 @cindex occur, command
912 An important feature of Org-mode is the ability to construct
913 @emph{sparse trees} for selected information in an outline tree.  A
914 sparse tree means that the entire document is folded as much as
915 possible, but the selected information is made visible along with the
916 headline structure above it@footnote{See also the variables
917 @code{org-show-hierarchy-above}, @code{org-show-following-heading}, and
918 @code{org-show-siblings} for detailed control on how much context is
919 shown around each match.}.  Just try it out and you will see immediately
920 how it works.
922 Org-mode contains several commands creating such trees.  The most
923 basic one is @command{org-occur}:
925 @table @kbd
926 @kindex C-c /
927 @item C-c /
928 Occur.  Prompts for a regexp and shows a sparse tree with all matches.
929 If the match is in a headline, the headline is made visible.  If the
930 match is in the body of an entry, headline and body are made visible.
931 In order to provide minimal context, also the full hierarchy of
932 headlines above the match is shown, as well as the headline following
933 the match.  Each match is also highlighted; the highlights disappear
934 when the buffer is changes an editing command, or by pressing @kbd{C-c
935 C-c}.  When called with a @kbd{C-u} prefix argument, previous highlights
936 are kept, so several calls to this command can be stacked.
937 @end table
938 @noindent
939 For frequently used sparse trees of specific search strings, you can
940 use the variable @code{org-agenda-custom-commands} to define fast
941 keyboard access to specific sparse trees.  These commands will then be
942 accessible through the agenda dispatcher (@pxref{Agenda dispatcher}).
943 For example:
945 @lisp
946 (setq org-agenda-custom-commands
947       '(("f" occur-tree "FIXME")))
948 @end lisp
950 @noindent will define the key @kbd{C-c a f} as a shortcut for creating
951 a sparse tree matching the string @samp{FIXME}.
953 Other commands use sparse trees as well.  For example @kbd{C-c
954 C-v} creates a sparse TODO tree (@pxref{TODO basics}).
956 @kindex C-c C-e v
957 @cindex printing sparse trees
958 @cindex visible text, printing
959 To print a sparse tree, you can use the Emacs command
960 @code{ps-print-buffer-with-faces} which does not print invisible parts
961 of the document @footnote{This does not work under XEmacs, because
962 XEmacs uses selective display for outlining, not text properties.}.
963 Or you can use the command @kbd{C-c C-e v} to export only the visible
964 part of the document and print the resulting file.
966 @node Plain lists,  , Sparse trees, Document structure
967 @section Plain lists
968 @cindex plain lists
969 @cindex lists, plain
970 @cindex lists, ordered
971 @cindex ordered lists
973 Within an entry of the outline tree, hand-formatted lists can provide
974 additional structure.  They also provide a way to create lists of
975 checkboxes (@pxref{Checkboxes}).  Org-mode supports editing such lists,
976 and the HTML exporter (@pxref{Exporting}) does parse and format them.
978 Org-mode knows ordered and unordered lists.  Unordered list items start
979 with @samp{-}, @samp{+}, or @samp{*}@footnote{When using @samp{*} as a
980 bullet, lines must be indented or they will be seen as top-level
981 headlines.  Also, when you are hiding leading stars to get a clean
982 outline view, plain list items starting with a star are visually
983 indistinguishable from true headlines.  In short: even though @samp{*}
984 is supported, it may be better not to use it for plain list items.} as
985 bullets.  Ordered list items start with @samp{1.} or @samp{1)}.  Items
986 belonging to the same list must have the same indentation on the first
987 line.  In particular, if an ordered list reaches number @samp{10.}, then
988 the 2--digit numbers must be written left-aligned with the other numbers
989 in the list.  Indentation also determines the end of a list item.  It
990 ends before the next line that is indented like the bullet/number, or
991 less.  Empty lines are part of the previous item, so you can have
992 several paragraphs in one item.  If you would like an emtpy line to
993 terminate all currently open plain lists, configure the variable
994 @code{org-empty-line-terminates-plain-lists}.  Here is an for example:
996 @example
997 @group
998 ** Lord of the Rings
999    My favorite scenes are (in this order)
1000    1. The attack of the Rohirrim
1001    2. Eowyns fight with the witch king
1002       + this was already my favorite scene in the book
1003       + I really like Miranda Otto.
1004    3. Peter Jackson being shot by Legolas
1005        - on DVD only
1006       He makes a really funny face when it happens.
1007    But in the end, not individual scenes matter but the film as a whole.
1008 @end group
1009 @end example
1011 Org-mode supports these lists by tuning filling and wrapping commands to
1012 deal with them correctly@footnote{Org-mode only changes the filling
1013 settings for Emacs.  For XEmacs, you should use Kyle E. Jones'
1014 @file{filladapt.el}.  To turn this on,  put into @file{.emacs}:
1015 @example
1016 (require 'filladapt)
1017 @end example
1020 The following commands act on items when the cursor is in the first line
1021 of an item (the line with the bullet or number).
1023 @table @kbd
1024 @kindex @key{TAB}
1025 @item @key{TAB}
1026 Items can be folded just like headline levels if you set the variable
1027 @code{org-cycle-include-plain-lists}.  The level of an item is then
1028 given by the indentation of the bullet/number.  Items are always
1029 subordinate to real headlines, however; the hierarchies remain
1030 completely separated.
1031 @kindex M-@key{RET}
1032 @item M-@key{RET}
1033 Insert new item at current level.  With prefix arg, force a new heading
1034 (@pxref{Structure editing}).  If this command is used in the middle of a
1035 line, the line is @emph{split} and the rest of the line becomes the new
1036 item.  If this command is executed in the @emph{whitespace before a bullet or
1037 number}, the new item is created @emph{before} the current item.  If the
1038 command is executed in the white space before the text that is part of
1039 an item but does not contain the bullet, a bullet is added to the
1040 current line.
1041 @kindex M-S-@key{RET}
1042 @item M-S-@key{RET}
1043 Insert a new item with a checkbox (@pxref{Checkboxes}).
1044 @kindex S-@key{up}
1045 @kindex S-@key{down}
1046 @item S-@key{up}
1047 @itemx S-@key{down}
1048 Jump to the previous/next item in the current list.
1049 @kindex M-S-@key{up}
1050 @kindex M-S-@key{down}
1051 @item M-S-@key{up}
1052 @itemx M-S-@key{down}
1053 Move the item including subitems up/down (swap with previous/next item
1054 of same indentation).  If the list is ordered, renumbering is
1055 automatic.
1056 @kindex M-S-@key{left}
1057 @kindex M-S-@key{right}
1058 @item M-S-@key{left}
1059 @itemx M-S-@key{right}
1060 Decrease/increase the indentation of the item, including subitems.
1061 Initially, the item tree is selected based on current indentation.
1062 When these commands are executed several times in direct succession,
1063 the initially selected region is used, even if the new indentation
1064 would imply a different hierarchy.  To use the new hierarchy, break
1065 the command chain with a cursor motion or so.
1066 @kindex C-c C-c
1067 @item C-c C-c
1068 If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the
1069 state of the checkbox.  Otherwise, if this is an ordered list, renumber
1070 the ordered list at the cursor.
1071 @end table
1073 @node Tables, Hyperlinks, Document structure, Top
1074 @chapter Tables
1075 @cindex tables
1076 @cindex editing tables
1078 Org-mode has a very fast and intuitive table editor built-in.
1079 Spreadsheet-like calculations are supported in connection with the
1080 Emacs @file{calc} package.
1082 @menu
1083 * Built-in table editor::       Simple tables
1084 * Narrow columns::              Stop wasting space in tables   
1085 * orgtbl-mode::                 The table editor as minor mode
1086 * The spreadsheet::             The table editor has spreadsheet capabilities.
1087 @end menu
1089 @node Built-in table editor, Narrow columns, Tables, Tables
1090 @section The built-in table editor
1091 @cindex table editor, built-in
1093 Org-mode makes it easy to format tables in plain ASCII.  Any line with
1094 @samp{|} as the first non-white character is considered part of a
1095 table.  @samp{|} is also the column separator.  A table might look
1096 like this:
1098 @example
1099 | Name  | Phone | Age |
1100 |-------+-------+-----|
1101 | Peter |  1234 |  17 |
1102 | Anna  |  4321 |  25 |
1103 @end example
1105 A table is re-aligned automatically each time you press @key{TAB} or
1106 @key{RET} or @kbd{C-c C-c} inside the table.  @key{TAB} also moves to
1107 the next field (@key{RET} to the next row) and creates new table rows
1108 at the end of the table or before horizontal lines.  The indentation
1109 of the table is set by the first line.  Any line starting with
1110 @samp{|-} is considered as a horizontal separator line and will be
1111 expanded on the next re-align to span the whole table width.  So, to
1112 create the above table, you would only type
1114 @example
1115 |Name|Phone|Age|
1117 @end example
1119 @noindent and then press @key{TAB} to align the table and start filling in
1120 fields.
1122 When typing text into a field, Org-mode treats @key{DEL},
1123 @key{Backspace}, and all character keys in a special way, so that
1124 inserting and deleting avoids shifting other fields.  Also, when
1125 typing @emph{immediately after the cursor was moved into a new field
1126 with @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the
1127 field is automatically made blank.  If this behavior is too
1128 unpredictable for you, configure the variables
1129 @code{org-enable-table-editor} and @code{org-table-auto-blank-field}.
1131 @table @kbd
1132 @tsubheading{Creation and conversion}
1133 @kindex C-c |
1134 @item C-c |
1135 Convert the active region to table. If every line contains at least one
1136 TAB character, the function assumes that the material is tab separated.
1137 If not, lines are split at whitespace into fields.  You can use a prefix
1138 argument to indicate the minimum number of consecutive spaces required
1139 to identify a field separator (default: just one).@* 
1140 If there is no active region, this command creates an empty Org-mode
1141 table.  But it's easier just to start typing, like
1142 @kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}.
1144 @tsubheading{Re-aligning and field motion}
1145 @kindex C-c C-c
1146 @item C-c C-c
1147 Re-align the table without moving the cursor.
1149 @kindex @key{TAB}
1150 @item @key{TAB}
1151 Re-align the table, move to the next field.  Creates a new row if
1152 necessary.
1154 @kindex S-@key{TAB}
1155 @item S-@key{TAB}
1156 Re-align, move to previous field.
1158 @kindex @key{RET}
1159 @item @key{RET}
1160 Re-align the table and move down to next row.  Creates a new row if
1161 necessary.  At the beginning or end of a line, @key{RET} still does
1162 NEWLINE, so it can be used to split a table.
1164 @tsubheading{Column and row editing}
1165 @kindex M-@key{left}
1166 @kindex M-@key{right}
1167 @item M-@key{left}
1168 @itemx M-@key{right}
1169 Move the current column left/right.
1171 @kindex M-S-@key{left}
1172 @item M-S-@key{left}
1173 Kill the current column.
1175 @kindex M-S-@key{right}
1176 @item M-S-@key{right}
1177 Insert a new column to the left of the cursor position.
1179 @kindex M-@key{up}
1180 @kindex M-@key{down}
1181 @item M-@key{up}
1182 @itemx M-@key{down}
1183 Move the current row up/down.
1185 @kindex M-S-@key{up}
1186 @item M-S-@key{up}
1187 Kill the current row or horizontal line.
1189 @kindex M-S-@key{down}
1190 @item M-S-@key{down}
1191 Insert a new row above (with arg: below) the current row.
1193 @kindex C-c -
1194 @item C-c -
1195 Insert a horizontal line below current row. With prefix arg, the line
1196 is created above the current line.
1198 @kindex C-c ^
1199 @item C-c ^
1200 Sort the table lines in the region.  The position of point indicates the
1201 column to be used for sorting, and the range of lines is the range
1202 between the nearest horizontal separator lines, or the entire table.  If
1203 point is before the first column, you will be prompted for the sorting
1204 column.  If there is an active region, the mark specifies the first line
1205 and the sorting column, while point should be in the last line to be
1206 included into the sorting.  The command prompts for the sorting type
1207 (alphabetically, numerically, or by time).  When called with a prefix
1208 argument, alphabetic sorting will be case-sensitive.
1210 @tsubheading{Regions}
1211 @kindex C-c C-x M-w
1212 @item C-c C-x M-w
1213 Copy a rectangular region from a table to a special clipboard.  Point
1214 and mark determine edge fields of the rectangle.  The process ignores
1215 horizontal separator lines.
1217 @kindex C-c C-x C-w
1218 @item C-c C-x C-w
1219 Copy a rectangular region from a table to a special clipboard, and
1220 blank all fields in the rectangle.  So this is the ``cut'' operation.
1222 @kindex C-c C-x C-y
1223 @item C-c C-x C-y
1224 Paste a rectangular region into a table.
1225 The upper right corner ends up in the current field.  All involved fields
1226 will be overwritten.  If the rectangle does not fit into the present table,
1227 the table is enlarged as needed.  The process ignores horizontal separator
1228 lines.
1230 @kindex C-c C-q
1231 @item C-c C-q
1232 Wrap several fields in a column like a paragraph.  If there is an active
1233 region, and both point and mark are in the same column, the text in the
1234 column is wrapped to minimum width for the given number of lines.  A
1235 prefix ARG may be used to change the number of desired lines.  If there
1236 is no region, the current field is split at the cursor position and the
1237 text fragment to the right of the cursor is prepended to the field one
1238 line down. If there is no region, but you specify a prefix ARG, the
1239 current field is made blank, and the content is appended to the field
1240 above.
1242 @tsubheading{Calculations}
1243 @cindex formula, in tables
1244 @cindex calculations, in tables
1245 @cindex region, active
1246 @cindex active region
1247 @cindex transient-mark-mode
1248 @kindex C-c +
1249 @item C-c +
1250 Sum the numbers in the current column, or in the rectangle defined by
1251 the active region.  The result is shown in the echo area and can
1252 be inserted with @kbd{C-y}.
1254 @kindex S-@key{RET}
1255 @item S-@key{RET}
1256 When current field is empty, copy from first non-empty field above.
1257 When not empty, copy current field down to next row and move cursor
1258 along with it.  Depending on the variable
1259 @code{org-table-copy-increment}, integer field values will be
1260 incremented during copy.  This key is also used by CUA-mode
1261 (@pxref{Cooperation}).
1263 @tsubheading{Miscellaneous}
1264 @kindex C-c `
1265 @item C-c `
1266 Edit the current field in a separate window.  This is useful for fields
1267 that are not fully visible (@pxref{Narrow columns}).  When called with a
1268 @kbd{C-u} prefix, just make the full field visible, so that it can be
1269 edited in place.
1271 @kindex C-c @key{TAB}
1272 @item C-c @key{TAB}
1273 This is an alias for @kbd{C-u C-c `} to make the current field fully
1274 visible.
1276 @item M-x org-table-import
1277 Import a file as a table.  The table should be TAB- or whitespace
1278 separated.  Useful, for example, to import an Excel table or data from a
1279 database, because these programs generally can write TAB-separated text
1280 files.  This command works by inserting the file into the buffer and
1281 then converting the region to a table.  Any prefix argument is passed on
1282 to the converter, which uses it to determine the separator.
1284 @item M-x org-table-export
1285 Export the table as a TAB-separated file.  Useful for data exchange with,
1286 for example, Excel or database programs.
1287 @end table
1289 If you don't like the automatic table editor because it gets in your
1290 way on lines which you would like to start with @samp{|}, you can turn
1291 it off with
1293 @lisp
1294 (setq org-enable-table-editor nil)
1295 @end lisp
1297 @noindent Then the only table command that still works is
1298 @kbd{C-c C-c} to do a manual re-align.
1300 @node Narrow columns, orgtbl-mode, Built-in table editor, Tables
1301 @section Narrow columns
1302 @cindex narrow columns in tables
1304 The width of columns is automatically determined by the table editor.
1305 Sometimes a single field or a few fields need to carry more text,
1306 leading to inconveniently wide columns.  To limit@footnote{This feature
1307 does not work on XEmacs.} the width of a column, one field anywhere in
1308 the column may contain just the string @samp{<N>} where @samp{N} is an
1309 integer specifying the width of the column in characters.  The next
1310 re-align will then set the width of this column to no more than this
1311 value.
1313 @example
1314 @group
1315 |---+------------------------------|               |---+--------|
1316 |   |                              |               |   | <6>    |
1317 | 1 | one                          |               | 1 | one    |
1318 | 2 | two                          |     ----\     | 2 | two    |
1319 | 3 | This is a long chunk of text |     ----/     | 3 | This=> |
1320 | 4 | four                         |               | 4 | four   |
1321 |---+------------------------------|               |---+--------|
1322 @end group
1323 @end example
1325 @noindent
1326 Fields that are wider become clipped and end in the string @samp{=>}.
1327 Note that the full text is still in the buffer, it is only invisible.
1328 To see the full text, hold the mouse over the field - a tool-tip window
1329 will show the full content.  To edit such a field, use the command
1330 @kbd{C-c `} (that is @kbd{C-c} followed by the backquote).  This will
1331 open a new window with the full field.  Edit it and finish with @kbd{C-c
1332 C-c}.
1334 When visiting a file containing a table with narrowed columns, the
1335 necessary character hiding has not yet happened, and the table needs to
1336 be aligned before it looks nice.  Setting the option
1337 @code{org-startup-align-all-tables} will realign all tables in a file
1338 upon visiting, but also slow down startup.  You can also set this option
1339 on a per-file basis with:
1341 @example
1342 #+STARTUP: align
1343 #+STARTUP: noalign
1344 @end example
1346 @node orgtbl-mode, The spreadsheet, Narrow columns, Tables
1347 @section The Orgtbl minor mode
1348 @cindex orgtbl-mode
1349 @cindex minor mode for tables
1351 If you like the intuitive way the Org-mode table editor works, you
1352 might also want to use it in other modes like text-mode or mail-mode.
1353 The minor mode Orgtbl-mode makes this possible.  You can always toggle
1354 the mode with @kbd{M-x orgtbl-mode}.  To turn it on by default, for
1355 example in mail mode, use
1357 @lisp
1358 (add-hook 'mail-mode-hook 'turn-on-orgtbl)
1359 @end lisp
1361 Furthermore, with some special setup, it is possible to maintain tables
1362 in arbitrary syntax with Orgtbl-mode.  For example, it is possible to
1363 construct LaTeX tables with the underlying ease and power of
1364 Orgtbl-mode, including spreadsheet capabilities.  For details, see
1365 @ref{Tables in arbitrary syntax}.
1367 @node The spreadsheet,  , orgtbl-mode, Tables
1368 @section The spreadsheet
1369 @cindex calculations, in tables
1370 @cindex spreadsheet capabilities
1371 @cindex @file{calc} package
1373 The table editor makes use of the Emacs @file{calc} package to implement
1374 spreadsheet-like capabilities.  It can also evaluate Emacs Lisp forms to
1375 derive fields from other fields.  While fully featured, Org-mode's
1376 implementation is not identical to other spreadsheets.  For example,
1377 Org-mode knows the concept of a @emph{column formula} that will be
1378 applied to all non-header fields in a column without having to copy the
1379 formula to each relevant field.
1381 @menu
1382 * References::                  How to refer to another field or range
1383 * Formula syntax for Calc::     Using Calc to compute stuff
1384 * Formula syntax for Lisp::     Writing formulas in Emacs Lisp
1385 * Field formulas::              Formulas valid for a single field
1386 * Column formulas::             Formulas valid for an entire column
1387 * Editing and debugging formulas::  Fixing formulas
1388 * Updating the table::          Recomputing all dependent fields
1389 * Advanced features::           Field names, parameters and automatic recalc
1390 @end menu
1392 @node References, Formula syntax for Calc, The spreadsheet, The spreadsheet
1393 @subsection References
1394 @cindex references
1396 To compute fields in the table from other fields, formulas must
1397 reference other fields or ranges.  In Org-mode, fields can be referenced
1398 by name, by absolute coordinates, and by relative coordinates.  To find
1399 out what the coordinates of a field are, press @kbd{C-c ?} in that
1400 field, or press @kbd{C-c @}} to toggle the display of a grid.
1402 @subsubheading Field references
1403 @cindex field references
1404 @cindex references, to fields
1406 Formulas can reference the value of another field in two ways.  Like in
1407 any other spreadsheet, you may reference fields with a letter/number
1408 combination like @code{B3}, meaning the 2nd field in the 3rd row.
1409 @c Such references are always fixed to that field, they don't change
1410 @c when you copy and paste a formula to a different field.  So
1411 @c Org-mode's @code{B3} behaves like @code{$B$3} in other spreadsheets.
1413 @noindent
1414 Org-mode also uses another, more general operator that looks like this:
1415 @example
1416 @@row$column
1417 @end example
1419 @noindent
1420 Column references can be absolute like @samp{1}, @samp{2},...@samp{N},
1421 or relative to the current column like @samp{+1} or @samp{-2}.
1423 The row specification only counts data lines and ignores horizontal
1424 separator lines (hlines).  You can use absolute row numbers
1425 @samp{1}...@samp{N}, and row numbers relative to the current row like
1426 @samp{+3} or @samp{-1}.  Or specify the row relative to one of the
1427 hlines: @samp{I} refers to the first hline, @samp{II} to the second etc.
1428 @samp{-I} refers to the first such line above the current line,
1429 @samp{+I} to the first such line below the current line.  You can also
1430 write @samp{III+2} which is the second data line after the third hline
1431 in the table.  Relative row numbers like @samp{-3} will not cross hlines
1432 if the current line is too close to the hline.  Instead, the value
1433 directly at the hline is used.
1435 @samp{0} refers to the current row and column.  Also, if you omit
1436 either the column or the row part of the reference, the current
1437 row/column is implied. 
1439 Org-mode's references with @emph{unsigned} numbers are fixed references
1440 in the sense that if you use the same reference in the formula for two
1441 different fields, the same field will be referenced each time.
1442 Org-mode's references with @emph{signed} numbers are floating
1443 references because the same reference operator can reference different
1444 fields depending on the field being calculated by the formula.
1446 Here are a few examples:
1448 @example
1449 @@2$3      @r{2nd row, 3rd column}
1450 C2        @r{same as previous}
1451 $5        @r{column 5 in the current row}
1452 E&        @r{same as previous}
1453 @@2        @r{current column, row 2}
1454 @@-1$-3    @r{the field one row up, three columns to the left}
1455 @@-I$2     @r{field just under hline above current row, column 2}
1456 @end example
1458 @subsubheading Range references
1459 @cindex range references
1460 @cindex references, to ranges
1462 You may reference a rectangular range of fields by specifying two field
1463 references connected by two dots @samp{..}.  If both fields are in the
1464 current row, you may simply use @samp{$2..$7}, but if at least one field
1465 is in a different row, you need to use the general @code{@@row$column}
1466 format at least for the first field (i.e the reference must start with
1467 @samp{@@} in order to be interpreted correctly).  Examples:
1469 @example
1470 $1..$3        @r{First three fields in the current row.}
1471 $P..$Q        @r{Range, using column names (see under Advanced)}
1472 @@2$1..@@4$3    @r{6 fields between these two fields.}
1473 A2..C4        @r{Same as above.}
1474 @@-1$-2..@@-1   @r{3 numbers from the column to the left, 2 up to current row}
1475 @end example
1477 @noindent Range references return a vector of values that can be fed
1478 into Calc vector functions.  Empty fields in ranges are normally
1479 suppressed, so that the vector contains only the non-empty fields (but
1480 see the @samp{E} mode switch below).  If there are no non-empty fields,
1481 @samp{[0]} is returned to avoid syntax errors in formulas.
1483 @subsubheading Named references
1484 @cindex named references
1485 @cindex references, named
1486 @cindex name, of column or field
1487 @cindex constants, in calculations
1489 @samp{$name} is interpreted as the name of a column, parameter or
1490 constant.  Constants are defined globally through the variable
1491 @code{org-table-formula-constants}.  If you have the @file{constants.el}
1492 package, it will also be used to resolve constants, including natural
1493 constants like @samp{$h} for Planck's constant, and units like
1494 @samp{$km} for kilometers@footnote{@file{Constant.el} can supply the
1495 values of constants in two different unit systems, @code{SI} and
1496 @code{cgs}.  Which one is used depends on the value of the variable
1497 @code{constants-unit-system}.  You can use the @code{#+STARTUP} options
1498 @code{constSI} and @code{constcgs} to set this value for the current
1499 buffer.}.  Column names and parameters can be specified in special table
1500 lines.  These are described below, see @ref{Advanced features}.  All
1501 names must start with a letter, and further consist of letters and
1502 numbers.
1504 @node Formula syntax for Calc, Formula syntax for Lisp, References, The spreadsheet
1505 @subsection Formula syntax for Calc
1506 @cindex formula syntax, Calc
1507 @cindex syntax, of formulas
1509 A formula can be any algebraic expression understood by the Emacs
1510 @file{Calc} package.  Note that @file{calc} has the slightly
1511 non-standard convention that @samp{/} has lower precedence than
1512 @samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.  Before
1513 evaluation by @code{calc-eval} (@pxref{Calling Calc from
1514 Your Programs,calc-eval,Calling calc from Your Lisp Programs,calc,GNU
1515 Emacs Calc Manual}),
1516 variable substitution takes place according to the rules described above.
1517 @cindex vectors, in table calculations
1518 The range vectors can be directly fed into the calc vector functions
1519 like @samp{vmean} and @samp{vsum}.
1521 @cindex format specifier
1522 @cindex mode, for @file{calc}
1523 A formula can contain an optional mode string after a semicolon.  This
1524 string consists of flags to influence Calc and other modes during
1525 execution.  By default, Org-mode uses the standard calc modes (precision
1526 12, angular units degrees, fraction and symbolic modes off.  The display
1527 format, however, has been changed to @code{(float 5)} to keep tables
1528 compact.  The default settings can be configured using the variable
1529 @code{org-calc-default-modes}.
1531 @example
1532 p20           @r{switch the internal precision to 20 digits}
1533 n3 s3 e2 f4   @r{normal, scientific, engineering, or fixed display format}
1534 D R           @r{angle modes: degrees, radians}
1535 F S           @r{fraction and symbolic modes}
1536 N             @r{interpret all fields as numbers, use 0 for non-numbers}
1537 T             @r{force text interpretation}
1538 E             @r{keep empty fields in ranges}
1539 @end example
1541 @noindent
1542 In addition, you may provide a @code{printf} format specifier to
1543 reformat the final result.  A few examples:
1545 @example
1546 $1+$2                @r{Sum of first and second field}
1547 $1+$2;%.2f           @r{Same, format result to two decimals}
1548 exp($2)+exp($1)      @r{Math functions can be used}
1549 $0;%.1f              @r{Reformat current cell to 1 decimal}
1550 ($3-32)*5/9          @r{Degrees F -> C conversion}
1551 $c/$1/$cm            @r{Hz -> cm conversion, using @file{constants.el}}
1552 tan($1);Dp3s1        @r{Compute in degrees, precision 3, display SCI 1}
1553 sin($1);Dp3%.1e      @r{Same, but use printf specifier for display}
1554 vmean($2..$7)        @r{Compute column range mean, using vector function}
1555 vmean($2..$7);EN     @r{Same, but treat empty fields as 0}
1556 taylor($3,x=7,2)     @r{taylor series of $3, at x=7, second degree}
1557 @end example
1559 Calc also contains a complete set of logical operations.  For example
1561 @example
1562 if($1<20,teen,string(""))  @r{``teen'' if age $1 less than 20, else empty}
1563 @end example
1565 @node Formula syntax for Lisp, Field formulas, Formula syntax for Calc, The spreadsheet
1566 @subsection Emacs Lisp forms as formulas
1567 @cindex Lisp forms, as table formulas
1569 It is also possible to write a formula in Emacs Lisp; this can be useful
1570 for string manipulation and control structures, if the Calc's
1571 functionality is not enough.  If a formula starts with a single quote
1572 followed by an opening parenthesis, then it is evaluated as a lisp form.
1573 The evaluation should return either a string or a number.  Just as with
1574 @file{calc} formulas, you can specify modes and a printf format after a
1575 semicolon.  A reference will be replaced with a string (in double
1576 quotes) containing the field.  If you provide the @samp{N} mode switch,
1577 all referenced elements will be numbers.  Ranges are inserted as
1578 space-separated fields, so you can embed them in list or vector syntax.
1579 A few examples, note how the @samp{N} mode is used when we do
1580 computations in lisp.
1582 @example
1583 @r{Swap the first two characters of the content of column 1}
1584   '(concat (substring $1 1 2) (substring $1 0 1) (substring $1 2))
1585 @r{Add columns 1 and 2, equivalent to the Calc's @code{$1+$2}}
1586   '(+ $1 $2);N
1587 @r{Compute the sum of columns 1-4, like Calc's @code{vsum($1..$4)}}
1588   '(apply '+ '($1..$4));N
1589 @end example
1591 @node Field formulas, Column formulas, Formula syntax for Lisp, The spreadsheet
1592 @subsection Field formulas
1593 @cindex field formula
1594 @cindex formula, for individual table field
1596 To assign a formula to a particular field, type it directly into the
1597 field, preceded by @samp{:=}, for example @samp{:=$1+$2}.  When you
1598 press @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in
1599 the field, the formula will be stored as the formula for this field,
1600 evaluated, and the current field replaced with the result.
1602 Formulas are stored in a special line starting with @samp{#+TBLFM:}
1603 directly below the table.  If you typed the equation in the 4th field of
1604 the 3rd data line in the table, the formula will look like
1605 @samp{@@3$4=$1+$2}.  When inserting/deleting/swapping column and rows
1606 with the appropriate commands, @i{absolute references} (but not relative
1607 ones) in stored formulas are modified in order to still reference the
1608 same field.  Of cause this is not true if you edit the table structure
1609 with normal editing commands - then you must fix the equations yourself.
1611 Instead of typing an equation into the field, you may also use the
1612 following command
1614 @table @kbd
1615 @kindex C-u C-c =
1616 @item C-u C-c =
1617 Install a new formula for the current field.  The command prompts for a
1618 formula, with default taken from the @samp{#+TBLFM:} line, applies
1619 it to the current field and stores it.
1620 @end table
1622 @node Column formulas, Editing and debugging formulas, Field formulas, The spreadsheet
1623 @subsection Column formulas
1624 @cindex column formula
1625 @cindex formula, for table column
1627 Often in a table, the same formula should be used for all fields in a
1628 particular column.  Instead of having to copy the formula to all fields
1629 in that column, org-mode allows to assign a single formula to an entire
1630 column.  If the table contains horizontal separator hlines, everything
1631 before the first such line is considered part of the table @emph{header}
1632 and will not be modified by column formulas.
1634 To assign a formula to a column, type it directly into any field in the
1635 column, preceded by an equal sign, like @samp{=$1+$2}.  When you press
1636 @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in the
1637 field, the formula will be stored as the formula for the current column,
1638 evaluated and the current field replaced with the result.  If the field
1639 contains only @samp{=}, the previously stored formula for this column is
1640 used.  For each column, Org-mode will only remember the most recently
1641 used formula.  In the @samp{TBLFM:} line, column formulas will look like
1642 @samp{$4=$1+$2}.
1644 Instead of typing an equation into the field, you may also use the
1645 following command:
1647 @table @kbd
1648 @kindex C-c =
1649 @item C-c =
1650 Install a new formula for the current column and replace current field
1651 with the result of the formula.  The command prompts for a formula, with
1652 default taken from the @samp{#+TBLFM} line, applies it to the current
1653 field and stores it.  With a numerical prefix (e.g. @kbd{C-5 C-c =})
1654 will apply it to that many consecutive fields in the current column.
1655 @end table
1658 @node Editing and debugging formulas, Updating the table, Column formulas, The spreadsheet
1659 @subsection Editing and Debugging formulas
1660 @cindex formula editing
1661 @cindex editing, of table formulas
1663 You can edit individual formulas in the minibuffer or directly in the
1664 field.  Org-mode can also prepare a special buffer with all active
1665 formulas of a table.  When offering a formula for editing, Org-mode
1666 converts references to the standard format (like @code{B3} or @code{D&})
1667 if possible.  If you prefer to only work with the internal format (like
1668 @code{@@3$2} or @code{$4}), configure the variable
1669 @code{org-table-use-standard-references}.
1671 @table @kbd
1672 @kindex C-c =
1673 @kindex C-u C-c =
1674 @item C-c =
1675 @itemx C-u C-c =
1676 Edit the formula associated with the current column/field in the
1677 minibuffer.  See @ref{Column formulas} and @ref{Field formulas}.
1678 @kindex C-u C-u C-c =
1679 @item C-u C-u C-c =
1680 Re-insert the active formula (either a
1681 field formula, or a column formula) into the current field, so that you
1682 can edit it directly in the field.  The advantage over editing in the
1683 minibuffer is that you can use the command @kbd{C-c ?}.
1684 @kindex C-c ?
1685 @item C-c ?
1686 While editing a formula in a table field, highlight the field(s)
1687 referenced by the reference at the cursor position in the formula.
1688 @kindex C-c @}
1689 @item C-c @}
1690 Toggle the display of row and column numbers for a table, using
1691 overlays.  These are updated each time the table is aligned, you can
1692 force it with @kbd{C-c C-c}.
1693 @kindex C-c @{
1694 @item C-c @{
1695 Toggle the formula debugger on and off.  See below.
1696 @kindex C-c '
1697 @item C-c '
1698 Edit all formulas for the current table in a special buffer, where the
1699 formulas will be displayed one per line.  If the current field has an
1700 active formula, the cursor in the formula editor will mark it.
1701 While inside the special buffer, Org-mode will automatically highlight
1702 any field or range reference at the cursor position.  You may edit,
1703 remove and add formulas, and use the following commands:
1704 @table @kbd
1705 @kindex C-c C-c
1706 @kindex C-x C-s
1707 @item C-c C-c
1708 @itemx C-x C-s
1709 Exit the formula editor and store the modified formulas.  With @kbd{C-u}
1710 prefix, also apply the new formulas to the entire table.
1711 @kindex C-c C-q
1712 @item C-c C-q
1713 Exit the formula editor without installing changes.
1714 @kindex C-c C-r
1715 @item C-c C-r
1716 Toggle all references in the formula editor between standard (like
1717 @code{B3}) and internal (like @code{@@3$2}).
1718 @kindex @key{TAB}
1719 @item @key{TAB}
1720 Pretty-print or indent lisp formula at point.  When in a line containing
1721 a lisp formula, format the formula according to Emacs Lisp rules.
1722 Another @key{TAB} collapses the formula back again.  In the open
1723 formula, @key{TAB} re-indents just like in Emacs-lisp-mode.
1724 @kindex M-@key{TAB}
1725 @item M-@key{TAB}
1726 Complete Lisp symbols, just like in Emacs-lisp-mode.
1727 @kindex S-@key{up}
1728 @kindex S-@key{down}
1729 @kindex S-@key{left}
1730 @kindex S-@key{right}
1731 @item S-@key{up}/@key{down}/@key{left}/@key{right}
1732 Shift the reference at point.  For example, if the reference is
1733 @code{B3} and you press @kbd{S-@key{right}}, it will become @code{C3}.
1734 This also works for relative references, and for hline references.
1735 @kindex M-S-@key{up}
1736 @kindex M-S-@key{down}
1737 @item M-S-@key{up}/@key{down}
1738 Move the test line for column formulas in the Org-mode buffer up and
1739 down.
1740 @kindex M-@key{up}
1741 @kindex M-@key{down}
1742 @item M-@key{up}/@key{down}
1743 Scroll the window displaying the table.
1744 @kindex C-c @}
1745 @item C-c @}
1746 Turn the coordinate grid in the table on and off.
1747 @end table
1748 @end table
1750 Making a table field blank does not remove the formula associated with
1751 the field, because that is stored in a different line (the @samp{TBLFM}
1752 line) - during the next recalculation the field will be filled again.
1753 To remove a formula from a field, you have to give an empty reply when
1754 prompted for the formula, or to edit the @samp{#+TBLFM} line.
1756 @kindex C-c C-c
1757 You may edit the @samp{#+TBLFM} directly and re-apply the changed
1758 equations with @kbd{C-c C-c} in that line, or with the normal
1759 recalculation commands in the table.
1761 @subsubheading Debugging formulas
1762 @cindex formula debugging
1763 @cindex debugging, of table formulas
1764 When the evaluation of a formula leads to an error, the field content
1765 becomes the string @samp{#ERROR}.  If you would like see what is going
1766 on during variable substitution and calculation in order to find a bug,
1767 turn on formula debugging in the @code{Tbl} menu and repeat the
1768 calculation, for example by pressing @kbd{C-u C-u C-c = @key{RET}} in a
1769 field.  Detailed information will be displayed.
1771 @node Updating the table, Advanced features, Editing and debugging formulas, The spreadsheet
1772 @subsection Updating the Table
1773 @cindex recomputing table fields
1774 @cindex updating, table
1776 Recalculation of a table is normally not automatic, but needs to be
1777 triggered by a command.  See @ref{Advanced features} for a way to make
1778 recalculation at least semi-automatically.
1780 In order to recalculate a line of a table or the entire table, use the
1781 following commands:
1783 @table @kbd
1784 @kindex C-c *
1785 @item C-c *
1786 Recalculate the current row by first applying the stored column formulas
1787 from left to right, and all field formulas in the current row.
1789 @kindex C-u C-c *
1790 @item C-u C-c *
1791 @kindex C-u C-c C-c
1792 @itemx C-u C-c C-c
1793 Recompute the entire table, line by line.  Any lines before the first
1794 hline are left alone, assuming that these are part of the table header.
1796 @kindex C-u C-u C-c *
1797 @item C-u C-u C-c *
1798 Iterate the table by recomputing it until no further changes occur.
1799 This may be necessary if some computed fields use the value of other
1800 fields that are computed @i{later} in the calculation sequence.
1801 @end table
1803 @node Advanced features,  , Updating the table, The spreadsheet
1804 @subsection Advanced features
1806 If you want the recalculation of fields to happen automatically, or if
1807 you want to be able to assign @i{names} to fields and columns, you need
1808 to reserve the first column of the table for special marking characters.
1809 @table @kbd
1810 @kindex C-#
1811 @item C-#
1812 Rotate the calculation mark in first column through the states @samp{},
1813 @samp{#}, @samp{*}, @samp{!}, @samp{$}.  The meaning of these characters
1814 is discussed below.  When there is an active region, change all marks in
1815 the region.
1816 @end table
1818 Here is an example of a table that collects exam results of students and
1819 makes use of these features:
1821 @example
1822 @group
1823 |---+---------+--------+--------+--------+-------+------|
1824 |   | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
1825 |---+---------+--------+--------+--------+-------+------|
1826 | ! |         |     P1 |     P2 |     P3 |   Tot |      |
1827 | # | Maximum |     10 |     15 |     25 |    50 | 10.0 |
1828 | ^ |         |     m1 |     m2 |     m3 |    mt |      |
1829 |---+---------+--------+--------+--------+-------+------|
1830 | # | Peter   |     10 |      8 |     23 |    41 |  8.2 |
1831 | # | Sara    |      6 |     14 |     19 |    39 |  7.8 |
1832 | # | Sam     |      2 |      4 |      3 |     9 |  1.8 |
1833 |---+---------+--------+--------+--------+-------+------|
1834 |   | Average |        |        |        |  29.7 |      |
1835 | ^ |         |        |        |        |    at |      |
1836 | $ | max=50  |        |        |        |       |      |
1837 |---+---------+--------+--------+--------+-------+------|
1838 #+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(@@-II..@@-I);%.1f
1839 @end group
1840 @end example
1842 @noindent @b{Important}: Please note that for these special tables,
1843 recalculating the table with @kbd{C-u C-c *} will only affect rows that
1844 are marked @samp{#} or @samp{*}, and fields that have a formula assigned
1845 to the field itself.  The column formulas are not applied in rows with
1846 empty first field.
1848 @cindex marking characters, tables
1849 The marking characters have the following meaning:
1850 @table @samp
1851 @item !
1852 The fields in this line define names for the columns, so that you may
1853 refer to a column as @samp{$Tot} instead of @samp{$6}.
1854 @item ^
1855 This row defines names for the fields @emph{above} the row.  With such
1856 a definition, any formula in the table may use @samp{$m1} to refer to
1857 the value @samp{10}.  Also, if you assign a formula to a names field, it
1858 will be stored as @samp{$name=...}.
1859 @item _
1860 Similar to @samp{^}, but defines names for the fields in the row
1861 @emph{below}.
1862 @item $
1863 Fields in this row can define @emph{parameters} for formulas.  For
1864 example, if a field in a @samp{$} row contains @samp{max=50}, then
1865 formulas in this table can refer to the value 50 using @samp{$max}.
1866 Parameters work exactly like constants, only that they can be defined on
1867 a per-table basis.
1868 @item #
1869 Fields in this row are automatically recalculated when pressing
1870 @key{TAB} or @key{RET} or @kbd{S-@key{TAB}} in this row.  Also, this row
1871 is selected for a global recalculation with @kbd{C-u C-c *}.  Unmarked
1872 lines will be left alone by this command.
1873 @item *
1874 Selects this line for global recalculation with @kbd{C-u C-c *}, but
1875 not for automatic recalculation.  Use this when automatic
1876 recalculation slows down editing too much.
1877 @item
1878 Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}.
1879 All lines that should be recalculated should be marked with @samp{#}
1880 or @samp{*}.
1881 @item /
1882 Do not export this line.  Useful for lines that contain the narrowing
1883 @samp{<N>} markers.
1884 @end table
1886 Finally, just to whet your appetite on what can be done with the
1887 fantastic @file{calc} package, here is a table that computes the Taylor
1888 series of degree @code{n} at location @code{x} for a couple of functions
1889 (homework: try that with Excel :-)
1891 @example
1892 @group
1893 |---+-------------+---+-----+--------------------------------------|
1894 |   | Func        | n | x   | Result                               |
1895 |---+-------------+---+-----+--------------------------------------|
1896 | # | exp(x)      | 1 | x   | 1 + x                                |
1897 | # | exp(x)      | 2 | x   | 1 + x + x^2 / 2                      |
1898 | # | exp(x)      | 3 | x   | 1 + x + x^2 / 2 + x^3 / 6            |
1899 | # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 |
1900 | # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2    |
1901 | * | tan(x)      | 3 | x   | 0.0175 x + 1.77e-6 x^3               |
1902 |---+-------------+---+-----+--------------------------------------|
1903 #+TBLFM: $5=taylor($2,$4,$3);n3
1904 @end group
1905 @end example
1907 @node Hyperlinks, TODO items, Tables, Top
1908 @chapter Hyperlinks
1909 @cindex hyperlinks
1911 Just like HTML, Org-mode provides links inside a file, and external
1912 links to other files, Usenet articles, emails, and much more.
1914 @menu
1915 * Link format::                 How links in Org-mode are formatted
1916 * Internal links::              Links to other places in the current file
1917 * External links::              URL-like links to the world
1918 * Handling links::              Creating, inserting and following
1919 * Link abbreviations::          Shortcuts for writing complex links
1920 * Search options::              Linking to a specific location
1921 * Custom searches::             When the default search is not enough
1922 * Remember::                    Org-trees store quick notes
1923 @end menu
1925 @node Link format, Internal links, Hyperlinks, Hyperlinks
1926 @section Link format
1927 @cindex link format
1928 @cindex format, of links
1930 Org-mode will recognize plain URL-like links and activate them as
1931 clickable links.  The general link format, however, looks like this:
1933 @example
1934 [[link][description]]       @r{or alternatively}           [[link]]  
1935 @end example
1937 Once a link in the buffer is complete (all brackets present), Org-mode
1938 will change the display so that @samp{description} is displayed instead
1939 of @samp{[[link][description]]} and @samp{link} is displayed instead of
1940 @samp{[[link]]}.  Links will be highlighted in the face @code{org-link},
1941 which by default is an underlined face.  You can directly edit the
1942 visible part of a link.  Note that this can be either the @samp{link}
1943 part (if there is no description) or the @samp{description} part.  To
1944 edit also the invisible @samp{link} part, use @kbd{C-c C-l} with the
1945 cursor on the link.
1947 If you place the cursor at the beginning or just behind the end of the
1948 displayed text and press @key{BACKSPACE}, you will remove the
1949 (invisible) bracket at that location.  This makes the link incomplete
1950 and the internals are again displayed as plain text.  Inserting the
1951 missing bracket hides the link internals again.  To show the
1952 internal structure of all links, use the menu entry
1953 @code{Org->Hyperlinks->Literal links}.
1955 @node Internal links, External links, Link format, Hyperlinks
1956 @section Internal links
1957 @cindex internal links
1958 @cindex links, internal
1959 @cindex targets, for links
1961 If the link does not look like a URL, it is considered to be internal in
1962 the current file.  Links such as @samp{[[My Target]]} or @samp{[[My
1963 Target][Find my target]]} lead to a text search in the current file.
1964 The link can be followed with @kbd{C-c C-o} when the cursor is on the
1965 link, or with a mouse click (@pxref{Handling links}).  The preferred
1966 match for such a link is a dedicated target: the same string in double
1967 angular brackets.  Targets may be located anywhere; sometimes it is
1968 convenient to put them into a comment line. For example
1970 @example
1971 # <<My Target>>
1972 @end example
1974 @noindent In HTML export (@pxref{HTML export}), such targets will become
1975 named anchors for direct access through @samp{http} links@footnote{Note
1976 that text before the first headline will never be exported, so the first
1977 such target must be after the first headline.}.
1979 If no dedicated target exists, Org-mode will search for the words in the
1980 link.  In the above example the search would be for @samp{my target}.
1981 Links starting with a star like @samp{*My Target} restrict the search to
1982 headlines.  When searching, Org-mode will first try an exact match, but
1983 then move on to more and more lenient searches.  For example, the link
1984 @samp{[[*My Targets]]} will find any of the following:
1986 @example
1987 ** My targets
1988 ** TODO my targets are bright
1989 ** my 20 targets are
1990 @end example
1992 To insert a link targeting a headline, in-buffer completion can be used.
1993 Just type a star followed by a few optional letters into the buffer and
1994 press @kbd{M-@key{TAB}}.  All headlines in the current buffer will be
1995 offered as completions.  @xref{Handling links}, for more commands
1996 creating links.
1998 Following a link pushes a mark onto Org-mode's own mark ring.  You can
1999 return to the previous position with @kbd{C-c &}.  Using this command
2000 several times in direct succession goes back to positions recorded
2001 earlier.
2003 @menu
2004 * Radio targets::               Make targets trigger links in plain text.
2005 @end menu
2007 @node Radio targets,  , Internal links, Internal links
2008 @subsection Radio targets
2009 @cindex radio targets
2010 @cindex targets, radio
2011 @cindex links, radio targets
2013 You can configure Org-mode to link any occurrences of certain target
2014 names in normal text.  So without explicitly creating a link, the text
2015 connects to the target radioing its position.  Radio targets are
2016 enclosed by triple angular brackets.  For example, a target
2017 @samp{<<<My Target>>>} causes each occurrence of @samp{my target} in
2018 normal text to become activated as a link.  The Org-mode file is
2019 scanned automatically for radio targets only when the file is first
2020 loaded into Emacs.  To update the target list during editing, press
2021 @kbd{C-c C-c} with the cursor on or at a target.
2023 @node External links, Handling links, Internal links, Hyperlinks
2024 @section External links
2025 @cindex links, external
2026 @cindex external links
2027 @cindex links, external
2028 @cindex GNUS links
2029 @cindex BBDB links
2030 @cindex URL links
2031 @cindex file links
2032 @cindex VM links
2033 @cindex RMAIL links
2034 @cindex WANDERLUST links
2035 @cindex MH-E links
2036 @cindex USENET links
2037 @cindex SHELL links
2038 @cindex Info links
2039 @cindex elisp links
2041 Org-mode supports links to files, websites, Usenet and email messages,
2042 and BBDB database entries.  External links are URL-like locators.  They
2043 start with a short identifying string followed by a colon.  There can be
2044 no space after the colon.  The following list shows examples for each
2045 link type.
2047 @example
2048 http://www.astro.uva.nl/~dominik          @r{on the web}
2049 file:/home/dominik/images/jupiter.jpg     @r{file, absolute path}
2050 file:papers/last.pdf                      @r{file, relative path}
2051 news:comp.emacs                           @r{Usenet link}
2052 mailto:adent@@galaxy.net                   @r{Mail link}
2053 vm:folder                                 @r{VM folder link}
2054 vm:folder#id                              @r{VM message link}
2055 vm://myself@@some.where.org/folder#id      @r{VM on remote machine}
2056 wl:folder                                 @r{WANDERLUST folder link}
2057 wl:folder#id                              @r{WANDERLUST message link}
2058 mhe:folder                                @r{MH-E folder link}
2059 mhe:folder#id                             @r{MH-E message link}
2060 rmail:folder                              @r{RMAIL folder link}
2061 rmail:folder#id                           @r{RMAIL message link}
2062 gnus:group                                @r{GNUS group link}
2063 gnus:group#id                             @r{GNUS article link}
2064 bbdb:Richard Stallman                     @r{BBDB link}
2065 shell:ls *.org                            @r{A shell command}
2066 elisp:(find-file-other-frame "Elisp.org") @r{An elisp form to evaluate}
2067 @end example
2069 A link should be enclosed in double brackets and may contain a
2070 descriptive text to be displayed instead of the url (@pxref{Link
2071 format}), for example:
2073 @example
2074 [[http://www.gnu.org/software/emacs/][GNU Emacs]]
2075 @end example
2077 @noindent
2078 If the description is a file name or URL that points to an image, HTML
2079 export (@pxref{HTML export}) will inline the image as a clickable
2080 button.  If there is no description at all and the link points to an
2081 image,
2082 that image will be inlined into the exported HTML file.
2084 @cindex angular brackets, around links
2085 @cindex plain text external links
2086 Org-mode also finds external links in the normal text and activates them
2087 as links.  If spaces must be part of the link (for example in
2088 @samp{bbdb:Richard Stallman}), or if you need to remove ambiguities
2089 about the end of the link, enclose them in angular brackets.
2091 @node Handling links, Link abbreviations, External links, Hyperlinks
2092 @section Handling links
2093 @cindex links, handling
2095 Org-mode provides methods to create a link in the correct syntax, to
2096 insert it into an org-mode file, and to follow the link.
2098 @table @kbd
2099 @kindex C-c l
2100 @cindex storing links
2101 @item C-c l
2102 Store a link to the current location.  This is a @emph{global} command
2103 which can be used in any buffer to create a link.  The link will be
2104 stored for later insertion into an Org-mode buffer (see below).  For
2105 Org-mode files, if there is a @samp{<<target>>} at the cursor, the link
2106 points to the target.  Otherwise it points to the current headline.  For
2107 VM, RMAIL, WANDERLUST, MH-E, GNUS and BBDB buffers, the link will
2108 indicate the current article/entry.  For W3 and W3M buffers, the link
2109 goes to the current URL.  For any other files, the link will point to
2110 the file, with a search string (@pxref{Search options}) pointing to the
2111 contents of the current line.  If there is an active region, the
2112 selected words will form the basis of the search string.  If the
2113 automatically created link is not working correctly or accurately
2114 enough, you can write custom functions to select the search string and
2115 to do the search for particular file types - see @ref{Custom searches}.
2116 The key binding @kbd{C-c l} is only a suggestion - see @ref{Installation}.
2118 @kindex C-c C-l
2119 @cindex link completion
2120 @cindex completion, of links
2121 @cindex inserting links
2122 @item C-c C-l
2123 Insert a link.  This prompts for a link to be inserted into the buffer.
2124 You can just type a link, using text for an internal link, or one of the
2125 link type prefixes mentioned in the examples above.  All links stored
2126 during the current session are part of the history for this prompt, so
2127 you can access them with @key{up} and @key{down}, or with
2128 completion@footnote{After insertion of a stored link, the link will be
2129 removed from the list of stored links.  To keep it in the list later
2130 use, use a triple @kbd{C-u} prefix to @kbd{C-c C-l}, or configure the
2131 option @code{org-keep-stored-link-after-insertion}.}.  The link will be
2132 inserted into the buffer, along with a descriptive text.  If some text
2133 was selected when this command is called, the selected text becomes the
2134 default description.@* Note that you don't have to use this command to
2135 insert a link.  Links in Org-mode are plain text, and you can type or
2136 paste them straight into the buffer.  By using this command, the links
2137 are automatically enclosed in double brackets, and you will be asked for
2138 the optional descriptive text.
2140 @c  If the link is a @samp{file:} link and
2141 @c the linked file is located in the same directory as the current file or
2142 @c a subdirectory of it, the path of the file will be inserted relative to
2143 @c the current directory.
2145 @kindex C-u C-c C-l
2146 @cindex file name completion
2147 @cindex completion, of file names
2148 @item C-u C-c C-l
2149 When @kbd{C-c C-l} is called with a @kbd{C-u} prefix argument, a link to
2150 a file will be inserted and you may use file name completion to select
2151 the name of the file.  The path to the file is inserted relative to the
2152 directory of the current org file, if the linked file is in the current
2153 directory or in a subdirectory of it, or if the path is written relative
2154 to the current directory using @samp{../}.  Otherwise an absolute path
2155 is used, if possible with @samp{~/} for your home directory.  You can
2156 force an absolute path with two @kbd{C-u} prefixes.
2158 @item C-c C-l @r{(with cursor on existing link)}
2159 When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit the
2160 link and description parts of the link.
2162 @cindex following links
2163 @kindex C-c C-o
2164 @item C-c C-o
2165 Open link at point.  This will launch a web browser for URLs (using
2166 @command{browse-url-at-point}), run vm/mh-e/wanderlust/rmail/gnus/bbdb
2167 for the corresponding links, and execute the command in a shell link.
2168 When the cursor is on an internal link, this commands runs the
2169 corresponding search.  When the cursor is on a TAG list in a headline,
2170 it creates the corresponding TAGS view.  If the cursor is on a time
2171 stamp, it compiles the agenda for that date.  Furthermore, it will visit
2172 text and remote files in @samp{file:} links with Emacs and select a
2173 suitable application for local non-text files.  Classification of files
2174 is based on file extension only.  See option @code{org-file-apps}.  If
2175 you want to override the default application and visit the file with
2176 Emacs, use a @kbd{C-u} prefix.
2178 @kindex mouse-2
2179 @kindex mouse-1
2180 @item mouse-2
2181 @itemx mouse-1
2182 On links, @kbd{mouse-2} will open the link just as @kbd{C-c C-o}
2183 would.  Under Emacs 22, also @kbd{mouse-1} will follow a link.
2185 @kindex mouse-3
2186 @item mouse-3
2187 Like @kbd{mouse-2}, but force file links to be opened with Emacs, and
2188 internal links to be displayed in another window@footnote{See the
2189 variable @code{org-display-internal-link-with-indirect-buffer}}.
2191 @cindex mark ring
2192 @kindex C-c %
2193 @item C-c %
2194 Push the current position onto the mark ring, to be able to return
2195 easily. Commands following an internal link do this automatically.
2197 @cindex links, returning to
2198 @kindex C-c &
2199 @item C-c &
2200 Jump back to a recorded position.  A position is recorded by the
2201 commands following internal links, and by @kbd{C-c %}.  Using this
2202 command several times in direct succession moves through a ring of
2203 previously recorded positions.
2205 @kindex C-c C-x C-n
2206 @kindex C-c C-x C-p
2207 @cindex links, finding next/previous
2208 @item C-c C-x C-n
2209 @itemx C-c C-x C-p
2210 Move forward/backward to the next link in the buffer.  At the limit of
2211 the buffer, the search fails once, and then wraps around.  The key
2212 bindings for this are really too long, you might want to bind this also
2213 to @kbd{C-n} and @kbd{C-p}
2214 @lisp
2215 (add-hook 'org-load-hook
2216   (lambda ()
2217     (define-key 'org-mode-map "\C-n" 'org-next-link)
2218     (define-key 'org-mode-map "\C-p" 'org-previous-link)))
2219 @end lisp
2220 @end table
2222 @node Link abbreviations, Search options, Handling links, Hyperlinks
2223 @section Link abbreviations
2224 @cindex link abbreviations
2225 @cindex abbreviation, links
2227 Long URLs can be cumbersome to type, and often many similar links are
2228 needed in a document.  For this you can use link abbreviations.  An
2229 abbreviated link looks like this
2231 @example
2232 [[linkword:tag][description]]
2233 @end example
2235 @noindent
2236 where the tag is optional.  Such abbreviations are resolved according to
2237 the information in the variable @code{org-link-abbrev-alist} that
2238 relates the linkwords to replacement text.  Here is an example:
2240 @lisp
2241 @group
2242 (setq org-link-abbrev-alist
2243   '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
2244     ("google"   . "http://www.google.com/search?q=")
2245     ("ads"      . "http://adsabs.harvard.edu/cgi-bin/
2246                    nph-abs_connect?author=%s&db_key=AST")))
2247 @end group
2248 @end lisp
2250 If the replacement text contains the string @samp{%s}, it will be
2251 replaced with the tag.  Otherwise the tag will be appended to the string
2252 in order to create the link.  You may also specify a function that will
2253 be called with the tag as the only argument to create the link.
2255 With the above setting, you could link to a specific bug with
2256 @code{[[bugzilla:129]]}, search the web for @samp{OrgMode} with
2257 @code{[[google:OrgMode]]} and find out what the Org-mode author is
2258 doing besides Emacs hacking with @code{[[ads:Dominik,C]]}.
2260 If you need special abbreviations just for a single Org-mode buffer, you
2261 can define them in the file with
2263 @example
2264 #+LINK: bugzilla  http://10.1.2.9/bugzilla/show_bug.cgi?id=
2265 #+LINK: google    http://www.google.com/search?q=%s
2266 @end example
2268 @noindent
2269 In-buffer completion @pxref{Completion} can be used after @samp{[} to
2270 complete link abbreviations.
2272 @node Search options, Custom searches, Link abbreviations, Hyperlinks
2273 @section Search options in file links
2274 @cindex search option in file links
2275 @cindex file links, searching
2277 File links can contain additional information to make Emacs jump to a
2278 particular location in the file when following a link.  This can be a
2279 line number or a search option after a double@footnote{For backward
2280 compatibility, line numbers can also follow a single colon.} colon. For
2281 example, when the command @kbd{C-c l} creates a link (@pxref{Handling
2282 links}) to a file, it encodes the words in the current line as a search
2283 string that can be used to find this line back later when following the
2284 link with @kbd{C-c C-o}. 
2286 Here is the syntax of the different ways to attach a search to a file
2287 link, together with an explanation:
2289 @example
2290 [[file:~/code/main.c::255]]
2291 [[file:~/xx.org::My Target]]
2292 [[file:~/xx.org::*My Target]]
2293 [[file:~/xx.org::/regexp/]]
2294 @end example
2296 @table @code
2297 @item 255
2298 Jump to line 255.
2299 @item My Target
2300 Search for a link target @samp{<<My Target>>}, or do a text search for
2301 @samp{my target}, similar to the search in internal links, see
2302 @ref{Internal links}.  In HTML export (@pxref{HTML export}), such a file
2303 link will become an HTML reference to the corresponding named anchor in
2304 the linked file.
2305 @item *My Target
2306 In an Org-mode file, restrict search to headlines.
2307 @item /regexp/
2308 Do a regular expression search for @code{regexp}.  This uses the Emacs
2309 command @code{occur} to list all matches in a separate window.  If the
2310 target file is in Org-mode, @code{org-occur} is used to create a
2311 sparse tree with the matches.
2312 @c If the target file is a directory,
2313 @c @code{grep} will be used to search all files in the directory.
2314 @end table
2316 As a degenerate case, a file link with an empty file name can be used
2317 to search the current file.  For example, @code{[[file:::find me]]} does
2318 a search for @samp{find me} in the current file, just as
2319 @samp{[[find me]]} would.
2321 @node Custom searches, Remember, Search options, Hyperlinks
2322 @section Custom Searches
2323 @cindex custom search strings
2324 @cindex search strings, custom
2326 The default mechanism for creating search strings and for doing the
2327 actual search related to a file link may not work correctly in all
2328 cases.  For example, BibTeX database files have many entries like
2329 @samp{year="1993"} which would not result in good search strings,
2330 because the only unique identification for a BibTeX entry is the
2331 citation key.
2333 If you come across such a problem, you can write custom functions to set
2334 the right search string for a particular file type, and to do the search
2335 for the string in the file.  Using @code{add-hook}, these functions need
2336 to be added to the hook variables
2337 @code{org-create-file-search-functions} and
2338 @code{org-execute-file-search-functions}.  See the docstring for these
2339 variables for more information.  Org-mode actually uses this mechanism
2340 for Bib@TeX{} database files, and you can use the corresponding code as
2341 an implementation example.  Search for @samp{BibTeX links} in the source
2342 file.
2345 @node Remember,  , Custom searches, Hyperlinks
2346 @section Remember
2347 @cindex @file{remember.el}
2349 Another way to create org entries with links to other files is through
2350 the @i{remember} package by John Wiegley.  @i{Remember} lets you store
2351 quick notes with little interruption of your work flow.  See
2352 @uref{http://www.emacswiki.org/cgi-bin/wiki/RememberMode} for more
2353 information.  The notes produced by @i{Remember} can be stored in
2354 different ways, and Org-mode files are a good target.  Org-mode
2355 significantly expands the possibilities of @i{remember}: You may define
2356 templates for different note types, and to associate target files and
2357 headlines with specific templates.  It also allows you to select the
2358 location where a note should be stored interactively, on the fly.
2360 @menu
2361 * Setting up remember::         Some code for .emacs to get things going
2362 * Remember templates::          Define the outline of different note types
2363 * Storing notes::               Directly get the note to where it belongs
2364 @end menu
2366 @node Setting up remember, Remember templates, Remember, Remember
2367 @subsection Setting up remember
2369 The following customization will tell @i{remember} to use org files as
2370 target, and to create annotations compatible with Org-mode links.
2372 @example
2373 (setq org-directory "~/path/to/my/orgfiles/")
2374 (setq org-default-notes-file "~/.notes")
2375 (setq remember-annotation-functions '(org-remember-annotation))
2376 (setq remember-handler-functions '(org-remember-handler))
2377 (add-hook 'remember-mode-hook 'org-remember-apply-template)
2378 @end example
2380 @node Remember templates, Storing notes, Setting up remember, Remember
2381 @subsection Remember templates
2382 @cindex templates, for remember
2384 In combination with Org-mode, you can use templates to generate
2385 different types of @i{remember} notes.  For example, if you would like
2386 to use one template to create general TODO entries, another one for
2387 journal entries, and a third one for collecting random ideas, you could
2388 use:
2390 @example
2391 (setq org-remember-templates
2392  '((?t "* TODO %?\n  %i\n  %a" "~/org/TODO.org")
2393    (?j "* %U %?\n\n  %i\n  %a" "~/org/JOURNAL.org")
2394    (?i "* %^@{Title@}\n  %i\n  %a" "~/org/JOURNAL.org" "New Ideas")))
2395 @end example
2397 @noindent In these entries, the character specifies how to select the
2398 template.  The first string specifies the template.  Two more (optional)
2399 strings give the file in which, and the headline under which the new
2400 note should be stored.  The file defaults to
2401 @code{org-default-notes-file}, the heading to
2402 @code{org-remember-default-headline}.  Both defaults help to get to the
2403 storing location quickly, but you can change the location interactively
2404 while storing the note.
2406 When you call @kbd{M-x remember} (or @kbd{M-x org-remember}) to remember
2407 something, org will prompt for a key to select the template (if you have
2408 more than one template) and then prepare the buffer like
2409 @example
2410 * TODO
2411   [[file:link to where you called remember]]
2412 @end example
2414 @noindent or
2416 @example
2417 * [2006-03-21 Tue 15:37]
2419   [[file:link to where you called remember]]
2420 @end example
2422 @noindent
2423 During expansion of the template, special @kbd{%}-escapes allow dynamic
2424 insertion of content:
2425 @example
2426 %^@{prompt@}  @r{prompt the user for a string and replace this sequence with it.}
2427 %t          @r{time stamp, date only}
2428 %T          @r{time stamp with date and time}
2429 %u, %U      @r{like the above, but inactive time stamps}
2430 %^t         @r{like @code{%t}, but prompt for date.  Similarly @code{%^T}, @code{%^u}, @code{%^U}}
2431             @r{You may define a prompt like @code{%^@{Birthday@}t}}
2432 %n          @r{user name (taken from @code{user-full-name})}
2433 %a          @r{annotation, normally the link created with @code{org-store-link}}
2434 %i          @r{initial content, the region when remember is called with C-u.}
2435             @r{The entire text will be indented like @code{%i} itself.}
2436 %:keyword   @r{specific information for certain link types, see below}
2437 @end example
2439 @noindent
2440 For specific link types, the following keywords will be defined:
2442 @example
2443 Link type          |  Available keywords
2444 -------------------+----------------------------------------------
2445 bbdb               |  %:name %:company
2446 vm, wl, mh, rmail  |  %:type %:subject %:message-id
2447                    |  %:from %:fromname %:fromaddress
2448                    |  %:to   %:toname   %:toaddress
2449                    |  %: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}.}}       
2450 gnus               |  %:group, @r{for messages also all email fields}
2451 w3, w3m            |  %:url
2452 info               |  %:file %:node
2453 calendar           |  %:date"
2454 @end example
2456 @noindent
2457 If you would like to have the cursor in a specific position after the
2458 template has been expanded:
2460 @example
2461 %?          @r{After completing the template, position cursor here.}
2462 @end example
2464 @noindent
2465 If you change you mind about which template to use, call
2466 @code{org-remember} in the remember buffer.  You may then select a new
2467 template that will be filled with the previous context information.
2469 @node Storing notes,  , Remember templates, Remember
2470 @subsection Storing notes
2472 When you are finished preparing a note with @i{remember}, you have to press
2473 @kbd{C-c C-c} to file the note away.  The handler first prompts for a
2474 target file - if you press @key{RET}, the value specified for the
2475 template is used.  Then the command offers the headings tree of the
2476 selected file, with the cursor position at the default headline (if you
2477 had specified one in the template).  You can either immediately press
2478 @key{RET} to get the note placed there.  Or you can use vertical cursor
2479 motion (@key{up} and @key{down}) and visibility cycling (@key{TAB}) to
2480 find a better place.  Pressing @key{RET} or @key{left} or @key{right}
2481 then leads to the following result.
2483 @multitable @columnfractions 0.2 0.1 0.7
2484 @item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted}
2485 @item buffer-start @tab @key{RET} @tab as level 2 heading at end of file
2486 @item on headline @tab @key{RET} @tab as sublevel of the heading at cursor
2487 @item             @tab @key{left}  @tab as same level, before current heading
2488 @item             @tab @key{right} @tab as same level, after current heading
2489 @item not on headline @tab @key{RET}
2490       @tab at cursor position, level taken from context.
2491            Or use prefix arg to specify level manually.
2492 @end multitable
2494 So a fast way to store the note to its default location is to press
2495 @kbd{C-c C-c @key{RET} @key{RET}}.  Even shorter would be @kbd{C-u C-c
2496 C-c}, which does the same without even asking for a file or showing the
2497 tree.
2499 Before inserting the text into a tree, the function ensures that the
2500 text has a headline, i.e. a first line that starts with a @samp{*}.
2501 If not, a headline is constructed from the current date and some
2502 additional data.  If the variable @code{org-adapt-indentation} is
2503 non-nil, the entire text is also indented so that it starts in the
2504 same column as the headline (after the asterisks).
2507 @node TODO items, Timestamps, Hyperlinks, Top
2508 @chapter TODO items
2509 @cindex TODO items
2511 Org-mode does not maintain TODO lists as a separate document.  TODO
2512 items are an integral part of the notes file, because TODO items
2513 usually come up while taking notes!  With Org-mode, you simply mark
2514 any entry in a tree as being a TODO item.  In this way, the
2515 information is not duplicated, and the entire context from which the
2516 item emerged is always present when you check.
2518 Of course, this technique causes TODO items to be scattered throughout
2519 your file.  Org-mode provides methods to give you an overview over all
2520 things you have to do.
2522 @menu
2523 * TODO basics::                 Marking and displaying TODO entries
2524 * TODO extensions::             Workflow and assignments
2525 * Priorities::                  Some things are more important than others
2526 * Breaking down tasks::         Splitting a task into manageable pieces
2527 * Checkboxes::                  Tick-off lists
2528 @end menu
2530 @node TODO basics, TODO extensions, TODO items, TODO items
2531 @section Basic TODO functionality
2533 Any headline can become a TODO item by starting it with the word TODO,
2534 for example:
2536 @example
2537 *** TODO Write letter to Sam Fortune
2538 @end example
2540 @noindent
2541 The most important commands to work with TODO entries are:
2543 @table @kbd
2544 @kindex C-c C-t
2545 @cindex cycling, of TODO states
2546 @item C-c C-t
2547 Rotate the TODO state of the current item between
2549 @example
2550 ,-> (unmarked) -> TODO -> DONE --.
2551 '--------------------------------'
2552 @end example
2554 The same rotation can also be done ``remotely'' from the timeline and
2555 agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
2556 @kindex S-@key{right}
2557 @kindex S-@key{left}
2558 @item S-@key{right}
2559 @itemx S-@key{left}
2560 Select the following/preceding TODO state, similar to cycling.  Mostly
2561 useful if more than two TODO states are possible (@pxref{TODO extensions}).
2562 @kindex C-c C-v
2563 @cindex sparse tree, for TODO
2564 @item C-c C-v
2565 View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}).  Folds
2566 the entire buffer, but shows all TODO items and the headings hierarchy
2567 above them.  With prefix arg, show also the DONE entries.  With
2568 numerical prefix N, show the tree for the Nth keyword in the variable
2569 @code{org-todo-keywords}.
2570 @kindex C-c a t
2571 @item C-c a t
2572 Show the global TODO list.  This collects the TODO items from all
2573 agenda files (@pxref{Agenda views}) into a single buffer.  The buffer is in
2574 @code{agenda-mode}, so there are commands to examine and manipulate
2575 the TODO entries directly from that buffer (@pxref{Agenda commands}).
2576 @xref{Global TODO list}, for more information.
2577 @c @item @code{org-agenda-include-all-todo}
2578 @c If you would like to have all your TODO items listed as part of your
2579 @c agenda, customize the variable @code{org-agenda-include-all-todo}.
2580 @end table
2582 @node TODO extensions, Priorities, TODO basics, TODO items
2583 @section Extended use of TODO keywords
2584 @cindex extended TODO keywords
2586 The default implementation of TODO entries is just two states: TODO and
2587 DONE.  You can, however, use the TODO feature for more complicated
2588 things by configuring the variables @code{org-todo-keywords} and
2589 @code{org-todo-interpretation}.  Using special setup, you can even use
2590 TODO keywords in different ways in different org files.
2592 Note that @i{tags} are another way to classify headlines in general and
2593 TODO items in particular (@pxref{Tags}).
2595 @menu
2596 * Workflow states::             From TODO to DONE in steps
2597 * TODO types::                  I do this, Fred the rest
2598 * Per file keywords::           Different files, different requirements
2599 * Multiple sets in one file::   Mixing it all, and still finding your way
2600 @end menu
2602 @node Workflow states, TODO types, TODO extensions, TODO extensions
2603 @subsection TODO keywords as workflow states
2604 @cindex TODO workflow
2605 @cindex workflow states as TODO keywords
2607 You can use TODO keywords to indicate different states in the process
2608 of working on an item, for example:
2610 @lisp
2611 (setq org-todo-keywords '("TODO" "FEEDBACK" "VERIFY" "DONE")
2612       org-todo-interpretation 'sequence)
2613 @end lisp
2615 @cindex completion, of TODO keywords
2616 Changing these variables only becomes effective in a new Emacs session.
2617 With this setup, the command @kbd{C-c C-t} will cycle an entry from
2618 TODO to FEEDBACK, then to VERIFY, and finally to DONE.  You may also
2619 use a prefix argument to quickly select a specific state.  For example
2620 @kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
2621 If you define many keywords, you can use in-buffer completion (see
2622 @ref{Completion}) to insert these words into the buffer.  Changing a todo
2623 state can be logged with a timestamp, see @ref{Tracking TODO state
2624 changes} for more information.
2626 @node TODO types, Per file keywords, Workflow states, TODO extensions
2627 @subsection TODO keywords as types
2628 @cindex TODO types
2629 @cindex names as TODO keywords
2630 @cindex types as TODO keywords
2632 The second possibility is to use TODO keywords to indicate different
2633 types of action items.  For example, you might want to indicate that
2634 items are for ``work'' or ``home''.  If you are into David Allen's
2635 @emph{Getting Things DONE}, you might want to use todo types
2636 @samp{NEXTACTION}, @samp{WAITING}, @samp{MAYBE}.  Or, when you work
2637 with several people on a single project, you might want to assign
2638 action items directly to persons, by using their names as TODO
2639 keywords.  This would be set up like this:
2641 @lisp
2642 (setq org-todo-keywords '("Fred" "Sara" "Lucy" "Mike" "DONE")
2643       org-todo-interpretation 'type)
2644 @end lisp
2646 In this case, different keywords do not indicate a sequence, but
2647 rather different types.  So it is normally not useful to change from
2648 one type to another.  Therefore, in this case the behavior of the
2649 command @kbd{C-c C-t} is changed slightly@footnote{This is also true
2650 for the @kbd{t} command in the timeline and agenda buffers.}.  When
2651 used several times in succession, it will still cycle through all
2652 names.  But when you return to the item after some time and execute
2653 @kbd{C-c C-t} again, it will switch from each name directly to DONE.
2654 Use prefix arguments or completion to quickly select a specific name.
2655 You can also review the items of a specific TODO type in a sparse tree
2656 by using a numeric prefix to @kbd{C-c C-v}.  For example, to see all
2657 things Lucy has to do, you would use @kbd{C-3 C-c C-v}.  To collect
2658 Lucy's items from all agenda files into a single buffer, you
2659 would use the prefix arg as well when creating the global todo list:
2660 @kbd{C-3 C-c t}.
2662 @node Per file keywords, Multiple sets in one file, TODO types, TODO extensions
2663 @subsection Setting up TODO keywords for individual files
2664 @cindex keyword options
2665 @cindex per file keywords
2667 It can be very useful to use different aspects of the TODO mechanism
2668 in different files, which is not possible with the global settings
2669 described above.  For file-local settings, you need to add special
2670 lines to the file which set the keywords and interpretation for that
2671 file only.  For example, to set one of the two examples discussed
2672 above, you need one of the following lines, starting in column zero
2673 anywhere in the file:
2675 @example
2676 #+SEQ_TODO: TODO FEEDBACK VERIFY DONE
2677 #+TYP_TODO: Fred Sara Lucy Mike DONE
2678 @end example
2680 @cindex completion, of option keywords
2681 @kindex M-@key{TAB}
2682 @noindent To make sure you are using the correct keyword, type
2683 @samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
2685 @cindex DONE, final TODO keyword
2686 Remember that the last keyword must always mean that the item is DONE
2687 (although you may use a different word).  After changing one of these
2688 lines, use @kbd{C-c C-c} with the cursor still in the line to make the
2689 changes known to Org-mode@footnote{Org-mode parses these lines only when
2690 Org-mode is activated after visiting a file.  @kbd{C-c C-c} with the
2691 cursor in a line starting with @samp{#+} is simply restarting Org-mode
2692 for the current buffer.}.
2694 @node Multiple sets in one file,  , Per file keywords, TODO extensions
2695 @subsection Multiple TODO keyword sets in one file
2696 @cindex todo keyword sets
2698 Sometimes you may want to use different sets of TODO keywords in the
2699 same file.  For example, you may want to have the basic
2700 @code{TODO}/@code{DONE}, but also a workflow for bug fixing.  Your setup
2701 would then look like this:
2703 @example
2704 #+SEQ_TODO: TODO DONE
2705 #+SEQ_TODO: REPORT BUG KNOWNCAUSE RESOLVED
2706 @end example
2708 The keywords should all be different, this helps Org-mode to keep track
2709 of which subsequence should be used for a given entry.  In this setup,
2710 @kbd{C-c C-t} only operates within a subsequence, so it switches from
2711 @code{DONE} to (nothing) to @code{TODO}, and from @code{RESOLVED} to
2712 (nothing) to @code{REPORT}.  Therefore you need a mechanism to initially
2713 select the correct sequence.  Besides the obvious ways like typing a
2714 keyword or using completion, you may also apply the following commands:
2716 @table @kbd
2717 @kindex S-@key{right}
2718 @kindex S-@key{left}
2719 @item S-@key{right}
2720 @itemx S-@key{left}
2721 @kbd{S-@key{<left>}} and @kbd{S-@key{<right>}} and walk through all
2722 keywords from all sets, so for example @kbd{S-@key{<right>}} would
2723 switch from @code{DONE} to @code{REPORT} in the example above. 
2724 @kindex C-S-@key{right}
2725 @kindex C-S-@key{left}
2726 @item C-S-@key{right}
2727 @itemx C-S-@key{left}
2728 These key jump from one TODO subset to the next.  So
2729 @kbd{C-S-@key{right}} would jump from @code{TODO} to @code{REPORT} and
2730 from @code{KNOWNCAUSE} to @code{TODO} in the above example.
2731 @end table
2733 @node Priorities, Breaking down tasks, TODO extensions, TODO items
2734 @section Priorities
2735 @cindex priorities
2737 If you use Org-mode extensively to organize your work, you may end up
2738 with a number of TODO entries so large that you'd like to prioritize
2739 them.  This can be done by placing a @emph{priority cookie} into the
2740 headline, like this
2742 @example
2743 *** TODO [#A] Write letter to Sam Fortune
2744 @end example
2746 @noindent
2747 With its standard setup, Org-mode supports priorities @samp{A},
2748 @samp{B}, and @samp{C}.  @samp{A} is the highest priority.  An entry
2749 without a cookie is treated as priority @samp{B}.  Priorities make a
2750 difference only in the agenda (@pxref{Weekly/Daily agenda}).
2752 @table @kbd
2753 @kindex @kbd{C-c ,}
2754 @item @kbd{C-c ,}
2755 Set the priority of the current headline.  The command prompts for a
2756 priority character @samp{A}, @samp{B} or @samp{C}.  When you press
2757 @key{SPC} instead, the priority cookie is removed from the headline.
2758 The priorities can also be changed ``remotely'' from the timeline and
2759 agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
2761 @kindex S-@key{up}
2762 @kindex S-@key{down}
2763 @item S-@key{up}
2764 @itemx S-@key{down}
2765 Increase/decrease priority of current headline.  Note that these keys
2766 are also used to modify time stamps (@pxref{Creating timestamps}).
2767 Furthermore, these keys are also used by CUA-mode (@pxref{Conflicts}).
2768 @end table
2770 @node Breaking down tasks, Checkboxes, Priorities, TODO items
2771 @section Breaking tasks down into subtasks
2772 @cindex tasks, breaking down
2774 It is often advisable to break down large tasks into smaller, manageable
2775 subtasks.  You can do this by creating an outline tree below a TODO
2776 item, with detailed subtasks on the tree@footnote{To keep subtasks out
2777 of the global TODO list, see the
2778 @code{org-agenda-todo-list-sublevels}.}.  Another possibility is the use
2779 of checkboxes to identify (a hierarchy of) a large number of subtasks
2780 (@pxref{Checkboxes}).
2783 @node Checkboxes,  , Breaking down tasks, TODO items
2784 @section Checkboxes
2785 @cindex checkboxes
2787 Every item in a plain list (@pxref{Plain lists}) can be made a checkbox
2788 by starting it with the string @samp{[ ]}.  This feature is similar to
2789 TODO items (@pxref{TODO items}), but more lightweight.  Checkboxes are
2790 not included into the global TODO list, so they are often great to split
2791 a task into a number of simple steps.  Or you can use them in a shopping
2792 list.  To toggle a checkbox, use @kbd{C-c C-c}, or try Piotr Zielinski's
2793 @file{org-mouse.el}.  Here is an example of a checkbox list.
2795 @example
2796 * TODO Organize party [3/6]
2797   - call people [1/3]
2798     - [ ] Peter
2799     - [X] Sarah
2800     - [ ] Sam
2801   - [X] order food
2802   - [ ] think about what music to play
2803   - [X] talk to the neighbors
2804 @end example
2806 @cindex statistics, for checkboxes
2807 @cindex checkbox statistics
2808 The @samp{[3/6]} and @samp{[1/3]} in the first and second line are
2809 cookies indicating how many checkboxes are present in this entry, and
2810 how many of them have been checked off.  This can give you an idea on
2811 how many checkboxes remain, even without opening a folded entry.  The
2812 cookies can be placed into a headline or into (the first line of) a
2813 plain list item. Each cookie covers all checkboxes structurally below
2814 that headline/item.  You have to insert the cookie yourself by typing
2815 either @samp{[/]} or @samp{[%]}.  In the first case you get an @samp{n
2816 out of m} result, in the second case you get information about the
2817 percentage of checkboxes checked (in the above example, this would be
2818 @samp{[50%]} and @samp{[33%], respectively}).
2820 @noindent The following commands work with checkboxes:
2822 @table @kbd
2823 @kindex C-c C-c
2824 @item C-c C-c
2825 Toggle checkbox at point.
2826 @kindex C-c C-x C-b
2827 @item C-c C-x C-b
2828 Toggle checkbox at point.
2829 @itemize @minus
2830 @item
2831 If there is an active region, toggle the first checkbox in the region
2832 and set all remaining boxes to the same status as the first.  If you
2833 want to toggle all boxes in the region independently, use a prefix
2834 argument.
2835 @item
2836 If the cursor is in a headline, toggle checkboxes in the region between
2837 this headline and the next (so @emph{not} the entire subtree).
2838 @item
2839 If there is no active region, just toggle the checkbox at point.
2840 @end itemize
2841 @kindex M-S-@key{RET}
2842 @item M-S-@key{RET}
2843 Insert a new item with a checkbox.
2844 This works only if the cursor is already in a plain list item
2845 (@pxref{Plain lists}).
2846 @kindex C-c #
2847 @item C-c #
2848 Update the checkbox statistics in the current outline entry.  When
2849 called with a @kbd{C-u} prefix, update the entire file.  Checkbox
2850 statistic cookies are updated automatically if you toggle checkboxes
2851 with @kbd{C-c C-c} and make new ones with @kbd{M-S-@key{RET}}.  If you
2852 delete boxes or add/change them by hand, use this command to get things
2853 back into synch.  Or simply toggle any checkbox twice with @kbd{C-c C-c}.
2854 @end table
2856 @node Timestamps, Tags, TODO items, Top
2857 @chapter Timestamps
2858 @cindex time stamps
2859 @cindex date stamps
2861 Items can be labeled with timestamps to make them useful for project
2862 planning.
2864 @menu
2865 * Time stamps::                 Assigning a time to a tree entry
2866 * Creating timestamps::         Commands which insert timestamps
2867 * Custom time format::          If you cannot work with the ISO format
2868 * Repeating items::             Deadlines that come back again and again
2869 * Progress logging::            Documenting when what work was done.
2870 @end menu
2873 @node Time stamps, Creating timestamps, Timestamps, Timestamps
2874 @section Time stamps, deadlines and scheduling
2875 @cindex time stamps
2876 @cindex ranges, time
2877 @cindex date stamps
2878 @cindex deadlines
2879 @cindex scheduling
2881 A time stamp is a specification of a date (possibly with time) in a
2882 special format, either @samp{<2003-09-16 Tue>} or @samp{<2003-09-16 Tue
2883 09:39>}@footnote{This is the standard ISO date/time format.  If you
2884 cannot get used to these, see @ref{Custom time format}}.  A time stamp
2885 can appear anywhere in the headline or body of an org-tree entry.  Its
2886 presence allows entries to be shown on specific dates in the agenda
2887 (@pxref{Weekly/Daily agenda}).  We distinguish:
2889 @table @var
2890 @item Plain time stamp
2891 @cindex timestamp
2892 A simple time stamp just assigns a date/time to an item.  This is just
2893 like writing down an appointment in a paper agenda, or like writing down
2894 an event in a diary, when you want to take note of when something
2895 happened.  In the timeline and agenda displays, the headline of an entry
2896 associated with a plain time stamp will be shown exactly on that date.
2898 @example
2899 * Meet Peter at the movies <2006-11-01 Wed 19:15>
2900 @end example
2902 @item Inactive time stamp
2903 @cindex timestamp, inactive
2904 @cindex inactive timestamp
2905 Just like a plain time stamp, but with square brackets instead of
2906 angular ones.  These time stamps are inactive in the sense that they do
2907 @emph{not} trigger an entry to show up in the agenda.
2909 @example
2910 * Gillian comes late for the fifth time [2006-11-01 Wed]
2911 @end example
2913 @item Time stamp range
2914 @cindex timerange
2915 Two time stamps connected by @samp{--} denote a time range.  The
2916 headline will be shown on the first and last day of the range, and on
2917 any dates that are displayed and fall in the range.  Here is an
2918 example:
2920 @example
2921 ** Meeting in Amsterdam
2922    <2004-08-23 Mon>--<2004-08-26 Thu>
2923 @end example
2925 @item Time stamp with SCHEDULED keyword
2926 @cindex SCHEDULED keyword
2927 If a time stamp is preceded by the word @samp{SCHEDULED:}, it means you
2928 are planning to start working on that task on the given date. So this is
2929 not about recording an event, but about planning your work.  The
2930 headline will be listed under the given date@footnote{It will still be
2931 listed on that date after it has been marked DONE.  If you don't like
2932 this, set the variable @code{org-agenda-skip-scheduled-if-done}.}.  In
2933 addition, a reminder that the scheduled date has passed will be present
2934 in the compilation for @emph{today}, until the entry is marked DONE.
2935 I.e., the task will automatically be forwarded until completed.
2937 @example
2938 *** TODO Call Trillian for a date on New Years Eve.
2939     SCHEDULED: <2004-12-25 Sat>
2940 @end example
2942 @item Time stamp with DEADLINE keyword
2943 @cindex DEADLINE keyword
2944 If a time stamp is preceded by the word @samp{DEADLINE:}, the task
2945 (most likely a TODO item) is supposed to be finished on that date, and
2946 it will be listed then.  In addition, the compilation for @emph{today}
2947 will carry a warning about the approaching or missed deadline,
2948 starting @code{org-deadline-warning-days} before the due date, and
2949 continuing until the entry is marked DONE.  An example:
2951 @example
2952 *** TODO write article about the Earth for the Guide
2953     The editor in charge is [[bbdb:Ford Prefect]]
2954     DEADLINE: <2004-02-29 Sun>
2955 @end example
2956 @item Time stamp with CLOSED keyword
2957 @cindex CLOSED keyword
2958 When @code{org-log-done} is non-nil, Org-mode will automatically insert
2959 a special time stamp each time a TODO entry is marked done
2960 (@pxref{Progress logging}).  This time stamp is enclosed in square
2961 brackets instead of angular brackets.
2963 @item Time range with CLOCK keyword
2964 @cindex CLOCK keyword
2965 When using the clock to time the work that is being done on specific
2966 items, time ranges preceded by the CLOCK keyword are inserted
2967 automatically into the file.  The time stamps are enclosed in square
2968 brackets instead of angular brackets.  @xref{Clocking work time}.
2969 @end table
2971 @node Creating timestamps, Custom time format, Time stamps, Timestamps
2972 @section Creating timestamps
2973 @cindex creating timestamps
2974 @cindex timestamps, creating
2976 For Org-mode to recognize time stamps, they need to be in the specific
2977 format.  All commands listed below produce time stamps in the correct
2978 format.
2980 @table @kbd
2981 @kindex C-c .
2982 @item C-c .
2983 Prompt for a date and insert a corresponding time stamp.  When the
2984 cursor is at a previously used time stamp, it is updated to NOW.  When
2985 this command is used twice in succession, a time range is inserted.
2987 @kindex C-u C-c .
2988 @item C-u C-c .
2989 Like @kbd{C-c .}, but use the alternative format which contains date
2990 and time.  The default time can be rounded to multiples of 5 minutes,
2991 see the option @code{org-time-stamp-rounding-minutes}.
2993 @kindex C-c !
2994 @item C-c !
2995 Like @kbd{C-c .}, but insert an inactive time stamp that will not cause
2996 an agenda entry.
2998 @kindex C-c <
2999 @item C-c <
3000 Insert a time stamp corresponding to the cursor date in the Calendar.
3002 @kindex C-c >
3003 @item C-c >
3004 Access the Emacs calendar for the current date.  If there is a
3005 timestamp in the current line, goto the corresponding date
3006 instead.
3008 @kindex C-c C-o
3009 @item C-c C-o
3010 Access the agenda for the date given by the time stamp or -range at
3011 point (@pxref{Weekly/Daily agenda}).
3013 @kindex C-c C-d
3014 @item C-c C-d
3015 Insert @samp{DEADLINE} keyword along with a stamp.  The insertion will
3016 happen in the line directly following the headline.  
3017 @c FIXME Any CLOSED timestamp will be removed.????????
3019 @kindex C-c C-w
3020 @cindex sparse tree, for deadlines
3021 @item C-c C-w
3022 Create a sparse tree with all deadlines that are either past-due, or
3023 which will become due within @code{org-deadline-warning-days}.
3024 With @kbd{C-u} prefix, show all deadlines in the file.  With a numeric
3025 prefix, check that many days.  For example, @kbd{C-1 C-c C-w} shows
3026 all deadlines due tomorrow.
3028 @kindex C-c C-s
3029 @item C-c C-s
3030 Insert @samp{SCHEDULED} keyword along with a stamp.  The insertion will
3031 happen in the line directly following the headline.  Any CLOSED
3032 timestamp will be removed.
3034 @kindex S-@key{left}
3035 @kindex S-@key{right}
3036 @item S-@key{left}
3037 @itemx S-@key{right}
3038 Change date at cursor by one day.  These key bindings conflict with
3039 CUA-mode (@pxref{Conflicts}).
3041 @kindex S-@key{up}
3042 @kindex S-@key{down}
3043 @item S-@key{up}
3044 @itemx S-@key{down}
3045 Change the item under the cursor in a timestamp.  The cursor can be on a
3046 year, month, day, hour or minute.  Note that if the cursor is in a
3047 headline and not at a time stamp, these same keys modify the priority of
3048 an item.  (@pxref{Priorities}). The key bindings also conflict with
3049 CUA-mode (@pxref{Conflicts}).
3051 @kindex C-c C-y
3052 @cindex evaluate time range
3053 @item C-c C-y
3054 Evaluate a time range by computing the difference between start and
3055 end.  With prefix arg, insert result after the time range (in a table:
3056 into the following column).
3057 @end table
3060 @menu
3061 * The date/time prompt::        How org-mode helps you entering date and time
3062 @end menu
3064 @node The date/time prompt,  , Creating timestamps, Creating timestamps
3065 @subsection The date/time prompt
3066 @cindex date, reading in minibuffer
3067 @cindex time, reading in minibuffer
3069 When Org-mode prompts for a date/time, the prompt suggests to enter an
3070 ISO date.  But it will in fact accept any string containing some date
3071 and/or time information.  You can, for example, use @kbd{C-y} to paste a
3072 (possibly multi-line) string copied from an email message.  Org-mode
3073 will find whatever information is in there and will replace anything not
3074 specified with the current date and time.  For example:
3076 @example
3077   3-2-5         --> 2003-02-05
3078   feb 15        --> currentyear-02-15
3079   sep 12 9      --> 2009-09-12
3080   12:45         --> today 12:45
3081   22 sept 0:34  --> currentyear-09-22 0:34
3082   12            --> currentyear-currentmonth-12
3083   Fri           --> nearest Friday (today or later)
3084   +4            --> 4 days from now (if +N is the only thing given)
3085 @end example
3087 The function understands English month and weekday abbreviations.  If
3088 you want to use unabbreviated names and/or other languages, configure
3089 the variables @code{parse-time-months} and @code{parse-time-weekdays}.
3091 @cindex calendar, for selecting date
3092 Parallel to the minibuffer prompt, a calendar is popped up@footnote{If
3093 you don't need/want the calendar, configure the variable
3094 @code{org-popup-calendar-for-date-prompt}.}.  When you exit the date
3095 prompt, either by clicking on a date in the calendar, or by pressing
3096 @key{RET}, the date selected in the calendar will be combined with the
3097 information entered at the prompt.  You can control the calendar fully
3098 from the minibuffer:
3100 @table @kbd
3101 @kindex <
3102 @item <
3103 Scroll calendar backwards by one month.
3104 @kindex >
3105 @item >
3106 Scroll calendar forwards by one month.
3107 @kindex mouse-1
3108 @item mouse-1
3109 Select date by clicking on it.
3110 @kindex S-@key{right}
3111 @item S-@key{right}
3112 One day forward.
3113 @kindex S-@key{left}
3114 @item S-@key{left}
3115 One day back.
3116 @kindex S-@key{down}
3117 @item S-@key{down}
3118 One week forward.
3119 @kindex S-@key{up}
3120 @item S-@key{up}
3121 One week back.
3122 @kindex M-S-@key{right}
3123 @item M-S-@key{right}
3124 One month forward.
3125 @kindex M-S-@key{left}
3126 @item M-S-@key{left}
3127 One month back.
3128 @kindex @key{RET}
3129 @item @key{RET}
3130 Choose date in calendar (only if nothing was typed into minibuffer).
3131 @end table
3133 @node Custom time format, Repeating items, Creating timestamps, Timestamps
3134 @section Custom time format
3135 @cindex custom date/time format
3136 @cindex time format, custom
3137 @cindex date format, custom
3139 Org-mode uses the standard ISO notation for dates and times as it is
3140 defined in ISO 8601.  If you cannot get used to this and require another
3141 representation of date and time to keep you happy, you can get it by
3142 customizing the variables @code{org-display-custom-times} and
3143 @code{org-time-stamp-custom-formats}.
3145 @table @kbd
3146 @kindex C-c C-x C-t
3147 @item C-c C-x C-t
3148 Toggle the display of custom formats for dates and times.
3149 @end table
3151 @noindent
3152 Org-mode needs the default format for scanning, so the custom date/time
3153 format does not @emph{replace} the default format - instead it is put
3154 @emph{over} the default format using text properties.  This has the
3155 following consequences:
3156 @itemize @bullet
3157 @item 
3158 You cannot place the cursor onto a time stamp anymore, only before or
3159 after.
3160 @item
3161 The @kbd{S-@key{up}/@key{down}} keys can no longer be used to adjust
3162 each component of a time stamp.  If the cursor is at the beginning of
3163 the stamp, @kbd{S-@key{up}/@key{down}} will change the stamp by one day,
3164 just like @kbd{S-@key{left}/@key{right}}.  At the end of the stamp, the
3165 time will be changed by one minute.
3166 @item
3167 When you delete a time stamp character-by-character, it will only
3168 disappear from the buffer after @emph{all} (invisible) characters
3169 belonging to the ISO timestamp have been removed.
3170 @item
3171 If the custom time stamp format is longer than the default and you are
3172 using dates in tables, table alignment will be messed up.  If the custom
3173 format is shorter, things do work as expected.
3174 @end itemize
3176 @node Repeating items, Progress logging, Custom time format, Timestamps
3177 @section Repeating items
3178 @cindex TODO items, repeating
3179 @cindex deadlines, repeating
3180 @cindex scheduling, repeating
3182 Org-mode integrates with the Emacs calendar and diary to display cyclic
3183 appointments, anniversaries and other special entries in the agenda
3184 (@pxref{Weekly/Daily agenda}).  However, it can be useful to have
3185 certain deadlines and scheduling items to auto-repeat.  The advantage of
3186 a deadline or scheduled item is that the they produce warnings ahead of
3187 time and automatically forward themselves in the agenda until they are
3188 done.  The abstract difference is therefore between cyclic
3189 @i{appointments} and cyclic @i{action items}.  For appointments you
3190 should use the diary, for actions you can uses an org-mode deadline or
3191 scheduling time stamp together with a REPEAT cookie.  For example:
3193 @example
3194 * TODO Replace batteries in smoke detector REPEAT(+18m)
3195   SCHEDULED: <2007-01-01 Mon>
3197 * TODO Get dentist appointment REPEAT(+6m)
3198   SCHEDULED: <2006-12-19 Tue>
3200 * TODO Tax report to IRS REPEAT(+1y)
3201   DEADLINE: <2007-04-01 Sun>
3202 @end example
3204 Each time you try to mark one of these entries DONE using @kbd{C-c C-t},
3205 they will automatically switch back to the state TODO, and the
3206 deadline/scheduling will be shifted accordingly.  The time units
3207 recognized by org-mode are year (y), month (m), week (w), and day (d).
3208 Org-mode will also prompt you for a note and record the fact that you
3209 have closed this item in a note under the headline.
3211 One unusual property of these repeating items is that only one instance
3212 of each exist at any given time.  So if you look back or ahead in the
3213 agenda, you will not find past and future instances, only the current
3214 one will show up.  Use a cyclic diary entry if you need all past and
3215 future instances to be visible in the agenda.
3217 @c FIXME: Document that a note is always being taken.
3219 @node Progress logging,  , Repeating items, Timestamps
3220 @section Progress Logging
3221 @cindex progress logging
3222 @cindex logging, of progress
3224 Org-mode can automatically record a time stamp when you mark a TODO item
3225 as DONE, or even each time when you change the state of a TODO item.
3226 You can also measure precisely the time you spent on specific items in a
3227 project by starting and stopping a clock when you start and stop working
3228 on an aspect of a project.
3230 @menu
3231 * Closing items::               When was this entry marked DONE?
3232 * Tracking TODO state changes::  When did the status change?
3233 * Clocking work time::          When exactly did you work on this item?
3234 @end menu
3236 @node Closing items, Tracking TODO state changes, Progress logging, Progress logging
3237 @subsection Closing items
3239 If you want to keep track of @emph{when} a certain TODO item was
3240 finished, turn on logging with@footnote{The corresponding in-buffer
3241 setting is: @code{#+STARTUP: logdone}}
3243 @lisp
3244 (setq org-log-done t)
3245 @end lisp
3247 @noindent
3248 Then each time you turn a TODO entry into DONE using either @kbd{C-c
3249 C-t} in the Org-mode buffer or @kbd{t} in the agenda buffer, a line
3250 @samp{CLOSED: [timestamp]} will be inserted just after the headline.  If
3251 you turn the entry back into a TODO item through further state cycling,
3252 that line will be removed again.  In the timeline (@pxref{Timeline}) and
3253 in the agenda (@pxref{Weekly/Daily agenda}), you can then use the
3254 @kbd{l} key to display the TODO items closed on each day, giving you an
3255 overview of what has been done on a day.  If you want to record a note
3256 along with the timestamp, use@footnote{The corresponding in-buffer
3257 setting is: @code{#+STARTUP: lognotedone}}
3259 @lisp
3260 (setq org-log-done '(done))
3261 @end lisp
3263 @node Tracking TODO state changes, Clocking work time, Closing items, Progress logging
3264 @subsection Tracking TODO state changes
3266 When TODO keywords are used as workflow states (@pxref{Workflow
3267 states}), you might want to keep track of when a state change occurred,
3268 and you may even want to attach notes to that state change.  With the
3269 setting
3271 @lisp
3272 (setq org-log-done '(state))
3273 @end lisp
3275 @noindent
3276 each state change will prompt you for a note that will be attached to
3277 the current headline.  Very likely you do not want this verbose tracking
3278 all the time, so it is probably better to configure this behavior with
3279 in-buffer options.  For example, if you are tracking purchases, put
3280 these into a separate file that starts with:
3282 @example
3283 #+SEQ_TODO: TODO ORDERED INVOICE PAYED RECEIVED SENT
3284 #+STARTUP: lognotestate
3285 @end example
3287 @node Clocking work time,  , Tracking TODO state changes, Progress logging
3288 @subsection Clocking work time
3290 Org-mode allows you to clock the time you spent on specific tasks in a
3291 project.  When you start working on an item, you can start the clock.
3292 When you stop working on that task, or when you mark the task done, the
3293 clock is stopped and the corresponding time interval is recorded.  It
3294 also computes the total time spent on each subtree of a project.
3296 @table @kbd
3297 @kindex C-c C-x C-i
3298 @item C-c C-x C-i
3299 Start the clock on the current item (clock-in).  This inserts the CLOCK
3300 keyword together with a timestamp.
3301 @kindex C-c C-x C-o
3302 @item C-c C-x C-o
3303 Stop the clock (clock-out).  The inserts another timestamp at the same
3304 location where the clock was last started.  It also directly computes
3305 the resulting time in inserts it after the time range as @samp{=>
3306 HH:MM}.  See the variable @code{org-log-done} for the possibility to
3307 record an additional note together with the clock-out time
3308 stamp@footnote{The corresponding in-buffer setting is: @code{#+STARTUP:
3309 lognoteclock-out}}.
3310 @kindex C-c C-y
3311 @item C-c C-y
3312 Recompute the time interval after changing one of the time stamps.  This
3313 is only necessary if you edit the time stamps directly.  If you change
3314 them with @kbd{S-@key{cursor}} keys, the update is automatic.
3315 @kindex C-c C-t
3316 @item C-c C-t
3317 Changing the TODO state of an item to DONE automatically stops the clock
3318 if it is running in this same item.
3319 @kindex C-c C-x C-x
3320 @item C-c C-x C-x
3321 Cancel the current clock.  This is useful if a clock was started by
3322 mistake, or if you ended up working on something else.
3323 @kindex C-c C-x C-d
3324 @item C-c C-x C-d
3325 Display time summaries for each subtree in the current buffer.  This
3326 puts overlays at the end of each headline, showing the total time
3327 recorded under that heading, including the time of any subheadings. You
3328 can use visibility cycling to study the tree, but the overlays disappear
3329 when you change the buffer (see variable
3330 @code{org-remove-highlights-with-change}) or press @kbd{C-c C-c}.
3331 @kindex C-c C-x C-r
3332 @item C-c C-x C-r
3333 Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock
3334 report as an org-mode table into the current file.
3335 @example
3336 #+BEGIN: clocktable :maxlevel 2 :emphasize nil
3338 #+END: clocktable
3339 @end example
3340 @noindent
3341 If such a block already exists, its content is replaced by the new
3342 table.  The @samp{BEGIN} line can specify options:
3343 @example
3344 :maxlevels   @r{Maximum level depth to which times are listed in the table.}
3345 :emphasize   @r{When @code{t}, emphasize level one and level two items}
3346 :block       @r{The time block to consider.  This block is specified relative}
3347              @r{to the current time and may be any of these keywords:}
3348              @r{@code{today}, @code{yesterday}, @code{thisweek}, @code{lastweek},}
3349              @r{@code{thismonth}, @code{lastmonth}, @code{thisyear}, or @code{lastyear}}.
3350 :tstart      @r{A time string specifying when to start considering times}
3351 :tend        @r{A time string specifying when to stop considering times}
3352 @end example
3353 So to get a clock summary for the current day, you could write
3354 @example
3355 #+BEGIN: clocktable :maxlevel 2 :block today
3357 #+END: clocktable
3358 @end example
3359 and to use a specific time range you could write@footnote{Note that all
3360 parameters must be specified in a single line - the line is broken here
3361 only to fit it onto the manual.}
3362 @example
3363 #+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>" 
3364                     :tend "<2006-08-10 Thu 12:00>"
3366 #+END: clocktable
3367 @end example
3368 @kindex C-u C-c C-x C-u
3369 @item C-u C-c C-x C-u
3370 Update all dynamic blocks (@pxref{Dynamic blocks}).  This is useful if
3371 you have several clocktable blocks in a buffer.
3372 @end table
3374 The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
3375 the agenda (@pxref{Weekly/Daily agenda}) to show which tasks have been
3376 worked on or closed during a day.
3378 @node Tags, Agenda views, Timestamps, Top
3379 @chapter Tags
3380 @cindex tags
3381 @cindex headline tagging
3382 @cindex matching, tags
3383 @cindex sparse tree, tag based
3385 If you wish to implement a system of labels and contexts for
3386 cross-correlating information, an excellent way is to assign @i{tags} to
3387 headlines.  Org-mode has extensive support for using tags.
3389 Every headline can contain a list of tags, at the end of the headline.
3390 Tags are normal words containing letters, numbers, @samp{_}, and
3391 @samp{@@}.  Tags must be preceded and followed by a single colon; like
3392 @samp{:WORK:}.  Several tags can be specified like @samp{:WORK:URGENT:}.
3394 @menu
3395 * Tag inheritance::             Tags use the tree structure of the outline
3396 * Setting tags::                How to assign tags to a headline
3397 * Tag searches::                Searching for combinations of tags
3398 @end menu
3400 @node Tag inheritance, Setting tags, Tags, Tags
3401 @section Tag inheritance
3402 @cindex inheritance, of tags
3403 @cindex sublevels, inclusion into tags match
3405 @i{Tags} make use of the hierarchical structure of outline trees.  If a
3406 heading has a certain tag, all subheadings will inherit the tag as
3407 well.  For example, in the list
3409 @example
3410 * Meeting with the French group      :WORK:
3411 ** Summary by Frank                  :BOSS:NOTES:
3412 *** TODO Prepare slides for him      :ACTION:
3413 @end example
3415 @noindent
3416 the final heading will have the tags @samp{:WORK:}, @samp{:BOSS:},
3417 @samp{:NOTES:}, and @samp{:ACTION:}.  When executing tag searches and
3418 Org-mode finds that a certain headline matches the search criterion, it
3419 will not check any sublevel headline, assuming that these likely also
3420 match, and that the list of matches can become very long.  This may
3421 not be what you want, however, and you can influence inheritance and
3422 searching using the variables @code{org-use-tag-inheritance} and
3423 @code{org-tags-match-list-sublevels}.
3425 @node Setting tags, Tag searches, Tag inheritance, Tags
3426 @section Setting tags
3427 @cindex setting tags
3428 @cindex tags, setting
3430 @kindex M-@key{TAB}
3431 Tags can simply be typed into the buffer at the end of a headline.
3432 After a colon, @kbd{M-@key{TAB}} offers completion on tags.  There is
3433 also a special command for inserting tags:
3435 @table @kbd
3436 @kindex C-c C-c
3437 @item C-c C-c
3438 @cindex completion, of tags
3439 Enter new tags for the current headline.  Org-mode will either offer
3440 completion or a special single-key interface for setting tags, see
3441 below.  After pressing @key{RET}, the tags will be inserted and aligned
3442 to @code{org-tags-column}.  When called with a @kbd{C-u} prefix, all
3443 tags in the current buffer will be aligned to that column, just to make
3444 things look nice.  TAGS are automatically realigned after promotion,
3445 demotion, and TODO state changes (@pxref{TODO basics}).
3446 @end table
3448 Org will support tag insertion based on a @emph{list of tags}.  By
3449 default this list is constructed dynamically, containing all tags
3450 currently used in the buffer.  You may also globally specify a hard list
3451 of tags with the variable @code{org-tag-alist}.  Finally you can set
3452 the default tags for a given file with lines like
3454 @example
3455 #+TAGS: @@WORK @@HOME @@TENNISCLUB
3456 #+TAGS: Laptop Car PC Sailboat
3457 @end example
3459 If you have globally defined your preferred set of tags using the
3460 variable @code{org-tag-alist}, but would like to use a dynamic tag list
3461 in a specific file: Just add an empty TAGS option line to that file:
3463 @example
3464 #+TAGS:
3465 @end example
3467 The default support method for entering tags is minibuffer completion.
3468 However, Org-mode also implements a much better method: @emph{fast tag
3469 selection}.  This method allows to select and deselect tags with a
3470 single key per tag.  To function efficiently, you should assign unique
3471 keys to most tags.  This can be done globally with
3473 @lisp
3474 (setq org-tag-alist '(("@@WORK" . ?w) ("@@HOME" . ?h) ("Laptop" . ?l)))
3475 @end lisp
3477 @noindent or on a per-file basis with
3479 @example
3480 #+TAGS: @@WORK(w)  @@HOME(h)  @@TENNISCLUB(t)  Laptop(l)  PC(p)
3481 @end example
3483 @noindent
3484 You can also group together tags that are mutually exclusive.  With
3485 curly braces@footnote{In @code{org-mode-alist} use
3486 @code{'(:startgroup)} and @code{'(:endgroup)}, respectively.  Several
3487 groups are allowed.}
3489 @example
3490 #+TAGS: @{ @@WORK(w)  @@HOME(h)  @@TENNISCLUB(t) @}  Laptop(l)  PC(p)
3491 @end example
3493 @noindent you indicate that at most one of @samp{@@WORK}, @samp{@@HOME},
3494 and @samp{@@TENNISCLUB} should be selected.
3496 @noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
3497 these lines to activate any changes.
3499 If at least one tag has a selection key, pressing @kbd{C-c C-c} will
3500 automatically present you with a special interface, listing inherited
3501 tags, the tags of the current headline, and a list of all legal tags
3502 with corresponding keys@footnote{Keys will automatically be assigned to
3503 tags which have no configured keys.}.  In this interface, you can use
3504 the following keys:
3506 @table @kbd
3507 @item a-z...
3508 Pressing keys assigned to tags will add or remove them from the list of
3509 tags in the current line.  Selecting a tag in a group of mutually
3510 exclusive tags will turn off any other tags from that group.
3511 @kindex @key{TAB}
3512 @item @key{TAB}
3513 Enter a tag in the minibuffer, even if the tag is not in the predefined
3514 list.  You will be able to complete on all tags present in the buffer.
3515 @kindex @key{SPC}
3516 @item @key{SPC}
3517 Clear all tags for this line.
3518 @kindex @key{RET}
3519 @item @key{RET}
3520 Accept the modified set.
3521 @item C-g
3522 Abort without installing changes.
3523 @item q
3524 If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}.
3525 @item !
3526 Turn off groups of mutually exclusive tags.  Use this to (as an
3527 exception) assign several tags from such a group.
3528 @item C-c
3529 Toggle auto-exit after the next change (see below).
3530 If you are using expert mode, the first @kbd{C-c} will display the
3531 selection window.
3532 @end table
3534 @noindent
3535 This method lets you assign tags to a headline with very few keys.  With
3536 the above setup, you could clear the current tags and set @samp{@@HOME},
3537 @samp{Laptop} and @samp{PC} tags with just the following keys: @kbd{C-c
3538 C-c @key{SPC} h l p @key{RET}}.  Switching from @samp{@@HOME} to
3539 @samp{@@WORK} would be done with @kbd{C-c C-c w @key{RET}} or
3540 alternatively with @kbd{C-c C-c C-c w}.  Adding the non-predefined tag
3541 @samp{Sarah} could be done with @kbd{C-c C-c @key{TAB} S a r a h
3542 @key{RET} @key{RET}}.
3544 If you find that most of the time, you need only a single keypress to
3545 modify your list of tags, set the variable
3546 @code{org-fast-tag-selection-single-key}.  Then you no longer have to
3547 press @key{RET} to exit fast tag selection - it will immediately exit
3548 after the first change.  If you then occasionally need more keys, press
3549 @kbd{C-c} to turn off auto-exit for the current tag selection process
3550 (in effect: start selection with @kbd{C-c C-c C-c} instead of @kbd{C-c
3551 C-c}).  If you set the variable to the value @code{expert}, the special
3552 window is not even shown for single-key tag selection, it comes up only
3553 when you press an extra @kbd{C-c}.
3555 @node Tag searches,  , Setting tags, Tags
3556 @section Tag searches
3557 @cindex tag searches
3558 @cindex searching for tags
3560 Once a tags system has been set up, it can be used to collect related
3561 information into special lists.
3563 @table @kbd
3564 @kindex C-c \
3565 @item C-c \
3566 Create a sparse tree with all headlines matching a tags search.  With a
3567 @kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
3568 @kindex C-c a m
3569 @item C-c a m
3570 Create a global list of tag matches from all agenda files.
3571 @xref{Matching headline tags}.
3572 @kindex C-c a M
3573 @item C-c a M
3574 Create a global list of tag matches from all agenda files, but check
3575 only TODO items and force checking subitems (see variable
3576 @code{org-tags-match-list-sublevels}).
3577 @end table
3579 @cindex Boolean logic, for tag searches
3580 A @i{tags} search string can use Boolean operators @samp{&} for AND and
3581 @samp{|} for OR.  @samp{&} binds more strongly than @samp{|}.
3582 Parenthesis are currently not implemented.  A tag may also be preceded
3583 by @samp{-}, to select against it, and @samp{+} is syntactic sugar for
3584 positive selection.  The AND operator @samp{&} is optional when @samp{+}
3585 or @samp{-} is present.  Examples:
3587 @table @samp
3588 @item +WORK-BOSS
3589 Select headlines tagged @samp{:WORK:}, but discard those also tagged
3590 @samp{:BOSS:}.
3591 @item WORK|LAPTOP
3592 Selects lines tagged @samp{:WORK:} or @samp{:LAPTOP:}.
3593 @item WORK|LAPTOP&NIGHT
3594 Like before, but require the @samp{:LAPTOP:} lines to be tagged also
3595 @samp{NIGHT}.
3596 @end table
3598 @cindex TODO keyword matching, with tags search
3599 If you are using multi-state TODO keywords (@pxref{TODO extensions}), it
3600 can be useful to also match on the TODO keyword.  This can be done by
3601 adding a condition after a slash to a tags match.  The syntax is similar
3602 to the tag matches, but should be applied with consideration: For
3603 example, a positive selection on several TODO keywords can not
3604 meaningfully be combined with boolean AND.  However, @emph{negative
3605 selection} combined with AND can be meaningful.  To make sure that only
3606 lines are checked that actually have any TODO keyword, use @kbd{C-c a
3607 M}, or equivalently start the todo part after the slash with @samp{!}.
3608 Examples:
3610 @table @samp
3611 @item WORK/WAITING
3612 Select @samp{:WORK:}-tagged TODO lines with the specific TODO
3613 keyword @samp{WAITING}.
3614 @item WORK/!-WAITING-NEXT
3615 Select @samp{:WORK:}-tagged TODO lines that are neither @samp{WAITING}
3616 nor @samp{NEXT}
3617 @item WORK/+WAITING|+NEXT
3618 Select @samp{:WORK:}-tagged TODO lines that are either @samp{WAITING} or
3619 @samp{NEXT}.
3620 @end table
3622 @cindex regular expressions, with tags search
3623 Any element of the tag/todo match can be a regular expression - in this
3624 case it must be enclosed in curly braces.  For example,
3625 @samp{WORK+@{^BOSS.*@}} matches headlines that contain the tag
3626 @samp{WORK} and any tag @i{starting} with @samp{BOSS}.
3628 @cindex level, require for tags match
3629 You can also require a headline to be of a certain level, by writing
3630 instead of any TAG an expression like @samp{LEVEL=3}.  For example, a
3631 search @samp{+LEVEL=3+BOSS/-DONE} lists all level three headlines that
3632 have the tag BOSS and are @emph{not} marked with the todo keyword DONE.
3634 @node Agenda views, Embedded LaTeX, Tags, Top
3635 @chapter Agenda Views
3636 @cindex agenda views
3638 Due to the way Org-mode works, TODO items, time-stamped items, and
3639 tagged headlines can be scattered throughout a file or even a number of
3640 files.  To get an overview over open action items, or over events that
3641 are important for a particular date, this information must be collected,
3642 sorted and displayed in an organized way.
3644 Org-mode can select items based on various criteria, and display them
3645 in a separate buffer.  Six different view types are provided:
3647 @itemize @bullet
3648 @item
3649 an @emph{agenda} that is like a calendar and shows information
3650 for specific dates,
3651 @item
3652 a @emph{TODO list} that covers all unfinished
3653 action items,
3654 @item
3655 a @emph{tags view}, showings headlines based on
3656 the tags associated with them,
3657 @item
3658 a @emph{timeline view} that shows all events in a single Org-mode file,
3659 in time-sorted view,
3660 @item
3661 a @emph{stuck projects view} showing projects that currently don't move
3662 along, and
3663 @item
3664 @emph{custom views} that are special tag/keyword searches and
3665 combinations of different views.
3666 @end itemize
3668 @noindent
3669 The extracted information is displayed in a special @emph{agenda
3670 buffer}.  This buffer is read-only, but provides commands to visit the
3671 corresponding locations in the original Org-mode files, and even to
3672 edit these files remotely.  
3674 Two variables control how the agenda buffer is displayed and whether the
3675 window configuration is restored when the agenda exits:
3676 @code{org-agenda-window-setup} and
3677 @code{org-agenda-restore-windows-after-quit}.
3679 @menu
3680 * Agenda files::                Files being searched for agenda information
3681 * Agenda dispatcher::           Keyboard access to agenda views
3682 * Built-in agenda views::       What is available out of the box?
3683 * Presentation and sorting::    How agenda items are prepared for display
3684 * Agenda commands::             Remote editing of org trees
3685 * Custom agenda views::         Defining special searches and views
3686 @end menu
3688 @node Agenda files, Agenda dispatcher, Agenda views, Agenda views
3689 @section Agenda files
3690 @cindex agenda files
3691 @cindex files for agenda
3693 The information to be shown is collected from all @emph{agenda files},
3694 the files listed in the variable @code{org-agenda-files}@footnote{If the
3695 value of that variable is not a list, but a single file name, then the
3696 list of agenda files will be maintained in that external file.}.  Thus even
3697 if you only work with a single Org-mode file, this file should be put
3698 into that list@footnote{When using the dispatcher, pressing @kbd{1}
3699 before selecting a command will actually limit the command to the
3700 current file, and ignore @code{org-agenda-files} until the next
3701 dispatcher command.}.  You can customize @code{org-agenda-files}, but
3702 the easiest way to maintain it is through the following commands
3704 @cindex files, adding to agenda list
3705 @table @kbd
3706 @kindex C-c [
3707 @item C-c [
3708 Add current file to the list of agenda files.  The file is added to
3709 the front of the list.  If it was already in the list, it is moved to
3710 the front.  With prefix arg, file is added/moved to the end.
3711 @kindex C-c ]
3712 @item C-c ]
3713 Remove current file from the list of agenda files.
3714 @kindex C-,
3715 @kindex C-'
3716 @item C-,
3717 @itemx C-'
3718 Cycle through agenda file list, visiting one file after the other.
3719 @end table
3721 @noindent
3722 The Org menu contains the current list of files and can be used
3723 to visit any of them.
3725 @node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda views
3726 @section The agenda dispatcher
3727 @cindex agenda dispatcher
3728 @cindex dispatching agenda commands
3729 The views are created through a dispatcher that should be bound to a
3730 global key, for example @kbd{C-c a} (@pxref{Installation}).  In the
3731 following we will assume that @kbd{C-c a} is indeed how the dispatcher
3732 is accessed and list keyboard access to commands accordingly.  After
3733 pressing @kbd{C-c a}, an additional letter is required to execute a
3734 command.  The dispatcher offers the following default commands:
3735 @table @kbd
3736 @item a
3737 Create the calendar-like agenda (@pxref{Weekly/Daily agenda}).
3738 @item t @r{/} T
3739 Create a list of all TODO items (@pxref{Global TODO list}).
3740 @item m @r{/} M
3741 Create a list of headlines matching a TAGS expression (@pxref{Matching
3742 headline tags}).
3743 @item L
3744 Create the timeline view for the current buffer (@pxref{Timeline}).
3745 @item # @r{/} !
3746 Create a list of stuck projects (@pxref{Stuck projects}).
3747 @item 1
3748 Restrict an agenda command to the current buffer.  After pressing
3749 @kbd{1}, you still need to press the character selecting the command.
3750 @item 0
3751 If there is an active region, restrict the following agenda command to
3752 the region.  Otherwise, restrict it to the current subtree.  After
3753 pressing @kbd{0}, you still need to press the character selecting the
3754 command.
3755 @end table
3757 You can also define custom commands that will be accessible through the
3758 dispatcher, just like the default commands.  This includes the
3759 possibility to create extended agenda buffers that contain several
3760 blocks together, for example the weekly agenda, the global TODO list and
3761 a number of special tags matches.  @xref{Custom agenda views}.
3763 @node Built-in agenda views, Presentation and sorting, Agenda dispatcher, Agenda views
3764 @section The built-in agenda views
3766 In this section we describe the built-in views.
3768 @menu
3769 * Weekly/Daily agenda::         The calendar page with current tasks
3770 * Global TODO list::            All unfinished action items
3771 * Matching headline tags::      Structured information with fine-tuned search
3772 * Timeline::                    Time-sorted view for single file
3773 * Stuck projects::              Find projects you need to review
3774 @end menu
3776 @node Weekly/Daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views
3777 @subsection The weekly/daily agenda
3778 @cindex agenda
3779 @cindex weekly agenda
3780 @cindex daily agenda
3782 The purpose of the weekly/daily @emph{agenda} is to act like a page of a
3783 paper agenda, showing all the tasks for the current week or day.
3785 @table @kbd
3786 @cindex org-agenda, command
3787 @kindex C-c a a
3788 @item C-c a a
3789 Compile an agenda for the current week from a list of org files.  The
3790 agenda shows the entries for each day.  With a @kbd{C-u} prefix (or
3791 when the variable @code{org-agenda-include-all-todo} is @code{t}), all
3792 unfinished TODO items (including those without a date) are also listed at
3793 the beginning of the buffer, before the first date.@*
3794 @end table
3796 Remote editing from the agenda buffer means, for example, that you can
3797 change the dates of deadlines and appointments from the agenda buffer.
3798 The commands available in the Agenda buffer are listed in @ref{Agenda
3799 commands}.
3801 @subsubheading Calendar/Diary integration
3802 @cindex calendar integration
3803 @cindex diary integration
3805 Emacs contains the calendar and diary by Edward M. Reingold.  The
3806 calendar displays a three-month calendar with holidays from different
3807 countries and cultures.  The diary allows you to keep track of
3808 anniversaries, lunar phases, sunrise/set, recurrent appointments
3809 (weekly, monthly) and more.  In this way, it is quite complementary to
3810 Org-mode.  It can be very useful to combine output from Org-mode with
3811 the diary.
3813 In order to include entries from the Emacs diary into Org-mode's
3814 agenda, you only need to customize the variable
3816 @lisp
3817 (setq org-agenda-include-diary t)
3818 @end lisp
3820 @noindent After that, everything will happen automatically.  All diary
3821 entries including holidays, anniversaries etc will be included in the
3822 agenda buffer created by Org-mode.  @key{SPC}, @key{TAB}, and
3823 @key{RET} can be used from the agenda buffer to jump to the diary
3824 file in order to edit existing diary entries.  The @kbd{i} command to
3825 insert new entries for the current date works in the agenda buffer, as
3826 well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display
3827 Sunrise/Sunset times, show lunar phases and to convert to other
3828 calendars, respectively.  @kbd{c} can be used to switch back and forth
3829 between calendar and agenda.
3832 @node Global TODO list, Matching headline tags, Weekly/Daily agenda, Built-in agenda views
3833 @subsection The global TODO list
3834 @cindex global TODO list
3835 @cindex TODO list, global
3837 The global TODO list contains all unfinished TODO items, formatted and
3838 collected into a single place.
3840 @table @kbd
3841 @kindex C-c a t
3842 @item C-c a t
3843 Show the global TODO list.  This collects the TODO items from all
3844 agenda files (@pxref{Agenda views}) into a single buffer.  The buffer is in
3845 @code{agenda-mode}, so there are commands to examine and manipulate
3846 the TODO entries directly from that buffer (@pxref{Agenda commands}).
3847 @kindex C-c a T
3848 @item C-c a T
3849 @cindex TODO keyword matching
3850 Like the above, but allows selection of a specific TODO keyword.  You can
3851 also do this by specifying a prefix argument to @kbd{C-c a t}.  With a
3852 @kbd{C-u} prefix you are prompted for a keyword.  With a numeric
3853 prefix, the Nth keyword in @code{org-todo-keywords} is selected.
3854 @kindex r
3855 The @kbd{r} key in the agenda buffer regenerates it, and you can give
3856 a prefix argument to this command to change the selected TODO keyword,
3857 for example @kbd{3 r}.  If you often need a search for a specific
3858 keyword, define a custom command for it (@pxref{Agenda dispatcher}).@*
3859 Matching specific TODO keywords can also be done as part of a tags
3860 search (@pxref{Tag searches}).
3861 @end table
3863 Remote editing of TODO items means that you can change the state of a
3864 TODO entry with a single key press.  The commands available in the
3865 TODO list are described in @ref{Agenda commands}.
3867 @cindex sublevels, inclusion into todo list
3868 Normally the global todo list simply shows all headlines with TODO
3869 keywords.  This list can become very long.  There are two ways to keep
3870 it more compact:
3871 @itemize @minus
3872 @item
3873 Some people view a TODO item that has been @emph{scheduled} for
3874 execution (@pxref{Time stamps}) as no longer @emph{open}.  Configure the
3875 variable @code{org-agenda-todo-ignore-scheduled} to exclude scheduled
3876 items from the global TODO list.
3877 @item
3878 TODO items may have sublevels to break up the task into subtasks.  In
3879 such cases it may be enough to list only the highest level TODO headline
3880 and omit the sublevels from the global list.  Configure the variable
3881 @code{org-agenda-todo-list-sublevels} to get this behavior.
3882 @end itemize
3884 @node Matching headline tags, Timeline, Global TODO list, Built-in agenda views
3885 @subsection Matching headline tags
3886 @cindex matching, of tags
3887 @cindex tags view
3889 If headlines in the agenda files are marked with @emph{tags}
3890 (@pxref{Tags}), you can select headlines based on the tags that apply
3891 to them and collect them into an agenda buffer.
3893 @table @kbd
3894 @kindex C-c a m
3895 @item C-c a m
3896 Produce a list of all headlines that match a given set of tags.  The
3897 command prompts for a selection criterion, which is a boolean logic
3898 expression with tags, like @samp{+WORK+URGENT-WITHBOSS} or
3899 @samp{WORK|HOME} (@pxref{Tags}).  If you often need a specific search,
3900 define a custom command for it (@pxref{Agenda dispatcher}).
3901 @kindex C-c a M
3902 @item C-c a M
3903 Like @kbd{C-c a m}, but only select headlines that are also TODO items
3904 and force checking subitems (see variable
3905 @code{org-tags-match-list-sublevels}).  Matching specific todo keywords
3906 together with a tags match is also possible, see @ref{Tag searches}.
3907 @end table
3909 The commands available in the tags list are described in @ref{Agenda
3910 commands}.
3912 @node Timeline, Stuck projects, Matching headline tags, Built-in agenda views
3913 @subsection Timeline for a single file
3914 @cindex timeline, single file
3915 @cindex time-sorted view
3917 The timeline summarizes all time-stamped items from a single Org-mode
3918 file in a @emph{time-sorted view}.  The main purpose of this command is
3919 to give an overview over events in a project.
3921 @table @kbd
3922 @kindex C-a a L
3923 @item C-c a L
3924 Show a time-sorted view of the org file, with all time-stamped items.
3925 When called with a @kbd{C-u} prefix, all unfinished TODO entries
3926 (scheduled or not) are also listed under the current date.
3927 @end table
3929 @noindent
3930 The commands available in the timeline buffer are listed in
3931 @ref{Agenda commands}.
3934 @node Stuck projects,  , Timeline, Built-in agenda views
3935 @subsection Stuck projects
3937 If you are following a system like David Allen's GTD to organize your
3938 work, one of the ``duties'' you have is a regular review to make sure
3939 that all projects move along.  A @emph{stuck} project is a project that
3940 has no defined next actions, so it will never show up in the TODO lists
3941 Org-mode produces.  During the review, you need to identify such
3942 projects and define next actions for them.
3944 @table @kbd
3945 @kindex C-c a #
3946 @item C-c a #
3947 List projects that are stuck.
3948 @kindex C-c a !
3949 @item C-c a !
3950 Customize the variable @code{org-stuck-projects} to define what a stuck
3951 project is and how to find it.
3952 @end table
3954 You almost certainly will have to configure this view before it will
3955 work for you.  The built-in default assumes that all your projects are
3956 level-2 headlines, and that a project is not stuck if it has at least
3957 one entry marked with a todo keyword TODO or NEXT or NEXTACTION.
3959 Lets assume that you, in your own way of using Org-mode, identify
3960 projects with a tag PROJECT, and that you use a todo keyword MAYBE to
3961 indicate a project that should not be considered yet.  Lets further
3962 assume that the todo keyword DONE marks finished projects, and that NEXT
3963 and TODO indicate next actions.  Finally, the tag @@SHOP indicates
3964 shopping and is a next action even without the NEXT tag.  In this case
3965 you would start by identifying eligible projects with a tags/todo match
3966 @samp{+PROJECT/-MAYBE-DONE}, and then check for TODO, NEXT and @@SHOP in
3967 the subtree to identify projects that are not stuck.  The correct
3968 customization for this is
3970 @lisp
3971 (setq org-stuck-projects
3972       ("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@@SHOP")))
3973 @end lisp
3976 @node Presentation and sorting, Agenda commands, Built-in agenda views, Agenda views
3977 @section Presentation and sorting
3978 @cindex presentation, of agenda items
3980 Before displaying items in an agenda view, Org-mode visually prepares
3981 the items and sorts them.  Each item occupies a single line.  The line
3982 starts with a @emph{prefix} that contains the @emph{category}
3983 (@pxref{Categories}) of the item and other important information.  You can
3984 customize the prefix using the option @code{org-agenda-prefix-format}.
3985 The prefix is followed by a cleaned-up version of the outline headline
3986 associated with the item.
3988 @menu
3989 * Categories::                  Not all tasks are equal
3990 * Time-of-day specifications::  How the agenda knows the time
3991 * Sorting of agenda items::     The order of things
3992 @end menu
3994 @node Categories, Time-of-day specifications, Presentation and sorting, Presentation and sorting
3995 @subsection Categories
3997 @cindex category
3998 The category is a broad label assigned to each agenda item.  By default,
3999 the category is simply derived from the file name, but you can also
4000 specify it with a special line in the buffer, like this:
4002 @example
4003 #+CATEGORY: Thesis
4004 @end example
4006 If there are several such lines in a file, each specifies the category
4007 for the text below it (but the first category also applies to any text
4008 before the first CATEGORY line).  The display in the agenda buffer looks
4009 best if the category is not longer than 10 characters.
4011 @node Time-of-day specifications, Sorting of agenda items, Categories, Presentation and sorting
4012 @subsection Time-of-Day Specifications
4013 @cindex time-of-day specification
4015 Org-mode checks each agenda item for a time-of-day specification.  The
4016 time can be part of the time stamp that triggered inclusion into the
4017 agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}.  Time
4018 ranges can be specified with two time stamps, like
4020 @w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
4022 In the headline of the entry itself, a time(range) may also appear as
4023 plain text (like @samp{12:45} or a @samp{8:30-1pm}.  If the agenda
4024 integrates the Emacs diary (@pxref{Weekly/Daily agenda}), time
4025 specifications in diary entries are recognized as well.
4027 For agenda display, Org-mode extracts the time and displays it in a
4028 standard 24 hour format as part of the prefix.  The example times in
4029 the previous paragraphs would end up in the agenda like this:
4031 @example
4032     8:30-13:00 Arthur Dent lies in front of the bulldozer
4033    12:45...... Ford Prefect arrives and takes Arthur to the pub
4034    19:00...... The Vogon reads his poem
4035    20:30-22:15 Marwin escorts the Hitchhikers to the bridge
4036 @end example
4038 @cindex time grid
4039 If the agenda is in single-day mode, or for the display of today, the
4040 timed entries are embedded in a time grid, like
4042 @example
4043     8:00...... ------------------
4044     8:30-13:00 Arthur Dent lies in front of the bulldozer
4045    10:00...... ------------------
4046    12:00...... ------------------
4047    12:45...... Ford Prefect arrives and takes Arthur to the pub
4048    14:00...... ------------------
4049    16:00...... ------------------
4050    18:00...... ------------------
4051    19:00...... The Vogon reads his poem
4052    20:00...... ------------------
4053    20:30-22:15 Marwin escorts the Hitchhikers to the bridge
4054 @end example
4056 The time grid can be turned on and off with the variable
4057 @code{org-agenda-use-time-grid}, and can be configured with
4058 @code{org-agenda-time-grid}.
4060 @node Sorting of agenda items,  , Time-of-day specifications, Presentation and sorting
4061 @subsection Sorting of agenda items
4062 @cindex sorting, of agenda items
4063 @cindex priorities, of agenda items
4064 Before being inserted into a view, the items are sorted.  How this is
4065 done depends on the type of view.
4066 @itemize @bullet
4067 @item
4068 For the daily/weekly agenda, the items for each day are sorted.  The
4069 default order is to first collect all items containing an explicit
4070 time-of-day specification.  These entries will be shown at the beginning
4071 of the list, as a @emph{schedule} for the day.  After that, items remain
4072 grouped in categories, in the sequence given by @code{org-agenda-files}.
4073 Within each category, items are sorted by priority (@pxref{Priorities}),
4074 which is composed of the base priority (2000 for priority @samp{A}, 1000
4075 for @samp{B}, and 0 for @samp{C}), plus additional increments for
4076 overdue scheduled or deadline items.
4077 @item 
4078 For the TODO list, items remain in the order of categories, but within
4079 each category, sorting takes place according to priority
4080 (@pxref{Priorities}).
4081 @item
4082 For tags matches, items are not sorted at all, but just appear in the
4083 sequence in which they are found in the agenda files.
4084 @end itemize
4086 Sorting can be customized using the variable
4087 @code{org-agenda-sorting-strategy}.
4090 @node Agenda commands, Custom agenda views, Presentation and sorting, Agenda views
4091 @section Commands in the agenda buffer
4092 @cindex commands, in agenda buffer
4094 Entries in the agenda buffer are linked back to the org file or diary
4095 file where they originate.  You are not allowed to edit the agenda
4096 buffer itself, but commands are provided to show and jump to the
4097 original entry location, and to edit the org-files ``remotely'' from
4098 the agenda buffer.  In this way, all information is stored only once,
4099 removing the risk that your agenda and note files may diverge.
4101 Some commands can be executed with mouse clicks on agenda lines.  For
4102 the other commands, the cursor needs to be in the desired line.
4104 @table @kbd
4105 @tsubheading{Motion}
4106 @cindex motion commands in agenda
4107 @kindex n
4108 @item n
4109 Next line (same as @key{up}).
4110 @kindex p
4111 @item p
4112 Previous line (same as @key{down}).
4113 @tsubheading{View/GoTo org file}
4114 @kindex mouse-3
4115 @kindex @key{SPC}
4116 @item mouse-3
4117 @itemx @key{SPC}
4118 Display the original location of the item in another window.
4120 @kindex L
4121 @item L
4122 Display original location and recenter that window.
4124 @kindex mouse-2
4125 @kindex mouse-1
4126 @kindex @key{TAB}
4127 @item mouse-2
4128 @itemx mouse-1
4129 @itemx @key{TAB}
4130 Go to the original location of the item in another window.  Under Emacs
4131 22, @kbd{mouse-1} will also works for this.
4133 @kindex @key{RET}
4134 @itemx @key{RET}
4135 Go to the original location of the item and delete other windows.
4137 @kindex f
4138 @item f
4139 Toggle Follow mode.  In Follow mode, as you move the cursor through
4140 the agenda buffer, the other window always shows the corresponding
4141 location in the org file.  The initial setting for this mode in new
4142 agenda buffers can be set with the variable
4143 @code{org-agenda-start-with-follow-mode}.
4145 @kindex b
4146 @item b
4147 Display the entire subtree of the current item in an indirect buffer.
4148 With numerical prefix ARG, go up to this level and then take that tree.
4149 If ARG is negative, go up that many levels.  With @kbd{C-u} prefix, do
4150 not remove the previously used indirect buffer.
4152 @kindex l
4153 @item l
4154 Toggle Logbook mode.  In Logbook mode, entries that where marked DONE while
4155 logging was on (variable @code{org-log-done}) are shown in the agenda,
4156 as are entries that have been clocked on that day.
4158 @tsubheading{Change display}
4159 @cindex display changing, in agenda
4160 @kindex o
4161 @item o
4162 Delete other windows.
4164 @kindex w
4165 @item w
4166 Switch to weekly view (7 days displayed together).
4168 @kindex d
4169 @item d
4170 Switch to daily view (just one day displayed).
4172 @kindex D
4173 @item D
4174 Toggle the inclusion of diary entries.  See @ref{Weekly/Daily agenda}.
4176 @kindex g
4177 @item g
4178 Toggle the time grid on and off.  See also the variables
4179 @code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
4181 @kindex r
4182 @item r
4183 Recreate the agenda buffer, for example to reflect the changes
4184 after modification of the time stamps of items with S-@key{left} and
4185 S-@key{right}.  When the buffer is the global todo list, a prefix
4186 argument is interpreted to create a selective list for a specific TODO
4187 keyword.
4189 @kindex s
4190 @item s
4191 Save all Org-mode buffers in the current Emacs session.
4193 @kindex @key{right}
4194 @item @key{right}
4195 Display the following @code{org-agenda-ndays} days.  For example, if
4196 the display covers a week, switch to the following week.  With prefix
4197 arg, go forward that many times @code{org-agenda-ndays} days.
4199 @kindex @key{left}
4200 @item @key{left}
4201 Display the previous dates.
4203 @kindex .
4204 @item .
4205 Goto today.
4207 @tsubheading{Remote editing}
4208 @cindex remote editing, from agenda
4210 @item 0-9
4211 Digit argument.
4213 @cindex undoing remote-editing events
4214 @cindex remote editing, undo
4215 @kindex C-_
4216 @item C-_
4217 Undo a change due to a remote editing command.  The change is undone
4218 both in the agenda buffer and in the remote buffer.
4220 @kindex t
4221 @item t
4222 Change the TODO state of the item, both in the agenda and in the
4223 original org file.
4225 @kindex C-k
4226 @item C-k
4227 Delete the current agenda item along with the entire subtree belonging
4228 to it in the original Org-mode file.  If the text to be deleted remotely
4229 is longer than one line, the kill needs to be confirmed by the user.  See
4230 variable @code{org-agenda-confirm-kill}.
4232 @kindex $
4233 @item $
4234 Archive the subtree corresponding to the current headline.
4236 @kindex T
4237 @item T
4238 Show all tags associated with the current item.  Because of
4239 inheritance, this may be more than the tags listed in the line itself.
4241 @kindex :
4242 @item :
4243 Set tags for the current headline.
4245 @kindex a
4246 @item a
4247 Toggle the ARCHIVE tag for the current headline.
4249 @kindex ,
4250 @item ,
4251 Set the priority for the current item.  Org-mode prompts for the
4252 priority character. If you reply with @key{SPC}, the priority cookie
4253 is removed from the entry.
4255 @kindex P
4256 @item P
4257 Display weighted priority of current item.
4259 @kindex +
4260 @kindex S-@key{up}
4261 @item +
4262 @itemx S-@key{up}
4263 Increase the priority of the current item.  The priority is changed in
4264 the original buffer, but the agenda is not resorted.  Use the @kbd{r}
4265 key for this.
4267 @kindex -
4268 @kindex S-@key{down}
4269 @item -
4270 @itemx S-@key{down}
4271 Decrease the priority of the current item.
4273 @kindex C-c C-s
4274 @item C-c C-s
4275 Schedule this item
4277 @kindex C-c C-d
4278 @item C-c C-d
4279 Set a deadline for this item.
4281 @kindex S-@key{right}
4282 @item S-@key{right}
4283 Change the time stamp associated with the current line by one day into
4284 the future.  With prefix argument, change it by that many days.  For
4285 example, @kbd{3 6 5 S-@key{right}} will change it by a year.  The
4286 stamp is changed in the original org file, but the change is not
4287 directly reflected in the agenda buffer.  Use the
4288 @kbd{r} key to update the buffer.
4290 @kindex S-@key{left}
4291 @item S-@key{left}
4292 Change the time stamp associated with the current line by one day
4293 into the past.
4295 @kindex >
4296 @item >
4297 Change the time stamp associated with the current line to today.
4298 The key @kbd{>} has been chosen, because it is the same as @kbd{S-.}
4299 on my keyboard.
4301 @kindex I
4302 @item I
4303 Start the clock on the current item.  If a clock is running already, it
4304 is stopped first.
4306 @kindex O
4307 @item O
4308 Stop the previously started clock.
4310 @kindex X
4311 @item X
4312 Cancel the currently running clock.
4314 @tsubheading{Calendar commands}
4315 @cindex calendar commands, from agenda
4316 @kindex c
4317 @item c
4318 Open the Emacs calendar and move to the date at the agenda cursor.
4320 @item c
4321 When in the calendar, compute and show the Org-mode agenda for the
4322 date at the cursor.
4324 @cindex diary entries, creating from agenda
4325 @kindex i
4326 @item i
4327 Insert a new entry into the diary.  Prompts for the type of entry
4328 (day, weekly, monthly, yearly, anniversary, cyclic) and creates a new
4329 entry in the diary, just as @kbd{i d} etc. would do in the calendar.
4330 The date is taken from the cursor position.
4332 @kindex M
4333 @item M
4334 Show the phases of the moon for the three months around current date.
4336 @kindex S
4337 @item S
4338 Show sunrise and sunset times.  The geographical location must be set
4339 with calendar variables, see documentation of the Emacs calendar.
4341 @kindex C
4342 @item C
4343 Convert the date at cursor into many other cultural and historic
4344 calendars.
4346 @kindex H
4347 @item H
4348 Show holidays for three month around the cursor date.
4350 @c FIXME:  This should be a different key.
4351 @kindex C-c C-x C-c
4352 @item C-c C-x C-c
4353 Export a single iCalendar file containing entries from all agenda files.
4355 @tsubheading{Quit and Exit}
4356 @kindex q
4357 @item q
4358 Quit agenda, remove the agenda buffer.
4360 @kindex x
4361 @cindex agenda files, removing buffers
4362 @item x
4363 Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
4364 for the compilation of the agenda.  Buffers created by the user to
4365 visit org files will not be removed.
4366 @end table
4369 @node Custom agenda views,  , Agenda commands, Agenda views
4370 @section Custom agenda views
4371 @cindex custom agenda views
4372 @cindex agenda views, custom
4374 Custom agenda commands serve two purposes: to store and quickly access
4375 frequently used TODO and tags searches, and to create special composite
4376 agenda buffers.  Custom agenda commands will be accessible through the
4377 dispatcher (@pxref{Agenda dispatcher}), just like the default commands.
4379 @menu
4380 * Storing searches::            Type once, use often
4381 * Block agenda::                All the stuff you need in a single buffer
4382 * Setting Options::             Changing the rules
4383 * Batch processing::            Agenda views from the command line
4384 @end menu
4386 @node Storing searches, Block agenda, Custom agenda views, Custom agenda views
4387 @subsection Storing searches
4389 The first application of custom searches is the definition of keyboard
4390 shortcuts for frequently used searches, either creating an agenda
4391 buffer, or a sparse tree (the latter covering of course only the current
4392 buffer).
4393 @kindex C-c a C
4394 Custom commands are configured in the variable
4395 @code{org-agenda-custom-commands}.  You can customize this variable, for
4396 example by pressing @kbd{C-c a C}.  You can also directly set it with
4397 Emacs Lisp in @file{.emacs}.  The following example contains all valid
4398 search types:
4400 @lisp
4401 @group
4402 (setq org-agenda-custom-commands
4403       '(("w" todo "WAITING")
4404         ("W" todo-tree "WAITING")
4405         ("u" tags "+BOSS-URGENT")
4406         ("v" tags-todo "+BOSS-URGENT")
4407         ("U" tags-tree "+BOSS-URGENT")
4408         ("f" occur-tree "\\<FIXME\\>")))
4409 @end group
4410 @end lisp
4412 @noindent
4413 The initial single-character string in each entry defines the character
4414 you have to press after the dispatcher command @kbd{C-c a} in order to
4415 access the command.   The second parameter is the search type, followed
4416 by the string or regular expression to be used for the matching.  The
4417 example above will therefore define:
4419 @table @kbd
4420 @item C-c a w
4421 as a global search for TODO entries with @samp{WAITING} as the TODO
4422 keyword
4423 @item C-c a W
4424 as the same search, but only in the current buffer and displaying the
4425 results as a sparse tree
4426 @item C-c a u
4427 as a global tags search for headlines marked @samp{:BOSS:} but not
4428 @samp{:URGENT:}
4429 @item C-c a v
4430 as the same search as @kbd{C-c a u}, but limiting the search to
4431 headlines that are also TODO items
4432 @item C-c a U
4433 as the same search as @kbd{C-c a u}, but only in the current buffer and
4434 displaying the result as a sparse tree
4435 @item C-c a f
4436 to create a sparse tree (again: current buffer only) with all entries
4437 containing the word @samp{FIXME}.
4438 @end table
4440 @node Block agenda, Setting Options, Storing searches, Custom agenda views
4441 @subsection Block agenda
4442 @cindex block agenda
4443 @cindex agenda, with block views
4445 Another possibility is the construction of agenda views that comprise
4446 the results of @emph{several} commands, each of which creates a block in
4447 the agenda buffer.  The available commands include @code{agenda} for the
4448 daily or weekly agenda (as created with @kbd{C-c a a}), @code{alltodo}
4449 for the global todo list (as constructed with @kbd{C-c a t}), and the
4450 matching commands discussed above: @code{todo}, @code{tags}, and
4451 @code{tags-todo}.  Here are two examples:
4453 @lisp
4454 @group
4455 (setq org-agenda-custom-commands
4456       '(("h" "Agenda and Home-related tasks"
4457          ((agenda)
4458           (tags-todo "HOME")
4459           (tags "GARDEN")))
4460         ("o" "Agenda and Office-related tasks"
4461          ((agenda)
4462           (tags-todo "WORK")
4463           (tags "OFFICE")))))
4464 @end group
4465 @end lisp
4467 @noindent
4468 This will define @kbd{C-c a h} to create a multi-block view for stuff
4469 you need to attend to at home.  The resulting agenda buffer will contain
4470 your agenda for the current week, all TODO items that carry the tag
4471 @samp{HOME}, and also all lines tagged with @samp{GARDEN}.  Finally the
4472 command @kbd{C-c a o} provides a similar view for office tasks.
4475 @node Setting Options, Batch processing, Block agenda, Custom agenda views
4476 @subsection Setting Options for custom commands
4477 @cindex options, for custom agenda views
4479 Org-mode contains a number of variables regulating agenda construction
4480 and display.  The global variables define the behavior for all agenda
4481 commands, including the custom commands.  However, if you want to change
4482 some settings just for a single custom view, you can do so.  Setting
4483 options requires inserting a list of variable names and values at the
4484 right spot in @code{org-agenda-custom-commands}.  For example:
4486 @lisp
4487 @group
4488 (setq org-agenda-custom-commands
4489       '(("w" todo "WAITING"
4490          ((org-agenda-sorting-strategy '(priority-down))
4491           (org-agenda-prefix-format "  Mixed: ")))
4492         ("U" tags-tree "+BOSS-URGENT"
4493          ((org-show-following-heading nil)
4494           (org-show-hierarchy-above nil)))))
4495 @end group
4496 @end lisp
4498 @noindent
4499 Now the @kbd{C-c a w} command will sort the collected entries only by
4500 priority, and the prefix format is modified to just say @samp{  Mixed:}
4501 instead of giving the category of the entry.  The sparse tags tree of
4502 @kbd{C-c a U} will now turn out ultra-compact, because neither the
4503 headline hierarchy above the match, nor the headline following the match
4504 will be shown.
4506 For command sets creating a block agenda,
4507 @code{org-agenda-custom-commands} has two separate spots for setting
4508 options.  You can add options that should be valid for just a single
4509 command in the set, and options that should be valid for all commands in
4510 the set.  The former are just added to the command entry, the latter
4511 must come after the list of command entries.  Going back to the block
4512 agenda example (@pxref{Block agenda}), let's change the sorting strategy
4513 for the @kbd{C-c a h} commands to @code{priority-down}, but let's sort
4514 the results for GARDEN tags query in the opposite order,
4515 @code{priority-up}.  This would look like this:
4517 @lisp
4518 @group
4519 (setq org-agenda-custom-commands
4520       '(("h" "Agenda and Home-related tasks"
4521          ((agenda)
4522           (tags-todo "HOME")
4523           (tags "GARDEN" ((org-agenda-sorting-strategy '(priority-up)))))
4524          ((org-agenda-sorting-strategy '(priority-down))))
4525         ("o" "Agenda and Office-related tasks"
4526          ((agenda)
4527           (tags-todo "WORK")
4528           (tags "OFFICE")))))
4529 @end group
4530 @end lisp
4532 As you see, the values and parenthesis setting is a little complex.
4533 When in doubt, use the customize interface to set this variable - it
4534 fully supports its structure.  Just one caveat: When setting options in
4535 this interface, the @emph{values} are just lisp expressions.  So if the
4536 value is a string, you need to add the double quotes around the value
4537 yourself.
4539 @node Batch processing,  , Setting Options, Custom agenda views
4540 @subsection Creating agenda views in batch processing
4541 @cindex agenda, batch production
4543 If you want to print or otherwise reprocess agenda views, it can be
4544 useful to create an agenda from the command line.  This is the purpose
4545 of the function @code{org-batch-agenda}.  It takes as a parameter one of
4546 the strings that are the keys in @code{org-agenda-custom-commands}.  For
4547 example, to directly print the current TODO list, you could use
4549 @example
4550 emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
4551 @end example
4553 @noindent
4554 You may also modify parameters on the fly like this:
4556 @example
4557 emacs -batch -l ~/.emacs                                      \
4558    -eval '(org-batch-agenda "a"                               \
4559             org-agenda-ndays 300                              \
4560             org-agenda-include-diary nil                      \
4561             org-agenda-files (quote ("~/org/project.org")))'  \
4562    | lpr
4563 @end example
4565 @noindent
4566 which will produce a 300 day agenda, fully restricted to the Org file
4567 @file{~/org/projects.org}, not even including the diary.
4569 @node Embedded LaTeX, Exporting, Agenda views, Top
4570 @chapter Embedded LaTeX
4571 @cindex @TeX{} interpretation
4572 @cindex La@TeX{} interpretation
4574 Plain ASCII is normally sufficient for almost all note taking.  One
4575 exception, however, are scientific notes which need to be able to
4576 contain mathematical symbols and the occasional formula.
4577 La@TeX{}@footnote{La@TeX{} is a macro system based on Donald E. Knuth's
4578 @TeX{} system.  Many of the features described here as ``La@TeX{}'' are
4579 really from @TeX{}, but for simplicity I am blurring this distinction.}
4580 is widely used to typeset scientific documents. Org-mode supports
4581 embedding La@TeX{} code into its files, because many academics are used
4582 to read La@TeX{} source code, and because it can be readily processed
4583 into images for HTML production.
4585 It is not necessary to mark La@TeX{} macros and code in any special way.
4586 If you observe a few conventions, Org-mode knows how to find it and what
4587 to do with it.
4589 @menu
4590 * Math symbols::                TeX macros for symbols and Greek letters
4591 * Subscripts and Superscripts::  Simple syntax for raising/lowering text
4592 * LaTeX fragments::             Complex formulas made easy
4593 * Processing LaTeX fragments::  Previewing LaTeX processing
4594 * CDLaTeX mode::                Speed up entering of formulas
4595 @end menu
4597 @node Math symbols, Subscripts and Superscripts, Embedded LaTeX, Embedded LaTeX
4598 @section Math symbols
4599 @cindex math symbols
4600 @cindex TeX macros
4602 You can use La@TeX{} macros to insert special symbols like @samp{\alpha}
4603 to indicate the Greek letter, or @samp{\to} to indicate an arrow.
4604 Completion for these macros is available, just type @samp{\} and maybe a
4605 few letters, and press @kbd{M-@key{TAB}} to see possible completions.
4606 Unlike La@TeX{} code, Org-mode allows these macros to be present
4607 without surrounding math delimiters, for example:
4609 @example
4610 Angles are written as Greek letters \alpha, \beta and \gamma.
4611 @end example
4613 During HTML export (@pxref{HTML export}), these symbols are translated
4614 into the proper syntax for HTML, for the above examples this is
4615 @samp{&alpha;} and @samp{&rarr;}, respectively.
4617 @node Subscripts and Superscripts, LaTeX fragments, Math symbols, Embedded LaTeX
4618 @section Subscripts and Superscripts
4619 @cindex subscript
4620 @cindex superscript
4622 Just like in La@TeX{}, @samp{^} and @samp{_} are used to indicate super-
4623 and subscripts.  Again, these can be used without embedding them in
4624 math-mode delimiters.  To increase the readability of ASCII text, it is
4625 not necessary (but OK) to surround multi-character sub- and superscripts
4626 with curly braces.  For example
4628 @example
4629 The mass if the sun is M_sun = 1.989 x 10^30 kg.  The radius of
4630 the sun is R_@{sun@} = 6.96 x 10^8 m.
4631 @end example
4633 To avoid interpretation as raised or lowered text, you can quote
4634 @samp{^} and @samp{_} with a backslash: @samp{\_} and @samp{\^}.
4636 During HTML export (@pxref{HTML export}), subscript and superscripts
4637 are surrounded with @code{<sub>} and @code{<sup>} tags, respectively.
4639 @node LaTeX fragments, Processing LaTeX fragments, Subscripts and Superscripts, Embedded LaTeX
4640 @section LaTeX fragments
4641 @cindex LaTeX fragments
4643 With symbols, sub- and superscripts, HTML is pretty much at its end when
4644 it comes to representing mathematical formulas@footnote{Yes, there is
4645 MathML, but that is not yet fully supported by many browsers, and there
4646 is no decent converter for turning LaTeX of ASCII representations of
4647 formulas into MathML.  So for the time being, converting formulas into
4648 images seems the way to go.}.  More complex
4649 expressions need a dedicated formula processor.  To this end, Org-mode
4650 can contain arbitrary La@TeX{} fragments.  It provides commands to
4651 preview the typeset result of these fragments, and upon export to HTML,
4652 all fragments will be converted to images and inlined into the HTML
4653 document.  For this to work you need to be on a system with a working
4654 La@TeX{} installation.  You also need the @file{dvipng} program,
4655 available at @url{http://sourceforge.net/projects/dvipng/}.
4657 La@TeX{} fragments don't need any special marking at all.  The following
4658 snippets will be identified as LaTeX source code:
4659 @itemize @bullet
4660 @item
4661 Environments of any kind.  The only requirement is that the
4662 @code{\begin} statement appears on a new line, preceded by only
4663 whitespace.
4664 @item
4665 Text within the usual La@TeX{} math delimiters.  To avoid conflicts with
4666 currency specifications, single @samp{$} characters are only recognized
4667 as math delimiters if the enclosed text contains at most two line breaks,
4668 is directly attached to the @samp{$} characters with no whitespace in
4669 between, and if the closing @samp{$} is followed by whitespace or
4670 punctuation.  For the other delimiters, there is no such restriction, so
4671 when in doubt, use @samp{\(...\)} as inline math delimiters.
4672 @end itemize
4674 @noindent For example:
4676 @example
4677 \begin@{equation@}                          % arbitrary environments,
4678 x=\sqrt@{b@}                                % even tables, figures
4679 \end@{equation@}                            % etc
4681 If $a^2=b$ and \( b=2 \), then the solution must be
4682 either $$ a=+\sqrt@{2@} $$ or \[ a=-\sqrt@{2@} \].
4683 @end example
4685 @noindent
4686 If you need any of the delimiter ASCII sequences for other purposes, you
4687 can configure the option @code{org-format-latex-options} to deselect the
4688 ones you do not wish to have interpreted by the La@TeX{} converter.
4690 @node Processing LaTeX fragments, CDLaTeX mode, LaTeX fragments, Embedded LaTeX
4691 @section Processing LaTeX fragments
4692 @cindex LaTeX fragments, preview
4694 La@TeX{} fragments can be processed to produce a preview images of the
4695 typeset expressions:
4697 @table @kbd
4698 @kindex C-c C-x C-l
4699 @item C-c C-x C-l
4700 Produce a preview image of the La@TeX{} fragment at point and overlay it
4701 over the source code.  If there is no fragment at point, process all
4702 fragments in the current entry (between two headlines).  When called
4703 with a prefix argument, process the entire subtree.  When called with
4704 two prefix arguments, or when the cursor is before the first headline,
4705 process the entire buffer.
4706 @kindex C-c C-c
4707 @item C-c C-c
4708 Remove the overlay preview images.
4709 @end table
4711 During HTML export (@pxref{HTML export}), all La@TeX{} fragments are
4712 converted into images and inlined into the document if the following
4713 setting is active:
4715 @lisp
4716 (setq org-export-with-LaTeX-fragments t)
4717 @end lisp
4719 @node CDLaTeX mode,  , Processing LaTeX fragments, Embedded LaTeX
4720 @section Using CDLaTeX to enter math
4721 @cindex CDLaTeX
4723 CDLaTeX-mode is a minor mode that is normally used in combination with a
4724 major LaTeX mode like AUCTeX in order to speed-up insertion of
4725 environments and math templates.  Inside Org-mode, you can make use of
4726 some of the features of cdlatex-mode.  You need to install
4727 @file{cdlatex.el} and @file{texmathp.el} (the latter comes also with
4728 AUCTeX) from @url{http://www.astro.uva.nl/~dominik/Tools/cdlatex}.
4729 Don't turn cdlatex-mode itself under Org-mode, but use the light
4730 version @code{org-cdlatex-mode} that comes as part of Org-mode.  Turn it
4731 on for the current buffer with @code{M-x org-cdlatex-mode}, or for all
4732 Org-mode files with
4734 @lisp
4735 (add-hook 'org-mode-hook 'turn-on-org-cdlatex)
4736 @end lisp
4738 When this mode is enabled, the following features are present (for more
4739 details see the documentation of cdlatex-mode):
4740 @itemize @bullet
4741 @kindex C-c @{
4742 @item
4743 Environment templates can be inserted with @kbd{C-c @{}.
4744 @item
4745 @kindex @key{TAB}
4746 The @key{TAB} key will do template expansion if the cursor is inside a
4747 LaTeX fragment@footnote{Org-mode has a method to test if the cursor is
4748 inside such a fragment, see the documentation of the function
4749 @code{org-inside-LaTeX-fragment-p}.}.  For example, @key{TAB} will
4750 expand @code{fr} to @code{\frac@{@}@{@}} and position the cursor
4751 correctly inside the first brace.  Another @key{TAB} will get you into
4752 the second brace.  Even outside fragments, @key{TAB} will expand
4753 environment abbreviations at the beginning of a line.  For example, if
4754 you write @samp{equ} at the beginning of a line and press @key{TAB},
4755 this abbreviation will be expanded to an @code{equation} environment.
4756 To get a list of all abbreviations, type @kbd{M-x cdlatex-command-help}.
4757 @item
4758 @kindex _
4759 @kindex ^
4760 Pressing @kbd{_} and @kbd{^} inside a LaTeX fragment will insert these
4761 characters together with a pair of braces.  If you use @key{TAB} to move
4762 out of the braces, and if the braces surround only a single character or
4763 macro, they are removed again (depending on the variable
4764 @code{cdlatex-simplify-sub-super-scripts}).
4765 @item
4766 @kindex `
4767 Pressing the backquote @kbd{`} followed by a character inserts math
4768 macros, also outside LaTeX fragments.  If you wait more than 1.5 seconds
4769 after the backquote, a help window will pop up.
4770 @item
4771 @kindex '
4772 Pressing the normal quote @kbd{'} followed by another character modifies
4773 the symbol before point with an accent or a font.  If you wait more than
4774 1.5 seconds after the backquote, a help window will pop up.  Character
4775 modification will work only inside La@TeX{} fragments, outside the quote
4776 is normal.
4777 @end itemize
4779 @node Exporting, Publishing, Embedded LaTeX, Top
4780 @chapter Exporting
4781 @cindex exporting
4783 Org-mode documents can be exported into a variety of other formats.  For
4784 printing and sharing of notes, ASCII export produces a readable and
4785 simple version of an Org-mode file.  HTML export allows you to publish a
4786 notes file on the web, while the XOXO format provides a solid base for
4787 exchange with a broad range of other applications.  To incorporate
4788 entries with associated times like deadlines or appointments into a
4789 desktop calendar program like iCal, Org-mode can also produce extracts
4790 in the iCalendar format.  Currently Org-mode only supports export, not
4791 import of these different formats.
4793 When exporting, Org-mode uses special conventions to enrich the output
4794 produced.  @xref{Text interpretation}, for more details.
4796 @table @kbd
4797 @kindex C-c C-e
4798 @item C-c C-e
4799 Dispatcher for export and publishing commands.  Displays a help-window
4800 listing the additional key(s) needed to launch an export or publishing
4801 command.
4802 @end table
4804 @menu
4805 * ASCII export::                Exporting to plain ASCII
4806 * HTML export::                 Exporting to HTML
4807 * XOXO export::                 Exporting to XOXO
4808 * iCalendar export::            Exporting in iCalendar format
4809 * Text interpretation::         How the exporter looks at the file
4810 @end menu
4812 @node ASCII export, HTML export, Exporting, Exporting
4813 @section ASCII export
4814 @cindex ASCII export
4816 ASCII export produces a simple and very readable version of an Org-mode
4817 file.
4819 @cindex region, active
4820 @cindex active region
4821 @cindex transient-mark-mode
4822 @table @kbd
4823 @kindex C-c C-e a
4824 @item C-c C-e a
4825 Export as ASCII file.  If there is an active region, only the region
4826 will be exported.  For an org file @file{myfile.org}, the ASCII file
4827 will be @file{myfile.txt}.  The file will be overwritten without
4828 warning.
4829 @kindex C-c C-e v a
4830 @item C-c C-e v a
4831 Export only the visible part of the document.
4832 @end table
4834 @cindex headline levels, for exporting
4835 In the exported version, the first 3 outline levels will become
4836 headlines, defining a general document structure.  Additional levels
4837 will be exported as itemized lists.  If you want that transition to occur
4838 at a different level, specify it with a prefix argument.  For example,
4840 @example
4841 @kbd{C-1 C-c C-e a}
4842 @end example
4844 @noindent
4845 creates only top level headlines and does the rest as items.  When
4846 headlines are converted to items, the indentation of the text following
4847 the headline is changed to fit nicely under the item.  This is done with
4848 the assumption that the first bodyline indicates the base indentation of
4849 the body text.  Any indentation larger than this is adjusted to preserve
4850 the layout relative to the first line.  Should there be lines with less
4851 indentation than the first, these are left alone.
4853 @node HTML export, XOXO export, ASCII export, Exporting
4854 @section HTML export
4855 @cindex HTML export
4857 Org-mode contains an HTML (XHTML 1.0 strict) exporter with extensive
4858 HTML formatting, in ways similar to John Grubers @emph{markdown}
4859 language, but with additional support for tables.
4861 @menu
4862 * Export commands::             How to invoke HTML export
4863 * Quoting HTML tags::           Using direct HTML in Org-mode
4864 * Links::                       How hyperlinks get transferred to HTML
4865 * Images::                      To inline or not to inline?
4866 * CSS support::                 Style specifications
4867 @end menu
4869 @node Export commands, Quoting HTML tags, HTML export, HTML export
4870 @subsection HTML export commands
4872 @cindex region, active
4873 @cindex active region
4874 @cindex transient-mark-mode
4875 @table @kbd
4876 @kindex C-c C-e h
4877 @item C-c C-e h
4878 Export as HTML file @file{myfile.html}.
4879 @kindex C-c C-e b
4880 @item C-c C-e b
4881 Export as HTML file and open it with a browser.
4882 @kindex C-c C-e v h
4883 @kindex C-c C-e v b
4884 @item C-c C-e v h
4885 @item C-c C-e v b
4886 Export only the visible part of the document.
4887 @end table
4889 @cindex headline levels, for exporting
4890 In the exported version, the first 3 outline levels will become
4891 headlines, defining a general document structure.  Additional levels
4892 will be exported as itemized lists.  If you want that transition to occur
4893 at a different level, specify it with a prefix argument.  For example,
4895 @example
4896 @kbd{C-2 C-c C-e b}
4897 @end example
4899 @noindent
4900 creates two levels of headings and does the rest as items.
4902 @node Quoting HTML tags, Links, Export commands, HTML export
4903 @subsection Quoting HTML tags
4905 Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
4906 @samp{&gt;} in HTML export.  If you want to include simple HTML tags
4907 which should be interpreted as such, mark them with @samp{@@} as in
4908 @samp{@@<b>bold text@@</b>}.  Note that this really works only for
4909 simple tags.  For more extensive HTML that should be copied verbatim to
4910 the exported file use either
4912 @example
4913 #+HTML: Literal HTML code for export
4914 @end example
4916 @noindent or
4918 @example
4919 #+BEGIN_HTML
4920 All lines between these markers are exported literally
4921 #+END_HTML
4922 @end example
4925 @node Links, Images, Quoting HTML tags, HTML export
4926 @subsection Links
4928 @cindex links, in HTML export
4929 @cindex internal links, in HTML export
4930 @cindex external links, in HTML export
4931 Internal links (@pxref{Internal links}) will continue to work in HTML
4932 files only if they match a dedicated @samp{<<target>>}.  Automatic links
4933 created by radio targets (@pxref{Radio targets}) will also work in the
4934 HTML file.  Links to external files will still work if the HTML file is
4935 in the same directory as the Org-mode file.  Links to other @file{.org}
4936 files will be translated into HTML links under the assumption that an
4937 HTML version also exists of the linked file.  For information related to
4938 linking files while publishing them to a publishing directory see
4939 @ref{Publishing links}.
4941 @node Images, CSS support, Links, HTML export
4942 @subsection Images
4944 @cindex images, inline in HTML
4945 @cindex inlining images in HTML
4946 HTML export can inline images given as links in the Org-mode file, and
4947 it can make an image the clickable part of a link.  By
4948 default@footnote{but see the variable
4949 @code{org-export-html-inline-images}}, images are inlined if a link does
4950 not have a description.  So @samp{[[file:myimg.jpg]]} will be inlined,
4951 while @samp{[[file:myimg.jpg][the image]]} will just produce a link
4952 @samp{the image} that points to the image.  If the description part
4953 itself is a @code{file:} link or a @code{http:} URL pointing to an
4954 image, this image will be inlined and activated so that clicking on the
4955 image will activate the link.  For example, to include a thumbnail that
4956 will link to a high resolution version of the image, you could use:
4958 @example
4959 [[file:highres.jpg][file:thumb.jpg]]
4960 @end example
4962 @noindent
4963 and you could use @code{http} addresses just as well.
4965 @node CSS support,  , Images, HTML export
4966 @subsection CSS support
4968 You can also give style information for the exported file.  The HTML
4969 exporter assigns the following CSS classes to appropriate parts of the
4970 document - your style specifications may change these:
4971 @example
4972 .todo           @r{TODO keywords}
4973 .done           @r{the DONE keyword}
4974 .timestamp      @r{time stamp}
4975 .timestamp-kwd  @r{keyword associated with a time stamp, like SCHEDULED}
4976 .tag            @r{tag in a headline}
4977 .target         @r{target for links}
4978 @end example
4980 The default style specification can be configured through the option
4981 @code{org-export-html-style}.  If you want to use a file-local style,
4982 you may use file variables, best wrapped into a COMMENT section at the
4983 end of the outline tree.  For example@footnote{Under Emacs 21, the
4984 continuation lines for a variable value should have no @samp{#} at the
4985 start of the line.}:
4987 @example
4988 * COMMENT html style specifications
4990 # Local Variables:
4991 # org-export-html-style: "   <style type=\"text/css\">
4992 #       p @{font-weight: normal; color: gray; @}
4993 #       h1 @{color: black; @}
4994 #   </style>"
4995 # End:
4996 @end example
4998 Remember to execute @kbd{M-x normal-mode} after changing this to make
4999 the new style visible to Emacs.  This command restarts org-mode for the
5000 current buffer and forces Emacs to re-evaluate the local variables
5001 section in the buffer.
5003 @c FIXME: More about header and footer styles
5004 @c FIXME: Talk about links and targets.
5006 @node XOXO export, iCalendar export, HTML export, Exporting
5007 @section XOXO export
5008 @cindex XOXO export
5010 Org-mode contains an exporter that produces XOXO-style output.
5011 Currently, this exporter only handles the general outline structure and
5012 does not interpret any additional Org-mode features.
5014 @table @kbd
5015 @kindex C-c C-e x
5016 @item C-c C-e x
5017 Export as XOXO file @file{myfile.html}.
5018 @kindex C-c C-e v
5019 @item C-c C-e v x
5020 Export only the visible part of the document.
5021 @end table
5023 @node iCalendar export, Text interpretation, XOXO export, Exporting
5024 @section iCalendar export
5025 @cindex iCalendar export
5027 Some people like to use Org-mode for keeping track of projects, but
5028 still prefer a standard calendar application for anniversaries and
5029 appointments.  In this case it can be useful to have deadlines and
5030 other time-stamped items in Org-mode files show up in the calendar
5031 application.  Org-mode can export calendar information in the standard
5032 iCalendar format.  If you also want to have TODO entries included in the
5033 export, configure the variable @code{org-icalendar-include-todo}.
5035 @table @kbd
5036 @kindex C-c C-e i
5037 @item C-c C-e i
5038 Create iCalendar entries for the current file and store them in the same
5039 directory, using a file extension @file{.ics}.
5040 @kindex C-c C-e I
5041 @item C-c C-e I
5042 Like @kbd{C-c C-e i}, but do this for all files in
5043 @code{org-agenda-files}.  For each of these files, a separate iCalendar
5044 file will be written.
5045 @kindex C-c C-e c
5046 @item C-c C-e c
5047 Create a single large iCalendar file from all files in
5048 @code{org-agenda-files} and write it to the file given by
5049 @code{org-combined-agenda-icalendar-file}.
5050 @end table
5052 How this calendar is best read and updated, depends on the application
5053 you are using.  The FAQ covers this issue.
5056 @node Text interpretation,  , iCalendar export, Exporting
5057 @section Text interpretation by the exporter
5059 The exporter backends interpret additional structure in the Org-mode file
5060 in order to produce better output.
5062 @menu
5063 * Comment lines::               Some lines will not be exported
5064 * Initial text::                Text before the first headline
5065 * Enhancing text::              Subscripts, symbols and more
5066 * Export options::              How to influence the export settings
5067 @end menu
5069 @node Comment lines, Initial text, Text interpretation, Text interpretation
5070 @subsection Comment lines
5071 @cindex comment lines
5072 @cindex exporting, not
5074 Lines starting with @samp{#} in column zero are treated as comments
5075 and will never be exported.  Also entire subtrees starting with the
5076 word @samp{COMMENT} will never be exported.
5078 @table @kbd
5079 @kindex C-c ;
5080 @item C-c ;
5081 Toggle the COMMENT keyword at the beginning of an entry.
5082 @end table
5084 @node Initial text, Enhancing text, Comment lines, Text interpretation
5085 @subsection Text before the first headline
5087 Org-mode normally ignores any text before the first headline when
5088 exporting, because this region is often used for internal links to speed
5089 up navigation etc.  However, there are occasions when you might want to
5090 have some text before the first headline, like a small intorduction,
5091 special HTML code with a navigation bar, etc.  You can ask to have this
5092 part of the file exported as well by setting the variable
5093 @code{org-export-skip-text-before-1st-heading} to @code{nil}.  On a
5094 per-file basis, you can get the same effect with
5096 @example
5097 #+OPTIONS: skip:nil
5098 @end example
5100 The text before the first headline will be fully processed
5101 (@pxref{Enhancing text}).  If you need to include literal HTML, use the
5102 special constructs described in @ref{Quoting HTML tags}.  The table of
5103 contents is normally inserted directly before the first headline of the
5104 file.  If you would like to get it to a different location, insert
5105 the string @code{[TABLE-OF-CONTENTS]} on a line by itself at the desired
5106 location.
5108 Finally, if you want to use the space before the first headline for
5109 internal purposes, but @emph{still} want to place something before the
5110 first headline when exporting the file, you can use the @code{#+TEXT}
5111 construct:
5113 @example
5114 #+OPTIONS: skip:t
5115 #+TEXT: This text will go before the *first* headline.
5116 #+TEXT: We place the table of contents here:
5117 #+TEXT: [TABLE-OF-CONTENTS]
5118 #+TEXT: This goes between the table of contents and the first headline
5119 @end example
5121 @node Enhancing text, Export options, Initial text, Text interpretation
5122 @subsection Enhancing text for export
5123 @cindex enhancing text
5124 @cindex richer text
5126 Some of the export backends of Org-mode allow for sophisticated text
5127 formatting, this is true in particular for the HTML backend.  Org-mode
5128 has a number of typing conventions that allow to produce a richly
5129 formatted output.
5131 @itemize @bullet
5133 @cindex hand-formatted lists
5134 @cindex lists, hand-formatted
5135 @item
5136 Plain lists @samp{-}, @samp{*} or @samp{+} as bullet, or with @samp{1.}
5137 or @samp{2)} as enumerator will be recognized and transformed if the
5138 backend supports lists.  See @xref{Plain lists}.
5140 @cindex underlined text
5141 @cindex bold text
5142 @cindex italic text
5143 @item
5144 You can make words @b{*bold*}, @i{/italic/}, _underlined_,
5145 @code{=code=}, and @samp{+strikethrough+}.
5147 @cindex horizontal rules, in exported files
5148 @item
5149 A line consisting of only dashes, and at least 5 of them, will be
5150 exported as a horizontal line (@samp{<hr/>} in HTML).
5152 @cindex LaTeX fragments, export
5153 @cindex TeX macros, export
5154 @item
5155 Many @TeX{} macros and entire La@TeX{} fragments are converted into HTML
5156 entities or images (@pxref{Embedded LaTeX}).
5158 @cindex tables, export
5159 @item
5160 Tables are transformed into native tables under the exporter, if the
5161 export backend supports this. Data fields before the first horizontal
5162 separator line will be formatted as table header fields.
5164 @cindex fixed width
5165 @item
5166 If a headline starts with the word @samp{QUOTE}, the text below the
5167 headline will be typeset as fixed-width, to allow quoting of computer
5168 codes etc.  Lines starting with @samp{:} are also typeset in
5169 fixed-width font.
5170 @table @kbd
5171 @kindex C-c :
5172 @item C-c :
5173 Toggle fixed-width for entry (QUOTE) or region, see below.
5174 @end table
5176 @cindex linebreak, forced
5177 @item 
5178 A double backslash @emph{at the end of a line} enforces a line break at
5179 this position.
5180 @end itemize
5182 If these conversions conflict with your habits of typing ASCII text,
5183 they can all be turned off with corresponding variables.  See the
5184 customization group @code{org-export-general}, and the following section
5185 which explains how to set export options with special lines in a
5186 buffer.
5189 @node Export options,  , Enhancing text, Text interpretation
5190 @subsection Export options
5191 @cindex options, for export
5193 @cindex completion, of option keywords
5194 The exporter recognizes special lines in the buffer which provide
5195 additional information.  These lines may be put anywhere in the file.
5196 The whole set of lines can be inserted into the buffer with @kbd{C-c
5197 C-e t}.  For individual lines, a good way to make sure the keyword is
5198 correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
5199 (@pxref{Completion}).
5201 @table @kbd
5202 @kindex C-c C-e t
5203 @item C-c C-e t
5204 Insert template with export options, see example below.
5205 @end table
5207 @example
5208 #+TITLE:     the title to be shown (default is the buffer name)
5209 #+AUTHOR:    the author (default taken from @code{user-full-name})
5210 #+EMAIL:     his/her email address (default from @code{user-mail-address})
5211 #+LANGUAGE:  language for HTML, e.g. @samp{en} (@code{org-export-default-language})
5212 #+TEXT:      Some descriptive text to be inserted at the beginning.
5213 #+TEXT:      Several lines may be given.
5214 #+OPTIONS:   H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t *:nil TeX:t LaTeX:t skip:t
5215 @end example
5217 @noindent
5218 The OPTIONS line is a compact form to specify export settings.  Here
5219 you can:
5220 @cindex headline levels
5221 @cindex section-numbers
5222 @cindex table of contents
5223 @cindex linebreak preservation
5224 @cindex quoted HTML tags
5225 @cindex fixed-width sections
5226 @cindex tables
5227 @cindex @TeX{}-like syntax for sub- and superscripts
5228 @cindex emphasized text
5229 @cindex @TeX{} macros
5230 @cindex La@TeX{} fragments
5231 @example
5232 H:      @r{set the number of headline levels for export}
5233 num:    @r{turn on/off section-numbers}
5234 toc:    @r{turn on/off table of contents, or set level limit (integer)}
5235 \n:     @r{turn on/off linebreak-preservation}
5236 @@:      @r{turn on/off quoted HTML tags}
5237 ::      @r{turn on/off fixed-width sections}
5238 |:      @r{turn on/off tables}
5239 ^:      @r{turn on/off @TeX{}-like syntax for sub- and superscripts.  If}
5240         @r{you write "^:@{@}", @code{a_@{b@}} will be interpreted, but}
5241         @r{the simple @code{a_b} will be left as it is.}
5242 *:      @r{turn on/off emphasized text (bold, italic, underlined)}
5243 TeX:    @r{turn on/off simple @TeX{} macros in plain text}
5244 LaTeX:  @r{turn on/off La@TeX{} fragments}
5245 skip:   @r{turn on/off skipping the text before the first heading}
5246 @end example
5248 @node Publishing, Miscellaneous, Exporting, Top
5249 @chapter Publishing
5250 @cindex publishing
5252 Org-mode includes@footnote{@file{org-publish.el} is not yet part of
5253 Emacs, so if you are using @file{org.el} as it comes with Emacs, you
5254 need to download this file separately.  Also make sure org.el is at
5255 least version 4.27.} a publishing management system
5256 that allows you to configure automatic HTML conversion of
5257 @emph{projects} composed of interlinked org files.  This system is
5258 called @emph{org-publish}.  You can also configure org-publish to
5259 automatically upload your exported HTML pages and related attachments,
5260 such as images and source code files, to a web server.  Org-publish turns
5261 org-mode into a web-site authoring tool.
5263 Org-publish has been contributed to Org-mode by David O'Toole.
5265 @menu
5266 * Configuration::               Defining projects
5267 * Sample configuration::        Example projects
5268 * Triggering publication::      Publication commands
5269 @end menu
5271 @node Configuration, Sample configuration, Publishing, Publishing
5272 @section Configuration
5274 Publishing needs significant configuration to specify files, destination
5275 and many other properties of a project.
5277 @menu
5278 * Project alist::               The central configuration variable
5279 * Sources and destinations::    From here to there
5280 * Selecting files::             What files are part of the project?
5281 * Publishing action::           Setting the function doing the publishing
5282 * Publishing options::          Tweaking HTML export
5283 * Publishing links::            Which links keep working after publishing?
5284 * Project page index::          Publishing a list of project files
5285 @end menu
5287 @node Project alist, Sources and destinations, Configuration, Configuration
5288 @subsection The variable @code{org-publish-project-alist}
5289 @cindex org-publish-project-alist
5290 @cindex projects, for publishing
5292 Org-publish is configured almost entirely through setting the value of
5293 one variable, called @code{org-publish-project-alist}.
5294 Each element of the list configures one project, and may be in one of
5295 the two following forms:
5297 @lisp
5298 ("project-name"  :property value :property value ...)
5300 @r{or} 
5302 ("project-name"  :components ("project-name" "project-name" ...))
5304 @end lisp
5306 In both cases, projects are configured by specifying property values.
5307 A project defines the set of files that will be published, as well as
5308 the publishing configuration to use when publishing those files.  When
5309 a project takes the second form listed above, the individual members
5310 of the ``components'' property are taken to be components of the
5311 project, which group together files requiring different publishing
5312 options. When you publish such a ``meta-project'' all the components
5313 will also publish.
5315 @node Sources and destinations, Selecting files, Project alist, Configuration
5316 @subsection Sources and destinations for files
5317 @cindex directories, for publishing
5319 Most properties are optional, but some should always be set. In
5320 particular, org-publish needs to know where to look for source files,
5321 and where to put published files.
5323 @multitable @columnfractions 0.3 0.7
5324 @item @code{:base-directory}
5325 @tab Directory containing publishing source files
5326 @item @code{:publishing-directory}
5327 @tab Directory (possibly remote) where output files will be published.
5328 @item @code{:preparation-function}
5329 @tab Function called before starting publishing process, for example to
5330 run @code{make} for updating files to be published.
5331 @end multitable
5332 @noindent
5334 @node Selecting files, Publishing action, Sources and destinations, Configuration
5335 @subsection Selecting files
5336 @cindex files, selecting for publishing
5338 By default, all files with extension @file{.org} in the base directory
5339 are considered part of the project.  This can be modified by setting the
5340 properties 
5341 @multitable @columnfractions 0.25 0.75
5342 @item @code{:base-extension}
5343 @tab Extension (without the dot!) of source files.  This actually is a
5344 regular expression.
5346 @item @code{:exclude} 
5347 @tab Regular expression to match file names that should not be
5348 published, even though they have been selected on the basis of their
5349 extension.
5351 @item @code{:include}
5352 @tab List of files to be included regardless of @code{:base-extension}
5353 and @code{:exclude}.
5354 @end multitable
5356 @node Publishing action, Publishing options, Selecting files, Configuration
5357 @subsection Publishing Action
5358 @cindex action, for publishing
5360 Publishing means that a file is copied to the destination directory and
5361 possibly transformed in the process.  The default transformation is to
5362 export Org-mode files as HTML files, and this is done by the function
5363 @code{org-publish-org-to-html} which calls the HTML exporter
5364 (@pxref{HTML export}).  Other files like images only need to be copied
5365 to the publishing destination.  For non-Org-mode files, you need to
5366 specify the publishing function.
5368 @multitable @columnfractions 0.3 0.7
5369 @item @code{:publishing-function}
5370 @tab Function executing the publication of a file.  This may also be a
5371 list of functions, which will all be called in turn.
5372 @end multitable
5374 The function must accept two arguments: a property list containing at
5375 least a @code{:publishing-directory} property, and the name of the file
5376 to be published.  It should take the specified file, make the necessary
5377 transformation (if any) and place the result into the destination folder.
5378 You can write your own publishing function, but @code{org-publish}
5379 provides one for attachments (files that only need to be copied):
5380 @code{org-publish-attachment}.
5382 @node Publishing options, Publishing links, Publishing action, Configuration
5383 @subsection Options for the HTML exporter
5384 @cindex options, for publishing
5386 The property list can be used to set many export options for the HTML
5387 exporter.  In most cases, these properties correspond to user variables
5388 in Org-mode.  The table below lists these properties along with the
5389 variable they belong to.  See the documentation string for the
5390 respective variable for details.
5392 @multitable @columnfractions 0.3 0.7
5393 @item @code{:language}              @tab @code{org-export-default-language}
5394 @item @code{:headline-levels}       @tab @code{org-export-headline-levels}
5395 @item @code{:section-numbers}       @tab @code{org-export-with-section-numbers}
5396 @item @code{:table-of-contents}     @tab @code{org-export-with-toc}
5397 @item @code{:archived-trees}        @tab @code{org-export-with-archived-trees}
5398 @item @code{:emphasize}             @tab @code{org-export-with-emphasize}
5399 @item @code{:sub-superscript}       @tab @code{org-export-with-sub-superscripts}
5400 @item @code{:TeX-macros}            @tab @code{org-export-with-TeX-macros}
5401 @item @code{:LaTeX-fragments}       @tab @code{org-export-with-LaTeX-fragments}
5402 @item @code{:fixed-width}           @tab @code{org-export-with-fixed-width}
5403 @item @code{:timestamps}           .@tab @code{org-export-with-timestamps}
5404 @item @code{:tags}                 .@tab @code{org-export-with-tags}
5405 @item @code{:tables}                @tab @code{org-export-with-tables}
5406 @item @code{:table-auto-headline}   @tab @code{org-export-highlight-first-table-line}
5407 @item @code{:style}                 @tab @code{org-export-html-style}
5408 @item @code{:convert-org-links}     @tab @code{org-export-html-link-org-files-as-html}
5409 @item @code{:inline-images}         @tab @code{org-export-html-inline-images}
5410 @item @code{:expand-quoted-html}    @tab @code{org-export-html-expand}
5411 @item @code{:timestamp}             @tab @code{org-export-html-with-timestamp}
5412 @item @code{:publishing-directory}  @tab @code{org-export-publishing-directory}
5413 @item @code{:preamble}              @tab @code{org-export-html-preamble}
5414 @item @code{:postamble}             @tab @code{org-export-html-postamble}
5415 @item @code{:auto-preamble}         @tab @code{org-export-html-auto-preamble}
5416 @item @code{:auto-postamble}        @tab @code{org-export-html-auto-postamble}
5417 @item @code{:author}                @tab @code{user-full-name}
5418 @item @code{:email}                 @tab @code{user-mail-address}
5419 @end multitable
5421 When a property is given a value in org-publish-project-alist, its
5422 setting overrides the value of the corresponding user variable (if any)
5423 during publishing.  options set within a file (@pxref{Export
5424 options}), however, override everything.
5426 @node Publishing links, Project page index, Publishing options, Configuration
5427 @subsection Links between published files
5428 @cindex links, publishing
5430 To create a link from one Org-mode file to another, you would use
5431 something like @samp{[[file:foo.org][The foo]]} or simply
5432 @samp{file:foo.org.} (@pxref{Hyperlinks}).  Upon publishing this link
5433 becomes a link to @file{foo.html}.  In this way, you can interlink the
5434 pages of your "org web" project and the links will work as expected when
5435 you publish them to HTML.
5437 You may also link to related files, such as images. Provided you are
5438 careful with relative pathnames, and provided you have also configured
5439 org-publish to upload the related files, these links will work
5440 too. @ref{Complex example} for an example of this usage.
5442 Sometime an Org-mode file to be published may contain links that are
5443 only valid in your production environment, but not in the publishing
5444 location.  In this case, use the property 
5446 @multitable @columnfractions 0.4 0.6
5447 @item @code{:link-validation-function}
5448 @tab Function to validate links
5449 @end multitable
5451 @noindent
5452 to define a function for checking link validity.  This function must
5453 accept two arguments, the file name and a directory relative to which
5454 the file name is interpreted in the production environment.  If this
5455 function returns @code{nil}, then the HTML generator will only insert a
5456 description into the HTML file, but no link.  One option for this
5457 function is @code{org-publish-validate-link} which checks if the given
5458 file is part of any project in @code{org-publish-project-alist}.
5460 @node Project page index,  , Publishing links, Configuration
5461 @subsection Project page index
5462 @cindex index, of published pages
5464 The following properties may be used to control publishing of an
5465 index of files or summary page for a given project.
5467 @multitable @columnfractions 0.25 0.75
5468 @item @code{:auto-index}
5469 @tab When non-nil, publish an index during org-publish-current-project or
5470 org-publish-all.
5472 @item @code{:index-filename}
5473 @tab Filename for output of index. Defaults to @file{index.org} (which
5474 becomes @file{index.html}).
5476 @item @code{:index-title}
5477 @tab Title of index page. Defaults to name of file.
5479 @item @code{:index-function}
5480 @tab Plugin function to use for generation of index.
5481 Defaults to @code{org-publish-org-index}, which generates a plain list
5482 of links to all files in the project.
5483 @end multitable
5485 @node Sample configuration, Triggering publication, Configuration, Publishing
5486 @section Sample configuration
5488 Below we provide two example configurations.  The first one is a simple
5489 project publishing only a set of Org-mode files.  The second example is
5490 more complex, with a multi-component project.
5492 @menu
5493 * Simple example::              One-component publishing
5494 * Complex example::             A multi-component publishing example
5495 @end menu
5497 @node Simple example, Complex example, Sample configuration, Sample configuration
5498 @subsection Example: simple publishing configuration
5500 This example publishes a set of Org-mode files to the @file{public_html}
5501 directory on the local machine.
5503 @lisp
5504 (setq org-publish-project-alist
5505       '(("org" 
5506          :base-directory "~/org/"
5507          :publishing-directory "~/public_html"
5508          :section-numbers nil
5509          :table-of-contents nil
5510          :style "<link rel=stylesheet 
5511                 href=\"../other/mystyle.css\"
5512                 type=\"text/css\">")))
5513 @end lisp
5515 @node Complex example,  , Simple example, Sample configuration
5516 @subsection Example: complex publishing configuration
5518 This more complicated example publishes an entire website, including
5519 org files converted to HTML, image files, emacs lisp source code, and
5520 stylesheets. The publishing-directory is remote and private files are
5521 excluded.
5523 To ensure that links are preserved, care should be taken to replicate
5524 your directory structure on the web server, and to use relative file
5525 paths. For example, if your org files are kept in @file{~/org} and your
5526 publishable images in @file{~/images}, you'd link to an image with
5528 @example
5529 file:../images/myimage.png
5530 @end example
5532 On the web server, the relative path to the image should be the
5533 same. You can accomplish this by setting up an "images" folder in the
5534 right place on the webserver, and publishing images to it.
5536 @lisp
5537 (setq org-publish-project-alist
5538       '(("orgfiles"
5539           :base-directory "~/org/"
5540           :base-extension "org"
5541           :publishing-directory "/ssh:user@@host:~/html/notebook/"
5542           :publishing-function org-publish-org-to-html
5543           :exclude "PrivatePage.org"   ;; regexp
5544           :headline-levels 3
5545           :section-numbers nil
5546           :table-of-contents nil
5547           :style "<link rel=stylesheet 
5548                   href=\"../other/mystyle.css\" type=\"text/css\">"
5549           :auto-preamble t
5550           :auto-postamble nil)
5551          
5552          ("images"
5553           :base-directory "~/images/"
5554           :base-extension "jpg\\|gif\\|png"
5555           :publishing-directory "/ssh:user@@host:~/html/images/"
5556           :publishing-function org-publish-attachment)
5558          ("other"
5559           :base-directory "~/other/"
5560           :base-extension "css\\|el"
5561           :publishing-directory "/ssh:user@@host:~/html/other/"
5562           :publishing-function org-publish-attachment)
5563          ("website" :components ("orgfiles" "images" "other"))))
5564 @end lisp
5566 @node Triggering publication,  , Sample configuration, Publishing
5567 @section Triggering publication
5569 Once org-publish is properly configured, you can publish with the
5570 following functions: 
5572 @table @kbd
5573 @item C-c C-e c
5574 Prompt for a specific project and publish all files that belong to it.
5575 @item C-c C-e p
5576 Publish the project containing the current file.
5577 @item C-c C-e f
5578 Publish only the current file.
5579 @item C-c C-e a
5580 Publish all projects.
5581 @end table
5583 Org uses timestamps to track when a file has changed. The above
5584 functions normally only publish changed files. You can override this and
5585 force publishing of all files by giving a prefix argument.
5587 @node Miscellaneous, Extensions and Hacking, Publishing, Top
5588 @chapter Miscellaneous
5590 @menu
5591 * Completion::                  M-TAB knows what you need
5592 * Customization::               Adapting Org-mode to your taste
5593 * In-buffer settings::          Overview of the #+KEYWORDS
5594 * The very busy C-c C-c key::   When in doubt, press C-c C-c
5595 * Clean view::                  Getting rid of leading stars in the outline
5596 * TTY keys::                    Using Org-mode on a tty
5597 * Interaction::                 Other Emacs packages
5598 * Bugs::                        Things which do not work perfectly
5599 @end menu
5601 @node Completion, Customization, Miscellaneous, Miscellaneous
5602 @section Completion
5603 @cindex completion, of @TeX{} symbols
5604 @cindex completion, of TODO keywords
5605 @cindex completion, of dictionary words
5606 @cindex completion, of option keywords
5607 @cindex completion, of tags
5608 @cindex completion, of link abbreviations
5609 @cindex @TeX{} symbol completion
5610 @cindex TODO keywords completion
5611 @cindex dictionary word completion
5612 @cindex option keyword completion
5613 @cindex tag completion
5614 @cindex link abbreviations, completion of
5616 Org-mode supports in-buffer completion.  This type of completion does
5617 not make use of the minibuffer.  You simply type a few letters into
5618 the buffer and use the key to complete text right there.
5620 @table @kbd
5621 @kindex M-@key{TAB}
5622 @item M-@key{TAB}
5623 Complete word at point
5624 @itemize @bullet
5625 @item
5626 At the beginning of a headline, complete TODO keywords.
5627 @item
5628 After @samp{\}, complete @TeX{} symbols supported by the exporter.
5629 @item
5630 After @samp{*}, complete headlines in the current buffer so that they
5631 can be used in search links like @samp{[[*find this headline]]}.
5632 @item
5633 After @samp{:}, complete tags.  The list of tags is taken from the
5634 variable @code{org-tag-alist} (possibly set through the @samp{#+TAGS}
5635 in-buffer option, @pxref{Setting tags}), or it is created dynamically
5636 from all tags used in the current buffer.
5637 @item
5638 After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}).
5639 @item
5640 After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
5641 @samp{OPTIONS} which set file-specific options for Org-mode.  When the
5642 option keyword is already complete, pressing @kbd{M-@key{TAB}} again
5643 will insert example settings for this keyword.
5644 @item
5645 In the line after @samp{#+STARTUP: }, complete startup keywords,
5646 i.e. valid keys for this line.
5647 @item
5648 Elsewhere, complete dictionary words using ispell.
5649 @end itemize
5650 @end table
5652 @node Customization, In-buffer settings, Completion, Miscellaneous
5653 @section Customization
5654 @cindex customization
5655 @cindex options, for customization
5656 @cindex variables, for customization
5658 There are more than 180 variables that can be used to customize
5659 Org-mode.  For the sake of compactness of the manual, I am not
5660 describing the variables here.  A structured overview of customization
5661 variables is available with @kbd{M-x org-customize}.  Or select
5662 @code{Browse Org Group} from the @code{Org->Customization} menu.  Many
5663 settings can also be activated on a per-file basis, by putting special
5664 lines into the buffer (@pxref{In-buffer settings}).
5666 @node In-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
5667 @section Summary of in-buffer settings
5668 @cindex in-buffer settings
5669 @cindex special keywords
5671 Org-mode uses special lines in the buffer to define settings on a
5672 per-file basis.  These lines start with a @samp{#+} followed by a
5673 keyword, a colon, and then individual words defining a setting.  Several
5674 setting words can be in the same line, but you can also have multiple
5675 lines for the keyword.  While these settings are described throughout
5676 the manual, here is a summary.  After changing any of those lines in the
5677 buffer, press @kbd{C-c C-c} with the cursor still in the line to
5678 activate the changes immediately.  Otherwise they become effective only
5679 when the file is visited again in a new Emacs session.
5681 @table @kbd
5682 @item #+STARTUP:
5683 This line sets options to be used at startup of org-mode, when an
5684 Org-mode file is being visited.  The first set of options deals with the
5685 initial visibility of the outline tree.  The corresponding variable for
5686 global default settings is @code{org-startup-folded}, with a default
5687 value @code{t}, which means @code{overview}.
5688 @cindex @code{overview}, STARTUP keyword
5689 @cindex @code{content}, STARTUP keyword
5690 @cindex @code{showall}, STARTUP keyword
5691 @example
5692 overview   @r{top-level headlines only}
5693 content    @r{all headlines}
5694 showall    @r{no folding at all, show everything}
5695 @end example
5696 Then there are options for aligning tables upon visiting a file.  This
5697 is useful in files containing narrowed table columns.  The corresponding
5698 variable is @code{org-startup-align-all-tables}, with a default value
5699 @code{nil}. 
5700 @cindex @code{align}, STARTUP keyword
5701 @cindex @code{noalign}, STARTUP keyword
5702 @example
5703 align      @r{align all tables}
5704 noalign    @r{don't align tables on startup}
5705 @end example
5706 Logging TODO state changes and clock intervals (variable
5707 @code{org-log-done}) can be configured using these options.
5708 @cindex @code{logdone}, STARTUP keyword
5709 @cindex @code{nologging}, STARTUP keyword
5710 @cindex @code{lognotedone}, STARTUP keyword
5711 @cindex @code{lognoteclock-out}, STARTUP keyword
5712 @cindex @code{lognotestate}, STARTUP keyword
5713 @example
5714 logging          @r{record a timestamp when an item is marked DONE}
5715 nologging        @r{don't record when items are marked DONE}
5716 lognotedone      @r{record timestamp and a note when DONE}
5717 lognotestate     @r{record timestamp, note when TODO state changes}
5718 lognoteclock-out @r{record timestamp and a note when clocking out}
5719 @end example
5720 Here are the options for hiding leading stars in outline headings.  The
5721 corresponding variables are @code{org-hide-leading-stars} and
5722 @code{org-odd-levels-only}, both with a default setting @code{nil}
5723 (meaning @code{showstars} and @code{oddeven}).
5724 @cindex @code{hidestars}, STARTUP keyword
5725 @cindex @code{showstars}, STARTUP keyword
5726 @cindex @code{odd}, STARTUP keyword
5727 @cindex @code{even}, STARTUP keyword
5728 @example
5729 hidestars  @r{make all but one of the stars starting a headline invisible.}
5730 showstars  @r{show all stars starting a headline}
5731 odd        @r{allow only odd outline levels (1,3,...)}
5732 oddeven    @r{allow all outline levels}
5733 @end example
5734 To turn on custom format overlays over time stamps (variables
5735 @code{org-put-time-stamp-overlays} and
5736 @code{org-time-stamp-overlay-formats}), use
5737 @cindex @code{customtime}, STARTUP keyword
5738 @example
5739 customtime @r{overlay custom time format}
5740 @end example
5741 The following options influence the table spreadsheet (variable
5742 @code{constants-unit-system}).
5743 @cindex @code{constcgs}, STARTUP keyword
5744 @cindex @code{constSI}, STARTUP keyword
5745 @example
5746 constcgs   @r{@file{constants.el} should use the c-g-s unit system}
5747 constSI    @r{@file{constants.el} should use the SI unit system}
5748 @end example
5749 @item #+SEQ_TODO:   #+TYP_TODO:
5750 These lines set the TODO keywords and their interpretation in the
5751 current file.  The corresponding variables are @code{org-todo-keywords}
5752 and @code{org-todo-interpretation}.
5753 @item #+TAGS:  TAG1(c1) TAG2(c2)
5754 These lines (several such lines are allowed) specify the legal tags in
5755 this file, and (potentially) the corresponding @emph{fast tag selection}
5756 keys.  The corresponding variable is @code{org-tag-alist}.
5757 @item #+LINK:  linkword replace
5758 These lines (several are allowed) specify link abbreviations.
5759 @xref{Link abbreviations}.  The corresponding variable is
5760 @code{org-link-abbrev-alist}.
5761 @item #+CATEGORY:
5762 This line sets the category for the agenda file.  The category applies
5763 for all subsequent lines until the next @samp{#+CATEGORY} line, or the
5764 end of the file.  The first such line also applies to any entries before it.
5765 @item #+ARCHIVE: %s_done::
5766 This line sets the archive location for the agenda file.  It applies for
5767 all subsequent lines until the next @samp{#+CATEGORY} line, or the end
5768 of the file.  The first such line also applies to any entries before it.
5769 The corresponding variable is @code{org-archive-location}.
5770 @item #+TBLFM:
5771 This line contains the formulas for the table directly above the line.
5772 @item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS:
5773 These lines provide settings for exporting files.  For more details see
5774 @ref{Export options}.
5775 @end table
5777 @node The very busy C-c C-c key, Clean view, In-buffer settings, Miscellaneous
5778 @section The very busy C-c C-c key
5779 @kindex C-c C-c
5780 @cindex C-c C-c, overview
5782 The key @kbd{C-c C-c} has many purposes in org-mode, which are all
5783 mentioned scattered throughout this manual.  One specific function of
5784 this key is to add @emph{tags} to a headline (@pxref{Tags}).  In many
5785 other circumstances it means something like @emph{Hey Org-mode, look
5786 here and update according to what you see here}.  Here is a summary of
5787 what this means in different contexts.
5789 @itemize @minus
5790 @item
5791 If there are highlights in the buffer from the creation of a sparse
5792 tree, or from clock display, remove these highlights.
5793 @item
5794 If the cursor is in one of the special @code{#+KEYWORD} lines, this
5795 triggers scanning the buffer for these lines and updating the
5796 information. 
5797 @item
5798 If the cursor is inside a table, realign the table.  This command
5799 works even if the automatic table editor has been turned off.
5800 @item
5801 If the cursor is on a @code{#+TBLFM} line, re-apply the formulas to
5802 the entire table.
5803 @item
5804 If the cursor is inside a table created by the @file{table.el} package,
5805 activate that table.
5806 @item
5807 If the current buffer is a remember buffer, close the note and file it.
5808 With a prefix argument, file it, without further interaction, to the
5809 default location.
5810 @item
5811 If the cursor is on a @code{<<<target>>>}, update radio targets and
5812 corresponding links in this buffer.
5813 @item
5814 If the cursor is in a plain list item with a checkbox, toggle the status
5815 of the checkbox.
5816 @item
5817 If the cursor is on a numbered item in a plain list, renumber the
5818 ordered list.
5819 @end itemize
5821 @node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous
5822 @section A cleaner outline view
5823 @cindex hiding leading stars
5824 @cindex clean outline view
5826 Some people find it noisy and distracting that the Org-mode headlines
5827 are starting with a potentially large number of stars.  For example
5828 the tree from @ref{Headlines}:
5830 @example
5831 * Top level headline
5832 ** Second level
5833 *** 3rd level
5834     some text
5835 *** 3rd level
5836     more text
5837 * Another top level headline
5838 @end example
5840 @noindent
5841 Unfortunately this is deeply ingrained into the code of Org-mode and
5842 cannot be easily changed.  You can, however, modify the display in such
5843 a way that all leading stars become invisible and the outline more easy
5844 to read.  To do this, customize the variable
5845 @code{org-hide-leading-stars} like this:
5847 @lisp
5848 (setq org-hide-leading-stars t)
5849 @end lisp
5851 @noindent
5852 or change this on a per-file basis with one of the lines (anywhere in
5853 the buffer)
5855 @example
5856 #+STARTUP: showstars
5857 #+STARTUP: hidestars
5858 @end example
5860 @noindent
5861 Press @kbd{C-c C-c} with the cursor in a @samp{STARTUP} line to activate
5862 the modifications.
5864 With stars hidden, the tree becomes:
5866 @example
5867 * Top level headline
5868  * Second level
5869   * 3rd level
5870     some text
5871   * 3rd level
5872     more text
5873 * Another top level headline
5874 @end example
5876 @noindent
5877 Note that the leading stars are not truly replaced by whitespace, they
5878 are only fontified with the face @code{org-hide} that uses the
5879 background color as font color.  If you are not using either white or
5880 black background, you may have to customize this face to get the wanted
5881 effect.  Another possibility is to set this font such that the extra
5882 stars are @i{almost} invisible, for example using the color
5883 @code{grey90} on a white background.
5885 Things become cleaner still if you skip all the even levels and use only
5886 odd levels 1, 3, 5..., effectively adding two stars to go from one
5887 outline level to the next:
5889 @example
5890 * Top level headline
5891   * Second level
5892     * 3rd level
5893       some text
5894     * 3rd level
5895       more text
5896 * Another top level headline
5897 @end example
5899 @noindent
5900 In order to make the structure editing and export commands handle this
5901 convention correctly, use
5903 @lisp
5904 (setq org-odd-levels-only t)
5905 @end lisp
5907 @noindent
5908 or set this on a per-file basis with one of the following lines (don't
5909 forget to press @kbd{C-c C-c} with the cursor in the startup line to
5910 activate changes immediately).
5912 @example
5913 #+STARTUP: odd
5914 #+STARTUP: oddeven
5915 @end example
5917 You can convert an Org-mode file from single-star-per-level to the
5918 double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
5919 RET} in that file.  The reverse operation is @kbd{M-x
5920 org-convert-to-oddeven-levels}.
5922 @node TTY keys, Interaction, Clean view, Miscellaneous
5923 @section Using org-mode on a tty
5924 @cindex tty keybindings
5926 Org-mode uses a number of keys that are not accessible on a tty.  This
5927 applies to most special keys like cursor keys, @key{TAB} and
5928 @key{RET}, when these are combined with modifier keys like @key{Meta}
5929 and/or @key{Shift}.  Org-mode uses these bindings because it needs to
5930 provide keys for a large number of commands, and because these keys
5931 appeared particularly easy to remember.  In order to still be able to
5932 access the core functionality of Org-mode on a tty, alternative
5933 bindings are provided.  Here is a complete list of these bindings,
5934 which are obviously more cumbersome to use.  Note that sometimes a
5935 work-around can be better.  For example changing a time stamp is
5936 really only fun with @kbd{S-@key{cursor}} keys.  On a tty you would
5937 rather use @kbd{C-c .}  to re-insert the timestamp.
5939 @multitable @columnfractions 0.15 0.2 0.2
5940 @item @b{Default} @tab @b{Alternative 1} @tab @b{Alternative 2}
5941 @item @kbd{S-@key{TAB}}     @tab @kbd{C-u @key{TAB}}       @tab
5942 @item @kbd{M-@key{left}}    @tab @kbd{C-c C-x l}           @tab @kbd{@key{Esc} @key{left}}
5943 @item @kbd{M-S-@key{left}}  @tab @kbd{C-c C-x L}           @tab
5944 @item @kbd{M-@key{right}}   @tab @kbd{C-c C-x r}           @tab @kbd{@key{Esc} @key{right}}
5945 @item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R}           @tab
5946 @item @kbd{M-@key{up}}      @tab @kbd{C-c C-x u}           @tab @kbd{@key{Esc} @key{up}}
5947 @item @kbd{M-S-@key{up}}    @tab @kbd{C-c C-x U}           @tab
5948 @item @kbd{M-@key{down}}    @tab @kbd{C-c C-x d}           @tab @kbd{@key{Esc} @key{down}}
5949 @item @kbd{M-S-@key{down}}  @tab @kbd{C-c C-x D}           @tab
5950 @item @kbd{S-@key{RET}}     @tab @kbd{C-c C-x c}           @tab
5951 @item @kbd{M-@key{RET}}     @tab @kbd{C-c C-x m}           @tab @kbd{@key{Esc} @key{RET}}
5952 @item @kbd{M-S-@key{RET}}   @tab @kbd{C-c C-x M}           @tab
5953 @item @kbd{S-@key{left}}    @tab @kbd{C-c C-x @key{left}}  @tab
5954 @item @kbd{S-@key{right}}   @tab @kbd{C-c C-x @key{right}} @tab
5955 @item @kbd{S-@key{up}}      @tab @kbd{C-c C-x @key{up}}    @tab
5956 @item @kbd{S-@key{down}}    @tab @kbd{C-c C-x @key{down}}  @tab
5957 @end multitable
5959 @node Interaction, Bugs, TTY keys, Miscellaneous
5960 @section Interaction with other packages
5961 @cindex packages, interaction with other
5962 Org-mode lives in the world of GNU Emacs and interacts in various ways
5963 with other code out there.
5965 @menu
5966 * Cooperation::                 Packages Org-mode cooperates with
5967 * Conflicts::                   Packages that lead to conflicts
5968 @end menu
5970 @node Cooperation, Conflicts, Interaction, Interaction
5971 @subsection Packages that Org-mode cooperates with
5973 @table @asis
5974 @cindex @file{calc.el}
5975 @item @file{calc.el} by Dave Gillespie
5976 Org-mode uses the calc package for implementing spreadsheet
5977 functionality in its tables (@pxref{The spreadsheet}).  Org-mode
5978 checks for the availability of calc by looking for the function
5979 @code{calc-eval} which should be autoloaded in your setup if calc has
5980 been installed properly.  As of Emacs 22, calc is part of the Emacs
5981 distribution.  Another possibility for interaction between the two
5982 packages is using calc for embedded calculations. @xref{Embedded Mode,
5983 , Embedded Mode, calc, GNU Emacs Calc Manual}.
5984 @cindex @file{constants.el}
5985 @item @file{constants.el} by Carsten Dominik
5986 In a table formula (@pxref{The spreadsheet}), it is possible to use
5987 names for natural constants or units.  Instead of defining your own
5988 constants in the variable @code{org-table-formula-constants}, install
5989 the @file{constants} package which defines a large number of constants
5990 and units, and lets you use unit prefixes like @samp{M} for
5991 @samp{Mega} etc.  You will need version 2.0 of this package, available
5992 at @url{http://www.astro.uva.nl/~dominik/Tools}. Org-mode checks for
5993 the function @code{constants-get}, which has to be autoloaded in your
5994 setup.  See the installation instructions in the file
5995 @file{constants.el}.
5996 @item @file{cdlatex.el} by Carsten Dominik
5997 @cindex @file{cdlatex.el}
5998 Org-mode can make use of the cdlatex package to efficiently enter
5999 La@TeX{} fragments into Org-mode files. See @ref{CDLaTeX mode}.
6000 @item @file{remember.el} by John Wiegley
6001 @cindex @file{remember.el}
6002 Org mode cooperates with remember, see @ref{Remember}.
6003 @file{Remember.el} is not part of Emacs, find it on the web.
6004 @cindex @file{table.el}
6005 @item @file{table.el} by Takaaki Ota
6006 @kindex C-c C-c
6007 @cindex table editor, @file{table.el}
6008 @cindex @file{table.el}
6010 Complex ASCII tables with automatic line wrapping, column- and
6011 row-spanning, and alignment can be created using the Emacs table
6012 package by Takaaki Ota (@uref{http://sourceforge.net/projects/table},
6013 and also part of Emacs 22).
6014 When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org-mode
6015 will call @command{table-recognize-table} and move the cursor into the
6016 table.  Inside a table, the keymap of Org-mode is inactive.  In order
6017 to execute Org-mode-related commands, leave the table.
6019 @table @kbd
6020 @kindex C-c C-c
6021 @item C-c C-c
6022 Recognize @file{table.el} table.  Works when the cursor is in a
6023 table.el table.
6025 @kindex C-c ~
6026 @item C-c ~
6027 Insert a table.el table.  If there is already a table at point, this
6028 command converts it between the table.el format and the Org-mode
6029 format.  See the documentation string of the command
6030 @code{org-convert-table} for the restrictions under which this is
6031 possible.
6032 @end table
6033 @file{table.el} is part of Emacs 22.
6034 @end table
6036 @node Conflicts,  , Cooperation, Interaction
6037 @subsection Packages that lead to conflicts with Org-mode
6039 @table @asis
6041 @cindex @file{allout.el}
6042 @item @file{allout.el} by Ken Manheimer
6043 Startup of Org-mode may fail with the error message
6044 @code{(wrong-type-argument keymapp nil)} when there is an outdated
6045 version @file{allout.el} on the load path, for example the version
6046 distributed with Emacs 21.x.  Upgrade to Emacs 22 and this problem will
6047 disappear.  If for some reason you cannot do this, make sure that org.el
6048 is loaded @emph{before} @file{allout.el}, for example by putting
6049 @code{(require 'org)} early enough into your @file{.emacs} file.
6051 @cindex @file{CUA.el}
6052 @item @file{CUA.el} by Kim. F. Storm
6053 Keybindings in Org-mode conflict with the @kbd{S-<cursor>} keys
6054 used by CUA-mode (as well as pc-select-mode and s-region-mode) to
6055 select and extend the region.  If you want to use one of these
6056 packages along with Org-mode, configure the variable
6057 @code{org-CUA-compatible}.  When set, Org-mode will move the following
6058 keybindings in org-mode files, and in the agenda buffer (but not
6059 during date selection).
6061 @example
6062 S-UP    -> M-p             S-DOWN  -> M-n
6063 S-LEFT  -> M--             S-RIGHT -> M-+
6064 S-RET   -> C-S-RET
6065 @end example
6067 Yes, these are unfortunately more difficult to remember.  If you want
6068 to have other replacement keys, look at the variable
6069 @code{org-disputed-keys}.
6070 @item @file{windmove.el} by Hovav Shacham
6071 @cindex @file{windmove.el}
6072 Also this package uses the @kbd{S-<cursor>} keys, so everything written
6073 in the paragraph above about CUA mode also applies here.
6074 @end table
6077 @node Bugs,  , Interaction, Miscellaneous
6078 @section Bugs
6079 @cindex bugs
6081 Here is a list of things that should work differently, but which I
6082 have found too hard to fix.
6084 @itemize @bullet
6085 @item
6086 If a table field starts with a link, and if the corresponding table
6087 column is narrowed (@pxref{Narrow columns}) to a width too small to
6088 display the link, the field would look entirely empty even though it is
6089 not.  To prevent this, Org-mode throws an error.  The work-around is to
6090 make the column wide enough to fit the link, or to add some text (at
6091 least 2 characters) before the link in the same field.
6092 @item
6093 Narrowing table columns does not work on XEmacs, because the
6094 @code{format} function does not transport text properties.
6095 @item
6096 Text in an entry protected with the @samp{QUOTE} keyword should not
6097 autowrap.
6098 @item
6099 When the application called by @kbd{C-c C-o} to open a file link fails
6100 (for example because the application does not exist or refuses to open
6101 the file), it does so silently.  No error message is displayed.
6102 @item
6103 Recalculating a table line applies the formulas from left to right.
6104 If a formula uses @emph{calculated} fields further down the row,
6105 multiple recalculation may be needed to get all fields consistent.  You
6106 may use the command @code{org-table-iterate} (@kbd{C-u C-c *}) to
6107 recalculate until convergence.
6108 @item
6109 A single letter cannot be made bold, for example @samp{*a*}.
6110 @item
6111 The exporters work well, but could be made more efficient.
6112 @end itemize
6115 @node Extensions and Hacking, History and Acknowledgments, Miscellaneous, Top
6116 @appendix Extensions, Hooks and Hacking
6118 This appendix lists extensions for Org-mode written by other authors.
6119 It also covers some aspects where users can extend the functionality of
6120 Org-mode.
6122 @menu
6123 * Extensions::                  Existing 3rd-part extensions
6124 * Tables in arbitrary syntax::  Orgtbl for LaTeX and other programs
6125 * Dynamic blocks::              Automatically filled blocks
6126 * Special agenda views::        Customized views
6127 @end menu
6129 @node Extensions, Tables in arbitrary syntax, Extensions and Hacking, Extensions and Hacking
6130 @section Third-party extensions for Org-mode
6131 @cindex extension, third-party
6133 The following extensions for Org-mode have been written by other people:
6135 @table @asis
6136 @cindex @file{org-publish.el}
6137 @item @file{org-publish.el} by David O'Toole
6138 This package provides facilities for publishing related sets of Org-mode
6139 files together with linked files like images as webpages.  It is
6140 highly configurable and can be used for other publishing purposes as
6141 well.  As of Org-mode version 4.30, @file{org-publish.el} is part of the
6142 Org-mode distribution.  It is not yet part of Emacs, however, a delay
6143 caused by the preparations for the 22.1 release.  In the mean time,
6144 @file{org-publish.el} can be downloaded from David's site:
6145 @url{http://dto.freeshell.org/e/org-publish.el}.
6146 @cindex @file{org-mouse.el}
6147 @item @file{org-mouse.el} by Piotr Zielinski
6148 This package implements extended mouse functionality for Org-mode.  It
6149 allows you to cycle visibility and to edit the document structure with
6150 the mouse.  Best of all, it provides a context-sensitive menu on
6151 @key{mouse-3} that changes depending on the context of a mouse-click.
6152 As of Org-mode version 4.53, @file{org-mouse.el} is part of the
6153 Org-mode distribution.  It is not yet part of Emacs, however, a delay
6154 caused by the preparations for the 22.1 release.  In the mean time,
6155 @file{org-mouse.el} can be downloaded from Piotr's site:
6156 @url{http://www.cl.cam.ac.uk/~pz215/files/org-mouse.el}.
6157 @cindex @file{org-blog.el}
6158 @item @file{org-blog.el} by David O'Toole
6159 A blogging plug-in for @file{org-publish.el}.@*
6160 @url{http://dto.freeshell.org/notebook/OrgMode.html}.
6161 @cindex @file{blorg.el}
6162 @item @file{blorg.el} by Bastien Guerry
6163 Publish Org-mode files as
6164 blogs. @url{http://www.cognition.ens.fr/~guerry/blorg.html}.
6165 @cindex @file{org2rem.el}
6166 @item @file{org2rem.el} by Bastien Guerry
6167 Translates Org-mode files into something readable by
6168 Remind. @url{http://www.cognition.ens.fr/~guerry/u/org2rem.el}.
6169 @end table
6171 @page
6173 @node Tables in arbitrary syntax, Dynamic blocks, Extensions, Extensions and Hacking
6174 @section Tables in arbitrary syntax
6175 @cindex tables, in other modes
6176 @cindex orgtbl-mode
6178 Since Orgtbl-mode can be used as a minor mode in arbitrary buffers, a
6179 frequent feature request has been to make it work with native tables in
6180 specific languages, for example LaTeX.  However, this is extremely hard
6181 to do in a general way, would lead to a customization nightmare, and
6182 would take away much of the simplicity of the Orgtbl-mode table editor.
6184 This appendix describes a different approach.  We keep the Orgtbl-mode
6185 table in its native format (the @i{source table}), and use a custom
6186 function to @i{translate} the table to the correct syntax, and to
6187 @i{install} it in the right location (the @i{target table}).  This puts
6188 the burden of writing conversion functions on the user, but it allows
6189 for a very flexible system.
6191 @menu
6192 * Radio tables::                Sending and receiving
6193 * A LaTeX example::             Step by step, almost a tutorial
6194 * Translator functions::        Copy and modify
6195 @end menu
6197 @node Radio tables, A LaTeX example, Tables in arbitrary syntax, Tables in arbitrary syntax
6198 @subsection Radio tables
6199 @cindex radio tables
6201 To define the location of the target table, you first need to create two
6202 lines that are comments in the current mode, but contain magic words for
6203 Orgtbl-mode to find.  Orgtbl-mode will insert the translated table
6204 between these lines, replacing whatever was there before.  For example:
6206 @example
6207 /* BEGIN RECEIVE ORGTBL table_name */
6208 /* END RECEIVE ORGTBL table_name */
6209 @end example
6211 @noindent
6212 Just above the source table, we put a special line that tells
6213 Orgtbl-mode how to translate this table and where to install it.  For
6214 example:
6215 @example
6216 #+ORGTBL: SEND table_name translation_function arguments....
6217 @end example
6219 @noindent
6220 @code{table_name} is the reference name for the table that is also used
6221 in the receiver lines. @code{translation_function} is the Lisp function
6222 that does the translation.  Furthermore, the line can contain a list of
6223 arguments (alternating key and value) at the end.  The arguments will be
6224 passed as a property list to the translation function for
6225 interpretation.  A few standard parameters are already recognized and
6226 acted upon before the translation function is called:
6228 @table @code
6229 @item :skip N
6230 Skip the first N lines of the table. Hlines do count!
6231 @item :skipcols (n1 n2 ...)
6232 List of columns that should be skipped.  If the table has a column with
6233 calculation marks, that column is automatically discarded as well.
6234 Please note that the translator function sees the table @emph{after} the
6235 removal of these columns, the function never knows that there have been
6236 additional columns.
6237 @end table
6239 @noindent
6240 The one problem remaining is how to keep the source table in the buffer
6241 without disturbing the normal workings of the file, for example during
6242 compilation of a C file or processing of a LaTeX file.  There are a
6243 number of different solutions:
6245 @itemize @bullet
6246 @item
6247 The table could be placed in a block comment if that is supported by the
6248 language.  For example, in C-mode you could wrap the table between
6249 @samp{/*} and @samp{*/} lines.
6250 @item 
6251 Sometimes it is possible to put the table after some kind of @i{END}
6252 statement, for example @samp{\bye} in TeX and @samp{\end@{document@}}
6253 in LaTeX.
6254 @item
6255 You can just comment the table line by line whenever you want to process
6256 the file, and uncomment it whenever you need to edit the table.  This
6257 only sounds tedious - the command @kbd{M-x orgtbl-toggle-comment} does
6258 make this comment-toggling very easy, in particular if you bind it to a
6259 key.
6260 @end itemize
6262 @node A LaTeX example, Translator functions, Radio tables, Tables in arbitrary syntax
6263 @subsection A LaTeX example
6264 @cindex LaTeX, and orgtbl-mode
6266 The best way to wrap the source table in LaTeX is to use the
6267 @code{comment} environment provided by @file{comment.sty}.  It has to be
6268 activated by placing @code{\usepackage@{comment@}} into the document
6269 header.  Orgtbl-mode can insert a radio table skeleton@footnote{By
6270 default this works only for LaTeX, HTML, and TeXInfo.  Configure the
6271 variable @code{orgtbl-radio-tables} to install templates for other
6272 modes.}  with the command @kbd{M-x orgtbl-insert-radio-table}.  You will
6273 be prompted for a table name, lets say we use @samp{salesfigures}.  You
6274 will then get the following template:
6276 @example
6277 % BEGIN RECEIVE ORGTBL salesfigures
6278 % END RECEIVE ORGTBL salesfigures
6279 \begin@{comment@}
6280 #+ORGTBL: SEND salesfigures orgtbl-to-latex
6281 | | |
6282 \end@{comment@}
6283 @end example
6285 @noindent
6286 The @code{#+ORGTBL: SEND} line tells orgtbl-mode to use the function
6287 @code{orgtbl-to-latex} to convert the table into LaTeX and to put it
6288 into the receiver location with name @code{salesfigures}.  You may now
6289 fill in the table, feel free to use the spreadsheet features@footnote{If
6290 the @samp{#+TBLFM} line contains an odd number of dollar characters,
6291 this may cause problems with font-lock in latex-mode.  As shown in the
6292 example you can fix this by adding an extra line inside the
6293 @code{comment} environment that is used to balance the dollar
6294 expressions.  If you are using AUCTeX with the font-latex library, a
6295 much better solution is to add the @code{comment} environment to the
6296 variable @code{LaTeX-verbatim-environments}.}:
6298 @example
6299 % BEGIN RECEIVE ORGTBL salesfigures
6300 % END RECEIVE ORGTBL salesfigures
6301 \begin@{comment@}
6302 #+ORGTBL: SEND salesfigures orgtbl-to-latex
6303 | Month | Days | Nr sold | per day |
6304 |-------+------+---------+---------|
6305 | Jan   |   23 |      55 |     2.4 |
6306 | Feb   |   21 |      16 |     0.8 |
6307 | March |   22 |     278 |    12.6 |
6308 #+TBLFM: $4=$3/$2;%.1f
6309 % $ (optional extra dollar to keep font-lock happy, see footnote)
6310 \end@{comment@}
6311 @end example
6313 @noindent
6314 When you are done, press @kbd{C-c C-c} in the table to get the converted
6315 table inserted between the two marker lines.
6317 Now lets assume you want to make the table header by hand, because you
6318 want to control how columns are aligned etc.  In this case we make sure
6319 that the table translator does skip the first 2 lines of the source
6320 table, and tell the command to work as a @i{splice}, i.e. to not produce
6321 header and footer commands of the target table:
6323 @example
6324 \begin@{tabular@}@{lrrr@}
6325 Month & \multicolumn@{1@}@{c@}@{Days@} & Nr.\ sold & per day\\
6326 % BEGIN RECEIVE ORGTBL salesfigures
6327 % END RECEIVE ORGTBL salesfigures
6328 \end@{tabular@}
6330 \begin@{comment@}
6331 #+ORGTBL: SEND salesfigures orgtbl-to-latex :splice t :skip 2
6332 | Month | Days | Nr sold | per day |
6333 |-------+------+---------+---------|
6334 | Jan   |   23 |      55 |     2.4 |
6335 | Feb   |   21 |      16 |     0.8 |
6336 | March |   22 |     278 |    12.6 |
6337 #+TBLFM: $4=$3/$2;%.1f
6338 \end@{comment@}
6339 @end example
6341 The LaTeX translator function @code{orgtbl-to-latex} is already part of
6342 Orgtbl-mode.  It uses a @code{tabular} environment to typeset the table
6343 and marks horizontal lines with @code{\hline}.  Furthermore, it
6344 interprets the following parameters:
6346 @table @code
6347 @item :splice nil/t
6348 When set to t, return only table body lines, don't wrap them into a
6349 tabular environment.  Default is nil.
6351 @item :fmt fmt
6352 A format to be used to wrap each field, should contain @code{%s} for the
6353 original field value.  For example, to wrap each field value in dollars,
6354 you could use @code{:fmt "$%s$"}.  This may also be a property list with
6355 column numbers and formats. for example @code{:fmt (2 "$%s$" 4 "%s\\%%")}.
6357 @item :efmt efmt
6358 Use this format to print numbers with exponentials.  The format should
6359 have @code{%s} twice for inserting mantissa and exponent, for example
6360 @code{"%s\\times10^@{%s@}"}.  The default is @code{"%s\\,(%s)"}.  This
6361 may also be a property list with column numbers and formats, for example
6362 @code{:efmt (2 "$%s\\times10^@{%s@}$" 4 "$%s\\cdot10^@{%s@}$")}.  After
6363 @code{efmt} has been applied to a value, @code{fmt} will also be
6364 applied.
6365 @end table
6367 @node Translator functions,  , A LaTeX example, Tables in arbitrary syntax
6368 @subsection Translator functions
6369 @cindex HTML, and orgtbl-mode
6370 @cindex translator function
6372 Orgtbl-mode has several translator functions built-in:
6373 @code{orgtbl-to-latex}, @code{orgtbl-to-html}, and
6374 @code{orgtbl-to-texinfo}.  Except for @code{orgtbl-to-html}@footnote{The
6375 HTML translator uses the same code that produces tables during HTML
6376 export.}, these all use a generic translator, @code{orgtbl-to-generic}.
6377 For example, @code{orgtbl-to-latex} itself is a very short function that
6378 computes the column definitions for the @code{tabular} environment,
6379 defines a few field and line separators and then hands over to the
6380 generic translator.  Here is the entire code:
6382 @lisp
6383 @group
6384 (defun orgtbl-to-latex (table params)
6385   "Convert the orgtbl-mode TABLE to LaTeX."
6386   (let* ((alignment (mapconcat (lambda (x) (if x "r" "l"))
6387                                org-table-last-alignment ""))
6388          (params2
6389           (list
6390            :tstart (concat "\\begin@{tabular@}@{" alignment "@}")
6391            :tend "\\end@{tabular@}"
6392            :lstart "" :lend " \\\\" :sep " & "
6393            :efmt "%s\\,(%s)" :hline "\\hline")))
6394     (orgtbl-to-generic table (org-combine-plists params2 params))))
6395 @end group
6396 @end lisp
6398 As you can see, the properties passed into the function (variable
6399 @var{PARAMS}) are combined with the ones newly defined in the function
6400 (variable @var{PARAMS2}).  The ones passed into the function (i.e. the
6401 ones set by the @samp{ORGTBL SEND} line) take precedence.  So if you
6402 would like to use the LaTeX translator, but wanted the line endings to
6403 be @samp{\\[2mm]} instead of the default @samp{\\}, you could just
6404 overrule the default with
6406 @example
6407 #+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]"
6408 @end example
6410 For a new language, you can either write your own converter function in
6411 analogy with the LaTeX translator, or you can use the generic function
6412 directly.  For example, if you have a language where a table is started
6413 with @samp{!BTBL!}, ended with @samp{!ETBL!}, and where table lines are
6414 started with @samp{!BL!}, ended with @samp{!EL!} and where the field
6415 separator is a TAB, you could call the generic translator like this (on
6416 a single line!):
6418 @example
6419 #+ORGTBL: SEND test orgtbl-to-generic :tstart "!BTBL!" :tend "!ETBL!"
6420                               :lstart "!BL! " :lend " !EL!" :sep "\t"
6421 @end example
6423 @noindent
6424 Please check the documentation string of the function
6425 @code{orgtbl-to-generic} for a full list of parameters understood by
6426 that function and remember that you can pass each of them into
6427 @code{orgtbl-to-latex}, @code{orgtbl-to-texinfo}, and any other function
6428 using the generic function.
6430 Of course you can also write a completely new function doing complicated
6431 things the generic translator cannot do.  A translator function takes
6432 two arguments.  The first argument is the table, a list of lines, each
6433 line either the symbol @code{hline} or a list of fields.  The second
6434 argument is the property list containing all parameters specified in the
6435 @samp{#+ORGTBL: SEND} line.  The function must return a single string
6436 containing the formatted table.  If you write a generally useful
6437 translator, please post it on @code{emacs-orgmode@@gnu.org} so that
6438 others can benefit from your work.
6440 @node Dynamic blocks, Special agenda views, Tables in arbitrary syntax, Extensions and Hacking
6441 @section Dynamic blocks
6442 @cindex dynamic blocks
6444 Org-mode documents can contain @emph{dynamic blocks}.  These are
6445 specially marked regions that are updated by some user-written function.
6446 A good example for such a block is the clock table inserted by the
6447 command @kbd{C-c C-x C-r} (@pxref{Clocking work time}).
6449 Dynamic block are enclosed by a BEGIN-END structure that assigns a name
6450 to the block and can also specify parameters for the function producing
6451 the content of the block.
6453 @example
6454 #+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
6456 #+END:
6457 @end example
6459 Dynamic blocks are updated with the following commands
6461 @table @kbd
6462 @kindex C-c C-x C-u
6463 @item C-c C-x C-u
6464 Update dynamic block at point.
6465 @kindex C-u C-c C-x C-u
6466 @item C-u C-c C-x C-u
6467 Update all dynamic blocks in the current file.
6468 @end table
6470 Updating a dynamic block means to remove all the text between BEGIN and
6471 END, parse the BEGIN line for parameters and then call the specific
6472 writer function for this block to insert the new content.  For a block
6473 with name @code{myblock}, the writer function is
6474 @code{org-dblock-write:myblock} with as only parameter a property list
6475 with the parameters given in the begin line.  Here is a trivial example
6476 of a block that keeps track of when the block update function was last
6477 run:
6479 @example
6480 #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
6482 #+END:
6483 @end example
6485 @noindent
6486 The corresponding block writer function could look like this:
6488 @lisp
6489 (defun org-dblock-write:block-update-time (params)
6490    (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
6491      (insert "Last block update at: "
6492              (format-time-string fmt (current-time)))))
6493 @end lisp
6495 If you want to make sure that all dynamic blocks are always up-to-date,
6496 you could add the function @code{org-update-all-dblocks} to a hook, for
6497 example @code{before-save-hook}.  @code{org-update-all-dblocks} is
6498 written in a way that is does nothing in buffers that are not in Org-mode.
6500 @node Special agenda views,  , Dynamic blocks, Extensions and Hacking
6501 @section Special Agenda Views
6502 @cindex agenda views, user-defined
6504 Org-mode provides a special hook that can be used to narrow down the
6505 selection made by any of the agenda views.  You may specify a function
6506 that is used at each match to verify if the match should indeed be part
6507 of the agenda view, and if not, how much should be skipped.
6509 Let's say you want to produce a list of projects that contain a WAITING
6510 tag anywhere in the project tree.  Let's further assume that you have
6511 marked all tree headings that define a project with the todo keyword
6512 PROJECT.  In this case you would run a todo search for the keyword
6513 PROJECT, but skip the match unless there is a WAITING tag anywhere in
6514 the subtree belonging to the project line.
6516 To achieve this, you must write a function that searches the subtree for
6517 the tag.  If the tag is found, the function must return @code{nil} to
6518 indicate that this match should not be skipped.  If there is no such
6519 tag, return the location of the end of the subtree, to indicate that
6520 search should continue from there.
6522 @lisp
6523 (defun my-skip-unless-waiting ()
6524   "Skip trees that are not waiting"
6525   (let ((subtree-end (save-excursion (org-end-of-subtree t))))
6526     (if (re-search-forward ":WAITING:" subtree-end t)
6527         nil          ; tag found, do not skip
6528       subtree-end))) ; tag not found, continue after end of subtree
6529 @end lisp
6531 Furthermore you must write a command that uses @code{let} to temporarily
6532 put this function into the variable @code{org-agenda-skip-function},
6533 sets the header string for the agenda buffer, and calls the todo-list
6534 generator while asking for the specific TODO keyword PROJECT.  The
6535 function must also accept one argument MATCH, but it can choose to
6536 ignore it@footnote{MATCH must be present in case you want to define a
6537 custom command for producing this special list.  Custom commands always
6538 supply the MATCH argument, but it can be empty if you do not specify it
6539 while defining the command(@pxref{Custom agenda
6540 views}).} (as we do in the example below).  Here is the example:
6542 @lisp
6543 (defun my-org-waiting-projects (&optional match)
6544   "Produce a list of projects that contain a WAITING tag.
6545 MATCH is being ignored."
6546   (interactive)
6547   (let ((org-agenda-skip-function 'my-skip-unless-waiting)
6548         (org-agenda-overriding-header "Projects waiting for something: "))
6549     ;; make the list
6550     (org-todo-list "PROJECT")))
6551 @end lisp
6554 @node History and Acknowledgments, Index, Extensions and Hacking, Top
6555 @appendix History and Acknowledgments
6556 @cindex acknowledgments
6557 @cindex history
6558 @cindex thanks
6560 Org-mode was borne in 2003, out of frustration over the user interface
6561 of the Emacs outline-mode.  I was trying to organize my notes and
6562 projects, and using Emacs seemed to be the natural way to go.  However,
6563 having to remember eleven different commands with two or three keys per
6564 command, only to hide and unhide parts of the outline tree, that seemed
6565 entirely unacceptable to me.  Also, when using outlines to take notes, I
6566 constantly want to restructure the tree, organizing it parallel to my
6567 thoughts and plans.  @emph{Visibility cycling} and @emph{structure
6568 editing} were originally implemented in the package
6569 @file{outline-magic.el}, but quickly moved to the more general
6570 @file{org.el}.  As this environment became comfortable for project
6571 planning, the next step was adding @emph{TODO entries}, basic @emph{time
6572 stamps}, and @emph{table support}.  These areas highlight the two main
6573 goals that Org-mode still has today: To create a new, outline-based,
6574 plain text mode with innovative and intuitive editing features, and to
6575 incorporate project planning functionality directly into a notes file.
6577 Since the first release, hundreds of emails to me or on
6578 @code{emacs-orgmode@@gnu.org} have provided a constant stream of bug
6579 reports, feedback, new ideas, and sometimes patches and add-on code.
6580 Many thanks to everyone who has helped to improve this package.  I am
6581 trying to keep here a list of the people who had significant influence
6582 in shaping one or more aspects of Org-mode.  The list may not be
6583 complete, if I have forgotten someone, please accept my apologies and
6584 let me know.
6586 @itemize @bullet
6588 @item
6589 @i{Thomas Baumann} contributed the code for links to the MH-E email
6590 system.
6591 @item
6592 @i{Alex Bochannek} provided a patch for rounding time stamps.
6593 @item
6594 @i{Charles Cave}'s suggestion sparked the implementation of templates
6595 for Remember.
6596 @item
6597 @i{Pavel Chalmoviansky} influenced the agenda treatment of items with
6598 specified time.
6599 @item
6600 @i{Gregory Chernov} patched support for lisp forms into table
6601 calculations and improved XEmacs compatibility, in particular by porting
6602 @file{nouline.el} to XEmacs.
6603 @item
6604 @i{Sacha Chua} suggested to copy some linking code from Planner.
6605 @item
6606 @i{Eddward DeVilla} proposed and tested checkbox statistics.
6607 @item
6608 @i{Kees Dullemond} used to edit projects lists directly in HTML and so
6609 inspired some of the early development, including HTML export.  He also
6610 asked for a way to narrow wide table columns.
6611 @item
6612 @i{Christian Egli} converted the documentation into TeXInfo format,
6613 patched CSS formatting into the HTML exporter, and inspired the agenda.
6614 @item
6615 @i{Nic Ferrier} contributed mailcap and XOXO support.
6616 @item
6617 @i{John Foerch} figured out how to make incremental search show context
6618 around a match in a hidden outline tree.
6619 @item
6620 @i{Niels Giessen} had the idea to automatically archive DONE trees.
6621 @item
6622 @i{Bastien Guerry} provided extensive feedback and some patches, and
6623 translated David O'Toole's tutorial into French.
6624 @item
6625 @i{Kai Grossjohann} pointed out key-binding conflicts with other packages.
6626 @item
6627 @i{Shidai Liu} ("Leo") asked for embedded LaTeX and tested it.  He also
6628 provided frequent feedback and some patches.
6629 @item
6630 @i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler
6631 happy.
6632 @item
6633 @i{Rick Moynihan} proposed to allow multiple TODO sequences in a file.
6634 @item
6635 @i{Todd Neal} provided patches for links to Info files and elisp forms.
6636 @item
6637 @i{Tim O'Callaghan} suggested in-file links, search options for general
6638 file links, and TAGS.
6639 @item
6640 @i{Takeshi Okano} translated the manual and David O'Toole's tutorial
6641 into Japanese.
6642 @item
6643 @i{Oliver Oppitz} suggested multi-state TODO items.
6644 @item
6645 @i{Scott Otterson} sparked the introduction of descriptive text for
6646 links, among other things.
6647 @item
6648 @i{Pete Phillips} helped during the development of the TAGS feature, and
6649 provided frequent feedback.
6650 @item
6651 @i{T.V. Raman} reported bugs and suggested improvements.
6652 @item
6653 @i{Matthias Rempe} (Oelde) provided ideas, Windows support, and quality
6654 control.
6655 @item
6656 @i{Kevin Rogers} contributed code to access VM files on remote hosts.
6657 @item
6658 @i{Frank Ruell} solved the mystery of the @code{keymapp nil} bug, a
6659 conflict with @file{allout.el}.
6660 @item
6661 @i{Jason Riedy} sent a patch to fix a bug with export of TODO keywords.
6662 @item
6663 @i{Philip Rooke} created the Org-mode reference card and provided lots
6664 of feedback.
6665 @item
6666 @i{Christian Schlauer} proposed angular brackets around links, among
6667 other things.
6668 @item
6669 Linking to VM/BBDB/GNUS was inspired by @i{Tom Shannon}'s
6670 @file{organizer-mode.el}.
6671 @item
6672 @i{Daniel Sinder} came up with the idea of internal archiving by locking
6673 subtrees.
6674 @item
6675 @i{Dale Smith} proposed link abbreviations.
6676 @item
6677 @i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
6678 chapter about publishing.
6679 @item
6680 @i{J@"urgen Vollmer} contributed code generating the table of contents
6681 in HTML output.
6682 @item
6683 @i{Chris Wallace} provided a patch implementing the @samp{QUOTE}
6684 keyword.
6685 @item
6686 @i{David Wainberg} suggested archiving, and improvements to the linking
6687 system.
6688 @item
6689 @i{John Wiegley} wrote @file{emacs-wiki.el} and @file{planner.el}.  The
6690 development of Org-mode was fully independent, and both systems are
6691 really different beasts in their basic ideas and implementation details.
6692 I later looked at John's code, however, and learned from his
6693 implementation of (i) links where the link itself is hidden and only a
6694 description is shown, and (ii) popping up a calendar to select a date.
6695 @item
6696 @i{Carsten Wimmer} suggested some changes and helped fix a bug in
6697 linking to GNUS.
6698 @item
6699 @i{Roland Winkler} requested additional keybindings to make Org-mode
6700 work on a tty.
6701 @item
6702 @i{Piotr Zielinski} wrote @file{org-mouse.el}, proposed agenda blocks
6703 and contributed various ideas and code snippets.
6704 @end itemize
6707 @node Index, Key Index, History and Acknowledgments, Top
6708 @unnumbered Index
6710 @printindex cp
6712 @node Key Index,  , Index, Top
6713 @unnumbered Key Index
6715 @printindex ky
6717 @bye
6719 @ignore
6720    arch-tag: 7893d1fe-cc57-4d13-b5e5-f494a1bcc7ac
6721 @end ignore