Release 4.28
[org-mode/org-mode-NeilSmithlineMods.git] / org.texi
blob2958bed61c27d6abb8eee00111c7fc7c01fcb809
1 \input texinfo
2 @c %**start of header
3 @setfilename org
4 @c @setfilename ../info/org
5 @settitle Org Mode Manual
7 @set VERSION 4.28
8 @set DATE April 2006
10 @dircategory Emacs
11 @direntry
12 * Org Mode: (org).      outline-based notes management and organizer
13 @end direntry
15 @c Version and Contact Info
16 @set MAINTAINERSITE @uref{http://www.astro.uva.nl/~dominik/Tools/org/,maintainers webpage}
17 @set MAINTAINER Carsten Dominik
18 @set MAINTAINEREMAIL @email{dominik@@science.uva.nl}
19 @set MAINTAINERCONTACT @uref{mailto:dominik@@science.uva.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 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 * Exporting::                   Sharing and publishing of notes
87 * Miscellaneous::               All the rest which did not fit elsewhere
88 * Index::                       The fast road to specific information
89 * Key Index::                   Key bindings and where they are described
91 @detailmenu
92  --- The Detailed Node Listing ---
94 Introduction
96 * Summary::                     Brief summary of what Org-mode does
97 * Installation and activation::  How to install Org-mode
98 * Feedback::                    Bug reports, ideas, patches etc.
100 Document Structure
102 * Outlines::                    Org-mode is based on outline-mode
103 * Headlines::                   How to typeset org-tree headlines
104 * Visibility cycling::          Show and hide, much simplified
105 * Motion::                      Jumping to other headlines
106 * Structure editing::           Changing sequence and level of headlines
107 * Archiving::                   Move done task trees to a different place
108 * Sparse trees::                Matches embedded in context
109 * Plain lists::                 Editing hand-formatted lists
111 Tables
113 * Built-in table editor::       Simple tables
114 * Narrow columns::              Stop wasting space in tables   
115 * Table calculations::          Compute a field from other fields
116 * orgtbl-mode::                 The table editor as minor mode
117 * table.el::                    Complex tables
119 Calculations in tables
121 * Formula syntax::              How to write a formula
122 * Column formulas::             Formulas valid for all fields in a column
123 * Advanced features::           Field names, parameters and automatic recalc
124 * Named-field formulas::        Formulas valid in single fields
125 * Editing/debugging formulas::  Changing a stored formula
126 * Appetizer::                   Taste the power of calc
128 Hyperlinks
130 * Link format::                 How links in Org-mode are formatted
131 * Internal links::              Links to other places in the current file
132 * External links::              URL-like links to the world
133 * Handling links::              Creating, inserting and following
134 * Search options::              Linking to a specific location
135 * Custom searches::             When the default search is not enough
136 * Remember::                    Org-trees store quick notes
138 Internal links
140 * Radio targets::               Make targets trigger links in plain text.
141 * CamelCase links::             Activating CamelCase words as links
143 TODO items
145 * TODO basics::                 Marking and displaying TODO entries
146 * Progress logging::            Document your productivity
147 * TODO extensions::             Workflow and assignments
148 * Priorities::                  Some things are more important than others
150 Extended use of TODO keywords
152 * Workflow states::             From TODO to DONE in steps
153 * TODO types::                  I do this, Fred the rest
154 * Per file keywords::           Different files, different requirements
156 Timestamps
158 * Time stamps::                 Assigning a time to a tree entry
159 * Creating timestamps::         Commands which insert timestamps
161 Tags
163 * Tag inheritance::             Tags use the tree structure of the outline
164 * Setting tags::                How to assign tags to a headline
165 * Tag searches::                Searching for combinations of tags
167 Agenda Views
169 * Agenda files::                Files being searched for agenda information
170 * Agenda dispatcher::           Keyboard access to agenda views
171 * Weekly/Daily agenda::         The calendar page with current tasks
172 * Global TODO list::            All unfinished action items
173 * Matching headline tags::      Structured information with fine-tuned search
174 * Timeline::                    Time-sorted view for single file
175 * Agenda commands::             Remote editing of org trees
177 The weekly/daily agenda
179 * Categories::                  Not all tasks are equal
180 * Time-of-day specifications::  How the agenda knows the time
181 * Calendar/Diary integration::  Integrating Anniversaries and more
182 * Sorting of agenda items::     The order of things
184 Exporting
186 * ASCII export::                Exporting to plain ASCII
187 * HTML export::                 Exporting to HTML
188 * XML export::                  Exporting to XML
189 * iCalendar export::            Exporting in iCalendar format
190 * Text interpretation::         How the exporter looks at the file
192 Text interpretation by the exporter
194 * Comment lines::               Some lines will not be exported
195 * Enhancing text::              Subscripts, symbols and more
196 * Export options::              How to influence the export settings
198 Miscellaneous
200 * Completion::                  M-TAB knows what you need
201 * Customization::               Adapting Org-mode to your taste
202 * Summary of in-buffer settings::  Using special lines to set options
203 * The very busy C-c C-c key::   When in doubt, press C-c C-c
204 * Clean view::                  Getting rid of leading stars in the outline
205 * TTY keys::                    Using Org-mode on a tty
206 * FAQ::                         Frequently asked questions
207 * Interaction::                 Other Emacs packages
208 * Bugs::                        Things which do not work perfectly
209 * Acknowledgments::             These people provided feedback and more
211 @end detailmenu
212 @end menu
214 @node Introduction, Document structure, Top, Top
215 @chapter Introduction
216 @cindex introduction
218 @menu
219 * Summary::                     Brief summary of what Org-mode does
220 * Installation and activation::  How to install Org-mode
221 * Feedback::                    Bug reports, ideas, patches etc.
222 @end menu
224 @node Summary, Installation and activation, Introduction, Introduction
225 @section Summary
226 @cindex summary
228 Org-mode is a mode for keeping notes, maintaining ToDo lists, and doing
229 project planning with a fast and effective plain-text system.
231 Org-mode develops organizational tasks around NOTES files that contain
232 information about projects as plain text.  Org-mode is implemented on
233 top of outline-mode, which makes it possible to keep the content of
234 large files well structured.  Visibility cycling and structure editing
235 help to work with the tree.  Tables are easily created with a built-in
236 table editor.  Org-mode supports ToDo items, deadlines, time stamps,
237 and scheduling.  It dynamically compiles entries into an agenda that
238 utilizes and smoothly integrates much of the Emacs calendar and diary.
239 Plain text URL-like links connect to websites, emails, Usenet
240 messages, BBDB entries, and any files related to the projects.  For
241 printing and sharing of notes, an Org-mode file can be exported as a
242 structured ASCII file, as HTML, or (todo and agenda items only) as an
243 iCalendar file.
245 Org-mode keeps simple things simple.  When first fired up, it should
246 feel like a simple, easy to use outliner.  Complexity is not imposed,
247 but a large amount of functionality is available when you need it.
248 Org-mode can be used on different levels and in different ways, for
249 example:
251 @example
252 @r{@bullet{} as an outline extension with visibility cycling and structure editing}
253 @r{@bullet{} as an ASCII system and table editor for taking structured notes}
254 @r{@bullet{} as an ASCII table editor with spreadsheet-like capabilities}
255 @r{@bullet{} as a simple hypertext system, with HTML export}
256 @r{@bullet{} as a TODO list editor}
257 @r{@bullet{} as a full agenda and planner with deadlines and work scheduling}
258 @end example
260 The Org-mode table editor can be integrated into any major mode by
261 activating the minor Orgtbl-mode.
263 There is a website for Org-mode which provides links to the newest
264 version of Org-mode, as well as additional information, screen shots
265 and example files.  This page is located at
266 @uref{http://www.astro.uva.nl/~dominik/Tools/org/}.
268 @page
270 @node Installation and activation, Feedback, Summary, Introduction
271 @section Installation and Activation
272 @cindex installation
273 @cindex autoload
274 @cindex global keybindings
275 @cindex keybindings, global
277 If Org-mode is part of the Emacs distribution or an XEmacs package,
278 you only need to copy the following lines to your @file{.emacs} file.
279 The last two lines define @emph{global} keys for the commands
280 @command{org-store-link} and @command{org-agenda} - please
281 choose suitable keys yourself.
283 @lisp
284 ;; The following lines are always needed.  Choose your own keys.
285 (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
286 (define-key global-map "\C-cl" 'org-store-link)
287 (define-key global-map "\C-ca" 'org-agenda)
288 @end lisp
290 If you have downloaded Org-mode from the Web, you must byte-compile
291 @file{org.el} and put it on your load path.  In addition to the Emacs
292 Lisp lines above, you also need to add the following lines to
293 @file{.emacs}:
295 @lisp
296 ;; These lines only if org-mode is not part of the X/Emacs distribution.
297 (autoload 'org-mode "org" "Org mode" t)
298 (autoload 'org-diary "org" "Diary entries from Org mode")
299 (autoload 'org-agenda "org" "Multi-file agenda from Org mode" t)
300 (autoload 'org-store-link "org" "Store a link to the current location" t)
301 (autoload 'orgtbl-mode "org" "Org tables as a minor mode" t)
302 (autoload 'turn-on-orgtbl "org" "Org tables as a minor mode")
303 @end lisp
305 @cindex org-mode, turning on
306 With this setup, all files with extension @samp{.org} will be put into
307 Org-mode.  As an alternative, make the first line of a file look like
308 this:
310 @example
311 MY PROJECTS    -*- mode: org; -*-
312 @end example
314 @noindent which will select Org-mode for this buffer no matter what
315 the file's name is.  See also the variable
316 @code{org-insert-mode-line-in-empty-file}.
318 @node Feedback,  , Installation and activation, Introduction
319 @section Feedback
320 @cindex feedback
321 @cindex bug reports
322 @cindex maintainer
323 @cindex author
325 If you find problems with Org-mode, or if you have questions, remarks,
326 or ideas about it, please contact the maintainer Carsten Dominik at
327 @value{MAINTAINEREMAIL}.
329 For bug reports, please provide as much information as possible,
330 including the version information of Emacs (@kbd{C-h v emacs-version
331 @key{RET}}) and Org-mode (@kbd{C-h v org-version @key{RET}}), as well as
332 the Org-mode related setup in @file{.emacs}.  If an error occurs, a
333 traceback can be very useful.  Often a small example file helps, along
334 with clear information about:
336 @enumerate
337 @item What exactly did you do?
338 @item What did you expect to happen?
339 @item What happened instead?
340 @end enumerate
341 @noindent Thank you for helping to improve this mode.
343 @node Document structure, Tables, Introduction, Top
344 @chapter Document Structure
345 @cindex document structure
346 @cindex structure of document
348 Org-mode is based on outline mode and provides flexible commands to
349 edit the structure of the document.
351 @menu
352 * Outlines::                    Org-mode is based on outline-mode
353 * Headlines::                   How to typeset org-tree headlines
354 * Visibility cycling::          Show and hide, much simplified
355 * Motion::                      Jumping to other headlines
356 * Structure editing::           Changing sequence and level of headlines
357 * Archiving::                   Move done task trees to a different place
358 * Sparse trees::                Matches embedded in context
359 * Plain lists::                 Editing hand-formatted lists
360 @end menu
362 @node Outlines, Headlines, Document structure, Document structure
363 @section Outlines
364 @cindex outlines
365 @cindex outline-mode
367 Org-mode is implemented on top of outline-mode.  Outlines allow to
368 organize a document in a hierarchical structure, which (at least for
369 me) is the best representation of notes and thoughts.  Overview over
370 this structure is achieved by folding (hiding) large parts of the
371 document to show only the general document structure and the parts
372 currently being worked on.  Org-mode greatly simplifies the use of
373 outlines by compressing the entire show/hide functionality into a
374 single command @command{org-cycle}, which is bound to the @key{TAB}
375 key.
377 @node Headlines, Visibility cycling, Outlines, Document structure
378 @section Headlines
379 @cindex headlines
380 @cindex outline tree
382 Headlines define the structure of an outline tree.  The headlines in
383 Org-mode start with one or more stars, on the left margin.  For
384 example:
386 @example
387 * Top level headline
388 ** Second level
389 *** 3rd level
390     some text
391 *** 3rd level
392     more text
393 * Another top level headline
394 @end example
396 @noindent Some people find the many stars too noisy and would prefer an
397 outline that has whitespace followed by a single star as headline
398 starters.  @ref{Clean view} describes a setup to realize this.
400 @node Visibility cycling, Motion, Headlines, Document structure
401 @section Visibility cycling
402 @cindex cycling, visibility
403 @cindex visibility cycling
404 @cindex trees, visibility
405 @cindex show hidden text
406 @cindex hide text
408 Outlines make it possible to hide parts of the text in the buffer.
409 Org-mode uses a single command bound to the @key{TAB} key to change
410 the visibility in the buffer.
412 @cindex subtree visibility states
413 @cindex folded, subtree visibility state
414 @cindex children, subtree visibility state
415 @cindex subtree, subtree visibility state
416 @table @kbd
417 @kindex @key{TAB}
418 @item @key{TAB}
419 Rotate current subtree between the states
421 @example
422 ,-> FOLDED -> CHILDREN -> SUBTREE --.
423 '-----------------------------------'
424 @end example
426 At the beginning of the buffer (or when called with @kbd{C-u}), this does
427 the same as the command @kbd{S-@key{TAB}} below.
429 @cindex global visibility states
430 @cindex overview, global visibility state
431 @cindex contents, global visibility state
432 @cindex show all, global visibility state
433 @kindex S-@key{TAB}
434 @item S-@key{TAB}
435 Rotate the entire buffer between the states
437 @example
438 ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
439 '--------------------------------------'
440 @end example
442 Note that inside tables, @kbd{S-@key{TAB}} jumps to the previous field.
444 @cindex show all, command
445 @kindex C-c C-a
446 @item C-c C-a
447 Show all.
448 @end table
450 When Emacs first visits an Org-mode file, the global state is set to
451 OVERVIEW, i.e. only the top level headlines are visible.  This can be
452 configured through the variable @code{org-startup-folded}, or on a
453 per-file basis by adding one of the following lines anywhere in the
454 buffer:
456 @example
457 #+STARTUP: overview
458 #+STARTUP: content
459 #+STARTUP: showall
460 @end example
462 @node Motion, Structure editing, Visibility cycling, Document structure
463 @section Motion
464 @cindex motion, between headlines
465 @cindex jumping, to headlines
466 @cindex headline navigation
467 The following commands jump to other headlines in the buffer.
469 @table @kbd
470 @kindex C-c C-n
471 @item C-c C-n
472 Next heading.
473 @kindex C-c C-p
474 @item C-c C-p
475 Previous heading.
476 @kindex C-c C-f
477 @item C-c C-f
478 Next heading same level.
479 @kindex C-c C-b
480 @item C-c C-b
481 Previous heading same level.
482 @kindex C-c C-u
483 @item C-c C-u
484 Backward to higher level heading.
485 @kindex C-c C-j
486 @item C-c C-j
487 Jump to a different place without changing the current outline
488 visibility.  Shows the document structure in a temporary buffer, where
489 you can use visibility cycling (@key{TAB}) to find your destination.
490 After pressing @key{RET}, the cursor moves to the selected location in
491 the original buffer, and the headings hierarchy above it is made
492 visible.
493 @end table
495 @node Structure editing, Archiving, Motion, Document structure
496 @section Structure editing
497 @cindex structure editing
498 @cindex headline, promotion and demotion
499 @cindex promotion, of subtrees
500 @cindex demotion, of subtrees
501 @cindex subtree, cut and paste
502 @cindex pasting, of subtrees
503 @cindex cutting, of subtrees
504 @cindex copying, of subtrees
505 @cindex subtrees, cut and paste
507 @table @kbd
508 @kindex M-@key{RET}
509 @item M-@key{RET}
510 Insert new heading with same level as current.  If the cursor is in a
511 plain list item, a new item is created (@pxref{Plain lists}).  To force
512 creation of a new headline, use a prefix arg, or first press @key{RET}
513 to get to the beginning of the next line.  When this command is used in
514 the middle of a line, the line is split and the rest of the line becomes
515 the new headline.  If the command is used at the beginning of a
516 headline, the new headline is created before the current line.  It at
517 the beginning of any other line, the content of that line is made the
518 new heading.
519 @kindex M-S-@key{RET}
520 @item M-S-@key{RET}
521 Insert new TODO entry with same level as current heading.
522 @kindex M-@key{left}
523 @item M-@key{left}
524 Promote current heading by one level.
525 @kindex M-@key{right}
526 @item M-@key{right}
527 Demote current heading by one level.
528 @kindex M-S-@key{left}
529 @item M-S-@key{left}
530 Promote the current subtree by one level.
531 @kindex M-S-@key{right}
532 @item M-S-@key{right}
533 Demote the current subtree by one level.
534 @kindex M-S-@key{up}
535 @item M-S-@key{up}
536 Move subtree up (swap with previous subtree of same
537 level).
538 @kindex M-S-@key{down}
539 @item M-S-@key{down}
540 Move subtree down (swap with next subtree of same level).
541 @kindex C-c C-x C-w
542 @kindex C-c C-x C-k
543 @item C-c C-x C-w
544 @itemx C-c C-x C-k
545 Kill subtree, i.e. remove it from buffer but save in kill ring.
546 @kindex C-c C-x M-w
547 @item C-c C-x M-w
548 Copy subtree to kill ring.
549 @kindex C-c C-x C-y
550 @item C-c C-x C-y
551 Yank subtree from kill ring.  This does modify the level of the subtree to
552 make sure the tree fits in nicely at the yank position.  The yank
553 level can also be specified with a prefix arg, or by yanking after a
554 headline marker like @samp{****}.
555 @end table
557 @cindex region, active
558 @cindex active region
559 @cindex transient-mark-mode
560 When there is an active region (transient-mark-mode), promotion and
561 demotion work on all headlines in the region.  To select a region of
562 headlines, it is best to place both point and mark at the beginning of a
563 line, mark at the beginning of the first headline, and point at the line
564 just after the last headline to change.  Note that when the cursor is
565 inside a table (@pxref{Tables}), the Meta-Cursor keys have different
566 functionality.
568 @node Archiving, Sparse trees, Structure editing, Document structure
569 @section Archiving
570 @cindex archiving
571 @cindex filing subtrees
573 When a project represented by a (sub)tree is finished, you may want
574 to move the tree to an archive place, either in the same file under a
575 special top-level heading, or even to a different file.
576 @table @kbd
577 @kindex C-c $
578 @item @kbd{C-c $}
579 Archive the subtree starting at the cursor position to the location
580 given by @code{org-archive-location}.
581 @end table
583 @cindex archive locations
584 The default archive is a file in the same directory as the current
585 file, with the name derived by appending @file{_archive} to the
586 current file name.  For information and examples on how to change
587 this, see the documentation string of the variable
588 @code{org-archive-location}.  If you are also using the Org-mode
589 agenda, archiving to a different file is a good way to keep archived
590 trees from contributing agenda items.
592 @node Sparse trees, Plain lists, Archiving, Document structure
593 @section Sparse trees
594 @cindex sparse trees
595 @cindex trees, sparse
596 @cindex folding, sparse trees
597 @cindex occur, command
599 An important feature of Org-mode is the ability to construct
600 @emph{sparse trees} for selected information in an outline tree.  A
601 sparse tree means that the entire document is folded as much as
602 possible, but the selected information is made visible along with the
603 headline structure above it@footnote{See also the variables
604 @code{org-show-hierarchy-above} and
605 @code{org-show-following-heading}.}.  Just try it out and you will see
606 immediately how it works.
608 Org-mode contains several commands creating such trees.  The most
609 basic one is @command{org-occur}:
611 @table @kbd
612 @kindex C-c /
613 @item C-c /
614 Occur.  Prompts for a regexp and shows a sparse tree with all matches.
615 If the match is in a headline, the headline is made visible.  If the
616 match is in the body of an entry, headline and body are made visible.
617 In order to provide minimal context, also the full hierarchy of
618 headlines above the match is shown, as well as the headline following
619 the match.  Each match is also highlighted, the highlights disappear
620 when the buffer is changed with an editing command.
621 @end table
622 @noindent
623 For frequently used sparse trees of specific search strings, you can
624 use the variable @code{org-agenda-custom-commands} to define fast
625 keyboard access to specific sparse trees.  These commands will then be
626 accessible through the agenda dispatcher (@pxref{Agenda dispatcher}).
627 For example:
629 @lisp
630 (setq org-agenda-custom-commands
631       '(("f" occur-tree "FIXME")))
632 @end lisp
634 @noindent will define the key @kbd{C-c a f} as a shortcut for creating
635 a sparse tree matching the string @samp{FIXME}.
637 Other commands are using sparse trees as well.  For example @kbd{C-c
638 C-v} creates a sparse TODO tree (@pxref{TODO basics}).
640 @kindex C-c C-x v
641 @cindex printing sparse trees
642 @cindex visible text, printing
643 To print a sparse tree, you can use the Emacs command
644 @code{ps-print-buffer-with-faces} which does not print invisible parts
645 of the document @footnote{This does not work under XEmacs, because
646 XEmacs uses selective display for outlining, not text properties.}.
647 Or you can use the command @kbd{C-c C-x v} to copy the visible part of
648 the document to another file (extension @file{.txt}) which can then be
649 printed in any desired way.
652 @node Plain lists,  , Sparse trees, Document structure
653 @section Plain lists
654 @cindex plain lists
655 @cindex lists, plain
656 @cindex lists, ordered
657 @cindex ordered lists
659 Headlines define both the structure of the Org-mode file, and also lists
660 (for example, TODO items (@pxref{TODO items}) should be created using
661 headline levels).  However, when taking notes, the plain text is
662 sometimes easier to read with hand-formatted lists.  Org-mode supports
663 editing such lists, and the HTML exporter (@pxref{Exporting}) does
664 parse and format them.
666 Org-mode knows ordered and unordered lists.  Unordered list items start
667 with @samp{-}, @samp{+}, or @samp{*}@footnote{When using @samp{*} as a
668 bullet, lines must be indented or they will be seen as top-level
669 headlines.  Also, when you are hiding leading stars to get a clean
670 outline view, plain list items starting with a star are visually
671 indistinguishable from true headlines.  In short: even though @samp{*}
672 is supported, it may be better to not use it for plain list items} as
673 bullets.  Ordered list items start with @samp{1.} or @samp{1)}.  Items
674 belonging to the same list must have the same indentation on the first
675 line.  In particular, if an ordered list reaches number @samp{10.}, then
676 the 2--digit numbers must be written left-aligned with the other numbers
677 in the list.  Indentation also determines the end of a list item.  It
678 ends before the next line that is indented like the bullet/number, or
679 less.  For example:
681 @example
682 @group
683 ** Lord of the Rings
684 My favorite scenes are (in this order)
685 1. Eowyns fight with the witch king
686    + this was already my favorite scene in the book
687    + I really like Miranda Otto.
688 2. The attack of the Rohirrim
689 3. Peter Jackson being shot by Legolas
690     - on DVD only
691    He makes a really funny face when it happens.
692 But in the end, not individual scenes matter but the film as a whole.
693 @end group
694 @end example
696 Org-mode supports these lists by tuning filling and wrapping commands
697 to correctly deal with them.  Furthermore, the following commands act
698 on items when the cursor is in the first line of an item (the line
699 with the bullet or number).
701 @table @kbd
702 @kindex @key{TAB}
703 @item @key{TAB}
704 Items can be folded just like headline levels if you set the variable
705 @code{org-cycle-include-plain-lists}.  The level of an item is then
706 given by the indentation of the bullet/number.  However, items are
707 always subordinate to real headlines, the hierarchies remain
708 completely separated.
709 @kindex M-@key{RET}
710 @item M-@key{RET}
711 Insert new item at current level.  With prefix arg, force a new heading
712 (@pxref{Structure editing}).  If this command is used in the middle of a
713 line, the line is @emph{split} and the rest of the line becomes the new
714 item.  If this command is executed in the @emph{whitespace before a bullet or
715 number}, the new item is created @emph{before} the current item.  If the
716 command is executed in the white space before the text that is part of
717 an item but does not contain the bullet, a bullet is added to the
718 current line.
719 @kindex M-S-@key{up}
720 @kindex M-S-@key{down}
721 @item M-S-@key{up}
722 @itemx M-S-@key{down}
723 Move the item including subitems up/down (swap with previous/next item
724 of same indentation).  If the list is ordered, renumbering is
725 automatic.
726 @kindex M-S-@key{left}
727 @kindex M-S-@key{right}
728 @item M-S-@key{left}
729 @itemx M-S-@key{right}
730 Decrease/increase the indentation of the item, including subitems.
731 Initially, the item tree is selected based on current indentation.
732 When these commands are executed several times in direct succession,
733 the initially selected region is used, even if the new indentation
734 would imply a different hierarchy.  To use the new hierarchy, break
735 the command chain with a cursor motion or so.
736 @kindex C-c C-c
737 @item C-c C-c
738 Renumber the ordered list at the cursor.
739 @end table
741 @node Tables, Hyperlinks, Document structure, Top
742 @chapter Tables
743 @cindex tables
744 @cindex editing tables
746 Org-mode has a very fast and intuitive table editor built-in.
747 Spreadsheet-like calculations are supported in connection with the
748 Emacs @file{calc} package.
750 @menu
751 * Built-in table editor::       Simple tables
752 * Narrow columns::              Stop wasting space in tables   
753 * Table calculations::          Compute a field from other fields
754 * orgtbl-mode::                 The table editor as minor mode
755 * table.el::                    Complex tables
756 @end menu
758 @node Built-in table editor, Narrow columns, Tables, Tables
759 @section The built-in table editor
760 @cindex table editor, builtin
762 Org-mode makes it easy to format tables in plain ASCII.  Any line with
763 @samp{|} as the first non-white character is considered part of a
764 table.  @samp{|} is also the column separator.  A table might look
765 like this:
767 @example
768 | Name  | Phone | Age |
769 |-------+-------+-----|
770 | Peter |  1234 |  17 |
771 | Anna  |  4321 |  25 |
772 @end example
774 A table is re-aligned automatically each time you press @key{TAB} or
775 @key{RET} or @kbd{C-c C-c} inside the table.  @key{TAB} also moves to
776 the next field (@key{RET} to the next row) and creates new table rows
777 at the end of the table or before horizontal lines.  The indentation
778 of the table is set by the first line.  Any line starting with
779 @samp{|-} is considered as a horizontal separator line and will be
780 expanded on the next re-align to span the whole table width.  So, to
781 create the above table, you would only type
783 @example
784 |Name|Phone|Age
786 @end example
788 @noindent and then press @key{TAB} to align the table and start filling in
789 fields.
791 When typing text into a field, Org-mode treats @key{DEL},
792 @key{Backspace}, and all character keys in a special way, so that
793 inserting and deleting avoids shifting other fields.  Also, when
794 typing @emph{immediately after the cursor was moved into a new field
795 with @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the
796 field is automatically made blank.  If this behavior is too
797 unpredictable for you, configure the variables
798 @code{org-enable-table-editor} and @code{org-table-auto-blank-field}.
800 @table @kbd
801 @tsubheading{Creation and conversion}
802 @kindex C-c |
803 @item C-c |
804 Convert the active region to table. If every line contains at least one
805 TAB character, the function assumes that the material is tab separated.
806 If not, lines are split at whitespace into fields.  You can use a prefix
807 argument to indicate the minimum number of consecutive spaces required
808 to identify a field separator (default: just one).@* 
809 If there is no active region, this command creates an empty Org-mode
810 table.  However, it's easier to just start typing, like
811 @kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}.
813 @tsubheading{Re-aligning and field motion}
814 @kindex C-c C-c
815 @item C-c C-c
816 Re-align the table without moving the cursor.
818 @kindex @key{TAB}
819 @item @key{TAB}
820 Re-align the table, move to the next field.  Creates a new row if
821 necessary.
823 @kindex S-@key{TAB}
824 @item S-@key{TAB}
825 Re-align, move to previous field.
827 @kindex @key{RET}
828 @item @key{RET}
829 Re-align the table and move down to next row.  Creates a new row if
830 necessary.  At the beginning or end of a line, @key{RET} still does
831 NEWLINE, so it can be used to split a table.
833 @tsubheading{Column and row editing}
834 @kindex M-@key{left}
835 @kindex M-@key{right}
836 @item M-@key{left}
837 @itemx M-@key{right}
838 Move the current column left/right.
840 @kindex M-S-@key{left}
841 @item M-S-@key{left}
842 Kill the current column.
844 @kindex M-S-@key{right}
845 @item M-S-@key{right}
846 Insert a new column to the left of the cursor position.
848 @kindex M-@key{up}
849 @kindex M-@key{down}
850 @item M-@key{up}
851 @itemx M-@key{down}
852 Move the current row up/down.
854 @kindex M-S-@key{up}
855 @item M-S-@key{up}
856 Kill the current row or horizontal line.
858 @kindex M-S-@key{down}
859 @item M-S-@key{down}
860 Insert a new row above (with arg: below) the current row.
862 @kindex C-c -
863 @item C-c -
864 Insert a horizontal line below current row. With prefix arg, the line
865 is created above the current line.
867 @kindex C-c ^
868 @item C-c ^
869 Sort the table lines in the region.  Point and mark must be in the first
870 and last line to be included, and must be in the column that should be
871 used for sorting.  The command prompts for numerical versus
872 alphanumerical sorting.
874 @tsubheading{Regions}
875 @kindex C-c C-x M-w
876 @item C-c C-x M-w
877 Copy a rectangular region from a table to a special clipboard.  Point
878 and mark determine edge fields of the rectangle.  The process ignores
879 horizontal separator lines.
880 @kindex C-c C-x C-w
881 @item C-c C-x C-w
882 Copy a rectangular region from a table to a special clipboard, and
883 blank all fields in the rectangle.  So this is the ``cut'' operation.
884 @kindex C-c C-x C-y
885 @item C-c C-x C-y
886 Paste a rectangular region into a table.
887 The upper right corner ends up in the current field.  All involved fields
888 will be overwritten.  If the rectangle does not fit into the present table,
889 the table is enlarged as needed.  The process ignores horizontal separator
890 lines.
891 @kindex C-c C-q
892 @item C-c C-q
893 Wrap several fields in a column like a paragraph.  If there is an active
894 region, and both point and mark are in the same column, the text in the
895 column is wrapped to minimum width for the given number of lines.  A
896 prefix ARG may be used to change the number of desired lines.  If there
897 is no region, the current field is split at the cursor position and the
898 text fragment to the right of the cursor is prepended to the field one
899 line down. If there is no region, but you specify a prefix ARG, the
900 current field is made blank, and the content is appended to the field
901 above.
903 @tsubheading{Calculations}
904 @cindex formula, in tables
905 @cindex calculations, in tables
906 @kindex C-c =
907 @item C-c =
908 Install a new formula for the current column and replace current field
909 with the result of the formula.
911 @kindex C-u C-c =
912 @item C-u C-c =
913 Install a new formula for the current field, which must be a named
914 field.  Evaluate the formula and replace the field content with the
915 result.
917 @kindex C-c '
918 @item C-c '
919 Edit all formulas associated with the current table in a separate
920 buffer.
922 @kindex C-c *
923 @item C-c *
924 Recalculate the current row by applying the stored formulas from left
925 to right.  When called with a @kbd{C-u} prefix, recalculate the
926 entire table, starting with the first non-header line (i.e. below the
927 first horizontal separator line).  For details, see @ref{Table calculations}.
929 @kindex C-#
930 @item C-#
931 Rotate the calculation mark in first column through the states
932 @samp{}, @samp{#}, @samp{*}, @samp{!}, @samp{$}.  For the meaning of
933 these marks see @ref{Advanced features}.  When there is an active
934 region, change all marks in the region.
936 @kindex C-c ?
937 @item C-c ?
938 Which table column is the cursor in?  Displays number >0 in echo
939 area.
941 @cindex region, active
942 @cindex active region
943 @cindex transient-mark-mode
944 @kindex C-c +
945 @item C-c +
946 Sum the numbers in the current column, or in the rectangle defined by
947 the active region.  The result is shown in the echo area and can
948 be inserted with @kbd{C-y}.
950 @kindex S-@key{RET}
951 @item S-@key{RET}
952 When current field is empty, copy from first non-empty field above.
953 When not empty, copy current field down to next row and move cursor
954 along with it.  Depending on the variable
955 @code{org-table-copy-increment}, integer field values will be
956 incremented during copy.  This key is also used by CUA-mode
957 (@pxref{Interaction}).
959 @tsubheading{Miscellaneous}
960 @kindex C-c `
961 @item C-c `
962 Edit the current field in a separate window.  This is useful for fields
963 that are not fully visible (@pxref{Narrow columns}).  When called with a
964 @kbd{C-u} prefix, just make the full field visible, so that it can be
965 edited in place.
967 @kindex C-c @key{TAB}
968 @item C-c @key{TAB}
969 This is an alias for @kbd{C-u C-c `} to make the current field fully
970 visible.
972 @item M-x org-table-import
973 Import a file as a table.  The table should be TAB- or whitespace
974 separated.  Useful, for example, to import an Excel table or data from a
975 database, because these programs generally can write TAB-separated text
976 files.  This command works by inserting the file into the buffer and
977 then converting the region to a table.  Any prefix argument is passed on
978 to the converter, which uses it to determine the separator.
980 @item M-x org-table-export
981 Export the table as a TAB-separated file.  Useful for data exchange with,
982 for example, Excel or database programs.
984 @end table
986 If you don't like the automatic table editor because it gets in your
987 way on lines which you would like to start with @samp{|}, you can turn
988 it off with
990 @lisp
991 (setq org-enable-table-editor nil)
992 @end lisp
994 @noindent The only table command which then still works is
995 @kbd{C-c C-c} to do a manual re-align.
997 @node Narrow columns, Table calculations, Built-in table editor, Tables
998 @section Narrow columns
999 @cindex narrow columns in tables
1001 The width of columns is automatically determined by the table editor.
1002 Sometimes a single field or a few fields need to carry more text,
1003 leading to inconveniently wide columns.  To limit@footnote{This feature
1004 does not work on XEmacs.} the width of a column, one field anywhere in
1005 the column may contain just the string @samp{<N>} where @samp{N} is an
1006 integer specifying the width of the column in characters.  The next
1007 re-align will then set the width of this column to no more than this
1008 value.
1010 @example
1011 |---+------------------------------|               |---+--------|
1012 |   |                              |               |   | <6>    |
1013 | 1 | one                          |               | 1 | one    |
1014 | 2 | two                          |     ----\     | 2 | two    |
1015 | 3 | This is a long chunk of text |     ----/     | 3 | This=> |
1016 | 4 | four                         |               | 4 | four   |
1017 |---+------------------------------|               |---+--------|
1018 @end example
1020 @noindent
1021 Fields that are wider become clipped and end in the string @samp{=>}.
1022 Note that the full text is still in the buffer, it is only invisible.
1023 To see the full text, hold the mouse over the field - a tooltip window
1024 will show the full content.  To edit such a field, use the command
1025 @kbd{C-c `} (that is @kbd{C-c} followed by the backquote).  This will
1026 open a new window with the full field.  Edit it and finish with @kbd{C-c
1027 C-c}.
1029 When visiting a file containing a table with narrowed columns, the
1030 necessary character hiding has not yet happened, and the table needs to
1031 be aligned before it looks nice.  Setting the option
1032 @code{org-startup-align-all-tables} will realign all tables in a file
1033 upon visiting, but also slow down startup.  You can also set this option
1034 on a per-file basis with:
1036 @example
1037 #+STARTUP: align
1038 #+STARTUP: noalign
1039 @end example
1041 @node Table calculations, orgtbl-mode, Narrow columns, Tables
1042 @section Calculations in tables
1043 @cindex calculations, in tables
1044 @cindex spreadsheet capabilities
1045 @cindex @file{calc} package
1047 The table editor makes use of the Emacs @file{calc} package to
1048 implement spreadsheet-like capabilities.  Org-mode has two levels of
1049 complexity for table calculations.  On the basic level, tables do only
1050 horizontal computations, so a field can be computed from other fields
1051 @emph{in the same row}, and Org-mode assumes that there is only one
1052 formula for each column.  This is very efficient to work with and
1053 enough for many tasks.  On the complex level, columns and individual
1054 fields can be named for easier referencing in formulas, individual
1055 named fields can have their own formula associated with them, and
1056 recalculation can be automated.
1058 @menu
1059 * Formula syntax::              How to write a formula
1060 * Column formulas::             Formulas valid for all fields in a column
1061 * Advanced features::           Field names, parameters and automatic recalc
1062 * Named-field formulas::        Formulas valid in single fields
1063 * Editing/debugging formulas::  Changing a stored formula
1064 * Appetizer::                   Taste the power of calc
1065 @end menu
1067 @node Formula syntax, Column formulas, Table calculations, Table calculations
1068 @subsection Formula syntax
1069 @cindex formula syntax
1070 @cindex syntax, of formulas
1072 A formula can be any algebraic expression understood by the Emacs
1073 @file{calc} package.  Note that @file{calc} has the slightly
1074 non-standard convention that @samp{/} has lower precedence than
1075 @samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.  Before
1076 evaluation by @code{calc-eval} (@pxref{Calling Calc from Your
1077 Programs,calc-eval,Calling calc from Your Lisp Programs,calc,GNU Emacs
1078 Calc Manual}), variable substitution takes place:
1080 @example
1081   $        @r{refers to the current field}
1082   $3       @r{refers to the field in column 3 of the current row}
1083   $3..$7   @r{a vector of the fields in columns 3-7 of current row}
1084   $P1..$P3 @r{vector of column range, using column names}
1085   &2       @r{second data field above the current, in same column}
1086   &5-2     @r{vector from fifth to second field above current}
1087   &III-II  @r{vector of fields between 2nd and 3rd hline above}
1088   &III     @r{vector of fields between third hline above and current field}
1089   $name    @r{a named field, parameter or constant}
1090 @end example
1092 @cindex vectors, in table calculations
1093 The range vectors can be directly fed into the calc vector functions
1094 like @samp{vmean} and @samp{vsum}.
1096 @cindex name, of column or field
1097 @cindex constants, in calculations
1098 @samp{$name} is interpreted as the name of a column, parameter or
1099 constant.  Constants are defined globally through the variable
1100 @code{org-table-formula-constants}.  If you have the
1101 @file{constants.el} package, it will also be used to resolve
1102 constants, including natural constants like @samp{$h} for Planck's
1103 constant, and units like @samp{$km} for kilometers.  Column names and
1104 parameters can be specified in special table lines.  These are
1105 described below, see @ref{Advanced features}.
1107 @cindex format specifier
1108 @cindex mode, for @file{calc}
1109 A formula can contain an optional mode string after a semicolon.  This
1110 string consists of flags to influence calc's modes@footnote{By
1111 default, Org-mode uses the standard calc modes (precision 12, angular
1112 units degrees, fraction and symbolic modes off).  However, the display
1113 format has been changed to @code{(float 5)} to keep tables compact.
1114 The default settings can be configured using the variable
1115 @code{org-calc-default-modes}.} during execution, e.g.  @samp{p20} to
1116 switch the internal precision to 20 digits, @samp{n3}, @samp{s3},
1117 @samp{e2} or @samp{f4} to switch to normal, scientific, engineering,
1118 or fixed display format, respectively, and @samp{D}, @samp{R}, @samp{F},
1119 and @samp{S} to turn on degrees, radians, fraction and symbolic modes,
1120 respectively.  In addition, you may provide a @code{printf} format
1121 specifier to reformat the final result.  A few examples:
1123 @example
1124   $1+$2                @r{Sum of first and second field}
1125   $1+$2;%.2f           @r{Same, format result to two decimals}
1126   exp($2)+exp($1)      @r{Math functions can be used}
1127   $;%.1f               @r{Reformat current cell to 1 decimal}
1128   ($3-32)*5/9          @r{Degrees F -> C conversion}
1129   $c/$1/$cm            @r{Hz -> cm conversion, using @file{constants.el}}
1130   tan($1);Dp3s1        @r{Compute in degrees, precision 3, display SCI 1}
1131   sin($1);Dp3%.1e      @r{Same, but use printf specifier for display}
1132   vmean($2..$7)        @r{Compute column range mean, using vector function}
1133   vsum(&III)           @r{Sum numbers from 3rd hline above, up to here}
1134   taylor($3,x=7,2)     @r{taylor series of $3, at x=7, second degree}
1135 @end example
1137 @node Column formulas, Advanced features, Formula syntax, Table calculations
1138 @subsection Column formulas
1139 @cindex column formula
1140 @cindex formula, for table column
1142 To apply a formula to a field, type it directly into the field,
1143 preceded by an equal sign, like @samp{=$1+$2}.  When you press
1144 @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in the
1145 field, the formula will be stored as the formula for the current
1146 column, evaluated and the current field replaced with the result.  If
1147 the field contains only @samp{=}, the previously stored formula for
1148 this column is used.
1150 For each column, Org-mode will remember the most recently used
1151 formula.  The information is stored in a special line starting with
1152 @samp{#+TBLFM} directly below the table.  When adding/deleting/moving
1153 columns with the appropriate commands, the stored equations will be
1154 modified accordingly.  When a column used in a calculation is removed,
1155 references to this column become invalid and will cause an error upon
1156 applying the equation.
1158 Instead of typing an equation into the field, you may also use the
1159 command @kbd{C-c =}.  It prompts for a formula (with default taken
1160 from the @samp{#+TBLFM:} line) and applies it to the current field.  A
1161 numerical prefix (e.g. @kbd{C-5 C-c =}) will apply it to that many
1162 subsequent fields in the current column.
1164 @cindex recomputing table fields
1165 To recompute all the fields in a line, use the command @kbd{C-c *}.
1166 It re-applies all stored equations to the current row, from left to
1167 right.  With a @kbd{C-u} prefix, this will be done to every line in
1168 the table, so use this command it you want to make sure the entire
1169 table is up-to-date. @kbd{C-u C-c C-c} is another way to update the
1170 entire table.  Global updating does not touch the line(s) above the
1171 first horizontal separator line, assuming that this is the table
1172 header.
1174 @node Advanced features, Named-field formulas, Column formulas, Table calculations
1175 @subsection Advanced features
1177 If you want the recalculation of fields to happen automatically,
1178 or if you want to be able to assign a formula to an individual field
1179 (instead of an entire column) you need to reserve the first column of
1180 the table for special marking characters.  Here is an example of a
1181 table that collects exam results of students and makes use of these
1182 features:
1184 @example
1185 @group
1186 |---+---------+--------+--------+--------+-------+------|
1187 |   | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
1188 |---+---------+--------+--------+--------+-------+------|
1189 | ! |         |     P1 |     P2 |     P3 |   Tot |      |
1190 | # | Maximum |     10 |     15 |     25 |    50 | 10.0 |
1191 | ^ |         |     m1 |     m2 |     m3 |    mt |      |
1192 |---+---------+--------+--------+--------+-------+------|
1193 | # | Peter   |     10 |      8 |     23 |    41 |  8.2 |
1194 | # | Sara    |      6 |     14 |     19 |    39 |  7.8 |
1195 | # | Sam     |      2 |      4 |      3 |     9 |  1.8 |
1196 |---+---------+--------+--------+--------+-------+------|
1197 |   | Average |        |        |        |  29.7 |      |
1198 | ^ |         |        |        |        |    at |      |
1199 | $ | max=50  |        |        |        |       |      |
1200 |---+---------+--------+--------+--------+-------+------|
1201 #+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(&II);%.1f
1202 @end group
1203 @end example
1205 @noindent @b{Important}: Please note that for these special tables,
1206 recalculating the table with @kbd{C-u C-c *} will only affect rows
1207 which are marked @samp{#} or @samp{*}, and named fields.  The column
1208 formulas are not applied in rows with empty first field.
1210 @cindex marking characters, tables
1211 The marking characters have the following meaning:
1212 @table @samp
1213 @item !
1214 The fields in this line define names for the columns, so that you may
1215 refer to a column as @samp{$Tot} instead of @samp{$6}.
1216 @item ^
1217 This row defines names for the fields @emph{above} the row.  With such
1218 a definition, any formula in the table may use @samp{$m1} to refer to
1219 the value @samp{10}.  Also, named fields can have their own formula
1220 associated with them.
1221 @item _
1222 Similar to @samp{^}, but defines names for the fields in the row
1223 @emph{below}.
1224 @item $
1225 Fields in this row can define @emph{parameters} for formulas.  For
1226 example, if a field in a @samp{$} row contains @samp{max=50}, then
1227 formulas in this table can refer to the value 50 using @samp{$max}.
1228 Parameters work exactly like constants, only that they can be defined on
1229 a per-table basis.  Changing a parameter and then recalculating the
1230 table can be useful.
1231 @item #
1232 Fields in this row are automatically recalculated when pressing
1233 @key{TAB} or @key{RET} or @kbd{S-@key{TAB}} in this row.  Also, this row
1234 is selected for a global recalculation with @kbd{C-u C-c *}.  Unmarked
1235 lines will be left alone by this command.
1236 @item *
1237 Selects this line for global recalculation with @kbd{C-u C-c *}, but
1238 not for automatic recalculation.  Use this when automatic
1239 recalculation slows down editing too much.
1240 @item
1241 Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}.
1242 All lines that should be recalculated should be marked with @samp{#}
1243 or @samp{*}.
1244 @end table
1246 @node Named-field formulas, Editing/debugging formulas, Advanced features, Table calculations
1247 @subsection Named-field formulas
1248 @cindex named field formula
1249 @cindex formula, for named table field
1251 A named field can have its own formula associated with it.  In the
1252 example above, this is used for the @samp{at} field that contains
1253 the average result of the students.  To enter a formula for a named
1254 field, just type it into the buffer, preceded by @samp{:=}.  Or use
1255 @kbd{C-u C-c =}.  This equation will be stored below the table like
1256 @samp{$name=...}.  Any recalculation in the table (even if only
1257 requested for the current line) will also update all named field
1258 formulas.
1260 @node Editing/debugging formulas, Appetizer, Named-field formulas, Table calculations
1261 @subsection Editing and debugging formulas
1262 @cindex formula editing
1263 @cindex editing, of table formulas
1265 To edit a column or field formula, use the commands @kbd{C-c
1266 =} and @kbd{C-u C-c =}, respectively.  The currently active expression
1267 is then presented as default in the minibuffer, where it may be edited.
1269 Note that making a table field blank does not remove the formula
1270 associated with the field - during the next recalculation the field
1271 will be filled again.  To remove a formula from a field, you have to
1272 give an empty reply when prompted for the formula, or to edit the
1273 @samp{#+TBLFM} line.
1275 @kindex C-c C-c
1276 You may edit the @samp{#+TBLFM} directly and re-apply
1277 the changed equations with @kbd{C-c C-c} in that line, or with the
1278 normal recalculation commands in the table.
1280 @kindex C-c '
1281 @kindex C-c C-c
1282 @kindex C-c C-q
1283 @kindex C-c ?
1284 In particular for large tables with many formulas, it is convenient to
1285 use the command @kbd{C-c '} to edit the formulas of the current table
1286 in a separate buffer.  That buffer will show the formulas one per
1287 line, and you are free to edit, add and remove formulas.  Press
1288 @kbd{C-c ?} on a @samp{$...}  expression to get information about its
1289 interpretation.  Exiting the buffer with @kbd{C-c C-c} only stores the
1290 modified formulas below the table.  Exiting with @kbd{C-u C-c C-c}
1291 also applies them to the entire table.  @kbd{C-c C-q} exits without
1292 installing the changes.
1294 When the evaluation of a formula leads to an error, the field content
1295 becomes the string @samp{#ERROR}.  If you would like see what is going
1296 on during variable substitution and calculation in order to find a
1297 bug, turn on formula debugging in the menu and repeat the calculation,
1298 for example by pressing @kbd{C-c = @key{RET}} in a field.
1299 Detailed information will be displayed.
1301 @node Appetizer,  , Editing/debugging formulas, Table calculations
1302 @subsection Appetizer
1304 Finally, just to wet your appetite on what can be done with the fantastic
1305 @file{calc} package, here is a table that computes the Taylor series
1306 for a couple of functions (homework: try that with Excel :-)
1308 @example
1309 @group
1310 |---+-------------+---+-----+--------------------------------------|
1311 |   | Func        | n | x   | Result                               |
1312 |---+-------------+---+-----+--------------------------------------|
1313 | # | exp(x)      | 1 | x   | 1 + x                                |
1314 | # | exp(x)      | 2 | x   | 1 + x + x^2 / 2                      |
1315 | # | exp(x)      | 3 | x   | 1 + x + x^2 / 2 + x^3 / 6            |
1316 | # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 |
1317 | # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2    |
1318 | * | tan(x)      | 3 | x   | 0.0175 x + 1.77e-6 x^3               |
1319 |---+-------------+---+-----+--------------------------------------|
1320 #+TBLFM: $5=taylor($2,$4,$3);n3
1321 @end group
1322 @end example
1324 @node orgtbl-mode, table.el, Table calculations, Tables
1325 @section The Orgtbl minor mode
1326 @cindex orgtbl-mode
1327 @cindex minor mode for tables
1329 If you like the intuitive way the Org-mode table editor works, you
1330 might want to use it also in other modes like text-mode or mail-mode.
1331 The minor mode Orgtbl-mode makes this possible.  You can always toggle
1332 the mode with @kbd{M-x orgtbl-mode}.  To turn it on by default, for
1333 example in mail mode, use
1335 @lisp
1336 (add-hook 'mail-mode-hook 'turn-on-orgtbl)
1337 @end lisp
1339 @node table.el,  , orgtbl-mode, Tables
1340 @section The @file{table.el} package
1341 @kindex C-c C-c
1342 @cindex table editor, @file{table.el}
1343 @cindex @file{table.el}
1345 Complex ASCII tables with automatic line wrapping, column- and
1346 row-spanning, and alignment can be created using the Emacs table
1347 package by Takaaki Ota (@uref{http://sourceforge.net/projects/table},
1348 and also part of Emacs 22).
1349 When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org-mode
1350 will call @command{table-recognize-table} and move the cursor into the
1351 table.  Inside a table, the keymap of Org-mode is inactive.  In order
1352 to execute Org-mode-related commands, leave the table.
1354 @table @kbd
1355 @kindex C-c C-c
1356 @item C-c C-c
1357 Recognize @file{table.el} table.  Works when the cursor is in a
1358 table.el table.
1360 @kindex C-c ~
1361 @item C-c ~
1362 Insert a table.el table.  If there is already a table at point, this
1363 command converts it between the table.el format and the Org-mode
1364 format.  See the documentation string of the command
1365 @code{org-convert-table} for the restrictions under which this is
1366 possible.
1367 @end table
1369 @node Hyperlinks, TODO items, Tables, Top
1370 @chapter Hyperlinks
1371 @cindex hyperlinks
1373 Just like HMTL, Org-mode provides links inside a file, and external
1374 links to other files, Usenet articles, emails and much more.
1376 @menu
1377 * Link format::                 How links in Org-mode are formatted
1378 * Internal links::              Links to other places in the current file
1379 * External links::              URL-like links to the world
1380 * Handling links::              Creating, inserting and following
1381 * Search options::              Linking to a specific location
1382 * Custom searches::             When the default search is not enough
1383 * Remember::                    Org-trees store quick notes
1384 @end menu
1386 @node Link format, Internal links, Hyperlinks, Hyperlinks
1387 @section Link format
1388 @cindex link format
1389 @cindex format, of links
1391 Org-mode will recognize plain URL-like links and activate them as
1392 clickable links.  However, the general link format looks like this:
1394 @example
1395 [[link][description]]       @r{or alternatively}           [[link]]  
1396 @end example
1398 Once a link in the buffer is complete (all brackets present), Org-mode
1399 will change the display so that @samp{description} is displayed instead
1400 of @samp{[[link][description]]} and @samp{link} is displayed instead of
1401 @samp{[[link]]}.  Links will be highlighted in the face @code{org-link},
1402 which by default is an underlined face.  You can directly edit the
1403 visible part of a link.  Note that this can be either the @samp{link}
1404 part (if there is not description) or the @samp{description} part.  To
1405 edit also the invisible @samp{link} part, use @kbd{C-c C-l} with the
1406 cursor on the link.
1408 If you place the cursor at the beginning or just behind the end of the
1409 displayed text and press @key{BACKSPACE}, you will remove the
1410 (invisible) bracket at that location.  This makes the link incomplete
1411 and the internals are again displayed as plain text.  Inserting the
1412 missing bracket does hide the link internals again.  To show the
1413 internal structure of all links, use the menu entry
1414 @code{Org->Hyperlinks->Literal links}.
1416 @node Internal links, External links, Link format, Hyperlinks
1417 @section Internal links
1418 @cindex internal links
1419 @cindex links, internal
1420 @cindex CamelCase links
1422 If the link does not look like a URL, it is considered to be internal in
1423 the current file.  Links such as @samp{[[My Target]]} or @samp{[[My
1424 Target][Find my target]]} lead to a text search in the current file.
1425 The link can be followed with @kbd{C-c C-o} when the cursor is on the
1426 link, or with a mouse click (@pxref{Handling links}).  The preferred
1427 match for such a link is a dedicated target: The same string in double
1428 angular brackets.  Targets may be located anywhere, often it is
1429 convenient to put them into a comment line, for example
1431 @example
1432 # <<My Target>>
1433 @end example
1435 @noindent In HTML export (@pxref{HTML export}), such targets will become
1436 named anchors for direct access through @samp{http} links.
1438 If no dedicated target exists, Org-mode will search for the words in the
1439 link.  In the above example the search would be for @samp{my target}.
1440 Links starting with a star like @samp{*My Target} restrict the search to
1441 headlines.  When searching, Org-mode will first try an exact match, but
1442 then move on to more and more lenient searches.  For example, the link
1443 @samp{[[*My Targets]]} will find any of the following:
1445 @example
1446 ** My targets
1447 ** TODO my targets are bright
1448 ** my 20 targets are
1449 @end example
1451 To insert a link targeting a headline, in-buffer completion can be used.
1452 Just type a star followed by a few optional letters into the buffer and
1453 press @kbd{M-@key{TAB}}.  All headlines in the current buffer will be
1454 offered as completions.  @xref{Handling links}, for more commands
1455 creating links.
1457 Following a link pushes a mark onto Org-mode's own mark ring.  You can
1458 return to the previous position with @kbd{C-c &}.  Using this command
1459 several times in direct succession goes back to positions recorded
1460 earlier.
1462 @menu
1463 * Radio targets::               Make targets trigger links in plain text.
1464 * CamelCase links::             Activating CamelCase words as links
1465 @end menu
1467 @node Radio targets, CamelCase links, Internal links, Internal links
1468 @subsection Radio targets
1470 You can configure Org-mode to link any occurrences of certain target
1471 names in normal text.  So without explicitly creating a link, the text
1472 connects to the target radioing its position.  Radio targets are
1473 enclosed by triple angular brackets.  For example, a target
1474 @samp{<<<My Target>>>} causes each occurrence of @samp{my target} in
1475 normal text to become activated as a link.  The Org-mode file is
1476 scanned automatically for radio targets only when the file is first
1477 loaded into Emacs.  To update the target list during editing, press
1478 @kbd{C-c C-c} with the cursor on or at a target.
1480 @node CamelCase links,  , Radio targets, Internal links
1481 @subsection CamelCase words as links
1482 @cindex completion, of CamelCase links
1483 @cindex CamelCase links, completion of
1485 Org-mode also supports CamelCase words as links.  This feature is not
1486 turned on by default because of the inconsistencies this system suffers
1487 from.  To activate CamelCase words as links, you need to customize
1488 the option @code{org-activate-links}.  A CamelCase word then leads to a
1489 text search such that @samp{CamelCaseLink} is equivalent to
1490 @samp{[[camel case link]]}.
1492 @node External links, Handling links, Internal links, Hyperlinks
1493 @section External links
1494 @cindex links, external
1495 @cindex external links
1496 @cindex links, external
1497 @cindex GNUS links
1498 @cindex BBDB links
1499 @cindex URL links
1500 @cindex file links
1501 @cindex VM links
1502 @cindex RMAIL links
1503 @cindex WANDERLUST links
1504 @cindex MH-E links
1505 @cindex USENET links
1506 @cindex SHELL links
1508 Org-mode supports links to files, websites, Usenet and email messages;
1509 and BBDB database entries.  External links are URL-like locators.  The
1510 following list shows examples for each link type.
1512 @example
1513 http://www.astro.uva.nl/~dominik         @r{on the web}
1514 file:/home/dominik/images/jupiter.jpg    @r{file, absolute path}
1515 file:papers/last.pdf                     @r{file, relative path}
1516 news:comp.emacs                          @r{Usenet link}
1517 mailto:adent@@galaxy.net                  @r{Mail link}
1518 vm:folder                                @r{VM folder link}
1519 vm:folder#id                             @r{VM message link}
1520 vm://myself@@some.where.org/folder#id     @r{VM on remote machine}
1521 wl:folder                                @r{WANDERLUST folder link}
1522 wl:folder#id                             @r{WANDERLUST message link}
1523 mhe:folder                               @r{MH-E folder link}
1524 mhe:folder#id                            @r{MH-E message link}
1525 rmail:folder                             @r{RMAIL folder link}
1526 rmail:folder#id                          @r{RMAIL message link}
1527 gnus:group                               @r{GNUS group link}
1528 gnus:group#id                            @r{GNUS article link}
1529 bbdb:Richard Stallman                    @r{BBDB link}
1530 shell:ls *.org                           @r{A shell command}
1531 @end example
1533 A link should be enclosed in double brackets and may contain a
1534 descriptive text to be displayed instead of the url (@pxref{Link
1535 format}), for example:
1537 @example
1538 [[http://www.gnu.org/software/emacs/][GNU Emacs]]
1539 @end example
1541 @cindex angular brackets, around links
1542 @cindex plain text external links
1543 Org-mode also finds external links in the normal text and activates them
1544 as links.  If spaces must be part of the link (for example in
1545 @samp{bbdb:Richard Stallman}) or to remove ambiguities about the end of
1546 the link, enclose them in angular brackets.
1548 @node Handling links, Search options, External links, Hyperlinks
1549 @section Handling links
1551 Org-mode provides methods to create a link in the correct syntax, to
1552 insert it into an org-mode file, and to follow the link.
1554 @table @kbd
1555 @kindex C-c l
1556 @cindex storing links
1557 @item C-c l
1558 Store a link to the current location.  This is a @emph{global} command
1559 which can be used in any buffer to create a link.  The link will be
1560 stored for later insertion into an Org-mode buffer (see below).  For
1561 Org-mode files, if there is a @samp{<<target>>} at the cursor, the link
1562 points to the target.  Otherwise it points to the current headline.  For
1563 VM, RMAIL, WANDERLUST, MH-E, GNUS and BBDB buffers, the link will
1564 indicate to the current article/entry.  For W3 and W3M buffers, the link
1565 goes to the current URL.  For any other files, the link will point to
1566 the file, with a search string (@pxref{Search options}) pointing to the
1567 contents of the current line.  If there is an active region, the
1568 selected words will form the basis of the search string.  If the
1569 automatically created link is not working correctly or accurately
1570 enough, you can write custom functions to select the search string and
1571 to do the search for particular file types - see @ref{Custom searches}.
1572 The key binding @kbd{C-c l} is only a suggestion - see @ref{Installation
1573 and activation}.
1575 @kindex C-c C-l
1576 @cindex link completion
1577 @cindex completion, of links
1578 @cindex inserting links
1579 @item C-c C-l
1580 Insert a link.  This prompts for a link to be inserted into the buffer.
1581 You can just type a link, using text for an internal link, or one of the
1582 link type prefixes mentioned in the examples above.  Through completion,
1583 all links stored during the current session can be accessed.  The link
1584 will be inserted into the buffer, along with a descriptive text.  Note
1585 that you don't have to use this command to insert a link.  Links in
1586 Org-mode are plain text, and you can type or paste them straight into
1587 the buffer.  By using this command, the links are automatically enclosed
1588 in double brackets, and you will be asked for the optional descriptive
1589 text.
1591 @kindex C-u C-c C-l
1592 @cindex file name completion
1593 @cindex completion, of file names
1594 @item C-u C-c C-l
1595 When @kbd{C-c C-l} is called with a @kbd{C-u} prefix argument, a link to
1596 a file will be inserted and you may use file name completion to select
1597 the name of the file.  The path to the file is inserted relative to the
1598 directory of the current org file, if the linked file is in the current
1599 directory or in a subdirectory of it, or if the path is written relative
1600 to the current directory using @samp{../}.  Otherwise an absolute path
1601 is used, if possible with @samp{~/} for your home directory.  You can
1602 force an absolute path with two @kbd{C-u} prefixes.
1604 @item C-c C-l @r{with cursor on existing link}
1605 When the cursor is on an existing link, @kbd{C-c C-l} allows to edit the
1606 link and description parts of the link.
1608 @cindex following links
1609 @kindex C-c C-o
1610 @item C-c C-o
1611 Open link at point.  This will launch a web browser for URLs (using
1612 @command{browse-url-at-point}), run vm/mh-e/wanderlust/rmail/gnus/bbdb
1613 for the corresponding links, and execute the command in a shell link.
1614 When the cursor is on an internal link, this commands runs the
1615 corresponding search.  When the cursor is on a TAGS list in a headline,
1616 it creates the corresponding TAGS view.  If the cursor is on a time
1617 stamp, it compiles the agenda for that date.  Furthermore, it will visit
1618 text files in @samp{file:} links with Emacs and select a suitable
1619 application for non-text files.  Classification of files is based on
1620 file extension only.  See option @code{org-file-apps}.  If you want to
1621 override the default application and visit the file with Emacs, use a
1622 @kbd{C-u} prefix.
1624 @kindex mouse-2
1625 @kindex mouse-1
1626 @item mouse-2
1627 @itemx mouse-1
1628 On links, @kbd{mouse-2} will open the link just like @kbd{C-c C-o}
1629 would.  Under Emacs 22, also @kbd{mouse-1} will follow a link.
1631 @kindex mouse-3
1632 @item mouse-3
1633 Like @kbd{mouse-2}, but force file links to be opened with Emacs.
1635 @cindex mark ring
1636 @kindex C-c %
1637 @item C-c %
1638 Push the current position onto the mark ring, to be able to return
1639 easily. Commands following an internal link do this automatically.
1641 @cindex links, returning to
1642 @kindex C-c &
1643 @item C-c &
1644 Jump back to a recorded position.  A position is recorded by the
1645 commands following internal links, and by @kbd{C-c %}.  Using this
1646 command several times in direct succession moves through a ring of
1647 previously recorded positions.
1648 @end table
1651 @node Search options, Custom searches, Handling links, Hyperlinks
1652 @section Search options in file links
1653 @cindex search option in file links
1654 @cindex file links, searching
1656 File links can contain additional information to make Emacs jump to a
1657 particular location in the file when following a link.  This can be a
1658 line number or a search option after a double@footnote{For backward
1659 compatibility, line numbers can also follow a single colon.} colon. For
1660 example, when the command @kbd{C-c l} creates a link (@pxref{Handling
1661 links}) to a file, it encodes the words in the current line as a search
1662 string that can be used to find this line back later when following the
1663 link with @kbd{C-c C-o}. 
1665 Here is the syntax of the different ways to attach a search to a file
1666 link, together with an explanation:
1668 @example
1669 [[file:~/code/main.c::255]]
1670 [[file:~/xx.org::My Target]]
1671 [[file:~/xx.org::*My Target]]
1672 [[file:~/xx.org::/regexp/]]
1673 @end example
1675 @table @code
1676 @item 255
1677 Jump to line 255.
1678 @item My Target
1679 Search for a link target @samp{<<My Target>>}, or do a text search for
1680 @samp{my target}, similar to the search in internal links, see
1681 @ref{Internal links}.  In HTML export (@pxref{HTML export}), such a file
1682 link will become an html reference to the corresponding named anchor in
1683 the linked file.
1684 @item *My Target
1685 In an Org-mode file, restrict search to headlines.
1686 @item /regexp/
1687 Do a regular expression search for @code{regexp}.  This uses the Emacs
1688 command @code{occur} to list all matches in a separate window.  If the
1689 target file is in Org-mode, @code{org-occur} is used to create a
1690 sparse tree with the matches.
1691 @c If the target file is a directory,
1692 @c @code{grep} will be used to search all files in the directory.
1693 @end table
1695 As a degenerate case, a file link with an empty file name can be used
1696 to search the current file.  For example, @code{<file:::find me>} does
1697 a search for @samp{find me} in the current file, just like
1698 @samp{[[find me]]} would.
1700 @node Custom searches, Remember, Search options, Hyperlinks
1701 @section Custom Searches
1702 @cindex custom search strings
1704 The default mechanism for creating search strings and for doing the
1705 actual search related to a file link may not work correctly in all
1706 cases.  For example, BibTeX database files have many entries like
1707 @samp{year="1993"} which would not result in good search strings,
1708 because the only unique identification for a BibTeX entry is the
1709 citation key.
1711 If you come across such a problem, you can write custom functions to set
1712 the right search string for a particular file type, and to do the search
1713 for the string in the file.  Using @code{add-hook}, these functions need
1714 to be added to the hook variables
1715 @code{org-create-file-search-functions} and
1716 @code{org-execute-file-search-functions}.  See the docstring for these
1717 variables for more information.  Org-mode actually uses this mechanism
1718 for Bib@TeX{} database files, and you can use the corresponding code as
1719 an implementation example.  Search for @samp{BibTeX links} in the source
1720 file.
1723 @node Remember,  , Custom searches, Hyperlinks
1724 @section Remember
1725 @cindex @file{remember.el}
1727 Another way to create org entries with links to other files is through
1728 the @emph{Remember} package by John Wiegley.  @emph{Remember} lets you
1729 store quick notes with little interruption of your work flow.  See
1730 @uref{http://www.emacswiki.org/cgi-bin/wiki/RememberMode} for more
1731 information.  The notes produced by @emph{Remember} can be stored in
1732 different ways, and Org-mode files are a good target.  Org-mode allows
1733 to file away notes either to a default file, or directly to the
1734 correct location in your Org-mode outline tree.  The following
1735 customization@footnote{The three autoload forms are only necessary if
1736 @file{org.el} is not part of the Emacs distribution or an XEmacs
1737 package.} will tell @emph{Remember} to use org files as target, and to
1738 create annotations compatible with Org-mode links.
1740 @example
1741 (setq org-directory "~/path/to/my/orgfiles/")
1742 (setq org-default-notes-file "~/.notes")
1743 (autoload 'org-remember-annotation "org")
1744 (autoload 'org-remember-apply-template "org")
1745 (autoload 'org-remember-handler "org")
1746 (setq remember-annotation-functions '(org-remember-annotation))
1747 (setq remember-handler-functions '(org-remember-handler))
1748 (add-hook 'remember-mode-hook 'org-remember-apply-template)
1749 @end example
1751 @cindex templates, for remember
1752 In combination with Org-mode, you can use templates to generate
1753 different types of remember notes.  For example, if you would like to
1754 use one template to create general TODO entries, and another one for
1755 journal entries, you could use:
1757 @example
1758 (setq org-remember-templates
1759       '((?t "* TODO %?\n  %i\n  %a" "~/org/TODO.org")
1760         (?j "* %U %?\n\n  %i\n  %a" "~/org/JOURNAL.org")))
1761 @end example
1763 @noindent In these entries, the character specifies how to select the
1764 template, the first string specifies the template, and the (optional)
1765 second string specifies a default file (overruling
1766 @code{org-default-notes-file}) as a target for this note.
1768 When you call @kbd{M-x remember} to remember something, org will prompt
1769 for a key to select the template and then prepare the buffer like
1770 @example
1771 * TODO
1772   <file:link to where you called remember>
1773 @end example
1775 @noindent or
1777 @example
1778 * [2006-03-21 Tue 15:37]
1780   <file:link to where you called remember>
1781 @end example
1783 @noindent See the variable @code{org-remember-templates} for more details.
1785 When you are finished composing a note with remember, you have to press
1786 @kbd{C-c C-c} to file the note away.  The handler first prompts for a
1787 target file - if you press @key{RET}, the value of
1788 @code{org-default-notes-file} is used.  Then the command offers the
1789 headings tree of the selected file.  You can either immediately press
1790 @key{RET} to get the note appended to the file.  Or you can use vertical
1791 cursor motion (@key{up} and @key{down}) and visibility cycling
1792 (@key{TAB}) to find a better place.  Pressing @key{RET} or @key{left} or
1793 @key{right} leads to the following result.
1795 @multitable @columnfractions 0.2 0.1 0.7
1796 @item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted}
1797 @item buffer-start @tab @key{RET} @tab as level 2 heading at end of file
1798 @item on headline @tab @key{RET} @tab as sublevel of the heading at cursor
1799 @item             @tab @key{left}  @tab as same level, before current heading
1800 @item             @tab @key{right} @tab as same level, after current heading
1801 @item not on headline @tab @key{RET}
1802       @tab at cursor position, level taken from context.
1803            Or use prefix arg to specify level manually.
1804 @end multitable
1806 So a fast way to store the note is to press @kbd{C-c C-c @key{RET}
1807 @key{RET}} to append it to the default file.  Even shorter would be
1808 @kbd{C-u C-c C-c}, which does the same without even showing the tree.
1809 But with little extra effort, you can push it directly to the correct
1810 location.
1812 Before inserting the text into a tree, the function ensures that the
1813 text has a headline, i.e. a first line that starts with a @samp{*}.
1814 If not, a headline is constructed from the current date and some
1815 additional data.  If the variable @code{org-adapt-indentation} is
1816 non-nil, the entire text is also indented so that it starts in the
1817 same column as the headline (after the asterisks).
1820 @node TODO items, Timestamps, Hyperlinks, Top
1821 @chapter TODO items
1822 @cindex TODO items
1824 Org-mode does not maintain TODO lists as a separate document.  TODO
1825 items are an integral part of the notes file, because TODO items
1826 usually come up while taking notes!  With Org-mode, you simply mark
1827 any entry in a tree as being a TODO item.  In this way, the
1828 information is not duplicated, and the entire context from which the
1829 item emerged is always present when you check.
1831 Of course, this technique causes TODO items to be scattered throughout
1832 your file.  Org-mode provides methods to give you an overview over all
1833 things you have to do.
1835 @menu
1836 * TODO basics::                 Marking and displaying TODO entries
1837 * Progress logging::            Document your productivity
1838 * TODO extensions::             Workflow and assignments
1839 * Priorities::                  Some things are more important than others
1840 @end menu
1842 @node TODO basics, Progress logging, TODO items, TODO items
1843 @section Basic TODO functionality
1845 Any headline can become a TODO item by starting it with the word TODO,
1846 for example:
1848 @example
1849 *** TODO Write letter to Sam Fortune
1850 @end example
1852 @noindent
1853 The most important commands to work with TODO entries are:
1855 @table @kbd
1856 @kindex C-c C-t
1857 @cindex cycling, of TODO states
1858 @item C-c C-t
1859 Rotate the TODO state of the current item between
1861 @example
1862 ,-> (unmarked) -> TODO -> DONE --.
1863 '--------------------------------'
1864 @end example
1866 The same rotation can also be done ``remotely'' from the timeline and
1867 agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
1868 @kindex C-c C-v
1869 @cindex sparse tree, for TODO
1870 @item C-c C-v
1871 View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}).  Folds
1872 the entire buffer, but shows all TODO items and the headings hierarchy
1873 above them.  With prefix arg, show also the DONE entries.  With
1874 numerical prefix N, show the tree for the Nth keyword in the variable
1875 @code{org-todo-keywords}.
1876 @kindex C-c a t
1877 @item C-c a t
1878 Show the global TODO list.  This collects the TODO items from all
1879 agenda files (@pxref{Agenda views}) into a single buffer.  The buffer is in
1880 @code{agenda-mode}, so there are commands to examine and manipulate
1881 the TODO entries directly from that buffer (@pxref{Agenda commands}).
1882 @xref{Global TODO list}, for more information.
1883 @c @item @code{org-agenda-include-all-todo}
1884 @c If you would like to have all your TODO items listed as part of your
1885 @c agenda, customize the variable @code{org-agenda-include-all-todo}.
1886 @end table
1888 @node Progress logging, TODO extensions, TODO basics, TODO items
1889 @section Progress Logging
1890 @cindex progress logging
1891 @cindex logging, of progress
1892 If you want to keep track of @emph{when} a certain TODO item was
1893 finished, turn on logging with
1895 @lisp
1896 (setq org-log-done t)
1897 @end lisp
1899 @noindent
1900 Then each time you turn a TODO entry into DONE using either @kbd{C-c
1901 C-t} in the Org-mode buffer or @kbd{t} in the agenda buffer, a line
1902 @samp{CLOSED: [timestamp]} will be inserted just after the headline.
1903 If you turn the entry back into a TODO item again through further
1904 state cycling, that line will be removed again.  In the timeline
1905 (@pxref{Timeline}) and in the agenda (@pxref{Weekly/Daily agenda}),
1906 you can then use the @kbd{L} key to display the TODO items closed on
1907 each day, giving you an overview of what has been done on a day.
1909 @node TODO extensions, Priorities, Progress logging, TODO items
1910 @section Extended use of TODO keywords
1911 @cindex extended TODO keywords
1913 The default implementation of TODO entries is just two states: TODO and
1914 DONE.  You can, however, use the TODO feature for more complicated
1915 things by configuring the variables @code{org-todo-keywords} and
1916 @code{org-todo-interpretation}.  Using special setup, you can even use
1917 TODO keywords in different ways in different org files.
1919 Note that @i{tags} are another way to classify headlines in general and
1920 TODO items in particular (@pxref{Tags}).
1922 @menu
1923 * Workflow states::             From TODO to DONE in steps
1924 * TODO types::                  I do this, Fred the rest
1925 * Per file keywords::           Different files, different requirements
1926 @end menu
1928 @node Workflow states, TODO types, TODO extensions, TODO extensions
1929 @subsection TODO keywords as workflow states
1930 @cindex TODO workflow
1931 @cindex workflow states as TODO keywords
1933 You can use TODO keywords to indicate different states in the process
1934 of working on an item, for example:
1936 @lisp
1937 (setq org-todo-keywords '("TODO" "FEEDBACK" "VERIFY" "DONE")
1938       org-todo-interpretation 'sequence)
1939 @end lisp
1941 @cindex completion, of TODO keywords
1942 Changing these variables becomes only effective in a new Emacs session.
1943 With this setup, the command @kbd{C-c C-t} will cycle an entry from
1944 TODO to FEEDBACK, then to VERIFY, and finally to DONE.  You may also
1945 use a prefix argument to quickly select a specific state.  For example
1946 @kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
1947 If you define many keywords, you can use in-buffer completion (see
1948 @ref{Completion}) to insert these words into the buffer.
1950 @node TODO types, Per file keywords, Workflow states, TODO extensions
1951 @subsection TODO keywords as types
1952 @cindex TODO types
1953 @cindex names as TODO keywords
1954 @cindex types as TODO keywords
1956 The second possibility is to use TODO keywords to indicate different
1957 types of action items.  For example, you might want to indicate that
1958 items are for ``work'' or ``home''.  If you are into David Allen's
1959 @emph{Getting Things DONE}, you might want to use todo types
1960 @samp{NEXTACTION}, @samp{WAITING}, @samp{MAYBE}.  Or, when you work
1961 with several people on a single project, you might want to assign
1962 action items directly to persons, by using their names as TODO
1963 keywords.  This would be set up like this:
1965 @lisp
1966 (setq org-todo-keywords '("Fred" "Sara" "Lucy" "Mike" "DONE")
1967       org-todo-interpretation 'type)
1968 @end lisp
1970 In this case, different keywords do not indicate a sequence, but
1971 rather different types.  So it is normally not useful to change from
1972 one type to another.  Therefore, in this case the behavior of the
1973 command @kbd{C-c C-t} is changed slightly@footnote{This is also true
1974 for the @kbd{t} command in the timeline and agenda buffers.}.  When
1975 used several times in succession, it will still cycle through all
1976 names.  But when you return to the item after some time and execute
1977 @kbd{C-c C-t} again, it will switch from each name directly to DONE.
1978 Use prefix arguments or completion to quickly select a specific name.
1979 You can also review the items of a specific TODO type in a sparse tree
1980 by using a numeric prefix to @kbd{C-c C-v}.  For example, to see all
1981 things Lucy has to do, you would use @kbd{C-3 C-c C-v}.  To collect
1982 Lucy's items from all agenda files into a single buffer, you
1983 would use the prefix arg as well when creating the global todo list:
1984 @kbd{C-3 C-c t}.
1986 @node Per file keywords,  , TODO types, TODO extensions
1987 @subsection Setting up TODO keywords for individual files
1988 @cindex keyword options
1989 @cindex per file keywords
1991 It can be very useful to use different aspects of the TODO mechanism
1992 in different files, which is not possible with the global settings
1993 described above.  For file-local settings, you need to add special
1994 lines to the file which set the keywords and interpretation for that
1995 file only.  For example, to set one of the two examples discussed
1996 above, you need one of the following lines, starting in column zero
1997 anywhere in the file:
1999 @example
2000 #+SEQ_TODO: TODO FEEDBACK VERIFY DONE
2001 #+TYP_TODO: Fred Sara Lucy Mike DONE
2002 @end example
2004 @cindex Completion, of option keywords
2005 @kindex M-@key{TAB}
2006 @noindent To make sure you are using the correct keyword, type
2007 @samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
2009 @cindex DONE, final TODO keyword
2010 Remember that the last keyword must always mean that the item is DONE
2011 (you may use a different word, though).  Also note that in each file,
2012 only one of the two aspects of TODO keywords can be used.  After
2013 changing one of these lines, use @kbd{C-c C-c} with the cursor still
2014 in the line to make the changes known to Org-mode@footnote{Org-mode
2015 parses these lines only when Org-mode is activated after visiting a
2016 file.  @kbd{C-c C-c} with the cursor in a line starting with @samp{#+}
2017 is simply restarting Org-mode, making sure that these changes will be
2018 respected.}.
2020 If you want to use very many keywords, for example when working with a
2021 large group of people, you may split the names over several lines:
2023 @example
2024 #+TYP_TODO: Fred Sara Lucy Mike
2025 #+TYP_TODO: Luis George Jules Jessica
2026 #+TYP_TODO: Kim Arnold Peter
2027 #+TYP_TODO: DONE
2028 @end example
2030 @node Priorities,  , TODO extensions, TODO items
2031 @section Priorities
2032 @cindex priorities
2034 If you use Org-mode extensively to organize your work, you may end up
2035 with a number of TODO entries so large that you'd like to prioritize
2036 them.  This can be done by placing a @emph{priority cookie} into the
2037 headline, like this
2039 @example
2040 *** TODO [#A] Write letter to Sam Fortune
2041 @end example
2043 @noindent
2044 With its standard setup, Org-mode supports priorities @samp{A},
2045 @samp{B}, and @samp{C}.  @samp{A} is the highest priority.  An entry
2046 without a cookie is treated as priority @samp{B}.  Priorities make a
2047 difference only in the agenda (@pxref{Weekly/Daily agenda}).
2049 @table @kbd
2050 @kindex @kbd{C-c ,}
2051 @item @kbd{C-c ,}
2052 Set the priority of the current item.  The command prompts for a
2053 priority character @samp{A}, @samp{B} or @samp{C}.  When you press
2054 @key{SPC} instead, the priority cookie is removed from the headline.
2055 The priorities can also be changed ``remotely'' from the timeline and
2056 agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
2058 @kindex S-@key{up}
2059 @kindex S-@key{down}
2060 @item S-@key{up}
2061 @itemx S-@key{down}
2062 Increase/decrease priority of current item.  Note that these keys are
2063 also used to modify time stamps (@pxref{Creating timestamps}).
2064 Furthermore, these keys are also used by CUA-mode
2065 (@pxref{Interaction}).
2066 @end table
2068 @node Timestamps, Tags, TODO items, Top
2069 @chapter Timestamps
2071 Items can be labeled with timestamps to make them useful for project
2072 planning.
2074 @menu
2075 * Time stamps::                 Assigning a time to a tree entry
2076 * Creating timestamps::         Commands which insert timestamps
2077 @end menu
2080 @node Time stamps, Creating timestamps, Timestamps, Timestamps
2081 @section Time stamps, deadlines and scheduling
2082 @cindex time stamps
2083 @cindex ranges, time
2084 @cindex date stamps
2085 @cindex deadlines
2086 @cindex scheduling
2088 A time stamp is a specification of a date (possibly with time) in a
2089 special format, either @samp{<2003-09-16 Tue>} or @samp{<2003-09-16
2090 Tue 09:39>}.  A time stamp can appear anywhere in the headline or body
2091 of an org-tree entry.  Its presence allows entries to be shown on specific
2092 dates in the agenda (@pxref{Weekly/Daily agenda}).  We distinguish:
2094 @table @var
2095 @cindex timestamp
2096 @item TIMESTAMP
2097 A simple time stamp just assigns a date/time to an item.  This is just
2098 like writing down an appointment in a paper agenda, or like writing down
2099 an event in a diary, when you want to take not of when something
2100 happened.  In the timeline and agenda displays, the headline of an entry
2101 associated with a plain time stamp will be shown exactly on that date.
2103 @item TIMERANGE
2104 @cindex timerange
2105 Two time stamps connected by @samp{--} denote a time range.  The
2106 headline will be shown on the first and last day of the range, and on
2107 any dates that are displayed and fall in the range.  Here is an
2108 example:
2110 @example
2111 ** Meeting in Amsterdam
2112    <2004-08-23 Mon>--<2004-08-26 Thu>
2113 @end example
2115 @item SCHEDULED
2116 @cindex SCHEDULED keyword
2117 If a time stamp is preceded by the word @samp{SCHEDULED:}, it means you
2118 are planning to start working on that task on the given date. So this is
2119 not about recording an event, but about planning your work.  The
2120 headline will be listed under the given date.  In addition, a reminder
2121 that the scheduled date has passed will be present in the compilation
2122 for @emph{today}, until the entry is marked DONE.  I.e., the task will
2123 automatically be forwarded until completed.
2125 @example
2126 *** TODO Call Trillian for a date on New Years Eve.
2127     SCHEDULED: <2004-12-25 Sat>
2128 @end example
2130 @item DEADLINE
2131 @cindex DEADLINE keyword
2132 If a time stamp is preceded by the word @samp{DEADLINE:}, the task
2133 (most likely a TODO item) is supposed to be finished on that date, and
2134 it will be listed then.  In addition, the compilation for @emph{today}
2135 will carry a warning about the approaching or missed deadline,
2136 starting @code{org-deadline-warning-days} before the due date, and
2137 continuing until the entry is marked DONE.  An example:
2139 @example
2140 *** TODO write article about the Earth for the Guide
2141     The editor in charge is <bbdb:Ford Prefect>
2142     DEADLINE: <2004-02-29 Sun>
2143 @end example
2144 @end table
2146 @node Creating timestamps,  , Time stamps, Timestamps
2147 @section Creating timestamps
2148 @cindex creating timestamps
2149 @cindex timestamps, creating
2151 For Org-mode to recognize time stamps, they need to be in the specific
2152 format.  All commands listed below produce time stamps in the correct
2153 format.
2155 @table @kbd
2156 @kindex C-c .
2157 @item C-c .
2158 Prompt for a date and insert a corresponding time stamp.  When the
2159 cursor is at a previously used time stamp, it is updated to NOW.  When
2160 this command is used twice in succession, a time range is inserted.
2162 @kindex C-u C-c .
2163 @item C-u C-c .
2164 Like @kbd{C-c .}, but use the alternative format which contains date
2165 and time.  The default time can be rounded to multiples of 5 minutes,
2166 see the option @code{org-time-stamp-rounding-minutes}.
2168 @kindex C-c !
2169 @item C-c !
2170 Like @kbd{C-c .}, but insert an inactive time stamp not triggering the
2171 agenda.
2173 @kindex C-c <
2174 @item C-c <
2175 Insert a time stamp corresponding to the cursor date in the Calendar.
2177 @kindex C-c >
2178 @item C-c >
2179 Access the Emacs calendar for the current date.  If there is a
2180 timestamp in the current line, goto the corresponding date
2181 instead.
2183 @kindex C-c C-o
2184 @item C-c C-o
2185 Access the agenda for the date given by the time stamp at point
2186 (@pxref{Weekly/Daily agenda}).
2188 @kindex C-c C-d
2189 @item C-c C-d
2190 Insert @samp{DEADLINE} keyword along with a stamp.
2191 @kindex C-c C-w
2192 @cindex sparse tree, for deadlines
2193 @item C-c C-w
2194 Create a sparse tree with all deadlines that are either past-due, or
2195 which will become due within @code{org-deadline-warning-days}.
2196 With @kbd{C-u} prefix, show all deadlines in the file.  With a numeric
2197 prefix, check that many days.  For example, @kbd{C-1 C-c C-w} shows
2198 all deadlines due tomorrow.
2200 @kindex C-c C-s
2201 @item C-c C-s
2202 Insert @samp{SCHEDULED} keyword along with a stamp.
2204 @kindex S-@key{left}
2205 @kindex S-@key{right}
2206 @item S-@key{left}
2207 @itemx S-@key{right}
2208 Change date at cursor by one day.  These key bindings conflict with
2209 CUA-mode (@pxref{Interaction}).
2211 @kindex S-@key{up}
2212 @kindex S-@key{down}
2213 @item S-@key{up}
2214 @itemx S-@key{down}
2215 Change the item under the cursor in a timestamp.  The cursor can be on
2216 a year, month, day, hour or minute.  Note that if the cursor is not at
2217 a time stamp, these same keys modify the priority of an item.
2218 (@pxref{Priorities}). The key bindings also conflict with CUA-mode
2219 (@pxref{Interaction}).
2222 @kindex C-c C-y
2223 @cindex evaluate time range
2224 @item C-c C-y
2225 Evaluate a time range by computing the difference between start and
2226 end.  With prefix arg, insert result after the time range (in a table:
2227 into the following column).
2228 @end table
2230 @cindex date, reading in minibuffer
2231 @cindex time, reading in minibuffer
2232 @cindex calendar, for selecting date
2233 When Org-mode prompts for a date/time, the function reading your input
2234 will replace anything you choose not to specify with the current date
2235 and time.  For details, see the documentation string of
2236 @command{org-read-date}.  Also, a calender will pop up to allow
2237 selecting a date.  The calendar can be fully controlled from the
2238 minibuffer, and a date can be selected with the following commands:
2240 @table @kbd
2241 @kindex <
2242 @item <
2243 Scroll calendar backwards by one month.
2244 @kindex >
2245 @item >
2246 Scroll calendar forwards by one month.
2247 @kindex mouse-1
2248 @item mouse-1
2249 Select date by clicking on it.
2250 @kindex S-@key{right}
2251 @item S-@key{right}
2252 One day forward.
2253 @kindex S-@key{left}
2254 @item S-@key{left}
2255 One day back.
2256 @kindex S-@key{down}
2257 @item S-@key{down}
2258 One week forward.
2259 @kindex S-@key{up}
2260 @item S-@key{up}
2261 One week back.
2262 @kindex M-S-@key{right}
2263 @item M-S-@key{right}
2264 One month forward.
2265 @kindex M-S-@key{left}
2266 @item M-S-@key{left}
2267 One month back.
2268 @kindex @key{RET}
2269 @item @key{RET}
2270 Choose date in calendar (only if nothing typed into minibuffer).
2271 @end table
2273 @node Tags, Agenda views, Timestamps, Top
2274 @chapter Tags
2275 @cindex tags
2276 @cindex headline tagging
2277 @cindex matching, tags
2278 @cindex sparse tree, tag based
2280 If you wish to implement a system to cross-correlate information, an
2281 excellent way is to assign @i{tags} to headline.  Org-mode has
2282 extensive support for using tags.
2284 Every headline can contain a list of tags, at the end of the headline.
2285 Tags are normal words containing letters, numbers, @samp{_}, and
2286 @samp{@@}.  Tags must be preceded and followed by a single colon; like
2287 @samp{:WORK:}.  Several tags can be specified like @samp{:WORK:URGENT:}.
2289 @menu
2290 * Tag inheritance::             Tags use the tree structure of the outline
2291 * Setting tags::                How to assign tags to a headline
2292 * Tag searches::                Searching for combinations of tags
2293 @end menu
2295 @node Tag inheritance, Setting tags, Tags, Tags
2296 @section Tag inheritance
2297 @cindex inheritance, of tags
2299 @i{Tags} make use of the hierarchical structure of outline trees.  If a
2300 heading has a certain tag, all subheadings will inherit the tag as
2301 well.  For example, in the list
2303 @example
2304 * Meeting with the French group      :WORK:
2305 ** Summary by Frank                  :BOSS:NOTES:
2306 *** TODO Prepare slides for him      :ACTION:
2307 @end example
2309 @noindent
2310 the final heading will have the tags @samp{:WORK:}, @samp{:BOSS:},
2311 @samp{:NOTES:}, and @samp{:ACTION:}.  When executing tag searches and
2312 Org-mode finds that a certain headline matches the search criterion, it
2313 will not check any sublevel headline, assuming that these likely also
2314 match, and that the list of matches can become very long.  However, this
2315 may not be what you want, and you can influence inheritance and
2316 searching using the variables @code{org-use-tag-inheritance} and
2317 @code{org-tags-match-list-sublevels}.
2319 @node Setting tags, Tag searches, Tag inheritance, Tags
2320 @section Setting tags
2321 @cindex setting tags
2323 @kindex M-@key{TAB}
2324 As Org-mode deals with plain text files, tags can simply be typed into
2325 the buffer.  After a colon, @kbd{M-@key{TAB}} offers completion on all
2326 tags being used in the current buffer.  There is also a special command
2327 for inserting tags:
2329 @table @kbd
2330 @kindex C-c C-c
2331 @item C-c C-c
2332 @cindex completion, of tags
2333 Enter new tags for the current headline.  The minibuffer will prompt for
2334 a list of tags and offer completion with respect to all other tags used
2335 in the current buffer.  Several tags, separated by colons, may be
2336 specified at the prompt.  After pressing @key{RET}, the tags will be
2337 inserted and aligned to @code{org-tags-column}.  When called with a
2338 @kbd{C-u} prefix, all tags in the current buffer will be aligned to that
2339 column, just to make things look nice.  TAGS are automatically realigned
2340 after promotion, demotion, and TODO state changes (@pxref{TODO basics}).
2341 @end table
2343 @node Tag searches,  , Setting tags, Tags
2344 @section Tag searches
2345 @cindex tag searches
2347 Once a tags system has been set up, it can be used to collect related
2348 information into special lists.
2350 @table @kbd
2351 @kindex C-c \
2352 @item C-c \
2353 Create a sparse tree with all headlines matching a tags search.
2354 @kindex C-c a m
2355 @item C-c a m
2356 Create a global list of tag matches from all agenda files.
2357 @xref{Matching headline tags}.
2358 @kindex C-c a M
2359 @item C-c a M
2360 Create a global list of tag matches from all agenda files, but check
2361 only TODO items and force checking subitems (see variable
2362 @code{org-tags-match-list-sublevels}).
2363 @end table
2365 A @i{tags} search string can use Boolean operators @samp{&} for AND and
2366 @samp{|} for OR.  @samp{&} binds more strongly than @samp{|}.
2367 Parenthesis are currently not implemented.  A tag may also be preceded
2368 by @samp{-}, to select against it, and @samp{+} is syntactic sugar for
2369 positive selection.  The AND operator @samp{&} is optional when @samp{+}
2370 or @samp{-} is present.  For example, @samp{+WORK-BOSS} would select all
2371 headlines that are tagged @samp{:WORK:}, but discard those also tagged
2372 @samp{:BOSS:}.  The search string @samp{WORK|LAPTOP} selects all lines
2373 tagged @samp{:WORK:} or @samp{:LAPTOP:}.  The string
2374 @samp{WORK|LAPTOP&NIGHT} requires that the @samp{:LAPTOP:} lines are
2375 also tagged @samp{NIGHT}.
2377 @node Agenda views, Exporting, Tags, Top
2378 @chapter Agenda Views
2379 @cindex agenda views
2381 Due to the way Org-mode works, TODO items, time-stamped items, and
2382 tagged headlines can be scattered throughout a file or even a number of
2383 files.  To get an overview over open action items, or over events that
2384 are important for a particular date, this information must be collected,
2385 sorted and displayed in an organized way.
2387 Org-mode can select items based on various criteria, and display them
2388 in a separate buffer.  Three different views are provided:
2390 @itemize @bullet
2391 @item
2392 an @emph{agenda} that is like a calendar and shows information
2393 for specific dates
2394 @item
2395 a @emph{TODO list} that covers all unfinished
2396 action items, and
2397 @item
2398 a @emph{tags view} that shows information based on
2399 the tags associated with headlines in the outline tree.
2400 @end itemize
2402 @noindent
2403 The extracted information is displayed in a special @emph{agenda
2404 buffer}.  This buffer is read-only, but provides commands to visit the
2405 corresponding locations in the original Org-mode files, and even to
2406 edit these files remotely.
2408 @menu
2409 * Agenda files::                Files being searched for agenda information
2410 * Agenda dispatcher::           Keyboard access to agenda views
2411 * Weekly/Daily agenda::         The calendar page with current tasks
2412 * Global TODO list::            All unfinished action items
2413 * Matching headline tags::      Structured information with fine-tuned search
2414 * Timeline::                    Time-sorted view for single file
2415 * Agenda commands::             Remote editing of org trees
2416 @end menu
2418 @node Agenda files, Agenda dispatcher, Agenda views, Agenda views
2419 @section Agenda files
2421 The information to be shown is collected from all @emph{agenda files},
2422 the files listed in the variable @code{org-agenda-files}@footnote{If the
2423 value of that variable is not a list, but a single file name, then the
2424 list of agenda files will be maintained in that external file.}.  Thus even
2425 if you only work with a single Org-mode file, this file should be put
2426 into that list@footnote{When using the dispatcher pressing @kbd{1}
2427 before selecting a command will actually limit the command to the
2428 current file, and ignore @code{org-agenda-files} until the next
2429 dispatcher command.}.  You can customize @code{org-agenda-files}, but
2430 the easiest way to maintain it is through the following commands
2432 @cindex files, adding to agenda list
2433 @table @kbd
2434 @kindex C-c [
2435 @item C-c [
2436 Add current file to the list of agenda files.  The file is added to
2437 the front of the list.  If it was already in the list, it is moved to
2438 the front.  With prefix arg, file is added/moved to the end.
2439 @kindex C-c ]
2440 @item C-c ]
2441 Remove current file from the list of agenda files.
2442 @kindex C-,
2443 @item C-,
2444 Cycle through agenda file list, visiting one file after the other.
2445 @end table
2447 @noindent
2448 The Org menu contains the current list of files and can be used
2449 to visit any of them.
2451 @node Agenda dispatcher, Weekly/Daily agenda, Agenda files, Agenda views
2452 @section The agenda dispatcher
2453 @cindex agenda dispatcher
2454 @cindex dispatching agenda commands
2455 @cindex custom agenda commands
2456 @cindex agenda commands, custom
2457 The views are created through a dispatcher that should be bound to a
2458 global key, for example @kbd{C-c a} (@pxref{Installation and
2459 activation}).  In the following we will assume that @kbd{C-c a} is
2460 indeed how the dispatcher is accessed and list keyboard access to
2461 commands accordingly.  After pressing @kbd{C-c a}, an additional
2462 letter is required to execute a command.  The dispatcher offers the
2463 following default commands:
2464 @table @kbd
2465 @item a
2466 Create the calendar-like agenda (@pxref{Weekly/Daily agenda}).
2467 @item t / T
2468 Create a list of all TODO items (@pxref{Global TODO list}).
2469 @item m / M
2470 Create a list of headlines matching a TAGS expression (@pxref{Matching
2471 headline tags}).
2472 @end table
2474 You can also define custom commands that will be accessible through
2475 the dispatcher, just like the default commands.  Custom commands are
2476 global searches for tags and specific TODO keywords, or a variety of
2477 sparse tree creating commands (@pxref{Sparse trees}).  As sparse trees
2478 are only defined for a single org-mode file, these latter commands act
2479 on the current buffer instead of the list of agenda files.
2481 @kindex C-c a C
2482 Custom commands are configured in the variable
2483 @code{org-agenda-custom-commands}.  You can customize this variable,
2484 for example by pressing @kbd{C-c a C}.  You can also directly set it
2485 with Emacs Lisp in @file{.emacs}.  For example:
2487 @lisp
2488 (setq org-agenda-custom-commands
2489       '(("w" todo "WAITING")
2490         ("u" tags "+BOSS-URGENT")
2491         ("U" tags-tree "+BOSS-URGENT")
2492         ("f" occur-tree "\\<FIXME\\>")))
2493 @end lisp
2495 @noindent will define @kbd{C-c a w} as a global search for
2496 TODO entries with @samp{WAITING} as the TODO keyword, @kbd{C-c a u} as a
2497 global tags search for headlines marked @samp{:BOSS:} but not
2498 @samp{:URGENT:}, @kbd{C-c a U} to do the same search but only in the
2499 current buffer and display the result as a sparse tree, and @kbd{C-c a
2500 f} to create a sparse tree with all entries containing the word
2501 @samp{FIXME}.  For more information, look at the documentation string
2502 of the variable @code{org-agenda-custom-commands}.
2504 @node Weekly/Daily agenda, Global TODO list, Agenda dispatcher, Agenda views
2505 @section The weekly/daily agenda
2506 @cindex agenda
2508 The purpose of the weekly/daily @emph{agenda} is to act like a page of
2509 a paper agenda, showing all the tasks for the current week or day.
2511 @table @kbd
2512 @cindex org-agenda, command
2513 @kindex C-c a a
2514 @item C-c a a
2515 Compile an agenda for the current week from a list of org files.  The
2516 agenda shows the entries for each day.  With a @kbd{C-u} prefix (or
2517 when the variable @code{org-agenda-include-all-todo} is @code{t}), all
2518 unfinished TODO items (including those without a date) are also listed at
2519 the beginning of the buffer, before the first date.@*
2520 @end table
2522 Remote editing from the agenda buffer means, for example, that you can
2523 change the dates of deadlines and appointments from the agenda buffer.
2524 The commands available in the Agenda buffer are listed in @ref{Agenda
2525 commands}.
2527 @menu
2528 * Categories::                  Not all tasks are equal
2529 * Time-of-day specifications::  How the agenda knows the time
2530 * Calendar/Diary integration::  Integrating Anniversaries and more
2531 * Sorting of agenda items::     The order of things
2532 @end menu
2534 @node Categories, Time-of-day specifications, Weekly/Daily agenda, Weekly/Daily agenda
2535 @subsection Categories
2537 @cindex category
2538 In the agenda buffer, each entry is preceded by a @emph{category},
2539 which is derived from the file name.  The category can also be set
2540 with a special line anywhere in the buffer, looking like this:
2542 @example
2543 #+CATEGORY: Thesis
2544 @end example
2546 If there are several such lines in a file, each specifies the category
2547 for the text below it (but the first category also applies to any text
2548 before the first CATEGORY line).  The display in the agenda buffer looks
2549 best if the category is not longer than 10 characters.
2551 @node Time-of-day specifications, Calendar/Diary integration, Categories, Weekly/Daily agenda
2552 @subsection Time-of-Day Specifications
2554 Org-mode checks each agenda item for a time-of-day specification.  The
2555 time can be part of the time stamp that triggered inclusion into the
2556 agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}.  Time
2557 ranges can be specified with two time stamps, like
2559 @w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
2561 In the headline of the entry itself, a time(range) may also appear as
2562 plain text (like @samp{12:45} or a @samp{8:30-1pm}.  If the agenda
2563 integrates the Emacs diary (@pxref{Calendar/Diary integration}), time
2564 specifications in diary entries are recognized as well.
2566 For agenda display, Org-mode extracts the time and displays it in a
2567 standard 24 hour format as part of the prefix.  The example times in
2568 the previous paragraphs would end up in the agenda like this:
2570 @example
2571     8:30-13:00 Arthur Dent lies in front of the bulldozer
2572    12:45...... Ford Prefect arrives and takes Arthur to the pub
2573    19:00...... The Vogon reads his poem
2574    20:30-22:15 Marwin escorts the Hitchhikers to the bridge
2575 @end example
2577 If the agenda is in single-day mode, or for the display of today, the
2578 timed entries are embedded in a time grid, like
2580 @example
2581     8:00...... ------------------
2582     8:30-13:00 Arthur Dent lies in front of the bulldozer
2583    10:00...... ------------------
2584    12:00...... ------------------
2585    12:45...... Ford Prefect arrives and takes Arthur to the pub
2586    14:00...... ------------------
2587    16:00...... ------------------
2588    18:00...... ------------------
2589    19:00...... The Vogon reads his poem
2590    20:00...... ------------------
2591    20:30-22:15 Marwin escorts the Hitchhikers to the bridge
2592 @end example
2594 The time grid can be turned on and off with the variable
2595 @code{org-agenda-use-time-grid}, and can be configured with
2596 @code{org-agenda-time-grid}.
2599 @node Calendar/Diary integration, Sorting of agenda items, Time-of-day specifications, Weekly/Daily agenda
2600 @subsection Calendar/Diary integration
2601 @cindex calendar integration
2602 @cindex diary integration
2604 Emacs contains the calendar and diary by Edward M. Reingold.  The
2605 calendar displays a three-month calendar with holidays from different
2606 countries and cultures.  The diary allows you to keep track of
2607 anniversaries, lunar phases, sunrise/set, recurrent appointments
2608 (weekly, monthly) and more.  In this way, it is quite complementary to
2609 Org-mode.  It can be very useful to combine output from Org-mode with
2610 the diary.
2612 In order to include entries from the Emacs diary into Org-mode's
2613 agenda, you only need to customize the variable
2615 @lisp
2616 (setq org-agenda-include-diary t)
2617 @end lisp
2619 @noindent After that, everything will happen automatically.  All diary
2620 entries including holidays, anniversaries etc will be included in the
2621 agenda buffer created by Org-mode.  @key{SPC}, @key{TAB}, and
2622 @key{RET} can be used from the agenda buffer to jump to the diary
2623 file in order to edit existing diary entries.  The @kbd{i} command to
2624 insert new entries for the current date works in the agenda buffer, as
2625 well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display
2626 Sunrise/Sunset times, show lunar phases and to convert to other
2627 calendars, respectively.  @kbd{c} can be used to switch back and forth
2628 between calendar and agenda.
2630 @node Sorting of agenda items,  , Calendar/Diary integration, Weekly/Daily agenda
2631 @subsection Sorting of agenda items
2632 @cindex sorting, of agenda items
2633 @cindex priorities, of agenda items
2634 The entries for each day are sorted.  The default order is to first
2635 collect all items containing an explicit time-of-day specification.
2636 These entries will be shown at the beginning of the list, as a
2637 @emph{schedule} for the day.  After that, items remain grouped in
2638 categories, in the sequence given by @code{org-agenda-files}.  Within
2639 each category, items are sorted by priority (@pxref{Priorities}).
2641 The priority is a numerical quantity composed of the base priority
2642 (2000 for priority @samp{A}, 1000 for @samp{B}, and 0 for @samp{C}),
2643 plus additional increments for overdue scheduled or deadline items.
2645 Sorting can be customized using the variable
2646 @code{org-agenda-sorting-strategy}.
2649 @node Global TODO list, Matching headline tags, Weekly/Daily agenda, Agenda views
2650 @section The global TODO list
2651 @cindex global TODO list
2652 @cindex TODO list, global
2654 The global TODO list contains all unfinished TODO items, formatted and
2655 collected into a single place.
2657 @table @kbd
2658 @kindex C-c a t
2659 @item C-c a t
2660 Show the global TODO list.  This collects the TODO items from all
2661 agenda files (@pxref{Agenda views}) into a single buffer.  The buffer is in
2662 @code{agenda-mode}, so there are commands to examine and manipulate
2663 the TODO entries directly from that buffer (@pxref{Agenda commands}).
2664 @xref{Global TODO list}, for more information.
2665 @kindex C-c a T
2666 @item C-c a T
2667 Like the above, but allows selection of a specific TODO keyword.  You can
2668 also do this by specifying a prefix argument to @kbd{C-c a t}.  With a
2669 @kbd{C-u} prefix you are prompted for a keyword.  With a numeric
2670 prefix, the Nth keyword in @code{org-todo-keywords} is selected.
2671 @kindex r
2672 The @kbd{r} key in the agenda buffer regenerates it, and you can give
2673 a prefix argument to this command to change the selected TODO keyword,
2674 for example @kbd{3 r}.  If you often need a search for a specific
2675 keyword, define a custom command for it (@pxref{Agenda dispatcher}).
2676 @end table
2678 Remote editing of TODO items means that you can change the state of a
2679 TODO entry with a single key press.  The commands available in the
2680 TODO list are described in @ref{Agenda commands}.
2682 @node Matching headline tags, Timeline, Global TODO list, Agenda views
2683 @section Matching headline tags
2684 @cindex matching, of tags
2685 @cindex tags view
2687 If headlines in the agenda files are marked with @emph{tags}
2688 (@pxref{Tags}), you can select headlines based on the tags that apply
2689 to them and collect them into an agenda buffer.
2691 @table @kbd
2692 @kindex C-c a m
2693 @item C-c a m
2694 Produce a list of all headlines that match a given set of tags.  The
2695 command prompts for a selection criterion, which is a boolean logic
2696 expression with tags, like @samp{+WORK+URGENT-WITHBOSS} or
2697 @samp{WORK|HOME} (@pxref{Tags}).  If you often need a specific search,
2698 define a custom command for it (@pxref{Agenda dispatcher}).
2699 @kindex C-c a M
2700 @item C-c a M
2701 Like @kbd{C-c a m}, but only select headlines that are also TODO items
2702 and force checking subitems (see variable
2703 @code{org-tags-match-list-sublevels}.
2704 @end table
2706 The commands available in the tags list are described in @ref{Agenda
2707 commands}.
2709 @node Timeline, Agenda commands, Matching headline tags, Agenda views
2710 @section Timeline for a single file
2711 @cindex single file summary
2712 @cindex agenda, for single file
2713 @cindex timeline, single file
2714 @cindex time-sorted view
2716 The timeline is not really an agenda view, because it only summarizes
2717 items from a single Org-mode file.  But it also uses the agenda buffer
2718 and provides similar commands, so we discuss it here.  The timeline
2719 shows all time-stamped items in a single Org-mode file (or the
2720 selected part of it), in a @emph{time-sorted view}.  The main purpose of
2721 this command is to give an overview over events in a project.
2723 @table @kbd
2724 @kindex C-c C-r
2725 @item C-c C-r
2726 Show a time-sorted view of the org file, with all time-stamped items.
2727 When called with a @kbd{C-u} prefix, all unfinished TODO entries
2728 (scheduled or not) are also listed under the current date.
2729 @end table
2731 @noindent
2732 The commands available in the timeline buffer are listed in
2733 @ref{Agenda commands}.
2735 @node Agenda commands,  , Timeline, Agenda views
2736 @section Commands in the agenda buffer
2737 @cindex commands, in agenda buffer
2739 Entries in the agenda buffer are linked back to the org file or diary
2740 file where they originate.  You are not allowed to edit the agenda
2741 buffer itself, but commands are provided to show and jump to the
2742 original entry location, and to edit the org-files ``remotely'' from
2743 the agenda buffer.  In this way, all information is stored only once,
2744 removing the risk that your agenda and note files may diverge.
2746 Some commands can be executed with mouse clicks on agenda lines.  For
2747 the other commands, the cursor needs to be in the desired line.
2749 @table @kbd
2750 @tsubheading{Motion}
2751 @kindex n
2752 @item n
2753 Next line (same as @key{up}).
2754 @kindex p
2755 @item p
2756 Previous line (same as @key{down}).
2757 @tsubheading{View/GoTo org file}
2758 @kindex mouse-3
2759 @kindex @key{SPC}
2760 @item mouse-3
2761 @itemx @key{SPC}
2762 Display the original location of the item in another window.
2764 @kindex L
2765 @item L
2766 Display original location and recenter that window.
2768 @kindex mouse-2
2769 @kindex mouse-1
2770 @kindex @key{TAB}
2771 @item mouse-2
2772 @itemx mouse-1
2773 @itemx @key{TAB}
2774 Go to the original location of the item in another window.  Under Emacs
2775 22, @kbd{mouse-1} will also works for this.
2777 @kindex @key{RET}
2778 @itemx @key{RET}
2779 Go to the original location of the item and delete other windows.
2781 @kindex f
2782 @item f
2783 Toggle Follow mode.  In Follow mode, as you move the cursor through
2784 the agenda buffer, the other window always shows the corresponding
2785 location in the org file.  The initial setting for this mode in new
2786 agenda buffers can be set with the variable
2787 @code{org-agenda-start-with-follow-mode}.
2789 @kindex l
2790 @item l
2791 Toggle Logbook mode.  In Logbook mode, entries that where marked DONE while
2792 logging was on (variable @code{org-log-done}) are shown in the agenda.
2794 @tsubheading{Change display}
2795 @kindex o
2796 @item o
2797 Delete other windows.
2799 @kindex w
2800 @item w
2801 Switch to weekly view (7 days displayed together).
2803 @kindex d
2804 @item d
2805 Switch to daily view (just one day displayed).
2807 @kindex D
2808 @item D
2809 Toggle the inclusion of diary entries.  See @ref{Calendar/Diary integration}.
2811 @kindex g
2812 @item g
2813 Toggle the time grid on and off.  See also the variables
2814 @code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
2816 @kindex r
2817 @item r
2818 Recreate the agenda buffer, for example to reflect the changes
2819 after modification of the time stamps of items with S-@key{left} and
2820 S-@key{right}.  When the buffer is the global todo list, a prefix
2821 argument is interpreted to create a selective list for a specific TODO
2822 keyword.
2824 @kindex @key{right}
2825 @item @key{right}
2826 Display the following @code{org-agenda-ndays} days.  For example, if
2827 the display covers a week, switch to the following week.  With prefix
2828 arg, go forward that many times @code{org-agenda-ndays} days.
2830 @kindex @key{left}
2831 @item @key{left}
2832 Display the previous dates.
2834 @kindex .
2835 @item .
2836 Goto today.
2838 @tsubheading{Remote editing}
2840 @item 0-9
2841 Digit argument.
2843 @kindex t
2844 @item t
2845 Change the TODO state of the item, both in the agenda and in the
2846 original org file.
2848 @kindex T
2849 @item T
2850 Show all tags associated with the current item.  Because of
2851 inheritance, this may be more than the tags listed in the line itself.
2853 @kindex :
2854 @item :
2855 Set tags for the current headline.
2857 @kindex ,
2858 @item ,
2859 Set the priority for the current item.  Org-mode prompts for the
2860 priority character. If you reply with @key{SPC}, the priority cookie
2861 is removed from the entry.
2863 @kindex P
2864 @item p
2865 Display weighted priority of current item.
2867 @kindex +
2868 @kindex S-@key{up}
2869 @item +
2870 @itemx S-@key{up}
2871 Increase the priority of the current item.  The priority is changed in
2872 the original buffer, but the agenda is not resorted.  Use the @kbd{r}
2873 key for this.
2875 @kindex -
2876 @kindex S-@key{down}
2877 @item -
2878 @itemx S-@key{down}
2879 Decrease the priority of the current item.
2881 @kindex S-@key{right}
2882 @item S-@key{right}
2883 Change the time stamp associated with the current line by one day into
2884 the future.  With prefix argument, change it by that many days.  For
2885 example, @kbd{3 6 5 S-@key{right}} will change it by a year.  The
2886 stamp is changed in the original org file, but the change is not
2887 directly reflected in the agenda buffer.  Use the
2888 @kbd{r} key to update the buffer.
2890 @kindex S-@key{left}
2891 @item S-@key{left}
2892 Change the time stamp associated with the current line by one day
2893 into the past.
2895 @kindex >
2896 @item >
2897 Change the time stamp associated with the current line to today.
2898 The key @kbd{>} has been chosen, because it is the same as @kbd{S-.}
2899 on my keyboard.
2901 @cindex diary entries, creating from agenda
2902 @kindex i
2903 @item i
2904 Insert a new entry into the diary.  Prompts for the type of entry
2905 (day, weekly, monthly, yearly, anniversary, cyclic) and creates a new
2906 entry in the diary, just like @kbd{i d} etc. would do in the calendar.
2907 The date is taken from the cursor position.
2909 @tsubheading{Calendar commands}
2910 @kindex c
2911 @item c
2912 Open the Emacs calendar and move to the date at the agenda cursor.
2914 @item c
2915 When in the calendar, compute and show the Org-mode agenda for the
2916 date at the cursor.
2918 @kindex M
2919 @item M
2920 Show the phases of the moon for the three months around current date.
2922 @kindex S
2923 @item S
2924 Show sunrise and sunset times.  The geographical location must be set
2925 with calendar variables, see documentation of the Emacs calendar.
2927 @kindex C
2928 @item C
2929 Convert the date at cursor into many other cultural and historic
2930 calendars.
2932 @kindex H
2933 @item H
2934 Show holidays for three month around the cursor date.
2936 @kindex C-c C-x C-c
2937 @item C-c C-x C-c
2938 Export a single iCalendar file containing entries from all agenda files.
2940 @tsubheading{Quit and Exit}
2941 @kindex q
2942 @item q
2943 Quit agenda, remove the agenda buffer.
2945 @kindex x
2946 @cindex agenda files, removing buffers
2947 @item x
2948 Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
2949 for the compilation of the agenda.  Buffers created by the user to
2950 visit org files will not be removed.
2952 @end table
2954 @node Exporting, Miscellaneous, Agenda views, Top
2955 @chapter Exporting
2956 @cindex exporting
2958 Org-mode documents can be exported into a variety of other formats.  For
2959 printing and sharing of notes, ASCII export produces a readable and
2960 simple version of an Org-mode file.  HTML export allows to publish a
2961 notes file on the web, while the XML format provides a solid base for
2962 exchange with a broad range of other applications.  To incorporate
2963 entries with associated times like deadlines or appointments into a
2964 desktop calendar program like iCal, Org-mode can also produce extracts
2965 in the iCalendar format.  Currently Org-mode only supports export, not
2966 import of these different formats.
2968 When exporting, Org-mode uses special conventions to enrich the output
2969 produced.  @xref{Text interpretation}, for more details.
2971 @menu
2972 * ASCII export::                Exporting to plain ASCII
2973 * HTML export::                 Exporting to HTML
2974 * XML export::                  Exporting to XML
2975 * iCalendar export::            Exporting in iCalendar format
2976 * Text interpretation::         How the exporter looks at the file
2977 @end menu
2979 @node ASCII export, HTML export, Exporting, Exporting
2980 @section ASCII export
2981 @cindex ASCII export
2983 ASCII export produces an simple and very readable version of an Org-mode
2984 file.
2986 @cindex region, active
2987 @cindex active region
2988 @cindex transient-mark-mode
2989 @table @kbd
2990 @kindex C-c C-x a
2991 @item C-c C-x a
2992 Export as ASCII file.  If there is an active region, only the region
2993 will be exported.  For an org file @file{myfile.org}, the ASCII file
2994 will be @file{myfile.txt}.  The file will be overwritten without
2995 warning.
2996 @end table
2998 @cindex headline levels, for exporting
2999 In the exported version, the first 3 outline levels will become
3000 headlines, defining a general document structure.  Additional levels
3001 will be exported as itemized lists.  If you want that transition to occur
3002 at a different level, specify it with a prefix argument.  For example,
3004 @example
3005 @kbd{C-1 C-c C-x a org-export-as-ascii}
3006 @end example
3008 @noindent
3009 creates only top level headlines and does the rest as items.
3011 @node HTML export, XML export, ASCII export, Exporting
3012 @section HTML export
3013 @cindex HTML export
3015 Org-mode contains an HTML exporter with extensive HTML formatting, in
3016 ways similar to John Grubers @emph{markdown} language, but with
3017 additional support for tables.
3019 @cindex region, active
3020 @cindex active region
3021 @cindex transient-mark-mode
3022 @table @kbd
3023 @kindex C-c C-x h
3024 @item C-c C-x h
3025 Export as HTML file @file{myfile.html}.
3026 @kindex C-c C-x b
3027 @item C-c C-x b
3028 Export as HTML file and open it with a browser.
3029 @end table
3031 @cindex headline levels, for exporting
3032 In the exported version, the first 3 outline levels will become
3033 headlines, defining a general document structure.  Additional levels
3034 will be exported as itemized lists.  If you want that transition to occur
3035 at a different level, specify it with a prefix argument.  For example,
3037 @example
3038 @kbd{C-2 C-c C-x b}
3039 @end example
3041 @noindent
3042 creates two levels of headings and does the rest as items.
3044 If you want to include HTML tags which should be interpreted as such,
3045 mark them with a @samp{@@} like in @samp{@@<b>bold text@@</b>}.
3046 Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
3047 @samp{&gt;} in HTML export.
3049 You can also give style information for the exported file.  The
3050 default specification can be configured through the option
3051 @code{org-export-html-style}.  If you want to use a file-local style,
3052 you may use file variables, best wrapped into a COMMENT section at the
3053 end of the outline tree.  For example:
3055 @example
3056 * COMMENT HTML style specifications
3058 # Local Variables:
3059 # org-export-html-style: "   <style type=\"text/css\">
3060        p @{font-weight: normal; color: gray; @}
3061        h1 @{color: black; @}
3062    </style>"
3063 # End: ***
3064 @end example
3066 Remember to execute @kbd{M-x normal-mode} after changing this to make
3067 the new style visible to Emacs.  This command restarts org-mode for the
3068 current buffer and forces Emacs to re-evaluate the local variables
3069 section in the buffer.
3071 @c FIXME: More about header and footer styles
3072 @c FIXME: Talk about links and targets.
3074 @node XML export, iCalendar export, HTML export, Exporting
3075 @section XML export
3076 @cindex XML export
3078 Org-mode contains an XML exporter that produces XOXO-style XML.
3079 Currently, this exporter only handles the general outline structure and
3080 does not interpret any additional Org-mode features.
3082 @table @kbd
3083 @kindex C-c C-x C-x
3084 @item C-c C-x C-x
3085 Export as XML file @file{myfile.xml}.
3086 @end table
3088 @node iCalendar export, Text interpretation, XML export, Exporting
3089 @section iCalendar export
3090 @cindex iCalendar export
3092 Some people like to use Org-mode for keeping track of projects, but
3093 still prefer a standard calendar application for anniversaries and
3094 appointments.  In this case it can be useful to have deadlines and
3095 other time-stamped items in Org-mode files show up in the calendar
3096 application.  Org-mode can export calendar information in the standard
3097 iCalendar format.
3099 @table @kbd
3100 @kindex C-c C-x i
3101 @item C-c C-x i
3102 Create iCalendar entries for the current file and store them in the same
3103 directory, using a file extension @file{.ics}.
3104 @kindex C-c C-x C-i
3105 @item C-c C-x C-i
3106 Like @kbd{C-c C-x i}, but do this for all files in
3107 @code{org-agenda-files}.  For each of these files, a separate iCalendar
3108 file will be written.
3109 @kindex C-c C-x c
3110 @item C-c C-x c
3111 Create a single large iCalendar file from all files in
3112 @code{org-agenda-files} and write it to the file given by
3113 @code{org-combined-agenda-icalendar-file}.
3114 @end table
3116 How this calendar is best read and updated, depends on the application
3117 you are using.  For example, when using iCal under Apple MacOS X, you
3118 could create a new calendar @samp{OrgMode} (the default name for the
3119 calendar created by @kbd{C-c C-x c}, see the variables
3120 @code{org-icalendar-combined-name} and
3121 @code{org-combined-agenda-icalendar-file}).  Then set Org-mode to
3122 overwrite the corresponding file
3123 @file{~/Library/Calendars/OrgMode.ics}.  You may even use AppleScript
3124 to make iCal re-read the calendar files each time a new version of
3125 @file{OrgMode.ics} is produced.  Here is the setup needed for this:
3127 @cindex applescript, for calendar update
3128 @lisp
3129 (setq org-combined-agenda-icalendar-file
3130     "~/Library/Calendars/OrgMode.ics")
3131 (add-hook 'org-after-save-iCalendar-file-hook
3132  (lambda ()
3133   (shell-command
3134    "osascript -e 'tell application \"iCal\" to reload calendars'")))
3135 @end lisp
3137 @node Text interpretation,  , iCalendar export, Exporting
3138 @section Text interpretation by the exporter
3140 The exporter backends interpret additional structure in the Org-mode file
3141 in order to produce better output.
3143 @menu
3144 * Comment lines::               Some lines will not be exported
3145 * Enhancing text::              Subscripts, symbols and more
3146 * Export options::              How to influence the export settings
3147 @end menu
3149 @node Comment lines, Enhancing text, Text interpretation, Text interpretation
3150 @subsection Comment lines
3151 @cindex comment lines
3152 @cindex exporting, not
3154 Lines starting with @samp{#} in column zero are treated as comments
3155 and will never be exported.  Also entire subtrees starting with the
3156 word @samp{COMMENT} will never be exported.  Finally, any text before
3157 the first headline will not be exported either.
3159 @table @kbd
3160 @kindex C-c ;
3161 @item C-c ;
3162 Toggle the COMMENT keyword at the beginning of an entry.
3163 @end table
3167 @node Enhancing text, Export options, Comment lines, Text interpretation
3168 @subsection Enhancing text for export
3169 @cindex enhancing text
3170 @cindex richer text
3172 Some of the export backends of Org-mode allow for sophisticated text
3173 formatting, this is true in particular for the HTML backend.  Org-mode
3174 has a number of typing conventions that allow to produce a richly
3175 formatted output.
3178 @itemize @bullet
3180 @cindex hand-formatted lists
3181 @cindex lists, hand-formatted
3182 @item
3183 Plain lists @samp{-}, @samp{*} or @samp{+} as bullet, or with @samp{1.}
3184 or @samp{2)} as enumerator will be recognized and transformed if the
3185 backend supports lists.  See @xref{Plain lists}.
3187 @cindex underlined text
3188 @cindex bold text
3189 @cindex italic text
3190 @item
3191 You can make words @b{*bold*}, @i{/italic/}, and _underlined_
3193 @cindex @TeX{} interpretation
3194 @item
3195 Simple @TeX{}-like math constructs are interpreted:
3197 @cindex completion, of @TeX{} symbols
3198 @itemize @minus
3199 @item
3200 @samp{10^22} and @samp{J_n} are super- and subscripts.  You can quote
3201 @samp{^} and @samp{_} with a backslash: @samp{\_} and @samp{\^}
3202 @item
3203 @samp{\alpha} indicates a Greek letter, @samp{\to} an arrow.  You can
3204 use completion for these macros, just type @samp{\} and maybe a few
3205 letters, and press @kbd{M-@key{TAB}} to see possible completions.
3206 @end itemize
3208 @cindex tables, export
3209 @item
3210 Tables are transformed into native tables under the exporter, if the
3211 export backend supports this. Data fields before the first horizontal
3212 separator line will be formatted as table header fields.
3214 @cindex fixed width
3215 @item
3216 If a headline starts with the word @samp{QUOTE}, the text below the
3217 headline will be typeset as fixed-width, to allow quoting of computer
3218 codes etc.  Lines starting with @samp{:} are also typeset in
3219 fixed-width font.
3220 @table @kbd
3221 @kindex C-c :
3222 @item C-c :
3223 Toggle fixed-width for entry (QUOTE) or region, see below.
3224 @end table
3225 @end itemize
3227 If these conversions conflict with your habits of typing ASCII text,
3228 they can all be turned off with corresponding variables (see the
3229 customization group @code{org-export-general}, and the following section
3230 which explains how to set export options with special lines in a
3231 buffer.
3233 @node Export options,  , Enhancing text, Text interpretation
3234 @subsection Export options
3235 @cindex options, for export
3237 @cindex completion, of option keywords
3238 The exporter recognizes special lines in the buffer which provide
3239 additional information.  These lines may be put anywhere in the file.
3240 The whole set of lines can be inserted into the buffer with @kbd{C-c
3241 C-x t}.  For individual lines, a good way to make sure the keyword is
3242 correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
3243 (@pxref{Completion}).
3245 @table @kbd
3246 @kindex C-c C-x t
3247 @item C-c C-x t
3248 Insert template with export options, see example below.
3249 @end table
3251 @example
3252 #+TITLE:     the title to be shown (default is the buffer name)
3253 #+AUTHOR:    the author (default taken from @code{user-full-name})
3254 #+EMAIL:     his/her email address (default from @code{user-mail-address})
3255 #+LANGUAGE:  language for HTML, e.g. @samp{en} (@code{org-export-default-language})
3256 #+TEXT:      Some descriptive text to be inserted at the beginning.
3257 #+TEXT:      Several lines may be given.
3258 #+OPTIONS:   H:2  num:t  toc:t  \n:nil  @:t  ::t  |:t  ^:t  *:nil  TeX:t
3259 @end example
3261 @noindent
3262 The OPTIONS line is a compact form to specify export settings.  Here
3263 you can:
3264 @cindex headline levels
3265 @cindex section-numbers
3266 @cindex table of contents
3267 @cindex linebreak preservation
3268 @cindex quoted html tags
3269 @cindex fixed-width sections
3270 @cindex tables
3271 @cindex @TeX{}-like syntax for sub- and superscripts
3272 @cindex emphasized text
3273 @cindex @TeX{} macros
3274 @example
3275 H:      @r{set the number of headline levels for export}
3276 num:    @r{turn on/off section-numbers}
3277 toc:    @r{turn on/off table of contents}
3278 \n:     @r{turn on/off linebreak-preservation}
3279 @@:      @r{turn on/off quoted html tags}
3280 ::      @r{turn on/off fixed-width sections}
3281 |:      @r{turn on/off tables}
3282 ^:      @r{turn on/off @TeX{}-like syntax for sub- and superscripts.}
3283 *:      @r{turn on/off emphasized text (bold, italic, underlined)}
3284 TeX:    @r{turn on/off @TeX{} macros}
3285 @end example
3287 @node Miscellaneous, Index, Exporting, Top
3288 @chapter Miscellaneous
3290 @menu
3291 * Completion::                  M-TAB knows what you need
3292 * Customization::               Adapting Org-mode to your taste
3293 * Summary of in-buffer settings::  Using special lines to set options
3294 * The very busy C-c C-c key::   When in doubt, press C-c C-c
3295 * Clean view::                  Getting rid of leading stars in the outline
3296 * TTY keys::                    Using Org-mode on a tty
3297 * FAQ::                         Frequently asked questions
3298 * Interaction::                 Other Emacs packages
3299 * Bugs::                        Things which do not work perfectly
3300 * Acknowledgments::             These people provided feedback and more
3301 @end menu
3303 @node Completion, Customization, Miscellaneous, Miscellaneous
3304 @section Completion
3305 @cindex completion, of @TeX{} symbols
3306 @cindex completion, of TODO keywords
3307 @cindex completion, of dictionary words
3308 @cindex completion, of option keywords
3309 @cindex completion, of CamelCase links
3310 @cindex completion, of tags
3311 @cindex @TeX{} symbol completion
3312 @cindex TODO keywords completion
3313 @cindex dictionary word completion
3314 @cindex option keyword completion
3315 @cindex CamelCase link completion
3316 @cindex tag completion
3318 Org-mode supports in-buffer completion.  This type of completion does
3319 not make use of the minibuffer.  You simply type a few letters into
3320 the buffer and use the key to complete text right there.
3322 @table @kbd
3323 @kindex M-@key{TAB}
3324 @item M-@key{TAB}
3325 Complete word at point
3326 @itemize @bullet
3327 @item
3328 At the beginning of a headline, complete TODO keywords.
3329 @item
3330 After @samp{\}, complete @TeX{} symbols supported by the exporter.
3331 @item
3332 After @samp{*}, complete CamelCase versions of all headlines in the
3333 buffer.
3334 @item
3335 After @samp{:}, complete tags used elsewhere in the buffer.
3336 @item
3337 After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
3338 @samp{OPTIONS} which set file-specific options for Org-mode.  When the
3339 option keyword is already complete, pressing @kbd{M-@key{TAB}} again
3340 will insert example settings for this keyword.
3341 @item
3342 Elsewhere, complete dictionary words using ispell.
3343 @end itemize
3344 @end table
3347 @node Customization, Summary of in-buffer settings, Completion, Miscellaneous
3348 @section Customization
3349 @cindex customization
3350 @cindex options, for customization
3351 @cindex variables, for customization
3353 There are more than 100 variables that can be used to customize
3354 Org-mode.  For the sake of compactness of the manual, we are not
3355 describing the variables here.  A structured overview of customization
3356 variables is available with @kbd{M-x org-customize}.  Or select
3357 @code{Browse Org Group} from the @code{Org->Customization} menu.  Many
3358 settings can also be activated on a per-file basis, by putting special
3359 lines into the buffer (@pxref{Summary of in-buffer settings}).
3361 @node Summary of in-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
3362 @section Summary of in-buffer settings
3363 @cindex in-buffer settings
3364 @cindex special keywords
3366 Org-mode uses special lines in the buffer to define settings on a
3367 per-file basis.  These lines start with a @samp{#+} followed by a
3368 keyword, a colon, and then individual words defining a setting.  Several
3369 settings words con be in the same line, but you can also have multiple
3370 lines for the keyword.  While these settings are described throughout
3371 the manual, here is a summary.  After changing any of those lines in the
3372 buffer, press @kbd{C-c C-c} with the cursor still in the line to
3373 activate the changes immediately.  Otherwise they become effective only
3374 when the file is visited again in a new Emacs session.
3376 @table @kbd
3377 @item #+STARTUP:
3378 This line sets options to be used at startup of org-mode, when an
3379 Org-mode file is being visited.  The first set of options deals with the
3380 initial visibility of the outline tree.  The corresponding variable for
3381 global default settings is @code{org-startup-folded}, with a default
3382 value @code{t}, which means @code{overview}.
3383 @example
3384 overview   @r{top-level headlines only}
3385 content    @r{all headlines}
3386 showall    @r{no folding at all, show everything}
3387 @end example
3388 Then there are options for aligning tables upon visiting a file.  This
3389 is useful in files containing narrowed table columns.  The corresponding
3390 variable is @code{org-startup-align-all-tables}, with a default value
3391 @code{nil}. 
3392 @example
3393 align      @r{align all tables}
3394 noalign    @r{don't align tables on startup}
3395 @end example
3396 Here are the options for hiding leading stars in outline headings.  The
3397 corresponding variables are @code{org-hide-leading-stars} and
3398 @code{org-odd-levels-only}, both with a default setting @code{nil}
3399 (meaning @code{showstars} and @code{oddeven}).
3400 @example
3401 hidestars  @r{make all but one of the stars starting a headline invisible.}
3402 showstars  @r{show all stars starting a headline}
3403 odd        @r{allow only odd outline levels (1,3,...)}
3404 oddeven    @r{allow all outline levels}
3405 @end example
3406 @item #+SEQ_TODO:   #+TYP_TODO:
3407 These lines that the TODO keywords and their interpretation in the
3408 current file.  The corresponding variables are @code{org-todo-keywords}
3409 and @code{org-todo-interpretation}.
3410 @item #+CATEGORY:
3411 This line sets the category for the agenda file.  The category applies
3412 for all subsequent lines until the next @samp{#+CATEGORY} line, or the
3413 end of the file.
3414 @item #+TBLFM:
3415 This line contains the formulas for the table directly above the line.
3416 @item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS:
3417 These lines provide setting for exporting files.  For more details see
3418 @ref{Export options}.
3419 @end table
3421 @node The very busy C-c C-c key, Clean view, Summary of in-buffer settings, Miscellaneous
3422 @section The very busy C-c C-c key
3423 @kindex C-c C-c
3425 The key @kbd{C-c C-c} has many purposes in org-mode, which are all
3426 mentioned scattered throughout this manual.  One specific function of
3427 this key is to add @emph{tags} to a headline (@pxref{Tags}).  In many
3428 other circumstances it means something like @emph{Hey Org-mode, look
3429 here and update according to what you see here}.  Here is a summary what
3430 this means in different contexts.
3432 @itemize @minus
3433 @c @item
3434 @c If the cursor is in a headline, prompt for tags and insert them
3435 @c into the current line, aligned to `org-tags-column'.  When called
3436 @c with prefix arg, realign all tags in the current buffer.
3437 @item
3438 If the cursor is in one of the special #+KEYWORD lines, this
3439 triggers scanning the buffer for these lines and updating the
3440 information. 
3441 @item
3442 If the cursor is inside a table, realign the table.  This command
3443 works even if the automatic table editor has been turned off.
3444 @item
3445 If the cursor is on a #+TBLFM line, re-apply the formulas to
3446 the entire table.
3447 @item
3448 If the cursor is inside a table created by the @file{table.el} package,
3449 activate that table.
3450 @item
3451 If the current buffer is a remember buffer, close note and file it.
3452 with a prefix argument, file it without further interaction to the default
3453 location.
3454 @item
3455 If the cursor is on a <<<target>>>, update radio targets and corresponding
3456 links in this buffer.
3457 @item
3458 If the cursor is on a numbered item in a plain list, renumber the
3459 ordered list.
3460 @end itemize
3462 @node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous
3463 @section A cleaner outline view
3464 @cindex hiding leading stars
3465 @cindex clean outline view
3467 Some people find it noisy and distracting that the Org-mode headlines
3468 are starting with a potentially large number of stars.  For example
3469 the tree from @ref{Headlines}:
3471 @example
3472 * Top level headline
3473 ** Second level
3474 *** 3rd level
3475     some text
3476 *** 3rd level
3477     more text
3478 * Another top level headline
3479 @end example
3481 @noindent
3482 Unfortunately this is deeply ingrained into the code of Org-mode and
3483 cannot be easily changed.  You can, however, modify the display in such
3484 a way that all leading stars become invisible and the outline more easy
3485 to read.  To do this, customize the variable
3486 @code{org-hide-leading-stars} like this:
3488 @lisp
3489 (setq org-hide-leading-stars t)
3490 @end lisp
3492 @noindent
3493 or change this on a per-file basis with one of the lines (anywhere in
3494 the buffer)
3496 @example
3497 #+STARTUP: showstars
3498 #+STARTUP: hidestars
3499 @end example
3501 @noindent
3502 Press @kbd{C-c C-c} with the cursor in a @samp{STARTUP} line to activate
3503 the modifications.
3505 With stars hidden, the tree becomes:
3507 @example
3508 * Top level headline
3509  * Second level
3510   * 3rd level
3511     some text
3512   * 3rd level
3513     more text
3514 * Another top level headline
3515 @end example
3517 @noindent
3518 Note that the leading stars are not truly replaced by whitespace, they
3519 are only fontified with the face @code{org-hide} that uses the
3520 background color as font color.  If are are not using either white or
3521 black background, you may have to customize this face to get the wanted
3522 effect.  Another possibility is to set this font such that the extra
3523 stars are @i{almost} invisible, for example using the color
3524 @code{grey90} on a white background.
3526 Things become cleaner still if you skip all the even levels and use only
3527 odd levels 1, 3, 5..., effectively adding two stars to go from one
3528 outline level to the next:
3530 @example
3531 * Top level headline
3532   * Second level
3533     * 3rd level
3534       some text
3535     * 3rd level
3536       more text
3537 * Another top level headline
3538 @end example
3540 @noindent
3541 In order to make the structure editing and export commands handle this
3542 convention correctly, use
3544 @lisp
3545 (setq org-odd-levels-only t)
3546 @end lisp
3548 @noindent
3549 or set this on a per-file basis with one of the following lines (don't
3550 forget to press @kbd{C-c C-c} with the cursor in the startup line to
3551 activate changes immediately).
3553 @example
3554 #+STARTUP: odd
3555 #+STARTUP: oddeven
3556 @end example
3558 You can convert an Org-mode file from single-star-per-level to the
3559 double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
3560 RET} in that file.  The reverse operation is @kbd{M-x
3561 org-convert-to-oddeven-levels}.
3563 @node TTY keys, FAQ, Clean view, Miscellaneous
3564 @section Using org-mode on a tty
3565 @cindex tty keybindings
3567 Org-mode uses a number of keys that are not accessible on a tty.  This
3568 applies to most special keys like cursor keys, @key{TAB} and
3569 @key{RET}, when these are combined with modifier keys like @key{Meta}
3570 and/or @key{Shift}.  Org-mode uses these bindings because it needs to
3571 provide keys for a large number of commands, and because these keys
3572 appeared particularly easy to remember.  In order to still be able to
3573 access the core functionality of Org-mode on a tty, alternative
3574 bindings are provided.  Here is a complete list of these bindings,
3575 which are obviously more cumbersome to use.  Note that sometimes a
3576 work-around can be better.  For example changing a time stamp is
3577 really only fun with @kbd{S-@key{cursor}} keys.  On a tty you would
3578 rather use @kbd{C-c .}  to re-insert the timestamp.
3580 @multitable @columnfractions 0.15 0.2 0.2
3581 @item @b{Default} @tab @b{Alternative 1} @tab @b{Alternative 2}
3582 @item @kbd{S-@key{TAB}}     @tab @kbd{C-u @key{TAB}}       @tab
3583 @item @kbd{M-@key{left}}    @tab @kbd{C-c C-x l}           @tab @kbd{@key{Esc} @key{left}}
3584 @item @kbd{M-S-@key{left}}  @tab @kbd{C-c C-x L}           @tab
3585 @item @kbd{M-@key{right}}   @tab @kbd{C-c C-x r}           @tab @kbd{@key{Esc} @key{right}}
3586 @item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R}           @tab
3587 @item @kbd{M-@key{up}}      @tab @kbd{C-c C-x u}           @tab @kbd{@key{Esc} @key{up}}
3588 @item @kbd{M-S-@key{up}}    @tab @kbd{C-c C-x U}           @tab
3589 @item @kbd{M-@key{down}}    @tab @kbd{C-c C-x d}           @tab @kbd{@key{Esc} @key{down}}
3590 @item @kbd{M-S-@key{down}}  @tab @kbd{C-c C-x D}           @tab
3591 @item @kbd{S-@key{RET}}     @tab @kbd{C-c C-x c}           @tab
3592 @item @kbd{M-@key{RET}}     @tab @kbd{C-c C-x m}           @tab @kbd{@key{Esc} @key{RET}}
3593 @item @kbd{M-S-@key{RET}}   @tab @kbd{C-c C-x M}           @tab
3594 @item @kbd{S-@key{left}}    @tab @kbd{C-c C-x @key{left}}  @tab
3595 @item @kbd{S-@key{right}}   @tab @kbd{C-c C-x @key{right}} @tab
3596 @item @kbd{S-@key{up}}      @tab @kbd{C-c C-x @key{up}}    @tab
3597 @item @kbd{S-@key{down}}    @tab @kbd{C-c C-x @key{down}}  @tab
3598 @end multitable
3600 @node FAQ, Interaction, TTY keys, Miscellaneous
3601 @section Frequently asked questions
3602 @cindex FAQ
3604 @enumerate
3606 @cindex allout.el, conflict with
3607 @cindex @code{keymapp nil} error
3608 @item @b{When I try to use Org-mode, I always get
3609 @code{(wrong-type-argument keymapp nil)}}.@*
3610 This is a conflict with an outdated version of the @file{allout.el}
3611 package which pretends to be also the standard outline-mode but is not.
3612 This happens with older versions of @file{allout.el}, for example the
3613 one distributed with Emacs 21.  Upgrade to Emacs 22 and this problem
3614 will disappear.  If for some reason you cannot do this, make sure that
3615 org.el is loaded @emph{before} @file{allout.el}, for example by putting
3616 @code{(require 'org)} early enough into your @file{.emacs} file.
3618 @item @b{Org-mode seems to be a useful default mode for the various
3619 @file{README} files I have scattered through my directories.  How do I
3620 turn it on for all @file{README} files?}
3621 @c @*
3623 @example
3624 (add-to-list 'auto-mode-alist '("README$" . org-mode))
3625 @end example
3627 @item @b{Some of my links stopped working after I upgraded to a version
3628 4.20 or later.  Why is this, and how can I fix it?}@*
3630 These must be links in plain text, containing white space, such as
3631 @samp{bbdb:Richard Stallman}.  You need to protect these links by
3632 putting double brackets around them, like @samp{[[bbdb:Richard
3633 Stallman]]}.
3635 @item @b{I see that Org-mode now creates links using the double bracket
3636 convention that hides the link part and the brackets, only showing the
3637 description part.  How can I convert my old links to this new format?}@*
3639 Execute once in each Org-mode file: @kbd{M-x org-upgrade-old-links}.
3640 This replaces angular brackets with the new link format.
3642 @item @b{I don't care if you find the new bracket links great, I am
3643 attached to the old style using angular brackets and no hiding of the
3644 link text.  Please give them back to me, don't tell me it is not
3645 possible!}@*
3647 Would I let you down like that?  If you must, you can do this
3649 @lisp
3650 (setq org-link-style 'plain
3651       org-link-format "<%s>")
3652 @end lisp
3654 @item @b{When I am executing shell links I always get a 
3655 confirmation prompt and need to type @kbd{yes @key{RET}}, thats 4 key
3656 presses!  Can I get rid of this?}@*
3658 @cindex shell links, confirmation
3659 @cindex dangerous commands
3660 The confirmation is there to protect you from unwantingly execute
3661 potentially dangerous commands.  For example, imagine a link
3662 @samp{[[shell:rm -rf ~/*][Google Search]]}.  In an Org-mode buffer, this
3663 command would look like @samp{Google Search}, but really it would remove
3664 your home directory.  If you wish, you can make it easier to respond to
3665 the query by setting @code{org-confirm-shell-links} to @code{y-or-n-p}.
3666 Then a single @kbd{y} keypress will be enough to confirm shell links.
3667 It is also possible to turn off this check entirely, but I do not
3668 recommend to do this.  Be warned.
3670 @item @b{All these stars are driving me mad, I just find the Emacs
3671 outlines unreadable. Can't you just put white space and a single star as a
3672 starter for headlines?}@*
3674 See @ref{Clean view}.
3676 @item @b{I would like to have two windows on the same Org-mode
3677 file, but with different outline visibility.  Is that possible?}@*
3679 @cindex @code{make-indirect-buffer}
3680 @cindex indirect buffers
3681 In GNU Emacs, you may use @emph{indirect buffers} which do exactly this.
3682 See the documentation on the command @code{make-indirect-buffer}.  In
3683 XEmacs, this is currently not possible because of the different outline
3684 implementation.
3686 @item @b{When I export my TODO list, every TODO item becomes a
3687 separate section.  How do I enforce these items to be exported as an
3688 itemized list?}@*
3690 If you plan to use ASCII or HTML export, make sure things you want to
3691 be exported as item lists are level 4 at least, even if that does mean
3692 there is a level jump.  For example:
3694 @example
3695 * Todays top priorities
3696 **** TODO write a letter to xyz
3697 **** TODO Finish the paper
3698 **** Pick up kids at the school
3699 @end example
3701 Alternatively, if you need a specific value for the heading/item
3702 transition in a particular file, use the @samp{+OPTIONS} line to
3703 configure the @samp{H} switch.
3705 @example
3706 +OPTIONS:   H:2; ...
3707 @end example
3709 @item @b{I would like to export only a subtree of my file to HTML.
3710 How?}@*
3712 @cindex exporting a subtree
3713 If you want to export a subtree, mark the subtree as region and then
3714 export.  Marking can be done with @kbd{C-c @@ C-x C-x}, for example.
3716 @item @b{Org-mode takes over the S-cursor keys.  I also want to use
3717 CUA-mode, is there a way to fix this conflict?}@*
3718 Yes, see @ref{Interaction}.
3720 @item @b{One of my table columns has started to fill up with
3721 @samp{#ERROR}.  What is going on?}@*
3723 Org-mode tried to compute the column from other fields using a
3724 formula stored in the @samp{#+TBLFM:} line just below the table, and
3725 the evaluation of the formula fails.  Fix the fields used in the
3726 formula, or fix the formula, or remove it!
3728 @item @b{When I am in the last column of a table and just above a
3729 horizontal line in the table, pressing TAB creates a new table line
3730 @i{before} the horizontal line.  How can I quickly move to the line
3731 @i{below} the horizontal line instead?}@*
3733 Press @key{down} (to get on the separator line) and then @key{TAB}.
3734 Or configure the variable @code{org-table-tab-jumps-over-hlines}.
3736 @item @b{How can I change the indentation of an entire table without
3737 fixing every line by hand?}@*
3739 @cindex indentation, of tables
3740 The indentation of a table is set by the first line.  So just fix the
3741 indentation of the first line and realign with @key{TAB}.
3743 @item @b{Is it possible to include entries from org-mode files into my
3744 emacs diary?}@*
3746 Since the org-mode agenda is much more powerful and can contain the
3747 diary (@pxref{Calendar/Diary integration}), you should think twice
3748 before deciding to do this.  Integrating Org-mode information into the
3749 diary is, however, possible.  The following steps are necessary:
3750 Autoload the function @command{org-diary} as shown above under
3751 @ref{Installation and activation}.  You also need to use @emph{fancy
3752 diary display} by setting in @file{.emacs}:
3754 @lisp
3755 (add-hook 'diary-display-hook 'fancy-diary-display)
3756 @end lisp
3758 Then include the following line into your @file{~/diary} file, in
3759 order to get the entries from all files listed in the variable
3760 @code{org-agenda-files}:
3762 @example
3763 &%%(org-diary)
3764 @end example
3765 @noindent
3766 You may also select specific files with
3768 @example
3769 &%%(org-diary) ~/path/to/some/org-file.org
3770 &%%(org-diary) ~/path/to/another/org-file.org
3771 @end example
3773 If you now launch the calendar and press @kbd{d} to display a diary, the
3774 headlines of entries containing a timestamp, date range, schedule, or
3775 deadline referring to the selected date will be listed.  Just like in
3776 Org-mode's agenda view, the diary for @emph{today} contains additional
3777 entries for overdue deadlines and scheduled items.  See also the
3778 documentation of the @command{org-diary} function.  Under XEmacs, it is
3779 not possible to jump back from the diary to the org, this works only in
3780 the agenda buffer.
3782 @end enumerate
3785 @node Interaction, Bugs, FAQ, Miscellaneous
3786 @section Interaction with other packages
3787 @cindex packages, interaction with other
3788 Org-mode can cooperate with the following packages:
3790 @table @asis
3791 @cindex @file{org-mouse.el}
3792 @item @file{org-mouse.el} by Piotr Zielinski
3793 This package implements extended mouse functionality for Org-mode.  It
3794 allows you to cycle visibility and to edit the document structure with
3795 the mouse.  Best of all, it provides a context-sensitive menu on
3796 @key{mouse-3} that changes depending on the context of a mouse-click.
3797 Use a search engine to find this package on the web.
3798 @cindex @file{table.el}
3799 @item @file{table.el} by Takaaki Ota
3800 Org mode cooperates with table.el, see @ref{table.el}.  @file{table.el}
3801 is part of Emacs 22.
3802 @cindex @file{calc.el}
3803 @item @file{calc.el} by Dave Gillespie
3804 Org-mode uses the calc package for implementing spreadsheet
3805 functionality in its tables (@pxref{Table calculations}).  Org-modes
3806 checks for the availability of calc by looking for the function
3807 @code{calc-eval} which should be autoloaded in your setup if calc has
3808 been installed properly.  As of Emacs 22, calc is part of the Emacs
3809 distribution.  Another possibility for interaction between the two
3810 packages is using calc for embedded calculations. @xref{Embedded Mode,
3811 , Embedded Mode, calc, GNU Emacs Calc Manual}.
3812 @cindex @file{constants.el}
3813 @item @file{constants.el} by Carsten Dominik
3814 In a table formula (@pxref{Table calculations}), it is possible to use
3815 names for natural constants or units.  Instead of defining your own
3816 constants in the variable @code{org-table-formula-constants}, install
3817 the @file{constants} package which defines a large number of constants
3818 and units, and lets you use unit prefixes like @samp{M} for
3819 @samp{Mega} etc.  You will need version 2.0 of this package, available
3820 at @url{http://www.astro.uva.nl/~dominik/Tools}. Org-mode checks for
3821 the function @code{constants-get}, which has to be autoloaded in your
3822 setup.  See the installation instructions in the file
3823 @file{constants.el}.
3824 @cindex @file{CUA.el}
3825 @item @file{CUA.el} by Kim. F. Storm
3826 Keybindings in Org-mode conflict with the @kbd{S-<cursor>} keys
3827 used by CUA-mode (as well as pc-select-mode and s-region-mode) to
3828 select and extend the region.  If you want to use one of these
3829 packages along with Org-mode, configure the variable
3830 @code{org-CUA-compatible}.  When set, Org-mode will move the following
3831 keybindings in org-mode files, and in the agenda buffer (but not
3832 during date selection).
3834 @example
3835 S-UP    -> M-p             S-DOWN  -> M-n
3836 S-LEFT  -> M--             S-RIGHT -> M-+
3837 S-RET   -> C-S-RET
3838 @end example
3840 Yes, these are unfortunately more difficult to remember.  If you want
3841 to have other replacement keys, look at the variable
3842 @code{org-disputed-keys}.
3843 @item @file{windmove.el} by Hovav Shacham
3844 @cindex @file{windmove.el}
3845 Also this package uses the @kbd{S-<cursor>} keys, so everything written
3846 in the paragraph above about CUA mode also applies here.
3847 @item @file{remember.el} by John Wiegley
3848 @cindex @file{remember.el}
3849 Org mode cooperates with remember, see @ref{Remember}.
3850 @file{Remember.el} is not part of Emacs, find it on the web.
3851 @end table
3853 @node Bugs, Acknowledgments, Interaction, Miscellaneous
3854 @section Bugs
3855 @cindex bugs
3857 Here is a list of things that should work differently, but which I
3858 have found too hard to fix.
3860 @itemize @bullet
3861 @item
3862 If a table field starts with a link, and if the corresponding table
3863 column is narrowed (@pxref{Narrow columns}) to a width too small to
3864 display the link, the field would look entirely empty even though it is
3865 not.  To prevent this, Org-mode throws an error.  The work-around is to
3866 make the column wide enough to fit the link, or to add some text (at
3867 least 2 characters) before the link in the same field.
3868 @item
3869 Narrowing table columns does not work on XEmacs, because the
3870 @code{format} function does not transport text properties.
3871 @item
3872 Text in an entry protected with the @samp{QUOTE} keyword should not
3873 autowrap.
3874 @item
3875 When the application called by @kbd{C-c C-o} to open a file link fails
3876 (for example because the application does not exits or refuses to open
3877 the file), it does so silently.  No error message is displayed.
3878 @item
3879 Plain list items should be able to hold a TODO item.  Unfortunately this
3880 has so many technical problems that I will only consider this change for
3881 the next major release (5.0).
3882 @item
3883 The remote-editing commands in the agenda buffer cannot be undone with
3884 @code{undo} called from within the agenda buffer.  But you can go to
3885 the corresponding buffer (using @key{TAB} or @key{RET} and execute
3886 @code{undo} there.
3887 @item
3888 Recalculating a table line applies the formulas from left to right.
3889 If a formula uses @emph{calculated} fields further down the row,
3890 multiple recalculation may be needed to get all fields consistent.
3891 @item
3892 You can only make a single word boldface or italic.  To emphasize
3893 several words in a row, each must have the emphasize markers, like in
3894 @samp{*three* *bold* *words*}.
3895 @item
3896 The exporters work well, but could be made more efficient.
3897 @end itemize
3899 @node Acknowledgments,  , Bugs, Miscellaneous
3900 @section Acknowledgments
3901 @cindex acknowledgments
3902 @cindex thanks
3904 Org-mode was written by Carsten Dominik, who still maintains it at the
3905 Org-mode homepage @uref{http://www.astro.uva.nl/~dominik/Tools/org/}.
3906 The following people (in alphabetic order) have helped the development
3907 along with ideas, suggestions and patches.  Many thanks to all of you,
3908 Org-mode would not be what it is without your input.
3910 @itemize @bullet
3911 @item
3912 Thomas Baumann contributed the code for links to the MH-E email system.
3913 @item
3914 Alex Bochannek provided a patch for rounding time stamps.
3915 @item
3916 Charles Caves' suggestion sparked the implementation of templates for
3917 Remember.
3918 @item
3919 Pavel Chalmoviansky influenced the agenda treatment of items with
3920 specified time.
3921 @item
3922 Sacha Chua suggested to copy some linking code from Planner.
3923 @item
3924 Kees Dullemond inspired the use of narrowed tabled columns.
3925 @item
3926 Christian Egli converted the documentation into TeXInfo format, patched
3927 CSS formatting into the HTML exporter, and inspired the agenda.
3928 @item
3929 Nic Ferrier contributed mailcap and XML support.
3930 @item
3931 Kai Grossjohann pointed out key-binding conflicts caused by Org-mode.
3932 @item
3933 Stefan Monnier provided a patch to keep the Emacs-Lisp compiler happy.
3934 @item
3935 Tim O'Callaghan suggested in-file links, search options for
3936 general file links, and TAGS.
3937 @item
3938 Oliver Oppitz suggested multi-state TODO items.
3939 @item
3940 Scott Otterson sparked the introduction of descriptive text for links,
3941 among other things.
3942 @item
3943 Pete Phillips helped the development of the TAGS feature.
3944 @item
3945 Matthias Rempe (Oelde) provided ideas, Windows support, and quality
3946 control.
3947 @item
3948 Kevin Rogers contributed code to access VM files on remote hosts.
3949 @item
3950 Frank Ruell solved the mystery of the @code{keymapp nil} bug, a conflict
3951 with @file{allout.el}.
3952 @item
3953 Philip Rooke created the Org-mode reference card and provided lots of feedback.
3954 @item
3955 Christian Schlauer proposed angular brackets around links, among other
3956 things.
3957 @item
3958 Linking to VM/BBDB/GNUS was inspired by Tom Shannon's
3959 @file{organizer-mode.el}.
3960 @item
3961 J@"urgen Vollmer contributed code generating the table of contents
3962 in HTML output.
3963 @item
3964 Chris Wallace provided a patch implementing the @samp{QUOTE} keyword.
3965 @item
3966 David Wainberg suggested archiving, and improvements to the linking
3967 system.
3968 @item
3969 John Wiegley wrote @file{emacs-wiki.el} and @file{planner.el}.  The
3970 development of Org-mode was fully independent, and both systems are
3971 really different beasts in their basic ideas and implementation details.
3972 However, I have later looked at John's code and learned from his
3973 implementation of (i) links where the link itself is hidden and only a
3974 description is shown, and (ii) popping up a calendar to select a date.
3975 @item
3976 Carsten Wimmer suggested some changes and helped fix a bug in linking
3977 to GNUS.
3978 @item
3979 Roland Winkler requested additional keybindings to make Org-mode
3980 work on a tty.
3981 @item
3982 Piotr Zielinski wrote @file{org-mouse.el} and showed how to follow links
3983 with mouse-1.
3984 @end itemize
3986 @node Index, Key Index, Miscellaneous, Top
3987 @chapter Index
3989 @printindex cp
3991 @node Key Index,  , Index, Top
3992 @chapter Key Index
3994 @printindex ky
3996 @bye
3998 @ignore
3999    arch-tag: 7893d1fe-cc57-4d13-b5e5-f494a1bcc7ac
4000 @end ignore