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