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