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