Release 4.40
[org-mode.git] / org.texi
blob26d0f25f90b0c6e385956f7cae9fcbf66b7ba57e
1 \input texinfo
2 @c %**start of header
3 @setfilename ../info/org
4 @settitle Org Mode Manual
6 @set VERSION 4.40
7 @set DATE June 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 Org-mode
102 * Feedback::                    Bug reports, ideas, patches etc.
104 Document Structure
106 * Outlines::                    Org-mode is based on outline-mode
107 * Headlines::                   How to typeset org-tree headlines
108 * Visibility cycling::          Show and hide, much simplified
109 * Motion::                      Jumping to other headlines
110 * Structure editing::           Changing sequence and level of headlines
111 * Archiving::                   Move done task trees to a different place
112 * Sparse trees::                Matches embedded in context
113 * Plain lists::                 Editing hand-formatted lists
115 Archiving
117 * ARCHIVE tag::                 Marking a tree as inactive
118 * Moving subtrees::             Moving a tree to an archive file
120 Tables
122 * Built-in table editor::       Simple tables
123 * Narrow columns::              Stop wasting space in tables   
124 * Table calculations::          Compute a field from other fields
125 * orgtbl-mode::                 The table editor as minor mode
126 * table.el::                    Complex tables
128 Calculations in tables
130 * Formula syntax::              How to write a formula
131 * Lisp formulas::               An alternative way to write formulas
132 * Column formulas::             Formulas valid for all fields in a column
133 * Advanced features::           Field names, parameters and automatic recalc
134 * Named-field formulas::        Formulas valid in single fields
135 * Editing/debugging formulas::  Changing a stored formula
136 * Appetizer::                   Taste the power of calc
138 Hyperlinks
140 * Link format::                 How links in Org-mode are formatted
141 * Internal links::              Links to other places in the current file
142 * External links::              URL-like links to the world
143 * Handling links::              Creating, inserting and following
144 * Search options::              Linking to a specific location
145 * Custom searches::             When the default search is not enough
146 * Remember::                    Org-trees store quick notes
148 Internal links
150 * Radio targets::               Make targets trigger links in plain text.
151 * CamelCase links::             Activating CamelCase words as links
153 TODO items
155 * TODO basics::                 Marking and displaying TODO entries
156 * TODO extensions::             Workflow and assignments
157 * Priorities::                  Some things are more important than others
159 Extended use of TODO keywords
161 * Workflow states::             From TODO to DONE in steps
162 * TODO types::                  I do this, Fred the rest
163 * Per file keywords::           Different files, different requirements
165 Timestamps
167 * Time stamps::                 Assigning a time to a tree entry
168 * Creating timestamps::         Commands which insert timestamps
169 * Progress logging::            Documenting when what work was done.
171 Progress Logging
173 * Closing items::               When was this entry marked DONE?
174 * Clocking work time::          When exactly did you work on this item?
176 Tags
178 * Tag inheritance::             Tags use the tree structure of the outline
179 * Setting tags::                How to assign tags to a headline
180 * Tag searches::                Searching for combinations of tags
182 Agenda Views
184 * Agenda files::                Files being searched for agenda information
185 * Agenda dispatcher::           Keyboard access to agenda views
186 * Weekly/Daily agenda::         The calendar page with current tasks
187 * Global TODO list::            All unfinished action items
188 * Matching headline tags::      Structured information with fine-tuned search
189 * Timeline::                    Time-sorted view for single file
190 * Agenda commands::             Remote editing of org trees
192 The weekly/daily agenda
194 * Categories::                  Not all tasks are equal
195 * Time-of-day specifications::  How the agenda knows the time
196 * Calendar/Diary integration::  Integrating Anniversaries and more
197 * Sorting of agenda items::     The order of things
199 Embedded LaTeX
201 * Math symbols::                TeX macros for symbols and Greek letters
202 * Subscripts and Superscripts::  Simple syntax for raising/lowering text
203 * LaTeX fragments::             Complex formulas made easy
204 * Processing LaTeX fragments::  Previewing LaTeX processing
205 * CDLaTeX mode::                Speed up entering of formulas
207 Exporting
209 * ASCII export::                Exporting to plain ASCII
210 * HTML export::                 Exporting to HTML
211 * XOXO export::                 Exporting to XOXO
212 * iCalendar export::            Exporting in iCalendar format
213 * Text interpretation::         How the exporter looks at the file
215 Text interpretation by the exporter
217 * Comment lines::               Some lines will not be exported
218 * Enhancing text::              Subscripts, symbols and more
219 * Export options::              How to influence the export settings
221 Publishing
223 * Configuration::               Defining projects
224 * Sample configuration::        Example projects
225 * Triggering publication::      Publication commands
227 Configuration
229 * Project alist::               The central configuration variable
230 * Sources and destinations::    From here to there
231 * Selecting files::             What files are part of the project?
232 * Publishing action::           Setting the function doing the publishing
233 * Publishing options::          Tweaking HTML export
234 * Publishing links::            Which links keep working after publishing?
235 * Project page index::          Publishing a list of project files
237 Sample configuration
239 * Simple example::              One-component publishing
240 * Complex example::             A multi-component publishing example
242 Miscellaneous
244 * Completion::                  M-TAB knows what you need
245 * Customization::               Adapting Org-mode to your taste
246 * In-buffer settings::          Overview of the #+KEYWORDS
247 * The very busy C-c C-c key::   When in doubt, press C-c C-c
248 * Clean view::                  Getting rid of leading stars in the outline
249 * TTY keys::                    Using Org-mode on a tty
250 * Interaction::                 Other Emacs packages
251 * Bugs::                        Things which do not work perfectly
253 Interaction with other packages
255 * Cooperation::                 Packages Org-mode cooperates with
256 * Conflicts::                   Packages that lead to conflicts
258 Extensions, Hooks and Hacking
260 * Extensions::                  Existing 3rd-part extensions
261 * Dynamic blocks::              Automatically filled blocks
263 @end detailmenu
264 @end menu
266 @node Introduction, Document structure, Top, Top
267 @chapter Introduction
268 @cindex introduction
270 @menu
271 * Summary::                     Brief summary of what Org-mode does
272 * Installation::                How to install Org-mode
273 * Feedback::                    Bug reports, ideas, patches etc.
274 @end menu
276 @node Summary, Installation, Introduction, Introduction
277 @section Summary
278 @cindex summary
280 Org-mode is a mode for keeping notes, maintaining ToDo lists, and doing
281 project planning with a fast and effective plain-text system.
283 Org-mode develops organizational tasks around NOTES files that contain
284 information about projects as plain text.  Org-mode is implemented on
285 top of outline-mode, which makes it possible to keep the content of
286 large files well structured.  Visibility cycling and structure editing
287 help to work with the tree.  Tables are easily created with a built-in
288 table editor.  Org-mode supports ToDo items, deadlines, time stamps,
289 and scheduling.  It dynamically compiles entries into an agenda that
290 utilizes and smoothly integrates much of the Emacs calendar and diary.
291 Plain text URL-like links connect to websites, emails, Usenet
292 messages, BBDB entries, and any files related to the projects.  For
293 printing and sharing of notes, an Org-mode file can be exported as a
294 structured ASCII file, as HTML, or (todo and agenda items only) as an
295 iCalendar file.  It can also serve as a publishing tool for a set of
296 linked webpages.
298 Org-mode keeps simple things simple.  When first fired up, it should
299 feel like a straightforward, easy to use outliner.  Complexity is not
300 imposed, but a large amount of functionality is available when you need
301 it.  Org-mode can be used on different levels and in different ways, for
302 example:
304 @example
305 @r{@bullet{} as an outline extension with visibility cycling and structure editing}
306 @r{@bullet{} as an ASCII system and table editor for taking structured notes}
307 @r{@bullet{} as an ASCII table editor with spreadsheet-like capabilities}
308 @r{@bullet{} as a TODO list editor}
309 @r{@bullet{} as a full agenda and planner with deadlines and work scheduling}
310 @r{@bullet{} as a simple hypertext system, with HTML export}
311 @r{@bullet{} as a publishing tool to create a set of interlinked webpages}
312 @end example
314 The Org-mode table editor can be integrated into any major mode by
315 activating the minor Orgtbl-mode.
317 @cindex FAQ
318 There is a website for Org-mode which provides links to the newest
319 version of Org-mode, as well as additional information, frequently asked
320 questions (FAQ), links to tutorials etc.  This page is located at
321 @uref{http://www.astro.uva.nl/~dominik/Tools/org/}.
323 @page
325 @node Installation, Feedback, Summary, Introduction
326 @section Installation and Activation
327 @cindex installation
328 @cindex autoload
329 @cindex global keybindings
330 @cindex keybindings, global
332 If Org-mode is part of the Emacs distribution or an XEmacs package,
333 you only need to copy the following lines to your @file{.emacs} file.
334 The last two lines define @emph{global} keys for the commands
335 @command{org-store-link} and @command{org-agenda} - please
336 choose suitable keys yourself.
338 @lisp
339 ;; The following lines are always needed.  Choose your own keys.
340 (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
341 (define-key global-map "\C-cl" 'org-store-link)
342 (define-key global-map "\C-ca" 'org-agenda)
343 @end lisp
345 Furthermore, you must activate @code{font-lock-mode} in org-mode
346 buffers, because significant functionality depends on font-locking being
347 active.  You can do this with either one of the following two lines:
348 @lisp
349 (global-font-lock-mode 1)                     ; for all buffers
350 (add-hook 'org-mode-hook 'turn-on-font-lock)  ; org-mode buffers only
351 @end lisp
353 If you have downloaded Org-mode from the Web, you must take additional
354 action:  Byte-compile @file{org.el} and @file{org-publish.el} and put
355 them together with @file{org-install.el} on your load path.  Then add to
356 @file{.emacs}:
358 @lisp
359 ;; This line only if org-mode is not part of the X/Emacs distribution.
360 (require 'org-install)
361 @end lisp
363 If you use Org-mode with XEmacs, you also need to install the file
364 @file{noutline.el} from the @file{xemacs} subdirectory of the Org-mode
365 distribution.
367 @cindex org-mode, turning on
368 With this setup, all files with extension @samp{.org} will be put into
369 Org-mode.  As an alternative, make the first line of a file look like
370 this:
372 @example
373 MY PROJECTS    -*- mode: org; -*-
374 @end example
376 @noindent which will select Org-mode for this buffer no matter what
377 the file's name is.  See also the variable
378 @code{org-insert-mode-line-in-empty-file}.
380 @node Feedback,  , Installation, Introduction
381 @section Feedback
382 @cindex feedback
383 @cindex bug reports
384 @cindex maintainer
385 @cindex author
387 If you find problems with Org-mode, or if you have questions, remarks,
388 or ideas about it, please contact the maintainer @value{MAINTAINER} at
389 @value{MAINTAINEREMAIL}.
391 For bug reports, please provide as much information as possible,
392 including the version information of Emacs (@kbd{C-h v emacs-version
393 @key{RET}}) and Org-mode (@kbd{C-h v org-version @key{RET}}), as well as
394 the Org-mode related setup in @file{.emacs}.  If an error occurs, a
395 traceback can be very useful.  Often a small example file helps, along
396 with clear information about:
398 @enumerate
399 @item What exactly did you do?
400 @item What did you expect to happen?
401 @item What happened instead?
402 @end enumerate
403 @noindent Thank you for helping to improve this mode.
405 @node Document structure, Tables, Introduction, Top
406 @chapter Document Structure
407 @cindex document structure
408 @cindex structure of document
410 Org-mode is based on outline mode and provides flexible commands to
411 edit the structure of the document.
413 @menu
414 * Outlines::                    Org-mode is based on outline-mode
415 * Headlines::                   How to typeset org-tree headlines
416 * Visibility cycling::          Show and hide, much simplified
417 * Motion::                      Jumping to other headlines
418 * Structure editing::           Changing sequence and level of headlines
419 * Archiving::                   Move done task trees to a different place
420 * Sparse trees::                Matches embedded in context
421 * Plain lists::                 Editing hand-formatted lists
422 @end menu
424 @node Outlines, Headlines, Document structure, Document structure
425 @section Outlines
426 @cindex outlines
427 @cindex outline-mode
429 Org-mode is implemented on top of outline-mode.  Outlines allow to
430 organize a document in a hierarchical structure, which (at least for
431 me) is the best representation of notes and thoughts.  Overview over
432 this structure is achieved by folding (hiding) large parts of the
433 document to show only the general document structure and the parts
434 currently being worked on.  Org-mode greatly simplifies the use of
435 outlines by compressing the entire show/hide functionality into a
436 single command @command{org-cycle}, which is bound to the @key{TAB}
437 key.
439 @node Headlines, Visibility cycling, Outlines, Document structure
440 @section Headlines
441 @cindex headlines
442 @cindex outline tree
444 Headlines define the structure of an outline tree.  The headlines in
445 Org-mode start with one or more stars, on the left margin.  For
446 example:
448 @example
449 * Top level headline
450 ** Second level
451 *** 3rd level
452     some text
453 *** 3rd level
454     more text
455 * Another top level headline
456 @end example
458 @noindent Some people find the many stars too noisy and would prefer an
459 outline that has whitespace followed by a single star as headline
460 starters.  @ref{Clean view} describes a setup to realize this.
462 @node Visibility cycling, Motion, Headlines, Document structure
463 @section Visibility cycling
464 @cindex cycling, visibility
465 @cindex visibility cycling
466 @cindex trees, visibility
467 @cindex show hidden text
468 @cindex hide text
470 Outlines make it possible to hide parts of the text in the buffer.
471 Org-mode uses just two commands, bound to @key{TAB} and
472 @kbd{S-@key{TAB}} to change the visibility in the buffer.
474 @cindex subtree visibility states
475 @cindex subtree cycling
476 @cindex folded, subtree visibility state
477 @cindex children, subtree visibility state
478 @cindex subtree, subtree visibility state
479 @table @kbd
480 @kindex @key{TAB}
481 @item @key{TAB}
482 @emph{Subtree cycling}: Rotate current subtree between the states
484 @example
485 ,-> FOLDED -> CHILDREN -> SUBTREE --.
486 '-----------------------------------'
487 @end example
489 The cursor must be on a headline for this to work@footnote{see, however,
490 the option @code{org-cycle-emulate-tab}.}.  When the cursor is at the
491 beginning of the buffer and the first line is not a headline, then
492 @key{TAB} actually runs global cycling (see below)@footnote{see the
493 option @code{org-cycle-global-at-bob}.}.  Also when called with a prefix
494 argument (@kbd{C-u @key{TAB}}), global cycling is invoked.
496 @cindex global visibility states
497 @cindex global cycling
498 @cindex overview, global visibility state
499 @cindex contents, global visibility state
500 @cindex show all, global visibility state
501 @kindex S-@key{TAB}
502 @item S-@key{TAB}
503 @itemx C-u @key{TAB}
504 @emph{Global cycling}: Rotate the entire buffer between the states
506 @example
507 ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
508 '--------------------------------------'
509 @end example
511 Note that inside tables, @kbd{S-@key{TAB}} jumps to the previous field.
513 @cindex show all, command
514 @kindex C-c C-a
515 @item C-c C-a
516 Show all.
517 @end table
519 When Emacs first visits an Org-mode file, the global state is set to
520 OVERVIEW, i.e. only the top level headlines are visible.  This can be
521 configured through the variable @code{org-startup-folded}, or on a
522 per-file basis by adding one of the following lines anywhere in the
523 buffer:
525 @example
526 #+STARTUP: overview
527 #+STARTUP: content
528 #+STARTUP: showall
529 @end example
531 @node Motion, Structure editing, Visibility cycling, Document structure
532 @section Motion
533 @cindex motion, between headlines
534 @cindex jumping, to headlines
535 @cindex headline navigation
536 The following commands jump to other headlines in the buffer.
538 @table @kbd
539 @kindex C-c C-n
540 @item C-c C-n
541 Next heading.
542 @kindex C-c C-p
543 @item C-c C-p
544 Previous heading.
545 @kindex C-c C-f
546 @item C-c C-f
547 Next heading same level.
548 @kindex C-c C-b
549 @item C-c C-b
550 Previous heading same level.
551 @kindex C-c C-u
552 @item C-c C-u
553 Backward to higher level heading.
554 @kindex C-c C-j
555 @item C-c C-j
556 Jump to a different place without changing the current outline
557 visibility.  Shows the document structure in a temporary buffer, where
558 you can use visibility cycling (@key{TAB}) to find your destination.
559 After pressing @key{RET}, the cursor moves to the selected location in
560 the original buffer, and the headings hierarchy above it is made
561 visible.
562 @end table
564 @node Structure editing, Archiving, Motion, Document structure
565 @section Structure editing
566 @cindex structure editing
567 @cindex headline, promotion and demotion
568 @cindex promotion, of subtrees
569 @cindex demotion, of subtrees
570 @cindex subtree, cut and paste
571 @cindex pasting, of subtrees
572 @cindex cutting, of subtrees
573 @cindex copying, of subtrees
574 @cindex subtrees, cut and paste
576 @table @kbd
577 @kindex M-@key{RET}
578 @item M-@key{RET}
579 Insert new heading with same level as current.  If the cursor is in a
580 plain list item, a new item is created (@pxref{Plain lists}).  To force
581 creation of a new headline, use a prefix arg, or first press @key{RET}
582 to get to the beginning of the next line.  When this command is used in
583 the middle of a line, the line is split and the rest of the line becomes
584 the new headline.  If the command is used at the beginning of a
585 headline, the new headline is created before the current line.  If at
586 the beginning of any other line, the content of that line is made the
587 new heading.
588 @kindex M-S-@key{RET}
589 @item M-S-@key{RET}
590 Insert new TODO entry with same level as current heading.
591 @kindex M-@key{left}
592 @item M-@key{left}
593 Promote current heading by one level.
594 @kindex M-@key{right}
595 @item M-@key{right}
596 Demote current heading by one level.
597 @kindex M-S-@key{left}
598 @item M-S-@key{left}
599 Promote the current subtree by one level.
600 @kindex M-S-@key{right}
601 @item M-S-@key{right}
602 Demote the current subtree by one level.
603 @kindex M-S-@key{up}
604 @item M-S-@key{up}
605 Move subtree up (swap with previous subtree of same
606 level).
607 @kindex M-S-@key{down}
608 @item M-S-@key{down}
609 Move subtree down (swap with next subtree of same level).
610 @kindex C-c C-x C-w
611 @kindex C-c C-x C-k
612 @item C-c C-x C-w
613 @itemx C-c C-x C-k
614 Kill subtree, i.e. remove it from buffer but save in kill ring.
615 @kindex C-c C-x M-w
616 @item C-c C-x M-w
617 Copy subtree to kill ring.
618 @kindex C-c C-x C-y
619 @item C-c C-x C-y
620 Yank subtree from kill ring.  This does modify the level of the subtree to
621 make sure the tree fits in nicely at the yank position.  The yank
622 level can also be specified with a prefix arg, or by yanking after a
623 headline marker like @samp{****}.
624 @end table
626 @cindex region, active
627 @cindex active region
628 @cindex transient-mark-mode
629 When there is an active region (transient-mark-mode), promotion and
630 demotion work on all headlines in the region.  To select a region of
631 headlines, it is best to place both point and mark at the beginning of a
632 line, mark at the beginning of the first headline, and point at the line
633 just after the last headline to change.  Note that when the cursor is
634 inside a table (@pxref{Tables}), the Meta-Cursor keys have different
635 functionality.
637 @node Archiving, Sparse trees, Structure editing, Document structure
638 @section Archiving
639 @cindex archiving
641 When a project represented by a (sub)tree is finished, you may want
642 to move the tree out of the way and to stop it from contributing to the
643 agenda.  Org-mode knows two ways of archiving.  You can mark a tree with
644 the ARCHIVE tag, or you can move an entire (sub)tree to a different
645 location.
647 @menu
648 * ARCHIVE tag::                 Marking a tree as inactive
649 * Moving subtrees::             Moving a tree to an archive file
650 @end menu
652 @node ARCHIVE tag, Moving subtrees, Archiving, Archiving
653 @subsection The ARCHIVE tag
654 @cindex internal archiving
656 A headline that is marked with the ARCHIVE tag (@pxref{Tags}) stays at
657 its location in the outline tree, but behaves in the following way:
658 @itemize @minus
659 @item
660 It does not open when you attempt to do so with a visibility cycling
661 command (@pxref{Visibility cycling}).  You can still open it with a
662 normal outline command like @code{show-all}.  Or you can modify the
663 option @code{org-cycle-open-archived-trees}.
664 @item
665 During sparse tree construction (@pxref{Sparse trees}), matches in
666 archived subtrees are not exposed, unless you configure the option
667 @code{org-sparse-tree-open-archived-trees}.
668 @item
669 During agenda view construction (@pxref{Agenda views}), the content of
670 archived trees is ignored unless you configure the option
671 @code{org-agenda-skip-archived-trees}.
672 @item
673 Archived trees are not exported (@pxref{Exporting}), only the headline
674 is.  Configure the details using the variable
675 @code{org-export-with-archived-trees}.
676 @end itemize
678 The following commands allow to set or clear the ARCHIVE tag:
680 @table @kbd
681 @kindex C-c C-x C-a
682 @item C-c C-x C-a
683 Toggle the ARCHIVE tag for the current headline.  When the tag is set,
684 the headline changes to a shadowish face, and the subtree below it is
685 hidden.
686 @kindex C-u C-c C-x C-a
687 @item C-u C-c C-x C-a
688 Check if any direct children of the current headline should be archived.
689 To do this, each subtree is checked for open TODO entries.  If none are
690 found, the command offers to set the ARCHIVE tag for the child.  If the
691 cursor is @emph{not} on a headline when this command is invoked, the
692 level 1 trees will be checked.
693 @end table
695 @node Moving subtrees,  , ARCHIVE tag, Archiving
696 @subsection Moving subtrees
697 @cindex external archiving
699 Once an entire project is finished, you may want to move it to a
700 different location, either in the current file, or even in a different
701 file, the archive file.
703 @table @kbd
704 @kindex C-c $
705 @item C-c $
706 Archive the subtree starting at the cursor position to the location
707 given by @code{org-archive-location}.
708 @kindex C-u C-c $
709 @item C-u C-c $
710 Check if any direct children of the current headline could be moved to
711 the archive.  To do this, each subtree is checked for open TODO entries.
712 If none are found, the command offers to move it to the archive
713 location.  If the cursor is @emph{not} on a headline when this command
714 is invoked, the level 1 trees will be checked.
715 @end table
717 @cindex archive locations
718 The default archive location is a file in the same directory as the
719 current file, with the name derived by appending @file{_archive} to the
720 current file name.  For information and examples on how to change this,
721 see the documentation string of the variable
722 @code{org-archive-location}.
724 @node Sparse trees, Plain lists, Archiving, Document structure
725 @section Sparse trees
726 @cindex sparse trees
727 @cindex trees, sparse
728 @cindex folding, sparse trees
729 @cindex occur, command
731 An important feature of Org-mode is the ability to construct
732 @emph{sparse trees} for selected information in an outline tree.  A
733 sparse tree means that the entire document is folded as much as
734 possible, but the selected information is made visible along with the
735 headline structure above it@footnote{See also the variables
736 @code{org-show-hierarchy-above} and
737 @code{org-show-following-heading}.}.  Just try it out and you will see
738 immediately how it works.
740 Org-mode contains several commands creating such trees.  The most
741 basic one is @command{org-occur}:
743 @table @kbd
744 @kindex C-c /
745 @item C-c /
746 Occur.  Prompts for a regexp and shows a sparse tree with all matches.
747 If the match is in a headline, the headline is made visible.  If the
748 match is in the body of an entry, headline and body are made visible.
749 In order to provide minimal context, also the full hierarchy of
750 headlines above the match is shown, as well as the headline following
751 the match.  Each match is also highlighted; the highlights disappear
752 when the buffer is changed with an editing command.
753 @end table
754 @noindent
755 For frequently used sparse trees of specific search strings, you can
756 use the variable @code{org-agenda-custom-commands} to define fast
757 keyboard access to specific sparse trees.  These commands will then be
758 accessible through the agenda dispatcher (@pxref{Agenda dispatcher}).
759 For example:
761 @lisp
762 (setq org-agenda-custom-commands
763       '(("f" occur-tree "FIXME")))
764 @end lisp
766 @noindent will define the key @kbd{C-c a f} as a shortcut for creating
767 a sparse tree matching the string @samp{FIXME}.
769 Other commands use sparse trees as well.  For example @kbd{C-c
770 C-v} creates a sparse TODO tree (@pxref{TODO basics}).
772 @kindex C-c C-x v
773 @cindex printing sparse trees
774 @cindex visible text, printing
775 To print a sparse tree, you can use the Emacs command
776 @code{ps-print-buffer-with-faces} which does not print invisible parts
777 of the document @footnote{This does not work under XEmacs, because
778 XEmacs uses selective display for outlining, not text properties.}.
779 Or you can use the command @kbd{C-c C-x v} to export only the visible
780 part of the document and print the resulting file.
783 @node Plain lists,  , Sparse trees, Document structure
784 @section Plain lists
785 @cindex plain lists
786 @cindex lists, plain
787 @cindex lists, ordered
788 @cindex ordered lists
790 Headlines define both the structure of the Org-mode file, and also lists
791 (for example, TODO items (@pxref{TODO items}) should be created using
792 headline levels).  When taking notes, however, the plain text is
793 sometimes easier to read with hand-formatted lists.  Org-mode supports
794 editing such lists, and the HTML exporter (@pxref{Exporting}) does
795 parse and format them.
797 Org-mode knows ordered and unordered lists.  Unordered list items start
798 with @samp{-}, @samp{+}, or @samp{*}@footnote{When using @samp{*} as a
799 bullet, lines must be indented or they will be seen as top-level
800 headlines.  Also, when you are hiding leading stars to get a clean
801 outline view, plain list items starting with a star are visually
802 indistinguishable from true headlines.  In short: even though @samp{*}
803 is supported, it may be better not to use it for plain list items} as
804 bullets.  Ordered list items start with @samp{1.} or @samp{1)}.  Items
805 belonging to the same list must have the same indentation on the first
806 line.  In particular, if an ordered list reaches number @samp{10.}, then
807 the 2--digit numbers must be written left-aligned with the other numbers
808 in the list.  Indentation also determines the end of a list item.  It
809 ends before the next line that is indented like the bullet/number, or
810 less.  For example:
812 @example
813 @group
814 ** Lord of the Rings
815 My favorite scenes are (in this order)
816 1. Eowyns fight with the witch king
817    + this was already my favorite scene in the book
818    + I really like Miranda Otto.
819 2. The attack of the Rohirrim
820 3. Peter Jackson being shot by Legolas
821     - on DVD only
822    He makes a really funny face when it happens.
823 But in the end, not individual scenes matter but the film as a whole.
824 @end group
825 @end example
827 Org-mode supports these lists by tuning filling and wrapping commands
828 to deal with them correctly.  
830 @cindex checkboxes
831 Every item in a plain list can be made a checkbox by starting it with
832 the string @samp{[ ]}.  The checkbox status can conveniently be toggled
833 with @kbd{C-c C-c}.
835 @example
836 * Stupid mistakes when distributing a new version
837   - [ ] update also Emacs CVS
838   - [X] forget to update index.html on the website
839   - [X] leaving a `(debug)' form in the code
840 @end example
842 The following commands act on items when the cursor is in the first line
843 of an item (the line with the bullet or number).
845 @table @kbd
846 @kindex @key{TAB}
847 @item @key{TAB}
848 Items can be folded just like headline levels if you set the variable
849 @code{org-cycle-include-plain-lists}.  The level of an item is then
850 given by the indentation of the bullet/number.  Items are always
851 subordinate to real headlines, however; the hierarchies remain
852 completely separated.
853 @kindex M-@key{RET}
854 @item M-@key{RET}
855 Insert new item at current level.  With prefix arg, force a new heading
856 (@pxref{Structure editing}).  If this command is used in the middle of a
857 line, the line is @emph{split} and the rest of the line becomes the new
858 item.  If this command is executed in the @emph{whitespace before a bullet or
859 number}, the new item is created @emph{before} the current item.  If the
860 command is executed in the white space before the text that is part of
861 an item but does not contain the bullet, a bullet is added to the
862 current line.
863 @kindex M-S-@key{RET}
864 @item M-S-@key{RET}
865 Insert a new item with a checkbox.
866 @kindex S-@key{up}
867 @kindex S-@key{down}
868 @item S-@key{up}
869 @itemx S-@key{down}
870 Jump to the previous/next item in the current list.
871 @kindex M-S-@key{up}
872 @kindex M-S-@key{down}
873 @item M-S-@key{up}
874 @itemx M-S-@key{down}
875 Move the item including subitems up/down (swap with previous/next item
876 of same indentation).  If the list is ordered, renumbering is
877 automatic.
878 @kindex M-S-@key{left}
879 @kindex M-S-@key{right}
880 @item M-S-@key{left}
881 @itemx M-S-@key{right}
882 Decrease/increase the indentation of the item, including subitems.
883 Initially, the item tree is selected based on current indentation.
884 When these commands are executed several times in direct succession,
885 the initially selected region is used, even if the new indentation
886 would imply a different hierarchy.  To use the new hierarchy, break
887 the command chain with a cursor motion or so.
888 @kindex C-c C-c
889 @item C-c C-c
890 If there is a checkbox in the item line, toggle the state of the
891 checkbox.  Otherwise, if this is an ordered list, renumber the ordered
892 list at the cursor.
893 @end table
896 @node Tables, Hyperlinks, Document structure, Top
897 @chapter Tables
898 @cindex tables
899 @cindex editing tables
901 Org-mode has a very fast and intuitive table editor built-in.
902 Spreadsheet-like calculations are supported in connection with the
903 Emacs @file{calc} package.
905 @menu
906 * Built-in table editor::       Simple tables
907 * Narrow columns::              Stop wasting space in tables   
908 * Table calculations::          Compute a field from other fields
909 * orgtbl-mode::                 The table editor as minor mode
910 * table.el::                    Complex tables
911 @end menu
913 @node Built-in table editor, Narrow columns, Tables, Tables
914 @section The built-in table editor
915 @cindex table editor, builtin
917 Org-mode makes it easy to format tables in plain ASCII.  Any line with
918 @samp{|} as the first non-white character is considered part of a
919 table.  @samp{|} is also the column separator.  A table might look
920 like this:
922 @example
923 | Name  | Phone | Age |
924 |-------+-------+-----|
925 | Peter |  1234 |  17 |
926 | Anna  |  4321 |  25 |
927 @end example
929 A table is re-aligned automatically each time you press @key{TAB} or
930 @key{RET} or @kbd{C-c C-c} inside the table.  @key{TAB} also moves to
931 the next field (@key{RET} to the next row) and creates new table rows
932 at the end of the table or before horizontal lines.  The indentation
933 of the table is set by the first line.  Any line starting with
934 @samp{|-} is considered as a horizontal separator line and will be
935 expanded on the next re-align to span the whole table width.  So, to
936 create the above table, you would only type
938 @example
939 |Name|Phone|Age
941 @end example
943 @noindent and then press @key{TAB} to align the table and start filling in
944 fields.
946 When typing text into a field, Org-mode treats @key{DEL},
947 @key{Backspace}, and all character keys in a special way, so that
948 inserting and deleting avoids shifting other fields.  Also, when
949 typing @emph{immediately after the cursor was moved into a new field
950 with @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the
951 field is automatically made blank.  If this behavior is too
952 unpredictable for you, configure the variables
953 @code{org-enable-table-editor} and @code{org-table-auto-blank-field}.
955 @table @kbd
956 @tsubheading{Creation and conversion}
957 @kindex C-c |
958 @item C-c |
959 Convert the active region to table. If every line contains at least one
960 TAB character, the function assumes that the material is tab separated.
961 If not, lines are split at whitespace into fields.  You can use a prefix
962 argument to indicate the minimum number of consecutive spaces required
963 to identify a field separator (default: just one).@* 
964 If there is no active region, this command creates an empty Org-mode
965 table.  But it's easier just to start typing, like
966 @kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}.
968 @tsubheading{Re-aligning and field motion}
969 @kindex C-c C-c
970 @item C-c C-c
971 Re-align the table without moving the cursor.
973 @kindex @key{TAB}
974 @item @key{TAB}
975 Re-align the table, move to the next field.  Creates a new row if
976 necessary.
978 @kindex S-@key{TAB}
979 @item S-@key{TAB}
980 Re-align, move to previous field.
982 @kindex @key{RET}
983 @item @key{RET}
984 Re-align the table and move down to next row.  Creates a new row if
985 necessary.  At the beginning or end of a line, @key{RET} still does
986 NEWLINE, so it can be used to split a table.
988 @tsubheading{Column and row editing}
989 @kindex M-@key{left}
990 @kindex M-@key{right}
991 @item M-@key{left}
992 @itemx M-@key{right}
993 Move the current column left/right.
995 @kindex M-S-@key{left}
996 @item M-S-@key{left}
997 Kill the current column.
999 @kindex M-S-@key{right}
1000 @item M-S-@key{right}
1001 Insert a new column to the left of the cursor position.
1003 @kindex M-@key{up}
1004 @kindex M-@key{down}
1005 @item M-@key{up}
1006 @itemx M-@key{down}
1007 Move the current row up/down.
1009 @kindex M-S-@key{up}
1010 @item M-S-@key{up}
1011 Kill the current row or horizontal line.
1013 @kindex M-S-@key{down}
1014 @item M-S-@key{down}
1015 Insert a new row above (with arg: below) the current row.
1017 @kindex C-c -
1018 @item C-c -
1019 Insert a horizontal line below current row. With prefix arg, the line
1020 is created above the current line.
1022 @kindex C-c ^
1023 @item C-c ^
1024 Sort the table lines in the region.  Point and mark must be in the first
1025 and last line to be included, and must be in the column that should be
1026 used for sorting.  The command prompts for numerical versus
1027 alphanumerical sorting.
1029 @tsubheading{Regions}
1030 @kindex C-c C-x M-w
1031 @item C-c C-x M-w
1032 Copy a rectangular region from a table to a special clipboard.  Point
1033 and mark determine edge fields of the rectangle.  The process ignores
1034 horizontal separator lines.
1035 @kindex C-c C-x C-w
1036 @item C-c C-x C-w
1037 Copy a rectangular region from a table to a special clipboard, and
1038 blank all fields in the rectangle.  So this is the ``cut'' operation.
1039 @kindex C-c C-x C-y
1040 @item C-c C-x C-y
1041 Paste a rectangular region into a table.
1042 The upper right corner ends up in the current field.  All involved fields
1043 will be overwritten.  If the rectangle does not fit into the present table,
1044 the table is enlarged as needed.  The process ignores horizontal separator
1045 lines.
1046 @kindex C-c C-q
1047 @item C-c C-q
1048 Wrap several fields in a column like a paragraph.  If there is an active
1049 region, and both point and mark are in the same column, the text in the
1050 column is wrapped to minimum width for the given number of lines.  A
1051 prefix ARG may be used to change the number of desired lines.  If there
1052 is no region, the current field is split at the cursor position and the
1053 text fragment to the right of the cursor is prepended to the field one
1054 line down. If there is no region, but you specify a prefix ARG, the
1055 current field is made blank, and the content is appended to the field
1056 above.
1058 @tsubheading{Calculations}
1059 @cindex formula, in tables
1060 @cindex calculations, in tables
1061 @kindex C-c =
1062 @item C-c =
1063 Install a new formula for the current column and replace current field
1064 with the result of the formula.
1066 @kindex C-u C-c =
1067 @item C-u C-c =
1068 Install a new formula for the current field, which must be a named
1069 field.  Evaluate the formula and replace the field content with the
1070 result.
1072 @kindex C-c '
1073 @item C-c '
1074 Edit all formulas associated with the current table in a separate
1075 buffer.
1077 @kindex C-c *
1078 @item C-c *
1079 Recalculate the current row by applying the stored formulas from left
1080 to right.  When called with a @kbd{C-u} prefix, recalculate the
1081 entire table, starting with the first non-header line (i.e. below the
1082 first horizontal separator line).  For details, see @ref{Table calculations}.
1084 @kindex C-#
1085 @item C-#
1086 Rotate the calculation mark in first column through the states
1087 @samp{}, @samp{#}, @samp{*}, @samp{!}, @samp{$}.  For the meaning of
1088 these marks see @ref{Advanced features}.  When there is an active
1089 region, change all marks in the region.
1091 @kindex C-c ?
1092 @item C-c ?
1093 Which table column is the cursor in?  Displays number >0 in echo
1094 area.
1096 @cindex region, active
1097 @cindex active region
1098 @cindex transient-mark-mode
1099 @kindex C-c +
1100 @item C-c +
1101 Sum the numbers in the current column, or in the rectangle defined by
1102 the active region.  The result is shown in the echo area and can
1103 be inserted with @kbd{C-y}.
1105 @kindex S-@key{RET}
1106 @item S-@key{RET}
1107 When current field is empty, copy from first non-empty field above.
1108 When not empty, copy current field down to next row and move cursor
1109 along with it.  Depending on the variable
1110 @code{org-table-copy-increment}, integer field values will be
1111 incremented during copy.  This key is also used by CUA-mode
1112 (@pxref{Cooperation}).
1114 @tsubheading{Miscellaneous}
1115 @kindex C-c `
1116 @item C-c `
1117 Edit the current field in a separate window.  This is useful for fields
1118 that are not fully visible (@pxref{Narrow columns}).  When called with a
1119 @kbd{C-u} prefix, just make the full field visible, so that it can be
1120 edited in place.
1122 @kindex C-c @key{TAB}
1123 @item C-c @key{TAB}
1124 This is an alias for @kbd{C-u C-c `} to make the current field fully
1125 visible.
1127 @item M-x org-table-import
1128 Import a file as a table.  The table should be TAB- or whitespace
1129 separated.  Useful, for example, to import an Excel table or data from a
1130 database, because these programs generally can write TAB-separated text
1131 files.  This command works by inserting the file into the buffer and
1132 then converting the region to a table.  Any prefix argument is passed on
1133 to the converter, which uses it to determine the separator.
1135 @item M-x org-table-export
1136 Export the table as a TAB-separated file.  Useful for data exchange with,
1137 for example, Excel or database programs.
1139 @end table
1141 If you don't like the automatic table editor because it gets in your
1142 way on lines which you would like to start with @samp{|}, you can turn
1143 it off with
1145 @lisp
1146 (setq org-enable-table-editor nil)
1147 @end lisp
1149 @noindent Then the only table command that still works is
1150 @kbd{C-c C-c} to do a manual re-align.
1152 @node Narrow columns, Table calculations, Built-in table editor, Tables
1153 @section Narrow columns
1154 @cindex narrow columns in tables
1156 The width of columns is automatically determined by the table editor.
1157 Sometimes a single field or a few fields need to carry more text,
1158 leading to inconveniently wide columns.  To limit@footnote{This feature
1159 does not work on XEmacs.} the width of a column, one field anywhere in
1160 the column may contain just the string @samp{<N>} where @samp{N} is an
1161 integer specifying the width of the column in characters.  The next
1162 re-align will then set the width of this column to no more than this
1163 value.
1165 @example
1166 |---+------------------------------|               |---+--------|
1167 |   |                              |               |   | <6>    |
1168 | 1 | one                          |               | 1 | one    |
1169 | 2 | two                          |     ----\     | 2 | two    |
1170 | 3 | This is a long chunk of text |     ----/     | 3 | This=> |
1171 | 4 | four                         |               | 4 | four   |
1172 |---+------------------------------|               |---+--------|
1173 @end example
1175 @noindent
1176 Fields that are wider become clipped and end in the string @samp{=>}.
1177 Note that the full text is still in the buffer, it is only invisible.
1178 To see the full text, hold the mouse over the field - a tooltip window
1179 will show the full content.  To edit such a field, use the command
1180 @kbd{C-c `} (that is @kbd{C-c} followed by the backquote).  This will
1181 open a new window with the full field.  Edit it and finish with @kbd{C-c
1182 C-c}.
1184 When visiting a file containing a table with narrowed columns, the
1185 necessary character hiding has not yet happened, and the table needs to
1186 be aligned before it looks nice.  Setting the option
1187 @code{org-startup-align-all-tables} will realign all tables in a file
1188 upon visiting, but also slow down startup.  You can also set this option
1189 on a per-file basis with:
1191 @example
1192 #+STARTUP: align
1193 #+STARTUP: noalign
1194 @end example
1196 @node Table calculations, orgtbl-mode, Narrow columns, Tables
1197 @section Calculations in tables
1198 @cindex calculations, in tables
1199 @cindex spreadsheet capabilities
1200 @cindex @file{calc} package
1202 The table editor makes use of the Emacs @file{calc} package to implement
1203 spreadsheet-like capabilities.  It can also evaluate Emacs Lisp forms to
1204 derive fields from other fields.  Org-mode has two levels of complexity
1205 for table calculations.  On the basic level, tables do only horizontal
1206 computations, so a field can be computed from other fields @emph{in the
1207 same row}, and Org-mode assumes that there is only one formula for each
1208 column.  This is very efficient to work with and enough for many tasks.
1209 On the complex level, columns and individual fields can be named for
1210 easier referencing in formulas, individual named fields can have their
1211 own formula associated with them, and recalculation can be automated.
1213 @menu
1214 * Formula syntax::              How to write a formula
1215 * Lisp formulas::               An alternative way to write formulas
1216 * Column formulas::             Formulas valid for all fields in a column
1217 * Advanced features::           Field names, parameters and automatic recalc
1218 * Named-field formulas::        Formulas valid in single fields
1219 * Editing/debugging formulas::  Changing a stored formula
1220 * Appetizer::                   Taste the power of calc
1221 @end menu
1223 @node Formula syntax, Lisp formulas, Table calculations, Table calculations
1224 @subsection Formula syntax
1225 @cindex formula syntax
1226 @cindex syntax, of formulas
1228 A formula can be any algebraic expression understood by the Emacs
1229 @file{calc} package.  Note that @file{calc} has the slightly
1230 non-standard convention that @samp{/} has lower precedence than
1231 @samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.  Before
1232 evaluation by @code{calc-eval} (@pxref{Calling Calc from Your
1233 Programs,calc-eval,Calling calc from Your Lisp Programs,calc,GNU Emacs
1234 Calc Manual}), variable substitution takes place:
1236 @example
1237   $        @r{refers to the current field}
1238   $3       @r{refers to the field in column 3 of the current row}
1239   $3..$7   @r{a vector of the fields in columns 3-7 of current row}
1240   $P1..$P3 @r{vector of column range, using column names}
1241   &2       @r{second data field above the current, in same column}
1242   &5-2     @r{vector from fifth to second field above current}
1243   &III-II  @r{vector of fields between 2nd and 3rd hline above}
1244   &III     @r{vector of fields between third hline above and current field}
1245   $name    @r{a named field, parameter or constant}
1246 @end example
1248 @cindex vectors, in table calculations
1249 The range vectors can be directly fed into the calc vector functions
1250 like @samp{vmean} and @samp{vsum}.
1252 @cindex name, of column or field
1253 @cindex constants, in calculations
1254 @samp{$name} is interpreted as the name of a column, parameter or
1255 constant.  Constants are defined globally through the variable
1256 @code{org-table-formula-constants}.  If you have the
1257 @file{constants.el} package, it will also be used to resolve
1258 constants, including natural constants like @samp{$h} for Planck's
1259 constant, and units like @samp{$km} for kilometers.  Column names and
1260 parameters can be specified in special table lines.  These are
1261 described below, see @ref{Advanced features}.
1263 @cindex format specifier
1264 @cindex mode, for @file{calc}
1265 A formula can contain an optional mode string after a semicolon.  This
1266 string consists of flags to influence calc's modes@footnote{By
1267 default, Org-mode uses the standard calc modes (precision 12, angular
1268 units degrees, fraction and symbolic modes off).  The display format,
1269 however, has been changed to @code{(float 5)} to keep tables compact.
1270 The default settings can be configured using the variable
1271 @code{org-calc-default-modes}.} during execution, e.g.  @samp{p20} to
1272 switch the internal precision to 20 digits, @samp{n3}, @samp{s3},
1273 @samp{e2} or @samp{f4} to switch to normal, scientific, engineering,
1274 or fixed display format, respectively, and @samp{D}, @samp{R}, @samp{F},
1275 and @samp{S} to turn on degrees, radians, fraction and symbolic modes,
1276 respectively.  In addition, you may provide a @code{printf} format
1277 specifier to reformat the final result.  A few examples:
1279 @example
1280 $1+$2                @r{Sum of first and second field}
1281 $1+$2;%.2f           @r{Same, format result to two decimals}
1282 exp($2)+exp($1)      @r{Math functions can be used}
1283 $;%.1f               @r{Reformat current cell to 1 decimal}
1284 ($3-32)*5/9          @r{Degrees F -> C conversion}
1285 $c/$1/$cm            @r{Hz -> cm conversion, using @file{constants.el}}
1286 tan($1);Dp3s1        @r{Compute in degrees, precision 3, display SCI 1}
1287 sin($1);Dp3%.1e      @r{Same, but use printf specifier for display}
1288 vmean($2..$7)        @r{Compute column range mean, using vector function}
1289 vsum(&III)           @r{Sum numbers from 3rd hline above, up to here}
1290 taylor($3,x=7,2)     @r{taylor series of $3, at x=7, second degree}
1291 @end example
1293 @node Lisp formulas, Column formulas, Formula syntax, Table calculations
1294 @subsection Emacs Lisp forms as formulas
1295 @cindex Lisp forms, as table formulas
1297 It is also possible to write a formula in Emacs lisp; this can be useful
1298 for string manipulation and control structures.  If a formula starts
1299 with a single quote followed by an opening parenthesis, then it is
1300 evaluated as a lisp form.  The evaluation should return either a string
1301 or a number.  Just as with @file{calc} formulas, you can provide a
1302 format specifier after a semicolon.  A few examples:
1304 @example
1305 @r{swap the first two characters of the content of column 1}
1306 '(concat (substring "$1" 1 2) (substring "$1" 0 1) (substring "$1" 2))
1307 @r{Add columns 1 and 2, equivalent to the calc's @code{$1+$2}}
1308 '(+ $1 $2)
1309 @end example
1311 @node Column formulas, Advanced features, Lisp formulas, Table calculations
1312 @subsection Column formulas
1313 @cindex column formula
1314 @cindex formula, for table column
1316 To apply a formula to a field, type it directly into the field,
1317 preceded by an equal sign, like @samp{=$1+$2}.  When you press
1318 @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in the
1319 field, the formula will be stored as the formula for the current
1320 column, evaluated and the current field replaced with the result.  If
1321 the field contains only @samp{=}, the previously stored formula for
1322 this column is used.
1324 For each column, Org-mode will remember the most recently used
1325 formula.  The information is stored in a special line starting with
1326 @samp{#+TBLFM} directly below the table.  When adding/deleting/moving
1327 columns with the appropriate commands, the stored equations will be
1328 modified accordingly.  When a column used in a calculation is removed,
1329 references to this column become invalid and will cause an error upon
1330 applying the equation.
1332 Instead of typing an equation into the field, you may also use the
1333 command @kbd{C-c =}.  It prompts for a formula (with default taken
1334 from the @samp{#+TBLFM:} line) and applies it to the current field.  A
1335 numerical prefix (e.g. @kbd{C-5 C-c =}) will apply it to that many
1336 consecutive fields in the current column.
1338 @cindex recomputing table fields
1339 To recompute all the fields in a line, use the command @kbd{C-c *}.
1340 It re-applies all stored equations to the current row, from left to
1341 right.  With a @kbd{C-u} prefix, this will be done to every line in
1342 the table, so use this command it you want to make sure the entire
1343 table is up-to-date. @kbd{C-u C-c C-c} is another way to update the
1344 entire table.  Global updating does not touch the line(s) above the
1345 first horizontal separator line, assuming that this is the table
1346 header.
1348 @node Advanced features, Named-field formulas, Column formulas, Table calculations
1349 @subsection Advanced features
1351 If you want the recalculation of fields to happen automatically,
1352 or if you want to be able to assign a formula to an individual field
1353 (instead of an entire column) you need to reserve the first column of
1354 the table for special marking characters.  Here is an example of a
1355 table that collects exam results of students and makes use of these
1356 features:
1358 @example
1359 @group
1360 |---+---------+--------+--------+--------+-------+------|
1361 |   | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
1362 |---+---------+--------+--------+--------+-------+------|
1363 | ! |         |     P1 |     P2 |     P3 |   Tot |      |
1364 | # | Maximum |     10 |     15 |     25 |    50 | 10.0 |
1365 | ^ |         |     m1 |     m2 |     m3 |    mt |      |
1366 |---+---------+--------+--------+--------+-------+------|
1367 | # | Peter   |     10 |      8 |     23 |    41 |  8.2 |
1368 | # | Sara    |      6 |     14 |     19 |    39 |  7.8 |
1369 | # | Sam     |      2 |      4 |      3 |     9 |  1.8 |
1370 |---+---------+--------+--------+--------+-------+------|
1371 |   | Average |        |        |        |  29.7 |      |
1372 | ^ |         |        |        |        |    at |      |
1373 | $ | max=50  |        |        |        |       |      |
1374 |---+---------+--------+--------+--------+-------+------|
1375 #+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(&II);%.1f
1376 @end group
1377 @end example
1379 @noindent @b{Important}: Please note that for these special tables,
1380 recalculating the table with @kbd{C-u C-c *} will only affect rows
1381 that are marked @samp{#} or @samp{*}, and named fields.  The column
1382 formulas are not applied in rows with empty first field.
1384 @cindex marking characters, tables
1385 The marking characters have the following meaning:
1386 @table @samp
1387 @item !
1388 The fields in this line define names for the columns, so that you may
1389 refer to a column as @samp{$Tot} instead of @samp{$6}.
1390 @item ^
1391 This row defines names for the fields @emph{above} the row.  With such
1392 a definition, any formula in the table may use @samp{$m1} to refer to
1393 the value @samp{10}.  Also, named fields can have their own formula
1394 associated with them.
1395 @item _
1396 Similar to @samp{^}, but defines names for the fields in the row
1397 @emph{below}.
1398 @item $
1399 Fields in this row can define @emph{parameters} for formulas.  For
1400 example, if a field in a @samp{$} row contains @samp{max=50}, then
1401 formulas in this table can refer to the value 50 using @samp{$max}.
1402 Parameters work exactly like constants, only that they can be defined on
1403 a per-table basis.  Changing a parameter and then recalculating the
1404 table can be useful.
1405 @item #
1406 Fields in this row are automatically recalculated when pressing
1407 @key{TAB} or @key{RET} or @kbd{S-@key{TAB}} in this row.  Also, this row
1408 is selected for a global recalculation with @kbd{C-u C-c *}.  Unmarked
1409 lines will be left alone by this command.
1410 @item *
1411 Selects this line for global recalculation with @kbd{C-u C-c *}, but
1412 not for automatic recalculation.  Use this when automatic
1413 recalculation slows down editing too much.
1414 @item
1415 Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}.
1416 All lines that should be recalculated should be marked with @samp{#}
1417 or @samp{*}.
1418 @end table
1420 @node Named-field formulas, Editing/debugging formulas, Advanced features, Table calculations
1421 @subsection Named-field formulas
1422 @cindex named field formula
1423 @cindex formula, for named table field
1425 A named field can have its own formula associated with it.  In the
1426 example above, this is used for the @samp{at} field that contains
1427 the average result of the students.  To enter a formula for a named
1428 field, just type it into the buffer, preceded by @samp{:=}.  Or use
1429 @kbd{C-u C-c =}.  This equation will be stored below the table like
1430 @samp{$name=...}.  Any recalculation in the table (even if only
1431 requested for the current line) will also update all named field
1432 formulas.
1434 @node Editing/debugging formulas, Appetizer, Named-field formulas, Table calculations
1435 @subsection Editing and debugging formulas
1436 @cindex formula editing
1437 @cindex editing, of table formulas
1439 To edit a column or field formula, use the commands @kbd{C-c
1440 =} and @kbd{C-u C-c =}, respectively.  The currently active expression
1441 is then presented as default in the minibuffer, where it may be edited.
1443 Note that making a table field blank does not remove the formula
1444 associated with the field - during the next recalculation the field
1445 will be filled again.  To remove a formula from a field, you have to
1446 give an empty reply when prompted for the formula, or to edit the
1447 @samp{#+TBLFM} line.
1449 @kindex C-c C-c
1450 You may edit the @samp{#+TBLFM} directly and re-apply
1451 the changed equations with @kbd{C-c C-c} in that line, or with the
1452 normal recalculation commands in the table.
1454 @kindex C-c '
1455 @kindex C-c C-c
1456 @kindex C-c C-q
1457 @kindex C-c ?
1458 In particular for large tables with many formulas, it is convenient to
1459 use the command @kbd{C-c '} to edit the formulas of the current table
1460 in a separate buffer.  That buffer will show the formulas one per
1461 line, and you are free to edit, add and remove formulas.  Press
1462 @kbd{C-c ?} on a @samp{$...}  expression to get information about its
1463 interpretation.  Exiting the buffer with @kbd{C-c C-c} only stores the
1464 modified formulas below the table.  Exiting with @kbd{C-u C-c C-c}
1465 also applies them to the entire table.  @kbd{C-c C-q} exits without
1466 installing the changes.
1468 When the evaluation of a formula leads to an error, the field content
1469 becomes the string @samp{#ERROR}.  If you would like see what is going
1470 on during variable substitution and calculation in order to find a
1471 bug, turn on formula debugging in the menu and repeat the calculation,
1472 for example by pressing @kbd{C-c = @key{RET}} in a field.
1473 Detailed information will be displayed.
1475 @node Appetizer,  , Editing/debugging formulas, Table calculations
1476 @subsection Appetizer
1478 Finally, just to whet your appetite on what can be done with the fantastic
1479 @file{calc} package, here is a table that computes the Taylor series
1480 for a couple of functions (homework: try that with Excel :-)
1482 @example
1483 @group
1484 |---+-------------+---+-----+--------------------------------------|
1485 |   | Func        | n | x   | Result                               |
1486 |---+-------------+---+-----+--------------------------------------|
1487 | # | exp(x)      | 1 | x   | 1 + x                                |
1488 | # | exp(x)      | 2 | x   | 1 + x + x^2 / 2                      |
1489 | # | exp(x)      | 3 | x   | 1 + x + x^2 / 2 + x^3 / 6            |
1490 | # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 |
1491 | # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2    |
1492 | * | tan(x)      | 3 | x   | 0.0175 x + 1.77e-6 x^3               |
1493 |---+-------------+---+-----+--------------------------------------|
1494 #+TBLFM: $5=taylor($2,$4,$3);n3
1495 @end group
1496 @end example
1498 @node orgtbl-mode, table.el, Table calculations, Tables
1499 @section The Orgtbl minor mode
1500 @cindex orgtbl-mode
1501 @cindex minor mode for tables
1503 If you like the intuitive way the Org-mode table editor works, you
1504 might also want to use it in other modes like text-mode or mail-mode.
1505 The minor mode Orgtbl-mode makes this possible.  You can always toggle
1506 the mode with @kbd{M-x orgtbl-mode}.  To turn it on by default, for
1507 example in mail mode, use
1509 @lisp
1510 (add-hook 'mail-mode-hook 'turn-on-orgtbl)
1511 @end lisp
1513 @node table.el,  , orgtbl-mode, Tables
1514 @section The @file{table.el} package
1515 @kindex C-c C-c
1516 @cindex table editor, @file{table.el}
1517 @cindex @file{table.el}
1519 Complex ASCII tables with automatic line wrapping, column- and
1520 row-spanning, and alignment can be created using the Emacs table
1521 package by Takaaki Ota (@uref{http://sourceforge.net/projects/table},
1522 and also part of Emacs 22).
1523 When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org-mode
1524 will call @command{table-recognize-table} and move the cursor into the
1525 table.  Inside a table, the keymap of Org-mode is inactive.  In order
1526 to execute Org-mode-related commands, leave the table.
1528 @table @kbd
1529 @kindex C-c C-c
1530 @item C-c C-c
1531 Recognize @file{table.el} table.  Works when the cursor is in a
1532 table.el table.
1534 @kindex C-c ~
1535 @item C-c ~
1536 Insert a table.el table.  If there is already a table at point, this
1537 command converts it between the table.el format and the Org-mode
1538 format.  See the documentation string of the command
1539 @code{org-convert-table} for the restrictions under which this is
1540 possible.
1541 @end table
1543 @node Hyperlinks, TODO items, Tables, Top
1544 @chapter Hyperlinks
1545 @cindex hyperlinks
1547 Just like HTML, Org-mode provides links inside a file, and external
1548 links to other files, Usenet articles, emails, and much more.
1550 @menu
1551 * Link format::                 How links in Org-mode are formatted
1552 * Internal links::              Links to other places in the current file
1553 * External links::              URL-like links to the world
1554 * Handling links::              Creating, inserting and following
1555 * Search options::              Linking to a specific location
1556 * Custom searches::             When the default search is not enough
1557 * Remember::                    Org-trees store quick notes
1558 @end menu
1560 @node Link format, Internal links, Hyperlinks, Hyperlinks
1561 @section Link format
1562 @cindex link format
1563 @cindex format, of links
1565 Org-mode will recognize plain URL-like links and activate them as
1566 clickable links.  The general link format, however, looks like this:
1568 @example
1569 [[link][description]]       @r{or alternatively}           [[link]]  
1570 @end example
1572 Once a link in the buffer is complete (all brackets present), Org-mode
1573 will change the display so that @samp{description} is displayed instead
1574 of @samp{[[link][description]]} and @samp{link} is displayed instead of
1575 @samp{[[link]]}.  Links will be highlighted in the face @code{org-link},
1576 which by default is an underlined face.  You can directly edit the
1577 visible part of a link.  Note that this can be either the @samp{link}
1578 part (if there is no description) or the @samp{description} part.  To
1579 edit also the invisible @samp{link} part, use @kbd{C-c C-l} with the
1580 cursor on the link.
1582 If you place the cursor at the beginning or just behind the end of the
1583 displayed text and press @key{BACKSPACE}, you will remove the
1584 (invisible) bracket at that location.  This makes the link incomplete
1585 and the internals are again displayed as plain text.  Inserting the
1586 missing bracket hides the link internals again.  To show the
1587 internal structure of all links, use the menu entry
1588 @code{Org->Hyperlinks->Literal links}.
1590 @node Internal links, External links, Link format, Hyperlinks
1591 @section Internal links
1592 @cindex internal links
1593 @cindex links, internal
1594 @cindex CamelCase links
1596 If the link does not look like a URL, it is considered to be internal in
1597 the current file.  Links such as @samp{[[My Target]]} or @samp{[[My
1598 Target][Find my target]]} lead to a text search in the current file.
1599 The link can be followed with @kbd{C-c C-o} when the cursor is on the
1600 link, or with a mouse click (@pxref{Handling links}).  The preferred
1601 match for such a link is a dedicated target: the same string in double
1602 angular brackets.  Targets may be located anywhere; often it is
1603 convenient to put them into a comment line. For example
1605 @example
1606 # <<My Target>>
1607 @end example
1609 @noindent In HTML export (@pxref{HTML export}), such targets will become
1610 named anchors for direct access through @samp{http} links@footnote{Note
1611 that text before the first headline will never be exported, so the first
1612 such target must be after the first headline.}.
1614 If no dedicated target exists, Org-mode will search for the words in the
1615 link.  In the above example the search would be for @samp{my target}.
1616 Links starting with a star like @samp{*My Target} restrict the search to
1617 headlines.  When searching, Org-mode will first try an exact match, but
1618 then move on to more and more lenient searches.  For example, the link
1619 @samp{[[*My Targets]]} will find any of the following:
1621 @example
1622 ** My targets
1623 ** TODO my targets are bright
1624 ** my 20 targets are
1625 @end example
1627 To insert a link targeting a headline, in-buffer completion can be used.
1628 Just type a star followed by a few optional letters into the buffer and
1629 press @kbd{M-@key{TAB}}.  All headlines in the current buffer will be
1630 offered as completions.  @xref{Handling links}, for more commands
1631 creating links.
1633 Following a link pushes a mark onto Org-mode's own mark ring.  You can
1634 return to the previous position with @kbd{C-c &}.  Using this command
1635 several times in direct succession goes back to positions recorded
1636 earlier.
1638 @menu
1639 * Radio targets::               Make targets trigger links in plain text.
1640 * CamelCase links::             Activating CamelCase words as links
1641 @end menu
1643 @node Radio targets, CamelCase links, Internal links, Internal links
1644 @subsection Radio targets
1646 You can configure Org-mode to link any occurrences of certain target
1647 names in normal text.  So without explicitly creating a link, the text
1648 connects to the target radioing its position.  Radio targets are
1649 enclosed by triple angular brackets.  For example, a target
1650 @samp{<<<My Target>>>} causes each occurrence of @samp{my target} in
1651 normal text to become activated as a link.  The Org-mode file is
1652 scanned automatically for radio targets only when the file is first
1653 loaded into Emacs.  To update the target list during editing, press
1654 @kbd{C-c C-c} with the cursor on or at a target.
1656 @node CamelCase links,  , Radio targets, Internal links
1657 @subsection CamelCase words as links
1658 @cindex completion, of CamelCase links
1659 @cindex CamelCase links, completion of
1661 Org-mode also supports CamelCase words as links.  This feature is not
1662 turned on by default because of the inconsistencies this system suffers
1663 from.  To activate CamelCase words as links, you need to customize
1664 the option @code{org-activate-links}.  A CamelCase word then leads to a
1665 text search such that @samp{CamelCaseLink} is equivalent to
1666 @samp{[[camel case link]]}.
1668 @node External links, Handling links, Internal links, Hyperlinks
1669 @section External links
1670 @cindex links, external
1671 @cindex external links
1672 @cindex links, external
1673 @cindex GNUS links
1674 @cindex BBDB links
1675 @cindex URL links
1676 @cindex file links
1677 @cindex VM links
1678 @cindex RMAIL links
1679 @cindex WANDERLUST links
1680 @cindex MH-E links
1681 @cindex USENET links
1682 @cindex SHELL links
1683 @cindex Info links
1684 @cindex elisp links
1686 Org-mode supports links to files, websites, Usenet and email messages,
1687 and BBDB database entries.  External links are URL-like locators.  They
1688 start with a short identifying string followed by a colon.  There can be
1689 no space after the colon.  The following list shows examples for each
1690 link type.
1692 @example
1693 http://www.astro.uva.nl/~dominik          @r{on the web}
1694 file:/home/dominik/images/jupiter.jpg     @r{file, absolute path}
1695 file:papers/last.pdf                      @r{file, relative path}
1696 news:comp.emacs                           @r{Usenet link}
1697 mailto:adent@@galaxy.net                   @r{Mail link}
1698 vm:folder                                 @r{VM folder link}
1699 vm:folder#id                              @r{VM message link}
1700 vm://myself@@some.where.org/folder#id      @r{VM on remote machine}
1701 wl:folder                                 @r{WANDERLUST folder link}
1702 wl:folder#id                              @r{WANDERLUST message link}
1703 mhe:folder                                @r{MH-E folder link}
1704 mhe:folder#id                             @r{MH-E message link}
1705 rmail:folder                              @r{RMAIL folder link}
1706 rmail:folder#id                           @r{RMAIL message link}
1707 gnus:group                                @r{GNUS group link}
1708 gnus:group#id                             @r{GNUS article link}
1709 bbdb:Richard Stallman                     @r{BBDB link}
1710 shell:ls *.org                            @r{A shell command}
1711 elisp:(find-file-other-frame "Elisp.org") @r{An elisp form to evaluate}
1712 @end example
1714 A link should be enclosed in double brackets and may contain a
1715 descriptive text to be displayed instead of the url (@pxref{Link
1716 format}), for example:
1718 @example
1719 [[http://www.gnu.org/software/emacs/][GNU Emacs]]
1720 @end example
1722 @cindex angular brackets, around links
1723 @cindex plain text external links
1724 Org-mode also finds external links in the normal text and activates them
1725 as links.  If spaces must be part of the link (for example in
1726 @samp{bbdb:Richard Stallman}), or you need to remove ambiguities about the end of
1727 the link, enclose them in angular brackets.
1729 @node Handling links, Search options, External links, Hyperlinks
1730 @section Handling links
1732 Org-mode provides methods to create a link in the correct syntax, to
1733 insert it into an org-mode file, and to follow the link.
1735 @table @kbd
1736 @kindex C-c l
1737 @cindex storing links
1738 @item C-c l
1739 Store a link to the current location.  This is a @emph{global} command
1740 which can be used in any buffer to create a link.  The link will be
1741 stored for later insertion into an Org-mode buffer (see below).  For
1742 Org-mode files, if there is a @samp{<<target>>} at the cursor, the link
1743 points to the target.  Otherwise it points to the current headline.  For
1744 VM, RMAIL, WANDERLUST, MH-E, GNUS and BBDB buffers, the link will
1745 indicate the current article/entry.  For W3 and W3M buffers, the link
1746 goes to the current URL.  For any other files, the link will point to
1747 the file, with a search string (@pxref{Search options}) pointing to the
1748 contents of the current line.  If there is an active region, the
1749 selected words will form the basis of the search string.  If the
1750 automatically created link is not working correctly or accurately
1751 enough, you can write custom functions to select the search string and
1752 to do the search for particular file types - see @ref{Custom searches}.
1753 The key binding @kbd{C-c l} is only a suggestion - see @ref{Installation}.
1755 @kindex C-c C-l
1756 @cindex link completion
1757 @cindex completion, of links
1758 @cindex inserting links
1759 @item C-c C-l
1760 Insert a link.  This prompts for a link to be inserted into the buffer.
1761 You can just type a link, using text for an internal link, or one of the
1762 link type prefixes mentioned in the examples above.  Through completion,
1763 all links stored during the current session can be
1764 accessed@footnote{After insertion of a stored link, the link will be
1765 removed from the list of stored links.  To keep it in the list later
1766 use, use a triple @kbd{C-u} prefix to @kbd{C-c C-l}, or configure the
1767 option @code{org-keep-stored-link-after-insertion}.}.  The link
1768 will be inserted into the buffer, along with a descriptive text.  Note
1769 that you don't have to use this command to insert a link.  Links in
1770 Org-mode are plain text, and you can type or paste them straight into
1771 the buffer.  By using this command, the links are automatically enclosed
1772 in double brackets, and you will be asked for the optional descriptive
1773 text.  If the link is a @samp{file:} link and the linked file is located
1774 in the same directory as the current file or a subdirectory of it, the
1775 path of the file will be inserted relative to the current directory.
1777 @kindex C-u C-c C-l
1778 @cindex file name completion
1779 @cindex completion, of file names
1780 @item C-u C-c C-l
1781 When @kbd{C-c C-l} is called with a @kbd{C-u} prefix argument, a link to
1782 a file will be inserted and you may use file name completion to select
1783 the name of the file.  The path to the file is inserted relative to the
1784 directory of the current org file, if the linked file is in the current
1785 directory or in a subdirectory of it, or if the path is written relative
1786 to the current directory using @samp{../}.  Otherwise an absolute path
1787 is used, if possible with @samp{~/} for your home directory.  You can
1788 force an absolute path with two @kbd{C-u} prefixes.
1790 @item C-c C-l @r{with cursor on existing link}
1791 When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit the
1792 link and description parts of the link.
1794 @cindex following links
1795 @kindex C-c C-o
1796 @item C-c C-o
1797 Open link at point.  This will launch a web browser for URLs (using
1798 @command{browse-url-at-point}), run vm/mh-e/wanderlust/rmail/gnus/bbdb
1799 for the corresponding links, and execute the command in a shell link.
1800 When the cursor is on an internal link, this commands runs the
1801 corresponding search.  When the cursor is on a TAG list in a headline,
1802 it creates the corresponding TAGS view.  If the cursor is on a time
1803 stamp, it compiles the agenda for that date.  Furthermore, it will visit
1804 text and remote files in @samp{file:} links with Emacs and select a
1805 suitable application for local non-text files.  Classification of files
1806 is based on file extension only.  See option @code{org-file-apps}.  If
1807 you want to override the default application and visit the file with
1808 Emacs, use a @kbd{C-u} prefix.
1810 @kindex mouse-2
1811 @kindex mouse-1
1812 @item mouse-2
1813 @itemx mouse-1
1814 On links, @kbd{mouse-2} will open the link just as @kbd{C-c C-o}
1815 would.  Under Emacs 22, also @kbd{mouse-1} will follow a link.
1817 @kindex mouse-3
1818 @item mouse-3
1819 Like @kbd{mouse-2}, but force file links to be opened with Emacs.
1821 @cindex mark ring
1822 @kindex C-c %
1823 @item C-c %
1824 Push the current position onto the mark ring, to be able to return
1825 easily. Commands following an internal link do this automatically.
1827 @cindex links, returning to
1828 @kindex C-c &
1829 @item C-c &
1830 Jump back to a recorded position.  A position is recorded by the
1831 commands following internal links, and by @kbd{C-c %}.  Using this
1832 command several times in direct succession moves through a ring of
1833 previously recorded positions.
1834 @end table
1837 @node Search options, Custom searches, Handling links, Hyperlinks
1838 @section Search options in file links
1839 @cindex search option in file links
1840 @cindex file links, searching
1842 File links can contain additional information to make Emacs jump to a
1843 particular location in the file when following a link.  This can be a
1844 line number or a search option after a double@footnote{For backward
1845 compatibility, line numbers can also follow a single colon.} colon. For
1846 example, when the command @kbd{C-c l} creates a link (@pxref{Handling
1847 links}) to a file, it encodes the words in the current line as a search
1848 string that can be used to find this line back later when following the
1849 link with @kbd{C-c C-o}. 
1851 Here is the syntax of the different ways to attach a search to a file
1852 link, together with an explanation:
1854 @example
1855 [[file:~/code/main.c::255]]
1856 [[file:~/xx.org::My Target]]
1857 [[file:~/xx.org::*My Target]]
1858 [[file:~/xx.org::/regexp/]]
1859 @end example
1861 @table @code
1862 @item 255
1863 Jump to line 255.
1864 @item My Target
1865 Search for a link target @samp{<<My Target>>}, or do a text search for
1866 @samp{my target}, similar to the search in internal links, see
1867 @ref{Internal links}.  In HTML export (@pxref{HTML export}), such a file
1868 link will become an HTML reference to the corresponding named anchor in
1869 the linked file.
1870 @item *My Target
1871 In an Org-mode file, restrict search to headlines.
1872 @item /regexp/
1873 Do a regular expression search for @code{regexp}.  This uses the Emacs
1874 command @code{occur} to list all matches in a separate window.  If the
1875 target file is in Org-mode, @code{org-occur} is used to create a
1876 sparse tree with the matches.
1877 @c If the target file is a directory,
1878 @c @code{grep} will be used to search all files in the directory.
1879 @end table
1881 As a degenerate case, a file link with an empty file name can be used
1882 to search the current file.  For example, @code{<file:::find me>} does
1883 a search for @samp{find me} in the current file, just as
1884 @samp{[[find me]]} would.
1886 @node Custom searches, Remember, Search options, Hyperlinks
1887 @section Custom Searches
1888 @cindex custom search strings
1890 The default mechanism for creating search strings and for doing the
1891 actual search related to a file link may not work correctly in all
1892 cases.  For example, BibTeX database files have many entries like
1893 @samp{year="1993"} which would not result in good search strings,
1894 because the only unique identification for a BibTeX entry is the
1895 citation key.
1897 If you come across such a problem, you can write custom functions to set
1898 the right search string for a particular file type, and to do the search
1899 for the string in the file.  Using @code{add-hook}, these functions need
1900 to be added to the hook variables
1901 @code{org-create-file-search-functions} and
1902 @code{org-execute-file-search-functions}.  See the docstring for these
1903 variables for more information.  Org-mode actually uses this mechanism
1904 for Bib@TeX{} database files, and you can use the corresponding code as
1905 an implementation example.  Search for @samp{BibTeX links} in the source
1906 file.
1909 @node Remember,  , Custom searches, Hyperlinks
1910 @section Remember
1911 @cindex @file{remember.el}
1913 Another way to create org entries with links to other files is through
1914 the @emph{Remember} package by John Wiegley.  @emph{Remember} lets you
1915 store quick notes with little interruption of your work flow.  See
1916 @uref{http://www.emacswiki.org/cgi-bin/wiki/RememberMode} for more
1917 information.  The notes produced by @emph{Remember} can be stored in
1918 different ways, and Org-mode files are a good target.  Org-mode allows
1919 you to file away notes either to a default file, or directly to the correct
1920 location in your Org-mode outline tree.  The following customization
1921 will tell @emph{Remember} to use org files as target, and to create
1922 annotations compatible with Org-mode links.
1924 @example
1925 (setq org-directory "~/path/to/my/orgfiles/")
1926 (setq org-default-notes-file "~/.notes")
1927 (setq remember-annotation-functions '(org-remember-annotation))
1928 (setq remember-handler-functions '(org-remember-handler))
1929 (add-hook 'remember-mode-hook 'org-remember-apply-template)
1930 @end example
1932 @cindex templates, for remember
1933 In combination with Org-mode, you can use templates to generate
1934 different types of remember notes.  For example, if you would like to
1935 use one template to create general TODO entries, and another one for
1936 journal entries, you could use:
1938 @example
1939 (setq org-remember-templates
1940       '((?t "* TODO %?\n  %i\n  %a" "~/org/TODO.org")
1941         (?j "* %U %?\n\n  %i\n  %a" "~/org/JOURNAL.org")))
1942 @end example
1944 @noindent In these entries, the character specifies how to select the
1945 template, the first string specifies the template, and the (optional)
1946 second string specifies a default file (overruling
1947 @code{org-default-notes-file}) as a target for this note.
1949 When you call @kbd{M-x remember} to remember something, org will prompt
1950 for a key to select the template and then prepare the buffer like
1951 @example
1952 * TODO
1953   <file:link to where you called remember>
1954 @end example
1956 @noindent or
1958 @example
1959 * [2006-03-21 Tue 15:37]
1961   <file:link to where you called remember>
1962 @end example
1964 @noindent See the variable @code{org-remember-templates} for more details.
1966 When you are finished composing a note with remember, you have to press
1967 @kbd{C-c C-c} to file the note away.  The handler first prompts for a
1968 target file - if you press @key{RET}, the value of
1969 @code{org-default-notes-file} is used.  Then the command offers the
1970 headings tree of the selected file.  You can either immediately press
1971 @key{RET} to get the note appended to the file.  Or you can use vertical
1972 cursor motion (@key{up} and @key{down}) and visibility cycling
1973 (@key{TAB}) to find a better place.  Pressing @key{RET} or @key{left} or
1974 @key{right} leads to the following result.
1976 @multitable @columnfractions 0.2 0.1 0.7
1977 @item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted}
1978 @item buffer-start @tab @key{RET} @tab as level 2 heading at end of file
1979 @item on headline @tab @key{RET} @tab as sublevel of the heading at cursor
1980 @item             @tab @key{left}  @tab as same level, before current heading
1981 @item             @tab @key{right} @tab as same level, after current heading
1982 @item not on headline @tab @key{RET}
1983       @tab at cursor position, level taken from context.
1984            Or use prefix arg to specify level manually.
1985 @end multitable
1987 So a fast way to store the note is to press @kbd{C-c C-c @key{RET}
1988 @key{RET}} to append it to the default file.  Even shorter would be
1989 @kbd{C-u C-c C-c}, which does the same without even showing the tree.
1990 But with little extra effort, you can push it directly to the correct
1991 location.
1993 Before inserting the text into a tree, the function ensures that the
1994 text has a headline, i.e. a first line that starts with a @samp{*}.
1995 If not, a headline is constructed from the current date and some
1996 additional data.  If the variable @code{org-adapt-indentation} is
1997 non-nil, the entire text is also indented so that it starts in the
1998 same column as the headline (after the asterisks).
2001 @node TODO items, Timestamps, Hyperlinks, Top
2002 @chapter TODO items
2003 @cindex TODO items
2005 Org-mode does not maintain TODO lists as a separate document.  TODO
2006 items are an integral part of the notes file, because TODO items
2007 usually come up while taking notes!  With Org-mode, you simply mark
2008 any entry in a tree as being a TODO item.  In this way, the
2009 information is not duplicated, and the entire context from which the
2010 item emerged is always present when you check.
2012 Of course, this technique causes TODO items to be scattered throughout
2013 your file.  Org-mode provides methods to give you an overview over all
2014 things you have to do.
2016 @menu
2017 * TODO basics::                 Marking and displaying TODO entries
2018 * TODO extensions::             Workflow and assignments
2019 * Priorities::                  Some things are more important than others
2020 @end menu
2022 @node TODO basics, TODO extensions, TODO items, TODO items
2023 @section Basic TODO functionality
2025 Any headline can become a TODO item by starting it with the word TODO,
2026 for example:
2028 @example
2029 *** TODO Write letter to Sam Fortune
2030 @end example
2032 @noindent
2033 The most important commands to work with TODO entries are:
2035 @table @kbd
2036 @kindex C-c C-t
2037 @cindex cycling, of TODO states
2038 @item C-c C-t
2039 Rotate the TODO state of the current item between
2041 @example
2042 ,-> (unmarked) -> TODO -> DONE --.
2043 '--------------------------------'
2044 @end example
2046 The same rotation can also be done ``remotely'' from the timeline and
2047 agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
2048 @kindex S-@key{right}
2049 @kindex S-@key{left}
2050 @item S-@key{right}
2051 @itemx S-@key{left}
2052 Select the following/preceding TODO state, similar to cycling.  Mostly
2053 useful if more than two TODO states are possible (@pxref{TODO extensions}).
2054 @kindex C-c C-v
2055 @cindex sparse tree, for TODO
2056 @item C-c C-v
2057 View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}).  Folds
2058 the entire buffer, but shows all TODO items and the headings hierarchy
2059 above them.  With prefix arg, show also the DONE entries.  With
2060 numerical prefix N, show the tree for the Nth keyword in the variable
2061 @code{org-todo-keywords}.
2062 @kindex C-c a t
2063 @item C-c a t
2064 Show the global TODO list.  This collects the TODO items from all
2065 agenda files (@pxref{Agenda views}) into a single buffer.  The buffer is in
2066 @code{agenda-mode}, so there are commands to examine and manipulate
2067 the TODO entries directly from that buffer (@pxref{Agenda commands}).
2068 @xref{Global TODO list}, for more information.
2069 @c @item @code{org-agenda-include-all-todo}
2070 @c If you would like to have all your TODO items listed as part of your
2071 @c agenda, customize the variable @code{org-agenda-include-all-todo}.
2072 @end table
2075 @node TODO extensions, Priorities, TODO basics, TODO items
2076 @section Extended use of TODO keywords
2077 @cindex extended TODO keywords
2079 The default implementation of TODO entries is just two states: TODO and
2080 DONE.  You can, however, use the TODO feature for more complicated
2081 things by configuring the variables @code{org-todo-keywords} and
2082 @code{org-todo-interpretation}.  Using special setup, you can even use
2083 TODO keywords in different ways in different org files.
2085 Note that @i{tags} are another way to classify headlines in general and
2086 TODO items in particular (@pxref{Tags}).
2088 @menu
2089 * Workflow states::             From TODO to DONE in steps
2090 * TODO types::                  I do this, Fred the rest
2091 * Per file keywords::           Different files, different requirements
2092 @end menu
2094 @node Workflow states, TODO types, TODO extensions, TODO extensions
2095 @subsection TODO keywords as workflow states
2096 @cindex TODO workflow
2097 @cindex workflow states as TODO keywords
2099 You can use TODO keywords to indicate different states in the process
2100 of working on an item, for example:
2102 @lisp
2103 (setq org-todo-keywords '("TODO" "FEEDBACK" "VERIFY" "DONE")
2104       org-todo-interpretation 'sequence)
2105 @end lisp
2107 @cindex completion, of TODO keywords
2108 Changing these variables only becomes effective in a new Emacs session.
2109 With this setup, the command @kbd{C-c C-t} will cycle an entry from
2110 TODO to FEEDBACK, then to VERIFY, and finally to DONE.  You may also
2111 use a prefix argument to quickly select a specific state.  For example
2112 @kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
2113 If you define many keywords, you can use in-buffer completion (see
2114 @ref{Completion}) to insert these words into the buffer.
2116 @node TODO types, Per file keywords, Workflow states, TODO extensions
2117 @subsection TODO keywords as types
2118 @cindex TODO types
2119 @cindex names as TODO keywords
2120 @cindex types as TODO keywords
2122 The second possibility is to use TODO keywords to indicate different
2123 types of action items.  For example, you might want to indicate that
2124 items are for ``work'' or ``home''.  If you are into David Allen's
2125 @emph{Getting Things DONE}, you might want to use todo types
2126 @samp{NEXTACTION}, @samp{WAITING}, @samp{MAYBE}.  Or, when you work
2127 with several people on a single project, you might want to assign
2128 action items directly to persons, by using their names as TODO
2129 keywords.  This would be set up like this:
2131 @lisp
2132 (setq org-todo-keywords '("Fred" "Sara" "Lucy" "Mike" "DONE")
2133       org-todo-interpretation 'type)
2134 @end lisp
2136 In this case, different keywords do not indicate a sequence, but
2137 rather different types.  So it is normally not useful to change from
2138 one type to another.  Therefore, in this case the behavior of the
2139 command @kbd{C-c C-t} is changed slightly@footnote{This is also true
2140 for the @kbd{t} command in the timeline and agenda buffers.}.  When
2141 used several times in succession, it will still cycle through all
2142 names.  But when you return to the item after some time and execute
2143 @kbd{C-c C-t} again, it will switch from each name directly to DONE.
2144 Use prefix arguments or completion to quickly select a specific name.
2145 You can also review the items of a specific TODO type in a sparse tree
2146 by using a numeric prefix to @kbd{C-c C-v}.  For example, to see all
2147 things Lucy has to do, you would use @kbd{C-3 C-c C-v}.  To collect
2148 Lucy's items from all agenda files into a single buffer, you
2149 would use the prefix arg as well when creating the global todo list:
2150 @kbd{C-3 C-c t}.
2152 @node Per file keywords,  , TODO types, TODO extensions
2153 @subsection Setting up TODO keywords for individual files
2154 @cindex keyword options
2155 @cindex per file keywords
2157 It can be very useful to use different aspects of the TODO mechanism
2158 in different files, which is not possible with the global settings
2159 described above.  For file-local settings, you need to add special
2160 lines to the file which set the keywords and interpretation for that
2161 file only.  For example, to set one of the two examples discussed
2162 above, you need one of the following lines, starting in column zero
2163 anywhere in the file:
2165 @example
2166 #+SEQ_TODO: TODO FEEDBACK VERIFY DONE
2167 #+TYP_TODO: Fred Sara Lucy Mike DONE
2168 @end example
2170 @cindex Completion, of option keywords
2171 @kindex M-@key{TAB}
2172 @noindent To make sure you are using the correct keyword, type
2173 @samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
2175 @cindex DONE, final TODO keyword
2176 Remember that the last keyword must always mean that the item is DONE
2177 (although you may use a different word).  Also note that in each file,
2178 only one of the two aspects of TODO keywords can be used.  After
2179 changing one of these lines, use @kbd{C-c C-c} with the cursor still
2180 in the line to make the changes known to Org-mode@footnote{Org-mode
2181 parses these lines only when Org-mode is activated after visiting a
2182 file.  @kbd{C-c C-c} with the cursor in a line starting with @samp{#+}
2183 is simply restarting Org-mode, making sure that these changes will be
2184 respected.}.
2186 If you want to use very many keywords, for example when working with a
2187 large group of people, you may split the names over several lines:
2189 @example
2190 #+TYP_TODO: Fred Sara Lucy Mike
2191 #+TYP_TODO: Luis George Jules Jessica
2192 #+TYP_TODO: Kim Arnold Peter
2193 #+TYP_TODO: DONE
2194 @end example
2196 @node Priorities,  , TODO extensions, TODO items
2197 @section Priorities
2198 @cindex priorities
2200 If you use Org-mode extensively to organize your work, you may end up
2201 with a number of TODO entries so large that you'd like to prioritize
2202 them.  This can be done by placing a @emph{priority cookie} into the
2203 headline, like this
2205 @example
2206 *** TODO [#A] Write letter to Sam Fortune
2207 @end example
2209 @noindent
2210 With its standard setup, Org-mode supports priorities @samp{A},
2211 @samp{B}, and @samp{C}.  @samp{A} is the highest priority.  An entry
2212 without a cookie is treated as priority @samp{B}.  Priorities make a
2213 difference only in the agenda (@pxref{Weekly/Daily agenda}).
2215 @table @kbd
2216 @kindex @kbd{C-c ,}
2217 @item @kbd{C-c ,}
2218 Set the priority of the current headline.  The command prompts for a
2219 priority character @samp{A}, @samp{B} or @samp{C}.  When you press
2220 @key{SPC} instead, the priority cookie is removed from the headline.
2221 The priorities can also be changed ``remotely'' from the timeline and
2222 agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
2224 @kindex S-@key{up}
2225 @kindex S-@key{down}
2226 @item S-@key{up}
2227 @itemx S-@key{down}
2228 Increase/decrease priority of current headline.  Note that these keys
2229 are also used to modify time stamps (@pxref{Creating timestamps}).
2230 Furthermore, these keys are also used by CUA-mode (@pxref{Conflicts}).
2231 @end table
2233 @node Timestamps, Tags, TODO items, Top
2234 @chapter Timestamps
2236 Items can be labeled with timestamps to make them useful for project
2237 planning.
2239 @menu
2240 * Time stamps::                 Assigning a time to a tree entry
2241 * Creating timestamps::         Commands which insert timestamps
2242 * Progress logging::            Documenting when what work was done.
2243 @end menu
2246 @node Time stamps, Creating timestamps, Timestamps, Timestamps
2247 @section Time stamps, deadlines and scheduling
2248 @cindex time stamps
2249 @cindex ranges, time
2250 @cindex date stamps
2251 @cindex deadlines
2252 @cindex scheduling
2254 A time stamp is a specification of a date (possibly with time) in a
2255 special format, either @samp{<2003-09-16 Tue>} or @samp{<2003-09-16
2256 Tue 09:39>}.  A time stamp can appear anywhere in the headline or body
2257 of an org-tree entry.  Its presence allows entries to be shown on specific
2258 dates in the agenda (@pxref{Weekly/Daily agenda}).  We distinguish:
2260 @table @var
2261 @item Plain time stamp
2262 @cindex timestamp
2263 A simple time stamp just assigns a date/time to an item.  This is just
2264 like writing down an appointment in a paper agenda, or like writing down
2265 an event in a diary, when you want to take note of when something
2266 happened.  In the timeline and agenda displays, the headline of an entry
2267 associated with a plain time stamp will be shown exactly on that date.
2269 @item Time stamp range
2270 @cindex timerange
2271 Two time stamps connected by @samp{--} denote a time range.  The
2272 headline will be shown on the first and last day of the range, and on
2273 any dates that are displayed and fall in the range.  Here is an
2274 example:
2276 @example
2277 ** Meeting in Amsterdam
2278    <2004-08-23 Mon>--<2004-08-26 Thu>
2279 @end example
2281 @item Time stamp with SCHEDULED keyword
2282 @cindex SCHEDULED keyword
2283 If a time stamp is preceded by the word @samp{SCHEDULED:}, it means you
2284 are planning to start working on that task on the given date. So this is
2285 not about recording an event, but about planning your work.  The
2286 headline will be listed under the given date.  In addition, a reminder
2287 that the scheduled date has passed will be present in the compilation
2288 for @emph{today}, until the entry is marked DONE.  I.e., the task will
2289 automatically be forwarded until completed.
2291 @example
2292 *** TODO Call Trillian for a date on New Years Eve.
2293     SCHEDULED: <2004-12-25 Sat>
2294 @end example
2296 @item Time stamp with DEADLINE keyword
2297 @cindex DEADLINE keyword
2298 If a time stamp is preceded by the word @samp{DEADLINE:}, the task
2299 (most likely a TODO item) is supposed to be finished on that date, and
2300 it will be listed then.  In addition, the compilation for @emph{today}
2301 will carry a warning about the approaching or missed deadline,
2302 starting @code{org-deadline-warning-days} before the due date, and
2303 continuing until the entry is marked DONE.  An example:
2305 @example
2306 *** TODO write article about the Earth for the Guide
2307     The editor in charge is <bbdb:Ford Prefect>
2308     DEADLINE: <2004-02-29 Sun>
2309 @end example
2310 @item Time stamp with CLOSED keyword
2311 @cindex CLOSED keyword
2312 When @code{org-log-done} is non-nil, Org-mode will automatically insert
2313 a special time stamp each time a TODO entry is marked done
2314 (@pxref{Progress logging}).  This time stamp is enclosed in square
2315 brackets instead of angular brackets.
2317 @item Time range with CLOCK keyword
2318 @cindex CLOCK keyword
2319 When using the clock to time the work that is being done on specific
2320 items, time ranges preceded by the CLOCK keyword are inserted
2321 automatically into the file.  The time stamps are enclosed in square
2322 brackets instead of angular brackets.  @xref{Clocking work time}.
2323 @end table
2325 @node Creating timestamps, Progress logging, Time stamps, Timestamps
2326 @section Creating timestamps
2327 @cindex creating timestamps
2328 @cindex timestamps, creating
2330 For Org-mode to recognize time stamps, they need to be in the specific
2331 format.  All commands listed below produce time stamps in the correct
2332 format.
2334 @table @kbd
2335 @kindex C-c .
2336 @item C-c .
2337 Prompt for a date and insert a corresponding time stamp.  When the
2338 cursor is at a previously used time stamp, it is updated to NOW.  When
2339 this command is used twice in succession, a time range is inserted.
2341 @kindex C-u C-c .
2342 @item C-u C-c .
2343 Like @kbd{C-c .}, but use the alternative format which contains date
2344 and time.  The default time can be rounded to multiples of 5 minutes,
2345 see the option @code{org-time-stamp-rounding-minutes}.
2347 @kindex C-c !
2348 @item C-c !
2349 Like @kbd{C-c .}, but insert an inactive time stamp not triggering the
2350 agenda.
2352 @kindex C-c <
2353 @item C-c <
2354 Insert a time stamp corresponding to the cursor date in the Calendar.
2356 @kindex C-c >
2357 @item C-c >
2358 Access the Emacs calendar for the current date.  If there is a
2359 timestamp in the current line, goto the corresponding date
2360 instead.
2362 @kindex C-c C-o
2363 @item C-c C-o
2364 Access the agenda for the date given by the time stamp at point
2365 (@pxref{Weekly/Daily agenda}).
2367 @kindex C-c C-d
2368 @item C-c C-d
2369 Insert @samp{DEADLINE} keyword along with a stamp.  The insertion will
2370 happen in the line directly following the headline.  
2371 @c FIXME Any CLOSED timestamp will be removed.????????
2373 @kindex C-c C-w
2374 @cindex sparse tree, for deadlines
2375 @item C-c C-w
2376 Create a sparse tree with all deadlines that are either past-due, or
2377 which will become due within @code{org-deadline-warning-days}.
2378 With @kbd{C-u} prefix, show all deadlines in the file.  With a numeric
2379 prefix, check that many days.  For example, @kbd{C-1 C-c C-w} shows
2380 all deadlines due tomorrow.
2382 @kindex C-c C-s
2383 @item C-c C-s
2384 Insert @samp{SCHEDULED} keyword along with a stamp.  The insertion will
2385 happen in the line directly following the headline.  Any CLOSED
2386 timestamp will be removed.
2388 @kindex S-@key{left}
2389 @kindex S-@key{right}
2390 @item S-@key{left}
2391 @itemx S-@key{right}
2392 Change date at cursor by one day.  These key bindings conflict with
2393 CUA-mode (@pxref{Conflicts}).
2395 @kindex S-@key{up}
2396 @kindex S-@key{down}
2397 @item S-@key{up}
2398 @itemx S-@key{down}
2399 Change the item under the cursor in a timestamp.  The cursor can be on
2400 a year, month, day, hour or minute.  Note that if the cursor is not at
2401 a time stamp, these same keys modify the priority of an item.
2402 (@pxref{Priorities}). The key bindings also conflict with CUA-mode
2403 (@pxref{Conflicts}).
2406 @kindex C-c C-y
2407 @cindex evaluate time range
2408 @item C-c C-y
2409 Evaluate a time range by computing the difference between start and
2410 end.  With prefix arg, insert result after the time range (in a table:
2411 into the following column).
2412 @end table
2414 @cindex date, reading in minibuffer
2415 @cindex time, reading in minibuffer
2416 @cindex calendar, for selecting date
2417 When Org-mode prompts for a date/time, the function reading your input
2418 will replace anything you choose not to specify with the current date
2419 and time.  For details, see the documentation string of
2420 @command{org-read-date}.  Also, a calender will pop up to allow
2421 selecting a date.  The calendar can be fully controlled from the
2422 minibuffer, and a date can be selected with the following commands:
2424 @table @kbd
2425 @kindex <
2426 @item <
2427 Scroll calendar backwards by one month.
2428 @kindex >
2429 @item >
2430 Scroll calendar forwards by one month.
2431 @kindex mouse-1
2432 @item mouse-1
2433 Select date by clicking on it.
2434 @kindex S-@key{right}
2435 @item S-@key{right}
2436 One day forward.
2437 @kindex S-@key{left}
2438 @item S-@key{left}
2439 One day back.
2440 @kindex S-@key{down}
2441 @item S-@key{down}
2442 One week forward.
2443 @kindex S-@key{up}
2444 @item S-@key{up}
2445 One week back.
2446 @kindex M-S-@key{right}
2447 @item M-S-@key{right}
2448 One month forward.
2449 @kindex M-S-@key{left}
2450 @item M-S-@key{left}
2451 One month back.
2452 @kindex @key{RET}
2453 @item @key{RET}
2454 Choose date in calendar (only if nothing typed into minibuffer).
2455 @end table
2457 @node Progress logging,  , Creating timestamps, Timestamps
2458 @section Progress Logging
2459 @cindex progress logging
2460 @cindex logging, of progress
2462 Org-mode can automatically record a time stamp when you mark a TODO item
2463 as DONE.  You can also measure precisely the time you spent on specific
2464 items in a project by starting and stopping a clock when you start and
2465 stop working on an aspect of a project.
2467 @menu
2468 * Closing items::               When was this entry marked DONE?
2469 * Clocking work time::          When exactly did you work on this item?
2470 @end menu
2472 @node Closing items, Clocking work time, Progress logging, Progress logging
2473 @subsection Closing items
2475 If you want to keep track of @emph{when} a certain TODO item was
2476 finished, turn on logging with
2478 @lisp
2479 (setq org-log-done t)
2480 @end lisp
2482 @noindent
2483 Then each time you turn a TODO entry into DONE using either @kbd{C-c
2484 C-t} in the Org-mode buffer or @kbd{t} in the agenda buffer, a line
2485 @samp{CLOSED: [timestamp]} will be inserted just after the headline.
2486 If you turn the entry back into a TODO item again through further
2487 state cycling, that line will be removed again.  In the timeline
2488 (@pxref{Timeline}) and in the agenda (@pxref{Weekly/Daily agenda}),
2489 you can then use the @kbd{l} key to display the TODO items closed on
2490 each day, giving you an overview of what has been done on a day.
2492 @node Clocking work time,  , Closing items, Progress logging
2493 @subsection Clocking work time
2495 Org-mode allows you to clock the time you spent on specific tasks in a
2496 project.  When you start working on an item, you can start the clock.
2497 When you stop working on that task, or when you mark the task done, the
2498 clock is stopped and the corresponding time interval is recorded.  It
2499 also computes the total time spent on each subtree of a project.
2501 @table @kbd
2502 @kindex C-c C-x C-i
2503 @item C-c C-x C-i
2504 Start the clock on the current item (clock-in).  This inserts the CLOCK
2505 keyword together with a timestamp.
2506 @kindex C-c C-x C-o
2507 @item C-c C-x C-o
2508 Stop the clock (clock-out).  The inserts another timestamp at the same
2509 location where the clock was last started.  It also directly computes
2510 the resulting time in inserts it after the time range as @samp{=>
2511 HH:MM}.
2512 @kindex C-c C-t
2513 @item C-c C-t
2514 Changing the TODO state of an item to DONE automatically stops the clock
2515 if it is running in this same item.
2516 @kindex C-c C-x C-x
2517 @item C-c C-x C-x
2518 Cancel the current clock.  This is useful if a clock was started by
2519 mistake, or if you ended up working on something else.
2520 @kindex C-c C-x C-d
2521 @item C-c C-x C-d
2522 Display time summaries for each subtree in the current buffer.  This
2523 puts overlays at the end of each headline, showing the total time
2524 recorded under that heading, including the time of any subheadings. You
2525 can use visibility cycling to study the tree, but the overlays disappear
2526 automatically when the buffer is changed.
2527 @kindex C-c C-x C-r
2528 @item C-c C-x C-r
2529 Insert a dynamic block containing a clock report as an org-mode table
2530 into the current file.
2531 @example
2532 #+BEGIN: clocktable :maxlevel 2 :emphasize nil
2534 #+END: clocktable
2535 @end example
2536 @noindent
2537 If such a block already exists, its content is replaced by the new
2538 table.  The @samp{BEGIN} line can specify options:
2539 @example
2540 :maxlevels   @r{Maximum level depth to which times are listed in the table.}
2541 :emphasize   @r{When @code{t}, emphasize level one and level two items}
2542 @end example
2543 @end table
2545 The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
2546 the agenda (@pxref{Weekly/Daily agenda}) to show which tasks have been
2547 worked on or closed during a day.
2549 @node Tags, Agenda views, Timestamps, Top
2550 @chapter Tags
2551 @cindex tags
2552 @cindex headline tagging
2553 @cindex matching, tags
2554 @cindex sparse tree, tag based
2556 If you wish to implement a system of labels and contexts for
2557 cross-correlating information, an excellent way is to assign @i{tags} to
2558 headlines.  Org-mode has extensive support for using tags.
2560 Every headline can contain a list of tags, at the end of the headline.
2561 Tags are normal words containing letters, numbers, @samp{_}, and
2562 @samp{@@}.  Tags must be preceded and followed by a single colon; like
2563 @samp{:WORK:}.  Several tags can be specified like @samp{:WORK:URGENT:}.
2565 @menu
2566 * Tag inheritance::             Tags use the tree structure of the outline
2567 * Setting tags::                How to assign tags to a headline
2568 * Tag searches::                Searching for combinations of tags
2569 @end menu
2571 @node Tag inheritance, Setting tags, Tags, Tags
2572 @section Tag inheritance
2573 @cindex inheritance, of tags
2575 @i{Tags} make use of the hierarchical structure of outline trees.  If a
2576 heading has a certain tag, all subheadings will inherit the tag as
2577 well.  For example, in the list
2579 @example
2580 * Meeting with the French group      :WORK:
2581 ** Summary by Frank                  :BOSS:NOTES:
2582 *** TODO Prepare slides for him      :ACTION:
2583 @end example
2585 @noindent
2586 the final heading will have the tags @samp{:WORK:}, @samp{:BOSS:},
2587 @samp{:NOTES:}, and @samp{:ACTION:}.  When executing tag searches and
2588 Org-mode finds that a certain headline matches the search criterion, it
2589 will not check any sublevel headline, assuming that these likely also
2590 match, and that the list of matches can become very long.  This may
2591 not be what you want, however, and you can influence inheritance and
2592 searching using the variables @code{org-use-tag-inheritance} and
2593 @code{org-tags-match-list-sublevels}.
2595 @node Setting tags, Tag searches, Tag inheritance, Tags
2596 @section Setting tags
2597 @cindex setting tags
2599 @kindex M-@key{TAB}
2600 Tags can simply be typed into the buffer at the end of a headline.
2601 After a colon, @kbd{M-@key{TAB}} offers completion on tags.  There is
2602 also a special command for inserting tags:
2604 @table @kbd
2605 @kindex C-c C-c
2606 @item C-c C-c
2607 @cindex completion, of tags
2608 Enter new tags for the current headline.  Org-mode will either offer
2609 completion or a special single-key interface for setting tags, see
2610 below.  After pressing @key{RET}, the tags will be inserted and aligned
2611 to @code{org-tags-column}.  When called with a @kbd{C-u} prefix, all
2612 tags in the current buffer will be aligned to that column, just to make
2613 things look nice.  TAGS are automatically realigned after promotion,
2614 demotion, and TODO state changes (@pxref{TODO basics}).
2615 @end table
2617 Org will support tag insertion based on a @emph{list of tags}.  By
2618 default this list is constructed dynamically, containing all tags
2619 currently used in the buffer.  You may also globally specify a hard list
2620 of tags with the variable @code{org-tag-alist}.  Finally you can set
2621 the allowed tags for a given file with lines like
2623 @example
2624 #+TAGS: @@WORK @@HOME @@TENNISCLUB
2625 #+TAGS: Laptop Car PC Sailboat
2626 @end example
2628 The default support method is minibuffer completion.  However, Org-mode
2629 also implements a much better method: @emph{fast tag selection}.  This
2630 method allows to select and deselect tags with a single key per tag.  To
2631 function efficiently, you should assign unique keys to all tags.  This
2632 can be done globally with
2634 @lisp
2635 (setq org-tag-alist '(("@@WORK" . ?w) ("@@HOME" . ?h) ("Laptop" . ?l)))
2636 @end lisp
2638 @noindent or on a per-file basis with
2640 @example
2641 #+TAGS: @@WORK(w)  @@HOME(h)  @@TENNISCLUB(t)  Laptop(l)  PC(p)
2642 @end example
2644 @noindent
2645 You can also group together tags that are mutually exclusive.  With
2646 curly braces@footnote{In @code{org-mode-alist} use
2647 @code{'(:startgroup)} and @code{'(:endgroup)}, respectively.  Several
2648 groups are allowed.}
2650 @example
2651 #+TAGS: @{ @@WORK(w)  @@HOME(h)  @@TENNISCLUB(t) @}  Laptop(l)  PC(p)
2652 @end example
2654 @noindent you indicate that at most one of @samp{@@WORK}, @samp{@@HOME},
2655 and @samp{@@SAILBOAT} should be selected.
2657 @noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
2658 these lines to activate any changes.
2660 If at least one tag has a selection key, pressing @kbd{C-c C-c} will
2661 automatically present you with a special interface, listing inherited
2662 tags, the tags of the current headline, and a list of all legal tags
2663 with corresponding keys@footnote{Keys will automatically assigned to
2664 tags which have no configured keys.}.  Pressing keys for the tags will
2665 add or remove them from the list of tags in the current line.  Selecting
2666 a tag in a group of mutually exclusive tags will turn off any other tags
2667 from that group.  @key{SPC} clears all tags for this line, @kbd{RET}
2668 accepts the modified set, and @kbd{C-g} aborts without installing
2669 changes.  This method lets you assign tags to a headline with very few
2670 keys.  With the above setup, you could clear the current tags and set
2671 @samp{@@HOME}, @samp{Laptop} and @samp{PC} tags with just the following
2672 keys: @kbd{C-c C-c @key{SPC} h l p @key{RET}}.  Switching from
2673 @samp{@@HOME} to @samp{@@WORK} would be done with @kbd{C-c C-c w
2674 @key{RET}}.
2676 What if you have globally defined your preferred set of tags using the
2677 variable @code{org-tag-alist}, but would like to use a dynamic tag list
2678 in a specific file?  Just add an empty TAGS option line to that file:
2680 @example
2681 #+TAGS:
2682 @end example
2686 @node Tag searches,  , Setting tags, Tags
2687 @section Tag searches
2688 @cindex tag searches
2690 Once a tags system has been set up, it can be used to collect related
2691 information into special lists.
2693 @table @kbd
2694 @kindex C-c \
2695 @item C-c \
2696 Create a sparse tree with all headlines matching a tags search.
2697 @kindex C-c a m
2698 @item C-c a m
2699 Create a global list of tag matches from all agenda files.
2700 @xref{Matching headline tags}.
2701 @kindex C-c a M
2702 @item C-c a M
2703 Create a global list of tag matches from all agenda files, but check
2704 only TODO items and force checking subitems (see variable
2705 @code{org-tags-match-list-sublevels}).
2706 @end table
2708 A @i{tags} search string can use Boolean operators @samp{&} for AND and
2709 @samp{|} for OR.  @samp{&} binds more strongly than @samp{|}.
2710 Parenthesis are currently not implemented.  A tag may also be preceded
2711 by @samp{-}, to select against it, and @samp{+} is syntactic sugar for
2712 positive selection.  The AND operator @samp{&} is optional when @samp{+}
2713 or @samp{-} is present.  For example, @samp{+WORK-BOSS} would select all
2714 headlines that are tagged @samp{:WORK:}, but discard those also tagged
2715 @samp{:BOSS:}.  The search string @samp{WORK|LAPTOP} selects all lines
2716 tagged @samp{:WORK:} or @samp{:LAPTOP:}.  The string
2717 @samp{WORK|LAPTOP&NIGHT} requires that the @samp{:LAPTOP:} lines are
2718 also tagged @samp{NIGHT}.
2720 @node Agenda views, Embedded LaTeX, Tags, Top
2721 @chapter Agenda Views
2722 @cindex agenda views
2724 Due to the way Org-mode works, TODO items, time-stamped items, and
2725 tagged headlines can be scattered throughout a file or even a number of
2726 files.  To get an overview over open action items, or over events that
2727 are important for a particular date, this information must be collected,
2728 sorted and displayed in an organized way.
2730 Org-mode can select items based on various criteria, and display them
2731 in a separate buffer.  Three different views are provided:
2733 @itemize @bullet
2734 @item
2735 an @emph{agenda} that is like a calendar and shows information
2736 for specific dates
2737 @item
2738 a @emph{TODO list} that covers all unfinished
2739 action items, and
2740 @item
2741 a @emph{tags view} that shows information based on
2742 the tags associated with headlines in the outline tree.
2743 @end itemize
2745 @noindent
2746 The extracted information is displayed in a special @emph{agenda
2747 buffer}.  This buffer is read-only, but provides commands to visit the
2748 corresponding locations in the original Org-mode files, and even to
2749 edit these files remotely.
2751 @menu
2752 * Agenda files::                Files being searched for agenda information
2753 * Agenda dispatcher::           Keyboard access to agenda views
2754 * Weekly/Daily agenda::         The calendar page with current tasks
2755 * Global TODO list::            All unfinished action items
2756 * Matching headline tags::      Structured information with fine-tuned search
2757 * Timeline::                    Time-sorted view for single file
2758 * Agenda commands::             Remote editing of org trees
2759 @end menu
2761 @node Agenda files, Agenda dispatcher, Agenda views, Agenda views
2762 @section Agenda files
2764 The information to be shown is collected from all @emph{agenda files},
2765 the files listed in the variable @code{org-agenda-files}@footnote{If the
2766 value of that variable is not a list, but a single file name, then the
2767 list of agenda files will be maintained in that external file.}.  Thus even
2768 if you only work with a single Org-mode file, this file should be put
2769 into that list@footnote{When using the dispatcher pressing @kbd{1}
2770 before selecting a command will actually limit the command to the
2771 current file, and ignore @code{org-agenda-files} until the next
2772 dispatcher command.}.  You can customize @code{org-agenda-files}, but
2773 the easiest way to maintain it is through the following commands
2775 @cindex files, adding to agenda list
2776 @table @kbd
2777 @kindex C-c [
2778 @item C-c [
2779 Add current file to the list of agenda files.  The file is added to
2780 the front of the list.  If it was already in the list, it is moved to
2781 the front.  With prefix arg, file is added/moved to the end.
2782 @kindex C-c ]
2783 @item C-c ]
2784 Remove current file from the list of agenda files.
2785 @kindex C-,
2786 @item C-,
2787 Cycle through agenda file list, visiting one file after the other.
2788 @end table
2790 @noindent
2791 The Org menu contains the current list of files and can be used
2792 to visit any of them.
2794 @node Agenda dispatcher, Weekly/Daily agenda, Agenda files, Agenda views
2795 @section The agenda dispatcher
2796 @cindex agenda dispatcher
2797 @cindex dispatching agenda commands
2798 @cindex custom agenda commands
2799 @cindex agenda commands, custom
2800 The views are created through a dispatcher that should be bound to a
2801 global key, for example @kbd{C-c a} (@pxref{Installation}).  In the
2802 following we will assume that @kbd{C-c a} is indeed how the dispatcher
2803 is accessed and list keyboard access to commands accordingly.  After
2804 pressing @kbd{C-c a}, an additional letter is required to execute a
2805 command.  The dispatcher offers the following default commands:
2806 @table @kbd
2807 @item a
2808 Create the calendar-like agenda (@pxref{Weekly/Daily agenda}).
2809 @item t / T
2810 Create a list of all TODO items (@pxref{Global TODO list}).
2811 @item m / M
2812 Create a list of headlines matching a TAGS expression (@pxref{Matching
2813 headline tags}).
2814 @end table
2816 You can also define custom commands that will be accessible through
2817 the dispatcher, just like the default commands.  Custom commands are
2818 global searches for tags and specific TODO keywords, or a variety of
2819 sparse tree creating commands (@pxref{Sparse trees}).  As sparse trees
2820 are only defined for a single org-mode file, these latter commands act
2821 on the current buffer instead of the list of agenda files.
2823 @kindex C-c a C
2824 Custom commands are configured in the variable
2825 @code{org-agenda-custom-commands}.  You can customize this variable,
2826 for example by pressing @kbd{C-c a C}.  You can also directly set it
2827 with Emacs Lisp in @file{.emacs}.  For example:
2829 @lisp
2830 (setq org-agenda-custom-commands
2831       '(("w" todo "WAITING")
2832         ("u" tags "+BOSS-URGENT")
2833         ("U" tags-tree "+BOSS-URGENT")
2834         ("f" occur-tree "\\<FIXME\\>")))
2835 @end lisp
2837 @noindent will define @kbd{C-c a w} as a global search for
2838 TODO entries with @samp{WAITING} as the TODO keyword, @kbd{C-c a u} as a
2839 global tags search for headlines marked @samp{:BOSS:} but not
2840 @samp{:URGENT:}, @kbd{C-c a U} to do the same search but only in the
2841 current buffer and display the result as a sparse tree, and @kbd{C-c a
2842 f} to create a sparse tree with all entries containing the word
2843 @samp{FIXME}.  For more information, look at the documentation string
2844 of the variable @code{org-agenda-custom-commands}.
2846 @node Weekly/Daily agenda, Global TODO list, Agenda dispatcher, Agenda views
2847 @section The weekly/daily agenda
2848 @cindex agenda
2850 The purpose of the weekly/daily @emph{agenda} is to act like a page of
2851 a paper agenda, showing all the tasks for the current week or day.
2853 @table @kbd
2854 @cindex org-agenda, command
2855 @kindex C-c a a
2856 @item C-c a a
2857 Compile an agenda for the current week from a list of org files.  The
2858 agenda shows the entries for each day.  With a @kbd{C-u} prefix (or
2859 when the variable @code{org-agenda-include-all-todo} is @code{t}), all
2860 unfinished TODO items (including those without a date) are also listed at
2861 the beginning of the buffer, before the first date.@*
2862 @end table
2864 Remote editing from the agenda buffer means, for example, that you can
2865 change the dates of deadlines and appointments from the agenda buffer.
2866 The commands available in the Agenda buffer are listed in @ref{Agenda
2867 commands}.
2869 @menu
2870 * Categories::                  Not all tasks are equal
2871 * Time-of-day specifications::  How the agenda knows the time
2872 * Calendar/Diary integration::  Integrating Anniversaries and more
2873 * Sorting of agenda items::     The order of things
2874 @end menu
2876 @node Categories, Time-of-day specifications, Weekly/Daily agenda, Weekly/Daily agenda
2877 @subsection Categories
2879 @cindex category
2880 In the agenda buffer, each entry is preceded by a @emph{category},
2881 which is derived from the file name.  The category can also be set
2882 with a special line anywhere in the buffer, looking like this:
2884 @example
2885 #+CATEGORY: Thesis
2886 @end example
2888 If there are several such lines in a file, each specifies the category
2889 for the text below it (but the first category also applies to any text
2890 before the first CATEGORY line).  The display in the agenda buffer looks
2891 best if the category is not longer than 10 characters.
2893 @node Time-of-day specifications, Calendar/Diary integration, Categories, Weekly/Daily agenda
2894 @subsection Time-of-Day Specifications
2896 Org-mode checks each agenda item for a time-of-day specification.  The
2897 time can be part of the time stamp that triggered inclusion into the
2898 agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}.  Time
2899 ranges can be specified with two time stamps, like
2901 @w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
2903 In the headline of the entry itself, a time(range) may also appear as
2904 plain text (like @samp{12:45} or a @samp{8:30-1pm}.  If the agenda
2905 integrates the Emacs diary (@pxref{Calendar/Diary integration}), time
2906 specifications in diary entries are recognized as well.
2908 For agenda display, Org-mode extracts the time and displays it in a
2909 standard 24 hour format as part of the prefix.  The example times in
2910 the previous paragraphs would end up in the agenda like this:
2912 @example
2913     8:30-13:00 Arthur Dent lies in front of the bulldozer
2914    12:45...... Ford Prefect arrives and takes Arthur to the pub
2915    19:00...... The Vogon reads his poem
2916    20:30-22:15 Marwin escorts the Hitchhikers to the bridge
2917 @end example
2919 If the agenda is in single-day mode, or for the display of today, the
2920 timed entries are embedded in a time grid, like
2922 @example
2923     8:00...... ------------------
2924     8:30-13:00 Arthur Dent lies in front of the bulldozer
2925    10:00...... ------------------
2926    12:00...... ------------------
2927    12:45...... Ford Prefect arrives and takes Arthur to the pub
2928    14:00...... ------------------
2929    16:00...... ------------------
2930    18:00...... ------------------
2931    19:00...... The Vogon reads his poem
2932    20:00...... ------------------
2933    20:30-22:15 Marwin escorts the Hitchhikers to the bridge
2934 @end example
2936 The time grid can be turned on and off with the variable
2937 @code{org-agenda-use-time-grid}, and can be configured with
2938 @code{org-agenda-time-grid}.
2941 @node Calendar/Diary integration, Sorting of agenda items, Time-of-day specifications, Weekly/Daily agenda
2942 @subsection Calendar/Diary integration
2943 @cindex calendar integration
2944 @cindex diary integration
2946 Emacs contains the calendar and diary by Edward M. Reingold.  The
2947 calendar displays a three-month calendar with holidays from different
2948 countries and cultures.  The diary allows you to keep track of
2949 anniversaries, lunar phases, sunrise/set, recurrent appointments
2950 (weekly, monthly) and more.  In this way, it is quite complementary to
2951 Org-mode.  It can be very useful to combine output from Org-mode with
2952 the diary.
2954 In order to include entries from the Emacs diary into Org-mode's
2955 agenda, you only need to customize the variable
2957 @lisp
2958 (setq org-agenda-include-diary t)
2959 @end lisp
2961 @noindent After that, everything will happen automatically.  All diary
2962 entries including holidays, anniversaries etc will be included in the
2963 agenda buffer created by Org-mode.  @key{SPC}, @key{TAB}, and
2964 @key{RET} can be used from the agenda buffer to jump to the diary
2965 file in order to edit existing diary entries.  The @kbd{i} command to
2966 insert new entries for the current date works in the agenda buffer, as
2967 well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display
2968 Sunrise/Sunset times, show lunar phases and to convert to other
2969 calendars, respectively.  @kbd{c} can be used to switch back and forth
2970 between calendar and agenda.
2972 @node Sorting of agenda items,  , Calendar/Diary integration, Weekly/Daily agenda
2973 @subsection Sorting of agenda items
2974 @cindex sorting, of agenda items
2975 @cindex priorities, of agenda items
2976 The entries for each day are sorted.  The default order is to first
2977 collect all items containing an explicit time-of-day specification.
2978 These entries will be shown at the beginning of the list, as a
2979 @emph{schedule} for the day.  After that, items remain grouped in
2980 categories, in the sequence given by @code{org-agenda-files}.  Within
2981 each category, items are sorted by priority (@pxref{Priorities}).
2983 The priority is a numerical quantity composed of the base priority
2984 (2000 for priority @samp{A}, 1000 for @samp{B}, and 0 for @samp{C}),
2985 plus additional increments for overdue scheduled or deadline items.
2987 Sorting can be customized using the variable
2988 @code{org-agenda-sorting-strategy}.
2991 @node Global TODO list, Matching headline tags, Weekly/Daily agenda, Agenda views
2992 @section The global TODO list
2993 @cindex global TODO list
2994 @cindex TODO list, global
2996 The global TODO list contains all unfinished TODO items, formatted and
2997 collected into a single place.
2999 @table @kbd
3000 @kindex C-c a t
3001 @item C-c a t
3002 Show the global TODO list.  This collects the TODO items from all
3003 agenda files (@pxref{Agenda views}) into a single buffer.  The buffer is in
3004 @code{agenda-mode}, so there are commands to examine and manipulate
3005 the TODO entries directly from that buffer (@pxref{Agenda commands}).
3006 @kindex C-c a T
3007 @item C-c a T
3008 Like the above, but allows selection of a specific TODO keyword.  You can
3009 also do this by specifying a prefix argument to @kbd{C-c a t}.  With a
3010 @kbd{C-u} prefix you are prompted for a keyword.  With a numeric
3011 prefix, the Nth keyword in @code{org-todo-keywords} is selected.
3012 @kindex r
3013 The @kbd{r} key in the agenda buffer regenerates it, and you can give
3014 a prefix argument to this command to change the selected TODO keyword,
3015 for example @kbd{3 r}.  If you often need a search for a specific
3016 keyword, define a custom command for it (@pxref{Agenda dispatcher}).
3017 @end table
3019 Remote editing of TODO items means that you can change the state of a
3020 TODO entry with a single key press.  The commands available in the
3021 TODO list are described in @ref{Agenda commands}.
3023 @node Matching headline tags, Timeline, Global TODO list, Agenda views
3024 @section Matching headline tags
3025 @cindex matching, of tags
3026 @cindex tags view
3028 If headlines in the agenda files are marked with @emph{tags}
3029 (@pxref{Tags}), you can select headlines based on the tags that apply
3030 to them and collect them into an agenda buffer.
3032 @table @kbd
3033 @kindex C-c a m
3034 @item C-c a m
3035 Produce a list of all headlines that match a given set of tags.  The
3036 command prompts for a selection criterion, which is a boolean logic
3037 expression with tags, like @samp{+WORK+URGENT-WITHBOSS} or
3038 @samp{WORK|HOME} (@pxref{Tags}).  If you often need a specific search,
3039 define a custom command for it (@pxref{Agenda dispatcher}).
3040 @kindex C-c a M
3041 @item C-c a M
3042 Like @kbd{C-c a m}, but only select headlines that are also TODO items
3043 and force checking subitems (see variable
3044 @code{org-tags-match-list-sublevels}.
3045 @end table
3047 The commands available in the tags list are described in @ref{Agenda
3048 commands}.
3050 @node Timeline, Agenda commands, Matching headline tags, Agenda views
3051 @section Timeline for a single file
3052 @cindex single file summary
3053 @cindex agenda, for single file
3054 @cindex timeline, single file
3055 @cindex time-sorted view
3057 The timeline is not really an agenda view, because it only summarizes
3058 items from a single Org-mode file.  But it also uses the agenda buffer
3059 and provides similar commands, so we discuss it here.  The timeline
3060 shows all time-stamped items in a single Org-mode file (or the
3061 selected part of it), in a @emph{time-sorted view}.  The main purpose of
3062 this command is to give an overview over events in a project.
3064 @table @kbd
3065 @kindex C-c C-r
3066 @item C-c C-r
3067 Show a time-sorted view of the org file, with all time-stamped items.
3068 When called with a @kbd{C-u} prefix, all unfinished TODO entries
3069 (scheduled or not) are also listed under the current date.
3070 @end table
3072 @noindent
3073 The commands available in the timeline buffer are listed in
3074 @ref{Agenda commands}.
3076 @node Agenda commands,  , Timeline, Agenda views
3077 @section Commands in the agenda buffer
3078 @cindex commands, in agenda buffer
3080 Entries in the agenda buffer are linked back to the org file or diary
3081 file where they originate.  You are not allowed to edit the agenda
3082 buffer itself, but commands are provided to show and jump to the
3083 original entry location, and to edit the org-files ``remotely'' from
3084 the agenda buffer.  In this way, all information is stored only once,
3085 removing the risk that your agenda and note files may diverge.
3087 Some commands can be executed with mouse clicks on agenda lines.  For
3088 the other commands, the cursor needs to be in the desired line.
3090 @table @kbd
3091 @tsubheading{Motion}
3092 @kindex n
3093 @item n
3094 Next line (same as @key{up}).
3095 @kindex p
3096 @item p
3097 Previous line (same as @key{down}).
3098 @tsubheading{View/GoTo org file}
3099 @kindex mouse-3
3100 @kindex @key{SPC}
3101 @item mouse-3
3102 @itemx @key{SPC}
3103 Display the original location of the item in another window.
3105 @kindex L
3106 @item L
3107 Display original location and recenter that window.
3109 @kindex mouse-2
3110 @kindex mouse-1
3111 @kindex @key{TAB}
3112 @item mouse-2
3113 @itemx mouse-1
3114 @itemx @key{TAB}
3115 Go to the original location of the item in another window.  Under Emacs
3116 22, @kbd{mouse-1} will also works for this.
3118 @kindex @key{RET}
3119 @itemx @key{RET}
3120 Go to the original location of the item and delete other windows.
3122 @kindex f
3123 @item f
3124 Toggle Follow mode.  In Follow mode, as you move the cursor through
3125 the agenda buffer, the other window always shows the corresponding
3126 location in the org file.  The initial setting for this mode in new
3127 agenda buffers can be set with the variable
3128 @code{org-agenda-start-with-follow-mode}.
3130 @kindex l
3131 @item l
3132 Toggle Logbook mode.  In Logbook mode, entries that where marked DONE while
3133 logging was on (variable @code{org-log-done}) are shown in the agenda,
3134 as are entries that have been clocked on that day.
3136 @tsubheading{Change display}
3137 @kindex o
3138 @item o
3139 Delete other windows.
3141 @kindex w
3142 @item w
3143 Switch to weekly view (7 days displayed together).
3145 @kindex d
3146 @item d
3147 Switch to daily view (just one day displayed).
3149 @kindex D
3150 @item D
3151 Toggle the inclusion of diary entries.  See @ref{Calendar/Diary integration}.
3153 @kindex g
3154 @item g
3155 Toggle the time grid on and off.  See also the variables
3156 @code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
3158 @kindex r
3159 @item r
3160 Recreate the agenda buffer, for example to reflect the changes
3161 after modification of the time stamps of items with S-@key{left} and
3162 S-@key{right}.  When the buffer is the global todo list, a prefix
3163 argument is interpreted to create a selective list for a specific TODO
3164 keyword.
3166 @kindex @key{right}
3167 @item @key{right}
3168 Display the following @code{org-agenda-ndays} days.  For example, if
3169 the display covers a week, switch to the following week.  With prefix
3170 arg, go forward that many times @code{org-agenda-ndays} days.
3172 @kindex @key{left}
3173 @item @key{left}
3174 Display the previous dates.
3176 @kindex .
3177 @item .
3178 Goto today.
3180 @tsubheading{Remote editing}
3182 @item 0-9
3183 Digit argument.
3185 @kindex t
3186 @item t
3187 Change the TODO state of the item, both in the agenda and in the
3188 original org file.
3190 @kindex T
3191 @item T
3192 Show all tags associated with the current item.  Because of
3193 inheritance, this may be more than the tags listed in the line itself.
3195 @kindex :
3196 @item :
3197 Set tags for the current headline.
3199 @kindex a
3200 @item a
3201 Toggle the ARCHIVE tag for the current headline.
3203 @kindex ,
3204 @item ,
3205 Set the priority for the current item.  Org-mode prompts for the
3206 priority character. If you reply with @key{SPC}, the priority cookie
3207 is removed from the entry.
3209 @kindex P
3210 @item p
3211 Display weighted priority of current item.
3213 @kindex +
3214 @kindex S-@key{up}
3215 @item +
3216 @itemx S-@key{up}
3217 Increase the priority of the current item.  The priority is changed in
3218 the original buffer, but the agenda is not resorted.  Use the @kbd{r}
3219 key for this.
3221 @kindex -
3222 @kindex S-@key{down}
3223 @item -
3224 @itemx S-@key{down}
3225 Decrease the priority of the current item.
3227 @kindex C-c C-s
3228 @item C-c C-s
3229 Schedule this item
3231 @kindex C-c C-d
3232 @item C-c C-d
3233 Set a deadline for this item.
3235 @kindex S-@key{right}
3236 @item S-@key{right}
3237 Change the time stamp associated with the current line by one day into
3238 the future.  With prefix argument, change it by that many days.  For
3239 example, @kbd{3 6 5 S-@key{right}} will change it by a year.  The
3240 stamp is changed in the original org file, but the change is not
3241 directly reflected in the agenda buffer.  Use the
3242 @kbd{r} key to update the buffer.
3244 @kindex S-@key{left}
3245 @item S-@key{left}
3246 Change the time stamp associated with the current line by one day
3247 into the past.
3249 @kindex >
3250 @item >
3251 Change the time stamp associated with the current line to today.
3252 The key @kbd{>} has been chosen, because it is the same as @kbd{S-.}
3253 on my keyboard.
3255 @kindex I
3256 @item I
3257 Start the clock on the current item.  If a clock is running already, it
3258 is stopped first.
3259 @kindex O
3260 @item O
3261 Stop the previously started clock.
3262 @kindex X
3263 @item X
3264 Cancel the currently running clock.
3266 @tsubheading{Calendar commands}
3267 @kindex c
3268 @item c
3269 Open the Emacs calendar and move to the date at the agenda cursor.
3271 @item c
3272 When in the calendar, compute and show the Org-mode agenda for the
3273 date at the cursor.
3275 @cindex diary entries, creating from agenda
3276 @kindex i
3277 @item i
3278 Insert a new entry into the diary.  Prompts for the type of entry
3279 (day, weekly, monthly, yearly, anniversary, cyclic) and creates a new
3280 entry in the diary, just as @kbd{i d} etc. would do in the calendar.
3281 The date is taken from the cursor position.
3283 @kindex M
3284 @item M
3285 Show the phases of the moon for the three months around current date.
3287 @kindex S
3288 @item S
3289 Show sunrise and sunset times.  The geographical location must be set
3290 with calendar variables, see documentation of the Emacs calendar.
3292 @kindex C
3293 @item C
3294 Convert the date at cursor into many other cultural and historic
3295 calendars.
3297 @kindex H
3298 @item H
3299 Show holidays for three month around the cursor date.
3301 @kindex C-c C-x C-c
3302 @item C-c C-x C-c
3303 Export a single iCalendar file containing entries from all agenda files.
3305 @tsubheading{Quit and Exit}
3306 @kindex q
3307 @item q
3308 Quit agenda, remove the agenda buffer.
3310 @kindex x
3311 @cindex agenda files, removing buffers
3312 @item x
3313 Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
3314 for the compilation of the agenda.  Buffers created by the user to
3315 visit org files will not be removed.
3317 @end table
3319 @node Embedded LaTeX, Exporting, Agenda views, Top
3320 @chapter Embedded LaTeX
3321 @cindex @TeX{} interpretation
3322 @cindex La@TeX{} interpretation
3324 Plain ASCII is normally sufficient for almost all note taking.  One
3325 exception, however, are scientific notes which need to be able to
3326 contain mathematical symbols and the occasional formula.
3327 La@TeX{}@footnote{La@TeX{} is a macro system based on Donald E. Knuth's
3328 @TeX{} system.  Many of the features described here as ``La@TeX{}'' are
3329 really from @TeX{}, but for simplicity I am blurring this distinction.}
3330 is widely used to typeset scientific documents. Org-mode supports
3331 embedding La@TeX{} code into its files, because many academics are used
3332 to read La@TeX{} source code, and because it can be readily processed
3333 into images for HTML production.
3335 It is not necessary to mark La@TeX{} macros and code in any special way.
3336 If you observe a few conventions, Org-mode knows how to find it and what
3337 to do with it.
3339 @menu
3340 * Math symbols::                TeX macros for symbols and Greek letters
3341 * Subscripts and Superscripts::  Simple syntax for raising/lowering text
3342 * LaTeX fragments::             Complex formulas made easy
3343 * Processing LaTeX fragments::  Previewing LaTeX processing
3344 * CDLaTeX mode::                Speed up entering of formulas
3345 @end menu
3347 @node Math symbols, Subscripts and Superscripts, Embedded LaTeX, Embedded LaTeX
3348 @section Math symbols
3350 You can use La@TeX{} macros to insert special symbols like @samp{\alpha}
3351 to indicate the Greek letter, or @samp{\to} to indicate an arrow.
3352 Completion for these macros is available, just type @samp{\} and maybe a
3353 few letters, and press @kbd{M-@key{TAB}} to see possible completions.
3354 Unlike La@TeX{} code, Org-mode allows these macros to be present
3355 without surrounding math delimiters, for example:
3357 @example
3358 Angles are written as Greek letters \alpha, \beta and \gamma.
3359 @end example
3361 During HTML export (@pxref{HTML export}), these symbols are translated
3362 into the proper syntax for HTML, for the above examples this is
3363 @samp{&alpha;} and @samp{&rarr;}, respectively.
3365 @node Subscripts and Superscripts, LaTeX fragments, Math symbols, Embedded LaTeX
3366 @section Subscripts and Superscripts
3368 Just like in La@TeX{}, @samp{^} and @samp{_} are used to indicate super-
3369 and subscripts.  Again, these can be used without embedding them in
3370 math-mode delimiters.  To increase the readability of ASCII text, it is
3371 not necessary (but OK) to surround multi-character sub- and superscripts
3372 with curly braces.  For example
3374 @example
3375 The mass if the sun is M_sun = 1.989 x 10^30 kg.  The radius of
3376 the sun is R_@{sun@} = 6.96 x 10^8 m.
3377 @end example
3379 To avoid interpretation as raised or lowered text, you can quote
3380 @samp{^} and @samp{_} with a backslash: @samp{\_} and @samp{\^}.
3382 During HTML export (@pxref{HTML export}), subscript and superscripts
3383 are surrounded with @code{<sub>} and @code{<sup>} tags, respectively.
3385 @node LaTeX fragments, Processing LaTeX fragments, Subscripts and Superscripts, Embedded LaTeX
3386 @section LaTeX fragments
3388 With symbols, sub- and superscripts, HTML is pretty much at its end when
3389 it comes to representing mathematical formulas.  More complex
3390 expressions need a dedicated formula processor.  To this end, Org-mode
3391 can contain arbitrary La@TeX{} fragments.  It provides commands to
3392 preview the typeset result of these fragments, and upon export to HTML,
3393 all fragments will be converted to images and inlined into the HTML
3394 document.  For this to work you need to be on a system with a working
3395 La@TeX{} installation.  You also need the @file{dvipng} program,
3396 available at @url{http://sourceforge.net/projects/dvipng/}.
3398 La@TeX{} fragments don't need any special marking at all.  The following
3399 snippets will be identified as LaTeX source code:
3400 @itemize @bullet
3401 @item
3402 Environments of any kind.  The only requirement is that the
3403 @code{\begin} statement appears on a new line, preceded by only
3404 whitespace.
3405 @item
3406 Text within the usual La@TeX{} math delimiters.  To avoid conflicts with
3407 currency specifications, single @samp{$} characters are only recognized
3408 as math delimiters if the enclosed text contains at most two line breaks,
3409 is directly attached to the @samp{$} characters with no whitespace in
3410 between, and if the closing @samp{$} is followed by whitespace or
3411 punctuation.  For the other delimiters, there is no such restriction, so
3412 when in doubt, use @samp{\(...\)} as inline math delimiters.
3413 @end itemize
3415 @noindent For example:
3417 @example
3418 \begin@{equation@}                          % arbitrary environments,
3419 x=\sqrt@{b@}                                % even tables, figures
3420 \end@{equation@}                            % etc
3422 If $a^2=b$ and \( b=2 \), then the solution must be
3423 either $$ a=+\sqrt@{2@} $$ or \[ a=-\sqrt@{2@} \].
3424 @end example
3426 @noindent
3427 If you need any of the delimiter ASCII sequences for other purposes, you
3428 can configure the option @code{org-format-latex-options} to deselect the
3429 ones you do not wish to have interpreted by the La@TeX{} converter.
3431 @node Processing LaTeX fragments, CDLaTeX mode, LaTeX fragments, Embedded LaTeX
3432 @section Processing LaTeX fragments
3434 La@TeX{} fragments can be processed to produce a preview images of the
3435 typeset expressions:
3437 @table @kbd
3438 @kindex C-c C-x C-l
3439 @item C-c C-x C-l
3440 Produce a preview image of the La@TeX{} fragment at point and overlay it
3441 over the source code.  If there is no fragment at point, process all
3442 fragments in the current entry (between two headlines).  When called
3443 with a prefix argument, process the entire subtree.  When called with
3444 two prefix arguments, or when the cursor is before the first headline,
3445 process the entire buffer.
3446 @kindex C-c C-c
3447 @item C-c C-c
3448 Remove the overlay preview images.
3449 @end table
3451 During HTML export (@pxref{HTML export}), all La@TeX{} fragments are
3452 converted into images and inlined into the document if the following
3453 setting is active:
3455 @lisp
3456 (setq org-export-with-LaTeX-fragments t)
3457 @end lisp
3459 @node CDLaTeX mode,  , Processing LaTeX fragments, Embedded LaTeX
3460 @section Using CDLaTeX to enter math
3462 CDLaTeX-mode is a minor mode that is normally used in combination with a
3463 major LaTeX mode like AUCTeX in order to speed-up insertion of
3464 environments and math templates.  Inside Org-mode, you can make use of
3465 some of the features of cdlatex-mode.  You need to install
3466 @file{cdlatex.el} and @file{texmathp.el} (the latter comes also with
3467 AUCTeX) from @url{http://www.astro.uva.nl/~dominik/Tools/cdlatex}.
3468 Don't turn cdlatex-mode itself under Org-mode, but use the light
3469 version @code{org-cdlatex-mode} that comes as part of Org-mode.  Turn it
3470 on for the current buffer with @code{M-x org-cdlatex-mode}, or for all
3471 Org-mode files with
3473 @lisp
3474 (add-hook 'org-mode-hook 'turn-on-org-cdlatex)
3475 @end lisp
3477 When this mode is enabled, the following features are present (for more
3478 details see the documentation of cdlatex-mode):
3479 @itemize @bullet
3480 @kindex C-c @{
3481 @item
3482 Environment templates can be inserted with @kbd{C-c @{}.
3483 @item
3484 @kindex @key{TAB}
3485 The @key{TAB} key will do template expansion if the cursor is inside a
3486 LaTeX fragment@footnote{Org-mode has a method to test if the cursor is
3487 inside such a fragment, see the documentation of the function
3488 @code{org-inside-LaTeX-fragment-p}.}.  For example, @key{TAB} will
3489 expand @code{fr} to @code{\frac@{@}@{@}} and position the cursor
3490 correctly inside the first brace.  Another @key{TAB} will get you into
3491 the second brace.  Even outside fragments, @key{TAB} will expand
3492 environment abbreviations at the beginning of a line.  For example, if
3493 you write @samp{equ} at the beginning of a line and press @key{TAB},
3494 this abbreviation will be expanded to an @code{equation} environment.
3495 To get a list of all abbreviations, type @kbd{M-x cdlatex-command-help}.
3496 @item
3497 @kindex _
3498 @kindex ^
3499 Pressing @kbd{_} and @kbd{^} inside a LaTeX fragment will insert these
3500 characters together with a pair of braces.  If you use @key{TAB} to move
3501 out of the braces, and if the braces surround only a single character or
3502 macro, they are removed again (depending on the variable
3503 @code{cdlatex-simplify-sub-super-scripts}).
3504 @item
3505 @kindex `
3506 Pressing the backquote @kbd{`} followed by a character inserts math
3507 macros, also outside LaTeX fragments.  If you wait more than 1.5 seconds
3508 after the backquote, a help window will pop up.
3509 @item
3510 @kindex '
3511 Pressing the normal quote @kbd{'} followed by another character modifies
3512 the symbol before point with an accent or a font.  If you wait more than
3513 1.5 seconds after the backquote, a help window will pop up.  Character
3514 modification will work only inside La@TeX{} fragments, outside the quote
3515 is normal.
3516 @end itemize
3518 @node Exporting, Publishing, Embedded LaTeX, Top
3519 @chapter Exporting
3520 @cindex exporting
3522 Org-mode documents can be exported into a variety of other formats.  For
3523 printing and sharing of notes, ASCII export produces a readable and
3524 simple version of an Org-mode file.  HTML export allows you to publish a
3525 notes file on the web, while the XOXO format provides a solid base for
3526 exchange with a broad range of other applications.  To incorporate
3527 entries with associated times like deadlines or appointments into a
3528 desktop calendar program like iCal, Org-mode can also produce extracts
3529 in the iCalendar format.  Currently Org-mode only supports export, not
3530 import of these different formats.
3532 When exporting, Org-mode uses special conventions to enrich the output
3533 produced.  @xref{Text interpretation}, for more details.
3535 @menu
3536 * ASCII export::                Exporting to plain ASCII
3537 * HTML export::                 Exporting to HTML
3538 * XOXO export::                 Exporting to XOXO
3539 * iCalendar export::            Exporting in iCalendar format
3540 * Text interpretation::         How the exporter looks at the file
3541 @end menu
3543 @node ASCII export, HTML export, Exporting, Exporting
3544 @section ASCII export
3545 @cindex ASCII export
3547 ASCII export produces a simple and very readable version of an Org-mode
3548 file.
3550 @cindex region, active
3551 @cindex active region
3552 @cindex transient-mark-mode
3553 @table @kbd
3554 @kindex C-c C-x a
3555 @item C-c C-x a
3556 Export as ASCII file.  If there is an active region, only the region
3557 will be exported.  For an org file @file{myfile.org}, the ASCII file
3558 will be @file{myfile.txt}.  The file will be overwritten without
3559 warning.
3560 @kindex C-c C-x v a
3561 @item C-c C-x v a
3562 Export only the visible part of the document.
3563 @end table
3565 @cindex headline levels, for exporting
3566 In the exported version, the first 3 outline levels will become
3567 headlines, defining a general document structure.  Additional levels
3568 will be exported as itemized lists.  If you want that transition to occur
3569 at a different level, specify it with a prefix argument.  For example,
3571 @example
3572 @kbd{C-1 C-c C-x a}
3573 @end example
3575 @noindent
3576 creates only top level headlines and does the rest as items.  When
3577 headlines are converted to items, the indentation of the text following
3578 the headline is changed to fit nicely under the item.  This is done with
3579 the assumption that the first bodyline indicates the base indentation of
3580 the body text.  Any indentation larger than this is adjusted to preserve
3581 the layout relative to the first line.  Should there be lines with less
3582 indentation than the first, these are left alone.
3584 @node HTML export, XOXO export, ASCII export, Exporting
3585 @section HTML export
3586 @cindex HTML export
3588 Org-mode contains an HTML (XHTML 1.0 strict) exporter with extensive
3589 HTML formatting, in ways similar to John Grubers @emph{markdown}
3590 language, but with additional support for tables.
3592 @cindex region, active
3593 @cindex active region
3594 @cindex transient-mark-mode
3595 @table @kbd
3596 @kindex C-c C-x h
3597 @item C-c C-x h
3598 Export as HTML file @file{myfile.html}.
3599 @kindex C-c C-x b
3600 @item C-c C-x b
3601 Export as HTML file and open it with a browser.
3602 @kindex C-c C-x v h
3603 @kindex C-c C-x v b
3604 @item C-c C-x v h
3605 @item C-c C-x v b
3606 Export only the visible part of the document.
3607 @end table
3609 @cindex headline levels, for exporting
3610 In the exported version, the first 3 outline levels will become
3611 headlines, defining a general document structure.  Additional levels
3612 will be exported as itemized lists.  If you want that transition to occur
3613 at a different level, specify it with a prefix argument.  For example,
3615 @example
3616 @kbd{C-2 C-c C-x b}
3617 @end example
3619 @noindent
3620 creates two levels of headings and does the rest as items.
3622 If you want to include HTML tags which should be interpreted as such,
3623 mark them with @samp{@@} as in @samp{@@<b>bold text@@</b>}.
3624 Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
3625 @samp{&gt;} in HTML export.
3627 @cindex links, in HTML export
3628 @cindex internal links, in HTML export
3629 @cindex external links, in HTML export
3630 Internal links (@pxref{Internal links}) will continue to work in HTML
3631 files only if they match a dedicated @samp{<<target>>}.  Automatic links
3632 created by radio targets (@pxref{Radio targets}) will also work in the
3633 HTML file.  Links to external files will still work if the HTML file is
3634 in the same directory as the Org-mode file.  Links to other @file{.org}
3635 files will be translated into HTML links under the assumption that an
3636 HTML version also exists of the linked file.  For information related to
3637 linking files while publishing them to a publishing directory see
3638 @ref{Publishing links}.
3640 You can also give style information for the exported file.  The HTML
3641 exporter assigns the following CSS classes to appropriate parts of the
3642 document - your style specifications may change these:
3643 @example
3644 .todo           @r{TODO keywords}
3645 .done           @r{the DONE keyword}
3646 .timestamp      @r{time stamp}
3647 .timestamp-kwd  @r{keyword associated with a time stamp, like SCHEDULED}
3648 .tag            @r{tag in a headline}
3649 .target         @r{target for links}
3650 @end example
3652 The default style specification can be configured through the option
3653 @code{org-export-html-style}.  If you want to use a file-local style,
3654 you may use file variables, best wrapped into a COMMENT section at the
3655 end of the outline tree.  For example:
3657 @example
3658 * COMMENT HTML style specifications
3660 # Local Variables:
3661 # org-export-html-style: "   <style type=\"text/css\">
3662 #       p @{font-weight: normal; color: gray; @}
3663 #       h1 @{color: black; @}
3664 #   </style>"
3665 # End:
3666 @end example
3668 Remember to execute @kbd{M-x normal-mode} after changing this to make
3669 the new style visible to Emacs.  This command restarts org-mode for the
3670 current buffer and forces Emacs to re-evaluate the local variables
3671 section in the buffer.
3673 @c FIXME: More about header and footer styles
3674 @c FIXME: Talk about links and targets.
3676 @node XOXO export, iCalendar export, HTML export, Exporting
3677 @section XOXO export
3678 @cindex XOXO export
3680 Org-mode contains an exporter that produces XOXO-style output.
3681 Currently, this exporter only handles the general outline structure and
3682 does not interpret any additional Org-mode features.
3684 @table @kbd
3685 @kindex C-c C-x C-x
3686 @item C-c C-x C-x
3687 Export as XOXO file @file{myfile.html}.
3688 @kindex C-c C-x v
3689 @item C-c C-x v x
3690 Export only the visible part of the document.
3691 @end table
3693 @node iCalendar export, Text interpretation, XOXO export, Exporting
3694 @section iCalendar export
3695 @cindex iCalendar export
3697 Some people like to use Org-mode for keeping track of projects, but
3698 still prefer a standard calendar application for anniversaries and
3699 appointments.  In this case it can be useful to have deadlines and
3700 other time-stamped items in Org-mode files show up in the calendar
3701 application.  Org-mode can export calendar information in the standard
3702 iCalendar format.
3704 @table @kbd
3705 @kindex C-c C-x i
3706 @item C-c C-x i
3707 Create iCalendar entries for the current file and store them in the same
3708 directory, using a file extension @file{.ics}.
3709 @kindex C-c C-x C-i
3710 @item C-c C-x C-i
3711 Like @kbd{C-c C-x i}, but do this for all files in
3712 @code{org-agenda-files}.  For each of these files, a separate iCalendar
3713 file will be written.
3714 @kindex C-c C-x c
3715 @item C-c C-x c
3716 Create a single large iCalendar file from all files in
3717 @code{org-agenda-files} and write it to the file given by
3718 @code{org-combined-agenda-icalendar-file}.
3719 @end table
3721 How this calendar is best read and updated, depends on the application
3722 you are using.  For example, when using iCal under Apple MacOS X, you
3723 could create a new calendar @samp{OrgMode} (the default name for the
3724 calendar created by @kbd{C-c C-x c}, see the variables
3725 @code{org-icalendar-combined-name} and
3726 @code{org-combined-agenda-icalendar-file}).  Then set Org-mode to
3727 overwrite the corresponding file
3728 @file{~/Library/Calendars/OrgMode.ics}.  You may even use AppleScript
3729 to make iCal re-read the calendar files each time a new version of
3730 @file{OrgMode.ics} is produced.  Here is the setup needed for this:
3732 @cindex applescript, for calendar update
3733 @lisp
3734 (setq org-combined-agenda-icalendar-file
3735     "~/Library/Calendars/OrgMode.ics")
3736 (add-hook 'org-after-save-iCalendar-file-hook
3737  (lambda ()
3738   (shell-command
3739    "osascript -e 'tell application \"iCal\" to reload calendars'")))
3740 @end lisp
3742 @node Text interpretation,  , iCalendar export, Exporting
3743 @section Text interpretation by the exporter
3745 The exporter backends interpret additional structure in the Org-mode file
3746 in order to produce better output.
3748 @menu
3749 * Comment lines::               Some lines will not be exported
3750 * Enhancing text::              Subscripts, symbols and more
3751 * Export options::              How to influence the export settings
3752 @end menu
3754 @node Comment lines, Enhancing text, Text interpretation, Text interpretation
3755 @subsection Comment lines
3756 @cindex comment lines
3757 @cindex exporting, not
3759 Lines starting with @samp{#} in column zero are treated as comments
3760 and will never be exported.  Also entire subtrees starting with the
3761 word @samp{COMMENT} will never be exported.  Finally, any text before
3762 the first headline will not be exported either.
3764 @table @kbd
3765 @kindex C-c ;
3766 @item C-c ;
3767 Toggle the COMMENT keyword at the beginning of an entry.
3768 @end table
3770 @node Enhancing text, Export options, Comment lines, Text interpretation
3771 @subsection Enhancing text for export
3772 @cindex enhancing text
3773 @cindex richer text
3775 Some of the export backends of Org-mode allow for sophisticated text
3776 formatting, this is true in particular for the HTML backend.  Org-mode
3777 has a number of typing conventions that allow to produce a richly
3778 formatted output.
3780 @itemize @bullet
3782 @cindex hand-formatted lists
3783 @cindex lists, hand-formatted
3784 @item
3785 Plain lists @samp{-}, @samp{*} or @samp{+} as bullet, or with @samp{1.}
3786 or @samp{2)} as enumerator will be recognized and transformed if the
3787 backend supports lists.  See @xref{Plain lists}.
3789 @cindex underlined text
3790 @cindex bold text
3791 @cindex italic text
3792 @item
3793 You can make words @b{*bold*}, @i{/italic/}, _underlined_,
3794 @code{=code=}, and @samp{+strikethrough+}.
3796 @cindex LaTeX fragments, export
3797 @cindex TeX macros, export
3798 @item
3799 Many @TeX{} macros and entire La@TeX{} fragments are converted into HTML
3800 entities or images (@pxref{Embedded LaTeX}).
3802 @cindex tables, export
3803 @item
3804 Tables are transformed into native tables under the exporter, if the
3805 export backend supports this. Data fields before the first horizontal
3806 separator line will be formatted as table header fields.
3808 @cindex fixed width
3809 @item
3810 If a headline starts with the word @samp{QUOTE}, the text below the
3811 headline will be typeset as fixed-width, to allow quoting of computer
3812 codes etc.  Lines starting with @samp{:} are also typeset in
3813 fixed-width font.
3814 @table @kbd
3815 @kindex C-c :
3816 @item C-c :
3817 Toggle fixed-width for entry (QUOTE) or region, see below.
3818 @end table
3820 @cindex linebreak, forced
3821 @item 
3822 A double backslash @emph{at the end of a line} enforces a line break at
3823 this position.
3824 @end itemize
3826 If these conversions conflict with your habits of typing ASCII text,
3827 they can all be turned off with corresponding variables (see the
3828 customization group @code{org-export-general}, and the following section
3829 which explains how to set export options with special lines in a
3830 buffer.
3833 @node Export options,  , Enhancing text, Text interpretation
3834 @subsection Export options
3835 @cindex options, for export
3837 @cindex completion, of option keywords
3838 The exporter recognizes special lines in the buffer which provide
3839 additional information.  These lines may be put anywhere in the file.
3840 The whole set of lines can be inserted into the buffer with @kbd{C-c
3841 C-x t}.  For individual lines, a good way to make sure the keyword is
3842 correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
3843 (@pxref{Completion}).
3845 @table @kbd
3846 @kindex C-c C-x t
3847 @item C-c C-x t
3848 Insert template with export options, see example below.
3849 @end table
3851 @example
3852 #+TITLE:     the title to be shown (default is the buffer name)
3853 #+AUTHOR:    the author (default taken from @code{user-full-name})
3854 #+EMAIL:     his/her email address (default from @code{user-mail-address})
3855 #+LANGUAGE:  language for HTML, e.g. @samp{en} (@code{org-export-default-language})
3856 #+TEXT:      Some descriptive text to be inserted at the beginning.
3857 #+TEXT:      Several lines may be given.
3858 #+OPTIONS:   H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t *:nil TeX:t LaTeX:t
3859 @end example
3861 @noindent
3862 The OPTIONS line is a compact form to specify export settings.  Here
3863 you can:
3864 @cindex headline levels
3865 @cindex section-numbers
3866 @cindex table of contents
3867 @cindex linebreak preservation
3868 @cindex quoted HTML tags
3869 @cindex fixed-width sections
3870 @cindex tables
3871 @cindex @TeX{}-like syntax for sub- and superscripts
3872 @cindex emphasized text
3873 @cindex @TeX{} macros
3874 @cindex La@TeX{} fragments
3875 @example
3876 H:      @r{set the number of headline levels for export}
3877 num:    @r{turn on/off section-numbers}
3878 toc:    @r{turn on/off table of contents}
3879 \n:     @r{turn on/off linebreak-preservation}
3880 @@:      @r{turn on/off quoted HTML tags}
3881 ::      @r{turn on/off fixed-width sections}
3882 |:      @r{turn on/off tables}
3883 ^:      @r{turn on/off @TeX{}-like syntax for sub- and superscripts.}
3884 *:      @r{turn on/off emphasized text (bold, italic, underlined)}
3885 TeX:    @r{turn on/off simple @TeX{} macros in plain text}
3886 LaTeX:  @r{turn on/off La@TeX{} fragments}
3887 @end example
3889 @node Publishing, Miscellaneous, Exporting, Top
3890 @chapter Publishing
3891 @cindex publishing
3893 Org-mode includes@footnote{@file{org-publish.el} is not yet part of
3894 emacs, so if you are using @file{org.el} as it comes with Emacs, you
3895 need to download this file separately.  Also make sure org.el is at
3896 least version 4.27.} a publishing management system
3897 that allows you to configure automatic HTML conversion of
3898 @emph{projects} composed of interlinked org files.  This system is
3899 called @emph{org-publish}.  You can also configure org-publish to
3900 automatically upload your exported HTML pages and related attachments,
3901 such as images and source code files, to a web server.  Org-publish turns
3902 org-mode into a web-site authoring tool.
3904 Org-publish has been contributed to Org-mode by David O'Toole.
3906 @menu
3907 * Configuration::               Defining projects
3908 * Sample configuration::        Example projects
3909 * Triggering publication::      Publication commands
3910 @end menu
3912 @node Configuration, Sample configuration, Publishing, Publishing
3913 @section Configuration
3915 Publishing needs significant configuration to specify files, destination
3916 and many other properties of a project.
3918 @menu
3919 * Project alist::               The central configuration variable
3920 * Sources and destinations::    From here to there
3921 * Selecting files::             What files are part of the project?
3922 * Publishing action::           Setting the function doing the publishing
3923 * Publishing options::          Tweaking HTML export
3924 * Publishing links::            Which links keep working after publishing?
3925 * Project page index::          Publishing a list of project files
3926 @end menu
3928 @node Project alist, Sources and destinations, Configuration, Configuration
3929 @subsection The variable @code{org-publish-project-alist}
3930 @cindex org-publish-project-alist
3931 @cindex projects, for publishing
3933 Org-publish is configured almost entirely through setting the value of
3934 one variable, called @code{org-publish-project-alist}.
3935 Each element of the list configures one project, and may be in one of
3936 the two following forms:
3938 @lisp
3939 ("project-name"  :property value :property value ...)
3941 @r{or} 
3943 ("project-name"  :components ("project-name" "project-name" ...))
3945 @end lisp
3947 In both cases, projects are configured by specifying property values.
3948 A project defines the set of files that will be published, as well as
3949 the publishing configuration to use when publishing those files.  When
3950 a project takes the second form listed above, the individual members
3951 of the ``components'' property are taken to be components of the
3952 project, which group together files requiring different publishing
3953 options. When you publish such a ``meta-project'' all the components
3954 will also publish.
3956 @node Sources and destinations, Selecting files, Project alist, Configuration
3957 @subsection Sources and destinations for files
3958 @cindex directories, for publishing
3960 Most properties are optional, but some should always be set. In
3961 particular, org-publish needs to know where to look for source files,
3962 and where to put published files.
3964 @multitable @columnfractions 0.3 0.7
3965 @item @code{:base-directory}
3966 @tab Directory containing publishing source files
3967 @item @code{:publishing-directory}
3968 @tab Directory (possibly remote) where output files will be published.
3969 @end multitable
3970 @noindent
3972 @node Selecting files, Publishing action, Sources and destinations, Configuration
3973 @subsection Selecting files
3974 @cindex files, selecting for publishing
3976 By default, all files with extension @file{.org} in the base directory
3977 are considered part of the project.  This can be modified by setting the
3978 properties 
3979 @multitable @columnfractions 0.25 0.75
3980 @item @code{:base-extension}
3981 @tab Extension (without the dot!) of source files.  This actually is a
3982 regular expression.
3984 @item @code{:exclude} 
3985 @tab Regular expression to match file names that should not be
3986 published, even though they have been selected on the basis of their
3987 extension.
3989 @item @code{:include}
3990 @tab List of files to be included regardless of @code{:base-extension}
3991 and @code{:exclude}.
3992 @end multitable
3994 @node Publishing action, Publishing options, Selecting files, Configuration
3995 @subsection Publishing Action
3996 @cindex action, for publishing
3998 Publishing means that a file is copied to the destination directory and
3999 possibly transformed in the process.  The default transformation is to
4000 export Org-mode files as HTML files, and this is done by the function
4001 @code{org-publish-org-to-html} which calls the HTML exporter
4002 (@pxref{HTML export}).  Other files like images only need to be copied
4003 to the publishing destination.  For non-Org-mode files, you need to
4004 specify the publishing function.
4006 @multitable @columnfractions 0.3 0.7
4007 @item @code{:publishing-function}
4008 @tab Function executing the publication of a file.
4009 @end multitable
4011 The function must accept two arguments: a property list containing at
4012 least a @code{:publishing-directory} property, and the name of the file
4013 to be published.  It should take the specified file, make the necessary
4014 transformation (if any) and place the result into the destination folder.
4015 You can write your own publishing function, but @code{org-publish}
4016 provides one for attachments (files that only need to be copied):
4017 @code{org-publish-attachment}.
4019 @node Publishing options, Publishing links, Publishing action, Configuration
4020 @subsection Options for the HTML exporter
4021 @cindex options, for publishing
4023 The property list can be used to set many export options for the HTML
4024 exporter.  In most cases, these properties correspond to user variables
4025 in Org-mode.  The table below lists these properties along with the
4026 variable they belong to.  See the documentation string for the
4027 respective variable for details.
4029 @multitable @columnfractions 0.3 0.7
4030 @item @code{:language}              @tab @code{org-export-default-language}
4031 @item @code{:headline-levels}       @tab @code{org-export-headline-levels}
4032 @item @code{:section-numbers}       @tab @code{org-export-with-section-numbers}
4033 @item @code{:table-of-contents}     @tab @code{org-export-with-toc}
4034 @item @code{:archived-trees}        @tab @code{org-export-with-archived-trees}
4035 @item @code{:emphasize}             @tab @code{org-export-with-emphasize}
4036 @item @code{:sub-superscript}       @tab @code{org-export-with-sub-superscripts}
4037 @item @code{:TeX-macros}            @tab @code{org-export-with-TeX-macros}
4038 @item @code{:LaTeX-fragments}       @tab @code{org-export-with-LaTeX-fragments}
4039 @item @code{:fixed-width}           @tab @code{org-export-with-fixed-width}
4040 @item @code{:timestamps}           .@tab @code{org-export-with-timestamps}
4041 @item @code{:tags}                 .@tab @code{org-export-with-tags}
4042 @item @code{:tables}                @tab @code{org-export-with-tables}
4043 @item @code{:table-auto-headline}   @tab @code{org-export-highlight-first-table-line}
4044 @item @code{:style}                 @tab @code{org-export-html-style}
4045 @item @code{:convert-org-links}     @tab @code{org-export-html-link-org-files-as-html}
4046 @item @code{:inline-images}         @tab @code{org-export-html-inline-images}
4047 @item @code{:expand-quoted-html}    @tab @code{org-export-html-expand}
4048 @item @code{:timestamp}             @tab @code{org-export-html-with-timestamp}
4049 @item @code{:publishing-directory}  @tab @code{org-export-publishing-directory}
4050 @item @code{:preamble}              @tab @code{org-export-html-preamble}
4051 @item @code{:postamble}             @tab @code{org-export-html-postamble}
4052 @item @code{:auto-preamble}         @tab @code{org-export-html-auto-preamble}
4053 @item @code{:auto-postamble}        @tab @code{org-export-html-auto-postamble}
4054 @item @code{:author}                @tab @code{user-full-name}
4055 @item @code{:email}                 @tab @code{user-mail-address}
4056 @end multitable
4058 When a property is given a value in org-publish-project-alist, its
4059 setting overrides the value of the corresponding user variable (if any)
4060 during publishing.  options set within a file (@pxref{Export
4061 options}), however, override everything.
4063 @node Publishing links, Project page index, Publishing options, Configuration
4064 @subsection Links between published files
4065 @cindex links, publishing
4067 To create a link from one Org-mode file to another, you would use
4068 something like @samp{[[file:foo.org][The foo]]} or simply
4069 @samp{file:foo.org.} (@pxref{Hyperlinks}).  Upon publishing this link
4070 becomes a link to @file{foo.html}.  In this way, you can interlink the
4071 pages of your "org web" project and the links will work as expected when
4072 you publish them to HTML.
4074 You may also link to related files, such as images. Provided you are
4075 careful with relative pathnames, and provided you have also configured
4076 org-publish to upload the related files, these links will work
4077 too. @ref{Complex example} for an example of this usage.
4079 Sometime an Org-mode file to be published may contain links that are
4080 only valid in your production environment, but not in the publishing
4081 location.  In this case, use the property 
4083 @multitable @columnfractions 0.4 0.6
4084 @item @code{:link-validation-function}
4085 @tab Function to validate links
4086 @end multitable
4088 @noindent
4089 to define a function for checking link validity.  This function must
4090 accept two arguments, the file name and a directory relative to which
4091 the file name is interpreted in the production environment.  If this
4092 function returns @code{nil}, then the HTML generator will only insert a
4093 description into the HTML file, but no link.  One option for this
4094 function is @code{org-publish-validate-link} which checks if the given
4095 file is part of any project in @code{org-publish-project-alist}.
4097 @node Project page index,  , Publishing links, Configuration
4098 @subsection Project page index
4099 @cindex index, of published pages
4101 The following properties may be used to control publishing of an
4102 index of files or summary page for a given project.
4104 @multitable @columnfractions 0.25 0.75
4105 @item @code{:auto-index}
4106 @tab When non-nil, publish an index during org-publish-current-project or
4107 org-publish-all.
4109 @item @code{:index-filename}
4110 @tab Filename for output of index. Defaults to @file{index.org} (which
4111 becomes @file{index.html}).
4113 @item @code{:index-title}
4114 @tab Title of index page. Defaults to name of file.
4116 @item @code{:index-function}
4117 @tab Plugin function to use for generation of index.
4118 Defaults to @code{org-publish-org-index}, which generates a plain list
4119 of links to all files in the project.
4120 @end multitable
4122 @node Sample configuration, Triggering publication, Configuration, Publishing
4123 @section Sample configuration
4125 Below we provide two example configurations.  The first one is a simple
4126 project publishing only a set of Org-mode files.  The second example is
4127 more complex, with a multi-component project.
4129 @menu
4130 * Simple example::              One-component publishing
4131 * Complex example::             A multi-component publishing example
4132 @end menu
4134 @node Simple example, Complex example, Sample configuration, Sample configuration
4135 @subsection Example: simple publishing configuration
4137 This example publishes a set of Org-mode files to the @file{public_html}
4138 directory on the local machine.
4140 @lisp
4141 (setq org-publish-project-alist
4142       '(("org" 
4143          :base-directory "~/org/"
4144          :publishing-directory "~/public_html"
4145          :section-numbers nil
4146          :table-of-contents nil
4147          :style "<link rel=stylesheet 
4148                 href=\"../other/mystyle.css\"
4149                 type=\"text/css\">")))
4150 @end lisp
4152 @node Complex example,  , Simple example, Sample configuration
4153 @subsection Example: complex publishing configuration
4155 This more complicated example publishes an entire website, including
4156 org files converted to HTML, image files, emacs lisp source code, and
4157 stylesheets. The publishing-directory is remote and private files are
4158 excluded.
4160 To ensure that links are preserved, care should be taken to replicate
4161 your directory structure on the web server, and to use relative file
4162 paths. For example, if your org files are kept in @file{~/org} and your
4163 publishable images in @file{~/images}, you'd link to an image with
4165 @example
4166 file:../images/myimage.png
4167 @end example
4169 On the web server, the relative path to the image should be the
4170 same. You can accomplish this by setting up an "images" folder in the
4171 right place on the webserver, and publishing images to it.
4173 @lisp
4174 (setq org-publish-project-alist
4175       '(("orgfiles"
4176           :base-directory "~/org/"
4177           :base-extension "org"
4178           :publishing-directory "/ssh:user@@host:~/html/notebook/"
4179           :publishing-function org-publish-org-to-html
4180           :exclude "PrivatePage.org"   ;; regexp
4181           :headline-levels 3
4182           :section-numbers nil
4183           :table-of-contents nil
4184           :style "<link rel=stylesheet 
4185                   href=\"../other/mystyle.css\" type=\"text/css\">"
4186           :auto-preamble t
4187           :auto-postamble nil)
4188          
4189          ("images"
4190           :base-directory "~/images/"
4191           :base-extension "jpg\\|gif\\|png"
4192           :publishing-directory "/ssh:user@@host:~/html/images/"
4193           :publishing-function org-publish-attachment)
4195          ("other"
4196           :base-directory "~/other/"
4197           :base-extension "css\\|el"
4198           :publishing-directory "/ssh:user@@host:~/html/other/"
4199           :publishing-function org-publish-attachment)
4200          ("website" :components ("orgfiles" "images" "other"))))
4201 @end lisp
4203 @node Triggering publication,  , Sample configuration, Publishing
4204 @section Triggering publication
4206 Once org-publish is properly configured, you can publish with the
4207 following functions: 
4209 @table @kbd
4210 @item C-c C-e c
4211 Prompts for a specific project to publish.
4212 @item C-c C-e p
4213 Publishes the project the current file is part of. 
4214 @item C-c C-e f
4215 Publishes only the current file.
4216 @item C-c C-e a
4217 Publish all projects.
4218 @end table
4220 Org uses timestamps to track when a file has changed. The above
4221 functions normally only publish changed files. You can override this and
4222 force publishing of all files by giving a prefix argument. 
4224 @node Miscellaneous, Extensions and Hacking, Publishing, Top
4225 @chapter Miscellaneous
4227 @menu
4228 * Completion::                  M-TAB knows what you need
4229 * Customization::               Adapting Org-mode to your taste
4230 * In-buffer settings::          Overview of the #+KEYWORDS
4231 * The very busy C-c C-c key::   When in doubt, press C-c C-c
4232 * Clean view::                  Getting rid of leading stars in the outline
4233 * TTY keys::                    Using Org-mode on a tty
4234 * Interaction::                 Other Emacs packages
4235 * Bugs::                        Things which do not work perfectly
4236 @end menu
4238 @node Completion, Customization, Miscellaneous, Miscellaneous
4239 @section Completion
4240 @cindex completion, of @TeX{} symbols
4241 @cindex completion, of TODO keywords
4242 @cindex completion, of dictionary words
4243 @cindex completion, of option keywords
4244 @cindex completion, of CamelCase links
4245 @cindex completion, of tags
4246 @cindex @TeX{} symbol completion
4247 @cindex TODO keywords completion
4248 @cindex dictionary word completion
4249 @cindex option keyword completion
4250 @cindex CamelCase link completion
4251 @cindex tag completion
4253 Org-mode supports in-buffer completion.  This type of completion does
4254 not make use of the minibuffer.  You simply type a few letters into
4255 the buffer and use the key to complete text right there.
4257 @table @kbd
4258 @kindex M-@key{TAB}
4259 @item M-@key{TAB}
4260 Complete word at point
4261 @itemize @bullet
4262 @item
4263 At the beginning of a headline, complete TODO keywords.
4264 @item
4265 After @samp{\}, complete @TeX{} symbols supported by the exporter.
4266 @item
4267 After @samp{*}, complete CamelCase versions of all headlines in the
4268 buffer.
4269 @item
4270 After @samp{:}, complete tags used elsewhere in the buffer.
4271 @item
4272 After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
4273 @samp{OPTIONS} which set file-specific options for Org-mode.  When the
4274 option keyword is already complete, pressing @kbd{M-@key{TAB}} again
4275 will insert example settings for this keyword.
4276 @item
4277 Elsewhere, complete dictionary words using ispell.
4278 @end itemize
4279 @end table
4281 @node Customization, In-buffer settings, Completion, Miscellaneous
4282 @section Customization
4283 @cindex customization
4284 @cindex options, for customization
4285 @cindex variables, for customization
4287 There are more than 100 variables that can be used to customize
4288 Org-mode.  For the sake of compactness of the manual, we are not
4289 describing the variables here.  A structured overview of customization
4290 variables is available with @kbd{M-x org-customize}.  Or select
4291 @code{Browse Org Group} from the @code{Org->Customization} menu.  Many
4292 settings can also be activated on a per-file basis, by putting special
4293 lines into the buffer (@pxref{In-buffer settings}).
4295 @node In-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
4296 @section Summary of in-buffer settings
4297 @cindex in-buffer settings
4298 @cindex special keywords
4300 Org-mode uses special lines in the buffer to define settings on a
4301 per-file basis.  These lines start with a @samp{#+} followed by a
4302 keyword, a colon, and then individual words defining a setting.  Several
4303 setting words can be in the same line, but you can also have multiple
4304 lines for the keyword.  While these settings are described throughout
4305 the manual, here is a summary.  After changing any of those lines in the
4306 buffer, press @kbd{C-c C-c} with the cursor still in the line to
4307 activate the changes immediately.  Otherwise they become effective only
4308 when the file is visited again in a new Emacs session.
4310 @table @kbd
4311 @item #+STARTUP:
4312 This line sets options to be used at startup of org-mode, when an
4313 Org-mode file is being visited.  The first set of options deals with the
4314 initial visibility of the outline tree.  The corresponding variable for
4315 global default settings is @code{org-startup-folded}, with a default
4316 value @code{t}, which means @code{overview}.
4317 @example
4318 overview   @r{top-level headlines only}
4319 content    @r{all headlines}
4320 showall    @r{no folding at all, show everything}
4321 @end example
4322 Then there are options for aligning tables upon visiting a file.  This
4323 is useful in files containing narrowed table columns.  The corresponding
4324 variable is @code{org-startup-align-all-tables}, with a default value
4325 @code{nil}. 
4326 @example
4327 align      @r{align all tables}
4328 noalign    @r{don't align tables on startup}
4329 @end example
4330 Logging when a TODO item is marked DONE (variable @code{org-log-done})
4331 can be configured using these options.
4332 @example
4333 logging    @r{record a timestamp when an item is marked DONE}
4334 nologging  @r{don't record when items are marked DONE}
4335 @end example
4336 Here are the options for hiding leading stars in outline headings.  The
4337 corresponding variables are @code{org-hide-leading-stars} and
4338 @code{org-odd-levels-only}, both with a default setting @code{nil}
4339 (meaning @code{showstars} and @code{oddeven}).
4340 @example
4341 hidestars  @r{make all but one of the stars starting a headline invisible.}
4342 showstars  @r{show all stars starting a headline}
4343 odd        @r{allow only odd outline levels (1,3,...)}
4344 oddeven    @r{allow all outline levels}
4345 @end example
4346 @item #+SEQ_TODO:   #+TYP_TODO:
4347 These lines set the TODO keywords and their interpretation in the
4348 current file.  The corresponding variables are @code{org-todo-keywords}
4349 and @code{org-todo-interpretation}.
4350 @item #+TAGS:  TAG1(c1) TAG2(c2)
4351 These lines (several such lines are allowed) specify the legal tags in
4352 this file, and (potentially) the corresponding @emph{fast tag selection}
4353 keys.  The corresponding variable is @code{org-tag-alist}.
4354 @item #+CATEGORY:
4355 This line sets the category for the agenda file.  The category applies
4356 for all subsequent lines until the next @samp{#+CATEGORY} line, or the
4357 end of the file.
4358 @item #+TBLFM:
4359 This line contains the formulas for the table directly above the line.
4360 @item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS:
4361 These lines provide settings for exporting files.  For more details see
4362 @ref{Export options}.
4363 @end table
4365 @node The very busy C-c C-c key, Clean view, In-buffer settings, Miscellaneous
4366 @section The very busy C-c C-c key
4367 @kindex C-c C-c
4369 The key @kbd{C-c C-c} has many purposes in org-mode, which are all
4370 mentioned scattered throughout this manual.  One specific function of
4371 this key is to add @emph{tags} to a headline (@pxref{Tags}).  In many
4372 other circumstances it means something like @emph{Hey Org-mode, look
4373 here and update according to what you see here}.  Here is a summary of
4374 what this means in different contexts.
4376 @itemize @minus
4377 @item
4378 If there are highlights in the buffer from the creation of a sparse
4379 tree, or from clock display, remove these highlights.
4380 @item
4381 If the cursor is in one of the special @code{#+KEYWORD} lines, this
4382 triggers scanning the buffer for these lines and updating the
4383 information. 
4384 @item
4385 If the cursor is inside a table, realign the table.  This command
4386 works even if the automatic table editor has been turned off.
4387 @item
4388 If the cursor is on a @code{#+TBLFM} line, re-apply the formulas to
4389 the entire table.
4390 @item
4391 If the cursor is inside a table created by the @file{table.el} package,
4392 activate that table.
4393 @item
4394 If the current buffer is a remember buffer, close note and file it.
4395 with a prefix argument, file it without further interaction to the default
4396 location.
4397 @item
4398 If the cursor is on a @code{<<<target>>>}, update radio targets and
4399 corresponding links in this buffer.
4400 @item
4401 If the cursor is in a plain list item with a checkbox, toggle the status
4402 of the checkbox.
4403 @item
4404 If the cursor is on a numbered item in a plain list, renumber the
4405 ordered list.
4406 @end itemize
4408 @node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous
4409 @section A cleaner outline view
4410 @cindex hiding leading stars
4411 @cindex clean outline view
4413 Some people find it noisy and distracting that the Org-mode headlines
4414 are starting with a potentially large number of stars.  For example
4415 the tree from @ref{Headlines}:
4417 @example
4418 * Top level headline
4419 ** Second level
4420 *** 3rd level
4421     some text
4422 *** 3rd level
4423     more text
4424 * Another top level headline
4425 @end example
4427 @noindent
4428 Unfortunately this is deeply ingrained into the code of Org-mode and
4429 cannot be easily changed.  You can, however, modify the display in such
4430 a way that all leading stars become invisible and the outline more easy
4431 to read.  To do this, customize the variable
4432 @code{org-hide-leading-stars} like this:
4434 @lisp
4435 (setq org-hide-leading-stars t)
4436 @end lisp
4438 @noindent
4439 or change this on a per-file basis with one of the lines (anywhere in
4440 the buffer)
4442 @example
4443 #+STARTUP: showstars
4444 #+STARTUP: hidestars
4445 @end example
4447 @noindent
4448 Press @kbd{C-c C-c} with the cursor in a @samp{STARTUP} line to activate
4449 the modifications.
4451 With stars hidden, the tree becomes:
4453 @example
4454 * Top level headline
4455  * Second level
4456   * 3rd level
4457     some text
4458   * 3rd level
4459     more text
4460 * Another top level headline
4461 @end example
4463 @noindent
4464 Note that the leading stars are not truly replaced by whitespace, they
4465 are only fontified with the face @code{org-hide} that uses the
4466 background color as font color.  If are are not using either white or
4467 black background, you may have to customize this face to get the wanted
4468 effect.  Another possibility is to set this font such that the extra
4469 stars are @i{almost} invisible, for example using the color
4470 @code{grey90} on a white background.
4472 Things become cleaner still if you skip all the even levels and use only
4473 odd levels 1, 3, 5..., effectively adding two stars to go from one
4474 outline level to the next:
4476 @example
4477 * Top level headline
4478   * Second level
4479     * 3rd level
4480       some text
4481     * 3rd level
4482       more text
4483 * Another top level headline
4484 @end example
4486 @noindent
4487 In order to make the structure editing and export commands handle this
4488 convention correctly, use
4490 @lisp
4491 (setq org-odd-levels-only t)
4492 @end lisp
4494 @noindent
4495 or set this on a per-file basis with one of the following lines (don't
4496 forget to press @kbd{C-c C-c} with the cursor in the startup line to
4497 activate changes immediately).
4499 @example
4500 #+STARTUP: odd
4501 #+STARTUP: oddeven
4502 @end example
4504 You can convert an Org-mode file from single-star-per-level to the
4505 double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
4506 RET} in that file.  The reverse operation is @kbd{M-x
4507 org-convert-to-oddeven-levels}.
4509 @node TTY keys, Interaction, Clean view, Miscellaneous
4510 @section Using org-mode on a tty
4511 @cindex tty keybindings
4513 Org-mode uses a number of keys that are not accessible on a tty.  This
4514 applies to most special keys like cursor keys, @key{TAB} and
4515 @key{RET}, when these are combined with modifier keys like @key{Meta}
4516 and/or @key{Shift}.  Org-mode uses these bindings because it needs to
4517 provide keys for a large number of commands, and because these keys
4518 appeared particularly easy to remember.  In order to still be able to
4519 access the core functionality of Org-mode on a tty, alternative
4520 bindings are provided.  Here is a complete list of these bindings,
4521 which are obviously more cumbersome to use.  Note that sometimes a
4522 work-around can be better.  For example changing a time stamp is
4523 really only fun with @kbd{S-@key{cursor}} keys.  On a tty you would
4524 rather use @kbd{C-c .}  to re-insert the timestamp.
4526 @multitable @columnfractions 0.15 0.2 0.2
4527 @item @b{Default} @tab @b{Alternative 1} @tab @b{Alternative 2}
4528 @item @kbd{S-@key{TAB}}     @tab @kbd{C-u @key{TAB}}       @tab
4529 @item @kbd{M-@key{left}}    @tab @kbd{C-c C-x l}           @tab @kbd{@key{Esc} @key{left}}
4530 @item @kbd{M-S-@key{left}}  @tab @kbd{C-c C-x L}           @tab
4531 @item @kbd{M-@key{right}}   @tab @kbd{C-c C-x r}           @tab @kbd{@key{Esc} @key{right}}
4532 @item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R}           @tab
4533 @item @kbd{M-@key{up}}      @tab @kbd{C-c C-x u}           @tab @kbd{@key{Esc} @key{up}}
4534 @item @kbd{M-S-@key{up}}    @tab @kbd{C-c C-x U}           @tab
4535 @item @kbd{M-@key{down}}    @tab @kbd{C-c C-x d}           @tab @kbd{@key{Esc} @key{down}}
4536 @item @kbd{M-S-@key{down}}  @tab @kbd{C-c C-x D}           @tab
4537 @item @kbd{S-@key{RET}}     @tab @kbd{C-c C-x c}           @tab
4538 @item @kbd{M-@key{RET}}     @tab @kbd{C-c C-x m}           @tab @kbd{@key{Esc} @key{RET}}
4539 @item @kbd{M-S-@key{RET}}   @tab @kbd{C-c C-x M}           @tab
4540 @item @kbd{S-@key{left}}    @tab @kbd{C-c C-x @key{left}}  @tab
4541 @item @kbd{S-@key{right}}   @tab @kbd{C-c C-x @key{right}} @tab
4542 @item @kbd{S-@key{up}}      @tab @kbd{C-c C-x @key{up}}    @tab
4543 @item @kbd{S-@key{down}}    @tab @kbd{C-c C-x @key{down}}  @tab
4544 @end multitable
4546 @node Interaction, Bugs, TTY keys, Miscellaneous
4547 @section Interaction with other packages
4548 @cindex packages, interaction with other
4549 Org-mode lives in the world of GNU Emacs and interacts in various ways
4550 with other code out there.
4552 @menu
4553 * Cooperation::                 Packages Org-mode cooperates with
4554 * Conflicts::                   Packages that lead to conflicts
4555 @end menu
4558 @node Cooperation, Conflicts, Interaction, Interaction
4559 @subsection Packages that Org-mode cooperates with
4561 @table @asis
4562 @cindex @file{calc.el}
4563 @item @file{calc.el} by Dave Gillespie
4564 Org-mode uses the calc package for implementing spreadsheet
4565 functionality in its tables (@pxref{Table calculations}).  Org-modes
4566 checks for the availability of calc by looking for the function
4567 @code{calc-eval} which should be autoloaded in your setup if calc has
4568 been installed properly.  As of Emacs 22, calc is part of the Emacs
4569 distribution.  Another possibility for interaction between the two
4570 packages is using calc for embedded calculations. @xref{Embedded Mode,
4571 , Embedded Mode, calc, GNU Emacs Calc Manual}.
4572 @cindex @file{constants.el}
4573 @item @file{constants.el} by Carsten Dominik
4574 In a table formula (@pxref{Table calculations}), it is possible to use
4575 names for natural constants or units.  Instead of defining your own
4576 constants in the variable @code{org-table-formula-constants}, install
4577 the @file{constants} package which defines a large number of constants
4578 and units, and lets you use unit prefixes like @samp{M} for
4579 @samp{Mega} etc.  You will need version 2.0 of this package, available
4580 at @url{http://www.astro.uva.nl/~dominik/Tools}. Org-mode checks for
4581 the function @code{constants-get}, which has to be autoloaded in your
4582 setup.  See the installation instructions in the file
4583 @file{constants.el}.
4584 @item @file{cdlatex.el} by Carsten Dominik
4585 @cindex @file{cdlatex.el}
4586 Org-mode can make use of the cdlatex package to efficiently enter
4587 La@TeX{} fragments into Org-mode files.
4588 @file{cdlatex.el} is not part of Emacs, find it on the web.
4589 @item @file{remember.el} by John Wiegley
4590 @cindex @file{remember.el}
4591 Org mode cooperates with remember, see @ref{Remember}.
4592 @file{Remember.el} is not part of Emacs, find it on the web.
4593 @cindex @file{table.el}
4594 @item @file{table.el} by Takaaki Ota
4595 Org mode cooperates with table.el, see @ref{table.el}.  @file{table.el}
4596 is part of Emacs 22.
4597 @end table
4599 @node Conflicts,  , Cooperation, Interaction
4600 @subsection Packages that lead to conflicts with Org-mode
4602 @table @asis
4604 @cindex @file{allout.el}
4605 @item @file{allout.el} by Ken Manheimer
4606 Startup of Org-mode may fail with the error message
4607 @code{(wrong-type-argument keymapp nil)} when there is an outdated
4608 version @file{allout.el} on the load path, for example the version
4609 distributed with Emacs 21.x.  Upgrade to Emacs 22 and this problem will
4610 disappear.  If for some reason you cannot do this, make sure that org.el
4611 is loaded @emph{before} @file{allout.el}, for example by putting
4612 @code{(require 'org)} early enough into your @file{.emacs} file.
4614 @cindex @file{CUA.el}
4615 @item @file{CUA.el} by Kim. F. Storm
4616 Keybindings in Org-mode conflict with the @kbd{S-<cursor>} keys
4617 used by CUA-mode (as well as pc-select-mode and s-region-mode) to
4618 select and extend the region.  If you want to use one of these
4619 packages along with Org-mode, configure the variable
4620 @code{org-CUA-compatible}.  When set, Org-mode will move the following
4621 keybindings in org-mode files, and in the agenda buffer (but not
4622 during date selection).
4624 @example
4625 S-UP    -> M-p             S-DOWN  -> M-n
4626 S-LEFT  -> M--             S-RIGHT -> M-+
4627 S-RET   -> C-S-RET
4628 @end example
4630 Yes, these are unfortunately more difficult to remember.  If you want
4631 to have other replacement keys, look at the variable
4632 @code{org-disputed-keys}.
4633 @item @file{windmove.el} by Hovav Shacham
4634 @cindex @file{windmove.el}
4635 Also this package uses the @kbd{S-<cursor>} keys, so everything written
4636 in the paragraph above about CUA mode also applies here.
4637 @end table
4640 @node Bugs,  , Interaction, Miscellaneous
4641 @section Bugs
4642 @cindex bugs
4644 Here is a list of things that should work differently, but which I
4645 have found too hard to fix.
4647 @itemize @bullet
4648 @item
4649 If a table field starts with a link, and if the corresponding table
4650 column is narrowed (@pxref{Narrow columns}) to a width too small to
4651 display the link, the field would look entirely empty even though it is
4652 not.  To prevent this, Org-mode throws an error.  The work-around is to
4653 make the column wide enough to fit the link, or to add some text (at
4654 least 2 characters) before the link in the same field.
4655 @item
4656 Narrowing table columns does not work on XEmacs, because the
4657 @code{format} function does not transport text properties.
4658 @item
4659 Text in an entry protected with the @samp{QUOTE} keyword should not
4660 autowrap.
4661 @item
4662 When the application called by @kbd{C-c C-o} to open a file link fails
4663 (for example because the application does not exist or refuses to open
4664 the file), it does so silently.  No error message is displayed.
4665 @item
4666 The remote-editing commands in the agenda buffer cannot be undone with
4667 @code{undo} called from within the agenda buffer.  But you can go to
4668 the corresponding buffer (using @key{TAB} or @key{RET} and execute
4669 @code{undo} there.
4670 @item
4671 Recalculating a table line applies the formulas from left to right.
4672 If a formula uses @emph{calculated} fields further down the row,
4673 multiple recalculation may be needed to get all fields consistent.
4674 @item
4675 A single letter cannot be made bold, for example @samp{*a*}.
4676 @item
4677 The exporters work well, but could be made more efficient.
4678 @end itemize
4681 @node Extensions and Hacking, History and Acknowledgments, Miscellaneous, Top
4682 @appendix Extensions, Hooks and Hacking
4684 This appendix lists extensions for Org-mode written by other authors.
4685 It also covers some aspects where users can easily extend the
4686 functionality of Org-mode.
4688 @menu
4689 * Extensions::                  Existing 3rd-part extensions
4690 * Dynamic blocks::              Automatically filled blocks
4691 @end menu
4693 @node Extensions, Dynamic blocks, Extensions and Hacking, Extensions and Hacking
4694 @section Third-party extensions for Org-mode
4696 The following extensions for Org-mode have been written by other people:
4698 @table @asis
4699 @cindex @file{org-mouse.el}
4700 @item @file{org-mouse.el} by Piotr Zielinski
4701 This package implements extended mouse functionality for Org-mode.  It
4702 allows you to cycle visibility and to edit the document structure with
4703 the mouse.  Best of all, it provides a context-sensitive menu on
4704 @key{mouse-3} that changes depending on the context of a mouse-click.
4705 @file{org-mouse.el} is freely available at @url{http://www.cl.cam.ac.uk/~pz215/files/org-mouse.el}.
4706 @cindex @file{org-publish.el}
4707 @item @file{org-publish.el} by David O'Toole
4708 This package provides facilities for publishing related sets of Org-mode
4709 files together with linked files like images as a webpages.  It is
4710 highly configurable and can be used for other publishing purposes as
4711 well.  As of Org-mode version 4.30, @file{org-publish.el} is part of the
4712 Org-mode distribution.  It is not yet part of Emacs, however, a delay
4713 caused by the preparations for the 22.1 release.  In the mean time,
4714 @file{org-publish.el} can be downloaded from David's site:
4715 @url{http://dto.freeshell.org/e/org-publish.el}.
4716 @cindex @file{org-blog.el}
4717 @item @file{org-blog.el} by David O'Toole
4718 A blogging plug-in for @file{org-publish.el}.
4719 @url{http://dto.freeshell.org/notebook/OrgMode.html}.
4720 @cindex @file{org-blogging.el}
4721 @item @file{org-blogging.el} by  Bastien Guerry
4722 Publish Org-mode files as
4723 blogs. @url{http://www.cognition.ens.fr/~guerry/org-blogging.html}.
4724 @end table
4726 @node Dynamic blocks,  , Extensions, Extensions and Hacking
4727 @section Dynamic blocks
4729 Org-mode documents can contain @emph{dynamic blocks}.  These are
4730 specially marked regions that are updates by some user-written
4731 function.  A good example for such a block is the clock table inserted
4732 by the command @kbd{C-c C-x C-r} (@pxref{Clocking work time}).
4734 Dynamic block are enclosed by a BEGIN-END structure that assigns a name
4735 to the block and can also specify parameters for the function producing
4736 the content of the block.
4738 @example
4739 #+BEGIN: myblock :parameter1 value1 :parameter2 value2 .....
4741 #+END:
4742 @end example
4744 Dynamic blocks are updated with the following commands
4746 @table @kbd
4747 @kindex C-c C-x C-u
4748 @item C-c C-x C-u
4749 Update dynamic block at point.
4750 @kindex C-u C-c C-x C-u
4751 @item C-u C-c C-x C-u
4752 Update all dynamic blocks in the current file.
4753 @end table
4755 Updating a dynamic block means to remove all the text between BEGIN and
4756 END, parse the BEGIN line for parameters and then call the specific
4757 writer function for this block to insert the new content.  For a block
4758 with name @code{myblock}, the writer function is
4759 @code{org-dblock-write:myblock} with as only parameter a property list
4760 with the parameters given in the begin line.  Here is a trivial example
4761 of a block that keeps track of when the block update function was last
4762 run:
4764 @example
4765 #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
4767 #+END:
4768 @end example
4770 @noindent
4771 The corresponding block writer function could look like this:
4773 @lisp
4774 (defun org-dblock-write:date-and-time (params)
4775    (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
4776      (insert "Last block update at: "
4777              (format-time-string fmt (current-time)))))
4778 @end lisp
4780 If you want to make sure that all dynamic blocks are always up-to-date,
4781 you could add the function @code{org-update-all-dblocks} to a hook, for
4782 example @code{before-save-hook}.  @code{org-update-all-dblocks} is
4783 written in a way that is does nothing in buffers that are not in Org-mode.
4786 @node History and Acknowledgments, Index, Extensions and Hacking, Top
4787 @appendix History and Acknowledgments
4788 @cindex acknowledgments
4789 @cindex history
4790 @cindex thanks
4792 The beginnings of Org-mode go back to 2003.  It was borne out of
4793 frustration over the user interface of the emacs outline-mode.  All I
4794 wanted was to make working with an outline tree possible without having
4795 to remember more than 10 commands just for hiding and unhiding parts of
4796 the outline tree, and to allow to restructure a tree easily.  Visibility
4797 cycling and structure editing were originally implemented in the package
4798 @file{outline-magic.el}, but quickly moved to the more general
4799 @file{org.el}.  TODO entries, basic time stamps, and table support were
4800 added next, and highlight the two main goals that Org-mode still has
4801 today:  To create a new, outline-based, plain text mode with innovative
4802 and intuitive editing features, and to incorporate project planning
4803 functionality directly into a notes file.
4805 Since the first release, hundreds of emails to me or on
4806 @code{emacs-orgmode@@gnu.org} have provided a constant stream of bug
4807 reports, feedback, new ideas, and sometimes even patches and add-on
4808 code.  Many thanks to everyone who has helped to improve this package.
4809 I am trying to keep here a list of the people who had significant
4810 influence in shaping one or more aspects of Org-mode.  The list may not
4811 be complete, if I have forgotten someone, please accept my apologies and
4812 let me know.
4814 @itemize @bullet
4815 @item
4816 @i{Thomas Baumann} contributed the code for links to the MH-E email
4817 system.
4818 @item
4819 @i{Alex Bochannek} provided a patch for rounding time stamps.
4820 @item
4821 @i{Charles Cave}'s suggestion sparked the implementation of templates
4822 for Remember.
4823 @item
4824 @i{Pavel Chalmoviansky} influenced the agenda treatment of items with
4825 specified time.
4826 @item
4827 @i{Gregory Chernov} patched support for lisp forms into table
4828 calculations and improved XEmacs compatibility, in particular by porting
4829 @file{nouline.el} to XEmacs.
4830 @item
4831 @i{Sacha Chua} suggested to copy some linking code from Planner.
4832 @item
4833 @i{Kees Dullemond} inspired the use of narrowed tabled columns.
4834 @item
4835 @i{Christian Egli} converted the documentation into TeXInfo format,
4836 patched CSS formatting into the HTML exporter, and inspired the agenda.
4837 @item
4838 @i{Nic Ferrier} contributed mailcap and XOXO support.
4839 @item
4840 @i{Niels Giessen} had the idea to automatically archive DONE trees.
4841 @item
4842 @i{Bastien Guerry} provoded extensive feedback.
4843 @item
4844 @i{Kai Grossjohann} pointed out key-binding conflicts caused by
4845 Org-mode.
4846 @item
4847 @i{Leon Liu} asked for embedded LaTeX and tested it.
4848 @item
4849 @i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler
4850 happy.
4851 @item
4852 @i{Todd Neal} provided patches for links to Info files and elisp forms.
4853 @item
4854 @i{Tim O'Callaghan} suggested in-file links, search options for general
4855 file links, and TAGS.
4856 @item
4857 @i{Oliver Oppitz} suggested multi-state TODO items.
4858 @item
4859 @i{Scott Otterson} sparked the introduction of descriptive text for
4860 links, among other things.
4861 @item
4862 @i{Pete Phillips} helped the development of the TAGS feature.
4863 @item
4864 @i{T.V. Raman} reported bugs and suggested improvements.
4865 @item
4866 @i{Matthias Rempe} (Oelde) provided ideas, Windows support, and quality
4867 control.
4868 @item
4869 @i{Kevin Rogers} contributed code to access VM files on remote hosts.
4870 @item
4871 @i{Frank Ruell} solved the mystery of the @code{keymapp nil} bug, a
4872 conflict with @file{allout.el}.
4873 @item
4874 @i{Philip Rooke} created the Org-mode reference card and provided lots
4875 of feedback.
4876 @item
4877 @i{Christian Schlauer} proposed angular brackets around links, among
4878 other things.
4879 @item
4880 Linking to VM/BBDB/GNUS was inspired by @i{Tom Shannon}'s
4881 @file{organizer-mode.el}.
4882 @item
4883 @i{Daniel Sinder} came up with the idea of internal archiving by locking
4884 subtrees.
4885 @item
4886 @i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
4887 chapter about publishing.
4888 @item
4889 @i{J@"urgen Vollmer} contributed code generating the table of contents
4890 in HTML output.
4891 @item
4892 @i{Chris Wallace} provided a patch implementing the @samp{QUOTE}
4893 keyword.
4894 @item
4895 @i{David Wainberg} suggested archiving, and improvements to the linking
4896 system.
4897 @item
4898 @i{John Wiegley} wrote @file{emacs-wiki.el} and @file{planner.el}.  The
4899 development of Org-mode was fully independent, and both systems are
4900 really different beasts in their basic ideas and implementation details.
4901 I later looked at John's code, however, and learned from his
4902 implementation of (i) links where the link itself is hidden and only a
4903 description is shown, and (ii) popping up a calendar to select a date.
4904 @item
4905 @i{Carsten Wimmer} suggested some changes and helped fix a bug in
4906 linking to GNUS.
4907 @item
4908 @i{Roland Winkler} requested additional keybindings to make Org-mode
4909 work on a tty.
4910 @item
4911 @i{Piotr Zielinski} wrote @file{org-mouse.el} and showed how to follow
4912 links with mouse-1.
4913 @end itemize
4916 @node Index, Key Index, History and Acknowledgments, Top
4917 @unnumbered Index
4919 @printindex cp
4921 @node Key Index,  , Index, Top
4922 @chapter Key Index
4924 @printindex ky
4926 @bye
4928 @ignore
4929    arch-tag: 7893d1fe-cc57-4d13-b5e5-f494a1bcc7ac
4930 @end ignore