Release 4.52
[org-mode.git] / org.texi
blob6139979cb1457a25c93598b3829e16a2d82f2df9
1 \input texinfo
2 @c %**start of header
3 @setfilename ../info/org
4 @settitle Org Mode Manual
6 @set VERSION 4.52
7 @set DATE October 2006
9 @dircategory Emacs
10 @direntry
11 * Org Mode: (org).      outline-based notes management and organizer
12 @end direntry
14 @c Version and Contact Info
15 @set MAINTAINERSITE @uref{http://www.astro.uva.nl/~dominik/Tools/org/,maintainers webpage}
16 @set AUTHOR Carsten Dominik
17 @set MAINTAINER Carsten Dominik
18 @set MAINTAINEREMAIL @email{dominik@@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 * Embedded LaTeX::              LaTeX fragments and formulas
87 * Exporting::                   Sharing and publishing of notes
88 * Publishing::                  Create a web site of linked Org-mode files
89 * Miscellaneous::               All the rest which did not fit elsewhere
90 * Extensions and Hacking::      It is possible to write add-on code
91 * History and Acknowledgments::  How Org-mode came into being 
92 * Index::                       The fast road to specific information
93 * Key Index::                   Key bindings and where they are described
95 @detailmenu
96  --- The Detailed Node Listing ---
98 Introduction
100 * Summary::                     Brief summary of what Org-mode does
101 * Installation::                How to install a downloaded version of Org-mode
102 * Activation::                  How to activate Org-mode for certain buffers.
103 * Feedback::                    Bug reports, ideas, patches etc.
105 Document Structure
107 * Outlines::                    Org-mode is based on outline-mode
108 * Headlines::                   How to typeset org-tree headlines
109 * Visibility cycling::          Show and hide, much simplified
110 * Motion::                      Jumping to other headlines
111 * Structure editing::           Changing sequence and level of headlines
112 * Archiving::                   Move done task trees to a different place
113 * Sparse trees::                Matches embedded in context
114 * Plain lists::                 Additional structure within an entry
116 Archiving
118 * ARCHIVE tag::                 Marking a tree as inactive
119 * Moving subtrees::             Moving a tree to an archive file
121 Tables
123 * Built-in table editor::       Simple tables
124 * Narrow columns::              Stop wasting space in tables   
125 * Table calculations::          Compute a field from other fields
126 * orgtbl-mode::                 The table editor as minor mode
127 * table.el::                    Complex tables
129 Calculations in tables
131 * Formula syntax::              How to write a formula
132 * Lisp formulas::               An alternative way to write formulas
133 * Column formulas::             Formulas valid for all fields in a column
134 * Advanced features::           Field names, parameters and automatic recalc
135 * Named-field formulas::        Formulas valid in single fields
136 * Editing/debugging formulas::  Changing a stored formula
137 * Appetizer::                   Taste the power of calc
139 Hyperlinks
141 * Link format::                 How links in Org-mode are formatted
142 * Internal links::              Links to other places in the current file
143 * External links::              URL-like links to the world
144 * Handling links::              Creating, inserting and following
145 * Link abbreviations::          Shortcuts for writing complex links
146 * Search options::              Linking to a specific location
147 * Custom searches::             When the default search is not enough
148 * Remember::                    Org-trees store quick notes
150 Internal links
152 * Radio targets::               Make targets trigger links in plain text.
153 * CamelCase links::             Activating CamelCase words as links
155 TODO items
157 * TODO basics::                 Marking and displaying TODO entries
158 * TODO extensions::             Workflow and assignments
159 * Priorities::                  Some things are more important than others
160 * Breaking down tasks::         Splitting a task into managable pieces
161 * Checkboxes::                  Tick-off lists
163 Extended use of TODO keywords
165 * Workflow states::             From TODO to DONE in steps
166 * TODO types::                  I do this, Fred the rest
167 * Per file keywords::           Different files, different requirements
169 Timestamps
171 * Time stamps::                 Assigning a time to a tree entry
172 * Creating timestamps::         Commands which insert timestamps
173 * Progress logging::            Documenting when what work was done.
175 Creating timestamps
177 * The date/time prompt::        
179 Progress Logging
181 * Closing items::               When was this entry marked DONE?
182 * Clocking work time::          When exactly did you work on this item?
184 Tags
186 * Tag inheritance::             Tags use the tree structure of the outline
187 * Setting tags::                How to assign tags to a headline
188 * Tag searches::                Searching for combinations of tags
190 Agenda Views
192 * Agenda files::                Files being searched for agenda information
193 * Agenda dispatcher::           Keyboard access to agenda views
194 * Weekly/Daily agenda::         The calendar page with current tasks
195 * Global TODO list::            All unfinished action items
196 * Matching headline tags::      Structured information with fine-tuned search
197 * Timeline::                    Time-sorted view for single file
198 * Presentation and sorting::    How agenda items are prepared for display
199 * Agenda commands::             Remote editing of org trees
200 * Custom agenda views::         Defining special searches and views
202 The weekly/daily agenda
204 * Calendar/Diary integration::  Integrating Anniversaries and more
206 Presentation and sorting
208 * Categories::                  Not all tasks are equal
209 * Time-of-day specifications::  How the agenda knows the time
210 * Sorting of agenda items::     The order of things
212 Custom agenda views
214 * Storing searches::            Type once, use often
215 * Block agenda::                All the stuff you need in a single buffer
216 * Setting Options::             Changing the rules
217 * Batch processing::            Agenda views from the command line
219 Embedded LaTeX
221 * Math symbols::                TeX macros for symbols and Greek letters
222 * Subscripts and Superscripts::  Simple syntax for raising/lowering text
223 * LaTeX fragments::             Complex formulas made easy
224 * Processing LaTeX fragments::  Previewing LaTeX processing
225 * CDLaTeX mode::                Speed up entering of formulas
227 Exporting
229 * ASCII export::                Exporting to plain ASCII
230 * HTML export::                 Exporting to HTML
231 * XOXO export::                 Exporting to XOXO
232 * iCalendar export::            Exporting in iCalendar format
233 * Text interpretation::         How the exporter looks at the file
235 Text interpretation by the exporter
237 * Comment lines::               Some lines will not be exported
238 * Enhancing text::              Subscripts, symbols and more
239 * Export options::              How to influence the export settings
241 Publishing
243 * Configuration::               Defining projects
244 * Sample configuration::        Example projects
245 * Triggering publication::      Publication commands
247 Configuration
249 * Project alist::               The central configuration variable
250 * Sources and destinations::    From here to there
251 * Selecting files::             What files are part of the project?
252 * Publishing action::           Setting the function doing the publishing
253 * Publishing options::          Tweaking HTML export
254 * Publishing links::            Which links keep working after publishing?
255 * Project page index::          Publishing a list of project files
257 Sample configuration
259 * Simple example::              One-component publishing
260 * Complex example::             A multi-component publishing example
262 Miscellaneous
264 * Completion::                  M-TAB knows what you need
265 * Customization::               Adapting Org-mode to your taste
266 * In-buffer settings::          Overview of the #+KEYWORDS
267 * The very busy C-c C-c key::   When in doubt, press C-c C-c
268 * Clean view::                  Getting rid of leading stars in the outline
269 * TTY keys::                    Using Org-mode on a tty
270 * Interaction::                 Other Emacs packages
271 * Bugs::                        Things which do not work perfectly
273 Interaction with other packages
275 * Cooperation::                 Packages Org-mode cooperates with
276 * Conflicts::                   Packages that lead to conflicts
278 Extensions, Hooks and Hacking
280 * Extensions::                  Existing 3rd-part extensions
281 * Dynamic blocks::              Automatically filled blocks
283 @end detailmenu
284 @end menu
286 @node Introduction, Document structure, Top, Top
287 @chapter Introduction
288 @cindex introduction
290 @menu
291 * Summary::                     Brief summary of what Org-mode does
292 * Installation::                How to install a downloaded version of Org-mode
293 * Activation::                  How to activate Org-mode for certain buffers.
294 * Feedback::                    Bug reports, ideas, patches etc.
295 @end menu
297 @node Summary, Installation, Introduction, Introduction
298 @section Summary
299 @cindex summary
301 Org-mode is a mode for keeping notes, maintaining ToDo lists, and doing
302 project planning with a fast and effective plain-text system.
304 Org-mode develops organizational tasks around NOTES files that contain
305 information about projects as plain text.  Org-mode is implemented on
306 top of outline-mode, which makes it possible to keep the content of
307 large files well structured.  Visibility cycling and structure editing
308 help to work with the tree.  Tables are easily created with a built-in
309 table editor.  Org-mode supports ToDo items, deadlines, time stamps,
310 and scheduling.  It dynamically compiles entries into an agenda that
311 utilizes and smoothly integrates much of the Emacs calendar and diary.
312 Plain text URL-like links connect to websites, emails, Usenet
313 messages, BBDB entries, and any files related to the projects.  For
314 printing and sharing of notes, an Org-mode file can be exported as a
315 structured ASCII file, as HTML, or (todo and agenda items only) as an
316 iCalendar file.  It can also serve as a publishing tool for a set of
317 linked webpages.
319 Org-mode keeps simple things simple.  When first fired up, it should
320 feel like a straightforward, easy to use outliner.  Complexity is not
321 imposed, but a large amount of functionality is available when you need
322 it.  Org-mode can be used on different levels and in different ways, for
323 example:
325 @example
326 @r{@bullet{} as an outline extension with visibility cycling and structure editing}
327 @r{@bullet{} as an ASCII system and table editor for taking structured notes}
328 @r{@bullet{} as an ASCII table editor with spreadsheet-like capabilities}
329 @r{@bullet{} as a TODO list editor}
330 @r{@bullet{} as a full agenda and planner with deadlines and work scheduling}
331 @r{@bullet{} as a simple hypertext system, with HTML export}
332 @r{@bullet{} as a publishing tool to create a set of interlinked webpages}
333 @end example
335 The Org-mode table editor can be integrated into any major mode by
336 activating the minor Orgtbl-mode.
338 @cindex FAQ
339 There is a website for Org-mode which provides links to the newest
340 version of Org-mode, as well as additional information, frequently asked
341 questions (FAQ), links to tutorials etc.  This page is located at
342 @uref{http://www.astro.uva.nl/~dominik/Tools/org/}.
344 @page
346 @node Installation, Activation, Summary, Introduction
347 @section Installation
348 @cindex installation
349 @cindex XEmacs
351 @b{Important:} If Org-mode is part of the Emacs distribution or an
352 XEmacs package, please skip this section and go directly to
353 @ref{Activation}.
355 If you have downloaded Org-mode from the Web, you must take the
356 following steps to install it: Go into the Org-mode distribution
357 directory and edit the top section of the file @file{Makefile}.  You
358 must set the name of the Emacs binary (likely either @file{emacs} or
359 @file{xemacs}), and the paths to the directories where local Lisp and
360 Info files are kept.  If you don't have access to the system-wide
361 directories, create your own two directories for these files, enter them
362 into the Makefile, and make sure Emacs finds the Lisp files by adding
363 the following line to @file{.emacs}:
365 @example
366 (setq load-path (cons "~/path/to/lispdir" load-path))
367 @end example
369 @b{XEmacs users now need to install the file @file{noutline.el} from
370 the @file{xemacs} subdirectory of the Org-mode distribution.  Use the
371 command:}
373 @example
374 @b{make install-noutline}
375 @end example
377 @noindent Now byte-compile and install the Lisp files with the shell
378 commands:
380 @example
381 make
382 make install
383 @end example
385 @noindent If you want to install the info documentation, use this command:
387 @example
388 make install-info
389 @end example
391 @noindent Then add to @file{.emacs}:
393 @lisp
394 ;; This line only if org-mode is not part of the X/Emacs distribution.
395 (require 'org-install)
396 @end lisp
398 @node Activation, Feedback, Installation, Introduction
399 @section Activation
400 @cindex activation
401 @cindex autoload
402 @cindex global keybindings
403 @cindex keybindings, global
405 Add the following lines to your @file{.emacs} file.  The last two lines
406 define @emph{global} keys for the commands @command{org-store-link} and
407 @command{org-agenda} - please choose suitable keys yourself.
409 @lisp
410 ;; The following lines are always needed.  Choose your own keys.
411 (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
412 (define-key global-map "\C-cl" 'org-store-link)
413 (define-key global-map "\C-ca" 'org-agenda)
414 @end lisp
416 Furthermore, you must activate @code{font-lock-mode} in org-mode
417 buffers, because significant functionality depends on font-locking being
418 active.  You can do this with either one of the following two lines
419 (XEmacs user must use the second option):
420 @lisp
421 (global-font-lock-mode 1)                     ; for all buffers
422 (add-hook 'org-mode-hook 'turn-on-font-lock)  ; org-mode buffers only
423 @end lisp
425 @cindex org-mode, turning on
426 With this setup, all files with extension @samp{.org} will be put
427 into Org-mode.  As an alternative, make the first line of a file look
428 like this:
430 @example
431 MY PROJECTS    -*- mode: org; -*-
432 @end example
434 @noindent which will select Org-mode for this buffer no matter what
435 the file's name is.  See also the variable
436 @code{org-insert-mode-line-in-empty-file}.
438 @node Feedback,  , Activation, Introduction
439 @section Feedback
440 @cindex feedback
441 @cindex bug reports
442 @cindex maintainer
443 @cindex author
445 If you find problems with Org-mode, or if you have questions, remarks,
446 or ideas about it, please contact the maintainer @value{MAINTAINER} at
447 @value{MAINTAINEREMAIL}.
449 For bug reports, please provide as much information as possible,
450 including the version information of Emacs (@kbd{C-h v emacs-version
451 @key{RET}}) and Org-mode (@kbd{C-h v org-version @key{RET}}), as well as
452 the Org-mode related setup in @file{.emacs}.  If an error occurs, a
453 traceback can be very useful.  Often a small example file helps, along
454 with clear information about:
456 @enumerate
457 @item What exactly did you do?
458 @item What did you expect to happen?
459 @item What happened instead?
460 @end enumerate
461 @noindent Thank you for helping to improve this mode.
463 @node Document structure, Tables, Introduction, Top
464 @chapter Document Structure
465 @cindex document structure
466 @cindex structure of document
468 Org-mode is based on outline mode and provides flexible commands to
469 edit the structure of the document.
471 @menu
472 * Outlines::                    Org-mode is based on outline-mode
473 * Headlines::                   How to typeset org-tree headlines
474 * Visibility cycling::          Show and hide, much simplified
475 * Motion::                      Jumping to other headlines
476 * Structure editing::           Changing sequence and level of headlines
477 * Archiving::                   Move done task trees to a different place
478 * Sparse trees::                Matches embedded in context
479 * Plain lists::                 Additional structure within an entry
480 @end menu
482 @node Outlines, Headlines, Document structure, Document structure
483 @section Outlines
484 @cindex outlines
485 @cindex outline-mode
487 Org-mode is implemented on top of outline-mode.  Outlines allow to
488 organize a document in a hierarchical structure, which (at least for
489 me) is the best representation of notes and thoughts.  Overview over
490 this structure is achieved by folding (hiding) large parts of the
491 document to show only the general document structure and the parts
492 currently being worked on.  Org-mode greatly simplifies the use of
493 outlines by compressing the entire show/hide functionality into a
494 single command @command{org-cycle}, which is bound to the @key{TAB}
495 key.
497 @node Headlines, Visibility cycling, Outlines, Document structure
498 @section Headlines
499 @cindex headlines
500 @cindex outline tree
502 Headlines define the structure of an outline tree.  The headlines in
503 Org-mode start with one or more stars, on the left margin.  For
504 example:
506 @example
507 * Top level headline
508 ** Second level
509 *** 3rd level
510     some text
511 *** 3rd level
512     more text
513 * Another top level headline
514 @end example
516 @noindent Some people find the many stars too noisy and would prefer an
517 outline that has whitespace followed by a single star as headline
518 starters.  @ref{Clean view} describes a setup to realize this.
520 @node Visibility cycling, Motion, Headlines, Document structure
521 @section Visibility cycling
522 @cindex cycling, visibility
523 @cindex visibility cycling
524 @cindex trees, visibility
525 @cindex show hidden text
526 @cindex hide text
528 Outlines make it possible to hide parts of the text in the buffer.
529 Org-mode uses just two commands, bound to @key{TAB} and
530 @kbd{S-@key{TAB}} to change the visibility in the buffer.
532 @cindex subtree visibility states
533 @cindex subtree cycling
534 @cindex folded, subtree visibility state
535 @cindex children, subtree visibility state
536 @cindex subtree, subtree visibility state
537 @table @kbd
538 @kindex @key{TAB}
539 @item @key{TAB}
540 @emph{Subtree cycling}: Rotate current subtree between the states
542 @example
543 ,-> FOLDED -> CHILDREN -> SUBTREE --.
544 '-----------------------------------'
545 @end example
547 The cursor must be on a headline for this to work@footnote{see, however,
548 the option @code{org-cycle-emulate-tab}.}.  When the cursor is at the
549 beginning of the buffer and the first line is not a headline, then
550 @key{TAB} actually runs global cycling (see below)@footnote{see the
551 option @code{org-cycle-global-at-bob}.}.  Also when called with a prefix
552 argument (@kbd{C-u @key{TAB}}), global cycling is invoked.
554 @cindex global visibility states
555 @cindex global cycling
556 @cindex overview, global visibility state
557 @cindex contents, global visibility state
558 @cindex show all, global visibility state
559 @kindex S-@key{TAB}
560 @item S-@key{TAB}
561 @itemx C-u @key{TAB}
562 @emph{Global cycling}: Rotate the entire buffer between the states
564 @example
565 ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
566 '--------------------------------------'
567 @end example
569 Note that inside tables, @kbd{S-@key{TAB}} jumps to the previous field.
571 @cindex show all, command
572 @kindex C-c C-a
573 @item C-c C-a
574 Show all.
575 @end table
577 When Emacs first visits an Org-mode file, the global state is set to
578 OVERVIEW, i.e. only the top level headlines are visible.  This can be
579 configured through the variable @code{org-startup-folded}, or on a
580 per-file basis by adding one of the following lines anywhere in the
581 buffer:
583 @example
584 #+STARTUP: overview
585 #+STARTUP: content
586 #+STARTUP: showall
587 @end example
589 @node Motion, Structure editing, Visibility cycling, Document structure
590 @section Motion
591 @cindex motion, between headlines
592 @cindex jumping, to headlines
593 @cindex headline navigation
594 The following commands jump to other headlines in the buffer.
596 @table @kbd
597 @kindex C-c C-n
598 @item C-c C-n
599 Next heading.
600 @kindex C-c C-p
601 @item C-c C-p
602 Previous heading.
603 @kindex C-c C-f
604 @item C-c C-f
605 Next heading same level.
606 @kindex C-c C-b
607 @item C-c C-b
608 Previous heading same level.
609 @kindex C-c C-u
610 @item C-c C-u
611 Backward to higher level heading.
612 @kindex C-c C-j
613 @item C-c C-j
614 Jump to a different place without changing the current outline
615 visibility.  Shows the document structure in a temporary buffer, where
616 you can use visibility cycling (@key{TAB}) to find your destination.
617 After pressing @key{RET}, the cursor moves to the selected location in
618 the original buffer, and the headings hierarchy above it is made
619 visible.
620 @end table
622 @node Structure editing, Archiving, Motion, Document structure
623 @section Structure editing
624 @cindex structure editing
625 @cindex headline, promotion and demotion
626 @cindex promotion, of subtrees
627 @cindex demotion, of subtrees
628 @cindex subtree, cut and paste
629 @cindex pasting, of subtrees
630 @cindex cutting, of subtrees
631 @cindex copying, of subtrees
632 @cindex subtrees, cut and paste
634 @table @kbd
635 @kindex M-@key{RET}
636 @item M-@key{RET}
637 Insert new heading with same level as current.  If the cursor is in a
638 plain list item, a new item is created (@pxref{Plain lists}).  To force
639 creation of a new headline, use a prefix arg, or first press @key{RET}
640 to get to the beginning of the next line.  When this command is used in
641 the middle of a line, the line is split and the rest of the line becomes
642 the new headline.  If the command is used at the beginning of a
643 headline, the new headline is created before the current line.  If at
644 the beginning of any other line, the content of that line is made the
645 new heading.
646 @kindex M-S-@key{RET}
647 @item M-S-@key{RET}
648 Insert new TODO entry with same level as current heading.
649 @kindex M-@key{left}
650 @item M-@key{left}
651 Promote current heading by one level.
652 @kindex M-@key{right}
653 @item M-@key{right}
654 Demote current heading by one level.
655 @kindex M-S-@key{left}
656 @item M-S-@key{left}
657 Promote the current subtree by one level.
658 @kindex M-S-@key{right}
659 @item M-S-@key{right}
660 Demote the current subtree by one level.
661 @kindex M-S-@key{up}
662 @item M-S-@key{up}
663 Move subtree up (swap with previous subtree of same
664 level).
665 @kindex M-S-@key{down}
666 @item M-S-@key{down}
667 Move subtree down (swap with next subtree of same level).
668 @kindex C-c C-x C-w
669 @kindex C-c C-x C-k
670 @item C-c C-x C-w
671 @itemx C-c C-x C-k
672 Kill subtree, i.e. remove it from buffer but save in kill ring.
673 @kindex C-c C-x M-w
674 @item C-c C-x M-w
675 Copy subtree to kill ring.
676 @kindex C-c C-x C-y
677 @item C-c C-x C-y
678 Yank subtree from kill ring.  This does modify the level of the subtree to
679 make sure the tree fits in nicely at the yank position.  The yank
680 level can also be specified with a prefix arg, or by yanking after a
681 headline marker like @samp{****}.
682 @end table
684 @cindex region, active
685 @cindex active region
686 @cindex transient-mark-mode
687 When there is an active region (transient-mark-mode), promotion and
688 demotion work on all headlines in the region.  To select a region of
689 headlines, it is best to place both point and mark at the beginning of a
690 line, mark at the beginning of the first headline, and point at the line
691 just after the last headline to change.  Note that when the cursor is
692 inside a table (@pxref{Tables}), the Meta-Cursor keys have different
693 functionality.
695 @node Archiving, Sparse trees, Structure editing, Document structure
696 @section Archiving
697 @cindex archiving
699 When a project represented by a (sub)tree is finished, you may want
700 to move the tree out of the way and to stop it from contributing to the
701 agenda.  Org-mode knows two ways of archiving.  You can mark a tree with
702 the ARCHIVE tag, or you can move an entire (sub)tree to a different
703 location.
705 @menu
706 * ARCHIVE tag::                 Marking a tree as inactive
707 * Moving subtrees::             Moving a tree to an archive file
708 @end menu
710 @node ARCHIVE tag, Moving subtrees, Archiving, Archiving
711 @subsection The ARCHIVE tag
712 @cindex internal archiving
714 A headline that is marked with the ARCHIVE tag (@pxref{Tags}) stays at
715 its location in the outline tree, but behaves in the following way:
716 @itemize @minus
717 @item
718 It does not open when you attempt to do so with a visibility cycling
719 command (@pxref{Visibility cycling}).  You can force cycling archived
720 subtrees with @kbd{C-@key{TAB}}, or by setting the option
721 @code{org-cycle-open-archived-trees}.  Also normal outline commands like
722 @code{show-all} will open archived subtrees.
723 @item
724 During sparse tree construction (@pxref{Sparse trees}), matches in
725 archived subtrees are not exposed, unless you configure the option
726 @code{org-sparse-tree-open-archived-trees}.
727 @item
728 During agenda view construction (@pxref{Agenda views}), the content of
729 archived trees is ignored unless you configure the option
730 @code{org-agenda-skip-archived-trees}.
731 @item
732 Archived trees are not exported (@pxref{Exporting}), only the headline
733 is.  Configure the details using the variable
734 @code{org-export-with-archived-trees}.
735 @end itemize
737 The following commands help managing the ARCHIVE tag:
739 @table @kbd
740 @kindex C-c C-x C-a
741 @item C-c C-x C-a
742 Toggle the ARCHIVE tag for the current headline.  When the tag is set,
743 the headline changes to a shadowish face, and the subtree below it is
744 hidden.
745 @kindex C-u C-c C-x C-a
746 @item C-u C-c C-x C-a
747 Check if any direct children of the current headline should be archived.
748 To do this, each subtree is checked for open TODO entries.  If none are
749 found, the command offers to set the ARCHIVE tag for the child.  If the
750 cursor is @emph{not} on a headline when this command is invoked, the
751 level 1 trees will be checked.
752 @kindex C-@kbd{TAB}
753 @item C-@kbd{TAB}
754 Cycle a tree even if it is tagged with ARCHIVE.
755 @end table
757 @node Moving subtrees,  , ARCHIVE tag, Archiving
758 @subsection Moving subtrees
759 @cindex external archiving
761 Once an entire project is finished, you may want to move it to a
762 different location, either in the current file, or even in a different
763 file, the archive file.
765 @table @kbd
766 @kindex C-c $
767 @item C-c $
768 Archive the subtree starting at the cursor position to the location
769 given by @code{org-archive-location}.
770 @kindex C-u C-c $
771 @item C-u C-c $
772 Check if any direct children of the current headline could be moved to
773 the archive.  To do this, each subtree is checked for open TODO entries.
774 If none are found, the command offers to move it to the archive
775 location.  If the cursor is @emph{not} on a headline when this command
776 is invoked, the level 1 trees will be checked.
777 @end table
779 @cindex archive locations
780 The default archive location is a file in the same directory as the
781 current file, with the name derived by appending @file{_archive} to the
782 current file name.  For information and examples on how to change this,
783 see the documentation string of the variable
784 @code{org-archive-location}.
786 @node Sparse trees, Plain lists, Archiving, Document structure
787 @section Sparse trees
788 @cindex sparse trees
789 @cindex trees, sparse
790 @cindex folding, sparse trees
791 @cindex occur, command
793 An important feature of Org-mode is the ability to construct
794 @emph{sparse trees} for selected information in an outline tree.  A
795 sparse tree means that the entire document is folded as much as
796 possible, but the selected information is made visible along with the
797 headline structure above it@footnote{See also the variables
798 @code{org-show-hierarchy-above} and
799 @code{org-show-following-heading}.}.  Just try it out and you will see
800 immediately how it works.
802 Org-mode contains several commands creating such trees.  The most
803 basic one is @command{org-occur}:
805 @table @kbd
806 @kindex C-c /
807 @item C-c /
808 Occur.  Prompts for a regexp and shows a sparse tree with all matches.
809 If the match is in a headline, the headline is made visible.  If the
810 match is in the body of an entry, headline and body are made visible.
811 In order to provide minimal context, also the full hierarchy of
812 headlines above the match is shown, as well as the headline following
813 the match.  Each match is also highlighted; the highlights disappear
814 when the bufer is changes an editing command, or by pressing @kbd{C-c
815 C-c}.  When called with a @kbd{C-u} prefix argument, previous highlights
816 are kept, so several calls to this command can be stacked.
817 @end table
818 @noindent
819 For frequently used sparse trees of specific search strings, you can
820 use the variable @code{org-agenda-custom-commands} to define fast
821 keyboard access to specific sparse trees.  These commands will then be
822 accessible through the agenda dispatcher (@pxref{Agenda dispatcher}).
823 For example:
825 @lisp
826 (setq org-agenda-custom-commands
827       '(("f" occur-tree "FIXME")))
828 @end lisp
830 @noindent will define the key @kbd{C-c a f} as a shortcut for creating
831 a sparse tree matching the string @samp{FIXME}.
833 Other commands use sparse trees as well.  For example @kbd{C-c
834 C-v} creates a sparse TODO tree (@pxref{TODO basics}).
836 @kindex C-c C-e v
837 @cindex printing sparse trees
838 @cindex visible text, printing
839 To print a sparse tree, you can use the Emacs command
840 @code{ps-print-buffer-with-faces} which does not print invisible parts
841 of the document @footnote{This does not work under XEmacs, because
842 XEmacs uses selective display for outlining, not text properties.}.
843 Or you can use the command @kbd{C-c C-e v} to export only the visible
844 part of the document and print the resulting file.
846 @node Plain lists,  , Sparse trees, Document structure
847 @section Plain lists
848 @cindex plain lists
849 @cindex lists, plain
850 @cindex lists, ordered
851 @cindex ordered lists
853 Within an entry of the outline tree, hand-formatted lists can provide
854 additional structure.  They also provide a way to create lists of
855 checkboxes (@pxref{Checkboxes}).  Org-mode supports editing such lists,
856 and the HTML exporter (@pxref{Exporting}) does parse and format them.
858 Org-mode knows ordered and unordered lists.  Unordered list items start
859 with @samp{-}, @samp{+}, or @samp{*}@footnote{When using @samp{*} as a
860 bullet, lines must be indented or they will be seen as top-level
861 headlines.  Also, when you are hiding leading stars to get a clean
862 outline view, plain list items starting with a star are visually
863 indistinguishable from true headlines.  In short: even though @samp{*}
864 is supported, it may be better not to use it for plain list items} as
865 bullets.  Ordered list items start with @samp{1.} or @samp{1)}.  Items
866 belonging to the same list must have the same indentation on the first
867 line.  In particular, if an ordered list reaches number @samp{10.}, then
868 the 2--digit numbers must be written left-aligned with the other numbers
869 in the list.  Indentation also determines the end of a list item.  It
870 ends before the next line that is indented like the bullet/number, or
871 less.  For example:
873 @example
874 @group
875 ** Lord of the Rings
876    My favorite scenes are (in this order)
877    1. The attack of the Rohirrim
878    2. Eowyns fight with the witch king
879       + this was already my favorite scene in the book
880       + I really like Miranda Otto.
881    3. Peter Jackson being shot by Legolas
882        - on DVD only
883       He makes a really funny face when it happens.
884    But in the end, not individual scenes matter but the film as a whole.
885 @end group
886 @end example
888 Org-mode supports these lists by tuning filling and wrapping commands to
889 deal with them correctly@footnote{Org-mode only changes the filling
890 settings for Emacs.  For XEmacs, you should use Kyle E. Jones'
891 @file{filladapt.el}.  To turn is on,  put into @file{.emacs}:
892 @example
893 (require 'filladapt)
894 @end example
897 The following commands act on items when the cursor is in the first line
898 of an item (the line with the bullet or number).
900 @table @kbd
901 @kindex @key{TAB}
902 @item @key{TAB}
903 Items can be folded just like headline levels if you set the variable
904 @code{org-cycle-include-plain-lists}.  The level of an item is then
905 given by the indentation of the bullet/number.  Items are always
906 subordinate to real headlines, however; the hierarchies remain
907 completely separated.
908 @kindex M-@key{RET}
909 @item M-@key{RET}
910 Insert new item at current level.  With prefix arg, force a new heading
911 (@pxref{Structure editing}).  If this command is used in the middle of a
912 line, the line is @emph{split} and the rest of the line becomes the new
913 item.  If this command is executed in the @emph{whitespace before a bullet or
914 number}, the new item is created @emph{before} the current item.  If the
915 command is executed in the white space before the text that is part of
916 an item but does not contain the bullet, a bullet is added to the
917 current line.
918 @kindex M-S-@key{RET}
919 @item M-S-@key{RET}
920 Insert a new item with a checkbox (@pxref{Checkboxes}).
921 @kindex S-@key{up}
922 @kindex S-@key{down}
923 @item S-@key{up}
924 @itemx S-@key{down}
925 Jump to the previous/next item in the current list.
926 @kindex M-S-@key{up}
927 @kindex M-S-@key{down}
928 @item M-S-@key{up}
929 @itemx M-S-@key{down}
930 Move the item including subitems up/down (swap with previous/next item
931 of same indentation).  If the list is ordered, renumbering is
932 automatic.
933 @kindex M-S-@key{left}
934 @kindex M-S-@key{right}
935 @item M-S-@key{left}
936 @itemx M-S-@key{right}
937 Decrease/increase the indentation of the item, including subitems.
938 Initially, the item tree is selected based on current indentation.
939 When these commands are executed several times in direct succession,
940 the initially selected region is used, even if the new indentation
941 would imply a different hierarchy.  To use the new hierarchy, break
942 the command chain with a cursor motion or so.
943 @kindex C-c C-c
944 @item C-c C-c
945 If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the
946 state of the checkbox.  Otherwise, if this is an ordered list, renumber
947 the ordered list at the cursor.
948 @end table
950 @node Tables, Hyperlinks, Document structure, Top
951 @chapter Tables
952 @cindex tables
953 @cindex editing tables
955 Org-mode has a very fast and intuitive table editor built-in.
956 Spreadsheet-like calculations are supported in connection with the
957 Emacs @file{calc} package.
959 @menu
960 * Built-in table editor::       Simple tables
961 * Narrow columns::              Stop wasting space in tables   
962 * Table calculations::          Compute a field from other fields
963 * orgtbl-mode::                 The table editor as minor mode
964 * table.el::                    Complex tables
965 @end menu
967 @node Built-in table editor, Narrow columns, Tables, Tables
968 @section The built-in table editor
969 @cindex table editor, builtin
971 Org-mode makes it easy to format tables in plain ASCII.  Any line with
972 @samp{|} as the first non-white character is considered part of a
973 table.  @samp{|} is also the column separator.  A table might look
974 like this:
976 @example
977 | Name  | Phone | Age |
978 |-------+-------+-----|
979 | Peter |  1234 |  17 |
980 | Anna  |  4321 |  25 |
981 @end example
983 A table is re-aligned automatically each time you press @key{TAB} or
984 @key{RET} or @kbd{C-c C-c} inside the table.  @key{TAB} also moves to
985 the next field (@key{RET} to the next row) and creates new table rows
986 at the end of the table or before horizontal lines.  The indentation
987 of the table is set by the first line.  Any line starting with
988 @samp{|-} is considered as a horizontal separator line and will be
989 expanded on the next re-align to span the whole table width.  So, to
990 create the above table, you would only type
992 @example
993 |Name|Phone|Age|
995 @end example
997 @noindent and then press @key{TAB} to align the table and start filling in
998 fields.
1000 When typing text into a field, Org-mode treats @key{DEL},
1001 @key{Backspace}, and all character keys in a special way, so that
1002 inserting and deleting avoids shifting other fields.  Also, when
1003 typing @emph{immediately after the cursor was moved into a new field
1004 with @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the
1005 field is automatically made blank.  If this behavior is too
1006 unpredictable for you, configure the variables
1007 @code{org-enable-table-editor} and @code{org-table-auto-blank-field}.
1009 @table @kbd
1010 @tsubheading{Creation and conversion}
1011 @kindex C-c |
1012 @item C-c |
1013 Convert the active region to table. If every line contains at least one
1014 TAB character, the function assumes that the material is tab separated.
1015 If not, lines are split at whitespace into fields.  You can use a prefix
1016 argument to indicate the minimum number of consecutive spaces required
1017 to identify a field separator (default: just one).@* 
1018 If there is no active region, this command creates an empty Org-mode
1019 table.  But it's easier just to start typing, like
1020 @kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}.
1022 @tsubheading{Re-aligning and field motion}
1023 @kindex C-c C-c
1024 @item C-c C-c
1025 Re-align the table without moving the cursor.
1027 @kindex @key{TAB}
1028 @item @key{TAB}
1029 Re-align the table, move to the next field.  Creates a new row if
1030 necessary.
1032 @kindex S-@key{TAB}
1033 @item S-@key{TAB}
1034 Re-align, move to previous field.
1036 @kindex @key{RET}
1037 @item @key{RET}
1038 Re-align the table and move down to next row.  Creates a new row if
1039 necessary.  At the beginning or end of a line, @key{RET} still does
1040 NEWLINE, so it can be used to split a table.
1042 @tsubheading{Column and row editing}
1043 @kindex M-@key{left}
1044 @kindex M-@key{right}
1045 @item M-@key{left}
1046 @itemx M-@key{right}
1047 Move the current column left/right.
1049 @kindex M-S-@key{left}
1050 @item M-S-@key{left}
1051 Kill the current column.
1053 @kindex M-S-@key{right}
1054 @item M-S-@key{right}
1055 Insert a new column to the left of the cursor position.
1057 @kindex M-@key{up}
1058 @kindex M-@key{down}
1059 @item M-@key{up}
1060 @itemx M-@key{down}
1061 Move the current row up/down.
1063 @kindex M-S-@key{up}
1064 @item M-S-@key{up}
1065 Kill the current row or horizontal line.
1067 @kindex M-S-@key{down}
1068 @item M-S-@key{down}
1069 Insert a new row above (with arg: below) the current row.
1071 @kindex C-c -
1072 @item C-c -
1073 Insert a horizontal line below current row. With prefix arg, the line
1074 is created above the current line.
1076 @kindex C-c ^
1077 @item C-c ^
1078 Sort the table lines in the region.  Point and mark must be in the first
1079 and last line to be included, and must be in the column that should be
1080 used for sorting.  The command prompts for numerical versus
1081 alphanumerical sorting.
1083 @tsubheading{Regions}
1084 @kindex C-c C-x M-w
1085 @item C-c C-x M-w
1086 Copy a rectangular region from a table to a special clipboard.  Point
1087 and mark determine edge fields of the rectangle.  The process ignores
1088 horizontal separator lines.
1089 @kindex C-c C-x C-w
1090 @item C-c C-x C-w
1091 Copy a rectangular region from a table to a special clipboard, and
1092 blank all fields in the rectangle.  So this is the ``cut'' operation.
1093 @kindex C-c C-x C-y
1094 @item C-c C-x C-y
1095 Paste a rectangular region into a table.
1096 The upper right corner ends up in the current field.  All involved fields
1097 will be overwritten.  If the rectangle does not fit into the present table,
1098 the table is enlarged as needed.  The process ignores horizontal separator
1099 lines.
1100 @kindex C-c C-q
1101 @item C-c C-q
1102 Wrap several fields in a column like a paragraph.  If there is an active
1103 region, and both point and mark are in the same column, the text in the
1104 column is wrapped to minimum width for the given number of lines.  A
1105 prefix ARG may be used to change the number of desired lines.  If there
1106 is no region, the current field is split at the cursor position and the
1107 text fragment to the right of the cursor is prepended to the field one
1108 line down. If there is no region, but you specify a prefix ARG, the
1109 current field is made blank, and the content is appended to the field
1110 above.
1112 @tsubheading{Calculations}
1113 @cindex formula, in tables
1114 @cindex calculations, in tables
1115 @kindex C-c =
1116 @item C-c =
1117 Install a new formula for the current column and replace current field
1118 with the result of the formula.
1120 @kindex C-u C-c =
1121 @item C-u C-c =
1122 Install a new formula for the current field, which must be a named
1123 field.  Evaluate the formula and replace the field content with the
1124 result.
1126 @kindex C-c '
1127 @item C-c '
1128 Edit all formulas associated with the current table in a separate
1129 buffer.
1131 @kindex C-c *
1132 @item C-c *
1133 Recalculate the current row by applying the stored formulas from left
1134 to right.  When called with a @kbd{C-u} prefix, recalculate the
1135 entire table, starting with the first non-header line (i.e. below the
1136 first horizontal separator line).  For details, see @ref{Table calculations}.
1138 @kindex C-#
1139 @item C-#
1140 Rotate the calculation mark in first column through the states
1141 @samp{}, @samp{#}, @samp{*}, @samp{!}, @samp{$}.  For the meaning of
1142 these marks see @ref{Advanced features}.  When there is an active
1143 region, change all marks in the region.
1145 @kindex C-c ?
1146 @item C-c ?
1147 Which table column is the cursor in?  Displays number >0 in echo
1148 area.
1150 @cindex region, active
1151 @cindex active region
1152 @cindex transient-mark-mode
1153 @kindex C-c +
1154 @item C-c +
1155 Sum the numbers in the current column, or in the rectangle defined by
1156 the active region.  The result is shown in the echo area and can
1157 be inserted with @kbd{C-y}.
1159 @kindex S-@key{RET}
1160 @item S-@key{RET}
1161 When current field is empty, copy from first non-empty field above.
1162 When not empty, copy current field down to next row and move cursor
1163 along with it.  Depending on the variable
1164 @code{org-table-copy-increment}, integer field values will be
1165 incremented during copy.  This key is also used by CUA-mode
1166 (@pxref{Cooperation}).
1168 @tsubheading{Miscellaneous}
1169 @kindex C-c `
1170 @item C-c `
1171 Edit the current field in a separate window.  This is useful for fields
1172 that are not fully visible (@pxref{Narrow columns}).  When called with a
1173 @kbd{C-u} prefix, just make the full field visible, so that it can be
1174 edited in place.
1176 @kindex C-c @key{TAB}
1177 @item C-c @key{TAB}
1178 This is an alias for @kbd{C-u C-c `} to make the current field fully
1179 visible.
1181 @item M-x org-table-import
1182 Import a file as a table.  The table should be TAB- or whitespace
1183 separated.  Useful, for example, to import an Excel table or data from a
1184 database, because these programs generally can write TAB-separated text
1185 files.  This command works by inserting the file into the buffer and
1186 then converting the region to a table.  Any prefix argument is passed on
1187 to the converter, which uses it to determine the separator.
1189 @item M-x org-table-export
1190 Export the table as a TAB-separated file.  Useful for data exchange with,
1191 for example, Excel or database programs.
1193 @end table
1195 If you don't like the automatic table editor because it gets in your
1196 way on lines which you would like to start with @samp{|}, you can turn
1197 it off with
1199 @lisp
1200 (setq org-enable-table-editor nil)
1201 @end lisp
1203 @noindent Then the only table command that still works is
1204 @kbd{C-c C-c} to do a manual re-align.
1206 @node Narrow columns, Table calculations, Built-in table editor, Tables
1207 @section Narrow columns
1208 @cindex narrow columns in tables
1210 The width of columns is automatically determined by the table editor.
1211 Sometimes a single field or a few fields need to carry more text,
1212 leading to inconveniently wide columns.  To limit@footnote{This feature
1213 does not work on XEmacs.} the width of a column, one field anywhere in
1214 the column may contain just the string @samp{<N>} where @samp{N} is an
1215 integer specifying the width of the column in characters.  The next
1216 re-align will then set the width of this column to no more than this
1217 value.
1219 @example
1220 |---+------------------------------|               |---+--------|
1221 |   |                              |               |   | <6>    |
1222 | 1 | one                          |               | 1 | one    |
1223 | 2 | two                          |     ----\     | 2 | two    |
1224 | 3 | This is a long chunk of text |     ----/     | 3 | This=> |
1225 | 4 | four                         |               | 4 | four   |
1226 |---+------------------------------|               |---+--------|
1227 @end example
1229 @noindent
1230 Fields that are wider become clipped and end in the string @samp{=>}.
1231 Note that the full text is still in the buffer, it is only invisible.
1232 To see the full text, hold the mouse over the field - a tooltip window
1233 will show the full content.  To edit such a field, use the command
1234 @kbd{C-c `} (that is @kbd{C-c} followed by the backquote).  This will
1235 open a new window with the full field.  Edit it and finish with @kbd{C-c
1236 C-c}.
1238 When visiting a file containing a table with narrowed columns, the
1239 necessary character hiding has not yet happened, and the table needs to
1240 be aligned before it looks nice.  Setting the option
1241 @code{org-startup-align-all-tables} will realign all tables in a file
1242 upon visiting, but also slow down startup.  You can also set this option
1243 on a per-file basis with:
1245 @example
1246 #+STARTUP: align
1247 #+STARTUP: noalign
1248 @end example
1250 @node Table calculations, orgtbl-mode, Narrow columns, Tables
1251 @section Calculations in tables
1252 @cindex calculations, in tables
1253 @cindex spreadsheet capabilities
1254 @cindex @file{calc} package
1256 The table editor makes use of the Emacs @file{calc} package to implement
1257 spreadsheet-like capabilities.  It can also evaluate Emacs Lisp forms to
1258 derive fields from other fields.  Org-mode has two levels of complexity
1259 for table calculations.  On the basic level, tables do only horizontal
1260 computations, so a field can be computed from other fields @emph{in the
1261 same row}, and Org-mode assumes that there is only one formula for each
1262 column.  This is very efficient to work with and enough for many tasks.
1263 On the complex level, columns and individual fields can be named for
1264 easier referencing in formulas, individual named fields can have their
1265 own formula associated with them, and recalculation can be automated.
1267 @menu
1268 * Formula syntax::              How to write a formula
1269 * Lisp formulas::               An alternative way to write formulas
1270 * Column formulas::             Formulas valid for all fields in a column
1271 * Advanced features::           Field names, parameters and automatic recalc
1272 * Named-field formulas::        Formulas valid in single fields
1273 * Editing/debugging formulas::  Changing a stored formula
1274 * Appetizer::                   Taste the power of calc
1275 @end menu
1277 @node Formula syntax, Lisp formulas, Table calculations, Table calculations
1278 @subsection Formula syntax
1279 @cindex formula syntax
1280 @cindex syntax, of formulas
1282 A formula can be any algebraic expression understood by the Emacs
1283 @file{calc} package.  Note that @file{calc} has the slightly
1284 non-standard convention that @samp{/} has lower precedence than
1285 @samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.  Before
1286 evaluation by @code{calc-eval} (@pxref{Calling Calc from Your
1287 Programs,calc-eval,Calling calc from Your Lisp Programs,calc,GNU Emacs
1288 Calc Manual}), variable substitution takes place:
1290 @example
1291   $        @r{refers to the current field}
1292   $3       @r{refers to the field in column 3 of the current row}
1293   $3..$7   @r{a vector of the fields in columns 3-7 of current row}
1294   $P1..$P3 @r{vector of column range, using column names}
1295   &2       @r{second data field above the current, in same column}
1296   &5-2     @r{vector from fifth to second field above current}
1297   &III-II  @r{vector of fields between 2nd and 3rd hline above}
1298   &III     @r{vector of fields between third hline above and current field}
1299   $name    @r{a named field, parameter or constant}
1300 @end example
1302 @cindex vectors, in table calculations
1303 The range vectors can be directly fed into the calc vector functions
1304 like @samp{vmean} and @samp{vsum}.
1306 @cindex name, of column or field
1307 @cindex constants, in calculations
1308 @samp{$name} is interpreted as the name of a column, parameter or
1309 constant.  Constants are defined globally through the variable
1310 @code{org-table-formula-constants}.  If you have the
1311 @file{constants.el} package, it will also be used to resolve
1312 constants, including natural constants like @samp{$h} for Planck's
1313 constant, and units like @samp{$km} for kilometers.  Column names and
1314 parameters can be specified in special table lines.  These are
1315 described below, see @ref{Advanced features}.
1317 @cindex format specifier
1318 @cindex mode, for @file{calc}
1319 A formula can contain an optional mode string after a semicolon.  This
1320 string consists of flags to influence calc's modes@footnote{By
1321 default, Org-mode uses the standard calc modes (precision 12, angular
1322 units degrees, fraction and symbolic modes off).  The display format,
1323 however, has been changed to @code{(float 5)} to keep tables compact.
1324 The default settings can be configured using the variable
1325 @code{org-calc-default-modes}.} during execution, e.g.  @samp{p20} to
1326 switch the internal precision to 20 digits, @samp{n3}, @samp{s3},
1327 @samp{e2} or @samp{f4} to switch to normal, scientific, engineering,
1328 or fixed display format, respectively, and @samp{D}, @samp{R}, @samp{F},
1329 and @samp{S} to turn on degrees, radians, fraction and symbolic modes,
1330 respectively.  In addition, you may provide a @code{printf} format
1331 specifier to reformat the final result.  A few examples:
1333 @example
1334 $1+$2                @r{Sum of first and second field}
1335 $1+$2;%.2f           @r{Same, format result to two decimals}
1336 exp($2)+exp($1)      @r{Math functions can be used}
1337 $;%.1f               @r{Reformat current cell to 1 decimal}
1338 ($3-32)*5/9          @r{Degrees F -> C conversion}
1339 $c/$1/$cm            @r{Hz -> cm conversion, using @file{constants.el}}
1340 tan($1);Dp3s1        @r{Compute in degrees, precision 3, display SCI 1}
1341 sin($1);Dp3%.1e      @r{Same, but use printf specifier for display}
1342 vmean($2..$7)        @r{Compute column range mean, using vector function}
1343 vsum(&III)           @r{Sum numbers from 3rd hline above, up to here}
1344 taylor($3,x=7,2)     @r{taylor series of $3, at x=7, second degree}
1345 @end example
1347 @node Lisp formulas, Column formulas, Formula syntax, Table calculations
1348 @subsection Emacs Lisp forms as formulas
1349 @cindex Lisp forms, as table formulas
1351 It is also possible to write a formula in Emacs lisp; this can be useful
1352 for string manipulation and control structures.  If a formula starts
1353 with a single quote followed by an opening parenthesis, then it is
1354 evaluated as a lisp form.  The evaluation should return either a string
1355 or a number.  Just as with @file{calc} formulas, you can provide a
1356 format specifier after a semicolon.  A few examples:
1358 @example
1359 @r{swap the first two characters of the content of column 1}
1360 '(concat (substring "$1" 1 2) (substring "$1" 0 1) (substring "$1" 2))
1361 @r{Add columns 1 and 2, equivalent to the calc's @code{$1+$2}}
1362 '(+ $1 $2)
1363 @end example
1365 @node Column formulas, Advanced features, Lisp formulas, Table calculations
1366 @subsection Column formulas
1367 @cindex column formula
1368 @cindex formula, for table column
1370 To apply a formula to a field, type it directly into the field,
1371 preceded by an equal sign, like @samp{=$1+$2}.  When you press
1372 @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in the
1373 field, the formula will be stored as the formula for the current
1374 column, evaluated and the current field replaced with the result.  If
1375 the field contains only @samp{=}, the previously stored formula for
1376 this column is used.
1378 For each column, Org-mode will remember the most recently used
1379 formula.  The information is stored in a special line starting with
1380 @samp{#+TBLFM} directly below the table.  When adding/deleting/moving
1381 columns with the appropriate commands, the stored equations will be
1382 modified accordingly.  When a column used in a calculation is removed,
1383 references to this column become invalid and will cause an error upon
1384 applying the equation.
1386 Instead of typing an equation into the field, you may also use the
1387 command @kbd{C-c =}.  It prompts for a formula (with default taken
1388 from the @samp{#+TBLFM:} line) and applies it to the current field.  A
1389 numerical prefix (e.g. @kbd{C-5 C-c =}) will apply it to that many
1390 consecutive fields in the current column.
1392 @cindex recomputing table fields
1393 To recompute all the fields in a line, use the command @kbd{C-c *}.
1394 It re-applies all stored equations to the current row, from left to
1395 right.  With a @kbd{C-u} prefix, this will be done to every line in
1396 the table, so use this command it you want to make sure the entire
1397 table is up-to-date. @kbd{C-u C-c C-c} is another way to update the
1398 entire table.  Global updating does not touch the line(s) above the
1399 first horizontal separator line, assuming that this is the table
1400 header.
1402 @node Advanced features, Named-field formulas, Column formulas, Table calculations
1403 @subsection Advanced features
1405 If you want the recalculation of fields to happen automatically,
1406 or if you want to be able to assign a formula to an individual field
1407 (instead of an entire column) you need to reserve the first column of
1408 the table for special marking characters.  Here is an example of a
1409 table that collects exam results of students and makes use of these
1410 features:
1412 @example
1413 @group
1414 |---+---------+--------+--------+--------+-------+------|
1415 |   | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
1416 |---+---------+--------+--------+--------+-------+------|
1417 | ! |         |     P1 |     P2 |     P3 |   Tot |      |
1418 | # | Maximum |     10 |     15 |     25 |    50 | 10.0 |
1419 | ^ |         |     m1 |     m2 |     m3 |    mt |      |
1420 |---+---------+--------+--------+--------+-------+------|
1421 | # | Peter   |     10 |      8 |     23 |    41 |  8.2 |
1422 | # | Sara    |      6 |     14 |     19 |    39 |  7.8 |
1423 | # | Sam     |      2 |      4 |      3 |     9 |  1.8 |
1424 |---+---------+--------+--------+--------+-------+------|
1425 |   | Average |        |        |        |  29.7 |      |
1426 | ^ |         |        |        |        |    at |      |
1427 | $ | max=50  |        |        |        |       |      |
1428 |---+---------+--------+--------+--------+-------+------|
1429 #+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(&II);%.1f
1430 @end group
1431 @end example
1433 @noindent @b{Important}: Please note that for these special tables,
1434 recalculating the table with @kbd{C-u C-c *} will only affect rows
1435 that are marked @samp{#} or @samp{*}, and named fields.  The column
1436 formulas are not applied in rows with empty first field.
1438 @cindex marking characters, tables
1439 The marking characters have the following meaning:
1440 @table @samp
1441 @item !
1442 The fields in this line define names for the columns, so that you may
1443 refer to a column as @samp{$Tot} instead of @samp{$6}.
1444 @item ^
1445 This row defines names for the fields @emph{above} the row.  With such
1446 a definition, any formula in the table may use @samp{$m1} to refer to
1447 the value @samp{10}.  Also, named fields can have their own formula
1448 associated with them.
1449 @item _
1450 Similar to @samp{^}, but defines names for the fields in the row
1451 @emph{below}.
1452 @item $
1453 Fields in this row can define @emph{parameters} for formulas.  For
1454 example, if a field in a @samp{$} row contains @samp{max=50}, then
1455 formulas in this table can refer to the value 50 using @samp{$max}.
1456 Parameters work exactly like constants, only that they can be defined on
1457 a per-table basis.  Changing a parameter and then recalculating the
1458 table can be useful.
1459 @item #
1460 Fields in this row are automatically recalculated when pressing
1461 @key{TAB} or @key{RET} or @kbd{S-@key{TAB}} in this row.  Also, this row
1462 is selected for a global recalculation with @kbd{C-u C-c *}.  Unmarked
1463 lines will be left alone by this command.
1464 @item *
1465 Selects this line for global recalculation with @kbd{C-u C-c *}, but
1466 not for automatic recalculation.  Use this when automatic
1467 recalculation slows down editing too much.
1468 @item
1469 Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}.
1470 All lines that should be recalculated should be marked with @samp{#}
1471 or @samp{*}.
1472 @end table
1474 @node Named-field formulas, Editing/debugging formulas, Advanced features, Table calculations
1475 @subsection Named-field formulas
1476 @cindex named field formula
1477 @cindex formula, for named table field
1479 A named field can have its own formula associated with it.  In the
1480 example above, this is used for the @samp{at} field that contains
1481 the average result of the students.  To enter a formula for a named
1482 field, just type it into the buffer, preceded by @samp{:=}.  Or use
1483 @kbd{C-u C-c =}.  This equation will be stored below the table like
1484 @samp{$name=...}.  Any recalculation in the table (even if only
1485 requested for the current line) will also update all named field
1486 formulas.
1488 @node Editing/debugging formulas, Appetizer, Named-field formulas, Table calculations
1489 @subsection Editing and debugging formulas
1490 @cindex formula editing
1491 @cindex editing, of table formulas
1493 To edit a column or field formula, use the commands @kbd{C-c
1494 =} and @kbd{C-u C-c =}, respectively.  The currently active expression
1495 is then presented as default in the minibuffer, where it may be edited.
1497 Note that making a table field blank does not remove the formula
1498 associated with the field - during the next recalculation the field
1499 will be filled again.  To remove a formula from a field, you have to
1500 give an empty reply when prompted for the formula, or to edit the
1501 @samp{#+TBLFM} line.
1503 @kindex C-c C-c
1504 You may edit the @samp{#+TBLFM} directly and re-apply
1505 the changed equations with @kbd{C-c C-c} in that line, or with the
1506 normal recalculation commands in the table.
1508 @kindex C-c '
1509 @kindex C-c C-c
1510 @kindex C-c C-q
1511 @kindex C-c ?
1512 In particular for large tables with many formulas, it is convenient to
1513 use the command @kbd{C-c '} to edit the formulas of the current table
1514 in a separate buffer.  That buffer will show the formulas one per
1515 line, and you are free to edit, add and remove formulas.  Press
1516 @kbd{C-c ?} on a @samp{$...}  expression to get information about its
1517 interpretation.  Exiting the buffer with @kbd{C-c C-c} only stores the
1518 modified formulas below the table.  Exiting with @kbd{C-u C-c C-c}
1519 also applies them to the entire table.  @kbd{C-c C-q} exits without
1520 installing the changes.
1522 When the evaluation of a formula leads to an error, the field content
1523 becomes the string @samp{#ERROR}.  If you would like see what is going
1524 on during variable substitution and calculation in order to find a
1525 bug, turn on formula debugging in the menu and repeat the calculation,
1526 for example by pressing @kbd{C-c = @key{RET}} in a field.
1527 Detailed information will be displayed.
1529 @node Appetizer,  , Editing/debugging formulas, Table calculations
1530 @subsection Appetizer
1532 Finally, just to whet your appetite on what can be done with the fantastic
1533 @file{calc} package, here is a table that computes the Taylor series
1534 for a couple of functions (homework: try that with Excel :-)
1536 @example
1537 @group
1538 |---+-------------+---+-----+--------------------------------------|
1539 |   | Func        | n | x   | Result                               |
1540 |---+-------------+---+-----+--------------------------------------|
1541 | # | exp(x)      | 1 | x   | 1 + x                                |
1542 | # | exp(x)      | 2 | x   | 1 + x + x^2 / 2                      |
1543 | # | exp(x)      | 3 | x   | 1 + x + x^2 / 2 + x^3 / 6            |
1544 | # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 |
1545 | # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2    |
1546 | * | tan(x)      | 3 | x   | 0.0175 x + 1.77e-6 x^3               |
1547 |---+-------------+---+-----+--------------------------------------|
1548 #+TBLFM: $5=taylor($2,$4,$3);n3
1549 @end group
1550 @end example
1552 @node orgtbl-mode, table.el, Table calculations, Tables
1553 @section The Orgtbl minor mode
1554 @cindex orgtbl-mode
1555 @cindex minor mode for tables
1557 If you like the intuitive way the Org-mode table editor works, you
1558 might also want to use it in other modes like text-mode or mail-mode.
1559 The minor mode Orgtbl-mode makes this possible.  You can always toggle
1560 the mode with @kbd{M-x orgtbl-mode}.  To turn it on by default, for
1561 example in mail mode, use
1563 @lisp
1564 (add-hook 'mail-mode-hook 'turn-on-orgtbl)
1565 @end lisp
1567 @node table.el,  , orgtbl-mode, Tables
1568 @section The @file{table.el} package
1569 @kindex C-c C-c
1570 @cindex table editor, @file{table.el}
1571 @cindex @file{table.el}
1573 Complex ASCII tables with automatic line wrapping, column- and
1574 row-spanning, and alignment can be created using the Emacs table
1575 package by Takaaki Ota (@uref{http://sourceforge.net/projects/table},
1576 and also part of Emacs 22).
1577 When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org-mode
1578 will call @command{table-recognize-table} and move the cursor into the
1579 table.  Inside a table, the keymap of Org-mode is inactive.  In order
1580 to execute Org-mode-related commands, leave the table.
1582 @table @kbd
1583 @kindex C-c C-c
1584 @item C-c C-c
1585 Recognize @file{table.el} table.  Works when the cursor is in a
1586 table.el table.
1588 @kindex C-c ~
1589 @item C-c ~
1590 Insert a table.el table.  If there is already a table at point, this
1591 command converts it between the table.el format and the Org-mode
1592 format.  See the documentation string of the command
1593 @code{org-convert-table} for the restrictions under which this is
1594 possible.
1595 @end table
1597 @node Hyperlinks, TODO items, Tables, Top
1598 @chapter Hyperlinks
1599 @cindex hyperlinks
1601 Just like HTML, Org-mode provides links inside a file, and external
1602 links to other files, Usenet articles, emails, and much more.
1604 @menu
1605 * Link format::                 How links in Org-mode are formatted
1606 * Internal links::              Links to other places in the current file
1607 * External links::              URL-like links to the world
1608 * Handling links::              Creating, inserting and following
1609 * Link abbreviations::          Shortcuts for writing complex links
1610 * Search options::              Linking to a specific location
1611 * Custom searches::             When the default search is not enough
1612 * Remember::                    Org-trees store quick notes
1613 @end menu
1615 @node Link format, Internal links, Hyperlinks, Hyperlinks
1616 @section Link format
1617 @cindex link format
1618 @cindex format, of links
1620 Org-mode will recognize plain URL-like links and activate them as
1621 clickable links.  The general link format, however, looks like this:
1623 @example
1624 [[link][description]]       @r{or alternatively}           [[link]]  
1625 @end example
1627 Once a link in the buffer is complete (all brackets present), Org-mode
1628 will change the display so that @samp{description} is displayed instead
1629 of @samp{[[link][description]]} and @samp{link} is displayed instead of
1630 @samp{[[link]]}.  Links will be highlighted in the face @code{org-link},
1631 which by default is an underlined face.  You can directly edit the
1632 visible part of a link.  Note that this can be either the @samp{link}
1633 part (if there is no description) or the @samp{description} part.  To
1634 edit also the invisible @samp{link} part, use @kbd{C-c C-l} with the
1635 cursor on the link.
1637 If you place the cursor at the beginning or just behind the end of the
1638 displayed text and press @key{BACKSPACE}, you will remove the
1639 (invisible) bracket at that location.  This makes the link incomplete
1640 and the internals are again displayed as plain text.  Inserting the
1641 missing bracket hides the link internals again.  To show the
1642 internal structure of all links, use the menu entry
1643 @code{Org->Hyperlinks->Literal links}.
1645 @node Internal links, External links, Link format, Hyperlinks
1646 @section Internal links
1647 @cindex internal links
1648 @cindex links, internal
1649 @cindex CamelCase links
1650 @cindex targets, for links
1652 If the link does not look like a URL, it is considered to be internal in
1653 the current file.  Links such as @samp{[[My Target]]} or @samp{[[My
1654 Target][Find my target]]} lead to a text search in the current file.
1655 The link can be followed with @kbd{C-c C-o} when the cursor is on the
1656 link, or with a mouse click (@pxref{Handling links}).  The preferred
1657 match for such a link is a dedicated target: the same string in double
1658 angular brackets.  Targets may be located anywhere; often it is
1659 convenient to put them into a comment line. For example
1661 @example
1662 # <<My Target>>
1663 @end example
1665 @noindent In HTML export (@pxref{HTML export}), such targets will become
1666 named anchors for direct access through @samp{http} links@footnote{Note
1667 that text before the first headline will never be exported, so the first
1668 such target must be after the first headline.}.
1670 If no dedicated target exists, Org-mode will search for the words in the
1671 link.  In the above example the search would be for @samp{my target}.
1672 Links starting with a star like @samp{*My Target} restrict the search to
1673 headlines.  When searching, Org-mode will first try an exact match, but
1674 then move on to more and more lenient searches.  For example, the link
1675 @samp{[[*My Targets]]} will find any of the following:
1677 @example
1678 ** My targets
1679 ** TODO my targets are bright
1680 ** my 20 targets are
1681 @end example
1683 To insert a link targeting a headline, in-buffer completion can be used.
1684 Just type a star followed by a few optional letters into the buffer and
1685 press @kbd{M-@key{TAB}}.  All headlines in the current buffer will be
1686 offered as completions.  @xref{Handling links}, for more commands
1687 creating links.
1689 Following a link pushes a mark onto Org-mode's own mark ring.  You can
1690 return to the previous position with @kbd{C-c &}.  Using this command
1691 several times in direct succession goes back to positions recorded
1692 earlier.
1694 @menu
1695 * Radio targets::               Make targets trigger links in plain text.
1696 * CamelCase links::             Activating CamelCase words as links
1697 @end menu
1699 @node Radio targets, CamelCase links, Internal links, Internal links
1700 @subsection Radio targets
1701 @cindex radio targets
1702 @cindex targets, radio
1703 @cindex links, radio targets
1705 You can configure Org-mode to link any occurrences of certain target
1706 names in normal text.  So without explicitly creating a link, the text
1707 connects to the target radioing its position.  Radio targets are
1708 enclosed by triple angular brackets.  For example, a target
1709 @samp{<<<My Target>>>} causes each occurrence of @samp{my target} in
1710 normal text to become activated as a link.  The Org-mode file is
1711 scanned automatically for radio targets only when the file is first
1712 loaded into Emacs.  To update the target list during editing, press
1713 @kbd{C-c C-c} with the cursor on or at a target.
1715 @node CamelCase links,  , Radio targets, Internal links
1716 @subsection CamelCase words as links
1717 @cindex completion, of CamelCase links
1718 @cindex CamelCase links, completion of
1720 Org-mode also supports CamelCase words as links.  This feature is not
1721 turned on by default because of the inconsistencies this system suffers
1722 from.  It is also possible that this feature will disappear entirely in
1723 a future version of Org-mode.  To activate CamelCase words as links, you
1724 need to customize the option @code{org-activate-links}.  A CamelCase
1725 word then leads to a text search such that @samp{CamelCaseLink} is
1726 equivalent to @samp{[[camel case link]]}.
1728 @node External links, Handling links, Internal links, Hyperlinks
1729 @section External links
1730 @cindex links, external
1731 @cindex external links
1732 @cindex links, external
1733 @cindex GNUS links
1734 @cindex BBDB links
1735 @cindex URL links
1736 @cindex file links
1737 @cindex VM links
1738 @cindex RMAIL links
1739 @cindex WANDERLUST links
1740 @cindex MH-E links
1741 @cindex USENET links
1742 @cindex SHELL links
1743 @cindex Info links
1744 @cindex elisp links
1746 Org-mode supports links to files, websites, Usenet and email messages,
1747 and BBDB database entries.  External links are URL-like locators.  They
1748 start with a short identifying string followed by a colon.  There can be
1749 no space after the colon.  The following list shows examples for each
1750 link type.
1752 @example
1753 http://www.astro.uva.nl/~dominik          @r{on the web}
1754 file:/home/dominik/images/jupiter.jpg     @r{file, absolute path}
1755 file:papers/last.pdf                      @r{file, relative path}
1756 news:comp.emacs                           @r{Usenet link}
1757 mailto:adent@@galaxy.net                   @r{Mail link}
1758 vm:folder                                 @r{VM folder link}
1759 vm:folder#id                              @r{VM message link}
1760 vm://myself@@some.where.org/folder#id      @r{VM on remote machine}
1761 wl:folder                                 @r{WANDERLUST folder link}
1762 wl:folder#id                              @r{WANDERLUST message link}
1763 mhe:folder                                @r{MH-E folder link}
1764 mhe:folder#id                             @r{MH-E message link}
1765 rmail:folder                              @r{RMAIL folder link}
1766 rmail:folder#id                           @r{RMAIL message link}
1767 gnus:group                                @r{GNUS group link}
1768 gnus:group#id                             @r{GNUS article link}
1769 bbdb:Richard Stallman                     @r{BBDB link}
1770 shell:ls *.org                            @r{A shell command}
1771 elisp:(find-file-other-frame "Elisp.org") @r{An elisp form to evaluate}
1772 @end example
1774 A link should be enclosed in double brackets and may contain a
1775 descriptive text to be displayed instead of the url (@pxref{Link
1776 format}), for example:
1778 @example
1779 [[http://www.gnu.org/software/emacs/][GNU Emacs]]
1780 @end example
1782 @cindex angular brackets, around links
1783 @cindex plain text external links
1784 Org-mode also finds external links in the normal text and activates them
1785 as links.  If spaces must be part of the link (for example in
1786 @samp{bbdb:Richard Stallman}), or you need to remove ambiguities about the end of
1787 the link, enclose them in angular brackets.
1789 @node Handling links, Link abbreviations, External links, Hyperlinks
1790 @section Handling links
1791 @cindex links, handling
1793 Org-mode provides methods to create a link in the correct syntax, to
1794 insert it into an org-mode file, and to follow the link.
1796 @table @kbd
1797 @kindex C-c l
1798 @cindex storing links
1799 @item C-c l
1800 Store a link to the current location.  This is a @emph{global} command
1801 which can be used in any buffer to create a link.  The link will be
1802 stored for later insertion into an Org-mode buffer (see below).  For
1803 Org-mode files, if there is a @samp{<<target>>} at the cursor, the link
1804 points to the target.  Otherwise it points to the current headline.  For
1805 VM, RMAIL, WANDERLUST, MH-E, GNUS and BBDB buffers, the link will
1806 indicate the current article/entry.  For W3 and W3M buffers, the link
1807 goes to the current URL.  For any other files, the link will point to
1808 the file, with a search string (@pxref{Search options}) pointing to the
1809 contents of the current line.  If there is an active region, the
1810 selected words will form the basis of the search string.  If the
1811 automatically created link is not working correctly or accurately
1812 enough, you can write custom functions to select the search string and
1813 to do the search for particular file types - see @ref{Custom searches}.
1814 The key binding @kbd{C-c l} is only a suggestion - see @ref{Installation}.
1816 @kindex C-c C-l
1817 @cindex link completion
1818 @cindex completion, of links
1819 @cindex inserting links
1820 @item C-c C-l
1821 Insert a link.  This prompts for a link to be inserted into the buffer.
1822 You can just type a link, using text for an internal link, or one of the
1823 link type prefixes mentioned in the examples above.  Through completion,
1824 all links stored during the current session can be
1825 accessed@footnote{After insertion of a stored link, the link will be
1826 removed from the list of stored links.  To keep it in the list later
1827 use, use a triple @kbd{C-u} prefix to @kbd{C-c C-l}, or configure the
1828 option @code{org-keep-stored-link-after-insertion}.}.  The link
1829 will be inserted into the buffer, along with a descriptive text.  Note
1830 that you don't have to use this command to insert a link.  Links in
1831 Org-mode are plain text, and you can type or paste them straight into
1832 the buffer.  By using this command, the links are automatically enclosed
1833 in double brackets, and you will be asked for the optional descriptive
1834 text.  If the link is a @samp{file:} link and the linked file is located
1835 in the same directory as the current file or a subdirectory of it, the
1836 path of the file will be inserted relative to the current directory.
1838 @kindex C-u C-c C-l
1839 @cindex file name completion
1840 @cindex completion, of file names
1841 @item C-u C-c C-l
1842 When @kbd{C-c C-l} is called with a @kbd{C-u} prefix argument, a link to
1843 a file will be inserted and you may use file name completion to select
1844 the name of the file.  The path to the file is inserted relative to the
1845 directory of the current org file, if the linked file is in the current
1846 directory or in a subdirectory of it, or if the path is written relative
1847 to the current directory using @samp{../}.  Otherwise an absolute path
1848 is used, if possible with @samp{~/} for your home directory.  You can
1849 force an absolute path with two @kbd{C-u} prefixes.
1851 @item C-c C-l @r{with cursor on existing link}
1852 When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit the
1853 link and description parts of the link.
1855 @cindex following links
1856 @kindex C-c C-o
1857 @item C-c C-o
1858 Open link at point.  This will launch a web browser for URLs (using
1859 @command{browse-url-at-point}), run vm/mh-e/wanderlust/rmail/gnus/bbdb
1860 for the corresponding links, and execute the command in a shell link.
1861 When the cursor is on an internal link, this commands runs the
1862 corresponding search.  When the cursor is on a TAG list in a headline,
1863 it creates the corresponding TAGS view.  If the cursor is on a time
1864 stamp, it compiles the agenda for that date.  Furthermore, it will visit
1865 text and remote files in @samp{file:} links with Emacs and select a
1866 suitable application for local non-text files.  Classification of files
1867 is based on file extension only.  See option @code{org-file-apps}.  If
1868 you want to override the default application and visit the file with
1869 Emacs, use a @kbd{C-u} prefix.
1871 @kindex mouse-2
1872 @kindex mouse-1
1873 @item mouse-2
1874 @itemx mouse-1
1875 On links, @kbd{mouse-2} will open the link just as @kbd{C-c C-o}
1876 would.  Under Emacs 22, also @kbd{mouse-1} will follow a link.
1878 @kindex mouse-3
1879 @item mouse-3
1880 Like @kbd{mouse-2}, but force file links to be opened with Emacs, and
1881 internal links to be displayed in another window@footnote{See the
1882 variable @code{org-display-internal-link-with-indirect-buffer}}.
1884 @cindex mark ring
1885 @kindex C-c %
1886 @item C-c %
1887 Push the current position onto the mark ring, to be able to return
1888 easily. Commands following an internal link do this automatically.
1890 @cindex links, returning to
1891 @kindex C-c &
1892 @item C-c &
1893 Jump back to a recorded position.  A position is recorded by the
1894 commands following internal links, and by @kbd{C-c %}.  Using this
1895 command several times in direct succession moves through a ring of
1896 previously recorded positions.
1897 @end table
1899 @node Link abbreviations, Search options, Handling links, Hyperlinks
1900 @section Link abbreviatons
1901 @cindex link abbreviations
1902 @cindex abbreviation, links
1904 Long URLs can be cumbersome to type, and often many similar links are
1905 needed in a document.  For this you can use link abbreviations.  An
1906 abbreviated link looks like this
1908 @example
1909 [[linkword::tag][description]]
1910 @end example
1912 @noindent
1913 where the tag is optional.  Such abbreviations are resolved according to
1914 the information in the variable @code{org-link-abbrev-alist} that
1915 relates the linkwords to replacement text.  Here is an example:
1917 @lisp
1918 @group
1919 (setq org-link-abbrev-alist
1920   '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
1921     ("google"   . "http://www.google.com/search?q=")
1922     ("ads"      . "http://adsabs.harvard.edu/cgi-bin/
1923                    nph-abs_connect?author=%s&db_key=AST")))
1924 @end group
1925 @end lisp
1927 If the replacement text contains the string @samp{%s}, it will be
1928 replaced with the tag.  Otherwise the tag will be appended to the string
1929 in order to create the link.  You may also specify a function that will
1930 be called with the tag as the only argument to create the link.
1932 With the above setting, you could link to a specific bug with
1933 @code{[[bugzilla::129]]}, search the web for OrgMode with
1934 @code{[[google::OrgMode]]} and find out what the Org-mode author is
1935 doing besides Emacs hacking with @code{[[ads::Dominik,C]]}.
1937 If you need special abbreviations just for a single Org-mode buffer, you
1938 can define them in the file with
1940 @example
1941 #+LINK: bugzilla  http://10.1.2.9/bugzilla/show_bug.cgi?id=
1942 #+LINK: google    http://www.google.com/search?q=%s
1943 @end example
1945 @noindent
1946 In-buffer completion @pxref{Completion} can be used after @samp{[} to
1947 complete link abbreviations.
1949 @node Search options, Custom searches, Link abbreviations, Hyperlinks
1950 @section Search options in file links
1951 @cindex search option in file links
1952 @cindex file links, searching
1954 File links can contain additional information to make Emacs jump to a
1955 particular location in the file when following a link.  This can be a
1956 line number or a search option after a double@footnote{For backward
1957 compatibility, line numbers can also follow a single colon.} colon. For
1958 example, when the command @kbd{C-c l} creates a link (@pxref{Handling
1959 links}) to a file, it encodes the words in the current line as a search
1960 string that can be used to find this line back later when following the
1961 link with @kbd{C-c C-o}. 
1963 Here is the syntax of the different ways to attach a search to a file
1964 link, together with an explanation:
1966 @example
1967 [[file:~/code/main.c::255]]
1968 [[file:~/xx.org::My Target]]
1969 [[file:~/xx.org::*My Target]]
1970 [[file:~/xx.org::/regexp/]]
1971 @end example
1973 @table @code
1974 @item 255
1975 Jump to line 255.
1976 @item My Target
1977 Search for a link target @samp{<<My Target>>}, or do a text search for
1978 @samp{my target}, similar to the search in internal links, see
1979 @ref{Internal links}.  In HTML export (@pxref{HTML export}), such a file
1980 link will become an HTML reference to the corresponding named anchor in
1981 the linked file.
1982 @item *My Target
1983 In an Org-mode file, restrict search to headlines.
1984 @item /regexp/
1985 Do a regular expression search for @code{regexp}.  This uses the Emacs
1986 command @code{occur} to list all matches in a separate window.  If the
1987 target file is in Org-mode, @code{org-occur} is used to create a
1988 sparse tree with the matches.
1989 @c If the target file is a directory,
1990 @c @code{grep} will be used to search all files in the directory.
1991 @end table
1993 As a degenerate case, a file link with an empty file name can be used
1994 to search the current file.  For example, @code{<file:::find me>} does
1995 a search for @samp{find me} in the current file, just as
1996 @samp{[[find me]]} would.
1998 @node Custom searches, Remember, Search options, Hyperlinks
1999 @section Custom Searches
2000 @cindex custom search strings
2001 @cindex search strings, custom
2003 The default mechanism for creating search strings and for doing the
2004 actual search related to a file link may not work correctly in all
2005 cases.  For example, BibTeX database files have many entries like
2006 @samp{year="1993"} which would not result in good search strings,
2007 because the only unique identification for a BibTeX entry is the
2008 citation key.
2010 If you come across such a problem, you can write custom functions to set
2011 the right search string for a particular file type, and to do the search
2012 for the string in the file.  Using @code{add-hook}, these functions need
2013 to be added to the hook variables
2014 @code{org-create-file-search-functions} and
2015 @code{org-execute-file-search-functions}.  See the docstring for these
2016 variables for more information.  Org-mode actually uses this mechanism
2017 for Bib@TeX{} database files, and you can use the corresponding code as
2018 an implementation example.  Search for @samp{BibTeX links} in the source
2019 file.
2022 @node Remember,  , Custom searches, Hyperlinks
2023 @section Remember
2024 @cindex @file{remember.el}
2026 Another way to create org entries with links to other files is through
2027 the @emph{Remember} package by John Wiegley.  @emph{Remember} lets you
2028 store quick notes with little interruption of your work flow.  See
2029 @uref{http://www.emacswiki.org/cgi-bin/wiki/RememberMode} for more
2030 information.  The notes produced by @emph{Remember} can be stored in
2031 different ways, and Org-mode files are a good target.  Org-mode allows
2032 you to file away notes either to a default file, or directly to the correct
2033 location in your Org-mode outline tree.  The following customization
2034 will tell @emph{Remember} to use org files as target, and to create
2035 annotations compatible with Org-mode links.
2037 @example
2038 (setq org-directory "~/path/to/my/orgfiles/")
2039 (setq org-default-notes-file "~/.notes")
2040 (setq remember-annotation-functions '(org-remember-annotation))
2041 (setq remember-handler-functions '(org-remember-handler))
2042 (add-hook 'remember-mode-hook 'org-remember-apply-template)
2043 @end example
2045 @cindex templates, for remember
2046 In combination with Org-mode, you can use templates to generate
2047 different types of remember notes.  For example, if you would like to
2048 use one template to create general TODO entries, and another one for
2049 journal entries, you could use:
2051 @example
2052 (setq org-remember-templates
2053       '((?t "* TODO %?\n  %i\n  %a" "~/org/TODO.org")
2054         (?j "* %U %?\n\n  %i\n  %a" "~/org/JOURNAL.org")))
2055 @end example
2057 @noindent In these entries, the character specifies how to select the
2058 template, the first string specifies the template, and the (optional)
2059 second string specifies a default file (overruling
2060 @code{org-default-notes-file}) as a target for this note.
2062 When you call @kbd{M-x remember} to remember something, org will prompt
2063 for a key to select the template and then prepare the buffer like
2064 @example
2065 * TODO
2066   <file:link to where you called remember>
2067 @end example
2069 @noindent or
2071 @example
2072 * [2006-03-21 Tue 15:37]
2074   <file:link to where you called remember>
2075 @end example
2077 @noindent See the variable @code{org-remember-templates} for more details.
2079 When you are finished composing a note with remember, you have to press
2080 @kbd{C-c C-c} to file the note away.  The handler first prompts for a
2081 target file - if you press @key{RET}, the value of
2082 @code{org-default-notes-file} is used.  Then the command offers the
2083 headings tree of the selected file.  You can either immediately press
2084 @key{RET} to get the note appended to the file.  Or you can use vertical
2085 cursor motion (@key{up} and @key{down}) and visibility cycling
2086 (@key{TAB}) to find a better place.  Pressing @key{RET} or @key{left} or
2087 @key{right} leads to the following result.
2089 @multitable @columnfractions 0.2 0.1 0.7
2090 @item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted}
2091 @item buffer-start @tab @key{RET} @tab as level 2 heading at end of file
2092 @item on headline @tab @key{RET} @tab as sublevel of the heading at cursor
2093 @item             @tab @key{left}  @tab as same level, before current heading
2094 @item             @tab @key{right} @tab as same level, after current heading
2095 @item not on headline @tab @key{RET}
2096       @tab at cursor position, level taken from context.
2097            Or use prefix arg to specify level manually.
2098 @end multitable
2100 So a fast way to store the note is to press @kbd{C-c C-c @key{RET}
2101 @key{RET}} to append it to the default file.  Even shorter would be
2102 @kbd{C-u C-c C-c}, which does the same without even showing the tree.
2103 But with little extra effort, you can push it directly to the correct
2104 location.
2106 Before inserting the text into a tree, the function ensures that the
2107 text has a headline, i.e. a first line that starts with a @samp{*}.
2108 If not, a headline is constructed from the current date and some
2109 additional data.  If the variable @code{org-adapt-indentation} is
2110 non-nil, the entire text is also indented so that it starts in the
2111 same column as the headline (after the asterisks).
2114 @node TODO items, Timestamps, Hyperlinks, Top
2115 @chapter TODO items
2116 @cindex TODO items
2118 Org-mode does not maintain TODO lists as a separate document.  TODO
2119 items are an integral part of the notes file, because TODO items
2120 usually come up while taking notes!  With Org-mode, you simply mark
2121 any entry in a tree as being a TODO item.  In this way, the
2122 information is not duplicated, and the entire context from which the
2123 item emerged is always present when you check.
2125 Of course, this technique causes TODO items to be scattered throughout
2126 your file.  Org-mode provides methods to give you an overview over all
2127 things you have to do.
2129 @menu
2130 * TODO basics::                 Marking and displaying TODO entries
2131 * TODO extensions::             Workflow and assignments
2132 * Priorities::                  Some things are more important than others
2133 * Breaking down tasks::         Splitting a task into managable pieces
2134 * Checkboxes::                  Tick-off lists
2135 @end menu
2137 @node TODO basics, TODO extensions, TODO items, TODO items
2138 @section Basic TODO functionality
2140 Any headline can become a TODO item by starting it with the word TODO,
2141 for example:
2143 @example
2144 *** TODO Write letter to Sam Fortune
2145 @end example
2147 @noindent
2148 The most important commands to work with TODO entries are:
2150 @table @kbd
2151 @kindex C-c C-t
2152 @cindex cycling, of TODO states
2153 @item C-c C-t
2154 Rotate the TODO state of the current item between
2156 @example
2157 ,-> (unmarked) -> TODO -> DONE --.
2158 '--------------------------------'
2159 @end example
2161 The same rotation can also be done ``remotely'' from the timeline and
2162 agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
2163 @kindex S-@key{right}
2164 @kindex S-@key{left}
2165 @item S-@key{right}
2166 @itemx S-@key{left}
2167 Select the following/preceding TODO state, similar to cycling.  Mostly
2168 useful if more than two TODO states are possible (@pxref{TODO extensions}).
2169 @kindex C-c C-v
2170 @cindex sparse tree, for TODO
2171 @item C-c C-v
2172 View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}).  Folds
2173 the entire buffer, but shows all TODO items and the headings hierarchy
2174 above them.  With prefix arg, show also the DONE entries.  With
2175 numerical prefix N, show the tree for the Nth keyword in the variable
2176 @code{org-todo-keywords}.
2177 @kindex C-c a t
2178 @item C-c a t
2179 Show the global TODO list.  This collects the TODO items from all
2180 agenda files (@pxref{Agenda views}) into a single buffer.  The buffer is in
2181 @code{agenda-mode}, so there are commands to examine and manipulate
2182 the TODO entries directly from that buffer (@pxref{Agenda commands}).
2183 @xref{Global TODO list}, for more information.
2184 @c @item @code{org-agenda-include-all-todo}
2185 @c If you would like to have all your TODO items listed as part of your
2186 @c agenda, customize the variable @code{org-agenda-include-all-todo}.
2187 @end table
2190 @node TODO extensions, Priorities, TODO basics, TODO items
2191 @section Extended use of TODO keywords
2192 @cindex extended TODO keywords
2194 The default implementation of TODO entries is just two states: TODO and
2195 DONE.  You can, however, use the TODO feature for more complicated
2196 things by configuring the variables @code{org-todo-keywords} and
2197 @code{org-todo-interpretation}.  Using special setup, you can even use
2198 TODO keywords in different ways in different org files.
2200 Note that @i{tags} are another way to classify headlines in general and
2201 TODO items in particular (@pxref{Tags}).
2203 @menu
2204 * Workflow states::             From TODO to DONE in steps
2205 * TODO types::                  I do this, Fred the rest
2206 * Per file keywords::           Different files, different requirements
2207 @end menu
2209 @node Workflow states, TODO types, TODO extensions, TODO extensions
2210 @subsection TODO keywords as workflow states
2211 @cindex TODO workflow
2212 @cindex workflow states as TODO keywords
2214 You can use TODO keywords to indicate different states in the process
2215 of working on an item, for example:
2217 @lisp
2218 (setq org-todo-keywords '("TODO" "FEEDBACK" "VERIFY" "DONE")
2219       org-todo-interpretation 'sequence)
2220 @end lisp
2222 @cindex completion, of TODO keywords
2223 Changing these variables only becomes effective in a new Emacs session.
2224 With this setup, the command @kbd{C-c C-t} will cycle an entry from
2225 TODO to FEEDBACK, then to VERIFY, and finally to DONE.  You may also
2226 use a prefix argument to quickly select a specific state.  For example
2227 @kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
2228 If you define many keywords, you can use in-buffer completion (see
2229 @ref{Completion}) to insert these words into the buffer.
2231 @node TODO types, Per file keywords, Workflow states, TODO extensions
2232 @subsection TODO keywords as types
2233 @cindex TODO types
2234 @cindex names as TODO keywords
2235 @cindex types as TODO keywords
2237 The second possibility is to use TODO keywords to indicate different
2238 types of action items.  For example, you might want to indicate that
2239 items are for ``work'' or ``home''.  If you are into David Allen's
2240 @emph{Getting Things DONE}, you might want to use todo types
2241 @samp{NEXTACTION}, @samp{WAITING}, @samp{MAYBE}.  Or, when you work
2242 with several people on a single project, you might want to assign
2243 action items directly to persons, by using their names as TODO
2244 keywords.  This would be set up like this:
2246 @lisp
2247 (setq org-todo-keywords '("Fred" "Sara" "Lucy" "Mike" "DONE")
2248       org-todo-interpretation 'type)
2249 @end lisp
2251 In this case, different keywords do not indicate a sequence, but
2252 rather different types.  So it is normally not useful to change from
2253 one type to another.  Therefore, in this case the behavior of the
2254 command @kbd{C-c C-t} is changed slightly@footnote{This is also true
2255 for the @kbd{t} command in the timeline and agenda buffers.}.  When
2256 used several times in succession, it will still cycle through all
2257 names.  But when you return to the item after some time and execute
2258 @kbd{C-c C-t} again, it will switch from each name directly to DONE.
2259 Use prefix arguments or completion to quickly select a specific name.
2260 You can also review the items of a specific TODO type in a sparse tree
2261 by using a numeric prefix to @kbd{C-c C-v}.  For example, to see all
2262 things Lucy has to do, you would use @kbd{C-3 C-c C-v}.  To collect
2263 Lucy's items from all agenda files into a single buffer, you
2264 would use the prefix arg as well when creating the global todo list:
2265 @kbd{C-3 C-c t}.
2267 @node Per file keywords,  , TODO types, TODO extensions
2268 @subsection Setting up TODO keywords for individual files
2269 @cindex keyword options
2270 @cindex per file keywords
2272 It can be very useful to use different aspects of the TODO mechanism
2273 in different files, which is not possible with the global settings
2274 described above.  For file-local settings, you need to add special
2275 lines to the file which set the keywords and interpretation for that
2276 file only.  For example, to set one of the two examples discussed
2277 above, you need one of the following lines, starting in column zero
2278 anywhere in the file:
2280 @example
2281 #+SEQ_TODO: TODO FEEDBACK VERIFY DONE
2282 #+TYP_TODO: Fred Sara Lucy Mike DONE
2283 @end example
2285 @cindex Completion, of option keywords
2286 @kindex M-@key{TAB}
2287 @noindent To make sure you are using the correct keyword, type
2288 @samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
2290 @cindex DONE, final TODO keyword
2291 Remember that the last keyword must always mean that the item is DONE
2292 (although you may use a different word).  Also note that in each file,
2293 only one of the two aspects of TODO keywords can be used.  After
2294 changing one of these lines, use @kbd{C-c C-c} with the cursor still
2295 in the line to make the changes known to Org-mode@footnote{Org-mode
2296 parses these lines only when Org-mode is activated after visiting a
2297 file.  @kbd{C-c C-c} with the cursor in a line starting with @samp{#+}
2298 is simply restarting Org-mode for the current buffer.}.
2300 If you want to use very many keywords, for example when working with a
2301 large group of people, you may split the names over several lines:
2303 @example
2304 #+TYP_TODO: Fred Sara Lucy Mike
2305 #+TYP_TODO: Luis George Jules Jessica
2306 #+TYP_TODO: Kim Arnold Peter
2307 #+TYP_TODO: DONE
2308 @end example
2310 @node Priorities, Breaking down tasks, TODO extensions, TODO items
2311 @section Priorities
2312 @cindex priorities
2314 If you use Org-mode extensively to organize your work, you may end up
2315 with a number of TODO entries so large that you'd like to prioritize
2316 them.  This can be done by placing a @emph{priority cookie} into the
2317 headline, like this
2319 @example
2320 *** TODO [#A] Write letter to Sam Fortune
2321 @end example
2323 @noindent
2324 With its standard setup, Org-mode supports priorities @samp{A},
2325 @samp{B}, and @samp{C}.  @samp{A} is the highest priority.  An entry
2326 without a cookie is treated as priority @samp{B}.  Priorities make a
2327 difference only in the agenda (@pxref{Weekly/Daily agenda}).
2329 @table @kbd
2330 @kindex @kbd{C-c ,}
2331 @item @kbd{C-c ,}
2332 Set the priority of the current headline.  The command prompts for a
2333 priority character @samp{A}, @samp{B} or @samp{C}.  When you press
2334 @key{SPC} instead, the priority cookie is removed from the headline.
2335 The priorities can also be changed ``remotely'' from the timeline and
2336 agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
2338 @kindex S-@key{up}
2339 @kindex S-@key{down}
2340 @item S-@key{up}
2341 @itemx S-@key{down}
2342 Increase/decrease priority of current headline.  Note that these keys
2343 are also used to modify time stamps (@pxref{Creating timestamps}).
2344 Furthermore, these keys are also used by CUA-mode (@pxref{Conflicts}).
2345 @end table
2347 @node Breaking down tasks, Checkboxes, Priorities, TODO items
2348 @section Breaking tasks down into subtasks
2349 @cindex tasks, breaking down
2351 It is often advisable to break down large tasks into smaller, managable
2352 subtasks.  You can do this by creating an outline tree below a TODO
2353 item, with detailed subtasks on the tree@footnote{To keep subtasks out
2354 of the global TODO list, see the
2355 @code{org-agenda-todo-list-sublevels}.}.  Another possibility is the use
2356 of checkboxes to ideantify (a hierarchy of) a large number of subtasks
2357 (@pxref{Checkboxes}).
2360 @node Checkboxes,  , Breaking down tasks, TODO items
2361 @section Checkboxes
2362 @cindex checkboxes
2364 Every item in a plain list (@pxref{Plain lists}) can be made a checkbox
2365 by starting it with the string @samp{[ ]}.  This feature is similar to
2366 TODO items (@pxref{TODO items}), but more lightweight.  Checkboxes are
2367 not included into the global TODO list, so they are often great to split
2368 a task into a number of simple steps.  Or you can use them in a shopping
2369 list.  To toggle a checkbox, use @kbd{C-c C-c}, or try Piotr Zielinski's
2370 @file{org-mouse.el}.  Here is an example of a checkbox list.
2372 @example
2373 * TODO Organize party [3/6]
2374   - call people [1/3]
2375     - [ ] Peter
2376     - [X] Sarah
2377     - [ ] Sam
2378   - [X] order food
2379   - [ ] think about what music to play
2380   - [X] talk to the neighbors
2381 @end example
2383 @cindex statistics, for checkboxes
2384 @cindex checkbox statistics
2385 The @samp{[3/6]} and @samp{[1/3]} in the first and second line are
2386 cookies indicating how many checkboxes are present in this entry, and
2387 how many of them have been checked off.  This can give you an idea on
2388 how many checkboxes remain, even without opening a folded entry.  The
2389 cookies can be placed into a headline or into (the first line of) a
2390 plain list item. Each cookie covers all checkboxes structurally below
2391 that headline/item.  You have to insert the cookie yourself by typing
2392 either @samp{[/]} or @samp{[%]}.  In the first case you get an @samp{n
2393 out of m} result, in the second case you get information about the
2394 percentage of checkboxes checked (in the above example, this would be
2395 @samp{[50%]} and @samp{[33%], respectively}).
2397 @noindent The following commands work with checkboxes:
2399 @table @kbd
2400 @kindex C-c C-c
2401 @item C-c C-c
2402 Toggle checkbox at point.
2403 @kindex C-c C-x C-b
2404 @item C-c C-x C-b
2405 Toggle checkbox at point.
2406 @itemize @minus
2407 @item
2408 If there is an active region, toggle the first checkbox in the region
2409 and set all remaining boxes to the same status as the first.  If you
2410 want to toggle all boxes in the region independently, use a prefix
2411 argument.
2412 @item
2413 If the cursor is in a headline, toggle checkboxes in the region between
2414 this headline and the next (so @emph{not} the entire subtree).
2415 @item
2416 If no active region, just toggle the checkbox at point.
2417 @end itemize
2418 @kindex M-S-@key{RET}
2419 @item M-S-@key{RET}
2420 Insert a new item with a checkbox.
2421 This works only if the cursor is already in a plain list item
2422 (@pxref{Plain lists}).
2423 @kindex C-c #
2424 @item C-c #
2425 Update the checkbox statistics in the current outline entry.  When
2426 called with a @kbd{C-u} prefix, update the entire file.  Checkbox
2427 statistic cookies are updated automatically if you toggle checkboxes
2428 with @kbd{C-c C-c} and make new ones with @kbd{M-S-@key{RET}}.  If you
2429 delete boxes or add/change them by hand, use this command to get things
2430 back into synch.  Or simply toggle any checkbox twice with @kbd{C-c C-c}.
2431 @end table
2433 @node Timestamps, Tags, TODO items, Top
2434 @chapter Timestamps
2435 @cindex time stamps
2436 @cindex date stamps
2438 Items can be labeled with timestamps to make them useful for project
2439 planning.
2441 @menu
2442 * Time stamps::                 Assigning a time to a tree entry
2443 * Creating timestamps::         Commands which insert timestamps
2444 * Progress logging::            Documenting when what work was done.
2445 @end menu
2448 @node Time stamps, Creating timestamps, Timestamps, Timestamps
2449 @section Time stamps, deadlines and scheduling
2450 @cindex time stamps
2451 @cindex ranges, time
2452 @cindex date stamps
2453 @cindex deadlines
2454 @cindex scheduling
2456 A time stamp is a specification of a date (possibly with time) in a
2457 special format, either @samp{<2003-09-16 Tue>} or @samp{<2003-09-16
2458 Tue 09:39>}.  A time stamp can appear anywhere in the headline or body
2459 of an org-tree entry.  Its presence allows entries to be shown on specific
2460 dates in the agenda (@pxref{Weekly/Daily agenda}).  We distinguish:
2462 @table @var
2463 @item Plain time stamp
2464 @cindex timestamp
2465 A simple time stamp just assigns a date/time to an item.  This is just
2466 like writing down an appointment in a paper agenda, or like writing down
2467 an event in a diary, when you want to take note of when something
2468 happened.  In the timeline and agenda displays, the headline of an entry
2469 associated with a plain time stamp will be shown exactly on that date.
2471 @item Time stamp range
2472 @cindex timerange
2473 Two time stamps connected by @samp{--} denote a time range.  The
2474 headline will be shown on the first and last day of the range, and on
2475 any dates that are displayed and fall in the range.  Here is an
2476 example:
2478 @example
2479 ** Meeting in Amsterdam
2480    <2004-08-23 Mon>--<2004-08-26 Thu>
2481 @end example
2483 @item Time stamp with SCHEDULED keyword
2484 @cindex SCHEDULED keyword
2485 If a time stamp is preceded by the word @samp{SCHEDULED:}, it means you
2486 are planning to start working on that task on the given date. So this is
2487 not about recording an event, but about planning your work.  The
2488 headline will be listed under the given date.  In addition, a reminder
2489 that the scheduled date has passed will be present in the compilation
2490 for @emph{today}, until the entry is marked DONE.  I.e., the task will
2491 automatically be forwarded until completed.
2493 @example
2494 *** TODO Call Trillian for a date on New Years Eve.
2495     SCHEDULED: <2004-12-25 Sat>
2496 @end example
2498 @item Time stamp with DEADLINE keyword
2499 @cindex DEADLINE keyword
2500 If a time stamp is preceded by the word @samp{DEADLINE:}, the task
2501 (most likely a TODO item) is supposed to be finished on that date, and
2502 it will be listed then.  In addition, the compilation for @emph{today}
2503 will carry a warning about the approaching or missed deadline,
2504 starting @code{org-deadline-warning-days} before the due date, and
2505 continuing until the entry is marked DONE.  An example:
2507 @example
2508 *** TODO write article about the Earth for the Guide
2509     The editor in charge is <bbdb:Ford Prefect>
2510     DEADLINE: <2004-02-29 Sun>
2511 @end example
2512 @item Time stamp with CLOSED keyword
2513 @cindex CLOSED keyword
2514 When @code{org-log-done} is non-nil, Org-mode will automatically insert
2515 a special time stamp each time a TODO entry is marked done
2516 (@pxref{Progress logging}).  This time stamp is enclosed in square
2517 brackets instead of angular brackets.
2519 @item Time range with CLOCK keyword
2520 @cindex CLOCK keyword
2521 When using the clock to time the work that is being done on specific
2522 items, time ranges preceded by the CLOCK keyword are inserted
2523 automatically into the file.  The time stamps are enclosed in square
2524 brackets instead of angular brackets.  @xref{Clocking work time}.
2525 @end table
2527 @node Creating timestamps, Progress logging, Time stamps, Timestamps
2528 @section Creating timestamps
2529 @cindex creating timestamps
2530 @cindex timestamps, creating
2532 For Org-mode to recognize time stamps, they need to be in the specific
2533 format.  All commands listed below produce time stamps in the correct
2534 format.
2536 @table @kbd
2537 @kindex C-c .
2538 @item C-c .
2539 Prompt for a date and insert a corresponding time stamp.  When the
2540 cursor is at a previously used time stamp, it is updated to NOW.  When
2541 this command is used twice in succession, a time range is inserted.
2543 @kindex C-u C-c .
2544 @item C-u C-c .
2545 Like @kbd{C-c .}, but use the alternative format which contains date
2546 and time.  The default time can be rounded to multiples of 5 minutes,
2547 see the option @code{org-time-stamp-rounding-minutes}.
2549 @kindex C-c !
2550 @item C-c !
2551 Like @kbd{C-c .}, but insert an inactive time stamp not triggering the
2552 agenda.
2554 @kindex C-c <
2555 @item C-c <
2556 Insert a time stamp corresponding to the cursor date in the Calendar.
2558 @kindex C-c >
2559 @item C-c >
2560 Access the Emacs calendar for the current date.  If there is a
2561 timestamp in the current line, goto the corresponding date
2562 instead.
2564 @kindex C-c C-o
2565 @item C-c C-o
2566 Access the agenda for the date given by the time stamp at point
2567 (@pxref{Weekly/Daily agenda}).
2569 @kindex C-c C-d
2570 @item C-c C-d
2571 Insert @samp{DEADLINE} keyword along with a stamp.  The insertion will
2572 happen in the line directly following the headline.  
2573 @c FIXME Any CLOSED timestamp will be removed.????????
2575 @kindex C-c C-w
2576 @cindex sparse tree, for deadlines
2577 @item C-c C-w
2578 Create a sparse tree with all deadlines that are either past-due, or
2579 which will become due within @code{org-deadline-warning-days}.
2580 With @kbd{C-u} prefix, show all deadlines in the file.  With a numeric
2581 prefix, check that many days.  For example, @kbd{C-1 C-c C-w} shows
2582 all deadlines due tomorrow.
2584 @kindex C-c C-s
2585 @item C-c C-s
2586 Insert @samp{SCHEDULED} keyword along with a stamp.  The insertion will
2587 happen in the line directly following the headline.  Any CLOSED
2588 timestamp will be removed.
2590 @kindex S-@key{left}
2591 @kindex S-@key{right}
2592 @item S-@key{left}
2593 @itemx S-@key{right}
2594 Change date at cursor by one day.  These key bindings conflict with
2595 CUA-mode (@pxref{Conflicts}).
2597 @kindex S-@key{up}
2598 @kindex S-@key{down}
2599 @item S-@key{up}
2600 @itemx S-@key{down}
2601 Change the item under the cursor in a timestamp.  The cursor can be on
2602 a year, month, day, hour or minute.  Note that if the cursor is not at
2603 a time stamp, these same keys modify the priority of an item.
2604 (@pxref{Priorities}). The key bindings also conflict with CUA-mode
2605 (@pxref{Conflicts}).
2608 @kindex C-c C-y
2609 @cindex evaluate time range
2610 @item C-c C-y
2611 Evaluate a time range by computing the difference between start and
2612 end.  With prefix arg, insert result after the time range (in a table:
2613 into the following column).
2614 @end table
2617 @menu
2618 * The date/time prompt::        
2619 @end menu
2621 @node The date/time prompt,  , Creating timestamps, Creating timestamps
2622 @subsection The date/time prompt
2623 @cindex date, reading in minibuffer
2624 @cindex time, reading in minibuffer
2626 When Org-mode prompts for a date/time, the prompt suggests to enter an
2627 ISO date.  But it will in fact accept any string containing some date
2628 and/or time information.  You can, for example, use @kbd{C-y} to paste a
2629 (possibly multi-line) string copied from an email message.  Org-mode
2630 will find whatever information is in there and will replace anything not
2631 specified with the current date and time.  For example:
2633 @example
2634   3-2-5         --> 2003-02-05
2635   feb 15        --> currentyear-02-15
2636   sep 12 9      --> 2009-09-12
2637   12:45         --> today 12:45
2638   22 sept 0:34  --> currentyear-09-22 0:34
2639   12            --> currentyear-currentmonth-12
2640   Fri           --> nearest Friday (today or later)
2641 @end example
2643 The function understands English month and weekday abbreviations.  If
2644 you want to use unabbreviated names and/or other languages, configure
2645 the variables @code{parse-time-months} and @code{parse-time-weekdays}.
2647 @cindex calendar, for selecting date
2648 Parallel to the minibuffer prompt, a calendar is popped up@footnote{If
2649 you don't need/want the calendar, configure the variable
2650 @code{org-popup-calendar-for-date-prompt}.}.  You can control the
2651 calendar fully from the minibuffer:
2653 @table @kbd
2654 @kindex <
2655 @item <
2656 Scroll calendar backwards by one month.
2657 @kindex >
2658 @item >
2659 Scroll calendar forwards by one month.
2660 @kindex mouse-1
2661 @item mouse-1
2662 Select date by clicking on it.
2663 @kindex S-@key{right}
2664 @item S-@key{right}
2665 One day forward.
2666 @kindex S-@key{left}
2667 @item S-@key{left}
2668 One day back.
2669 @kindex S-@key{down}
2670 @item S-@key{down}
2671 One week forward.
2672 @kindex S-@key{up}
2673 @item S-@key{up}
2674 One week back.
2675 @kindex M-S-@key{right}
2676 @item M-S-@key{right}
2677 One month forward.
2678 @kindex M-S-@key{left}
2679 @item M-S-@key{left}
2680 One month back.
2681 @kindex @key{RET}
2682 @item @key{RET}
2683 Choose date in calendar (only if nothing typed into minibuffer).
2684 @end table
2686 @node Progress logging,  , Creating timestamps, Timestamps
2687 @section Progress Logging
2688 @cindex progress logging
2689 @cindex logging, of progress
2691 Org-mode can automatically record a time stamp when you mark a TODO item
2692 as DONE.  You can also measure precisely the time you spent on specific
2693 items in a project by starting and stopping a clock when you start and
2694 stop working on an aspect of a project.
2696 @menu
2697 * Closing items::               When was this entry marked DONE?
2698 * Clocking work time::          When exactly did you work on this item?
2699 @end menu
2701 @node Closing items, Clocking work time, Progress logging, Progress logging
2702 @subsection Closing items
2704 If you want to keep track of @emph{when} a certain TODO item was
2705 finished, turn on logging with
2707 @lisp
2708 (setq org-log-done t)
2709 @end lisp
2711 @noindent
2712 Then each time you turn a TODO entry into DONE using either @kbd{C-c
2713 C-t} in the Org-mode buffer or @kbd{t} in the agenda buffer, a line
2714 @samp{CLOSED: [timestamp]} will be inserted just after the headline.
2715 If you turn the entry back into a TODO item again through further
2716 state cycling, that line will be removed again.  In the timeline
2717 (@pxref{Timeline}) and in the agenda (@pxref{Weekly/Daily agenda}),
2718 you can then use the @kbd{l} key to display the TODO items closed on
2719 each day, giving you an overview of what has been done on a day.
2720 See the variable @code{org-log-done} for the possibility to record an
2721 additional note together with a timestamp.
2723 @node Clocking work time,  , Closing items, Progress logging
2724 @subsection Clocking work time
2726 Org-mode allows you to clock the time you spent on specific tasks in a
2727 project.  When you start working on an item, you can start the clock.
2728 When you stop working on that task, or when you mark the task done, the
2729 clock is stopped and the corresponding time interval is recorded.  It
2730 also computes the total time spent on each subtree of a project.
2732 @table @kbd
2733 @kindex C-c C-x C-i
2734 @item C-c C-x C-i
2735 Start the clock on the current item (clock-in).  This inserts the CLOCK
2736 keyword together with a timestamp.
2737 @kindex C-c C-x C-o
2738 @item C-c C-x C-o
2739 Stop the clock (clock-out).  The inserts another timestamp at the same
2740 location where the clock was last started.  It also directly computes
2741 the resulting time in inserts it after the time range as @samp{=>
2742 HH:MM}.  
2743 @kindex C-c C-y
2744 @item C-c C-y
2745 Recompute the time interval after changing one of the time stamps.  This
2746 is only necessary if you edit the time stamps directly.  If you change
2747 them with @kbd{S-@key{cursor}} keys, the update is automatic.
2748 @kindex C-c C-t
2749 @item C-c C-t
2750 Changing the TODO state of an item to DONE automatically stops the clock
2751 if it is running in this same item.
2752 @kindex C-c C-x C-x
2753 @item C-c C-x C-x
2754 Cancel the current clock.  This is useful if a clock was started by
2755 mistake, or if you ended up working on something else.
2756 @kindex C-c C-x C-d
2757 @item C-c C-x C-d
2758 Display time summaries for each subtree in the current buffer.  This
2759 puts overlays at the end of each headline, showing the total time
2760 recorded under that heading, including the time of any subheadings. You
2761 can use visibility cycling to study the tree, but the overlays disappear
2762 automatically when the buffer is changed.
2763 @kindex C-c C-x C-r
2764 @item C-c C-x C-r
2765 Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock
2766 report as an org-mode table into the current file.
2767 @example
2768 #+BEGIN: clocktable :maxlevel 2 :emphasize nil
2770 #+END: clocktable
2771 @end example
2772 @noindent
2773 If such a block already exists, its content is replaced by the new
2774 table.  The @samp{BEGIN} line can specify options:
2775 @example
2776 :maxlevels   @r{Maximum level depth to which times are listed in the table.}
2777 :emphasize   @r{When @code{t}, emphasize level one and level two items}
2778 :block       @r{The time block to consider.  This block is specified relative}
2779              @r{to the current time and may be any of these keywords:}
2780              @r{@code{today}, @code{yesterday}, @code{thisweek}, @code{lastweek},}
2781              @r{@code{thismonth}, @code{lastmonth}, @code{thisyear}, or @code{lastyear}}.
2782 :tstart      @r{A time string specifying when to start considering times}
2783 :tend        @r{A time string specifying when to stop considering times}
2784 @end example
2785 So to get a clock summary for the current day, you could write
2786 @example
2787 #+BEGIN: clocktable :maxlevel 2 :block today
2789 #+END: clocktable
2790 @end example
2791 and to use a specific time range you could write@footnote{Note that all
2792 parameters must be specified in a single line - the line is broken here
2793 only to fit it onto the manual.}
2794 @example
2795 #+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>" 
2796                     :tend "<2006-08-10 Thu 12:00>"
2798 #+END: clocktable
2799 @end example
2800 @kindex C-u C-c C-x C-u
2801 @item C-u C-c C-x C-u
2802 Update all dynamic blocks (@pxref{Dynamic blocks}).  This is useful if
2803 you have several clocktable blocks in a buffer.
2804 @end table
2806 The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
2807 the agenda (@pxref{Weekly/Daily agenda}) to show which tasks have been
2808 worked on or closed during a day.
2810 See the variable @code{org-log-done} for the possibility to record an
2811 additional note together with a the clock-out time stamp.
2813 @node Tags, Agenda views, Timestamps, Top
2814 @chapter Tags
2815 @cindex tags
2816 @cindex headline tagging
2817 @cindex matching, tags
2818 @cindex sparse tree, tag based
2820 If you wish to implement a system of labels and contexts for
2821 cross-correlating information, an excellent way is to assign @i{tags} to
2822 headlines.  Org-mode has extensive support for using tags.
2824 Every headline can contain a list of tags, at the end of the headline.
2825 Tags are normal words containing letters, numbers, @samp{_}, and
2826 @samp{@@}.  Tags must be preceded and followed by a single colon; like
2827 @samp{:WORK:}.  Several tags can be specified like @samp{:WORK:URGENT:}.
2829 @menu
2830 * Tag inheritance::             Tags use the tree structure of the outline
2831 * Setting tags::                How to assign tags to a headline
2832 * Tag searches::                Searching for combinations of tags
2833 @end menu
2835 @node Tag inheritance, Setting tags, Tags, Tags
2836 @section Tag inheritance
2837 @cindex inheritance, of tags
2838 @cindex sublevels, inclusion into tags match
2840 @i{Tags} make use of the hierarchical structure of outline trees.  If a
2841 heading has a certain tag, all subheadings will inherit the tag as
2842 well.  For example, in the list
2844 @example
2845 * Meeting with the French group      :WORK:
2846 ** Summary by Frank                  :BOSS:NOTES:
2847 *** TODO Prepare slides for him      :ACTION:
2848 @end example
2850 @noindent
2851 the final heading will have the tags @samp{:WORK:}, @samp{:BOSS:},
2852 @samp{:NOTES:}, and @samp{:ACTION:}.  When executing tag searches and
2853 Org-mode finds that a certain headline matches the search criterion, it
2854 will not check any sublevel headline, assuming that these likely also
2855 match, and that the list of matches can become very long.  This may
2856 not be what you want, however, and you can influence inheritance and
2857 searching using the variables @code{org-use-tag-inheritance} and
2858 @code{org-tags-match-list-sublevels}.
2860 @node Setting tags, Tag searches, Tag inheritance, Tags
2861 @section Setting tags
2862 @cindex setting tags
2863 @cindex tags, setting
2865 @kindex M-@key{TAB}
2866 Tags can simply be typed into the buffer at the end of a headline.
2867 After a colon, @kbd{M-@key{TAB}} offers completion on tags.  There is
2868 also a special command for inserting tags:
2870 @table @kbd
2871 @kindex C-c C-c
2872 @item C-c C-c
2873 @cindex completion, of tags
2874 Enter new tags for the current headline.  Org-mode will either offer
2875 completion or a special single-key interface for setting tags, see
2876 below.  After pressing @key{RET}, the tags will be inserted and aligned
2877 to @code{org-tags-column}.  When called with a @kbd{C-u} prefix, all
2878 tags in the current buffer will be aligned to that column, just to make
2879 things look nice.  TAGS are automatically realigned after promotion,
2880 demotion, and TODO state changes (@pxref{TODO basics}).
2881 @end table
2883 Org will support tag insertion based on a @emph{list of tags}.  By
2884 default this list is constructed dynamically, containing all tags
2885 currently used in the buffer.  You may also globally specify a hard list
2886 of tags with the variable @code{org-tag-alist}.  Finally you can set
2887 the default tags for a given file with lines like
2889 @example
2890 #+TAGS: @@WORK @@HOME @@TENNISCLUB
2891 #+TAGS: Laptop Car PC Sailboat
2892 @end example
2894 If you have globally defined your preferred set of tags using the
2895 variable @code{org-tag-alist}, but would like to use a dynamic tag list
2896 in a specific file: Just add an empty TAGS option line to that file:
2898 @example
2899 #+TAGS:
2900 @end example
2902 The default support method for entering tags is minibuffer completion.
2903 However, Org-mode also implements a much better method: @emph{fast tag
2904 selection}.  This method allows to select and deselect tags with a
2905 single key per tag.  To function efficiently, you should assign unique
2906 keys to most tags.  This can be done globally with
2908 @lisp
2909 (setq org-tag-alist '(("@@WORK" . ?w) ("@@HOME" . ?h) ("Laptop" . ?l)))
2910 @end lisp
2912 @noindent or on a per-file basis with
2914 @example
2915 #+TAGS: @@WORK(w)  @@HOME(h)  @@TENNISCLUB(t)  Laptop(l)  PC(p)
2916 @end example
2918 @noindent
2919 You can also group together tags that are mutually exclusive.  With
2920 curly braces@footnote{In @code{org-mode-alist} use
2921 @code{'(:startgroup)} and @code{'(:endgroup)}, respectively.  Several
2922 groups are allowed.}
2924 @example
2925 #+TAGS: @{ @@WORK(w)  @@HOME(h)  @@TENNISCLUB(t) @}  Laptop(l)  PC(p)
2926 @end example
2928 @noindent you indicate that at most one of @samp{@@WORK}, @samp{@@HOME},
2929 and @samp{@@TENNISCLUB} should be selected.
2931 @noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
2932 these lines to activate any changes.
2934 If at least one tag has a selection key, pressing @kbd{C-c C-c} will
2935 automatically present you with a special interface, listing inherited
2936 tags, the tags of the current headline, and a list of all legal tags
2937 with corresponding keys@footnote{Keys will automatically assigned to
2938 tags which have no configured keys.}.  In this interface, you can use
2939 the following keys:
2941 @table @kbd
2942 @item a-z...
2943 Pressing keys assigned to tags will add or remove them from the list of
2944 tags in the current line.  Selecting a tag in a group of mutually
2945 exclusive tags will turn off any other tags from that group.
2946 @kindex @key{TAB}
2947 @item @key{TAB}
2948 Enter a tag in the minibuffer, even if the tag is not in the predefined
2949 list.  You will be able to complete on all tags present in the buffer.
2950 @kindex @key{SPC}
2951 @item @key{SPC}
2952 Clear all tags for this line.
2953 @kindex @key{RET}
2954 @item @key{RET}
2955 Accept the modified set.
2956 @item C-g
2957 Abort without installing changes.
2958 @end table
2960 @noindent
2961 This method lets you assign tags to a headline with very few keys.  With
2962 the above setup, you could clear the current tags and set @samp{@@HOME},
2963 @samp{Laptop} and @samp{PC} tags with just the following keys: @kbd{C-c
2964 C-c @key{SPC} h l p @key{RET}}.  Switching from @samp{@@HOME} to
2965 @samp{@@WORK} would be done with @kbd{C-c C-c w @key{RET}}.  Adding the
2966 non-predefined tag @samp{Sarah} could be done with @kbd{C-c C-c
2967 @key{TAB} S a r a h @key{RET} @key{RET}}.
2970 @node Tag searches,  , Setting tags, Tags
2971 @section Tag searches
2972 @cindex tag searches
2973 @cindex searching for tags
2975 Once a tags system has been set up, it can be used to collect related
2976 information into special lists.
2978 @table @kbd
2979 @kindex C-c \
2980 @item C-c \
2981 Create a sparse tree with all headlines matching a tags search.
2982 @kindex C-c a m
2983 @item C-c a m
2984 Create a global list of tag matches from all agenda files.
2985 @xref{Matching headline tags}.
2986 @kindex C-c a M
2987 @item C-c a M
2988 Create a global list of tag matches from all agenda files, but check
2989 only TODO items and force checking subitems (see variable
2990 @code{org-tags-match-list-sublevels}).
2991 @end table
2993 @cindex Boolean logic, for tag searches
2994 A @i{tags} search string can use Boolean operators @samp{&} for AND and
2995 @samp{|} for OR.  @samp{&} binds more strongly than @samp{|}.
2996 Parenthesis are currently not implemented.  A tag may also be preceded
2997 by @samp{-}, to select against it, and @samp{+} is syntactic sugar for
2998 positive selection.  The AND operator @samp{&} is optional when @samp{+}
2999 or @samp{-} is present.  Examples:
3001 @table @samp
3002 @item +WORK-BOSS
3003 Select all headlines that are tagged @samp{:WORK:}, but discard those also tagged
3004 @samp{:BOSS:}.
3005 @item WORK|LAPTOP
3006 Selects lines tagged @samp{:WORK:} or @samp{:LAPTOP:}.
3007 @item WORK|LAPTOP&NIGHT
3008 Like the previous example, but require  the @samp{:LAPTOP:} lines to be
3009 tagged also @samp{NIGHT}.
3010 @end table
3012 @cindex TODO keyword matching, with tags search
3013 If you are using multi-state TODO keywords (@pxref{TODO extensions}), it
3014 can be useful to also match on the TODO keyword.  This can be done by
3015 adding a condition after a double slash to a tags match.  The syntax is
3016 similar to the tag matches, but should be applied with consideration:
3017 For example, a positive selection on several TODO keywords can not
3018 meaningfully be combined with boolean AND.  However, @emph{negative
3019 selection} combined with AND can be meaningful.  Examples:
3021 @table @samp
3022 @item WORK//WAITING
3023 Select @samp{:WORK:}-tagged TODO lines with the specific TODO
3024 keyword @samp{WAITING}.
3025 @item WORK//-WAITING-NEXT
3026 Select @samp{:WORK:}-tagged TODO lines that are neither @samp{WAITING}
3027 nor @samp{NEXT}
3028 @item WORK//+WAITING|+NEXT
3029 Select @samp{:WORK:}-tagged TODO lines that are either @samp{WAITING} or
3030 @samp{NEXT}.
3031 @end table
3033 @node Agenda views, Embedded LaTeX, Tags, Top
3034 @chapter Agenda Views
3035 @cindex agenda views
3037 Due to the way Org-mode works, TODO items, time-stamped items, and
3038 tagged headlines can be scattered throughout a file or even a number of
3039 files.  To get an overview over open action items, or over events that
3040 are important for a particular date, this information must be collected,
3041 sorted and displayed in an organized way.
3043 Org-mode can select items based on various criteria, and display them
3044 in a separate buffer.  Five different view types are provided:
3046 @itemize @bullet
3047 @item
3048 an @emph{agenda} that is like a calendar and shows information
3049 for specific dates
3050 @item
3051 a @emph{TODO list} that covers all unfinished
3052 action items,
3053 @item
3054 a @emph{tags view} that shows information based on
3055 the tags associated with headlines in the outline tree,
3056 @item
3057 a @emph{timeline view} that shows all events in a single Org-mode file,
3058 in time-sorted view
3059 @item
3060 @emph{custom views} that are special tag and keyword searches and
3061 combinations of different views.
3062 @end itemize
3064 @noindent
3065 The extracted information is displayed in a special @emph{agenda
3066 buffer}.  This buffer is read-only, but provides commands to visit the
3067 corresponding locations in the original Org-mode files, and even to
3068 edit these files remotely.  
3070 Two variables control how the agenda buffer is displayed and whether the
3071 window configuration is restored when the agenda exits:
3072 @code{org-agenda-window-setup} and
3073 @code{org-agenda-restore-windows-after-quit}.
3075 @menu
3076 * Agenda files::                Files being searched for agenda information
3077 * Agenda dispatcher::           Keyboard access to agenda views
3078 * Weekly/Daily agenda::         The calendar page with current tasks
3079 * Global TODO list::            All unfinished action items
3080 * Matching headline tags::      Structured information with fine-tuned search
3081 * Timeline::                    Time-sorted view for single file
3082 * Presentation and sorting::    How agenda items are prepared for display
3083 * Agenda commands::             Remote editing of org trees
3084 * Custom agenda views::         Defining special searches and views
3085 @end menu
3087 @node Agenda files, Agenda dispatcher, Agenda views, Agenda views
3088 @section Agenda files
3089 @cindex agenda files
3090 @cindex files for agenda
3092 The information to be shown is collected from all @emph{agenda files},
3093 the files listed in the variable @code{org-agenda-files}@footnote{If the
3094 value of that variable is not a list, but a single file name, then the
3095 list of agenda files will be maintained in that external file.}.  Thus even
3096 if you only work with a single Org-mode file, this file should be put
3097 into that list@footnote{When using the dispatcher, pressing @kbd{1}
3098 before selecting a command will actually limit the command to the
3099 current file, and ignore @code{org-agenda-files} until the next
3100 dispatcher command.}.  You can customize @code{org-agenda-files}, but
3101 the easiest way to maintain it is through the following commands
3103 @cindex files, adding to agenda list
3104 @table @kbd
3105 @kindex C-c [
3106 @item C-c [
3107 Add current file to the list of agenda files.  The file is added to
3108 the front of the list.  If it was already in the list, it is moved to
3109 the front.  With prefix arg, file is added/moved to the end.
3110 @kindex C-c ]
3111 @item C-c ]
3112 Remove current file from the list of agenda files.
3113 @kindex C-,
3114 @item C-,
3115 Cycle through agenda file list, visiting one file after the other.
3116 @end table
3118 @noindent
3119 The Org menu contains the current list of files and can be used
3120 to visit any of them.
3122 @node Agenda dispatcher, Weekly/Daily agenda, Agenda files, Agenda views
3123 @section The agenda dispatcher
3124 @cindex agenda dispatcher
3125 @cindex dispatching agenda commands
3126 The views are created through a dispatcher that should be bound to a
3127 global key, for example @kbd{C-c a} (@pxref{Installation}).  In the
3128 following we will assume that @kbd{C-c a} is indeed how the dispatcher
3129 is accessed and list keyboard access to commands accordingly.  After
3130 pressing @kbd{C-c a}, an additional letter is required to execute a
3131 command.  The dispatcher offers the following default commands:
3132 @table @kbd
3133 @item a
3134 Create the calendar-like agenda (@pxref{Weekly/Daily agenda}).
3135 @item t / T
3136 Create a list of all TODO items (@pxref{Global TODO list}).
3137 @item m / M
3138 Create a list of headlines matching a TAGS expression (@pxref{Matching
3139 headline tags}).
3140 @item L
3141 Create the timeline view for the current buffer (@pxref{Timeline}).
3142 @item 1
3143 Restrict an agenda command to the current buffer.  After pressing
3144 @kbd{1}, you still need to press the character selecting the command.
3145 @item 0
3146 If there is an active region, restrict the following agenda command to
3147 the region.  Otherwise, restrict it to the current subtree.  After
3148 pressing @kbd{0}, you still need to press the character selecting the
3149 command.
3150 @end table
3152 You can also define custom commands that will be accessible through the
3153 dispatcher, just like the default commands.  This includes the
3154 possibility to create extended agenda buffers that contain several
3155 blocks together, for example the weekly agenda, the global TODO list and
3156 a number of special tags matches.  @xref{Custom agenda views}.
3158 @node Weekly/Daily agenda, Global TODO list, Agenda dispatcher, Agenda views
3159 @section The weekly/daily agenda
3160 @cindex agenda
3161 @cindex weekly agenda
3162 @cindex daily agenda
3164 The purpose of the weekly/daily @emph{agenda} is to act like a page of a
3165 paper agenda, showing all the tasks for the current week or day.
3167 @table @kbd
3168 @cindex org-agenda, command
3169 @kindex C-c a a
3170 @item C-c a a
3171 Compile an agenda for the current week from a list of org files.  The
3172 agenda shows the entries for each day.  With a @kbd{C-u} prefix (or
3173 when the variable @code{org-agenda-include-all-todo} is @code{t}), all
3174 unfinished TODO items (including those without a date) are also listed at
3175 the beginning of the buffer, before the first date.@*
3176 @end table
3178 Remote editing from the agenda buffer means, for example, that you can
3179 change the dates of deadlines and appointments from the agenda buffer.
3180 The commands available in the Agenda buffer are listed in @ref{Agenda
3181 commands}.
3183 @menu
3184 * Calendar/Diary integration::  Integrating Anniversaries and more
3185 @end menu
3188 @node Calendar/Diary integration,  , Weekly/Daily agenda, Weekly/Daily agenda
3189 @subsection Calendar/Diary integration
3190 @cindex calendar integration
3191 @cindex diary integration
3193 Emacs contains the calendar and diary by Edward M. Reingold.  The
3194 calendar displays a three-month calendar with holidays from different
3195 countries and cultures.  The diary allows you to keep track of
3196 anniversaries, lunar phases, sunrise/set, recurrent appointments
3197 (weekly, monthly) and more.  In this way, it is quite complementary to
3198 Org-mode.  It can be very useful to combine output from Org-mode with
3199 the diary.
3201 In order to include entries from the Emacs diary into Org-mode's
3202 agenda, you only need to customize the variable
3204 @lisp
3205 (setq org-agenda-include-diary t)
3206 @end lisp
3208 @noindent After that, everything will happen automatically.  All diary
3209 entries including holidays, anniversaries etc will be included in the
3210 agenda buffer created by Org-mode.  @key{SPC}, @key{TAB}, and
3211 @key{RET} can be used from the agenda buffer to jump to the diary
3212 file in order to edit existing diary entries.  The @kbd{i} command to
3213 insert new entries for the current date works in the agenda buffer, as
3214 well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display
3215 Sunrise/Sunset times, show lunar phases and to convert to other
3216 calendars, respectively.  @kbd{c} can be used to switch back and forth
3217 between calendar and agenda.
3220 @node Global TODO list, Matching headline tags, Weekly/Daily agenda, Agenda views
3221 @section The global TODO list
3222 @cindex global TODO list
3223 @cindex TODO list, global
3225 The global TODO list contains all unfinished TODO items, formatted and
3226 collected into a single place.
3228 @table @kbd
3229 @kindex C-c a t
3230 @item C-c a t
3231 Show the global TODO list.  This collects the TODO items from all
3232 agenda files (@pxref{Agenda views}) into a single buffer.  The buffer is in
3233 @code{agenda-mode}, so there are commands to examine and manipulate
3234 the TODO entries directly from that buffer (@pxref{Agenda commands}).
3235 @kindex C-c a T
3236 @item C-c a T
3237 @cindex TODO keyword matching
3238 Like the above, but allows selection of a specific TODO keyword.  You can
3239 also do this by specifying a prefix argument to @kbd{C-c a t}.  With a
3240 @kbd{C-u} prefix you are prompted for a keyword.  With a numeric
3241 prefix, the Nth keyword in @code{org-todo-keywords} is selected.
3242 @kindex r
3243 The @kbd{r} key in the agenda buffer regenerates it, and you can give
3244 a prefix argument to this command to change the selected TODO keyword,
3245 for example @kbd{3 r}.  If you often need a search for a specific
3246 keyword, define a custom command for it (@pxref{Agenda dispatcher}).@*
3247 Matching specific TODO keywords can also be done as part of a tags
3248 search (@pxref{Tag searches}).
3249 @end table
3251 Remote editing of TODO items means that you can change the state of a
3252 TODO entry with a single key press.  The commands available in the
3253 TODO list are described in @ref{Agenda commands}.
3255 @cindex sublevels, inclusion into todo list
3256 Normally the global todo list simply shows all headlines with TODO
3257 keywords.  This list can become very long.  There are two ways to keep
3258 it more compact:
3259 @itemize @minus
3260 @item
3261 Some people view a TODO item that has been @emph{scheduled} for
3262 execution (@pxref{Time stamps}) as no longer @emph{open}.  Configure the
3263 variable @code{org-agenda-todo-ignore-scheduled} to exclude scheduled
3264 items from the global TODO list.
3265 @item
3266 TODO items may have sublevels to break up the task into subtasks.  In
3267 such cases it may be enough to list only the highest level TODO headline
3268 and omit the sublevels from the global list.  Configure the variable
3269 @code{org-agenda-todo-list-sublevels} to get this behavior.
3270 @end itemize
3272 @node Matching headline tags, Timeline, Global TODO list, Agenda views
3273 @section Matching headline tags
3274 @cindex matching, of tags
3275 @cindex tags view
3277 If headlines in the agenda files are marked with @emph{tags}
3278 (@pxref{Tags}), you can select headlines based on the tags that apply
3279 to them and collect them into an agenda buffer.
3281 @table @kbd
3282 @kindex C-c a m
3283 @item C-c a m
3284 Produce a list of all headlines that match a given set of tags.  The
3285 command prompts for a selection criterion, which is a boolean logic
3286 expression with tags, like @samp{+WORK+URGENT-WITHBOSS} or
3287 @samp{WORK|HOME} (@pxref{Tags}).  If you often need a specific search,
3288 define a custom command for it (@pxref{Agenda dispatcher}).
3289 @kindex C-c a M
3290 @item C-c a M
3291 Like @kbd{C-c a m}, but only select headlines that are also TODO items
3292 and force checking subitems (see variable
3293 @code{org-tags-match-list-sublevels}).  Matching specific todo keywords
3294 together with a tags match is also possible, see @ref{Tag searches}.
3295 @end table
3297 The commands available in the tags list are described in @ref{Agenda
3298 commands}.
3300 @node Timeline, Presentation and sorting, Matching headline tags, Agenda views
3301 @section Timeline for a single file
3302 @cindex timeline, single file
3303 @cindex time-sorted view
3305 The timeline summarizes all time-stamped items from a single Org-mode
3306 file in a @emph{time-sorted view}.  The main purpose of this command is
3307 to give an overview over events in a project.
3309 @table @kbd
3310 @kindex C-a a L
3311 @item C-c a L
3312 Show a time-sorted view of the org file, with all time-stamped items.
3313 When called with a @kbd{C-u} prefix, all unfinished TODO entries
3314 (scheduled or not) are also listed under the current date.
3315 @end table
3317 @noindent
3318 The commands available in the timeline buffer are listed in
3319 @ref{Agenda commands}.
3322 @node Presentation and sorting, Agenda commands, Timeline, Agenda views
3323 @section Presentation and sorting
3324 @cindex presentation, of agenda items
3326 Before displaying items in an agenda view, Org-mode visually prepares
3327 the items and sorts them.  Each item occupies a single line.  The line
3328 starts with a @emph{prefix} that contains the @emph{category}
3329 (@pxref{Categories}) of the item and other important information.  You can
3330 customize the prefix using the option @code{org-agenda-prefix-format}.
3331 The prefix is followed by a cleaned-up version of the outline headline
3332 associated with the item.
3334 @menu
3335 * Categories::                  Not all tasks are equal
3336 * Time-of-day specifications::  How the agenda knows the time
3337 * Sorting of agenda items::     The order of things
3338 @end menu
3340 @node Categories, Time-of-day specifications, Presentation and sorting, Presentation and sorting
3341 @subsection Categories
3343 @cindex category
3344 The category is a broad label assigned to each agenda item.  By default,
3345 the category is simply derived from the file name, but you can also
3346 specify it with a special line in the buffer, like this:
3348 @example
3349 #+CATEGORY: Thesis
3350 @end example
3352 If there are several such lines in a file, each specifies the category
3353 for the text below it (but the first category also applies to any text
3354 before the first CATEGORY line).  The display in the agenda buffer looks
3355 best if the category is not longer than 10 characters.
3357 @node Time-of-day specifications, Sorting of agenda items, Categories, Presentation and sorting
3358 @subsection Time-of-Day Specifications
3359 @cindex time-of-day specification
3361 Org-mode checks each agenda item for a time-of-day specification.  The
3362 time can be part of the time stamp that triggered inclusion into the
3363 agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}.  Time
3364 ranges can be specified with two time stamps, like
3366 @w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
3368 In the headline of the entry itself, a time(range) may also appear as
3369 plain text (like @samp{12:45} or a @samp{8:30-1pm}.  If the agenda
3370 integrates the Emacs diary (@pxref{Calendar/Diary integration}), time
3371 specifications in diary entries are recognized as well.
3373 For agenda display, Org-mode extracts the time and displays it in a
3374 standard 24 hour format as part of the prefix.  The example times in
3375 the previous paragraphs would end up in the agenda like this:
3377 @example
3378     8:30-13:00 Arthur Dent lies in front of the bulldozer
3379    12:45...... Ford Prefect arrives and takes Arthur to the pub
3380    19:00...... The Vogon reads his poem
3381    20:30-22:15 Marwin escorts the Hitchhikers to the bridge
3382 @end example
3384 @cindex time grid
3385 If the agenda is in single-day mode, or for the display of today, the
3386 timed entries are embedded in a time grid, like
3388 @example
3389     8:00...... ------------------
3390     8:30-13:00 Arthur Dent lies in front of the bulldozer
3391    10:00...... ------------------
3392    12:00...... ------------------
3393    12:45...... Ford Prefect arrives and takes Arthur to the pub
3394    14:00...... ------------------
3395    16:00...... ------------------
3396    18:00...... ------------------
3397    19:00...... The Vogon reads his poem
3398    20:00...... ------------------
3399    20:30-22:15 Marwin escorts the Hitchhikers to the bridge
3400 @end example
3402 The time grid can be turned on and off with the variable
3403 @code{org-agenda-use-time-grid}, and can be configured with
3404 @code{org-agenda-time-grid}.
3406 @node Sorting of agenda items,  , Time-of-day specifications, Presentation and sorting
3407 @subsection Sorting of agenda items
3408 @cindex sorting, of agenda items
3409 @cindex priorities, of agenda items
3410 Before being inserted into a view, the items are sorted.  How this is
3411 done depends on the type of view.
3412 @itemize @bullet
3413 @item
3414 For the daily/weekly agenda, the items for each day are sorted.  The
3415 default order is to first collect all items containing an explicit
3416 time-of-day specification.  These entries will be shown at the beginning
3417 of the list, as a @emph{schedule} for the day.  After that, items remain
3418 grouped in categories, in the sequence given by @code{org-agenda-files}.
3419 Within each category, items are sorted by priority (@pxref{Priorities}),
3420 which is composed of the base priority (2000 for priority @samp{A}, 1000
3421 for @samp{B}, and 0 for @samp{C}), plus additional increments for
3422 overdue scheduled or deadline items.
3423 @item 
3424 For the TODO list, items remain in the order of categories, but within
3425 each category, sorting takes place according to priority
3426 (@pxref{Priorities}).
3427 @item
3428 For tags matches, items are not sorted at all, but just appear in the
3429 sequence in which they are found in the agenda files.
3430 @end itemize
3432 Sorting can be customized using the variable
3433 @code{org-agenda-sorting-strategy}.
3436 @node Agenda commands, Custom agenda views, Presentation and sorting, Agenda views
3437 @section Commands in the agenda buffer
3438 @cindex commands, in agenda buffer
3440 Entries in the agenda buffer are linked back to the org file or diary
3441 file where they originate.  You are not allowed to edit the agenda
3442 buffer itself, but commands are provided to show and jump to the
3443 original entry location, and to edit the org-files ``remotely'' from
3444 the agenda buffer.  In this way, all information is stored only once,
3445 removing the risk that your agenda and note files may diverge.
3447 Some commands can be executed with mouse clicks on agenda lines.  For
3448 the other commands, the cursor needs to be in the desired line.
3450 @table @kbd
3451 @tsubheading{Motion}
3452 @cindex motion commands in agenda
3453 @kindex n
3454 @item n
3455 Next line (same as @key{up}).
3456 @kindex p
3457 @item p
3458 Previous line (same as @key{down}).
3459 @tsubheading{View/GoTo org file}
3460 @kindex mouse-3
3461 @kindex @key{SPC}
3462 @item mouse-3
3463 @itemx @key{SPC}
3464 Display the original location of the item in another window.
3466 @kindex L
3467 @item L
3468 Display original location and recenter that window.
3470 @kindex mouse-2
3471 @kindex mouse-1
3472 @kindex @key{TAB}
3473 @item mouse-2
3474 @itemx mouse-1
3475 @itemx @key{TAB}
3476 Go to the original location of the item in another window.  Under Emacs
3477 22, @kbd{mouse-1} will also works for this.
3479 @kindex @key{RET}
3480 @itemx @key{RET}
3481 Go to the original location of the item and delete other windows.
3483 @kindex f
3484 @item f
3485 Toggle Follow mode.  In Follow mode, as you move the cursor through
3486 the agenda buffer, the other window always shows the corresponding
3487 location in the org file.  The initial setting for this mode in new
3488 agenda buffers can be set with the variable
3489 @code{org-agenda-start-with-follow-mode}.
3491 @kindex l
3492 @item l
3493 Toggle Logbook mode.  In Logbook mode, entries that where marked DONE while
3494 logging was on (variable @code{org-log-done}) are shown in the agenda,
3495 as are entries that have been clocked on that day.
3497 @tsubheading{Change display}
3498 @cindex display changing, in agenda
3499 @kindex o
3500 @item o
3501 Delete other windows.
3503 @kindex w
3504 @item w
3505 Switch to weekly view (7 days displayed together).
3507 @kindex d
3508 @item d
3509 Switch to daily view (just one day displayed).
3511 @kindex D
3512 @item D
3513 Toggle the inclusion of diary entries.  See @ref{Calendar/Diary integration}.
3515 @kindex g
3516 @item g
3517 Toggle the time grid on and off.  See also the variables
3518 @code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
3520 @kindex r
3521 @item r
3522 Recreate the agenda buffer, for example to reflect the changes
3523 after modification of the time stamps of items with S-@key{left} and
3524 S-@key{right}.  When the buffer is the global todo list, a prefix
3525 argument is interpreted to create a selective list for a specific TODO
3526 keyword.
3528 @kindex s
3529 @item s
3530 Save all Org-mode buffers in the current Emacs session.
3532 @kindex @key{right}
3533 @item @key{right}
3534 Display the following @code{org-agenda-ndays} days.  For example, if
3535 the display covers a week, switch to the following week.  With prefix
3536 arg, go forward that many times @code{org-agenda-ndays} days.
3538 @kindex @key{left}
3539 @item @key{left}
3540 Display the previous dates.
3542 @kindex .
3543 @item .
3544 Goto today.
3546 @tsubheading{Remote editing}
3547 @cindex remote editing, from agenda
3549 @item 0-9
3550 Digit argument.
3552 @kindex t
3553 @item t
3554 Change the TODO state of the item, both in the agenda and in the
3555 original org file.
3557 @kindex T
3558 @item T
3559 Show all tags associated with the current item.  Because of
3560 inheritance, this may be more than the tags listed in the line itself.
3562 @kindex :
3563 @item :
3564 Set tags for the current headline.
3566 @kindex a
3567 @item a
3568 Toggle the ARCHIVE tag for the current headline.
3570 @kindex ,
3571 @item ,
3572 Set the priority for the current item.  Org-mode prompts for the
3573 priority character. If you reply with @key{SPC}, the priority cookie
3574 is removed from the entry.
3576 @kindex P
3577 @item p
3578 Display weighted priority of current item.
3580 @kindex +
3581 @kindex S-@key{up}
3582 @item +
3583 @itemx S-@key{up}
3584 Increase the priority of the current item.  The priority is changed in
3585 the original buffer, but the agenda is not resorted.  Use the @kbd{r}
3586 key for this.
3588 @kindex -
3589 @kindex S-@key{down}
3590 @item -
3591 @itemx S-@key{down}
3592 Decrease the priority of the current item.
3594 @kindex C-c C-s
3595 @item C-c C-s
3596 Schedule this item
3598 @kindex C-c C-d
3599 @item C-c C-d
3600 Set a deadline for this item.
3602 @kindex S-@key{right}
3603 @item S-@key{right}
3604 Change the time stamp associated with the current line by one day into
3605 the future.  With prefix argument, change it by that many days.  For
3606 example, @kbd{3 6 5 S-@key{right}} will change it by a year.  The
3607 stamp is changed in the original org file, but the change is not
3608 directly reflected in the agenda buffer.  Use the
3609 @kbd{r} key to update the buffer.
3611 @kindex S-@key{left}
3612 @item S-@key{left}
3613 Change the time stamp associated with the current line by one day
3614 into the past.
3616 @kindex >
3617 @item >
3618 Change the time stamp associated with the current line to today.
3619 The key @kbd{>} has been chosen, because it is the same as @kbd{S-.}
3620 on my keyboard.
3622 @kindex I
3623 @item I
3624 Start the clock on the current item.  If a clock is running already, it
3625 is stopped first.
3626 @kindex O
3627 @item O
3628 Stop the previously started clock.
3629 @kindex X
3630 @item X
3631 Cancel the currently running clock.
3633 @tsubheading{Calendar commands}
3634 @cindex calendar commands, from agenda
3635 @kindex c
3636 @item c
3637 Open the Emacs calendar and move to the date at the agenda cursor.
3639 @item c
3640 When in the calendar, compute and show the Org-mode agenda for the
3641 date at the cursor.
3643 @cindex diary entries, creating from agenda
3644 @kindex i
3645 @item i
3646 Insert a new entry into the diary.  Prompts for the type of entry
3647 (day, weekly, monthly, yearly, anniversary, cyclic) and creates a new
3648 entry in the diary, just as @kbd{i d} etc. would do in the calendar.
3649 The date is taken from the cursor position.
3651 @kindex M
3652 @item M
3653 Show the phases of the moon for the three months around current date.
3655 @kindex S
3656 @item S
3657 Show sunrise and sunset times.  The geographical location must be set
3658 with calendar variables, see documentation of the Emacs calendar.
3660 @kindex C
3661 @item C
3662 Convert the date at cursor into many other cultural and historic
3663 calendars.
3665 @kindex H
3666 @item H
3667 Show holidays for three month around the cursor date.
3669 @c FIXME:  This should be a different key.
3670 @kindex C-c C-x C-c
3671 @item C-c C-x C-c
3672 Export a single iCalendar file containing entries from all agenda files.
3674 @tsubheading{Quit and Exit}
3675 @kindex q
3676 @item q
3677 Quit agenda, remove the agenda buffer.
3679 @kindex x
3680 @cindex agenda files, removing buffers
3681 @item x
3682 Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
3683 for the compilation of the agenda.  Buffers created by the user to
3684 visit org files will not be removed.
3686 @end table
3689 @node Custom agenda views,  , Agenda commands, Agenda views
3690 @section Custom agenda views
3691 @cindex custom agenda views
3692 @cindex agenda views, custom
3694 Custom agenda commands serve two purposes: to store and quickly access
3695 frequently used TODO and tags searches, and to create special composite
3696 agenda buffers.  Custom agenda commands will be accessible through the
3697 dispatcher (@pxref{Agenda dispatcher}), just like the default commands.
3699 @menu
3700 * Storing searches::            Type once, use often
3701 * Block agenda::                All the stuff you need in a single buffer
3702 * Setting Options::             Changing the rules
3703 * Batch processing::            Agenda views from the command line
3704 @end menu
3706 @node Storing searches, Block agenda, Custom agenda views, Custom agenda views
3707 @subsection Storing searches
3709 The first application of custom searches is the definition of keyboard
3710 shortcuts for frequently used searches, either creating an agenda
3711 buffer, or a sparse tree (the latter covering of course only the current
3712 buffer).
3713 @kindex C-c a C
3714 Custom commands are configured in the variable
3715 @code{org-agenda-custom-commands}.  You can customize this variable, for
3716 example by pressing @kbd{C-c a C}.  You can also directly set it with
3717 Emacs Lisp in @file{.emacs}.  The following example contains all valid
3718 search types:
3720 @lisp
3721 @group
3722 (setq org-agenda-custom-commands
3723       '(("w" todo "WAITING")
3724         ("W" todo-tree "WAITING")
3725         ("u" tags "+BOSS-URGENT")
3726         ("v" tags-todo "+BOSS-URGENT")
3727         ("U" tags-tree "+BOSS-URGENT")
3728         ("f" occur-tree "\\<FIXME\\>")))
3729 @end group
3730 @end lisp
3732 @noindent
3733 The initial single-character string in each entry defines the character
3734 you have to press after the dispatcher command @kbd{C-c a} in order to
3735 access the command.   The second parameter is the search type, followed
3736 by the string or regular expression to be used for the matching.  The
3737 example above will therefore define:
3739 @table @kbd
3740 @item C-c a w
3741 as a global search for TODO entries with @samp{WAITING} as the TODO
3742 keyword
3743 @item C-c a W
3744 as the same search, but only in the current buffer and displaying the
3745 results as a sparse tree
3746 @item C-c a u
3747 as a global tags search for headlines marked @samp{:BOSS:} but not
3748 @samp{:URGENT:}
3749 @item C-c a v
3750 as the same search as @kbd{C-c a u}, but limiting the search to
3751 headlines that are also TODO items
3752 @item C-c a U
3753 as the same search as @kbd{C-c a u}, but only in the current buffer and
3754 displaying the result as a sparse tree
3755 @item C-c a f
3756 to create a sparse tree (again: current buffer only) with all entries
3757 containing the word @samp{FIXME}.
3758 @end table
3760 @node Block agenda, Setting Options, Storing searches, Custom agenda views
3761 @subsection Block agenda
3762 @cindex block agenda
3763 @cindex agenda, with block views
3765 Another possibility is the construction of agenda views that comprise
3766 the results of @emph{several} commands, each of which creates a block in
3767 the agenda buffer.  The available commands include @code{agenda} for the
3768 daily or weekly agenda (as created with @kbd{C-c a a}), @code{alltodo}
3769 for the global todo list (as constructed with @kbd{C-c a t}), and the
3770 matching commands discussed above: @code{todo}, @code{tags}, and
3771 @code{tags-todo}.  Here are two examples:
3773 @lisp
3774 @group
3775 (setq org-agenda-custom-commands
3776       '(("h" "Agenda and Home-related tasks"
3777          ((agenda)
3778           (tags-todo "HOME")
3779           (tags "GARDEN")))
3780         ("o" "Agenda and Office-related tasks"
3781          ((agenda)
3782           (tags-todo "WORK")
3783           (tags "OFFICE")))))
3784 @end group
3785 @end lisp
3787 @noindent
3788 This will define @kbd{C-c a h} to create a multi-block view for stuff
3789 you need to attend to at home.  The resulting agenda buffer will contain
3790 your agenda for the current week, all TODO items that carry the tag
3791 @samp{HOME}, and also all lines tagged with @samp{GARDEN}.  Finally the
3792 command @kbd{C-c a o} provides a similar view for office tasks.
3795 @node Setting Options, Batch processing, Block agenda, Custom agenda views
3796 @subsection Setting Options for custom commands
3797 @cindex options, for custom agenda views
3799 Org-mode contains a number of variables regulating agenda construction
3800 and display.  The global variables define the behavior for all agenda
3801 commands, including the custom commands.  However, if you want to change
3802 some settings just for a single custom view, you can do so.  Setting
3803 options requires inserting a list of variable names and values at the
3804 right spot in @code{org-agenda-custom-commands}.  For example:
3806 @lisp
3807 @group
3808 (setq org-agenda-custom-commands
3809       '(("w" todo "WAITING"
3810          ((org-agenda-sorting-strategy '(priority-down))
3811           (org-agenda-prefix-format "  Mixed: ")))
3812         ("U" tags-tree "+BOSS-URGENT"
3813          ((org-show-following-heading nil)
3814           (org-show-hierarchy-above nil)))))
3815 @end group
3816 @end lisp
3818 @noindent
3819 Now the @kbd{C-c a w} command will sort the collected entries only by
3820 priority, and the prefix format is modified to just say @samp{  Mixed:}
3821 instead of giving the category of the entry.  The sparse tags tree of
3822 @kbd{C-c a U} will now turn out ultra-compact, because neither the
3823 headline hierarchy above the match, nor the headline following the match
3824 will be shown.
3826 For command sets creating a block agenda,
3827 @code{org-agenda-custom-commands} has two separate spots for setting
3828 options.  You can add options that should be valid for just a single
3829 command in the set, and options that should be valid for all commands in
3830 the set.  The former are just added to the command entry, the latter
3831 must come after the list of command entries.  Going back to the block
3832 agenda example (@pxref{Block agenda}), let's change the sorting strategy
3833 for the @kbd{C-c a h} commands to @code{priority-down}, but let's sort
3834 the results for GARDEN tags query in the opposite order,
3835 @code{priority-up}.  This would look like this:
3837 @lisp
3838 @group
3839 (setq org-agenda-custom-commands
3840       '(("h" "Agenda and Home-related tasks"
3841          ((agenda)
3842           (tags-todo "HOME")
3843           (tags "GARDEN" ((org-agenda-sorting-strategy '(priority-up)))))
3844          ((org-agenda-sorting-strategy '(priority-down))))
3845         ("o" "Agenda and Office-related tasks"
3846          ((agenda)
3847           (tags-todo "WORK")
3848           (tags "OFFICE")))))
3849 @end group
3850 @end lisp
3852 As you see, the values and parenthesis setting is a little complex.
3853 When in doubt, use the customize interface to set this variable - it
3854 fully supports its structure.  Just one caveat: When setting options in
3855 this interface, the @emph{values} are just lisp expressions.  So if the
3856 value is a string, you need to add the double quotes around the value
3857 yourself.
3859 @node Batch processing,  , Setting Options, Custom agenda views
3860 @subsection Creating agenda views in batch processing
3861 @cindex agenda, batch production
3863 If you want to print or otherwise reprocess agenda views, it can be
3864 useful to create an agenda from the command line.  This is the purpose
3865 of the function @code{org-batch-agenda}.  It takes as a parameter one of
3866 the strings that are the keys in @code{org-agenda-custom-commands}.  For
3867 example, to directly print the current TODO list, you could use
3869 @example
3870 emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
3871 @end example
3873 @noindent
3874 You may also modify parameters on the fly like this:
3876 @example
3877 emacs -batch -l ~/.emacs                                      \
3878    -eval '(org-batch-agenda "a"                               \
3879             org-agenda-ndays 300                              \
3880             org-agenda-include-diary nil                      \
3881             org-agenda-files (quote ("~/org/project.org")))'  \
3882    | lpr
3883 @end example
3885 @noindent
3886 which will produce a 300 day agenda, fully restricted to the Org file
3887 @file{~/org/projects.org}, not even including the diary.
3889 @node Embedded LaTeX, Exporting, Agenda views, Top
3890 @chapter Embedded LaTeX
3891 @cindex @TeX{} interpretation
3892 @cindex La@TeX{} interpretation
3894 Plain ASCII is normally sufficient for almost all note taking.  One
3895 exception, however, are scientific notes which need to be able to
3896 contain mathematical symbols and the occasional formula.
3897 La@TeX{}@footnote{La@TeX{} is a macro system based on Donald E. Knuth's
3898 @TeX{} system.  Many of the features described here as ``La@TeX{}'' are
3899 really from @TeX{}, but for simplicity I am blurring this distinction.}
3900 is widely used to typeset scientific documents. Org-mode supports
3901 embedding La@TeX{} code into its files, because many academics are used
3902 to read La@TeX{} source code, and because it can be readily processed
3903 into images for HTML production.
3905 It is not necessary to mark La@TeX{} macros and code in any special way.
3906 If you observe a few conventions, Org-mode knows how to find it and what
3907 to do with it.
3909 @menu
3910 * Math symbols::                TeX macros for symbols and Greek letters
3911 * Subscripts and Superscripts::  Simple syntax for raising/lowering text
3912 * LaTeX fragments::             Complex formulas made easy
3913 * Processing LaTeX fragments::  Previewing LaTeX processing
3914 * CDLaTeX mode::                Speed up entering of formulas
3915 @end menu
3917 @node Math symbols, Subscripts and Superscripts, Embedded LaTeX, Embedded LaTeX
3918 @section Math symbols
3919 @cindex math symbols
3920 @cindex TeX macros
3922 You can use La@TeX{} macros to insert special symbols like @samp{\alpha}
3923 to indicate the Greek letter, or @samp{\to} to indicate an arrow.
3924 Completion for these macros is available, just type @samp{\} and maybe a
3925 few letters, and press @kbd{M-@key{TAB}} to see possible completions.
3926 Unlike La@TeX{} code, Org-mode allows these macros to be present
3927 without surrounding math delimiters, for example:
3929 @example
3930 Angles are written as Greek letters \alpha, \beta and \gamma.
3931 @end example
3933 During HTML export (@pxref{HTML export}), these symbols are translated
3934 into the proper syntax for HTML, for the above examples this is
3935 @samp{&alpha;} and @samp{&rarr;}, respectively.
3937 @node Subscripts and Superscripts, LaTeX fragments, Math symbols, Embedded LaTeX
3938 @section Subscripts and Superscripts
3939 @cindex subscript
3940 @cindex superscript
3942 Just like in La@TeX{}, @samp{^} and @samp{_} are used to indicate super-
3943 and subscripts.  Again, these can be used without embedding them in
3944 math-mode delimiters.  To increase the readability of ASCII text, it is
3945 not necessary (but OK) to surround multi-character sub- and superscripts
3946 with curly braces.  For example
3948 @example
3949 The mass if the sun is M_sun = 1.989 x 10^30 kg.  The radius of
3950 the sun is R_@{sun@} = 6.96 x 10^8 m.
3951 @end example
3953 To avoid interpretation as raised or lowered text, you can quote
3954 @samp{^} and @samp{_} with a backslash: @samp{\_} and @samp{\^}.
3956 During HTML export (@pxref{HTML export}), subscript and superscripts
3957 are surrounded with @code{<sub>} and @code{<sup>} tags, respectively.
3959 @node LaTeX fragments, Processing LaTeX fragments, Subscripts and Superscripts, Embedded LaTeX
3960 @section LaTeX fragments
3961 @cindex LaTeX fragments
3963 With symbols, sub- and superscripts, HTML is pretty much at its end when
3964 it comes to representing mathematical formulas@footnote{Yes, there is
3965 MathML, but that is not yet fully supported by many browsers, and there
3966 is no decent converter for turning LaTeX of ASCII representations of
3967 formulas into MathML.  So for the time being, converting formulas into
3968 images seems the way to go.}.  More complex
3969 expressions need a dedicated formula processor.  To this end, Org-mode
3970 can contain arbitrary La@TeX{} fragments.  It provides commands to
3971 preview the typeset result of these fragments, and upon export to HTML,
3972 all fragments will be converted to images and inlined into the HTML
3973 document.  For this to work you need to be on a system with a working
3974 La@TeX{} installation.  You also need the @file{dvipng} program,
3975 available at @url{http://sourceforge.net/projects/dvipng/}.
3977 La@TeX{} fragments don't need any special marking at all.  The following
3978 snippets will be identified as LaTeX source code:
3979 @itemize @bullet
3980 @item
3981 Environments of any kind.  The only requirement is that the
3982 @code{\begin} statement appears on a new line, preceded by only
3983 whitespace.
3984 @item
3985 Text within the usual La@TeX{} math delimiters.  To avoid conflicts with
3986 currency specifications, single @samp{$} characters are only recognized
3987 as math delimiters if the enclosed text contains at most two line breaks,
3988 is directly attached to the @samp{$} characters with no whitespace in
3989 between, and if the closing @samp{$} is followed by whitespace or
3990 punctuation.  For the other delimiters, there is no such restriction, so
3991 when in doubt, use @samp{\(...\)} as inline math delimiters.
3992 @end itemize
3994 @noindent For example:
3996 @example
3997 \begin@{equation@}                          % arbitrary environments,
3998 x=\sqrt@{b@}                                % even tables, figures
3999 \end@{equation@}                            % etc
4001 If $a^2=b$ and \( b=2 \), then the solution must be
4002 either $$ a=+\sqrt@{2@} $$ or \[ a=-\sqrt@{2@} \].
4003 @end example
4005 @noindent
4006 If you need any of the delimiter ASCII sequences for other purposes, you
4007 can configure the option @code{org-format-latex-options} to deselect the
4008 ones you do not wish to have interpreted by the La@TeX{} converter.
4010 @node Processing LaTeX fragments, CDLaTeX mode, LaTeX fragments, Embedded LaTeX
4011 @section Processing LaTeX fragments
4012 @cindex LaTeX fragments, preview
4014 La@TeX{} fragments can be processed to produce a preview images of the
4015 typeset expressions:
4017 @table @kbd
4018 @kindex C-c C-x C-l
4019 @item C-c C-x C-l
4020 Produce a preview image of the La@TeX{} fragment at point and overlay it
4021 over the source code.  If there is no fragment at point, process all
4022 fragments in the current entry (between two headlines).  When called
4023 with a prefix argument, process the entire subtree.  When called with
4024 two prefix arguments, or when the cursor is before the first headline,
4025 process the entire buffer.
4026 @kindex C-c C-c
4027 @item C-c C-c
4028 Remove the overlay preview images.
4029 @end table
4031 During HTML export (@pxref{HTML export}), all La@TeX{} fragments are
4032 converted into images and inlined into the document if the following
4033 setting is active:
4035 @lisp
4036 (setq org-export-with-LaTeX-fragments t)
4037 @end lisp
4039 @node CDLaTeX mode,  , Processing LaTeX fragments, Embedded LaTeX
4040 @section Using CDLaTeX to enter math
4041 @cindex CDLaTeX
4043 CDLaTeX-mode is a minor mode that is normally used in combination with a
4044 major LaTeX mode like AUCTeX in order to speed-up insertion of
4045 environments and math templates.  Inside Org-mode, you can make use of
4046 some of the features of cdlatex-mode.  You need to install
4047 @file{cdlatex.el} and @file{texmathp.el} (the latter comes also with
4048 AUCTeX) from @url{http://www.astro.uva.nl/~dominik/Tools/cdlatex}.
4049 Don't turn cdlatex-mode itself under Org-mode, but use the light
4050 version @code{org-cdlatex-mode} that comes as part of Org-mode.  Turn it
4051 on for the current buffer with @code{M-x org-cdlatex-mode}, or for all
4052 Org-mode files with
4054 @lisp
4055 (add-hook 'org-mode-hook 'turn-on-org-cdlatex)
4056 @end lisp
4058 When this mode is enabled, the following features are present (for more
4059 details see the documentation of cdlatex-mode):
4060 @itemize @bullet
4061 @kindex C-c @{
4062 @item
4063 Environment templates can be inserted with @kbd{C-c @{}.
4064 @item
4065 @kindex @key{TAB}
4066 The @key{TAB} key will do template expansion if the cursor is inside a
4067 LaTeX fragment@footnote{Org-mode has a method to test if the cursor is
4068 inside such a fragment, see the documentation of the function
4069 @code{org-inside-LaTeX-fragment-p}.}.  For example, @key{TAB} will
4070 expand @code{fr} to @code{\frac@{@}@{@}} and position the cursor
4071 correctly inside the first brace.  Another @key{TAB} will get you into
4072 the second brace.  Even outside fragments, @key{TAB} will expand
4073 environment abbreviations at the beginning of a line.  For example, if
4074 you write @samp{equ} at the beginning of a line and press @key{TAB},
4075 this abbreviation will be expanded to an @code{equation} environment.
4076 To get a list of all abbreviations, type @kbd{M-x cdlatex-command-help}.
4077 @item
4078 @kindex _
4079 @kindex ^
4080 Pressing @kbd{_} and @kbd{^} inside a LaTeX fragment will insert these
4081 characters together with a pair of braces.  If you use @key{TAB} to move
4082 out of the braces, and if the braces surround only a single character or
4083 macro, they are removed again (depending on the variable
4084 @code{cdlatex-simplify-sub-super-scripts}).
4085 @item
4086 @kindex `
4087 Pressing the backquote @kbd{`} followed by a character inserts math
4088 macros, also outside LaTeX fragments.  If you wait more than 1.5 seconds
4089 after the backquote, a help window will pop up.
4090 @item
4091 @kindex '
4092 Pressing the normal quote @kbd{'} followed by another character modifies
4093 the symbol before point with an accent or a font.  If you wait more than
4094 1.5 seconds after the backquote, a help window will pop up.  Character
4095 modification will work only inside La@TeX{} fragments, outside the quote
4096 is normal.
4097 @end itemize
4099 @node Exporting, Publishing, Embedded LaTeX, Top
4100 @chapter Exporting
4101 @cindex exporting
4103 Org-mode documents can be exported into a variety of other formats.  For
4104 printing and sharing of notes, ASCII export produces a readable and
4105 simple version of an Org-mode file.  HTML export allows you to publish a
4106 notes file on the web, while the XOXO format provides a solid base for
4107 exchange with a broad range of other applications.  To incorporate
4108 entries with associated times like deadlines or appointments into a
4109 desktop calendar program like iCal, Org-mode can also produce extracts
4110 in the iCalendar format.  Currently Org-mode only supports export, not
4111 import of these different formats.
4113 When exporting, Org-mode uses special conventions to enrich the output
4114 produced.  @xref{Text interpretation}, for more details.
4116 @table @kbd
4117 @kindex C-c C-e
4118 @item C-c C-e
4119 Dispatcher for export and publishing commands.  Displays a help-window
4120 listing the additional key(s) needed to launch an export or publishing
4121 command.
4122 @end table
4124 @menu
4125 * ASCII export::                Exporting to plain ASCII
4126 * HTML export::                 Exporting to HTML
4127 * XOXO export::                 Exporting to XOXO
4128 * iCalendar export::            Exporting in iCalendar format
4129 * Text interpretation::         How the exporter looks at the file
4130 @end menu
4132 @node ASCII export, HTML export, Exporting, Exporting
4133 @section ASCII export
4134 @cindex ASCII export
4136 ASCII export produces a simple and very readable version of an Org-mode
4137 file.
4139 @cindex region, active
4140 @cindex active region
4141 @cindex transient-mark-mode
4142 @table @kbd
4143 @kindex C-c C-e a
4144 @item C-c C-e a
4145 Export as ASCII file.  If there is an active region, only the region
4146 will be exported.  For an org file @file{myfile.org}, the ASCII file
4147 will be @file{myfile.txt}.  The file will be overwritten without
4148 warning.
4149 @kindex C-c C-e v a
4150 @item C-c C-e v a
4151 Export only the visible part of the document.
4152 @end table
4154 @cindex headline levels, for exporting
4155 In the exported version, the first 3 outline levels will become
4156 headlines, defining a general document structure.  Additional levels
4157 will be exported as itemized lists.  If you want that transition to occur
4158 at a different level, specify it with a prefix argument.  For example,
4160 @example
4161 @kbd{C-1 C-c C-e a}
4162 @end example
4164 @noindent
4165 creates only top level headlines and does the rest as items.  When
4166 headlines are converted to items, the indentation of the text following
4167 the headline is changed to fit nicely under the item.  This is done with
4168 the assumption that the first bodyline indicates the base indentation of
4169 the body text.  Any indentation larger than this is adjusted to preserve
4170 the layout relative to the first line.  Should there be lines with less
4171 indentation than the first, these are left alone.
4173 @node HTML export, XOXO export, ASCII export, Exporting
4174 @section HTML export
4175 @cindex HTML export
4177 Org-mode contains an HTML (XHTML 1.0 strict) exporter with extensive
4178 HTML formatting, in ways similar to John Grubers @emph{markdown}
4179 language, but with additional support for tables.
4181 @cindex region, active
4182 @cindex active region
4183 @cindex transient-mark-mode
4184 @table @kbd
4185 @kindex C-c C-e h
4186 @item C-c C-e h
4187 Export as HTML file @file{myfile.html}.
4188 @kindex C-c C-e b
4189 @item C-c C-e b
4190 Export as HTML file and open it with a browser.
4191 @kindex C-c C-e v h
4192 @kindex C-c C-e v b
4193 @item C-c C-e v h
4194 @item C-c C-e v b
4195 Export only the visible part of the document.
4196 @end table
4198 @cindex headline levels, for exporting
4199 In the exported version, the first 3 outline levels will become
4200 headlines, defining a general document structure.  Additional levels
4201 will be exported as itemized lists.  If you want that transition to occur
4202 at a different level, specify it with a prefix argument.  For example,
4204 @example
4205 @kbd{C-2 C-c C-e b}
4206 @end example
4208 @noindent
4209 creates two levels of headings and does the rest as items.
4211 If you want to include HTML tags which should be interpreted as such,
4212 mark them with @samp{@@} as in @samp{@@<b>bold text@@</b>}.
4213 Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
4214 @samp{&gt;} in HTML export.
4216 @cindex links, in HTML export
4217 @cindex internal links, in HTML export
4218 @cindex external links, in HTML export
4219 Internal links (@pxref{Internal links}) will continue to work in HTML
4220 files only if they match a dedicated @samp{<<target>>}.  Automatic links
4221 created by radio targets (@pxref{Radio targets}) will also work in the
4222 HTML file.  Links to external files will still work if the HTML file is
4223 in the same directory as the Org-mode file.  Links to other @file{.org}
4224 files will be translated into HTML links under the assumption that an
4225 HTML version also exists of the linked file.  For information related to
4226 linking files while publishing them to a publishing directory see
4227 @ref{Publishing links}.
4229 You can also give style information for the exported file.  The HTML
4230 exporter assigns the following CSS classes to appropriate parts of the
4231 document - your style specifications may change these:
4232 @example
4233 .todo           @r{TODO keywords}
4234 .done           @r{the DONE keyword}
4235 .timestamp      @r{time stamp}
4236 .timestamp-kwd  @r{keyword associated with a time stamp, like SCHEDULED}
4237 .tag            @r{tag in a headline}
4238 .target         @r{target for links}
4239 @end example
4241 The default style specification can be configured through the option
4242 @code{org-export-html-style}.  If you want to use a file-local style,
4243 you may use file variables, best wrapped into a COMMENT section at the
4244 end of the outline tree.  For example:
4246 @example
4247 * COMMENT HTML style specifications
4249 # Local Variables:
4250 # org-export-html-style: "   <style type=\"text/css\">
4251 #       p @{font-weight: normal; color: gray; @}
4252 #       h1 @{color: black; @}
4253 #   </style>"
4254 # End:
4255 @end example
4257 Remember to execute @kbd{M-x normal-mode} after changing this to make
4258 the new style visible to Emacs.  This command restarts org-mode for the
4259 current buffer and forces Emacs to re-evaluate the local variables
4260 section in the buffer.
4262 @c FIXME: More about header and footer styles
4263 @c FIXME: Talk about links and targets.
4265 @node XOXO export, iCalendar export, HTML export, Exporting
4266 @section XOXO export
4267 @cindex XOXO export
4269 Org-mode contains an exporter that produces XOXO-style output.
4270 Currently, this exporter only handles the general outline structure and
4271 does not interpret any additional Org-mode features.
4273 @table @kbd
4274 @kindex C-c C-e x
4275 @item C-c C-e x
4276 Export as XOXO file @file{myfile.html}.
4277 @kindex C-c C-e v
4278 @item C-c C-e v x
4279 Export only the visible part of the document.
4280 @end table
4282 @node iCalendar export, Text interpretation, XOXO export, Exporting
4283 @section iCalendar export
4284 @cindex iCalendar export
4286 Some people like to use Org-mode for keeping track of projects, but
4287 still prefer a standard calendar application for anniversaries and
4288 appointments.  In this case it can be useful to have deadlines and
4289 other time-stamped items in Org-mode files show up in the calendar
4290 application.  Org-mode can export calendar information in the standard
4291 iCalendar format.
4293 @table @kbd
4294 @kindex C-c C-e i
4295 @item C-c C-e i
4296 Create iCalendar entries for the current file and store them in the same
4297 directory, using a file extension @file{.ics}.
4298 @kindex C-c C-e I
4299 @item C-c C-e I
4300 Like @kbd{C-c C-e i}, but do this for all files in
4301 @code{org-agenda-files}.  For each of these files, a separate iCalendar
4302 file will be written.
4303 @kindex C-c C-e c
4304 @item C-c C-e c
4305 Create a single large iCalendar file from all files in
4306 @code{org-agenda-files} and write it to the file given by
4307 @code{org-combined-agenda-icalendar-file}.
4308 @end table
4310 How this calendar is best read and updated, depends on the application
4311 you are using.  For example, when using iCal under Apple MacOS X, you
4312 could create a new calendar @samp{OrgMode} (the default name for the
4313 calendar created by @kbd{C-c C-e c}, see the variables
4314 @code{org-icalendar-combined-name} and
4315 @code{org-combined-agenda-icalendar-file}).  Then set Org-mode to
4316 overwrite the corresponding file
4317 @file{~/Library/Calendars/OrgMode.ics}.  You may even use AppleScript
4318 to make iCal re-read the calendar files each time a new version of
4319 @file{OrgMode.ics} is produced.  Here is the setup needed for this:
4321 @cindex applescript, for calendar update
4322 @lisp
4323 (setq org-combined-agenda-icalendar-file
4324     "~/Library/Calendars/OrgMode.ics")
4325 (add-hook 'org-after-save-iCalendar-file-hook
4326  (lambda ()
4327   (shell-command
4328    "osascript -e 'tell application \"iCal\" to reload calendars'")))
4329 @end lisp
4331 @node Text interpretation,  , iCalendar export, Exporting
4332 @section Text interpretation by the exporter
4334 The exporter backends interpret additional structure in the Org-mode file
4335 in order to produce better output.
4337 @menu
4338 * Comment lines::               Some lines will not be exported
4339 * Enhancing text::              Subscripts, symbols and more
4340 * Export options::              How to influence the export settings
4341 @end menu
4343 @node Comment lines, Enhancing text, Text interpretation, Text interpretation
4344 @subsection Comment lines
4345 @cindex comment lines
4346 @cindex exporting, not
4348 Lines starting with @samp{#} in column zero are treated as comments
4349 and will never be exported.  Also entire subtrees starting with the
4350 word @samp{COMMENT} will never be exported.  Finally, any text before
4351 the first headline will not be exported either.
4353 @table @kbd
4354 @kindex C-c ;
4355 @item C-c ;
4356 Toggle the COMMENT keyword at the beginning of an entry.
4357 @end table
4359 @node Enhancing text, Export options, Comment lines, Text interpretation
4360 @subsection Enhancing text for export
4361 @cindex enhancing text
4362 @cindex richer text
4364 Some of the export backends of Org-mode allow for sophisticated text
4365 formatting, this is true in particular for the HTML backend.  Org-mode
4366 has a number of typing conventions that allow to produce a richly
4367 formatted output.
4369 @itemize @bullet
4371 @cindex hand-formatted lists
4372 @cindex lists, hand-formatted
4373 @item
4374 Plain lists @samp{-}, @samp{*} or @samp{+} as bullet, or with @samp{1.}
4375 or @samp{2)} as enumerator will be recognized and transformed if the
4376 backend supports lists.  See @xref{Plain lists}.
4378 @cindex underlined text
4379 @cindex bold text
4380 @cindex italic text
4381 @item
4382 You can make words @b{*bold*}, @i{/italic/}, _underlined_,
4383 @code{=code=}, and @samp{+strikethrough+}.
4385 @cindex LaTeX fragments, export
4386 @cindex TeX macros, export
4387 @item
4388 Many @TeX{} macros and entire La@TeX{} fragments are converted into HTML
4389 entities or images (@pxref{Embedded LaTeX}).
4391 @cindex tables, export
4392 @item
4393 Tables are transformed into native tables under the exporter, if the
4394 export backend supports this. Data fields before the first horizontal
4395 separator line will be formatted as table header fields.
4397 @cindex fixed width
4398 @item
4399 If a headline starts with the word @samp{QUOTE}, the text below the
4400 headline will be typeset as fixed-width, to allow quoting of computer
4401 codes etc.  Lines starting with @samp{:} are also typeset in
4402 fixed-width font.
4403 @table @kbd
4404 @kindex C-c :
4405 @item C-c :
4406 Toggle fixed-width for entry (QUOTE) or region, see below.
4407 @end table
4409 @cindex linebreak, forced
4410 @item 
4411 A double backslash @emph{at the end of a line} enforces a line break at
4412 this position.
4413 @end itemize
4415 If these conversions conflict with your habits of typing ASCII text,
4416 they can all be turned off with corresponding variables (see the
4417 customization group @code{org-export-general}, and the following section
4418 which explains how to set export options with special lines in a
4419 buffer.
4422 @node Export options,  , Enhancing text, Text interpretation
4423 @subsection Export options
4424 @cindex options, for export
4426 @cindex completion, of option keywords
4427 The exporter recognizes special lines in the buffer which provide
4428 additional information.  These lines may be put anywhere in the file.
4429 The whole set of lines can be inserted into the buffer with @kbd{C-c
4430 C-e t}.  For individual lines, a good way to make sure the keyword is
4431 correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
4432 (@pxref{Completion}).
4434 @table @kbd
4435 @kindex C-c C-e t
4436 @item C-c C-e t
4437 Insert template with export options, see example below.
4438 @end table
4440 @example
4441 #+TITLE:     the title to be shown (default is the buffer name)
4442 #+AUTHOR:    the author (default taken from @code{user-full-name})
4443 #+EMAIL:     his/her email address (default from @code{user-mail-address})
4444 #+LANGUAGE:  language for HTML, e.g. @samp{en} (@code{org-export-default-language})
4445 #+TEXT:      Some descriptive text to be inserted at the beginning.
4446 #+TEXT:      Several lines may be given.
4447 #+OPTIONS:   H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t *:nil TeX:t LaTeX:t
4448 @end example
4450 @noindent
4451 The OPTIONS line is a compact form to specify export settings.  Here
4452 you can:
4453 @cindex headline levels
4454 @cindex section-numbers
4455 @cindex table of contents
4456 @cindex linebreak preservation
4457 @cindex quoted HTML tags
4458 @cindex fixed-width sections
4459 @cindex tables
4460 @cindex @TeX{}-like syntax for sub- and superscripts
4461 @cindex emphasized text
4462 @cindex @TeX{} macros
4463 @cindex La@TeX{} fragments
4464 @example
4465 H:      @r{set the number of headline levels for export}
4466 num:    @r{turn on/off section-numbers}
4467 toc:    @r{turn on/off table of contents}
4468 \n:     @r{turn on/off linebreak-preservation}
4469 @@:      @r{turn on/off quoted HTML tags}
4470 ::      @r{turn on/off fixed-width sections}
4471 |:      @r{turn on/off tables}
4472 ^:      @r{turn on/off @TeX{}-like syntax for sub- and superscripts.}
4473 *:      @r{turn on/off emphasized text (bold, italic, underlined)}
4474 TeX:    @r{turn on/off simple @TeX{} macros in plain text}
4475 LaTeX:  @r{turn on/off La@TeX{} fragments}
4476 @end example
4478 @node Publishing, Miscellaneous, Exporting, Top
4479 @chapter Publishing
4480 @cindex publishing
4482 Org-mode includes@footnote{@file{org-publish.el} is not yet part of
4483 Emacs, so if you are using @file{org.el} as it comes with Emacs, you
4484 need to download this file separately.  Also make sure org.el is at
4485 least version 4.27.} a publishing management system
4486 that allows you to configure automatic HTML conversion of
4487 @emph{projects} composed of interlinked org files.  This system is
4488 called @emph{org-publish}.  You can also configure org-publish to
4489 automatically upload your exported HTML pages and related attachments,
4490 such as images and source code files, to a web server.  Org-publish turns
4491 org-mode into a web-site authoring tool.
4493 Org-publish has been contributed to Org-mode by David O'Toole.
4495 @menu
4496 * Configuration::               Defining projects
4497 * Sample configuration::        Example projects
4498 * Triggering publication::      Publication commands
4499 @end menu
4501 @node Configuration, Sample configuration, Publishing, Publishing
4502 @section Configuration
4504 Publishing needs significant configuration to specify files, destination
4505 and many other properties of a project.
4507 @menu
4508 * Project alist::               The central configuration variable
4509 * Sources and destinations::    From here to there
4510 * Selecting files::             What files are part of the project?
4511 * Publishing action::           Setting the function doing the publishing
4512 * Publishing options::          Tweaking HTML export
4513 * Publishing links::            Which links keep working after publishing?
4514 * Project page index::          Publishing a list of project files
4515 @end menu
4517 @node Project alist, Sources and destinations, Configuration, Configuration
4518 @subsection The variable @code{org-publish-project-alist}
4519 @cindex org-publish-project-alist
4520 @cindex projects, for publishing
4522 Org-publish is configured almost entirely through setting the value of
4523 one variable, called @code{org-publish-project-alist}.
4524 Each element of the list configures one project, and may be in one of
4525 the two following forms:
4527 @lisp
4528 ("project-name"  :property value :property value ...)
4530 @r{or} 
4532 ("project-name"  :components ("project-name" "project-name" ...))
4534 @end lisp
4536 In both cases, projects are configured by specifying property values.
4537 A project defines the set of files that will be published, as well as
4538 the publishing configuration to use when publishing those files.  When
4539 a project takes the second form listed above, the individual members
4540 of the ``components'' property are taken to be components of the
4541 project, which group together files requiring different publishing
4542 options. When you publish such a ``meta-project'' all the components
4543 will also publish.
4545 @node Sources and destinations, Selecting files, Project alist, Configuration
4546 @subsection Sources and destinations for files
4547 @cindex directories, for publishing
4549 Most properties are optional, but some should always be set. In
4550 particular, org-publish needs to know where to look for source files,
4551 and where to put published files.
4553 @multitable @columnfractions 0.3 0.7
4554 @item @code{:base-directory}
4555 @tab Directory containing publishing source files
4556 @item @code{:publishing-directory}
4557 @tab Directory (possibly remote) where output files will be published.
4558 @item @code{:preparation-function}
4559 @tab Function called before starting publishing process, for example to
4560 run @code{make} for updating files to be published.
4561 @end multitable
4562 @noindent
4564 @node Selecting files, Publishing action, Sources and destinations, Configuration
4565 @subsection Selecting files
4566 @cindex files, selecting for publishing
4568 By default, all files with extension @file{.org} in the base directory
4569 are considered part of the project.  This can be modified by setting the
4570 properties 
4571 @multitable @columnfractions 0.25 0.75
4572 @item @code{:base-extension}
4573 @tab Extension (without the dot!) of source files.  This actually is a
4574 regular expression.
4576 @item @code{:exclude} 
4577 @tab Regular expression to match file names that should not be
4578 published, even though they have been selected on the basis of their
4579 extension.
4581 @item @code{:include}
4582 @tab List of files to be included regardless of @code{:base-extension}
4583 and @code{:exclude}.
4584 @end multitable
4586 @node Publishing action, Publishing options, Selecting files, Configuration
4587 @subsection Publishing Action
4588 @cindex action, for publishing
4590 Publishing means that a file is copied to the destination directory and
4591 possibly transformed in the process.  The default transformation is to
4592 export Org-mode files as HTML files, and this is done by the function
4593 @code{org-publish-org-to-html} which calls the HTML exporter
4594 (@pxref{HTML export}).  Other files like images only need to be copied
4595 to the publishing destination.  For non-Org-mode files, you need to
4596 specify the publishing function.
4598 @multitable @columnfractions 0.3 0.7
4599 @item @code{:publishing-function}
4600 @tab Function executing the publication of a file.  This may also be a
4601 list of functions, which will all be called in turn.
4602 @end multitable
4604 The function must accept two arguments: a property list containing at
4605 least a @code{:publishing-directory} property, and the name of the file
4606 to be published.  It should take the specified file, make the necessary
4607 transformation (if any) and place the result into the destination folder.
4608 You can write your own publishing function, but @code{org-publish}
4609 provides one for attachments (files that only need to be copied):
4610 @code{org-publish-attachment}.
4612 @node Publishing options, Publishing links, Publishing action, Configuration
4613 @subsection Options for the HTML exporter
4614 @cindex options, for publishing
4616 The property list can be used to set many export options for the HTML
4617 exporter.  In most cases, these properties correspond to user variables
4618 in Org-mode.  The table below lists these properties along with the
4619 variable they belong to.  See the documentation string for the
4620 respective variable for details.
4622 @multitable @columnfractions 0.3 0.7
4623 @item @code{:language}              @tab @code{org-export-default-language}
4624 @item @code{:headline-levels}       @tab @code{org-export-headline-levels}
4625 @item @code{:section-numbers}       @tab @code{org-export-with-section-numbers}
4626 @item @code{:table-of-contents}     @tab @code{org-export-with-toc}
4627 @item @code{:archived-trees}        @tab @code{org-export-with-archived-trees}
4628 @item @code{:emphasize}             @tab @code{org-export-with-emphasize}
4629 @item @code{:sub-superscript}       @tab @code{org-export-with-sub-superscripts}
4630 @item @code{:TeX-macros}            @tab @code{org-export-with-TeX-macros}
4631 @item @code{:LaTeX-fragments}       @tab @code{org-export-with-LaTeX-fragments}
4632 @item @code{:fixed-width}           @tab @code{org-export-with-fixed-width}
4633 @item @code{:timestamps}           .@tab @code{org-export-with-timestamps}
4634 @item @code{:tags}                 .@tab @code{org-export-with-tags}
4635 @item @code{:tables}                @tab @code{org-export-with-tables}
4636 @item @code{:table-auto-headline}   @tab @code{org-export-highlight-first-table-line}
4637 @item @code{:style}                 @tab @code{org-export-html-style}
4638 @item @code{:convert-org-links}     @tab @code{org-export-html-link-org-files-as-html}
4639 @item @code{:inline-images}         @tab @code{org-export-html-inline-images}
4640 @item @code{:expand-quoted-html}    @tab @code{org-export-html-expand}
4641 @item @code{:timestamp}             @tab @code{org-export-html-with-timestamp}
4642 @item @code{:publishing-directory}  @tab @code{org-export-publishing-directory}
4643 @item @code{:preamble}              @tab @code{org-export-html-preamble}
4644 @item @code{:postamble}             @tab @code{org-export-html-postamble}
4645 @item @code{:auto-preamble}         @tab @code{org-export-html-auto-preamble}
4646 @item @code{:auto-postamble}        @tab @code{org-export-html-auto-postamble}
4647 @item @code{:author}                @tab @code{user-full-name}
4648 @item @code{:email}                 @tab @code{user-mail-address}
4649 @end multitable
4651 When a property is given a value in org-publish-project-alist, its
4652 setting overrides the value of the corresponding user variable (if any)
4653 during publishing.  options set within a file (@pxref{Export
4654 options}), however, override everything.
4656 @node Publishing links, Project page index, Publishing options, Configuration
4657 @subsection Links between published files
4658 @cindex links, publishing
4660 To create a link from one Org-mode file to another, you would use
4661 something like @samp{[[file:foo.org][The foo]]} or simply
4662 @samp{file:foo.org.} (@pxref{Hyperlinks}).  Upon publishing this link
4663 becomes a link to @file{foo.html}.  In this way, you can interlink the
4664 pages of your "org web" project and the links will work as expected when
4665 you publish them to HTML.
4667 You may also link to related files, such as images. Provided you are
4668 careful with relative pathnames, and provided you have also configured
4669 org-publish to upload the related files, these links will work
4670 too. @ref{Complex example} for an example of this usage.
4672 Sometime an Org-mode file to be published may contain links that are
4673 only valid in your production environment, but not in the publishing
4674 location.  In this case, use the property 
4676 @multitable @columnfractions 0.4 0.6
4677 @item @code{:link-validation-function}
4678 @tab Function to validate links
4679 @end multitable
4681 @noindent
4682 to define a function for checking link validity.  This function must
4683 accept two arguments, the file name and a directory relative to which
4684 the file name is interpreted in the production environment.  If this
4685 function returns @code{nil}, then the HTML generator will only insert a
4686 description into the HTML file, but no link.  One option for this
4687 function is @code{org-publish-validate-link} which checks if the given
4688 file is part of any project in @code{org-publish-project-alist}.
4690 @node Project page index,  , Publishing links, Configuration
4691 @subsection Project page index
4692 @cindex index, of published pages
4694 The following properties may be used to control publishing of an
4695 index of files or summary page for a given project.
4697 @multitable @columnfractions 0.25 0.75
4698 @item @code{:auto-index}
4699 @tab When non-nil, publish an index during org-publish-current-project or
4700 org-publish-all.
4702 @item @code{:index-filename}
4703 @tab Filename for output of index. Defaults to @file{index.org} (which
4704 becomes @file{index.html}).
4706 @item @code{:index-title}
4707 @tab Title of index page. Defaults to name of file.
4709 @item @code{:index-function}
4710 @tab Plugin function to use for generation of index.
4711 Defaults to @code{org-publish-org-index}, which generates a plain list
4712 of links to all files in the project.
4713 @end multitable
4715 @node Sample configuration, Triggering publication, Configuration, Publishing
4716 @section Sample configuration
4718 Below we provide two example configurations.  The first one is a simple
4719 project publishing only a set of Org-mode files.  The second example is
4720 more complex, with a multi-component project.
4722 @menu
4723 * Simple example::              One-component publishing
4724 * Complex example::             A multi-component publishing example
4725 @end menu
4727 @node Simple example, Complex example, Sample configuration, Sample configuration
4728 @subsection Example: simple publishing configuration
4730 This example publishes a set of Org-mode files to the @file{public_html}
4731 directory on the local machine.
4733 @lisp
4734 (setq org-publish-project-alist
4735       '(("org" 
4736          :base-directory "~/org/"
4737          :publishing-directory "~/public_html"
4738          :section-numbers nil
4739          :table-of-contents nil
4740          :style "<link rel=stylesheet 
4741                 href=\"../other/mystyle.css\"
4742                 type=\"text/css\">")))
4743 @end lisp
4745 @node Complex example,  , Simple example, Sample configuration
4746 @subsection Example: complex publishing configuration
4748 This more complicated example publishes an entire website, including
4749 org files converted to HTML, image files, emacs lisp source code, and
4750 stylesheets. The publishing-directory is remote and private files are
4751 excluded.
4753 To ensure that links are preserved, care should be taken to replicate
4754 your directory structure on the web server, and to use relative file
4755 paths. For example, if your org files are kept in @file{~/org} and your
4756 publishable images in @file{~/images}, you'd link to an image with
4758 @example
4759 file:../images/myimage.png
4760 @end example
4762 On the web server, the relative path to the image should be the
4763 same. You can accomplish this by setting up an "images" folder in the
4764 right place on the webserver, and publishing images to it.
4766 @lisp
4767 (setq org-publish-project-alist
4768       '(("orgfiles"
4769           :base-directory "~/org/"
4770           :base-extension "org"
4771           :publishing-directory "/ssh:user@@host:~/html/notebook/"
4772           :publishing-function org-publish-org-to-html
4773           :exclude "PrivatePage.org"   ;; regexp
4774           :headline-levels 3
4775           :section-numbers nil
4776           :table-of-contents nil
4777           :style "<link rel=stylesheet 
4778                   href=\"../other/mystyle.css\" type=\"text/css\">"
4779           :auto-preamble t
4780           :auto-postamble nil)
4781          
4782          ("images"
4783           :base-directory "~/images/"
4784           :base-extension "jpg\\|gif\\|png"
4785           :publishing-directory "/ssh:user@@host:~/html/images/"
4786           :publishing-function org-publish-attachment)
4788          ("other"
4789           :base-directory "~/other/"
4790           :base-extension "css\\|el"
4791           :publishing-directory "/ssh:user@@host:~/html/other/"
4792           :publishing-function org-publish-attachment)
4793          ("website" :components ("orgfiles" "images" "other"))))
4794 @end lisp
4796 @node Triggering publication,  , Sample configuration, Publishing
4797 @section Triggering publication
4799 Once org-publish is properly configured, you can publish with the
4800 following functions: 
4802 @table @kbd
4803 @item C-c C-e c
4804 Prompt for a specific project and publish all files that belong to it.
4805 @item C-c C-e p
4806 Publish the project containing the current file.
4807 @item C-c C-e f
4808 Publish only the current file.
4809 @item C-c C-e a
4810 Publish all projects.
4811 @end table
4813 Org uses timestamps to track when a file has changed. The above
4814 functions normally only publish changed files. You can override this and
4815 force publishing of all files by giving a prefix argument.
4817 @node Miscellaneous, Extensions and Hacking, Publishing, Top
4818 @chapter Miscellaneous
4820 @menu
4821 * Completion::                  M-TAB knows what you need
4822 * Customization::               Adapting Org-mode to your taste
4823 * In-buffer settings::          Overview of the #+KEYWORDS
4824 * The very busy C-c C-c key::   When in doubt, press C-c C-c
4825 * Clean view::                  Getting rid of leading stars in the outline
4826 * TTY keys::                    Using Org-mode on a tty
4827 * Interaction::                 Other Emacs packages
4828 * Bugs::                        Things which do not work perfectly
4829 @end menu
4831 @node Completion, Customization, Miscellaneous, Miscellaneous
4832 @section Completion
4833 @cindex completion, of @TeX{} symbols
4834 @cindex completion, of TODO keywords
4835 @cindex completion, of dictionary words
4836 @cindex completion, of option keywords
4837 @cindex completion, of CamelCase links
4838 @cindex completion, of tags
4839 @cindex @TeX{} symbol completion
4840 @cindex TODO keywords completion
4841 @cindex dictionary word completion
4842 @cindex option keyword completion
4843 @cindex CamelCase link completion
4844 @cindex tag completion
4846 Org-mode supports in-buffer completion.  This type of completion does
4847 not make use of the minibuffer.  You simply type a few letters into
4848 the buffer and use the key to complete text right there.
4850 @table @kbd
4851 @kindex M-@key{TAB}
4852 @item M-@key{TAB}
4853 Complete word at point
4854 @itemize @bullet
4855 @item
4856 At the beginning of a headline, complete TODO keywords.
4857 @item
4858 After @samp{\}, complete @TeX{} symbols supported by the exporter.
4859 @item
4860 After @samp{*}, complete headlines in the current buffer so that they
4861 can be used in search links like @samp{[[*find this headline]]}.
4862 @item
4863 After @samp{:}, complete tags.  The list of tags is taken from the
4864 variable @code{org-tag-alist} (possibly set through the @samp{#+TAGS}
4865 in-buffer option, @pxref{Setting tags}), or it is created dynamically
4866 from all tags used in the current buffer.
4867 @item
4868 After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}).
4869 @item
4870 After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
4871 @samp{OPTIONS} which set file-specific options for Org-mode.  When the
4872 option keyword is already complete, pressing @kbd{M-@key{TAB}} again
4873 will insert example settings for this keyword.
4874 @item
4875 In the line after @samp{#+STARTUP: }, complete startup keywords,
4876 i.e. valid keys for this line.
4877 @item
4878 Elsewhere, complete dictionary words using ispell.
4879 @end itemize
4880 @end table
4882 @node Customization, In-buffer settings, Completion, Miscellaneous
4883 @section Customization
4884 @cindex customization
4885 @cindex options, for customization
4886 @cindex variables, for customization
4888 There are more than 100 variables that can be used to customize
4889 Org-mode.  For the sake of compactness of the manual, we are not
4890 describing the variables here.  A structured overview of customization
4891 variables is available with @kbd{M-x org-customize}.  Or select
4892 @code{Browse Org Group} from the @code{Org->Customization} menu.  Many
4893 settings can also be activated on a per-file basis, by putting special
4894 lines into the buffer (@pxref{In-buffer settings}).
4896 @node In-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
4897 @section Summary of in-buffer settings
4898 @cindex in-buffer settings
4899 @cindex special keywords
4901 Org-mode uses special lines in the buffer to define settings on a
4902 per-file basis.  These lines start with a @samp{#+} followed by a
4903 keyword, a colon, and then individual words defining a setting.  Several
4904 setting words can be in the same line, but you can also have multiple
4905 lines for the keyword.  While these settings are described throughout
4906 the manual, here is a summary.  After changing any of those lines in the
4907 buffer, press @kbd{C-c C-c} with the cursor still in the line to
4908 activate the changes immediately.  Otherwise they become effective only
4909 when the file is visited again in a new Emacs session.
4911 @table @kbd
4912 @item #+STARTUP:
4913 This line sets options to be used at startup of org-mode, when an
4914 Org-mode file is being visited.  The first set of options deals with the
4915 initial visibility of the outline tree.  The corresponding variable for
4916 global default settings is @code{org-startup-folded}, with a default
4917 value @code{t}, which means @code{overview}.
4918 @example
4919 overview   @r{top-level headlines only}
4920 content    @r{all headlines}
4921 showall    @r{no folding at all, show everything}
4922 @end example
4923 Then there are options for aligning tables upon visiting a file.  This
4924 is useful in files containing narrowed table columns.  The corresponding
4925 variable is @code{org-startup-align-all-tables}, with a default value
4926 @code{nil}. 
4927 @example
4928 align      @r{align all tables}
4929 noalign    @r{don't align tables on startup}
4930 @end example
4931 Logging when a TODO item is marked DONE (variable @code{org-log-done})
4932 can be configured using these options.
4933 @example
4934 logging    @r{record a timestamp when an item is marked DONE}
4935 nologging  @r{don't record when items are marked DONE}
4936 @end example
4937 Here are the options for hiding leading stars in outline headings.  The
4938 corresponding variables are @code{org-hide-leading-stars} and
4939 @code{org-odd-levels-only}, both with a default setting @code{nil}
4940 (meaning @code{showstars} and @code{oddeven}).
4941 @example
4942 hidestars  @r{make all but one of the stars starting a headline invisible.}
4943 showstars  @r{show all stars starting a headline}
4944 odd        @r{allow only odd outline levels (1,3,...)}
4945 oddeven    @r{allow all outline levels}
4946 @end example
4947 @item #+SEQ_TODO:   #+TYP_TODO:
4948 These lines set the TODO keywords and their interpretation in the
4949 current file.  The corresponding variables are @code{org-todo-keywords}
4950 and @code{org-todo-interpretation}.
4951 @item #+TAGS:  TAG1(c1) TAG2(c2)
4952 These lines (several such lines are allowed) specify the legal tags in
4953 this file, and (potentially) the corresponding @emph{fast tag selection}
4954 keys.  The corresponding variable is @code{org-tag-alist}.
4955 @item #+LINK:  linkword replace
4956 These lines (several are allowed) specify link abbreviations.
4957 @xref{Link abbreviations}.  The corresponding variable is
4958 @code{org-link-abbrev-alist}.
4959 @item #+CATEGORY:
4960 This line sets the category for the agenda file.  The category applies
4961 for all subsequent lines until the next @samp{#+CATEGORY} line, or the
4962 end of the file.
4963 @item #+TBLFM:
4964 This line contains the formulas for the table directly above the line.
4965 @item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS:
4966 These lines provide settings for exporting files.  For more details see
4967 @ref{Export options}.
4968 @end table
4970 @node The very busy C-c C-c key, Clean view, In-buffer settings, Miscellaneous
4971 @section The very busy C-c C-c key
4972 @kindex C-c C-c
4973 @cindex C-c C-c, overview
4975 The key @kbd{C-c C-c} has many purposes in org-mode, which are all
4976 mentioned scattered throughout this manual.  One specific function of
4977 this key is to add @emph{tags} to a headline (@pxref{Tags}).  In many
4978 other circumstances it means something like @emph{Hey Org-mode, look
4979 here and update according to what you see here}.  Here is a summary of
4980 what this means in different contexts.
4982 @itemize @minus
4983 @item
4984 If there are highlights in the buffer from the creation of a sparse
4985 tree, or from clock display, remove these highlights.
4986 @item
4987 If the cursor is in one of the special @code{#+KEYWORD} lines, this
4988 triggers scanning the buffer for these lines and updating the
4989 information. 
4990 @item
4991 If the cursor is inside a table, realign the table.  This command
4992 works even if the automatic table editor has been turned off.
4993 @item
4994 If the cursor is on a @code{#+TBLFM} line, re-apply the formulas to
4995 the entire table.
4996 @item
4997 If the cursor is inside a table created by the @file{table.el} package,
4998 activate that table.
4999 @item
5000 If the current buffer is a remember buffer, close the note and file it.
5001 With a prefix argument, file it, without further interaction, to the
5002 default location.
5003 @item
5004 If the cursor is on a @code{<<<target>>>}, update radio targets and
5005 corresponding links in this buffer.
5006 @item
5007 If the cursor is in a plain list item with a checkbox, toggle the status
5008 of the checkbox.
5009 @item
5010 If the cursor is on a numbered item in a plain list, renumber the
5011 ordered list.
5012 @end itemize
5014 @node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous
5015 @section A cleaner outline view
5016 @cindex hiding leading stars
5017 @cindex clean outline view
5019 Some people find it noisy and distracting that the Org-mode headlines
5020 are starting with a potentially large number of stars.  For example
5021 the tree from @ref{Headlines}:
5023 @example
5024 * Top level headline
5025 ** Second level
5026 *** 3rd level
5027     some text
5028 *** 3rd level
5029     more text
5030 * Another top level headline
5031 @end example
5033 @noindent
5034 Unfortunately this is deeply ingrained into the code of Org-mode and
5035 cannot be easily changed.  You can, however, modify the display in such
5036 a way that all leading stars become invisible and the outline more easy
5037 to read.  To do this, customize the variable
5038 @code{org-hide-leading-stars} like this:
5040 @lisp
5041 (setq org-hide-leading-stars t)
5042 @end lisp
5044 @noindent
5045 or change this on a per-file basis with one of the lines (anywhere in
5046 the buffer)
5048 @example
5049 #+STARTUP: showstars
5050 #+STARTUP: hidestars
5051 @end example
5053 @noindent
5054 Press @kbd{C-c C-c} with the cursor in a @samp{STARTUP} line to activate
5055 the modifications.
5057 With stars hidden, the tree becomes:
5059 @example
5060 * Top level headline
5061  * Second level
5062   * 3rd level
5063     some text
5064   * 3rd level
5065     more text
5066 * Another top level headline
5067 @end example
5069 @noindent
5070 Note that the leading stars are not truly replaced by whitespace, they
5071 are only fontified with the face @code{org-hide} that uses the
5072 background color as font color.  If are are not using either white or
5073 black background, you may have to customize this face to get the wanted
5074 effect.  Another possibility is to set this font such that the extra
5075 stars are @i{almost} invisible, for example using the color
5076 @code{grey90} on a white background.
5078 Things become cleaner still if you skip all the even levels and use only
5079 odd levels 1, 3, 5..., effectively adding two stars to go from one
5080 outline level to the next:
5082 @example
5083 * Top level headline
5084   * Second level
5085     * 3rd level
5086       some text
5087     * 3rd level
5088       more text
5089 * Another top level headline
5090 @end example
5092 @noindent
5093 In order to make the structure editing and export commands handle this
5094 convention correctly, use
5096 @lisp
5097 (setq org-odd-levels-only t)
5098 @end lisp
5100 @noindent
5101 or set this on a per-file basis with one of the following lines (don't
5102 forget to press @kbd{C-c C-c} with the cursor in the startup line to
5103 activate changes immediately).
5105 @example
5106 #+STARTUP: odd
5107 #+STARTUP: oddeven
5108 @end example
5110 You can convert an Org-mode file from single-star-per-level to the
5111 double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
5112 RET} in that file.  The reverse operation is @kbd{M-x
5113 org-convert-to-oddeven-levels}.
5115 @node TTY keys, Interaction, Clean view, Miscellaneous
5116 @section Using org-mode on a tty
5117 @cindex tty keybindings
5119 Org-mode uses a number of keys that are not accessible on a tty.  This
5120 applies to most special keys like cursor keys, @key{TAB} and
5121 @key{RET}, when these are combined with modifier keys like @key{Meta}
5122 and/or @key{Shift}.  Org-mode uses these bindings because it needs to
5123 provide keys for a large number of commands, and because these keys
5124 appeared particularly easy to remember.  In order to still be able to
5125 access the core functionality of Org-mode on a tty, alternative
5126 bindings are provided.  Here is a complete list of these bindings,
5127 which are obviously more cumbersome to use.  Note that sometimes a
5128 work-around can be better.  For example changing a time stamp is
5129 really only fun with @kbd{S-@key{cursor}} keys.  On a tty you would
5130 rather use @kbd{C-c .}  to re-insert the timestamp.
5132 @multitable @columnfractions 0.15 0.2 0.2
5133 @item @b{Default} @tab @b{Alternative 1} @tab @b{Alternative 2}
5134 @item @kbd{S-@key{TAB}}     @tab @kbd{C-u @key{TAB}}       @tab
5135 @item @kbd{M-@key{left}}    @tab @kbd{C-c C-x l}           @tab @kbd{@key{Esc} @key{left}}
5136 @item @kbd{M-S-@key{left}}  @tab @kbd{C-c C-x L}           @tab
5137 @item @kbd{M-@key{right}}   @tab @kbd{C-c C-x r}           @tab @kbd{@key{Esc} @key{right}}
5138 @item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R}           @tab
5139 @item @kbd{M-@key{up}}      @tab @kbd{C-c C-x u}           @tab @kbd{@key{Esc} @key{up}}
5140 @item @kbd{M-S-@key{up}}    @tab @kbd{C-c C-x U}           @tab
5141 @item @kbd{M-@key{down}}    @tab @kbd{C-c C-x d}           @tab @kbd{@key{Esc} @key{down}}
5142 @item @kbd{M-S-@key{down}}  @tab @kbd{C-c C-x D}           @tab
5143 @item @kbd{S-@key{RET}}     @tab @kbd{C-c C-x c}           @tab
5144 @item @kbd{M-@key{RET}}     @tab @kbd{C-c C-x m}           @tab @kbd{@key{Esc} @key{RET}}
5145 @item @kbd{M-S-@key{RET}}   @tab @kbd{C-c C-x M}           @tab
5146 @item @kbd{S-@key{left}}    @tab @kbd{C-c C-x @key{left}}  @tab
5147 @item @kbd{S-@key{right}}   @tab @kbd{C-c C-x @key{right}} @tab
5148 @item @kbd{S-@key{up}}      @tab @kbd{C-c C-x @key{up}}    @tab
5149 @item @kbd{S-@key{down}}    @tab @kbd{C-c C-x @key{down}}  @tab
5150 @end multitable
5152 @node Interaction, Bugs, TTY keys, Miscellaneous
5153 @section Interaction with other packages
5154 @cindex packages, interaction with other
5155 Org-mode lives in the world of GNU Emacs and interacts in various ways
5156 with other code out there.
5158 @menu
5159 * Cooperation::                 Packages Org-mode cooperates with
5160 * Conflicts::                   Packages that lead to conflicts
5161 @end menu
5163 @node Cooperation, Conflicts, Interaction, Interaction
5164 @subsection Packages that Org-mode cooperates with
5166 @table @asis
5167 @cindex @file{calc.el}
5168 @item @file{calc.el} by Dave Gillespie
5169 Org-mode uses the calc package for implementing spreadsheet
5170 functionality in its tables (@pxref{Table calculations}).  Org-modes
5171 checks for the availability of calc by looking for the function
5172 @code{calc-eval} which should be autoloaded in your setup if calc has
5173 been installed properly.  As of Emacs 22, calc is part of the Emacs
5174 distribution.  Another possibility for interaction between the two
5175 packages is using calc for embedded calculations. @xref{Embedded Mode,
5176 , Embedded Mode, calc, GNU Emacs Calc Manual}.
5177 @cindex @file{constants.el}
5178 @item @file{constants.el} by Carsten Dominik
5179 In a table formula (@pxref{Table calculations}), it is possible to use
5180 names for natural constants or units.  Instead of defining your own
5181 constants in the variable @code{org-table-formula-constants}, install
5182 the @file{constants} package which defines a large number of constants
5183 and units, and lets you use unit prefixes like @samp{M} for
5184 @samp{Mega} etc.  You will need version 2.0 of this package, available
5185 at @url{http://www.astro.uva.nl/~dominik/Tools}. Org-mode checks for
5186 the function @code{constants-get}, which has to be autoloaded in your
5187 setup.  See the installation instructions in the file
5188 @file{constants.el}.
5189 @item @file{cdlatex.el} by Carsten Dominik
5190 @cindex @file{cdlatex.el}
5191 Org-mode can make use of the cdlatex package to efficiently enter
5192 La@TeX{} fragments into Org-mode files. See @ref{CDLaTeX mode}.
5193 @item @file{remember.el} by John Wiegley
5194 @cindex @file{remember.el}
5195 Org mode cooperates with remember, see @ref{Remember}.
5196 @file{Remember.el} is not part of Emacs, find it on the web.
5197 @cindex @file{table.el}
5198 @item @file{table.el} by Takaaki Ota
5199 Org mode cooperates with table.el, see @ref{table.el}.  @file{table.el}
5200 is part of Emacs 22.
5201 @end table
5203 @node Conflicts,  , Cooperation, Interaction
5204 @subsection Packages that lead to conflicts with Org-mode
5206 @table @asis
5208 @cindex @file{allout.el}
5209 @item @file{allout.el} by Ken Manheimer
5210 Startup of Org-mode may fail with the error message
5211 @code{(wrong-type-argument keymapp nil)} when there is an outdated
5212 version @file{allout.el} on the load path, for example the version
5213 distributed with Emacs 21.x.  Upgrade to Emacs 22 and this problem will
5214 disappear.  If for some reason you cannot do this, make sure that org.el
5215 is loaded @emph{before} @file{allout.el}, for example by putting
5216 @code{(require 'org)} early enough into your @file{.emacs} file.
5218 @cindex @file{CUA.el}
5219 @item @file{CUA.el} by Kim. F. Storm
5220 Keybindings in Org-mode conflict with the @kbd{S-<cursor>} keys
5221 used by CUA-mode (as well as pc-select-mode and s-region-mode) to
5222 select and extend the region.  If you want to use one of these
5223 packages along with Org-mode, configure the variable
5224 @code{org-CUA-compatible}.  When set, Org-mode will move the following
5225 keybindings in org-mode files, and in the agenda buffer (but not
5226 during date selection).
5228 @example
5229 S-UP    -> M-p             S-DOWN  -> M-n
5230 S-LEFT  -> M--             S-RIGHT -> M-+
5231 S-RET   -> C-S-RET
5232 @end example
5234 Yes, these are unfortunately more difficult to remember.  If you want
5235 to have other replacement keys, look at the variable
5236 @code{org-disputed-keys}.
5237 @item @file{windmove.el} by Hovav Shacham
5238 @cindex @file{windmove.el}
5239 Also this package uses the @kbd{S-<cursor>} keys, so everything written
5240 in the paragraph above about CUA mode also applies here.
5241 @end table
5244 @node Bugs,  , Interaction, Miscellaneous
5245 @section Bugs
5246 @cindex bugs
5248 Here is a list of things that should work differently, but which I
5249 have found too hard to fix.
5251 @itemize @bullet
5252 @item
5253 If a table field starts with a link, and if the corresponding table
5254 column is narrowed (@pxref{Narrow columns}) to a width too small to
5255 display the link, the field would look entirely empty even though it is
5256 not.  To prevent this, Org-mode throws an error.  The work-around is to
5257 make the column wide enough to fit the link, or to add some text (at
5258 least 2 characters) before the link in the same field.
5259 @item
5260 Narrowing table columns does not work on XEmacs, because the
5261 @code{format} function does not transport text properties.
5262 @item
5263 Text in an entry protected with the @samp{QUOTE} keyword should not
5264 autowrap.
5265 @item
5266 When the application called by @kbd{C-c C-o} to open a file link fails
5267 (for example because the application does not exist or refuses to open
5268 the file), it does so silently.  No error message is displayed.
5269 @item
5270 The remote-editing commands in the agenda buffer cannot be undone with
5271 @code{undo} called from within the agenda buffer.  But you can go to
5272 the corresponding buffer (using @key{TAB} or @key{RET} and execute
5273 @code{undo} there.
5274 @item
5275 Recalculating a table line applies the formulas from left to right.
5276 If a formula uses @emph{calculated} fields further down the row,
5277 multiple recalculation may be needed to get all fields consistent.
5278 @item
5279 A single letter cannot be made bold, for example @samp{*a*}.
5280 @item
5281 The exporters work well, but could be made more efficient.
5282 @end itemize
5285 @node Extensions and Hacking, History and Acknowledgments, Miscellaneous, Top
5286 @appendix Extensions, Hooks and Hacking
5288 This appendix lists extensions for Org-mode written by other authors.
5289 It also covers some aspects where users can easily extend the
5290 functionality of Org-mode.
5292 @menu
5293 * Extensions::                  Existing 3rd-part extensions
5294 * Dynamic blocks::              Automatically filled blocks
5295 @end menu
5297 @node Extensions, Dynamic blocks, Extensions and Hacking, Extensions and Hacking
5298 @section Third-party extensions for Org-mode
5300 The following extensions for Org-mode have been written by other people:
5302 @table @asis
5303 @cindex @file{org-mouse.el}
5304 @item @file{org-mouse.el} by Piotr Zielinski
5305 This package implements extended mouse functionality for Org-mode.  It
5306 allows you to cycle visibility and to edit the document structure with
5307 the mouse.  Best of all, it provides a context-sensitive menu on
5308 @key{mouse-3} that changes depending on the context of a mouse-click.
5309 @file{org-mouse.el} is freely available at @url{http://www.cl.cam.ac.uk/~pz215/files/org-mouse.el}.
5310 @cindex @file{org-publish.el}
5311 @item @file{org-publish.el} by David O'Toole
5312 This package provides facilities for publishing related sets of Org-mode
5313 files together with linked files like images as a webpages.  It is
5314 highly configurable and can be used for other publishing purposes as
5315 well.  As of Org-mode version 4.30, @file{org-publish.el} is part of the
5316 Org-mode distribution.  It is not yet part of Emacs, however, a delay
5317 caused by the preparations for the 22.1 release.  In the mean time,
5318 @file{org-publish.el} can be downloaded from David's site:
5319 @url{http://dto.freeshell.org/e/org-publish.el}.
5320 @cindex @file{org-blog.el}
5321 @item @file{org-blog.el} by David O'Toole
5322 A blogging plug-in for @file{org-publish.el}.@*
5323 @url{http://dto.freeshell.org/notebook/OrgMode.html}.
5324 @cindex @file{org-blogging.el}
5325 @item @file{org-blogging.el} by  Bastien Guerry
5326 Publish Org-mode files as
5327 blogs. @url{http://www.cognition.ens.fr/~guerry/org-blogging.html}.
5328 @end table
5330 @node Dynamic blocks,  , Extensions, Extensions and Hacking
5331 @section Dynamic blocks
5333 Org-mode documents can contain @emph{dynamic blocks}.  These are
5334 specially marked regions that are updated by some user-written
5335 function.  A good example for such a block is the clock table inserted
5336 by the command @kbd{C-c C-x C-r} (@pxref{Clocking work time}).
5338 Dynamic block are enclosed by a BEGIN-END structure that assigns a name
5339 to the block and can also specify parameters for the function producing
5340 the content of the block.
5342 @example
5343 #+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
5345 #+END:
5346 @end example
5348 Dynamic blocks are updated with the following commands
5350 @table @kbd
5351 @kindex C-c C-x C-u
5352 @item C-c C-x C-u
5353 Update dynamic block at point.
5354 @kindex C-u C-c C-x C-u
5355 @item C-u C-c C-x C-u
5356 Update all dynamic blocks in the current file.
5357 @end table
5359 Updating a dynamic block means to remove all the text between BEGIN and
5360 END, parse the BEGIN line for parameters and then call the specific
5361 writer function for this block to insert the new content.  For a block
5362 with name @code{myblock}, the writer function is
5363 @code{org-dblock-write:myblock} with as only parameter a property list
5364 with the parameters given in the begin line.  Here is a trivial example
5365 of a block that keeps track of when the block update function was last
5366 run:
5368 @example
5369 #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
5371 #+END:
5372 @end example
5374 @noindent
5375 The corresponding block writer function could look like this:
5377 @lisp
5378 (defun org-dblock-write:block-update-time (params)
5379    (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
5380      (insert "Last block update at: "
5381              (format-time-string fmt (current-time)))))
5382 @end lisp
5384 If you want to make sure that all dynamic blocks are always up-to-date,
5385 you could add the function @code{org-update-all-dblocks} to a hook, for
5386 example @code{before-save-hook}.  @code{org-update-all-dblocks} is
5387 written in a way that is does nothing in buffers that are not in Org-mode.
5389 @node History and Acknowledgments, Index, Extensions and Hacking, Top
5390 @appendix History and Acknowledgments
5391 @cindex acknowledgments
5392 @cindex history
5393 @cindex thanks
5395 Org-mode was borne in 2003, out of frustration over the user interface
5396 of the Emacs outline-mode.  All I wanted was to make working with an
5397 outline tree possible without having to remember more than 10 commands
5398 just for hiding and unhiding parts of the outline tree, and to allow to
5399 restructure a tree easily.  Visibility cycling and structure editing
5400 were originally implemented in the package @file{outline-magic.el}, but
5401 quickly moved to the more general @file{org.el}.  TODO entries, basic
5402 time stamps, and table support were added next, and highlight the two
5403 main goals that Org-mode still has today: To create a new,
5404 outline-based, plain text mode with innovative and intuitive editing
5405 features, and to incorporate project planning functionality directly
5406 into a notes file.
5408 Since the first release, hundreds of emails to me or on
5409 @code{emacs-orgmode@@gnu.org} have provided a constant stream of bug
5410 reports, feedback, new ideas, and sometimes even patches and add-on
5411 code.  Many thanks to everyone who has helped to improve this package.
5412 I am trying to keep here a list of the people who had significant
5413 influence in shaping one or more aspects of Org-mode.  The list may not
5414 be complete, if I have forgotten someone, please accept my apologies and
5415 let me know.
5417 @itemize @bullet
5418 @item
5419 @i{Thomas Baumann} contributed the code for links to the MH-E email
5420 system.
5421 @item
5422 @i{Alex Bochannek} provided a patch for rounding time stamps.
5423 @item
5424 @i{Charles Cave}'s suggestion sparked the implementation of templates
5425 for Remember.
5426 @item
5427 @i{Pavel Chalmoviansky} influenced the agenda treatment of items with
5428 specified time.
5429 @item
5430 @i{Gregory Chernov} patched support for lisp forms into table
5431 calculations and improved XEmacs compatibility, in particular by porting
5432 @file{nouline.el} to XEmacs.
5433 @item
5434 @i{Sacha Chua} suggested to copy some linking code from Planner.
5435 @item
5436 @i{Eddward DeVilla} proposed and tested checkbox statistics.
5437 @item
5438 @i{Kees Dullemond} inspired the use of narrowed tabled columns.
5439 @item
5440 @i{Christian Egli} converted the documentation into TeXInfo format,
5441 patched CSS formatting into the HTML exporter, and inspired the agenda.
5442 @item
5443 @i{Nic Ferrier} contributed mailcap and XOXO support.
5444 @item
5445 @i{Niels Giessen} had the idea to automatically archive DONE trees.
5446 @item
5447 @i{Bastien Guerry} provided extensive feedback.
5448 @item
5449 @i{Kai Grossjohann} pointed out key-binding conflicts with other packages.
5450 @item
5451 @i{Leon Liu} asked for embedded LaTeX and tested it.
5452 @item
5453 @i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler
5454 happy.
5455 @item
5456 @i{Todd Neal} provided patches for links to Info files and elisp forms.
5457 @item
5458 @i{Tim O'Callaghan} suggested in-file links, search options for general
5459 file links, and TAGS.
5460 @item
5461 @i{Oliver Oppitz} suggested multi-state TODO items.
5462 @item
5463 @i{Scott Otterson} sparked the introduction of descriptive text for
5464 links, among other things.
5465 @item
5466 @i{Pete Phillips} helped during the development of the TAGS feature, and
5467 provided frequent feedback.
5468 @item
5469 @i{T.V. Raman} reported bugs and suggested improvements.
5470 @item
5471 @i{Matthias Rempe} (Oelde) provided ideas, Windows support, and quality
5472 control.
5473 @item
5474 @i{Kevin Rogers} contributed code to access VM files on remote hosts.
5475 @item
5476 @i{Frank Ruell} solved the mystery of the @code{keymapp nil} bug, a
5477 conflict with @file{allout.el}.
5478 @item
5479 @i{Jason Riedy} sent a patch to fix a bug with export of TODO keywerds.
5480 @item
5481 @i{Philip Rooke} created the Org-mode reference card and provided lots
5482 of feedback.
5483 @item
5484 @i{Christian Schlauer} proposed angular brackets around links, among
5485 other things.
5486 @item
5487 Linking to VM/BBDB/GNUS was inspired by @i{Tom Shannon}'s
5488 @file{organizer-mode.el}.
5489 @item
5490 @i{Daniel Sinder} came up with the idea of internal archiving by locking
5491 subtrees.
5492 @item
5493 @i{Dale Smith} proposed link abbreviations.
5494 @item
5495 @i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
5496 chapter about publishing.
5497 @item
5498 @i{J@"urgen Vollmer} contributed code generating the table of contents
5499 in HTML output.
5500 @item
5501 @i{Chris Wallace} provided a patch implementing the @samp{QUOTE}
5502 keyword.
5503 @item
5504 @i{David Wainberg} suggested archiving, and improvements to the linking
5505 system.
5506 @item
5507 @i{John Wiegley} wrote @file{emacs-wiki.el} and @file{planner.el}.  The
5508 development of Org-mode was fully independent, and both systems are
5509 really different beasts in their basic ideas and implementation details.
5510 I later looked at John's code, however, and learned from his
5511 implementation of (i) links where the link itself is hidden and only a
5512 description is shown, and (ii) popping up a calendar to select a date.
5513 @item
5514 @i{Carsten Wimmer} suggested some changes and helped fix a bug in
5515 linking to GNUS.
5516 @item
5517 @i{Roland Winkler} requested additional keybindings to make Org-mode
5518 work on a tty.
5519 @item
5520 @i{Piotr Zielinski} wrote @file{org-mouse.el}, proposed angenda blocks
5521 and contributed various ideas and code snippets.
5522 @end itemize
5525 @node Index, Key Index, History and Acknowledgments, Top
5526 @unnumbered Index
5528 @printindex cp
5530 @node Key Index,  , Index, Top
5531 @unnumbered Key Index
5533 @printindex ky
5535 @bye
5537 @ignore
5538    arch-tag: 7893d1fe-cc57-4d13-b5e5-f494a1bcc7ac
5539 @end ignore