]> code.delx.au - gnu-emacs/blob - man/org.texi
Restore deleted entry.
[gnu-emacs] / man / org.texi
1 \input texinfo
2 @c %**start of header
3 @setfilename ../info/org
4 @settitle Org Mode Manual
5
6 @set VERSION 4.67
7 @set DATE February 2007
8
9 @dircategory Emacs
10 @direntry
11 * Org Mode: (org). Outline-based notes management and organizer
12 @end direntry
13
14 @c Version and Contact Info
15 @set MAINTAINERSITE @uref{http://www.astro.uva.nl/~dominik/Tools/org/,maintainers webpage}
16 @set AUTHOR Carsten Dominik
17 @set MAINTAINER Carsten Dominik
18 @set MAINTAINEREMAIL @email{dominik at science dot uva dot nl}
19 @set MAINTAINERCONTACT @uref{mailto:dominik at science dot uva dot nl,contact the maintainer}
20 @c %**end of header
21 @finalout
22
23 @c Macro definitions
24
25 @c Subheadings inside a table.
26 @macro tsubheading{text}
27 @ifinfo
28 @subsubheading \text\
29 @end ifinfo
30 @ifnotinfo
31 @item @b{\text\}
32 @end ifnotinfo
33 @end macro
34
35 @copying
36 This manual is for Org-mode (version @value{VERSION}).
37
38 Copyright @copyright{} 2004, 2005, 2006, 2007 Free Software Foundation
39
40 @quotation
41 Permission is granted to copy, distribute and/or modify this document
42 under the terms of the GNU Free Documentation License, Version 1.1 or
43 any later version published by the Free Software Foundation; with no
44 Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
45 and with the Back-Cover Texts as in (a) below. A copy of the
46 license is included in the section entitled ``GNU Free Documentation
47 License.''
48
49 (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
50 this GNU Manual, like GNU software. Copies published by the Free
51 Software Foundation raise funds for GNU development.''
52 @end quotation
53 @end copying
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
79 * Document structure:: A tree works like your brain
80 * Tables:: Pure magic for quick formatting
81 * Hyperlinks:: Notes in context
82 * TODO items:: Every tree branch can be a TODO item
83 * Timestamps:: Assign date and time to items
84 * Tags:: Tagging headlines and matching sets of tags
85 * Agenda views:: Collecting information into views
86 * Embedded LaTeX:: LaTeX fragments and formulas
87 * Exporting:: Sharing and publishing of notes
88 * Publishing:: Create a web site of linked Org-mode files
89 * Miscellaneous:: All the rest which did not fit elsewhere
90 * Extensions and Hacking:: It is possible to write add-on code
91 * History and Acknowledgments:: How Org-mode came into being
92 * GNU Free Documentation License:: The license for this documentation.
93 * Index:: The fast road to specific information
94 * Key Index:: Key bindings and where they are described
95
96 @detailmenu
97 --- The Detailed Node Listing ---
98
99 Introduction
100
101 * Summary:: Brief summary of what Org-mode does
102 * Installation:: How to install a downloaded version of Org-mode
103 * Activation:: How to activate Org-mode for certain buffers.
104 * Feedback:: Bug reports, ideas, patches etc.
105
106 Document Structure
107
108 * Outlines:: Org-mode is based on outline-mode
109 * Headlines:: How to typeset org-tree headlines
110 * Visibility cycling:: Show and hide, much simplified
111 * Motion:: Jumping to other headlines
112 * Structure editing:: Changing sequence and level of headlines
113 * Archiving:: Move done task trees to a different place
114 * Sparse trees:: Matches embedded in context
115 * Plain lists:: Additional structure within an entry
116
117 Archiving
118
119 * ARCHIVE tag:: Marking a tree as inactive
120 * Moving subtrees:: Moving a tree to an archive file
121
122 Tables
123
124 * Built-in table editor:: Simple tables
125 * Narrow columns:: Stop wasting space in tables
126 * orgtbl-mode:: The table editor as minor mode
127 * The spreadsheet:: The table editor has spreadsheet capabilities.
128
129 The spreadsheet
130
131 * References:: How to refer to another field or range
132 * Formula syntax for Calc:: Using Calc to compute stuff
133 * Formula syntax for Lisp:: Writing formulas in Emacs Lisp
134 * Field formulas:: Formulas valid for a single field
135 * Column formulas:: Formulas valid for an entire column
136 * Editing and debugging formulas:: Fixing formulas
137 * Updating the table:: Recomputing all dependent fields
138 * Advanced features:: Field names, parameters and automatic recalc
139
140 Hyperlinks
141
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
145 * Handling links:: Creating, inserting and following
146 * Link abbreviations:: Shortcuts for writing complex links
147 * Search options:: Linking to a specific location
148 * Custom searches:: When the default search is not enough
149 * Remember:: Org-trees store quick notes
150
151 Internal links
152
153 * Radio targets:: Make targets trigger links in plain text.
154
155 Remember
156
157 * Setting up remember:: Some code for .emacs to get things going
158 * Remember templates:: Define the outline of different note types
159 * Storing notes:: Directly get the note to where it belongs
160
161 TODO items
162
163 * TODO basics:: Marking and displaying TODO entries
164 * TODO extensions:: Workflow and assignments
165 * Priorities:: Some things are more important than others
166 * Breaking down tasks:: Splitting a task into managable pieces
167 * Checkboxes:: Tick-off lists
168
169 Extended use of TODO keywords
170
171 * Workflow states:: From TODO to DONE in steps
172 * TODO types:: I do this, Fred the rest
173 * Per file keywords:: Different files, different requirements
174
175 Timestamps
176
177 * Time stamps:: Assigning a time to a tree entry
178 * Creating timestamps:: Commands which insert timestamps
179 * Custom time format:: If you cannot work with the ISO format
180 * Repeating items:: Deadlines that come back again and again
181 * Progress logging:: Documenting when what work was done.
182
183 Creating timestamps
184
185 * The date/time prompt:: How org-mode helps you entering date and time
186
187 Progress Logging
188
189 * Closing items:: When was this entry marked DONE?
190 * Tracking TODO state changes:: When did the status change?
191 * Clocking work time:: When exactly did you work on this item?
192
193 Tags
194
195 * Tag inheritance:: Tags use the tree structure of the outline
196 * Setting tags:: How to assign tags to a headline
197 * Tag searches:: Searching for combinations of tags
198
199 Agenda Views
200
201 * Agenda files:: Files being searched for agenda information
202 * Agenda dispatcher:: Keyboard access to agenda views
203 * Built-in agenda views:: What is available out of the box?
204 * Presentation and sorting:: How agenda items are prepared for display
205 * Agenda commands:: Remote editing of org trees
206 * Custom agenda views:: Defining special searches and views
207
208 The built-in agenda views
209
210 * Weekly/Daily agenda:: The calendar page with current tasks
211 * Global TODO list:: All unfinished action items
212 * Matching headline tags:: Structured information with fine-tuned search
213 * Timeline:: Time-sorted view for single file
214 * Stuck projects:: Find projects you need to review
215
216 Presentation and sorting
217
218 * Categories:: Not all tasks are equal
219 * Time-of-day specifications:: How the agenda knows the time
220 * Sorting of agenda items:: The order of things
221
222 Custom agenda views
223
224 * Storing searches:: Type once, use often
225 * Block agenda:: All the stuff you need in a single buffer
226 * Setting Options:: Changing the rules
227 * Batch processing:: Agenda views from the command line
228
229 Embedded LaTeX
230
231 * Math symbols:: TeX macros for symbols and Greek letters
232 * Subscripts and Superscripts:: Simple syntax for raising/lowering text
233 * LaTeX fragments:: Complex formulas made easy
234 * Processing LaTeX fragments:: Previewing LaTeX processing
235 * CDLaTeX mode:: Speed up entering of formulas
236
237 Exporting
238
239 * ASCII export:: Exporting to plain ASCII
240 * HTML export:: Exporting to HTML
241 * XOXO export:: Exporting to XOXO
242 * iCalendar export:: Exporting in iCalendar format
243 * Text interpretation:: How the exporter looks at the file
244
245 HTML export
246
247 * Export commands:: How to invode HTML export
248 * Quoting HTML tags:: Using direct HTML in Org-mode
249 * Links:: How hyperlinks get transferred to HTML
250 * Images:: To inline or not to inline?
251 * CSS support:: Style specifications
252
253 Text interpretation by the exporter
254
255 * Comment lines:: Some lines will not be exported
256 * Enhancing text:: Subscripts, symbols and more
257 * Export options:: How to influence the export settings
258
259 Publishing
260
261 * Configuration:: Defining projects
262 * Sample configuration:: Example projects
263 * Triggering publication:: Publication commands
264
265 Configuration
266
267 * Project alist:: The central configuration variable
268 * Sources and destinations:: From here to there
269 * Selecting files:: What files are part of the project?
270 * Publishing action:: Setting the function doing the publishing
271 * Publishing options:: Tweaking HTML export
272 * Publishing links:: Which links keep working after publishing?
273 * Project page index:: Publishing a list of project files
274
275 Sample configuration
276
277 * Simple example:: One-component publishing
278 * Complex example:: A multi-component publishing example
279
280 Miscellaneous
281
282 * Completion:: M-TAB knows what you need
283 * Customization:: Adapting Org-mode to your taste
284 * In-buffer settings:: Overview of the #+KEYWORDS
285 * The very busy C-c C-c key:: When in doubt, press C-c C-c
286 * Clean view:: Getting rid of leading stars in the outline
287 * TTY keys:: Using Org-mode on a tty
288 * Interaction:: Other Emacs packages
289 * Bugs:: Things which do not work perfectly
290
291 Interaction with other packages
292
293 * Cooperation:: Packages Org-mode cooperates with
294 * Conflicts:: Packages that lead to conflicts
295
296 Extensions, Hooks and Hacking
297
298 * Extensions:: Existing 3rd-part extensions
299 * Tables in arbitrary syntax:: Orgtbl for LaTeX and other programs
300 * Dynamic blocks:: Automatically filled blocks
301 * Special agenda views:: Customized views
302
303 Tables in arbitrary syntax
304
305 * Radio tables:: Sending and receiving
306 * A LaTeX example:: Step by step, almost a tutorial
307 * Translator functions:: Copy and modify
308
309 @end detailmenu
310 @end menu
311
312 @node Introduction, Document structure, Top, Top
313 @chapter Introduction
314 @cindex introduction
315
316 @menu
317 * Summary:: Brief summary of what Org-mode does
318 * Installation:: How to install a downloaded version of Org-mode
319 * Activation:: How to activate Org-mode for certain buffers.
320 * Feedback:: Bug reports, ideas, patches etc.
321 @end menu
322
323 @node Summary, Installation, Introduction, Introduction
324 @section Summary
325 @cindex summary
326
327 Org-mode is a mode for keeping notes, maintaining ToDo lists, and doing
328 project planning with a fast and effective plain-text system.
329
330 Org-mode develops organizational tasks around NOTES files that contain
331 lists or information about projects as plain text. Org-mode is
332 implemented on top of outline-mode, which makes it possible to keep the
333 content of large files well structured. Visibility cycling and
334 structure editing help to work with the tree. Tables are easily created
335 with a built-in table editor. Org-mode supports ToDo items, deadlines,
336 time stamps, and scheduling. It dynamically compiles entries into an
337 agenda that utilizes and smoothly integrates much of the Emacs calendar
338 and diary. Plain text URL-like links connect to websites, emails,
339 Usenet messages, BBDB entries, and any files related to the projects.
340 For printing and sharing of notes, an Org-mode file can be exported as a
341 structured ASCII file, as HTML, or (todo and agenda items only) as an
342 iCalendar file. It can also serve as a publishing tool for a set of
343 linked webpages.
344
345 An important design aspect that distinguishes Org-mode from for example
346 Planner/Muse is that it encourages to store every piece of information
347 only once. In Planner, you have project pages, day pages and possibly
348 other files, duplicating some information such as tasks. In Org-mode,
349 you only have notes files. In your notes you mark entries as tasks,
350 label them with tags and timestamps. All necessary lists like a
351 schedule for the day, the agenda for a meeting, tasks lists selected by
352 tags etc are created dynamically when you need them.
353
354 Org-mode keeps simple things simple. When first fired up, it should
355 feel like a straightforward, easy to use outliner. Complexity is not
356 imposed, but a large amount of functionality is available when you need
357 it. Org-mode can be used on different levels and in different ways, for
358 example as:
359
360 @example
361 @r{@bullet{} outline extension with visibility cycling and structure editing}
362 @r{@bullet{} ASCII system and table editor for taking structured notes}
363 @r{@bullet{} ASCII table editor with spreadsheet-like capabilities}
364 @r{@bullet{} TODO list editor}
365 @r{@bullet{} full agenda and planner with deadlines and work scheduling}
366 @r{@bullet{} environment to implement David Allen's GTD system}
367 @r{@bullet{} simple hypertext system, with HTML export}
368 @r{@bullet{} publishing tool to create a set of interlinked webpages}
369 @end example
370
371 Org-mode's automatic, context sensitive table editor with spreadsheet
372 capabilities can be integrated into any major mode by activating the
373 minor Orgtbl-mode. Using a translation step, it can be used to maintain
374 tables in arbitray file types, for example in LaTeX.
375
376 @cindex FAQ
377 There is a website for Org-mode which provides links to the newest
378 version of Org-mode, as well as additional information, frequently asked
379 questions (FAQ), links to tutorials etc. This page is located at
380 @uref{http://www.astro.uva.nl/~dominik/Tools/org/}.
381
382 @page
383
384
385 @node Installation, Activation, Summary, Introduction
386 @section Installation
387 @cindex installation
388 @cindex XEmacs
389
390 @b{Important:} @i{If Org-mode is part of the Emacs distribution or an
391 XEmacs package, please skip this section and go directly to
392 @ref{Activation}.}
393
394 If you have downloaded Org-mode from the Web, you must take the
395 following steps to install it: Go into the Org-mode distribution
396 directory and edit the top section of the file @file{Makefile}. You
397 must set the name of the Emacs binary (likely either @file{emacs} or
398 @file{xemacs}), and the paths to the directories where local Lisp and
399 Info files are kept. If you don't have access to the system-wide
400 directories, create your own two directories for these files, enter them
401 into the Makefile, and make sure Emacs finds the Lisp files by adding
402 the following line to @file{.emacs}:
403
404 @example
405 (setq load-path (cons "~/path/to/lispdir" load-path))
406 @end example
407
408 @b{XEmacs users now need to install the file @file{noutline.el} from
409 the @file{xemacs} subdirectory of the Org-mode distribution. Use the
410 command:}
411
412 @example
413 @b{make install-noutline}
414 @end example
415
416 @noindent Now byte-compile and install the Lisp files with the shell
417 commands:
418
419 @example
420 make
421 make install
422 @end example
423
424 @noindent If you want to install the info documentation, use this command:
425
426 @example
427 make install-info
428 @end example
429
430 @noindent Then add to @file{.emacs}:
431
432 @lisp
433 ;; This line only if org-mode is not part of the X/Emacs distribution.
434 (require 'org-install)
435 @end lisp
436
437 @node Activation, Feedback, Installation, Introduction
438 @section Activation
439 @cindex activation
440 @cindex autoload
441 @cindex global keybindings
442 @cindex keybindings, global
443
444 @iftex
445 @b{Important:} @i{If you use copy-and-paste to copy lisp code from the
446 PDF documentation to your .emacs file, the single quote character comes
447 out incorrectly and the code will not work. You need to fix the single
448 quotes by hand, or copy from Info documentation.}
449 @end iftex
450
451 Add the following lines to your @file{.emacs} file. The last two lines
452 define @emph{global} keys for the commands @command{org-store-link} and
453 @command{org-agenda} - please choose suitable keys yourself.
454
455 @lisp
456 ;; The following lines are always needed. Choose your own keys.
457 (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
458 (define-key global-map "\C-cl" 'org-store-link)
459 (define-key global-map "\C-ca" 'org-agenda)
460 @end lisp
461
462 Furthermore, you must activate @code{font-lock-mode} in org-mode
463 buffers, because significant functionality depends on font-locking being
464 active. You can do this with either one of the following two lines
465 (XEmacs user must use the second option):
466 @lisp
467 (global-font-lock-mode 1) ; for all buffers
468 (add-hook 'org-mode-hook 'turn-on-font-lock) ; org-mode buffers only
469 @end lisp
470
471 @cindex org-mode, turning on
472 With this setup, all files with extension @samp{.org} will be put
473 into Org-mode. As an alternative, make the first line of a file look
474 like this:
475
476 @example
477 MY PROJECTS -*- mode: org; -*-
478 @end example
479
480 @noindent which will select Org-mode for this buffer no matter what
481 the file's name is. See also the variable
482 @code{org-insert-mode-line-in-empty-file}.
483
484 @node Feedback, , Activation, Introduction
485 @section Feedback
486 @cindex feedback
487 @cindex bug reports
488 @cindex maintainer
489 @cindex author
490
491 If you find problems with Org-mode, or if you have questions, remarks,
492 or ideas about it, please contact the maintainer @value{MAINTAINER} at
493 @value{MAINTAINEREMAIL}.
494
495 For bug reports, please provide as much information as possible,
496 including the version information of Emacs (@kbd{C-h v emacs-version
497 @key{RET}}) and Org-mode (@kbd{C-h v org-version @key{RET}}), as well as
498 the Org-mode related setup in @file{.emacs}. If an error occurs, a
499 backtrace can be very useful (see below on how to create one). Often a
500 small example file helps, along with clear information about:
501
502 @enumerate
503 @item What exactly did you do?
504 @item What did you expect to happen?
505 @item What happened instead?
506 @end enumerate
507 @noindent Thank you for helping to improve this mode.
508
509 @subsubheading How to create a useful backtrace
510
511 @cindex backtrace of an error
512 If working with Org-mode produces an error with a message you don't
513 understand, you may have hit a bug. The best way to report this is by
514 providing, in addition to what was mentioned above, a @emph{Backtrace}.
515 This is information from the built-in debugger about where and how the
516 error occurred. Here is how to produce a useful backtrace:
517
518 @enumerate
519 @item
520 Start a fresh Emacs or XEmacs, and make sure that it will load the
521 original Lisp code in @file{org.el} instead of the compiled version in
522 @file{org.elc}. The backtrace contains much more information if it is
523 produced with uncompiled code. To do this, either rename @file{org.elc}
524 to something else before starting Emacs, or ask Emacs explicitly to load
525 @file{org.el} by using the command line
526 @example
527 emacs -l /path/to/org.el
528 @end example
529 @item
530 Go to the @code{Options} menu and select @code{Enter Debugger on Error}
531 (XEmacs has this option in the @code{Troubleshooting} sub-menu).
532 @item
533 Do whatever you have to do to hit the error. Don't forget to
534 document the steps you take.
535 @item
536 When you hit the error, a @file{*Backtrace*} buffer will appear on the
537 screen. Save this buffer to a file (for example using @kbd{C-x C-w}) and
538 attach it to your bug report.
539 @end enumerate
540
541 @node Document structure, Tables, Introduction, Top
542 @chapter Document Structure
543 @cindex document structure
544 @cindex structure of document
545
546 Org-mode is based on outline mode and provides flexible commands to
547 edit the structure of the document.
548
549 @menu
550 * Outlines:: Org-mode is based on outline-mode
551 * Headlines:: How to typeset org-tree headlines
552 * Visibility cycling:: Show and hide, much simplified
553 * Motion:: Jumping to other headlines
554 * Structure editing:: Changing sequence and level of headlines
555 * Archiving:: Move done task trees to a different place
556 * Sparse trees:: Matches embedded in context
557 * Plain lists:: Additional structure within an entry
558 @end menu
559
560 @node Outlines, Headlines, Document structure, Document structure
561 @section Outlines
562 @cindex outlines
563 @cindex outline-mode
564
565 Org-mode is implemented on top of outline-mode. Outlines allow to
566 organize a document in a hierarchical structure, which (at least for
567 me) is the best representation of notes and thoughts. Overview over
568 this structure is achieved by folding (hiding) large parts of the
569 document to show only the general document structure and the parts
570 currently being worked on. Org-mode greatly simplifies the use of
571 outlines by compressing the entire show/hide functionality into a
572 single command @command{org-cycle}, which is bound to the @key{TAB}
573 key.
574
575 @node Headlines, Visibility cycling, Outlines, Document structure
576 @section Headlines
577 @cindex headlines
578 @cindex outline tree
579
580 Headlines define the structure of an outline tree. The headlines in
581 Org-mode start with one or more stars, on the left margin. For
582 example:
583
584 @example
585 * Top level headline
586 ** Second level
587 *** 3rd level
588 some text
589 *** 3rd level
590 more text
591 * Another top level headline
592 @end example
593
594 @noindent Some people find the many stars too noisy and would prefer an
595 outline that has whitespace followed by a single star as headline
596 starters. @ref{Clean view} describes a setup to realize this.
597
598 @node Visibility cycling, Motion, Headlines, Document structure
599 @section Visibility cycling
600 @cindex cycling, visibility
601 @cindex visibility cycling
602 @cindex trees, visibility
603 @cindex show hidden text
604 @cindex hide text
605
606 Outlines make it possible to hide parts of the text in the buffer.
607 Org-mode uses just two commands, bound to @key{TAB} and
608 @kbd{S-@key{TAB}} to change the visibility in the buffer.
609
610 @cindex subtree visibility states
611 @cindex subtree cycling
612 @cindex folded, subtree visibility state
613 @cindex children, subtree visibility state
614 @cindex subtree, subtree visibility state
615 @table @kbd
616 @kindex @key{TAB}
617 @item @key{TAB}
618 @emph{Subtree cycling}: Rotate current subtree between the states
619
620 @example
621 ,-> FOLDED -> CHILDREN -> SUBTREE --.
622 '-----------------------------------'
623 @end example
624
625 The cursor must be on a headline for this to work@footnote{see, however,
626 the option @code{org-cycle-emulate-tab}.}. When the cursor is at the
627 beginning of the buffer and the first line is not a headline, then
628 @key{TAB} actually runs global cycling (see below)@footnote{see the
629 option @code{org-cycle-global-at-bob}.}. Also when called with a prefix
630 argument (@kbd{C-u @key{TAB}}), global cycling is invoked.
631
632 @cindex global visibility states
633 @cindex global cycling
634 @cindex overview, global visibility state
635 @cindex contents, global visibility state
636 @cindex show all, global visibility state
637 @kindex S-@key{TAB}
638 @item S-@key{TAB}
639 @itemx C-u @key{TAB}
640 @emph{Global cycling}: Rotate the entire buffer between the states
641
642 @example
643 ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
644 '--------------------------------------'
645 @end example
646
647 When @kbd{S-@key{TAB}} is called with a numerical prefix N, the CONTENTS
648 view up to headlines of level N will be shown.
649 Note that inside tables, @kbd{S-@key{TAB}} jumps to the previous field.
650
651 @cindex show all, command
652 @kindex C-c C-a
653 @item C-c C-a
654 Show all.
655 @kindex C-c C-r
656 @item C-c C-r
657 Reveal context around point, showing the current entry, the following
658 heading and the hierarchy above. Useful for working near a location
659 exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda
660 command (@pxref{Agenda commands}). With prefix arg show, on each
661 level, all sibling headings.
662 @kindex C-c C-x b
663 @item C-c C-x b
664 Show the current subtree in an indirect buffer@footnote{The indirect
665 buffer (@pxref{Indirect Buffers,Indirect Buffers,Indirect
666 Buffers,emacs,GNU Emacs Manual}) will contain the entire buffer, but
667 will be narrowed to the current tree. Editing the indirect buffer will
668 also change the original buffer, but without affecting visibility in
669 that buffer.}. With numerical prefix ARG, go up to this level and then
670 take that tree. If ARG is negative, go up that many levels. With
671 @kbd{C-u} prefix, do not remove the previously used indirect buffer.
672 @end table
673
674 When Emacs first visits an Org-mode file, the global state is set to
675 OVERVIEW, i.e. only the top level headlines are visible. This can be
676 configured through the variable @code{org-startup-folded}, or on a
677 per-file basis by adding one of the following lines anywhere in the
678 buffer:
679
680 @example
681 #+STARTUP: overview
682 #+STARTUP: content
683 #+STARTUP: showall
684 @end example
685
686 @node Motion, Structure editing, Visibility cycling, Document structure
687 @section Motion
688 @cindex motion, between headlines
689 @cindex jumping, to headlines
690 @cindex headline navigation
691 The following commands jump to other headlines in the buffer.
692
693 @table @kbd
694 @kindex C-c C-n
695 @item C-c C-n
696 Next heading.
697 @kindex C-c C-p
698 @item C-c C-p
699 Previous heading.
700 @kindex C-c C-f
701 @item C-c C-f
702 Next heading same level.
703 @kindex C-c C-b
704 @item C-c C-b
705 Previous heading same level.
706 @kindex C-c C-u
707 @item C-c C-u
708 Backward to higher level heading.
709 @kindex C-c C-j
710 @item C-c C-j
711 Jump to a different place without changing the current outline
712 visibility. Shows the document structure in a temporary buffer, where
713 you can use visibility cycling (@key{TAB}) to find your destination.
714 After pressing @key{RET}, the cursor moves to the selected location in
715 the original buffer, and the headings hierarchy above it is made
716 visible.
717 @end table
718
719 @node Structure editing, Archiving, Motion, Document structure
720 @section Structure editing
721 @cindex structure editing
722 @cindex headline, promotion and demotion
723 @cindex promotion, of subtrees
724 @cindex demotion, of subtrees
725 @cindex subtree, cut and paste
726 @cindex pasting, of subtrees
727 @cindex cutting, of subtrees
728 @cindex copying, of subtrees
729 @cindex subtrees, cut and paste
730
731 @table @kbd
732 @kindex M-@key{RET}
733 @item M-@key{RET}
734 Insert new heading with same level as current. If the cursor is in a
735 plain list item, a new item is created (@pxref{Plain lists}). To force
736 creation of a new headline, use a prefix arg, or first press @key{RET}
737 to get to the beginning of the next line. When this command is used in
738 the middle of a line, the line is split and the rest of the line becomes
739 the new headline. If the command is used at the beginning of a
740 headline, the new headline is created before the current line. If at
741 the beginning of any other line, the content of that line is made the
742 new heading. If the command is used at the end of a folded subtree
743 (i.e. behind the ellipses at the end of a headline), then a headline
744 like the current one will be inserted after the end of the subtree.
745 @kindex M-S-@key{RET}
746 @item M-S-@key{RET}
747 Insert new TODO entry with same level as current heading.
748 @kindex M-@key{left}
749 @item M-@key{left}
750 Promote current heading by one level.
751 @kindex M-@key{right}
752 @item M-@key{right}
753 Demote current heading by one level.
754 @kindex M-S-@key{left}
755 @item M-S-@key{left}
756 Promote the current subtree by one level.
757 @kindex M-S-@key{right}
758 @item M-S-@key{right}
759 Demote the current subtree by one level.
760 @kindex M-S-@key{up}
761 @item M-S-@key{up}
762 Move subtree up (swap with previous subtree of same
763 level).
764 @kindex M-S-@key{down}
765 @item M-S-@key{down}
766 Move subtree down (swap with next subtree of same level).
767 @kindex C-c C-x C-w
768 @kindex C-c C-x C-k
769 @item C-c C-x C-w
770 @itemx C-c C-x C-k
771 Kill subtree, i.e. remove it from buffer but save in kill ring.
772 @kindex C-c C-x M-w
773 @item C-c C-x M-w
774 Copy subtree to kill ring.
775 @kindex C-c C-x C-y
776 @item C-c C-x C-y
777 Yank subtree from kill ring. This does modify the level of the subtree to
778 make sure the tree fits in nicely at the yank position. The yank
779 level can also be specified with a prefix arg, or by yanking after a
780 headline marker like @samp{****}.
781 @kindex C-c ^
782 @item C-c ^
783 Sort same-level entries. When there is an active region, all entries in
784 the region will be sorted. Otherwise the children of the current
785 headline are sorted. The command prompts for the sorting method, which
786 can be alphabetically, numerically, by time (using the first time stamp
787 in each entry), and each of these in reverse order. With a @kbd{C-u}
788 prefix, sorting will be case-sensitive. With two @kbd{C-u C-u}
789 prefixes, duplicate entries will also be removed.
790 @end table
791
792 @cindex region, active
793 @cindex active region
794 @cindex transient-mark-mode
795 When there is an active region (transient-mark-mode), promotion and
796 demotion work on all headlines in the region. To select a region of
797 headlines, it is best to place both point and mark at the beginning of a
798 line, mark at the beginning of the first headline, and point at the line
799 just after the last headline to change. Note that when the cursor is
800 inside a table (@pxref{Tables}), the Meta-Cursor keys have different
801 functionality.
802
803 @node Archiving, Sparse trees, Structure editing, Document structure
804 @section Archiving
805 @cindex archiving
806
807 When a project represented by a (sub)tree is finished, you may want
808 to move the tree out of the way and to stop it from contributing to the
809 agenda. Org-mode knows two ways of archiving. You can mark a tree with
810 the ARCHIVE tag, or you can move an entire (sub)tree to a different
811 location.
812
813 @menu
814 * ARCHIVE tag:: Marking a tree as inactive
815 * Moving subtrees:: Moving a tree to an archive file
816 @end menu
817
818 @node ARCHIVE tag, Moving subtrees, Archiving, Archiving
819 @subsection The ARCHIVE tag
820 @cindex internal archiving
821
822 A headline that is marked with the ARCHIVE tag (@pxref{Tags}) stays at
823 its location in the outline tree, but behaves in the following way:
824 @itemize @minus
825 @item
826 It does not open when you attempt to do so with a visibility cycling
827 command (@pxref{Visibility cycling}). You can force cycling archived
828 subtrees with @kbd{C-@key{TAB}}, or by setting the option
829 @code{org-cycle-open-archived-trees}. Also normal outline commands like
830 @code{show-all} will open archived subtrees.
831 @item
832 During sparse tree construction (@pxref{Sparse trees}), matches in
833 archived subtrees are not exposed, unless you configure the option
834 @code{org-sparse-tree-open-archived-trees}.
835 @item
836 During agenda view construction (@pxref{Agenda views}), the content of
837 archived trees is ignored unless you configure the option
838 @code{org-agenda-skip-archived-trees}.
839 @item
840 Archived trees are not exported (@pxref{Exporting}), only the headline
841 is. Configure the details using the variable
842 @code{org-export-with-archived-trees}.
843 @end itemize
844
845 The following commands help managing the ARCHIVE tag:
846
847 @table @kbd
848 @kindex C-c C-x C-a
849 @item C-c C-x C-a
850 Toggle the ARCHIVE tag for the current headline. When the tag is set,
851 the headline changes to a shadowish face, and the subtree below it is
852 hidden.
853 @kindex C-u C-c C-x C-a
854 @item C-u C-c C-x C-a
855 Check if any direct children of the current headline should be archived.
856 To do this, each subtree is checked for open TODO entries. If none are
857 found, the command offers to set the ARCHIVE tag for the child. If the
858 cursor is @emph{not} on a headline when this command is invoked, the
859 level 1 trees will be checked.
860 @kindex C-@kbd{TAB}
861 @item C-@kbd{TAB}
862 Cycle a tree even if it is tagged with ARCHIVE.
863 @end table
864
865 @node Moving subtrees, , ARCHIVE tag, Archiving
866 @subsection Moving subtrees
867 @cindex external archiving
868
869 Once an entire project is finished, you may want to move it to a
870 different location, either in the current file, or even in a different
871 file, the archive file.
872
873 @table @kbd
874 @kindex C-c C-x C-s
875 @item C-c C-x C-s
876 Archive the subtree starting at the cursor position to the location
877 given by @code{org-archive-location}.
878 @kindex C-u C-c C-x C-s
879 @item C-u C-c C-x C-s
880 Check if any direct children of the current headline could be moved to
881 the archive. To do this, each subtree is checked for open TODO entries.
882 If none are found, the command offers to move it to the archive
883 location. If the cursor is @emph{not} on a headline when this command
884 is invoked, the level 1 trees will be checked.
885 @end table
886
887 @cindex archive locations
888 The default archive location is a file in the same directory as the
889 current file, with the name derived by appending @file{_archive} to the
890 current file name. For information and examples on how to change this,
891 see the documentation string of the variable
892 @code{org-archive-location}. There is also an in-buffer option for
893 setting this variable, for example
894
895 @example
896 #+ARCHIVE: %s_done::
897 @end example
898
899 @noindent
900 You may have several such lines in the buffer, they will then be valid
901 for the entries following the line (the first will also apply to any
902 text before it).
903
904 @node Sparse trees, Plain lists, Archiving, Document structure
905 @section Sparse trees
906 @cindex sparse trees
907 @cindex trees, sparse
908 @cindex folding, sparse trees
909 @cindex occur, command
910
911 An important feature of Org-mode is the ability to construct
912 @emph{sparse trees} for selected information in an outline tree. A
913 sparse tree means that the entire document is folded as much as
914 possible, but the selected information is made visible along with the
915 headline structure above it@footnote{See also the variables
916 @code{org-show-hierarchy-above}, @code{org-show-following-heading}, and
917 @code{org-show-siblings} for detailed control on how much context is
918 shown around each match.}. Just try it out and you will see immediately
919 how it works.
920
921 Org-mode contains several commands creating such trees. The most
922 basic one is @command{org-occur}:
923
924 @table @kbd
925 @kindex C-c /
926 @item C-c /
927 Occur. Prompts for a regexp and shows a sparse tree with all matches.
928 If the match is in a headline, the headline is made visible. If the
929 match is in the body of an entry, headline and body are made visible.
930 In order to provide minimal context, also the full hierarchy of
931 headlines above the match is shown, as well as the headline following
932 the match. Each match is also highlighted; the highlights disappear
933 when the buffer is changes an editing command, or by pressing @kbd{C-c
934 C-c}. When called with a @kbd{C-u} prefix argument, previous highlights
935 are kept, so several calls to this command can be stacked.
936 @end table
937 @noindent
938 For frequently used sparse trees of specific search strings, you can
939 use the variable @code{org-agenda-custom-commands} to define fast
940 keyboard access to specific sparse trees. These commands will then be
941 accessible through the agenda dispatcher (@pxref{Agenda dispatcher}).
942 For example:
943
944 @lisp
945 (setq org-agenda-custom-commands
946 '(("f" occur-tree "FIXME")))
947 @end lisp
948
949 @noindent will define the key @kbd{C-c a f} as a shortcut for creating
950 a sparse tree matching the string @samp{FIXME}.
951
952 Other commands use sparse trees as well. For example @kbd{C-c
953 C-v} creates a sparse TODO tree (@pxref{TODO basics}).
954
955 @kindex C-c C-e v
956 @cindex printing sparse trees
957 @cindex visible text, printing
958 To print a sparse tree, you can use the Emacs command
959 @code{ps-print-buffer-with-faces} which does not print invisible parts
960 of the document @footnote{This does not work under XEmacs, because
961 XEmacs uses selective display for outlining, not text properties.}.
962 Or you can use the command @kbd{C-c C-e v} to export only the visible
963 part of the document and print the resulting file.
964
965 @node Plain lists, , Sparse trees, Document structure
966 @section Plain lists
967 @cindex plain lists
968 @cindex lists, plain
969 @cindex lists, ordered
970 @cindex ordered lists
971
972 Within an entry of the outline tree, hand-formatted lists can provide
973 additional structure. They also provide a way to create lists of
974 checkboxes (@pxref{Checkboxes}). Org-mode supports editing such lists,
975 and the HTML exporter (@pxref{Exporting}) does parse and format them.
976
977 Org-mode knows ordered and unordered lists. Unordered list items start
978 with @samp{-}, @samp{+}, or @samp{*}@footnote{When using @samp{*} as a
979 bullet, lines must be indented or they will be seen as top-level
980 headlines. Also, when you are hiding leading stars to get a clean
981 outline view, plain list items starting with a star are visually
982 indistinguishable from true headlines. In short: even though @samp{*}
983 is supported, it may be better not to use it for plain list items} as
984 bullets. Ordered list items start with @samp{1.} or @samp{1)}. Items
985 belonging to the same list must have the same indentation on the first
986 line. In particular, if an ordered list reaches number @samp{10.}, then
987 the 2--digit numbers must be written left-aligned with the other numbers
988 in the list. Indentation also determines the end of a list item. It
989 ends before the next line that is indented like the bullet/number, or
990 less. For example:
991
992 @example
993 @group
994 ** Lord of the Rings
995 My favorite scenes are (in this order)
996 1. The attack of the Rohirrim
997 2. Eowyns fight with the witch king
998 + this was already my favorite scene in the book
999 + I really like Miranda Otto.
1000 3. Peter Jackson being shot by Legolas
1001 - on DVD only
1002 He makes a really funny face when it happens.
1003 But in the end, not individual scenes matter but the film as a whole.
1004 @end group
1005 @end example
1006
1007 Org-mode supports these lists by tuning filling and wrapping commands to
1008 deal with them correctly@footnote{Org-mode only changes the filling
1009 settings for Emacs. For XEmacs, you should use Kyle E. Jones'
1010 @file{filladapt.el}. To turn this on, put into @file{.emacs}:
1011 @example
1012 (require 'filladapt)
1013 @end example
1014 }.
1015
1016 The following commands act on items when the cursor is in the first line
1017 of an item (the line with the bullet or number).
1018
1019 @table @kbd
1020 @kindex @key{TAB}
1021 @item @key{TAB}
1022 Items can be folded just like headline levels if you set the variable
1023 @code{org-cycle-include-plain-lists}. The level of an item is then
1024 given by the indentation of the bullet/number. Items are always
1025 subordinate to real headlines, however; the hierarchies remain
1026 completely separated.
1027 @kindex M-@key{RET}
1028 @item M-@key{RET}
1029 Insert new item at current level. With prefix arg, force a new heading
1030 (@pxref{Structure editing}). If this command is used in the middle of a
1031 line, the line is @emph{split} and the rest of the line becomes the new
1032 item. If this command is executed in the @emph{whitespace before a bullet or
1033 number}, the new item is created @emph{before} the current item. If the
1034 command is executed in the white space before the text that is part of
1035 an item but does not contain the bullet, a bullet is added to the
1036 current line.
1037 @kindex M-S-@key{RET}
1038 @item M-S-@key{RET}
1039 Insert a new item with a checkbox (@pxref{Checkboxes}).
1040 @kindex S-@key{up}
1041 @kindex S-@key{down}
1042 @item S-@key{up}
1043 @itemx S-@key{down}
1044 Jump to the previous/next item in the current list.
1045 @kindex M-S-@key{up}
1046 @kindex M-S-@key{down}
1047 @item M-S-@key{up}
1048 @itemx M-S-@key{down}
1049 Move the item including subitems up/down (swap with previous/next item
1050 of same indentation). If the list is ordered, renumbering is
1051 automatic.
1052 @kindex M-S-@key{left}
1053 @kindex M-S-@key{right}
1054 @item M-S-@key{left}
1055 @itemx M-S-@key{right}
1056 Decrease/increase the indentation of the item, including subitems.
1057 Initially, the item tree is selected based on current indentation.
1058 When these commands are executed several times in direct succession,
1059 the initially selected region is used, even if the new indentation
1060 would imply a different hierarchy. To use the new hierarchy, break
1061 the command chain with a cursor motion or so.
1062 @kindex C-c C-c
1063 @item C-c C-c
1064 If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the
1065 state of the checkbox. Otherwise, if this is an ordered list, renumber
1066 the ordered list at the cursor.
1067 @end table
1068
1069 @node Tables, Hyperlinks, Document structure, Top
1070 @chapter Tables
1071 @cindex tables
1072 @cindex editing tables
1073
1074 Org-mode has a very fast and intuitive table editor built-in.
1075 Spreadsheet-like calculations are supported in connection with the
1076 Emacs @file{calc} package.
1077
1078 @menu
1079 * Built-in table editor:: Simple tables
1080 * Narrow columns:: Stop wasting space in tables
1081 * orgtbl-mode:: The table editor as minor mode
1082 * The spreadsheet:: The table editor has spreadsheet capabilities.
1083 @end menu
1084
1085 @node Built-in table editor, Narrow columns, Tables, Tables
1086 @section The built-in table editor
1087 @cindex table editor, built-in
1088
1089 Org-mode makes it easy to format tables in plain ASCII. Any line with
1090 @samp{|} as the first non-white character is considered part of a
1091 table. @samp{|} is also the column separator. A table might look
1092 like this:
1093
1094 @example
1095 | Name | Phone | Age |
1096 |-------+-------+-----|
1097 | Peter | 1234 | 17 |
1098 | Anna | 4321 | 25 |
1099 @end example
1100
1101 A table is re-aligned automatically each time you press @key{TAB} or
1102 @key{RET} or @kbd{C-c C-c} inside the table. @key{TAB} also moves to
1103 the next field (@key{RET} to the next row) and creates new table rows
1104 at the end of the table or before horizontal lines. The indentation
1105 of the table is set by the first line. Any line starting with
1106 @samp{|-} is considered as a horizontal separator line and will be
1107 expanded on the next re-align to span the whole table width. So, to
1108 create the above table, you would only type
1109
1110 @example
1111 |Name|Phone|Age|
1112 |-
1113 @end example
1114
1115 @noindent and then press @key{TAB} to align the table and start filling in
1116 fields.
1117
1118 When typing text into a field, Org-mode treats @key{DEL},
1119 @key{Backspace}, and all character keys in a special way, so that
1120 inserting and deleting avoids shifting other fields. Also, when
1121 typing @emph{immediately after the cursor was moved into a new field
1122 with @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the
1123 field is automatically made blank. If this behavior is too
1124 unpredictable for you, configure the variables
1125 @code{org-enable-table-editor} and @code{org-table-auto-blank-field}.
1126
1127 @table @kbd
1128 @tsubheading{Creation and conversion}
1129 @kindex C-c |
1130 @item C-c |
1131 Convert the active region to table. If every line contains at least one
1132 TAB character, the function assumes that the material is tab separated.
1133 If not, lines are split at whitespace into fields. You can use a prefix
1134 argument to indicate the minimum number of consecutive spaces required
1135 to identify a field separator (default: just one).@*
1136 If there is no active region, this command creates an empty Org-mode
1137 table. But it's easier just to start typing, like
1138 @kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}.
1139
1140 @tsubheading{Re-aligning and field motion}
1141 @kindex C-c C-c
1142 @item C-c C-c
1143 Re-align the table without moving the cursor.
1144
1145 @kindex @key{TAB}
1146 @item @key{TAB}
1147 Re-align the table, move to the next field. Creates a new row if
1148 necessary.
1149
1150 @kindex S-@key{TAB}
1151 @item S-@key{TAB}
1152 Re-align, move to previous field.
1153
1154 @kindex @key{RET}
1155 @item @key{RET}
1156 Re-align the table and move down to next row. Creates a new row if
1157 necessary. At the beginning or end of a line, @key{RET} still does
1158 NEWLINE, so it can be used to split a table.
1159
1160 @tsubheading{Column and row editing}
1161 @kindex M-@key{left}
1162 @kindex M-@key{right}
1163 @item M-@key{left}
1164 @itemx M-@key{right}
1165 Move the current column left/right.
1166
1167 @kindex M-S-@key{left}
1168 @item M-S-@key{left}
1169 Kill the current column.
1170
1171 @kindex M-S-@key{right}
1172 @item M-S-@key{right}
1173 Insert a new column to the left of the cursor position.
1174
1175 @kindex M-@key{up}
1176 @kindex M-@key{down}
1177 @item M-@key{up}
1178 @itemx M-@key{down}
1179 Move the current row up/down.
1180
1181 @kindex M-S-@key{up}
1182 @item M-S-@key{up}
1183 Kill the current row or horizontal line.
1184
1185 @kindex M-S-@key{down}
1186 @item M-S-@key{down}
1187 Insert a new row above (with arg: below) the current row.
1188
1189 @kindex C-c -
1190 @item C-c -
1191 Insert a horizontal line below current row. With prefix arg, the line
1192 is created above the current line.
1193
1194 @kindex C-c ^
1195 @item C-c ^
1196 Sort the table lines in the region. The position of point indicates the
1197 column to be used for sorting, and the range of lines is the range
1198 between the nearest horizontal separator lines, or the entire table. If
1199 point is before the first column, you will be prompted for the sorting
1200 column. If there is an active region, the mark specifies the first line
1201 and the sorting column, while point should be in the last line to be
1202 included into the sorting. The command prompts for the sorting type
1203 (alphabetically, numerically, or by time). When called with a prefix
1204 argument, alphabetic sorting will be case-sensitive.
1205
1206 @tsubheading{Regions}
1207 @kindex C-c C-x M-w
1208 @item C-c C-x M-w
1209 Copy a rectangular region from a table to a special clipboard. Point
1210 and mark determine edge fields of the rectangle. The process ignores
1211 horizontal separator lines.
1212 @kindex C-c C-x C-w
1213 @item C-c C-x C-w
1214 Copy a rectangular region from a table to a special clipboard, and
1215 blank all fields in the rectangle. So this is the ``cut'' operation.
1216 @kindex C-c C-x C-y
1217 @item C-c C-x C-y
1218 Paste a rectangular region into a table.
1219 The upper right corner ends up in the current field. All involved fields
1220 will be overwritten. If the rectangle does not fit into the present table,
1221 the table is enlarged as needed. The process ignores horizontal separator
1222 lines.
1223 @kindex C-c C-q
1224 @item C-c C-q
1225 Wrap several fields in a column like a paragraph. If there is an active
1226 region, and both point and mark are in the same column, the text in the
1227 column is wrapped to minimum width for the given number of lines. A
1228 prefix ARG may be used to change the number of desired lines. If there
1229 is no region, the current field is split at the cursor position and the
1230 text fragment to the right of the cursor is prepended to the field one
1231 line down. If there is no region, but you specify a prefix ARG, the
1232 current field is made blank, and the content is appended to the field
1233 above.
1234
1235 @tsubheading{Calculations}
1236 @cindex formula, in tables
1237 @cindex calculations, in tables
1238
1239 @cindex region, active
1240 @cindex active region
1241 @cindex transient-mark-mode
1242 @kindex C-c +
1243 @item C-c +
1244 Sum the numbers in the current column, or in the rectangle defined by
1245 the active region. The result is shown in the echo area and can
1246 be inserted with @kbd{C-y}.
1247
1248 @kindex S-@key{RET}
1249 @item S-@key{RET}
1250 When current field is empty, copy from first non-empty field above.
1251 When not empty, copy current field down to next row and move cursor
1252 along with it. Depending on the variable
1253 @code{org-table-copy-increment}, integer field values will be
1254 incremented during copy. This key is also used by CUA-mode
1255 (@pxref{Cooperation}).
1256
1257 @tsubheading{Miscellaneous}
1258 @kindex C-c `
1259 @item C-c `
1260 Edit the current field in a separate window. This is useful for fields
1261 that are not fully visible (@pxref{Narrow columns}). When called with a
1262 @kbd{C-u} prefix, just make the full field visible, so that it can be
1263 edited in place.
1264
1265 @kindex C-c @key{TAB}
1266 @item C-c @key{TAB}
1267 This is an alias for @kbd{C-u C-c `} to make the current field fully
1268 visible.
1269
1270 @item M-x org-table-import
1271 Import a file as a table. The table should be TAB- or whitespace
1272 separated. Useful, for example, to import an Excel table or data from a
1273 database, because these programs generally can write TAB-separated text
1274 files. This command works by inserting the file into the buffer and
1275 then converting the region to a table. Any prefix argument is passed on
1276 to the converter, which uses it to determine the separator.
1277
1278 @item M-x org-table-export
1279 Export the table as a TAB-separated file. Useful for data exchange with,
1280 for example, Excel or database programs.
1281
1282 @end table
1283
1284 If you don't like the automatic table editor because it gets in your
1285 way on lines which you would like to start with @samp{|}, you can turn
1286 it off with
1287
1288 @lisp
1289 (setq org-enable-table-editor nil)
1290 @end lisp
1291
1292 @noindent Then the only table command that still works is
1293 @kbd{C-c C-c} to do a manual re-align.
1294
1295 @node Narrow columns, orgtbl-mode, Built-in table editor, Tables
1296 @section Narrow columns
1297 @cindex narrow columns in tables
1298
1299 The width of columns is automatically determined by the table editor.
1300 Sometimes a single field or a few fields need to carry more text,
1301 leading to inconveniently wide columns. To limit@footnote{This feature
1302 does not work on XEmacs.} the width of a column, one field anywhere in
1303 the column may contain just the string @samp{<N>} where @samp{N} is an
1304 integer specifying the width of the column in characters. The next
1305 re-align will then set the width of this column to no more than this
1306 value.
1307
1308 @example
1309 @group
1310 |---+------------------------------| |---+--------|
1311 | | | | | <6> |
1312 | 1 | one | | 1 | one |
1313 | 2 | two | ----\ | 2 | two |
1314 | 3 | This is a long chunk of text | ----/ | 3 | This=> |
1315 | 4 | four | | 4 | four |
1316 |---+------------------------------| |---+--------|
1317 @end group
1318 @end example
1319
1320 @noindent
1321 Fields that are wider become clipped and end in the string @samp{=>}.
1322 Note that the full text is still in the buffer, it is only invisible.
1323 To see the full text, hold the mouse over the field - a tooltip window
1324 will show the full content. To edit such a field, use the command
1325 @kbd{C-c `} (that is @kbd{C-c} followed by the backquote). This will
1326 open a new window with the full field. Edit it and finish with @kbd{C-c
1327 C-c}.
1328
1329 When visiting a file containing a table with narrowed columns, the
1330 necessary character hiding has not yet happened, and the table needs to
1331 be aligned before it looks nice. Setting the option
1332 @code{org-startup-align-all-tables} will realign all tables in a file
1333 upon visiting, but also slow down startup. You can also set this option
1334 on a per-file basis with:
1335
1336 @example
1337 #+STARTUP: align
1338 #+STARTUP: noalign
1339 @end example
1340
1341 @node orgtbl-mode, The spreadsheet, Narrow columns, Tables
1342 @section The Orgtbl minor mode
1343 @cindex orgtbl-mode
1344 @cindex minor mode for tables
1345
1346 If you like the intuitive way the Org-mode table editor works, you
1347 might also want to use it in other modes like text-mode or mail-mode.
1348 The minor mode Orgtbl-mode makes this possible. You can always toggle
1349 the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for
1350 example in mail mode, use
1351
1352 @lisp
1353 (add-hook 'mail-mode-hook 'turn-on-orgtbl)
1354 @end lisp
1355
1356 Furthermore, with some special setup, it is possible to maintain tables
1357 in arbitrary syntax with Orgtbl-mode. For example, it is possible to
1358 construct LaTeX tables with the underlying ease and power of
1359 Orgtbl-mode, including spreadsheet capabulities. For details, see
1360 @ref{Tables in arbitrary syntax}.
1361
1362 @node The spreadsheet, , orgtbl-mode, Tables
1363 @section The spreadsheet
1364 @cindex calculations, in tables
1365 @cindex spreadsheet capabilities
1366 @cindex @file{calc} package
1367
1368 The table editor makes use of the Emacs @file{calc} package to implement
1369 spreadsheet-like capabilities. It can also evaluate Emacs Lisp forms to
1370 derive fields from other fields.
1371 @menu
1372 * References:: How to refer to another field or range
1373 * Formula syntax for Calc:: Using Calc to compute stuff
1374 * Formula syntax for Lisp:: Writing formulas in Emacs Lisp
1375 * Field formulas:: Formulas valid for a single field
1376 * Column formulas:: Formulas valid for an entire column
1377 * Editing and debugging formulas:: Fixing formulas
1378 * Updating the table:: Recomputing all dependent fields
1379 * Advanced features:: Field names, parameters and automatic recalc
1380 @end menu
1381
1382 @node References, Formula syntax for Calc, The spreadsheet, The spreadsheet
1383 @subsection References
1384 @cindex references
1385
1386 To compute fields in the table from other fields, formulas must
1387 reference other fields or ranges. In Org-mode, fields can be referenced
1388 by name, by absolute coordinates, and by relative coordinates. To find
1389 out what the coordinates of a field are, press @kbd{C-c ?} in that
1390 field.
1391
1392 @subsubheading Field references
1393 @cindex field references
1394 @cindex references, to fields
1395
1396 Formulas can reference the value of another field with the operator
1397 @example
1398 @@row$column
1399 @end example
1400
1401 Column references can be absolute like @samp{1}, @samp{2},...@samp{N},
1402 or relative to the current column like @samp{+1} or @samp{-2}.
1403
1404 The row specification only counts data lines and ignores horizontal
1405 separator lines (hlines). You can use absolute row numbers
1406 @samp{1}...@samp{N}, and row numbers relative to the current row like
1407 @samp{+3} or @samp{-1}. Or specify the row relative to one of the
1408 hlines: @samp{I} refers to the first hline, @samp{II} to the second etc.
1409 @samp{-I} refers to the first such line above the current line,
1410 @samp{+I} to the first such line below the current line. You can also
1411 write @samp{III+2} which is the second data line after the third hline
1412 in the table. Relative row numbers like @samp{-3} will not cross hlines
1413 if the current line is too close to the hline. Instead, the value
1414 directly at the hline is used.
1415
1416 @samp{0} refers to the current row and column. Also, if you omit
1417 either the column or the row part of the reference, the current
1418 row/column is implied.
1419
1420 Org-mode's references with @emph{positive} numbers correspond to fixed
1421 references in other spreadsheet programs. For example, @code{@@3$28}
1422 corresponds to @code{$AB$3}. Org-mode's references with @emph{negative}
1423 numbers behave similar to non-fixed references in other spreadsheet
1424 programs, because when the same formula is used in several fields,
1425 different fields are referenced each time.
1426
1427 Here are a few examples:
1428
1429 @example
1430 @@2$3 @r{2nd row, 3rd column}
1431 $5 @r{column 5 in the current row}
1432 @@2 @r{current column, row 2}
1433 @@-1$-3 @r{the field one row up, three columns to the left}
1434 @@-I$2 @r{field just under hline above current row, column 2}
1435 @end example
1436
1437 @subsubheading Range references
1438 @cindex range references
1439 @cindex references, to ranges
1440
1441 You may reference a rectangular range of fields by specifying two field
1442 references connected by two dots @samp{..}. If both fields are in the
1443 current row, you may simply use @samp{$2..$7}, but if at least one field
1444 is in a different row, you need to use the general @code{@@row$column}
1445 format at least for the first field (i.e the reference must start with
1446 @samp{@@} in order to be interpreted correctly). Examples:
1447
1448 @example
1449 $1..$3 @r{First three fields in the current row.}
1450 $P..$Q @r{Range, using column names (see under Advanced)}
1451 @@2$1..@@4$3 @r{6 fields between these two fields.}
1452 @@-1$-2..@@-1 @r{3 numbers from the column to the left, 2 up to current row}
1453 @end example
1454
1455 @noindent Range references return a vector of values that can be fed
1456 into Calc vector functions. Empty fields in ranges are normally
1457 suppressed, so that the vector contains only the non-empty fields (but
1458 see the @samp{E} mode switch below). If there are no non-empty fields,
1459 @samp{[0]} is returned to avoid syntax errors in formulas.
1460
1461 @subsubheading Named references
1462 @cindex named references
1463 @cindex references, named
1464 @cindex name, of column or field
1465 @cindex constants, in calculations
1466
1467 @samp{$name} is interpreted as the name of a column, parameter or
1468 constant. Constants are defined globally through the variable
1469 @code{org-table-formula-constants}. If you have the
1470 @file{constants.el} package, it will also be used to resolve
1471 constants, including natural constants like @samp{$h} for Planck's
1472 constant, and units like @samp{$km} for kilometers. Column names and
1473 parameters can be specified in special table lines. These are
1474 described below, see @ref{Advanced features}.
1475
1476 @node Formula syntax for Calc, Formula syntax for Lisp, References, The spreadsheet
1477 @subsection Formula syntax for Calc
1478 @cindex formula syntax, Calc
1479 @cindex syntax, of formulas
1480
1481 A formula can be any algebraic expression understood by the Emacs
1482 @file{Calc} package. @b{Note that @file{calc} has the
1483 non-standard convention that @samp{/} has lower precedence than
1484 @samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.} Before
1485 evaluation by @code{calc-eval} (@pxref{Calling Calc from
1486 Your Programs,calc-eval,Calling calc from Your Lisp Programs,calc,GNU
1487 Emacs Calc Manual}),
1488 variable substitution takes place according to the rules described above.
1489 @cindex vectors, in table calculations
1490 The range vectors can be directly fed into the calc vector functions
1491 like @samp{vmean} and @samp{vsum}.
1492
1493 @cindex format specifier
1494 @cindex mode, for @file{calc}
1495 A formula can contain an optional mode string after a semicolon. This
1496 string consists of flags to influence Calc and other modes during
1497 execution. By default, Org-mode uses the standard calc modes (precision
1498 12, angular units degrees, fraction and symbolic modes off. The display
1499 format, however, has been changed to @code{(float 5)} to keep tables
1500 compact. The default settings can be configured using the variable
1501 @code{org-calc-default-modes}.
1502
1503 @example
1504 p20 @r{switch the internal precision to 20 digits}
1505 n3 s3 e2 f4 @r{normal, scientific, engineering, or fixed display format}
1506 D R @r{angle modes: degrees, radians}
1507 F S @r{fraction and symbolic modes}
1508 N @r{interpret all fields as numbers, use 0 for non-numbers}
1509 T @r{force text interpretation}
1510 E @r{keep empty fields in ranges}
1511 @end example
1512
1513 @noindent
1514 In addition, you may provide a @code{printf} format specifier to
1515 reformat the final result. A few examples:
1516
1517 @example
1518 $1+$2 @r{Sum of first and second field}
1519 $1+$2;%.2f @r{Same, format result to two decimals}
1520 exp($2)+exp($1) @r{Math functions can be used}
1521 $;%.1f @r{Reformat current cell to 1 decimal}
1522 ($3-32)*5/9 @r{Degrees F -> C conversion}
1523 $c/$1/$cm @r{Hz -> cm conversion, using @file{constants.el}}
1524 tan($1);Dp3s1 @r{Compute in degrees, precision 3, display SCI 1}
1525 sin($1);Dp3%.1e @r{Same, but use printf specifier for display}
1526 vmean($2..$7) @r{Compute column range mean, using vector function}
1527 vmean($2..$7);EN @r{Same, but treat empty fields as 0}
1528 taylor($3,x=7,2) @r{taylor series of $3, at x=7, second degree}
1529 @end example
1530
1531 @node Formula syntax for Lisp, Field formulas, Formula syntax for Calc, The spreadsheet
1532 @subsection Emacs Lisp forms as formulas
1533 @cindex Lisp forms, as table formulas
1534
1535 It is also possible to write a formula in Emacs Lisp; this can be useful
1536 for string manipulation and control structures. If a formula starts
1537 with a single quote followed by an opening parenthesis, then it is
1538 evaluated as a lisp form. The evaluation should return either a string
1539 or a number. Just as with @file{calc} formulas, you can specify modes
1540 and a printf format after a semicolon. A reference will be replaced
1541 with a string (in double quotes) containing the field. If you provide
1542 the @samp{N} mode switch, all referenced elements will be numbers.
1543 Ranges are inserted as space-separated fields, so you can embed them in
1544 list or vector syntax. A few examples, note how the @samp{N} mode is
1545 used when we do computations in lisp.
1546
1547 @example
1548 @r{Swap the first two characters of the content of column 1}
1549 '(concat (substring $1 1 2) (substring $1 0 1) (substring $1 2))
1550 @r{Add columns 1 and 2, equivalent to the Calc's @code{$1+$2}}
1551 '(+ $1 $2);N
1552 @r{Compute the sum of columns 1-4, like Calc's @code{vsum($1..$4)}}
1553 '(apply '+ '($1..$4));N
1554 @end example
1555
1556 @node Field formulas, Column formulas, Formula syntax for Lisp, The spreadsheet
1557 @subsection Field formulas
1558 @cindex field formula
1559 @cindex formula, for individual table field
1560
1561 To assign a formula to a particular field, type it directly into the
1562 field, preceded by @samp{:=}, for example @samp{:=$1+$2}. When you
1563 press @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in
1564 the field, the formula will be stored as the formula for this field,
1565 evaluated, and the current field replaced with the result.
1566
1567 Formulas are stored in a special line starting with @samp{#+TBLFM:}
1568 directly below the table. If you typed the equation in the 4th field of
1569 the 3rd data line in the table, the formula will look like
1570 @samp{@@3$2=$1+$2}. When inserting/deleting/swapping column and rows
1571 with the appropriate commands, @i{absolute references} (but not relative
1572 ones) in stored formulas are modified in order to
1573 still reference the same field. Of cause this is not true if you edit
1574 the table structure with normal editing commands - then you must go and
1575 fix equations yourself.
1576
1577 Instead of typing an equation into the field, you may also use the
1578 following command
1579
1580 @table @kbd
1581 @kindex C-u C-c =
1582 @item C-u C-c =
1583 Install a new formula for the current field. The command prompts for a
1584 formula, with default taken from the @samp{#+TBLFM:} line, applies
1585 it to the current field and stores it.
1586 @end table
1587
1588 @node Column formulas, Editing and debugging formulas, Field formulas, The spreadsheet
1589 @subsection Column formulas
1590 @cindex column formula
1591 @cindex formula, for table column
1592
1593 Often in a table, the same formula should be used for all fields in a
1594 particular column. Instead of having to copy the formula to all fields
1595 in that column, org-mode allows to assign a single formula to an entire
1596 column.
1597
1598 To assign a formula to a column, type it directly into any field in the
1599 column, preceded by an equal sign, like @samp{=$1+$2}. When you press
1600 @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in the
1601 field, the formula will be stored as the formula for the current column,
1602 evaluated and the current field replaced with the result. If the field
1603 contains only @samp{=}, the previously stored formula for this column is
1604 used. For each column, Org-mode will only remember the most recently
1605 used formula. In the @samp{TBLFM:} line, column formulas will look like
1606 @samp{$4=$1+$2}.
1607
1608 Instead of typing an equation into the field, you may also use the
1609 following command:
1610
1611 @table @kbd
1612 @kindex C-c =
1613 @item C-c =
1614 Install a new formula for the current column and replace current field
1615 with the result of the formula. The command prompts for a formula, with
1616 default taken from the @samp{#+TBLFM} line, applies it to the current
1617 field and stores it. With a numerical prefix (e.g. @kbd{C-5 C-c =})
1618 will apply it to that many consecutive fields in the current column.
1619 @end table
1620
1621
1622 @node Editing and debugging formulas, Updating the table, Column formulas, The spreadsheet
1623 @subsection Editing and Debugging formulas
1624 @cindex formula editing
1625 @cindex editing, of table formulas
1626
1627 You can edit individual formulas in the minibuffer or directly in the
1628 field. Org-mode can also prepare a special buffer with all active
1629 formulas of a table.
1630
1631 @table @kbd
1632 @kindex C-c =
1633 @kindex C-u C-c =
1634 @item C-c =
1635 @itemx C-u C-c =
1636 Edit the formula associated with the current column/field in the
1637 minibuffer. See @ref{Column formulas} and @ref{Field formulas}.
1638 @kindex C-u C-u C-c =
1639 @item C-u C-u C-c =
1640 Re-insert the active formula (either a
1641 field formula, or a column formula) into the current field, so that you
1642 can edit it directly in the field. The advantage over editing in the
1643 minibuffer is that you can use the command @kbd{C-c ?}.
1644 @kindex C-c ?
1645 @item C-c ?
1646 While editing a formula in a table field, highlight the field(s)
1647 referenced by the reference at the cursor position in the formula.
1648 @kindex C-c '
1649 @item C-c '
1650 Edit all formulas for the current table in a special buffer, where the
1651 formulas will be displayed one per line.
1652 While inside the special buffer, Org-mode will automatically highlight
1653 any field or range reference at the cursor position. You may edit,
1654 remove and add formulas, and use the following commands:
1655 @table @kbd
1656 @kindex C-c C-c
1657 @item C-c C-c
1658 Exit the buffer and store the modified formulas. With @kbd{C-u} prefix,
1659 also apply the new formulas to the entire table.
1660 @kindex C-c C-q
1661 @item C-c C-q
1662 Exit the buffer without installing changes.
1663 @kindex @key{TAB}
1664 @item @key{TAB}
1665 Pretty-print or indent lisp formula at point. When in a line containing
1666 a lisp formula, format the formula according to Emacs Lisp rules.
1667 Another @key{TAB} collapses the formula back again. In the open
1668 formula, @key{TAB} re-indents just like in Emacs-lisp-mode.
1669 @kindex M-@key{TAB}
1670 @item M-@key{TAB}
1671 Complete Lisp symbols, just like in Emacs-lisp-mode.
1672 @kindex S-@key{up}
1673 @kindex S-@key{down}
1674 @item S-@key{up}/@key{down}
1675 Move the reference line in the Org-mode buffer up and down. This is
1676 important for highlighting the references of column formulas for
1677 different rows.
1678 @kindex M-@key{up}
1679 @kindex M-@key{down}
1680 @item M-@key{up}/@key{down}
1681 Scroll the window displaying the table.
1682 @end table
1683 @kindex C-c @}
1684 @item C-c @}
1685 Toggle the display of row and column numbers for a table, using
1686 overlays. These are uptated each time the table is aligned, you can
1687 force it with @kbd{C-c C-c}.
1688 @kindex C-c @{
1689 @item C-c @{
1690 Toggle the formula debugger on and off. See below.
1691 @end table
1692
1693 Making a table field blank does not remove the formula associated with
1694 the field, because that is stored in a different line (the @samp{TBLFM}
1695 line) - during the next recalculation the field will be filled again.
1696 To remove a formula from a field, you have to give an empty reply when
1697 prompted for the formula, or to edit the @samp{#+TBLFM} line.
1698
1699 @kindex C-c C-c
1700 You may edit the @samp{#+TBLFM} directly and re-apply the changed
1701 equations with @kbd{C-c C-c} in that line, or with the normal
1702 recalculation commands in the table.
1703
1704 @subsubheading Debugging formulas
1705 @cindex formula debugging
1706 @cindex debugging, of table formulas
1707 When the evaluation of a formula leads to an error, the field content
1708 becomes the string @samp{#ERROR}. If you would like see what is going
1709 on during variable substitution and calculation in order to find a bug,
1710 turn on formula debugging in the @code{Tbl} menu and repeat the
1711 calculation, for example by pressing @kbd{C-c = @key{RET}} in a field.
1712 Detailed information will be displayed.
1713
1714 @node Updating the table, Advanced features, Editing and debugging formulas, The spreadsheet
1715 @subsection Updating the Table
1716 @cindex recomputing table fields
1717 @cindex updating, table
1718
1719 Recalculation of a table is normally not automatic, but needs to be
1720 triggered by a command. See @ref{Advanced features} for a way to make
1721 recalculation at least semi-automatically.
1722
1723 In order to recalculate a line of a table or the entire table, use the
1724 following commands:
1725
1726 @table @kbd
1727 @kindex C-c *
1728 @item C-c *
1729 Recalculate the current row by first applying the stored column formulas
1730 from left to right, and all field formulas in the current row.
1731
1732 @kindex C-u C-c *
1733 @item C-u C-c *
1734 @kindex C-u C-c C-c
1735 @itemx C-u C-c C-c
1736 Recompute the entire table, line by line. Any lines before the first
1737 hline are left alone, assuming that these are part of the table header.
1738
1739 @kindex C-u C-u C-c *
1740 @item C-u C-u C-c *
1741 Iterate the table by recomputing it until no further changes occur.
1742 This may be necessary if some computed fields use the value of other
1743 fields that are computed @i{later} in the calculation sequence.
1744 @end table
1745
1746
1747 @node Advanced features, , Updating the table, The spreadsheet
1748 @subsection Advanced features
1749
1750 If you want the recalculation of fields to happen automatically, or if
1751 you want to be able to assign @i{names} to fields and columns, you need
1752 to reserve the first column of the table for special marking characters.
1753 @table @kbd
1754 @kindex C-#
1755 @item C-#
1756 Rotate the calculation mark in first column through the states @samp{},
1757 @samp{#}, @samp{*}, @samp{!}, @samp{$}. The meaning of these characters
1758 is discussed below. When there is an active region, change all marks in
1759 the region.
1760 @end table
1761
1762 Here is an example of a table that collects exam results of students and
1763 makes use of these features:
1764
1765 @example
1766 @group
1767 |---+---------+--------+--------+--------+-------+------|
1768 | | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
1769 |---+---------+--------+--------+--------+-------+------|
1770 | ! | | P1 | P2 | P3 | Tot | |
1771 | # | Maximum | 10 | 15 | 25 | 50 | 10.0 |
1772 | ^ | | m1 | m2 | m3 | mt | |
1773 |---+---------+--------+--------+--------+-------+------|
1774 | # | Peter | 10 | 8 | 23 | 41 | 8.2 |
1775 | # | Sara | 6 | 14 | 19 | 39 | 7.8 |
1776 | # | Sam | 2 | 4 | 3 | 9 | 1.8 |
1777 |---+---------+--------+--------+--------+-------+------|
1778 | | Average | | | | 29.7 | |
1779 | ^ | | | | | at | |
1780 | $ | max=50 | | | | | |
1781 |---+---------+--------+--------+--------+-------+------|
1782 #+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(@@-II..@@-I);%.1f
1783 @end group
1784 @end example
1785
1786 @noindent @b{Important}: Please note that for these special tables,
1787 recalculating the table with @kbd{C-u C-c *} will only affect rows that
1788 are marked @samp{#} or @samp{*}, and fields that have a formula assigned
1789 to the field itself. The column formulas are not applied in rows with
1790 empty first field.
1791
1792 @cindex marking characters, tables
1793 The marking characters have the following meaning:
1794 @table @samp
1795 @item !
1796 The fields in this line define names for the columns, so that you may
1797 refer to a column as @samp{$Tot} instead of @samp{$6}.
1798 @item ^
1799 This row defines names for the fields @emph{above} the row. With such
1800 a definition, any formula in the table may use @samp{$m1} to refer to
1801 the value @samp{10}. Also, if you assign a formula to a names field, it
1802 will be stored as @samp{$name=...}.
1803 @item _
1804 Similar to @samp{^}, but defines names for the fields in the row
1805 @emph{below}.
1806 @item $
1807 Fields in this row can define @emph{parameters} for formulas. For
1808 example, if a field in a @samp{$} row contains @samp{max=50}, then
1809 formulas in this table can refer to the value 50 using @samp{$max}.
1810 Parameters work exactly like constants, only that they can be defined on
1811 a per-table basis.
1812 @item #
1813 Fields in this row are automatically recalculated when pressing
1814 @key{TAB} or @key{RET} or @kbd{S-@key{TAB}} in this row. Also, this row
1815 is selected for a global recalculation with @kbd{C-u C-c *}. Unmarked
1816 lines will be left alone by this command.
1817 @item *
1818 Selects this line for global recalculation with @kbd{C-u C-c *}, but
1819 not for automatic recalculation. Use this when automatic
1820 recalculation slows down editing too much.
1821 @item
1822 Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}.
1823 All lines that should be recalculated should be marked with @samp{#}
1824 or @samp{*}.
1825 @item /
1826 Do not export this line. Useful for lines that contain the narrowing
1827 @samp{<N>} markers.
1828 @end table
1829
1830 Finally, just to whet your appetite on what can be done with the
1831 fantastic @file{calc} package, here is a table that computes the Taylor
1832 series of degree @code{n} at location @code{x} for a couple of functions
1833 (homework: try that with Excel :-)
1834
1835 @example
1836 @group
1837 |---+-------------+---+-----+--------------------------------------|
1838 | | Func | n | x | Result |
1839 |---+-------------+---+-----+--------------------------------------|
1840 | # | exp(x) | 1 | x | 1 + x |
1841 | # | exp(x) | 2 | x | 1 + x + x^2 / 2 |
1842 | # | exp(x) | 3 | x | 1 + x + x^2 / 2 + x^3 / 6 |
1843 | # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 |
1844 | # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2 |
1845 | * | tan(x) | 3 | x | 0.0175 x + 1.77e-6 x^3 |
1846 |---+-------------+---+-----+--------------------------------------|
1847 #+TBLFM: $5=taylor($2,$4,$3);n3
1848 @end group
1849 @end example
1850
1851 @node Hyperlinks, TODO items, Tables, Top
1852 @chapter Hyperlinks
1853 @cindex hyperlinks
1854
1855 Just like HTML, Org-mode provides links inside a file, and external
1856 links to other files, Usenet articles, emails, and much more.
1857
1858 @menu
1859 * Link format:: How links in Org-mode are formatted
1860 * Internal links:: Links to other places in the current file
1861 * External links:: URL-like links to the world
1862 * Handling links:: Creating, inserting and following
1863 * Link abbreviations:: Shortcuts for writing complex links
1864 * Search options:: Linking to a specific location
1865 * Custom searches:: When the default search is not enough
1866 * Remember:: Org-trees store quick notes
1867 @end menu
1868
1869 @node Link format, Internal links, Hyperlinks, Hyperlinks
1870 @section Link format
1871 @cindex link format
1872 @cindex format, of links
1873
1874 Org-mode will recognize plain URL-like links and activate them as
1875 clickable links. The general link format, however, looks like this:
1876
1877 @example
1878 [[link][description]] @r{or alternatively} [[link]]
1879 @end example
1880
1881 Once a link in the buffer is complete (all brackets present), Org-mode
1882 will change the display so that @samp{description} is displayed instead
1883 of @samp{[[link][description]]} and @samp{link} is displayed instead of
1884 @samp{[[link]]}. Links will be highlighted in the face @code{org-link},
1885 which by default is an underlined face. You can directly edit the
1886 visible part of a link. Note that this can be either the @samp{link}
1887 part (if there is no description) or the @samp{description} part. To
1888 edit also the invisible @samp{link} part, use @kbd{C-c C-l} with the
1889 cursor on the link.
1890
1891 If you place the cursor at the beginning or just behind the end of the
1892 displayed text and press @key{BACKSPACE}, you will remove the
1893 (invisible) bracket at that location. This makes the link incomplete
1894 and the internals are again displayed as plain text. Inserting the
1895 missing bracket hides the link internals again. To show the
1896 internal structure of all links, use the menu entry
1897 @code{Org->Hyperlinks->Literal links}.
1898
1899 @node Internal links, External links, Link format, Hyperlinks
1900 @section Internal links
1901 @cindex internal links
1902 @cindex links, internal
1903 @cindex targets, for links
1904
1905 If the link does not look like a URL, it is considered to be internal in
1906 the current file. Links such as @samp{[[My Target]]} or @samp{[[My
1907 Target][Find my target]]} lead to a text search in the current file.
1908 The link can be followed with @kbd{C-c C-o} when the cursor is on the
1909 link, or with a mouse click (@pxref{Handling links}). The preferred
1910 match for such a link is a dedicated target: the same string in double
1911 angular brackets. Targets may be located anywhere; sometimes it is
1912 convenient to put them into a comment line. For example
1913
1914 @example
1915 # <<My Target>>
1916 @end example
1917
1918 @noindent In HTML export (@pxref{HTML export}), such targets will become
1919 named anchors for direct access through @samp{http} links@footnote{Note
1920 that text before the first headline will never be exported, so the first
1921 such target must be after the first headline.}.
1922
1923 If no dedicated target exists, Org-mode will search for the words in the
1924 link. In the above example the search would be for @samp{my target}.
1925 Links starting with a star like @samp{*My Target} restrict the search to
1926 headlines. When searching, Org-mode will first try an exact match, but
1927 then move on to more and more lenient searches. For example, the link
1928 @samp{[[*My Targets]]} will find any of the following:
1929
1930 @example
1931 ** My targets
1932 ** TODO my targets are bright
1933 ** my 20 targets are
1934 @end example
1935
1936 To insert a link targeting a headline, in-buffer completion can be used.
1937 Just type a star followed by a few optional letters into the buffer and
1938 press @kbd{M-@key{TAB}}. All headlines in the current buffer will be
1939 offered as completions. @xref{Handling links}, for more commands
1940 creating links.
1941
1942 Following a link pushes a mark onto Org-mode's own mark ring. You can
1943 return to the previous position with @kbd{C-c &}. Using this command
1944 several times in direct succession goes back to positions recorded
1945 earlier.
1946
1947 @menu
1948 * Radio targets:: Make targets trigger links in plain text.
1949 @end menu
1950
1951 @node Radio targets, , Internal links, Internal links
1952 @subsection Radio targets
1953 @cindex radio targets
1954 @cindex targets, radio
1955 @cindex links, radio targets
1956
1957 You can configure Org-mode to link any occurrences of certain target
1958 names in normal text. So without explicitly creating a link, the text
1959 connects to the target radioing its position. Radio targets are
1960 enclosed by triple angular brackets. For example, a target
1961 @samp{<<<My Target>>>} causes each occurrence of @samp{my target} in
1962 normal text to become activated as a link. The Org-mode file is
1963 scanned automatically for radio targets only when the file is first
1964 loaded into Emacs. To update the target list during editing, press
1965 @kbd{C-c C-c} with the cursor on or at a target.
1966
1967 @node External links, Handling links, Internal links, Hyperlinks
1968 @section External links
1969 @cindex links, external
1970 @cindex external links
1971 @cindex links, external
1972 @cindex GNUS links
1973 @cindex BBDB links
1974 @cindex URL links
1975 @cindex file links
1976 @cindex VM links
1977 @cindex RMAIL links
1978 @cindex WANDERLUST links
1979 @cindex MH-E links
1980 @cindex USENET links
1981 @cindex SHELL links
1982 @cindex Info links
1983 @cindex elisp links
1984
1985 Org-mode supports links to files, websites, Usenet and email messages,
1986 and BBDB database entries. External links are URL-like locators. They
1987 start with a short identifying string followed by a colon. There can be
1988 no space after the colon. The following list shows examples for each
1989 link type.
1990
1991 @example
1992 http://www.astro.uva.nl/~dominik @r{on the web}
1993 file:/home/dominik/images/jupiter.jpg @r{file, absolute path}
1994 file:papers/last.pdf @r{file, relative path}
1995 news:comp.emacs @r{Usenet link}
1996 mailto:adent@@galaxy.net @r{Mail link}
1997 vm:folder @r{VM folder link}
1998 vm:folder#id @r{VM message link}
1999 vm://myself@@some.where.org/folder#id @r{VM on remote machine}
2000 wl:folder @r{WANDERLUST folder link}
2001 wl:folder#id @r{WANDERLUST message link}
2002 mhe:folder @r{MH-E folder link}
2003 mhe:folder#id @r{MH-E message link}
2004 rmail:folder @r{RMAIL folder link}
2005 rmail:folder#id @r{RMAIL message link}
2006 gnus:group @r{GNUS group link}
2007 gnus:group#id @r{GNUS article link}
2008 bbdb:Richard Stallman @r{BBDB link}
2009 shell:ls *.org @r{A shell command}
2010 elisp:(find-file-other-frame "Elisp.org") @r{An elisp form to evaluate}
2011 @end example
2012
2013 A link should be enclosed in double brackets and may contain a
2014 descriptive text to be displayed instead of the url (@pxref{Link
2015 format}), for example:
2016
2017 @example
2018 [[http://www.gnu.org/software/emacs/][GNU Emacs]]
2019 @end example
2020
2021 @noindent
2022 If the description is a file name or URL that points to an image, HTML
2023 export (@pxref{HTML export}) will inline the image as a clickable
2024 button. If there is no description at all and the link points to an
2025 image,
2026 that image will be inlined into the exported HTML file.
2027
2028 @cindex angular brackets, around links
2029 @cindex plain text external links
2030 Org-mode also finds external links in the normal text and activates them
2031 as links. If spaces must be part of the link (for example in
2032 @samp{bbdb:Richard Stallman}), or if you need to remove ambiguities
2033 about the end of the link, enclose them in angular brackets.
2034
2035 @node Handling links, Link abbreviations, External links, Hyperlinks
2036 @section Handling links
2037 @cindex links, handling
2038
2039 Org-mode provides methods to create a link in the correct syntax, to
2040 insert it into an org-mode file, and to follow the link.
2041
2042 @table @kbd
2043 @kindex C-c l
2044 @cindex storing links
2045 @item C-c l
2046 Store a link to the current location. This is a @emph{global} command
2047 which can be used in any buffer to create a link. The link will be
2048 stored for later insertion into an Org-mode buffer (see below). For
2049 Org-mode files, if there is a @samp{<<target>>} at the cursor, the link
2050 points to the target. Otherwise it points to the current headline. For
2051 VM, RMAIL, WANDERLUST, MH-E, GNUS and BBDB buffers, the link will
2052 indicate the current article/entry. For W3 and W3M buffers, the link
2053 goes to the current URL. For any other files, the link will point to
2054 the file, with a search string (@pxref{Search options}) pointing to the
2055 contents of the current line. If there is an active region, the
2056 selected words will form the basis of the search string. If the
2057 automatically created link is not working correctly or accurately
2058 enough, you can write custom functions to select the search string and
2059 to do the search for particular file types - see @ref{Custom searches}.
2060 The key binding @kbd{C-c l} is only a suggestion - see @ref{Installation}.
2061
2062 @kindex C-c C-l
2063 @cindex link completion
2064 @cindex completion, of links
2065 @cindex inserting links
2066 @item C-c C-l
2067 Insert a link. This prompts for a link to be inserted into the buffer.
2068 You can just type a link, using text for an internal link, or one of the
2069 link type prefixes mentioned in the examples above. All links stored
2070 during the current session are part of the history for this prompt, so
2071 you can access them with @key{up} and @key{down}, or with
2072 completion@footnote{After insertion of a stored link, the link will be
2073 removed from the list of stored links. To keep it in the list later
2074 use, use a triple @kbd{C-u} prefix to @kbd{C-c C-l}, or configure the
2075 option @code{org-keep-stored-link-after-insertion}.}. The link will be
2076 inserted into the buffer, along with a descriptive text. If some text
2077 was selected when this command is called, the selected text becomes the
2078 default description.@* Note that you don't have to use this command to
2079 insert a link. Links in Org-mode are plain text, and you can type or
2080 paste them straight into the buffer. By using this command, the links
2081 are automatically enclosed in double brackets, and you will be asked for
2082 the optional descriptive text.
2083
2084 @c If the link is a @samp{file:} link and
2085 @c the linked file is located in the same directory as the current file or
2086 @c a subdirectory of it, the path of the file will be inserted relative to
2087 @c the current directory.
2088
2089 @kindex C-u C-c C-l
2090 @cindex file name completion
2091 @cindex completion, of file names
2092 @item C-u C-c C-l
2093 When @kbd{C-c C-l} is called with a @kbd{C-u} prefix argument, a link to
2094 a file will be inserted and you may use file name completion to select
2095 the name of the file. The path to the file is inserted relative to the
2096 directory of the current org file, if the linked file is in the current
2097 directory or in a subdirectory of it, or if the path is written relative
2098 to the current directory using @samp{../}. Otherwise an absolute path
2099 is used, if possible with @samp{~/} for your home directory. You can
2100 force an absolute path with two @kbd{C-u} prefixes.
2101
2102 @item C-c C-l @r{with cursor on existing link}
2103 When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit the
2104 link and description parts of the link.
2105
2106 @cindex following links
2107 @kindex C-c C-o
2108 @item C-c C-o
2109 Open link at point. This will launch a web browser for URLs (using
2110 @command{browse-url-at-point}), run vm/mh-e/wanderlust/rmail/gnus/bbdb
2111 for the corresponding links, and execute the command in a shell link.
2112 When the cursor is on an internal link, this commands runs the
2113 corresponding search. When the cursor is on a TAG list in a headline,
2114 it creates the corresponding TAGS view. If the cursor is on a time
2115 stamp, it compiles the agenda for that date. Furthermore, it will visit
2116 text and remote files in @samp{file:} links with Emacs and select a
2117 suitable application for local non-text files. Classification of files
2118 is based on file extension only. See option @code{org-file-apps}. If
2119 you want to override the default application and visit the file with
2120 Emacs, use a @kbd{C-u} prefix.
2121
2122 @kindex mouse-2
2123 @kindex mouse-1
2124 @item mouse-2
2125 @itemx mouse-1
2126 On links, @kbd{mouse-2} will open the link just as @kbd{C-c C-o}
2127 would. Under Emacs 22, also @kbd{mouse-1} will follow a link.
2128
2129 @kindex mouse-3
2130 @item mouse-3
2131 Like @kbd{mouse-2}, but force file links to be opened with Emacs, and
2132 internal links to be displayed in another window@footnote{See the
2133 variable @code{org-display-internal-link-with-indirect-buffer}}.
2134
2135 @cindex mark ring
2136 @kindex C-c %
2137 @item C-c %
2138 Push the current position onto the mark ring, to be able to return
2139 easily. Commands following an internal link do this automatically.
2140
2141 @cindex links, returning to
2142 @kindex C-c &
2143 @item C-c &
2144 Jump back to a recorded position. A position is recorded by the
2145 commands following internal links, and by @kbd{C-c %}. Using this
2146 command several times in direct succession moves through a ring of
2147 previously recorded positions.
2148
2149 @kindex C-c C-x C-n
2150 @kindex C-c C-x C-p
2151 @cindex links, finding next/previous
2152 @item C-c C-x C-n
2153 @itemx C-c C-x C-p
2154 Move forward/backward to the next link in the buffer. At the limit of
2155 the buffer, the search fails once, and then wraps around. The key
2156 bindings for this are really too long, you might want to bind this also
2157 to @kbd{C-n} and @kbd{C-p}
2158 @lisp
2159 (add-hook 'org-load-hook
2160 (lambda ()
2161 (define-key 'org-mode-map "\C-n" 'org-next-link)
2162 (define-key 'org-mode-map "\C-p" 'org-previous-link)))
2163 @end lisp
2164 @end table
2165
2166 @node Link abbreviations, Search options, Handling links, Hyperlinks
2167 @section Link abbreviations
2168 @cindex link abbreviations
2169 @cindex abbreviation, links
2170
2171 Long URLs can be cumbersome to type, and often many similar links are
2172 needed in a document. For this you can use link abbreviations. An
2173 abbreviated link looks like this
2174
2175 @example
2176 [[linkword:tag][description]]
2177 @end example
2178
2179 @noindent
2180 where the tag is optional. Such abbreviations are resolved according to
2181 the information in the variable @code{org-link-abbrev-alist} that
2182 relates the linkwords to replacement text. Here is an example:
2183
2184 @lisp
2185 @group
2186 (setq org-link-abbrev-alist
2187 '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
2188 ("google" . "http://www.google.com/search?q=")
2189 ("ads" . "http://adsabs.harvard.edu/cgi-bin/
2190 nph-abs_connect?author=%s&db_key=AST")))
2191 @end group
2192 @end lisp
2193
2194 If the replacement text contains the string @samp{%s}, it will be
2195 replaced with the tag. Otherwise the tag will be appended to the string
2196 in order to create the link. You may also specify a function that will
2197 be called with the tag as the only argument to create the link.
2198
2199 With the above setting, you could link to a specific bug with
2200 @code{[[bugzilla:129]]}, search the web for @samp{OrgMode} with
2201 @code{[[google:OrgMode]]} and find out what the Org-mode author is
2202 doing besides Emacs hacking with @code{[[ads:Dominik,C]]}.
2203
2204 If you need special abbreviations just for a single Org-mode buffer, you
2205 can define them in the file with
2206
2207 @example
2208 #+LINK: bugzilla http://10.1.2.9/bugzilla/show_bug.cgi?id=
2209 #+LINK: google http://www.google.com/search?q=%s
2210 @end example
2211
2212 @noindent
2213 In-buffer completion @pxref{Completion} can be used after @samp{[} to
2214 complete link abbreviations.
2215
2216 @node Search options, Custom searches, Link abbreviations, Hyperlinks
2217 @section Search options in file links
2218 @cindex search option in file links
2219 @cindex file links, searching
2220
2221 File links can contain additional information to make Emacs jump to a
2222 particular location in the file when following a link. This can be a
2223 line number or a search option after a double@footnote{For backward
2224 compatibility, line numbers can also follow a single colon.} colon. For
2225 example, when the command @kbd{C-c l} creates a link (@pxref{Handling
2226 links}) to a file, it encodes the words in the current line as a search
2227 string that can be used to find this line back later when following the
2228 link with @kbd{C-c C-o}.
2229
2230 Here is the syntax of the different ways to attach a search to a file
2231 link, together with an explanation:
2232
2233 @example
2234 [[file:~/code/main.c::255]]
2235 [[file:~/xx.org::My Target]]
2236 [[file:~/xx.org::*My Target]]
2237 [[file:~/xx.org::/regexp/]]
2238 @end example
2239
2240 @table @code
2241 @item 255
2242 Jump to line 255.
2243 @item My Target
2244 Search for a link target @samp{<<My Target>>}, or do a text search for
2245 @samp{my target}, similar to the search in internal links, see
2246 @ref{Internal links}. In HTML export (@pxref{HTML export}), such a file
2247 link will become an HTML reference to the corresponding named anchor in
2248 the linked file.
2249 @item *My Target
2250 In an Org-mode file, restrict search to headlines.
2251 @item /regexp/
2252 Do a regular expression search for @code{regexp}. This uses the Emacs
2253 command @code{occur} to list all matches in a separate window. If the
2254 target file is in Org-mode, @code{org-occur} is used to create a
2255 sparse tree with the matches.
2256 @c If the target file is a directory,
2257 @c @code{grep} will be used to search all files in the directory.
2258 @end table
2259
2260 As a degenerate case, a file link with an empty file name can be used
2261 to search the current file. For example, @code{[[file:::find me]]} does
2262 a search for @samp{find me} in the current file, just as
2263 @samp{[[find me]]} would.
2264
2265 @node Custom searches, Remember, Search options, Hyperlinks
2266 @section Custom Searches
2267 @cindex custom search strings
2268 @cindex search strings, custom
2269
2270 The default mechanism for creating search strings and for doing the
2271 actual search related to a file link may not work correctly in all
2272 cases. For example, BibTeX database files have many entries like
2273 @samp{year="1993"} which would not result in good search strings,
2274 because the only unique identification for a BibTeX entry is the
2275 citation key.
2276
2277 If you come across such a problem, you can write custom functions to set
2278 the right search string for a particular file type, and to do the search
2279 for the string in the file. Using @code{add-hook}, these functions need
2280 to be added to the hook variables
2281 @code{org-create-file-search-functions} and
2282 @code{org-execute-file-search-functions}. See the docstring for these
2283 variables for more information. Org-mode actually uses this mechanism
2284 for Bib@TeX{} database files, and you can use the corresponding code as
2285 an implementation example. Search for @samp{BibTeX links} in the source
2286 file.
2287
2288
2289 @node Remember, , Custom searches, Hyperlinks
2290 @section Remember
2291 @cindex @file{remember.el}
2292
2293 Another way to create org entries with links to other files is through
2294 the @i{remember} package by John Wiegley. @i{Remember} lets you store
2295 quick notes with little interruption of your work flow. See
2296 @uref{http://www.emacswiki.org/cgi-bin/wiki/RememberMode} for more
2297 information. The notes produced by @i{Remember} can be stored in
2298 different ways, and Org-mode files are a good target. Org-mode
2299 significantly expands the possibilities of @i{remember}: You may define
2300 templates for different note types, and to associate target files and
2301 headlines with specific templates. It also allows you to select the
2302 location where a note should be stored interactively, on the fly.
2303
2304 @menu
2305 * Setting up remember:: Some code for .emacs to get things going
2306 * Remember templates:: Define the outline of different note types
2307 * Storing notes:: Directly get the note to where it belongs
2308 @end menu
2309
2310 @node Setting up remember, Remember templates, Remember, Remember
2311 @subsection Setting up remember
2312
2313 The following customization will tell @i{remember} to use org files as
2314 target, and to create annotations compatible with Org-mode links.
2315
2316 @example
2317 (setq org-directory "~/path/to/my/orgfiles/")
2318 (setq org-default-notes-file "~/.notes")
2319 (setq remember-annotation-functions '(org-remember-annotation))
2320 (setq remember-handler-functions '(org-remember-handler))
2321 (add-hook 'remember-mode-hook 'org-remember-apply-template)
2322 @end example
2323
2324 @node Remember templates, Storing notes, Setting up remember, Remember
2325 @subsection Remember templates
2326 @cindex templates, for remember
2327
2328 In combination with Org-mode, you can use templates to generate
2329 different types of @i{remember} notes. For example, if you would like
2330 to use one template to create general TODO entries, another one for
2331 journal entries, and a third one for collecting random ideas, you could
2332 use:
2333
2334 @example
2335 (setq org-remember-templates
2336 '((?t "* TODO %?\n %i\n %a" "~/org/TODO.org")
2337 (?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org")
2338 (?i "* %^@{Title@}\n %i\n %a" "~/org/JOURNAL.org" "New Ideas")))
2339 @end example
2340
2341 @noindent In these entries, the character specifies how to select the
2342 template. The first string specifies the template. Two more (optional)
2343 strings give the file in which, and the headline under which the new
2344 note should be stored. The file defaults to
2345 @code{org-default-notes-file}, the heading to
2346 @code{org-remember-default-headline}. Both defaults help to get to the
2347 storing location quickly, but you can change the location interactively
2348 while storing the note.
2349
2350 When you call @kbd{M-x remember} (or @kbd{M-x org-remember}) to remember
2351 something, org will prompt for a key to select the template (if you have
2352 more than one template) and then prepare the buffer like
2353 @example
2354 * TODO
2355 [[file:link to where you called remember]]
2356 @end example
2357
2358 @noindent or
2359
2360 @example
2361 * [2006-03-21 Tue 15:37]
2362
2363 [[file:link to where you called remember]]
2364 @end example
2365
2366 @noindent
2367 During expansion of the template, special @kbd{%}-escapes allow dynamic
2368 insertion of content:
2369 @example
2370 %^@{prompt@} @r{prompt the user for a string and replace this sequence with it.}
2371 %t @r{time stamp, date only}
2372 %T @r{time stamp with date and time}
2373 %u, %U @r{like the above, but inactive time stamps}
2374 %^t @r{like @code{%t}, but prompt for date. Similarly @code{%^T}, @code{%^u}, @code{%^U}}
2375 @r{You may define a prompt like @code{%^@{Birthday@}t}}
2376 %n @r{user name (taken from @code{user-full-name})}
2377 %a @r{annotation, normally the link created with @code{org-store-link}}
2378 %i @r{initial content, the region when remember is called with C-u.}
2379 @r{The entire text will be indented like @code{%i} itself.}
2380 %:keyword @r{specific information for certain link types, see below}
2381 @end example
2382
2383 @noindent
2384 For specific link types, the following keywords will be defined:
2385
2386 @example
2387 Link type | Available keywords
2388 -------------------+----------------------------------------------
2389 bbdb | %:name %:company
2390 vm, wl, mh, rmail | %:type %:subject %:message-id
2391 | %:from %:fromname %:fromaddress
2392 | %:to %:toname %:toaddress
2393 | %:fromto @r{(either "to NAME" or "from NAME")@footnote{This will always be the other, not the user. See the variable @code{org-from-is-user-regexp}.}}
2394 gnus | %:group, @r{for messages also all email fields}
2395 w3, w3m | %:url
2396 info | %:file %:node
2397 calendar | %:date"
2398 @end example
2399
2400 @noindent
2401 If you would like to have the cursor in a specific position after the
2402 template has been expanded:
2403
2404 @example
2405 %? @r{After completing the template, position cursor here.}
2406 @end example
2407
2408 @noindent
2409 If you change you mind about which template to use, call
2410 @code{org-remember} in the remember buffer. You may then select a new
2411 template that will be filled with the previoous context information.
2412
2413 @node Storing notes, , Remember templates, Remember
2414 @subsection Storing notes
2415
2416 When you are finished preparing a note with @i{remember}, you have to press
2417 @kbd{C-c C-c} to file the note away. The handler first prompts for a
2418 target file - if you press @key{RET}, the value specified for the
2419 template is used. Then the command offers the headings tree of the
2420 selected file, with the cursor position at the default headline (if you
2421 had specified one in the template). You can either immediately press
2422 @key{RET} to get the note placed there. Or you can use vertical cursor
2423 motion (@key{up} and @key{down}) and visibility cycling (@key{TAB}) to
2424 find a better place. Pressing @key{RET} or @key{left} or @key{right}
2425 then leads to the following result.
2426
2427 @multitable @columnfractions 0.2 0.1 0.7
2428 @item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted}
2429 @item buffer-start @tab @key{RET} @tab as level 2 heading at end of file
2430 @item on headline @tab @key{RET} @tab as sublevel of the heading at cursor
2431 @item @tab @key{left} @tab as same level, before current heading
2432 @item @tab @key{right} @tab as same level, after current heading
2433 @item not on headline @tab @key{RET}
2434 @tab at cursor position, level taken from context.
2435 Or use prefix arg to specify level manually.
2436 @end multitable
2437
2438 So a fast way to store the note to its default location is to press
2439 @kbd{C-c C-c @key{RET} @key{RET}}. Even shorter would be @kbd{C-u C-c
2440 C-c}, which does the same without even asking for a file or showing the
2441 tree.
2442
2443 Before inserting the text into a tree, the function ensures that the
2444 text has a headline, i.e. a first line that starts with a @samp{*}.
2445 If not, a headline is constructed from the current date and some
2446 additional data. If the variable @code{org-adapt-indentation} is
2447 non-nil, the entire text is also indented so that it starts in the
2448 same column as the headline (after the asterisks).
2449
2450
2451 @node TODO items, Timestamps, Hyperlinks, Top
2452 @chapter TODO items
2453 @cindex TODO items
2454
2455 Org-mode does not maintain TODO lists as a separate document. TODO
2456 items are an integral part of the notes file, because TODO items
2457 usually come up while taking notes! With Org-mode, you simply mark
2458 any entry in a tree as being a TODO item. In this way, the
2459 information is not duplicated, and the entire context from which the
2460 item emerged is always present when you check.
2461
2462 Of course, this technique causes TODO items to be scattered throughout
2463 your file. Org-mode provides methods to give you an overview over all
2464 things you have to do.
2465
2466 @menu
2467 * TODO basics:: Marking and displaying TODO entries
2468 * TODO extensions:: Workflow and assignments
2469 * Priorities:: Some things are more important than others
2470 * Breaking down tasks:: Splitting a task into managable pieces
2471 * Checkboxes:: Tick-off lists
2472 @end menu
2473
2474 @node TODO basics, TODO extensions, TODO items, TODO items
2475 @section Basic TODO functionality
2476
2477 Any headline can become a TODO item by starting it with the word TODO,
2478 for example:
2479
2480 @example
2481 *** TODO Write letter to Sam Fortune
2482 @end example
2483
2484 @noindent
2485 The most important commands to work with TODO entries are:
2486
2487 @table @kbd
2488 @kindex C-c C-t
2489 @cindex cycling, of TODO states
2490 @item C-c C-t
2491 Rotate the TODO state of the current item between
2492
2493 @example
2494 ,-> (unmarked) -> TODO -> DONE --.
2495 '--------------------------------'
2496 @end example
2497
2498 The same rotation can also be done ``remotely'' from the timeline and
2499 agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
2500 @kindex S-@key{right}
2501 @kindex S-@key{left}
2502 @item S-@key{right}
2503 @itemx S-@key{left}
2504 Select the following/preceding TODO state, similar to cycling. Mostly
2505 useful if more than two TODO states are possible (@pxref{TODO extensions}).
2506 @kindex C-c C-v
2507 @cindex sparse tree, for TODO
2508 @item C-c C-v
2509 View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}). Folds
2510 the entire buffer, but shows all TODO items and the headings hierarchy
2511 above them. With prefix arg, show also the DONE entries. With
2512 numerical prefix N, show the tree for the Nth keyword in the variable
2513 @code{org-todo-keywords}.
2514 @kindex C-c a t
2515 @item C-c a t
2516 Show the global TODO list. This collects the TODO items from all
2517 agenda files (@pxref{Agenda views}) into a single buffer. The buffer is in
2518 @code{agenda-mode}, so there are commands to examine and manipulate
2519 the TODO entries directly from that buffer (@pxref{Agenda commands}).
2520 @xref{Global TODO list}, for more information.
2521 @c @item @code{org-agenda-include-all-todo}
2522 @c If you would like to have all your TODO items listed as part of your
2523 @c agenda, customize the variable @code{org-agenda-include-all-todo}.
2524 @end table
2525
2526
2527 @node TODO extensions, Priorities, TODO basics, TODO items
2528 @section Extended use of TODO keywords
2529 @cindex extended TODO keywords
2530
2531 The default implementation of TODO entries is just two states: TODO and
2532 DONE. You can, however, use the TODO feature for more complicated
2533 things by configuring the variables @code{org-todo-keywords} and
2534 @code{org-todo-interpretation}. Using special setup, you can even use
2535 TODO keywords in different ways in different org files.
2536
2537 Note that @i{tags} are another way to classify headlines in general and
2538 TODO items in particular (@pxref{Tags}).
2539
2540 @menu
2541 * Workflow states:: From TODO to DONE in steps
2542 * TODO types:: I do this, Fred the rest
2543 * Per file keywords:: Different files, different requirements
2544 @end menu
2545
2546 @node Workflow states, TODO types, TODO extensions, TODO extensions
2547 @subsection TODO keywords as workflow states
2548 @cindex TODO workflow
2549 @cindex workflow states as TODO keywords
2550
2551 You can use TODO keywords to indicate different states in the process
2552 of working on an item, for example:
2553
2554 @lisp
2555 (setq org-todo-keywords '("TODO" "FEEDBACK" "VERIFY" "DONE")
2556 org-todo-interpretation 'sequence)
2557 @end lisp
2558
2559 @cindex completion, of TODO keywords
2560 Changing these variables only becomes effective in a new Emacs session.
2561 With this setup, the command @kbd{C-c C-t} will cycle an entry from
2562 TODO to FEEDBACK, then to VERIFY, and finally to DONE. You may also
2563 use a prefix argument to quickly select a specific state. For example
2564 @kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
2565 If you define many keywords, you can use in-buffer completion (see
2566 @ref{Completion}) to insert these words into the buffer. Changing a todo
2567 state can be logged with a timestamp, see @ref{Tracking TODO state
2568 changes} for more information.
2569
2570 @node TODO types, Per file keywords, Workflow states, TODO extensions
2571 @subsection TODO keywords as types
2572 @cindex TODO types
2573 @cindex names as TODO keywords
2574 @cindex types as TODO keywords
2575
2576 The second possibility is to use TODO keywords to indicate different
2577 types of action items. For example, you might want to indicate that
2578 items are for ``work'' or ``home''. If you are into David Allen's
2579 @emph{Getting Things DONE}, you might want to use todo types
2580 @samp{NEXTACTION}, @samp{WAITING}, @samp{MAYBE}. Or, when you work
2581 with several people on a single project, you might want to assign
2582 action items directly to persons, by using their names as TODO
2583 keywords. This would be set up like this:
2584
2585 @lisp
2586 (setq org-todo-keywords '("Fred" "Sara" "Lucy" "Mike" "DONE")
2587 org-todo-interpretation 'type)
2588 @end lisp
2589
2590 In this case, different keywords do not indicate a sequence, but
2591 rather different types. So it is normally not useful to change from
2592 one type to another. Therefore, in this case the behavior of the
2593 command @kbd{C-c C-t} is changed slightly@footnote{This is also true
2594 for the @kbd{t} command in the timeline and agenda buffers.}. When
2595 used several times in succession, it will still cycle through all
2596 names. But when you return to the item after some time and execute
2597 @kbd{C-c C-t} again, it will switch from each name directly to DONE.
2598 Use prefix arguments or completion to quickly select a specific name.
2599 You can also review the items of a specific TODO type in a sparse tree
2600 by using a numeric prefix to @kbd{C-c C-v}. For example, to see all
2601 things Lucy has to do, you would use @kbd{C-3 C-c C-v}. To collect
2602 Lucy's items from all agenda files into a single buffer, you
2603 would use the prefix arg as well when creating the global todo list:
2604 @kbd{C-3 C-c t}.
2605
2606 @node Per file keywords, , TODO types, TODO extensions
2607 @subsection Setting up TODO keywords for individual files
2608 @cindex keyword options
2609 @cindex per file keywords
2610
2611 It can be very useful to use different aspects of the TODO mechanism
2612 in different files, which is not possible with the global settings
2613 described above. For file-local settings, you need to add special
2614 lines to the file which set the keywords and interpretation for that
2615 file only. For example, to set one of the two examples discussed
2616 above, you need one of the following lines, starting in column zero
2617 anywhere in the file:
2618
2619 @example
2620 #+SEQ_TODO: TODO FEEDBACK VERIFY DONE
2621 #+TYP_TODO: Fred Sara Lucy Mike DONE
2622 @end example
2623
2624 @cindex completion, of option keywords
2625 @kindex M-@key{TAB}
2626 @noindent To make sure you are using the correct keyword, type
2627 @samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
2628
2629 @cindex DONE, final TODO keyword
2630 Remember that the last keyword must always mean that the item is DONE
2631 (although you may use a different word). Also note that in each file,
2632 only one of the two aspects of TODO keywords can be used. After
2633 changing one of these lines, use @kbd{C-c C-c} with the cursor still
2634 in the line to make the changes known to Org-mode@footnote{Org-mode
2635 parses these lines only when Org-mode is activated after visiting a
2636 file. @kbd{C-c C-c} with the cursor in a line starting with @samp{#+}
2637 is simply restarting Org-mode for the current buffer.}.
2638
2639 If you want to use very many keywords, for example when working with a
2640 large group of people, you may split the names over several lines:
2641
2642 @example
2643 #+TYP_TODO: Fred Sara Lucy Mike
2644 #+TYP_TODO: Luis George Jules Jessica
2645 #+TYP_TODO: Kim Arnold Peter
2646 #+TYP_TODO: DONE
2647 @end example
2648
2649 @node Priorities, Breaking down tasks, TODO extensions, TODO items
2650 @section Priorities
2651 @cindex priorities
2652
2653 If you use Org-mode extensively to organize your work, you may end up
2654 with a number of TODO entries so large that you'd like to prioritize
2655 them. This can be done by placing a @emph{priority cookie} into the
2656 headline, like this
2657
2658 @example
2659 *** TODO [#A] Write letter to Sam Fortune
2660 @end example
2661
2662 @noindent
2663 With its standard setup, Org-mode supports priorities @samp{A},
2664 @samp{B}, and @samp{C}. @samp{A} is the highest priority. An entry
2665 without a cookie is treated as priority @samp{B}. Priorities make a
2666 difference only in the agenda (@pxref{Weekly/Daily agenda}).
2667
2668 @table @kbd
2669 @kindex @kbd{C-c ,}
2670 @item @kbd{C-c ,}
2671 Set the priority of the current headline. The command prompts for a
2672 priority character @samp{A}, @samp{B} or @samp{C}. When you press
2673 @key{SPC} instead, the priority cookie is removed from the headline.
2674 The priorities can also be changed ``remotely'' from the timeline and
2675 agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
2676
2677 @kindex S-@key{up}
2678 @kindex S-@key{down}
2679 @item S-@key{up}
2680 @itemx S-@key{down}
2681 Increase/decrease priority of current headline. Note that these keys
2682 are also used to modify time stamps (@pxref{Creating timestamps}).
2683 Furthermore, these keys are also used by CUA-mode (@pxref{Conflicts}).
2684 @end table
2685
2686 @node Breaking down tasks, Checkboxes, Priorities, TODO items
2687 @section Breaking tasks down into subtasks
2688 @cindex tasks, breaking down
2689
2690 It is often advisable to break down large tasks into smaller, managable
2691 subtasks. You can do this by creating an outline tree below a TODO
2692 item, with detailed subtasks on the tree@footnote{To keep subtasks out
2693 of the global TODO list, see the
2694 @code{org-agenda-todo-list-sublevels}.}. Another possibility is the use
2695 of checkboxes to identify (a hierarchy of) a large number of subtasks
2696 (@pxref{Checkboxes}).
2697
2698
2699 @node Checkboxes, , Breaking down tasks, TODO items
2700 @section Checkboxes
2701 @cindex checkboxes
2702
2703 Every item in a plain list (@pxref{Plain lists}) can be made a checkbox
2704 by starting it with the string @samp{[ ]}. This feature is similar to
2705 TODO items (@pxref{TODO items}), but more lightweight. Checkboxes are
2706 not included into the global TODO list, so they are often great to split
2707 a task into a number of simple steps. Or you can use them in a shopping
2708 list. To toggle a checkbox, use @kbd{C-c C-c}, or try Piotr Zielinski's
2709 @file{org-mouse.el}. Here is an example of a checkbox list.
2710
2711 @example
2712 * TODO Organize party [3/6]
2713 - call people [1/3]
2714 - [ ] Peter
2715 - [X] Sarah
2716 - [ ] Sam
2717 - [X] order food
2718 - [ ] think about what music to play
2719 - [X] talk to the neighbors
2720 @end example
2721
2722 @cindex statistics, for checkboxes
2723 @cindex checkbox statistics
2724 The @samp{[3/6]} and @samp{[1/3]} in the first and second line are
2725 cookies indicating how many checkboxes are present in this entry, and
2726 how many of them have been checked off. This can give you an idea on
2727 how many checkboxes remain, even without opening a folded entry. The
2728 cookies can be placed into a headline or into (the first line of) a
2729 plain list item. Each cookie covers all checkboxes structurally below
2730 that headline/item. You have to insert the cookie yourself by typing
2731 either @samp{[/]} or @samp{[%]}. In the first case you get an @samp{n
2732 out of m} result, in the second case you get information about the
2733 percentage of checkboxes checked (in the above example, this would be
2734 @samp{[50%]} and @samp{[33%], respectively}).
2735
2736 @noindent The following commands work with checkboxes:
2737
2738 @table @kbd
2739 @kindex C-c C-c
2740 @item C-c C-c
2741 Toggle checkbox at point.
2742 @kindex C-c C-x C-b
2743 @item C-c C-x C-b
2744 Toggle checkbox at point.
2745 @itemize @minus
2746 @item
2747 If there is an active region, toggle the first checkbox in the region
2748 and set all remaining boxes to the same status as the first. If you
2749 want to toggle all boxes in the region independently, use a prefix
2750 argument.
2751 @item
2752 If the cursor is in a headline, toggle checkboxes in the region between
2753 this headline and the next (so @emph{not} the entire subtree).
2754 @item
2755 If there is no active region, just toggle the checkbox at point.
2756 @end itemize
2757 @kindex M-S-@key{RET}
2758 @item M-S-@key{RET}
2759 Insert a new item with a checkbox.
2760 This works only if the cursor is already in a plain list item
2761 (@pxref{Plain lists}).
2762 @kindex C-c #
2763 @item C-c #
2764 Update the checkbox statistics in the current outline entry. When
2765 called with a @kbd{C-u} prefix, update the entire file. Checkbox
2766 statistic cookies are updated automatically if you toggle checkboxes
2767 with @kbd{C-c C-c} and make new ones with @kbd{M-S-@key{RET}}. If you
2768 delete boxes or add/change them by hand, use this command to get things
2769 back into synch. Or simply toggle any checkbox twice with @kbd{C-c C-c}.
2770 @end table
2771
2772 @node Timestamps, Tags, TODO items, Top
2773 @chapter Timestamps
2774 @cindex time stamps
2775 @cindex date stamps
2776
2777 Items can be labeled with timestamps to make them useful for project
2778 planning.
2779
2780 @menu
2781 * Time stamps:: Assigning a time to a tree entry
2782 * Creating timestamps:: Commands which insert timestamps
2783 * Custom time format:: If you cannot work with the ISO format
2784 * Repeating items:: Deadlines that come back again and again
2785 * Progress logging:: Documenting when what work was done.
2786 @end menu
2787
2788
2789 @node Time stamps, Creating timestamps, Timestamps, Timestamps
2790 @section Time stamps, deadlines and scheduling
2791 @cindex time stamps
2792 @cindex ranges, time
2793 @cindex date stamps
2794 @cindex deadlines
2795 @cindex scheduling
2796
2797 A time stamp is a specification of a date (possibly with time) in a
2798 special format, either @samp{<2003-09-16 Tue>} or @samp{<2003-09-16 Tue
2799 09:39>}@footnote{This is the standard ISO date/time format. If you
2800 cannot get used to these, see @ref{Custom time format}}. A time stamp
2801 can appear anywhere in the headline or body of an org-tree entry. Its
2802 presence allows entries to be shown on specific dates in the agenda
2803 (@pxref{Weekly/Daily agenda}). We distinguish:
2804
2805 @table @var
2806 @item Plain time stamp
2807 @cindex timestamp
2808 A simple time stamp just assigns a date/time to an item. This is just
2809 like writing down an appointment in a paper agenda, or like writing down
2810 an event in a diary, when you want to take note of when something
2811 happened. In the timeline and agenda displays, the headline of an entry
2812 associated with a plain time stamp will be shown exactly on that date.
2813
2814 @example
2815 * Meet Peter at the movies <2006-11-01 Wed 19:15>
2816 @end example
2817
2818 @item Inactive time stamp
2819 @cindex timestamp, inactive
2820 @cindex inactive timestamp
2821 Just like a plain time stamp, but with square brackets instead of
2822 angular ones. These time stamps are inactive in the sense that they do
2823 @emph{not} trigger an entry to show up in the agenda.
2824
2825 @example
2826 * Gillian comes late for the fifth time [2006-11-01 Wed]
2827 @end example
2828
2829 @item Time stamp range
2830 @cindex timerange
2831 Two time stamps connected by @samp{--} denote a time range. The
2832 headline will be shown on the first and last day of the range, and on
2833 any dates that are displayed and fall in the range. Here is an
2834 example:
2835
2836 @example
2837 ** Meeting in Amsterdam
2838 <2004-08-23 Mon>--<2004-08-26 Thu>
2839 @end example
2840
2841 @item Time stamp with SCHEDULED keyword
2842 @cindex SCHEDULED keyword
2843 If a time stamp is preceded by the word @samp{SCHEDULED:}, it means you
2844 are planning to start working on that task on the given date. So this is
2845 not about recording an event, but about planning your work. The
2846 headline will be listed under the given date@footnote{It will still be
2847 listed on that date after it has been marked DONE. If you don't like
2848 this, set the variable @code{org-agenda-skip-scheduled-if-done}.}. In
2849 addition, a reminder that the scheduled date has passed will be present
2850 in the compilation for @emph{today}, until the entry is marked DONE.
2851 I.e., the task will automatically be forwarded until completed.
2852
2853 @example
2854 *** TODO Call Trillian for a date on New Years Eve.
2855 SCHEDULED: <2004-12-25 Sat>
2856 @end example
2857
2858 @item Time stamp with DEADLINE keyword
2859 @cindex DEADLINE keyword
2860 If a time stamp is preceded by the word @samp{DEADLINE:}, the task
2861 (most likely a TODO item) is supposed to be finished on that date, and
2862 it will be listed then. In addition, the compilation for @emph{today}
2863 will carry a warning about the approaching or missed deadline,
2864 starting @code{org-deadline-warning-days} before the due date, and
2865 continuing until the entry is marked DONE. An example:
2866
2867 @example
2868 *** TODO write article about the Earth for the Guide
2869 The editor in charge is [[bbdb:Ford Prefect]]
2870 DEADLINE: <2004-02-29 Sun>
2871 @end example
2872 @item Time stamp with CLOSED keyword
2873 @cindex CLOSED keyword
2874 When @code{org-log-done} is non-nil, Org-mode will automatically insert
2875 a special time stamp each time a TODO entry is marked done
2876 (@pxref{Progress logging}). This time stamp is enclosed in square
2877 brackets instead of angular brackets.
2878
2879 @item Time range with CLOCK keyword
2880 @cindex CLOCK keyword
2881 When using the clock to time the work that is being done on specific
2882 items, time ranges preceded by the CLOCK keyword are inserted
2883 automatically into the file. The time stamps are enclosed in square
2884 brackets instead of angular brackets. @xref{Clocking work time}.
2885 @end table
2886
2887 @node Creating timestamps, Custom time format, Time stamps, Timestamps
2888 @section Creating timestamps
2889 @cindex creating timestamps
2890 @cindex timestamps, creating
2891
2892 For Org-mode to recognize time stamps, they need to be in the specific
2893 format. All commands listed below produce time stamps in the correct
2894 format.
2895
2896 @table @kbd
2897 @kindex C-c .
2898 @item C-c .
2899 Prompt for a date and insert a corresponding time stamp. When the
2900 cursor is at a previously used time stamp, it is updated to NOW. When
2901 this command is used twice in succession, a time range is inserted.
2902
2903 @kindex C-u C-c .
2904 @item C-u C-c .
2905 Like @kbd{C-c .}, but use the alternative format which contains date
2906 and time. The default time can be rounded to multiples of 5 minutes,
2907 see the option @code{org-time-stamp-rounding-minutes}.
2908
2909 @kindex C-c !
2910 @item C-c !
2911 Like @kbd{C-c .}, but insert an inactive time stamp not triggering the
2912 agenda.
2913
2914 @kindex C-c <
2915 @item C-c <
2916 Insert a time stamp corresponding to the cursor date in the Calendar.
2917
2918 @kindex C-c >
2919 @item C-c >
2920 Access the Emacs calendar for the current date. If there is a
2921 timestamp in the current line, goto the corresponding date
2922 instead.
2923
2924 @kindex C-c C-o
2925 @item C-c C-o
2926 Access the agenda for the date given by the time stamp or -range at
2927 point (@pxref{Weekly/Daily agenda}).
2928
2929 @kindex C-c C-d
2930 @item C-c C-d
2931 Insert @samp{DEADLINE} keyword along with a stamp. The insertion will
2932 happen in the line directly following the headline.
2933 @c FIXME Any CLOSED timestamp will be removed.????????
2934
2935 @kindex C-c C-w
2936 @cindex sparse tree, for deadlines
2937 @item C-c C-w
2938 Create a sparse tree with all deadlines that are either past-due, or
2939 which will become due within @code{org-deadline-warning-days}.
2940 With @kbd{C-u} prefix, show all deadlines in the file. With a numeric
2941 prefix, check that many days. For example, @kbd{C-1 C-c C-w} shows
2942 all deadlines due tomorrow.
2943
2944 @kindex C-c C-s
2945 @item C-c C-s
2946 Insert @samp{SCHEDULED} keyword along with a stamp. The insertion will
2947 happen in the line directly following the headline. Any CLOSED
2948 timestamp will be removed.
2949
2950 @kindex S-@key{left}
2951 @kindex S-@key{right}
2952 @item S-@key{left}
2953 @itemx S-@key{right}
2954 Change date at cursor by one day. These key bindings conflict with
2955 CUA-mode (@pxref{Conflicts}).
2956
2957 @kindex S-@key{up}
2958 @kindex S-@key{down}
2959 @item S-@key{up}
2960 @itemx S-@key{down}
2961 Change the item under the cursor in a timestamp. The cursor can be on a
2962 year, month, day, hour or minute. Note that if the cursor is in a
2963 headline and not at a time stamp, these same keys modify the priority of
2964 an item. (@pxref{Priorities}). The key bindings also conflict with
2965 CUA-mode (@pxref{Conflicts}).
2966
2967
2968 @kindex C-c C-y
2969 @cindex evaluate time range
2970 @item C-c C-y
2971 Evaluate a time range by computing the difference between start and
2972 end. With prefix arg, insert result after the time range (in a table:
2973 into the following column).
2974 @end table
2975
2976
2977 @menu
2978 * The date/time prompt:: How org-mode helps you entering date and time
2979 @end menu
2980
2981 @node The date/time prompt, , Creating timestamps, Creating timestamps
2982 @subsection The date/time prompt
2983 @cindex date, reading in minibuffer
2984 @cindex time, reading in minibuffer
2985
2986 When Org-mode prompts for a date/time, the prompt suggests to enter an
2987 ISO date. But it will in fact accept any string containing some date
2988 and/or time information. You can, for example, use @kbd{C-y} to paste a
2989 (possibly multi-line) string copied from an email message. Org-mode
2990 will find whatever information is in there and will replace anything not
2991 specified with the current date and time. For example:
2992
2993 @example
2994 3-2-5 --> 2003-02-05
2995 feb 15 --> currentyear-02-15
2996 sep 12 9 --> 2009-09-12
2997 12:45 --> today 12:45
2998 22 sept 0:34 --> currentyear-09-22 0:34
2999 12 --> currentyear-currentmonth-12
3000 Fri --> nearest Friday (today or later)
3001 +4 --> 4 days from now (if +N is the only thing given)
3002 @end example
3003
3004 The function understands English month and weekday abbreviations. If
3005 you want to use unabbreviated names and/or other languages, configure
3006 the variables @code{parse-time-months} and @code{parse-time-weekdays}.
3007
3008 @cindex calendar, for selecting date
3009 Parallel to the minibuffer prompt, a calendar is popped up@footnote{If
3010 you don't need/want the calendar, configure the variable
3011 @code{org-popup-calendar-for-date-prompt}.}. When you exit the date
3012 prompt, either by clicking on a date in the calendar, or by pressing
3013 @key{RET}, the date selected in the calendar will be combined with the
3014 information entered at the prompt. You can control the calendar fully
3015 from the minibuffer:
3016
3017 @table @kbd
3018 @kindex <
3019 @item <
3020 Scroll calendar backwards by one month.
3021 @kindex >
3022 @item >
3023 Scroll calendar forwards by one month.
3024 @kindex mouse-1
3025 @item mouse-1
3026 Select date by clicking on it.
3027 @kindex S-@key{right}
3028 @item S-@key{right}
3029 One day forward.
3030 @kindex S-@key{left}
3031 @item S-@key{left}
3032 One day back.
3033 @kindex S-@key{down}
3034 @item S-@key{down}
3035 One week forward.
3036 @kindex S-@key{up}
3037 @item S-@key{up}
3038 One week back.
3039 @kindex M-S-@key{right}
3040 @item M-S-@key{right}
3041 One month forward.
3042 @kindex M-S-@key{left}
3043 @item M-S-@key{left}
3044 One month back.
3045 @kindex @key{RET}
3046 @item @key{RET}
3047 Choose date in calendar (only if nothing was typed into minibuffer).
3048 @end table
3049
3050 @node Custom time format, Repeating items, Creating timestamps, Timestamps
3051 @section Custom time format
3052 @cindex custom date/time format
3053 @cindex time format, custom
3054 @cindex date format, custom
3055
3056 Org-mode uses the standard ISO notation for dates and times as it is
3057 defined in ISO 8601. If you cannot get used to this and require another
3058 representation of date and time to keep you happy, you can get it by
3059 customizing the variables @code{org-display-custom-times} and
3060 @code{org-time-stamp-custom-formats}.
3061
3062 @table @kbd
3063 @kindex C-c C-x C-t
3064 @item C-c C-x C-t
3065 Toggle the display of custom formats for dates and times.
3066 @end table
3067
3068 @noindent
3069 Org-mode needs the default format for scanning, so the custom date/time
3070 format does not @emph{replace} the default format - instead it is put
3071 @emph{over} the default format using text properties. This has the
3072 following consequences:
3073 @itemize @bullet
3074 @item
3075 You cannot place the cursor onto a time stamp anymore, only before or
3076 after.
3077 @item
3078 The @kbd{S-@key{up}/@key{down}} keys can no longer be used to adjust
3079 each component of a time stamp. If the cursor is at the beginning of
3080 the stamp, @kbd{S-@key{up}/@key{down}} will change the stamp by one day,
3081 just like @kbd{S-@key{left}/@key{right}}. At the end of the stamp, the
3082 time will be changed by one minute.
3083 @item
3084 When you delete a time stamp character-by-character, it will only
3085 disappear from the buffer after @emph{all} (invisible) characters
3086 belonging to the ISO timestamp have been removed.
3087 @item
3088 If the custom time stamp format is longer than the default and you are
3089 using dates in tables, table alignment will be messed up. If the custom
3090 format is shorter, things do work as expected.
3091 @end itemize
3092
3093 @node Repeating items, Progress logging, Custom time format, Timestamps
3094 @section Repeating items
3095 @cindex TODO items, repeating
3096 @cindex deadlines, repeating
3097 @cindex scheduling, repeating
3098
3099 Org-mode integrates with the Emacs calendar and diary to display cyclic
3100 appointments, anniversaries and other special entries in the agenda
3101 (@pxref{Weekly/Daily agenda}). However, it can be useful to have
3102 certain deadlines and scheduling items to auto-repeat. The advantage of
3103 a deadline or scheduled item is that the they produce warnings ahead of
3104 time and automatically forward themselves in the agenda until they are
3105 done. The abstract difference is therefore between cyclic
3106 @i{appointments} and cyclic @i{action items}. For appointments you
3107 should use the diary, for actions you can uses an org-mode deadline or
3108 scheduling time stamp together with a REPEAT cookie. For example:
3109
3110 @example
3111 * TODO Replace batteries in smoke detector REPEAT(+18m)
3112 SCHEDULED: <2007-01-01 Mon>
3113
3114 * TODO Get dentist appointment REPEAT(+6m)
3115 SCHEDULED: <2006-12-19 Tue>
3116
3117 * TODO Tax report to IRS REPEAT(+1y)
3118 DEADLINE: <2007-04-01 Sun>
3119 @end example
3120
3121 Each time you try to mark one of these entries DONE using @kbd{C-c C-t},
3122 they will automatically switch back to the state TODO, and the
3123 deadline/scheduling will be shifted accordingly. The time units
3124 recognized by org-mode are year (y), month (m), week (w), and day (d).
3125 Org-mode will also prompt you for a note and record the fact that you
3126 have closed this item in a note under the headline.
3127
3128 One unusual property of these repeating items is that only one instance
3129 of each exist at any given time. So if you look back or ahead in the
3130 agenda, you will not find past and future instances, only the current
3131 one will show up. Use a cyclic diary entry if you need all past and
3132 future instances to be visible in the agenda.
3133
3134 @node Progress logging, , Repeating items, Timestamps
3135 @section Progress Logging
3136 @cindex progress logging
3137 @cindex logging, of progress
3138
3139 Org-mode can automatically record a time stamp when you mark a TODO item
3140 as DONE, or even each time when you change the state of a TODO item.
3141 You can also measure precisely the time you spent on specific items in a
3142 project by starting and stopping a clock when you start and stop working
3143 on an aspect of a project.
3144
3145 @menu
3146 * Closing items:: When was this entry marked DONE?
3147 * Tracking TODO state changes:: When did the status change?
3148 * Clocking work time:: When exactly did you work on this item?
3149 @end menu
3150
3151 @node Closing items, Tracking TODO state changes, Progress logging, Progress logging
3152 @subsection Closing items
3153
3154 If you want to keep track of @emph{when} a certain TODO item was
3155 finished, turn on logging with@footnote{The corresponding in-buffer
3156 setting is: @code{#+STARTUP: logdone}}
3157
3158 @lisp
3159 (setq org-log-done t)
3160 @end lisp
3161
3162 @noindent
3163 Then each time you turn a TODO entry into DONE using either @kbd{C-c
3164 C-t} in the Org-mode buffer or @kbd{t} in the agenda buffer, a line
3165 @samp{CLOSED: [timestamp]} will be inserted just after the headline. If
3166 you turn the entry back into a TODO item through further state cycling,
3167 that line will be removed again. In the timeline (@pxref{Timeline}) and
3168 in the agenda (@pxref{Weekly/Daily agenda}), you can then use the
3169 @kbd{l} key to display the TODO items closed on each day, giving you an
3170 overview of what has been done on a day. If you want to record a note
3171 along with the timestamp, use@footnote{The corresponding in-buffer
3172 setting is: @code{#+STARTUP: lognotedone}}
3173
3174 @lisp
3175 (setq org-log-done '(done))
3176 @end lisp
3177
3178 @node Tracking TODO state changes, Clocking work time, Closing items, Progress logging
3179 @subsection Tracking TODO state changes
3180
3181 When TODO keywords are used as workflow states (@pxref{Workflow
3182 states}), you might want to keep track of when a state change occurred,
3183 and you may even want to attach notes to that state change. With the
3184 setting
3185
3186 @lisp
3187 (setq org-log-done '(state))
3188 @end lisp
3189
3190 @noindent
3191 each state change will prompt you for a note that will be attached to
3192 the current headline. Very likely you do not want this verbose tracking
3193 all the time, so it is probably better to configure this behavior with
3194 in-buffer options. For example, if you are tracking purchases, put
3195 these into a separate file that starts with:
3196
3197 @example
3198 #+SEQ_TODO: TODO ORDERED INVOICE PAYED RECEIVED SENT
3199 #+STARTUP: lognotestate
3200 @end example
3201
3202 @node Clocking work time, , Tracking TODO state changes, Progress logging
3203 @subsection Clocking work time
3204
3205 Org-mode allows you to clock the time you spent on specific tasks in a
3206 project. When you start working on an item, you can start the clock.
3207 When you stop working on that task, or when you mark the task done, the
3208 clock is stopped and the corresponding time interval is recorded. It
3209 also computes the total time spent on each subtree of a project.
3210
3211 @table @kbd
3212 @kindex C-c C-x C-i
3213 @item C-c C-x C-i
3214 Start the clock on the current item (clock-in). This inserts the CLOCK
3215 keyword together with a timestamp.
3216 @kindex C-c C-x C-o
3217 @item C-c C-x C-o
3218 Stop the clock (clock-out). The inserts another timestamp at the same
3219 location where the clock was last started. It also directly computes
3220 the resulting time in inserts it after the time range as @samp{=>
3221 HH:MM}. See the variable @code{org-log-done} for the possibility to
3222 record an additional note together with the clock-out time
3223 stamp@footnote{The corresponding in-buffer setting is: @code{#+STARTUP:
3224 lognoteclock-out}}.
3225 @kindex C-c C-y
3226 @item C-c C-y
3227 Recompute the time interval after changing one of the time stamps. This
3228 is only necessary if you edit the time stamps directly. If you change
3229 them with @kbd{S-@key{cursor}} keys, the update is automatic.
3230 @kindex C-c C-t
3231 @item C-c C-t
3232 Changing the TODO state of an item to DONE automatically stops the clock
3233 if it is running in this same item.
3234 @kindex C-c C-x C-x
3235 @item C-c C-x C-x
3236 Cancel the current clock. This is useful if a clock was started by
3237 mistake, or if you ended up working on something else.
3238 @kindex C-c C-x C-d
3239 @item C-c C-x C-d
3240 Display time summaries for each subtree in the current buffer. This
3241 puts overlays at the end of each headline, showing the total time
3242 recorded under that heading, including the time of any subheadings. You
3243 can use visibility cycling to study the tree, but the overlays disappear
3244 when you change the buffer (see variable
3245 @code{org-remove-highlights-with-change}) or press @kbd{C-c C-c}.
3246 @kindex C-c C-x C-r
3247 @item C-c C-x C-r
3248 Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock
3249 report as an org-mode table into the current file.
3250 @example
3251 #+BEGIN: clocktable :maxlevel 2 :emphasize nil
3252
3253 #+END: clocktable
3254 @end example
3255 @noindent
3256 If such a block already exists, its content is replaced by the new
3257 table. The @samp{BEGIN} line can specify options:
3258 @example
3259 :maxlevels @r{Maximum level depth to which times are listed in the table.}
3260 :emphasize @r{When @code{t}, emphasize level one and level two items}
3261 :block @r{The time block to consider. This block is specified relative}
3262 @r{to the current time and may be any of these keywords:}
3263 @r{@code{today}, @code{yesterday}, @code{thisweek}, @code{lastweek},}
3264 @r{@code{thismonth}, @code{lastmonth}, @code{thisyear}, or @code{lastyear}}.
3265 :tstart @r{A time string specifying when to start considering times}
3266 :tend @r{A time string specifying when to stop considering times}
3267 @end example
3268 So to get a clock summary for the current day, you could write
3269 @example
3270 #+BEGIN: clocktable :maxlevel 2 :block today
3271
3272 #+END: clocktable
3273 @end example
3274 and to use a specific time range you could write@footnote{Note that all
3275 parameters must be specified in a single line - the line is broken here
3276 only to fit it onto the manual.}
3277 @example
3278 #+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>"
3279 :tend "<2006-08-10 Thu 12:00>"
3280
3281 #+END: clocktable
3282 @end example
3283 @kindex C-u C-c C-x C-u
3284 @item C-u C-c C-x C-u
3285 Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
3286 you have several clocktable blocks in a buffer.
3287 @end table
3288
3289 The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
3290 the agenda (@pxref{Weekly/Daily agenda}) to show which tasks have been
3291 worked on or closed during a day.
3292
3293 @node Tags, Agenda views, Timestamps, Top
3294 @chapter Tags
3295 @cindex tags
3296 @cindex headline tagging
3297 @cindex matching, tags
3298 @cindex sparse tree, tag based
3299
3300 If you wish to implement a system of labels and contexts for
3301 cross-correlating information, an excellent way is to assign @i{tags} to
3302 headlines. Org-mode has extensive support for using tags.
3303
3304 Every headline can contain a list of tags, at the end of the headline.
3305 Tags are normal words containing letters, numbers, @samp{_}, and
3306 @samp{@@}. Tags must be preceded and followed by a single colon; like
3307 @samp{:WORK:}. Several tags can be specified like @samp{:WORK:URGENT:}.
3308
3309 @menu
3310 * Tag inheritance:: Tags use the tree structure of the outline
3311 * Setting tags:: How to assign tags to a headline
3312 * Tag searches:: Searching for combinations of tags
3313 @end menu
3314
3315 @node Tag inheritance, Setting tags, Tags, Tags
3316 @section Tag inheritance
3317 @cindex inheritance, of tags
3318 @cindex sublevels, inclusion into tags match
3319
3320 @i{Tags} make use of the hierarchical structure of outline trees. If a
3321 heading has a certain tag, all subheadings will inherit the tag as
3322 well. For example, in the list
3323
3324 @example
3325 * Meeting with the French group :WORK:
3326 ** Summary by Frank :BOSS:NOTES:
3327 *** TODO Prepare slides for him :ACTION:
3328 @end example
3329
3330 @noindent
3331 the final heading will have the tags @samp{:WORK:}, @samp{:BOSS:},
3332 @samp{:NOTES:}, and @samp{:ACTION:}. When executing tag searches and
3333 Org-mode finds that a certain headline matches the search criterion, it
3334 will not check any sublevel headline, assuming that these likely also
3335 match, and that the list of matches can become very long. This may
3336 not be what you want, however, and you can influence inheritance and
3337 searching using the variables @code{org-use-tag-inheritance} and
3338 @code{org-tags-match-list-sublevels}.
3339
3340 @node Setting tags, Tag searches, Tag inheritance, Tags
3341 @section Setting tags
3342 @cindex setting tags
3343 @cindex tags, setting
3344
3345 @kindex M-@key{TAB}
3346 Tags can simply be typed into the buffer at the end of a headline.
3347 After a colon, @kbd{M-@key{TAB}} offers completion on tags. There is
3348 also a special command for inserting tags:
3349
3350 @table @kbd
3351 @kindex C-c C-c
3352 @item C-c C-c
3353 @cindex completion, of tags
3354 Enter new tags for the current headline. Org-mode will either offer
3355 completion or a special single-key interface for setting tags, see
3356 below. After pressing @key{RET}, the tags will be inserted and aligned
3357 to @code{org-tags-column}. When called with a @kbd{C-u} prefix, all
3358 tags in the current buffer will be aligned to that column, just to make
3359 things look nice. TAGS are automatically realigned after promotion,
3360 demotion, and TODO state changes (@pxref{TODO basics}).
3361 @end table
3362
3363 Org will support tag insertion based on a @emph{list of tags}. By
3364 default this list is constructed dynamically, containing all tags
3365 currently used in the buffer. You may also globally specify a hard list
3366 of tags with the variable @code{org-tag-alist}. Finally you can set
3367 the default tags for a given file with lines like
3368
3369 @example
3370 #+TAGS: @@WORK @@HOME @@TENNISCLUB
3371 #+TAGS: Laptop Car PC Sailboat
3372 @end example
3373
3374 If you have globally defined your preferred set of tags using the
3375 variable @code{org-tag-alist}, but would like to use a dynamic tag list
3376 in a specific file: Just add an empty TAGS option line to that file:
3377
3378 @example
3379 #+TAGS:
3380 @end example
3381
3382 The default support method for entering tags is minibuffer completion.
3383 However, Org-mode also implements a much better method: @emph{fast tag
3384 selection}. This method allows to select and deselect tags with a
3385 single key per tag. To function efficiently, you should assign unique
3386 keys to most tags. This can be done globally with
3387
3388 @lisp
3389 (setq org-tag-alist '(("@@WORK" . ?w) ("@@HOME" . ?h) ("Laptop" . ?l)))
3390 @end lisp
3391
3392 @noindent or on a per-file basis with
3393
3394 @example
3395 #+TAGS: @@WORK(w) @@HOME(h) @@TENNISCLUB(t) Laptop(l) PC(p)
3396 @end example
3397
3398 @noindent
3399 You can also group together tags that are mutually exclusive. With
3400 curly braces@footnote{In @code{org-mode-alist} use
3401 @code{'(:startgroup)} and @code{'(:endgroup)}, respectively. Several
3402 groups are allowed.}
3403
3404 @example
3405 #+TAGS: @{ @@WORK(w) @@HOME(h) @@TENNISCLUB(t) @} Laptop(l) PC(p)
3406 @end example
3407
3408 @noindent you indicate that at most one of @samp{@@WORK}, @samp{@@HOME},
3409 and @samp{@@TENNISCLUB} should be selected.
3410
3411 @noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
3412 these lines to activate any changes.
3413
3414 If at least one tag has a selection key, pressing @kbd{C-c C-c} will
3415 automatically present you with a special interface, listing inherited
3416 tags, the tags of the current headline, and a list of all legal tags
3417 with corresponding keys@footnote{Keys will automatically be assigned to
3418 tags which have no configured keys.}. In this interface, you can use
3419 the following keys:
3420
3421 @table @kbd
3422 @item a-z...
3423 Pressing keys assigned to tags will add or remove them from the list of
3424 tags in the current line. Selecting a tag in a group of mutually
3425 exclusive tags will turn off any other tags from that group.
3426 @kindex @key{TAB}
3427 @item @key{TAB}
3428 Enter a tag in the minibuffer, even if the tag is not in the predefined
3429 list. You will be able to complete on all tags present in the buffer.
3430 @kindex @key{SPC}
3431 @item @key{SPC}
3432 Clear all tags for this line.
3433 @kindex @key{RET}
3434 @item @key{RET}
3435 Accept the modified set.
3436 @item C-g
3437 Abort without installing changes.
3438 @item q
3439 If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}.
3440 @item !
3441 Turn off groups of mutually exclusive tags. Use this to (as an
3442 exception) assign several tags from such a group.
3443 @item C-c
3444 Toggle auto-exit after the next change (see below).
3445 If you are using expert mode, the first @kbd{C-c} will display the
3446 selection window.
3447 @end table
3448
3449 @noindent
3450 This method lets you assign tags to a headline with very few keys. With
3451 the above setup, you could clear the current tags and set @samp{@@HOME},
3452 @samp{Laptop} and @samp{PC} tags with just the following keys: @kbd{C-c
3453 C-c @key{SPC} h l p @key{RET}}. Switching from @samp{@@HOME} to
3454 @samp{@@WORK} would be done with @kbd{C-c C-c w @key{RET}} or
3455 alternatively with @kbd{C-c C-c C-c w}. Adding the non-predefined tag
3456 @samp{Sarah} could be done with @kbd{C-c C-c @key{TAB} S a r a h
3457 @key{RET} @key{RET}}.
3458
3459 If you find that most of the time, you need only a single keypress to
3460 modify your list of tags, set the variable
3461 @code{org-fast-tag-selection-single-key}. Then you no longer have to
3462 press @key{RET} to exit fast tag selection - it will immediately exit
3463 after the first change. If you then occasionally need more keys, press
3464 @kbd{C-c} to turn off auto-exit for the current tag selection process
3465 (in effect: start selection with @kbd{C-c C-c C-c} instead of @kbd{C-c
3466 C-c}). If you set the variable to the value @code{expert}, the special
3467 window is not even shown for single-key tag selection, it comes up only
3468 when you press an extra @kbd{C-c}.
3469
3470 @node Tag searches, , Setting tags, Tags
3471 @section Tag searches
3472 @cindex tag searches
3473 @cindex searching for tags
3474
3475 Once a tags system has been set up, it can be used to collect related
3476 information into special lists.
3477
3478 @table @kbd
3479 @kindex C-c \
3480 @item C-c \
3481 Create a sparse tree with all headlines matching a tags search. With a
3482 @kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
3483 @kindex C-c a m
3484 @item C-c a m
3485 Create a global list of tag matches from all agenda files.
3486 @xref{Matching headline tags}.
3487 @kindex C-c a M
3488 @item C-c a M
3489 Create a global list of tag matches from all agenda files, but check
3490 only TODO items and force checking subitems (see variable
3491 @code{org-tags-match-list-sublevels}).
3492 @end table
3493
3494 @cindex Boolean logic, for tag searches
3495 A @i{tags} search string can use Boolean operators @samp{&} for AND and
3496 @samp{|} for OR. @samp{&} binds more strongly than @samp{|}.
3497 Parenthesis are currently not implemented. A tag may also be preceded
3498 by @samp{-}, to select against it, and @samp{+} is syntactic sugar for
3499 positive selection. The AND operator @samp{&} is optional when @samp{+}
3500 or @samp{-} is present. Examples:
3501
3502 @table @samp
3503 @item +WORK-BOSS
3504 Select headlines tagged @samp{:WORK:}, but discard those also tagged
3505 @samp{:BOSS:}.
3506 @item WORK|LAPTOP
3507 Selects lines tagged @samp{:WORK:} or @samp{:LAPTOP:}.
3508 @item WORK|LAPTOP&NIGHT
3509 Like before, but require the @samp{:LAPTOP:} lines to be tagged also
3510 @samp{NIGHT}.
3511 @end table
3512
3513 @cindex TODO keyword matching, with tags search
3514 If you are using multi-state TODO keywords (@pxref{TODO extensions}), it
3515 can be useful to also match on the TODO keyword. This can be done by
3516 adding a condition after a slash to a tags match. The syntax is similar
3517 to the tag matches, but should be applied with consideration: For
3518 example, a positive selection on several TODO keywords can not
3519 meaningfully be combined with boolean AND. However, @emph{negative
3520 selection} combined with AND can be meaningful. To make sure that only
3521 lines are checked that actually have any TODO keyword, use @kbd{C-c a
3522 M}, or equivalently start the todo part after the slash with @samp{!}.
3523 Examples:
3524
3525 @table @samp
3526 @item WORK/WAITING
3527 Select @samp{:WORK:}-tagged TODO lines with the specific TODO
3528 keyword @samp{WAITING}.
3529 @item WORK/!-WAITING-NEXT
3530 Select @samp{:WORK:}-tagged TODO lines that are neither @samp{WAITING}
3531 nor @samp{NEXT}
3532 @item WORK/+WAITING|+NEXT
3533 Select @samp{:WORK:}-tagged TODO lines that are either @samp{WAITING} or
3534 @samp{NEXT}.
3535 @end table
3536
3537 @cindex regular expressions, with tags search
3538 Any element of the tag/todo match can be a regular expression - in this
3539 case it must be enclosed in curly braces. For example,
3540 @samp{WORK+@{^BOSS.*@}} matches headlines that contain the tag
3541 @samp{WORK} and any tag @i{starting} with @samp{BOSS}.
3542
3543 @cindex level, require for tags match
3544 You can also require a headline to be of a certain level, by writing
3545 instead of any TAG an expression like @samp{LEVEL=3}. For example, a
3546 search @samp{+LEVEL=3+BOSS/-DONE} lists all level three headlines that
3547 have the tag BOSS and are @emph{not} marked with the todo keyword DONE.
3548
3549 @node Agenda views, Embedded LaTeX, Tags, Top
3550 @chapter Agenda Views
3551 @cindex agenda views
3552
3553 Due to the way Org-mode works, TODO items, time-stamped items, and
3554 tagged headlines can be scattered throughout a file or even a number of
3555 files. To get an overview over open action items, or over events that
3556 are important for a particular date, this information must be collected,
3557 sorted and displayed in an organized way.
3558
3559 Org-mode can select items based on various criteria, and display them
3560 in a separate buffer. Six different view types are provided:
3561
3562 @itemize @bullet
3563 @item
3564 an @emph{agenda} that is like a calendar and shows information
3565 for specific dates,
3566 @item
3567 a @emph{TODO list} that covers all unfinished
3568 action items,
3569 @item
3570 a @emph{tags view}, showings headlines based on
3571 the tags associated with them,
3572 @item
3573 a @emph{timeline view} that shows all events in a single Org-mode file,
3574 in time-sorted view,
3575 @item
3576 a @emph{stuck projects view} showing projects that currently don't move
3577 along, and
3578 @item
3579 @emph{custom views} that are special tag/keyword searches and
3580 combinations of different views.
3581 @end itemize
3582
3583 @noindent
3584 The extracted information is displayed in a special @emph{agenda
3585 buffer}. This buffer is read-only, but provides commands to visit the
3586 corresponding locations in the original Org-mode files, and even to
3587 edit these files remotely.
3588
3589 Two variables control how the agenda buffer is displayed and whether the
3590 window configuration is restored when the agenda exits:
3591 @code{org-agenda-window-setup} and
3592 @code{org-agenda-restore-windows-after-quit}.
3593
3594 @menu
3595 * Agenda files:: Files being searched for agenda information
3596 * Agenda dispatcher:: Keyboard access to agenda views
3597 * Built-in agenda views:: What is available out of the box?
3598 * Presentation and sorting:: How agenda items are prepared for display
3599 * Agenda commands:: Remote editing of org trees
3600 * Custom agenda views:: Defining special searches and views
3601 @end menu
3602
3603 @node Agenda files, Agenda dispatcher, Agenda views, Agenda views
3604 @section Agenda files
3605 @cindex agenda files
3606 @cindex files for agenda
3607
3608 The information to be shown is collected from all @emph{agenda files},
3609 the files listed in the variable @code{org-agenda-files}@footnote{If the
3610 value of that variable is not a list, but a single file name, then the
3611 list of agenda files will be maintained in that external file.}. Thus even
3612 if you only work with a single Org-mode file, this file should be put
3613 into that list@footnote{When using the dispatcher, pressing @kbd{1}
3614 before selecting a command will actually limit the command to the
3615 current file, and ignore @code{org-agenda-files} until the next
3616 dispatcher command.}. You can customize @code{org-agenda-files}, but
3617 the easiest way to maintain it is through the following commands
3618
3619 @cindex files, adding to agenda list
3620 @table @kbd
3621 @kindex C-c [
3622 @item C-c [
3623 Add current file to the list of agenda files. The file is added to
3624 the front of the list. If it was already in the list, it is moved to
3625 the front. With prefix arg, file is added/moved to the end.
3626 @kindex C-c ]
3627 @item C-c ]
3628 Remove current file from the list of agenda files.
3629 @kindex C-,
3630 @kindex C-'
3631 @item C-,
3632 @itemx C-'
3633 Cycle through agenda file list, visiting one file after the other.
3634 @end table
3635
3636 @noindent
3637 The Org menu contains the current list of files and can be used
3638 to visit any of them.
3639
3640 @node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda views
3641 @section The agenda dispatcher
3642 @cindex agenda dispatcher
3643 @cindex dispatching agenda commands
3644 The views are created through a dispatcher that should be bound to a
3645 global key, for example @kbd{C-c a} (@pxref{Installation}). In the
3646 following we will assume that @kbd{C-c a} is indeed how the dispatcher
3647 is accessed and list keyboard access to commands accordingly. After
3648 pressing @kbd{C-c a}, an additional letter is required to execute a
3649 command. The dispatcher offers the following default commands:
3650 @table @kbd
3651 @item a
3652 Create the calendar-like agenda (@pxref{Weekly/Daily agenda}).
3653 @item t @r{/} T
3654 Create a list of all TODO items (@pxref{Global TODO list}).
3655 @item m @r{/} M
3656 Create a list of headlines matching a TAGS expression (@pxref{Matching
3657 headline tags}).
3658 @item L
3659 Create the timeline view for the current buffer (@pxref{Timeline}).
3660 @item # @r{/} !
3661 Create a list of stuck projects (@pxref{Stuck projects}).
3662 @item 1
3663 Restrict an agenda command to the current buffer. After pressing
3664 @kbd{1}, you still need to press the character selecting the command.
3665 @item 0
3666 If there is an active region, restrict the following agenda command to
3667 the region. Otherwise, restrict it to the current subtree. After
3668 pressing @kbd{0}, you still need to press the character selecting the
3669 command.
3670 @end table
3671
3672 You can also define custom commands that will be accessible through the
3673 dispatcher, just like the default commands. This includes the
3674 possibility to create extended agenda buffers that contain several
3675 blocks together, for example the weekly agenda, the global TODO list and
3676 a number of special tags matches. @xref{Custom agenda views}.
3677
3678 @node Built-in agenda views, Presentation and sorting, Agenda dispatcher, Agenda views
3679 @section The built-in agenda views
3680
3681 In this section we describe the built-in views.
3682
3683 @menu
3684 * Weekly/Daily agenda:: The calendar page with current tasks
3685 * Global TODO list:: All unfinished action items
3686 * Matching headline tags:: Structured information with fine-tuned search
3687 * Timeline:: Time-sorted view for single file
3688 * Stuck projects:: Find projects you need to review
3689 @end menu
3690
3691 @node Weekly/Daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views
3692 @subsection The weekly/daily agenda
3693 @cindex agenda
3694 @cindex weekly agenda
3695 @cindex daily agenda
3696
3697 The purpose of the weekly/daily @emph{agenda} is to act like a page of a
3698 paper agenda, showing all the tasks for the current week or day.
3699
3700 @table @kbd
3701 @cindex org-agenda, command
3702 @kindex C-c a a
3703 @item C-c a a
3704 Compile an agenda for the current week from a list of org files. The
3705 agenda shows the entries for each day. With a @kbd{C-u} prefix (or
3706 when the variable @code{org-agenda-include-all-todo} is @code{t}), all
3707 unfinished TODO items (including those without a date) are also listed at
3708 the beginning of the buffer, before the first date.@*
3709 @end table
3710
3711 Remote editing from the agenda buffer means, for example, that you can
3712 change the dates of deadlines and appointments from the agenda buffer.
3713 The commands available in the Agenda buffer are listed in @ref{Agenda
3714 commands}.
3715
3716 @subsubheading Calendar/Diary integration
3717 @cindex calendar integration
3718 @cindex diary integration
3719
3720 Emacs contains the calendar and diary by Edward M. Reingold. The
3721 calendar displays a three-month calendar with holidays from different
3722 countries and cultures. The diary allows you to keep track of
3723 anniversaries, lunar phases, sunrise/set, recurrent appointments
3724 (weekly, monthly) and more. In this way, it is quite complementary to
3725 Org-mode. It can be very useful to combine output from Org-mode with
3726 the diary.
3727
3728 In order to include entries from the Emacs diary into Org-mode's
3729 agenda, you only need to customize the variable
3730
3731 @lisp
3732 (setq org-agenda-include-diary t)
3733 @end lisp
3734
3735 @noindent After that, everything will happen automatically. All diary
3736 entries including holidays, anniversaries etc will be included in the
3737 agenda buffer created by Org-mode. @key{SPC}, @key{TAB}, and
3738 @key{RET} can be used from the agenda buffer to jump to the diary
3739 file in order to edit existing diary entries. The @kbd{i} command to
3740 insert new entries for the current date works in the agenda buffer, as
3741 well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display
3742 Sunrise/Sunset times, show lunar phases and to convert to other
3743 calendars, respectively. @kbd{c} can be used to switch back and forth
3744 between calendar and agenda.
3745
3746
3747 @node Global TODO list, Matching headline tags, Weekly/Daily agenda, Built-in agenda views
3748 @subsection The global TODO list
3749 @cindex global TODO list
3750 @cindex TODO list, global
3751
3752 The global TODO list contains all unfinished TODO items, formatted and
3753 collected into a single place.
3754
3755 @table @kbd
3756 @kindex C-c a t
3757 @item C-c a t
3758 Show the global TODO list. This collects the TODO items from all
3759 agenda files (@pxref{Agenda views}) into a single buffer. The buffer is in
3760 @code{agenda-mode}, so there are commands to examine and manipulate
3761 the TODO entries directly from that buffer (@pxref{Agenda commands}).
3762 @kindex C-c a T
3763 @item C-c a T
3764 @cindex TODO keyword matching
3765 Like the above, but allows selection of a specific TODO keyword. You can
3766 also do this by specifying a prefix argument to @kbd{C-c a t}. With a
3767 @kbd{C-u} prefix you are prompted for a keyword. With a numeric
3768 prefix, the Nth keyword in @code{org-todo-keywords} is selected.
3769 @kindex r
3770 The @kbd{r} key in the agenda buffer regenerates it, and you can give
3771 a prefix argument to this command to change the selected TODO keyword,
3772 for example @kbd{3 r}. If you often need a search for a specific
3773 keyword, define a custom command for it (@pxref{Agenda dispatcher}).@*
3774 Matching specific TODO keywords can also be done as part of a tags
3775 search (@pxref{Tag searches}).
3776 @end table
3777
3778 Remote editing of TODO items means that you can change the state of a
3779 TODO entry with a single key press. The commands available in the
3780 TODO list are described in @ref{Agenda commands}.
3781
3782 @cindex sublevels, inclusion into todo list
3783 Normally the global todo list simply shows all headlines with TODO
3784 keywords. This list can become very long. There are two ways to keep
3785 it more compact:
3786 @itemize @minus
3787 @item
3788 Some people view a TODO item that has been @emph{scheduled} for
3789 execution (@pxref{Time stamps}) as no longer @emph{open}. Configure the
3790 variable @code{org-agenda-todo-ignore-scheduled} to exclude scheduled
3791 items from the global TODO list.
3792 @item
3793 TODO items may have sublevels to break up the task into subtasks. In
3794 such cases it may be enough to list only the highest level TODO headline
3795 and omit the sublevels from the global list. Configure the variable
3796 @code{org-agenda-todo-list-sublevels} to get this behavior.
3797 @end itemize
3798
3799 @node Matching headline tags, Timeline, Global TODO list, Built-in agenda views
3800 @subsection Matching headline tags
3801 @cindex matching, of tags
3802 @cindex tags view
3803
3804 If headlines in the agenda files are marked with @emph{tags}
3805 (@pxref{Tags}), you can select headlines based on the tags that apply
3806 to them and collect them into an agenda buffer.
3807
3808 @table @kbd
3809 @kindex C-c a m
3810 @item C-c a m
3811 Produce a list of all headlines that match a given set of tags. The
3812 command prompts for a selection criterion, which is a boolean logic
3813 expression with tags, like @samp{+WORK+URGENT-WITHBOSS} or
3814 @samp{WORK|HOME} (@pxref{Tags}). If you often need a specific search,
3815 define a custom command for it (@pxref{Agenda dispatcher}).
3816 @kindex C-c a M
3817 @item C-c a M
3818 Like @kbd{C-c a m}, but only select headlines that are also TODO items
3819 and force checking subitems (see variable
3820 @code{org-tags-match-list-sublevels}). Matching specific todo keywords
3821 together with a tags match is also possible, see @ref{Tag searches}.
3822 @end table
3823
3824 The commands available in the tags list are described in @ref{Agenda
3825 commands}.
3826
3827 @node Timeline, Stuck projects, Matching headline tags, Built-in agenda views
3828 @subsection Timeline for a single file
3829 @cindex timeline, single file
3830 @cindex time-sorted view
3831
3832 The timeline summarizes all time-stamped items from a single Org-mode
3833 file in a @emph{time-sorted view}. The main purpose of this command is
3834 to give an overview over events in a project.
3835
3836 @table @kbd
3837 @kindex C-a a L
3838 @item C-c a L
3839 Show a time-sorted view of the org file, with all time-stamped items.
3840 When called with a @kbd{C-u} prefix, all unfinished TODO entries
3841 (scheduled or not) are also listed under the current date.
3842 @end table
3843
3844 @noindent
3845 The commands available in the timeline buffer are listed in
3846 @ref{Agenda commands}.
3847
3848
3849 @node Stuck projects, , Timeline, Built-in agenda views
3850 @subsection Stuck projects
3851
3852 If you are following a system like David Allen's GTD to organize your
3853 work, one of the ``duties'' you have is a regular review to make sure
3854 that all projects move along. A @emph{stuck} project is a project that
3855 has no defined next actions, so it will never show up in the TODO lists
3856 Org-mode produces. During the review, you need to identify such
3857 projects and define next actions for them.
3858
3859 @table @kbd
3860 @kindex C-c a #
3861 @item C-c a #
3862 List projects that are stuck.
3863 @kindex C-c a !
3864 @item C-c a !
3865 Customize the variable @code{org-stuck-projects} to define what a stuck
3866 project is and how to find it.
3867 @end table
3868
3869 You almost certainly will have to configure this view before it will
3870 work for you. The built-in default assumes that all your projects are
3871 level-2 headlines, and that a project is not stuck if it has at least
3872 one entry marked with a todo keyword TODO or NEXT or NEXTACTION.
3873
3874 Lets assume that you, in your own way of using Org-mode, identify
3875 projects with a tag PROJECT, and that you use a todo keyword MAYBE to
3876 indicate a project that should not be considered yet. Lets further
3877 assume that the todo keyword DONE marks finished projects, and that NEXT
3878 and TODO indicate next actions. Finally, the tag @@SHOP indicates
3879 shopping and is a next action even without the NEXT tag. In this case
3880 you would start by identifying eligible projects with a tags/todo match
3881 @samp{+PROJECT/-MAYBE-DONE}, and then check for TODO, NEXT and @@SHOP in
3882 the subtree to identify projects that are not stuck. The correct
3883 customization for this is
3884
3885 @lisp
3886 (setq org-stuck-projects
3887 ("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@@SHOP")))
3888 @end lisp
3889
3890
3891 @node Presentation and sorting, Agenda commands, Built-in agenda views, Agenda views
3892 @section Presentation and sorting
3893 @cindex presentation, of agenda items
3894
3895 Before displaying items in an agenda view, Org-mode visually prepares
3896 the items and sorts them. Each item occupies a single line. The line
3897 starts with a @emph{prefix} that contains the @emph{category}
3898 (@pxref{Categories}) of the item and other important information. You can
3899 customize the prefix using the option @code{org-agenda-prefix-format}.
3900 The prefix is followed by a cleaned-up version of the outline headline
3901 associated with the item.
3902
3903 @menu
3904 * Categories:: Not all tasks are equal
3905 * Time-of-day specifications:: How the agenda knows the time
3906 * Sorting of agenda items:: The order of things
3907 @end menu
3908
3909 @node Categories, Time-of-day specifications, Presentation and sorting, Presentation and sorting
3910 @subsection Categories
3911
3912 @cindex category
3913 The category is a broad label assigned to each agenda item. By default,
3914 the category is simply derived from the file name, but you can also
3915 specify it with a special line in the buffer, like this:
3916
3917 @example
3918 #+CATEGORY: Thesis
3919 @end example
3920
3921 If there are several such lines in a file, each specifies the category
3922 for the text below it (but the first category also applies to any text
3923 before the first CATEGORY line). The display in the agenda buffer looks
3924 best if the category is not longer than 10 characters.
3925
3926 @node Time-of-day specifications, Sorting of agenda items, Categories, Presentation and sorting
3927 @subsection Time-of-Day Specifications
3928 @cindex time-of-day specification
3929
3930 Org-mode checks each agenda item for a time-of-day specification. The
3931 time can be part of the time stamp that triggered inclusion into the
3932 agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}. Time
3933 ranges can be specified with two time stamps, like
3934 @c
3935 @w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
3936
3937 In the headline of the entry itself, a time(range) may also appear as
3938 plain text (like @samp{12:45} or a @samp{8:30-1pm}. If the agenda
3939 integrates the Emacs diary (@pxref{Weekly/Daily agenda}), time
3940 specifications in diary entries are recognized as well.
3941
3942 For agenda display, Org-mode extracts the time and displays it in a
3943 standard 24 hour format as part of the prefix. The example times in
3944 the previous paragraphs would end up in the agenda like this:
3945
3946 @example
3947 8:30-13:00 Arthur Dent lies in front of the bulldozer
3948 12:45...... Ford Prefect arrives and takes Arthur to the pub
3949 19:00...... The Vogon reads his poem
3950 20:30-22:15 Marwin escorts the Hitchhikers to the bridge
3951 @end example
3952
3953 @cindex time grid
3954 If the agenda is in single-day mode, or for the display of today, the
3955 timed entries are embedded in a time grid, like
3956
3957 @example
3958 8:00...... ------------------
3959 8:30-13:00 Arthur Dent lies in front of the bulldozer
3960 10:00...... ------------------
3961 12:00...... ------------------
3962 12:45...... Ford Prefect arrives and takes Arthur to the pub
3963 14:00...... ------------------
3964 16:00...... ------------------
3965 18:00...... ------------------
3966 19:00...... The Vogon reads his poem
3967 20:00...... ------------------
3968 20:30-22:15 Marwin escorts the Hitchhikers to the bridge
3969 @end example
3970
3971 The time grid can be turned on and off with the variable
3972 @code{org-agenda-use-time-grid}, and can be configured with
3973 @code{org-agenda-time-grid}.
3974
3975 @node Sorting of agenda items, , Time-of-day specifications, Presentation and sorting
3976 @subsection Sorting of agenda items
3977 @cindex sorting, of agenda items
3978 @cindex priorities, of agenda items
3979 Before being inserted into a view, the items are sorted. How this is
3980 done depends on the type of view.
3981 @itemize @bullet
3982 @item
3983 For the daily/weekly agenda, the items for each day are sorted. The
3984 default order is to first collect all items containing an explicit
3985 time-of-day specification. These entries will be shown at the beginning
3986 of the list, as a @emph{schedule} for the day. After that, items remain
3987 grouped in categories, in the sequence given by @code{org-agenda-files}.
3988 Within each category, items are sorted by priority (@pxref{Priorities}),
3989 which is composed of the base priority (2000 for priority @samp{A}, 1000
3990 for @samp{B}, and 0 for @samp{C}), plus additional increments for
3991 overdue scheduled or deadline items.
3992 @item
3993 For the TODO list, items remain in the order of categories, but within
3994 each category, sorting takes place according to priority
3995 (@pxref{Priorities}).
3996 @item
3997 For tags matches, items are not sorted at all, but just appear in the
3998 sequence in which they are found in the agenda files.
3999 @end itemize
4000
4001 Sorting can be customized using the variable
4002 @code{org-agenda-sorting-strategy}.
4003
4004
4005 @node Agenda commands, Custom agenda views, Presentation and sorting, Agenda views
4006 @section Commands in the agenda buffer
4007 @cindex commands, in agenda buffer
4008
4009 Entries in the agenda buffer are linked back to the org file or diary
4010 file where they originate. You are not allowed to edit the agenda
4011 buffer itself, but commands are provided to show and jump to the
4012 original entry location, and to edit the org-files ``remotely'' from
4013 the agenda buffer. In this way, all information is stored only once,
4014 removing the risk that your agenda and note files may diverge.
4015
4016 Some commands can be executed with mouse clicks on agenda lines. For
4017 the other commands, the cursor needs to be in the desired line.
4018
4019 @table @kbd
4020 @tsubheading{Motion}
4021 @cindex motion commands in agenda
4022 @kindex n
4023 @item n
4024 Next line (same as @key{up}).
4025 @kindex p
4026 @item p
4027 Previous line (same as @key{down}).
4028 @tsubheading{View/GoTo org file}
4029 @kindex mouse-3
4030 @kindex @key{SPC}
4031 @item mouse-3
4032 @itemx @key{SPC}
4033 Display the original location of the item in another window.
4034
4035 @kindex L
4036 @item L
4037 Display original location and recenter that window.
4038
4039 @kindex mouse-2
4040 @kindex mouse-1
4041 @kindex @key{TAB}
4042 @item mouse-2
4043 @itemx mouse-1
4044 @itemx @key{TAB}
4045 Go to the original location of the item in another window. Under Emacs
4046 22, @kbd{mouse-1} will also works for this.
4047
4048 @kindex @key{RET}
4049 @itemx @key{RET}
4050 Go to the original location of the item and delete other windows.
4051
4052 @kindex f
4053 @item f
4054 Toggle Follow mode. In Follow mode, as you move the cursor through
4055 the agenda buffer, the other window always shows the corresponding
4056 location in the org file. The initial setting for this mode in new
4057 agenda buffers can be set with the variable
4058 @code{org-agenda-start-with-follow-mode}.
4059
4060 @kindex b
4061 @item b
4062 Display the entire subtree of the current item in an indirect buffer.
4063 With numerical prefix ARG, go up to this level and then take that tree.
4064 If ARG is negative, go up that many levels. With @kbd{C-u} prefix, do
4065 not remove the previously used indirect buffer.
4066
4067 @kindex l
4068 @item l
4069 Toggle Logbook mode. In Logbook mode, entries that where marked DONE while
4070 logging was on (variable @code{org-log-done}) are shown in the agenda,
4071 as are entries that have been clocked on that day.
4072
4073 @tsubheading{Change display}
4074 @cindex display changing, in agenda
4075 @kindex o
4076 @item o
4077 Delete other windows.
4078
4079 @kindex w
4080 @item w
4081 Switch to weekly view (7 days displayed together).
4082
4083 @kindex d
4084 @item d
4085 Switch to daily view (just one day displayed).
4086
4087 @kindex D
4088 @item D
4089 Toggle the inclusion of diary entries. See @ref{Weekly/Daily agenda}.
4090
4091 @kindex g
4092 @item g
4093 Toggle the time grid on and off. See also the variables
4094 @code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
4095
4096 @kindex r
4097 @item r
4098 Recreate the agenda buffer, for example to reflect the changes
4099 after modification of the time stamps of items with S-@key{left} and
4100 S-@key{right}. When the buffer is the global todo list, a prefix
4101 argument is interpreted to create a selective list for a specific TODO
4102 keyword.
4103
4104 @kindex s
4105 @item s
4106 Save all Org-mode buffers in the current Emacs session.
4107
4108 @kindex @key{right}
4109 @item @key{right}
4110 Display the following @code{org-agenda-ndays} days. For example, if
4111 the display covers a week, switch to the following week. With prefix
4112 arg, go forward that many times @code{org-agenda-ndays} days.
4113
4114 @kindex @key{left}
4115 @item @key{left}
4116 Display the previous dates.
4117
4118 @kindex .
4119 @item .
4120 Goto today.
4121
4122 @tsubheading{Remote editing}
4123 @cindex remote editing, from agenda
4124
4125 @item 0-9
4126 Digit argument.
4127
4128 @cindex undoing remote-editing events
4129 @cindex remote editing, undo
4130 @kindex C-_
4131 @item C-_
4132 Undo a change due to a remote editing command. The change is undone
4133 both in the agenda buffer and in the remote buffer.
4134
4135 @kindex t
4136 @item t
4137 Change the TODO state of the item, both in the agenda and in the
4138 original org file.
4139
4140 @kindex C-k
4141 @item C-k
4142 Delete the current agenda item along with the entire subtree belonging
4143 to it in the original Org-mode file. If the text to be deleted remotely
4144 is longer than one line, the kill needs to be confirmed by the user. See
4145 variable @code{org-agenda-confirm-kill}.
4146
4147 @kindex $
4148 @item $
4149 Archive the subtree corresponding to the current headline.
4150
4151 @kindex T
4152 @item T
4153 Show all tags associated with the current item. Because of
4154 inheritance, this may be more than the tags listed in the line itself.
4155
4156 @kindex :
4157 @item :
4158 Set tags for the current headline.
4159
4160 @kindex a
4161 @item a
4162 Toggle the ARCHIVE tag for the current headline.
4163
4164 @kindex ,
4165 @item ,
4166 Set the priority for the current item. Org-mode prompts for the
4167 priority character. If you reply with @key{SPC}, the priority cookie
4168 is removed from the entry.
4169
4170 @kindex P
4171 @item P
4172 Display weighted priority of current item.
4173
4174 @kindex +
4175 @kindex S-@key{up}
4176 @item +
4177 @itemx S-@key{up}
4178 Increase the priority of the current item. The priority is changed in
4179 the original buffer, but the agenda is not resorted. Use the @kbd{r}
4180 key for this.
4181
4182 @kindex -
4183 @kindex S-@key{down}
4184 @item -
4185 @itemx S-@key{down}
4186 Decrease the priority of the current item.
4187
4188 @kindex C-c C-s
4189 @item C-c C-s
4190 Schedule this item
4191
4192 @kindex C-c C-d
4193 @item C-c C-d
4194 Set a deadline for this item.
4195
4196 @kindex S-@key{right}
4197 @item S-@key{right}
4198 Change the time stamp associated with the current line by one day into
4199 the future. With prefix argument, change it by that many days. For
4200 example, @kbd{3 6 5 S-@key{right}} will change it by a year. The
4201 stamp is changed in the original org file, but the change is not
4202 directly reflected in the agenda buffer. Use the
4203 @kbd{r} key to update the buffer.
4204
4205 @kindex S-@key{left}
4206 @item S-@key{left}
4207 Change the time stamp associated with the current line by one day
4208 into the past.
4209
4210 @kindex >
4211 @item >
4212 Change the time stamp associated with the current line to today.
4213 The key @kbd{>} has been chosen, because it is the same as @kbd{S-.}
4214 on my keyboard.
4215
4216 @kindex I
4217 @item I
4218 Start the clock on the current item. If a clock is running already, it
4219 is stopped first.
4220 @kindex O
4221 @item O
4222 Stop the previously started clock.
4223 @kindex X
4224 @item X
4225 Cancel the currently running clock.
4226
4227 @tsubheading{Calendar commands}
4228 @cindex calendar commands, from agenda
4229 @kindex c
4230 @item c
4231 Open the Emacs calendar and move to the date at the agenda cursor.
4232
4233 @item c
4234 When in the calendar, compute and show the Org-mode agenda for the
4235 date at the cursor.
4236
4237 @cindex diary entries, creating from agenda
4238 @kindex i
4239 @item i
4240 Insert a new entry into the diary. Prompts for the type of entry
4241 (day, weekly, monthly, yearly, anniversary, cyclic) and creates a new
4242 entry in the diary, just as @kbd{i d} etc. would do in the calendar.
4243 The date is taken from the cursor position.
4244
4245 @kindex M
4246 @item M
4247 Show the phases of the moon for the three months around current date.
4248
4249 @kindex S
4250 @item S
4251 Show sunrise and sunset times. The geographical location must be set
4252 with calendar variables, see documentation of the Emacs calendar.
4253
4254 @kindex C
4255 @item C
4256 Convert the date at cursor into many other cultural and historic
4257 calendars.
4258
4259 @kindex H
4260 @item H
4261 Show holidays for three month around the cursor date.
4262
4263 @c FIXME: This should be a different key.
4264 @kindex C-c C-x C-c
4265 @item C-c C-x C-c
4266 Export a single iCalendar file containing entries from all agenda files.
4267
4268 @tsubheading{Quit and Exit}
4269 @kindex q
4270 @item q
4271 Quit agenda, remove the agenda buffer.
4272
4273 @kindex x
4274 @cindex agenda files, removing buffers
4275 @item x
4276 Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
4277 for the compilation of the agenda. Buffers created by the user to
4278 visit org files will not be removed.
4279
4280 @end table
4281
4282
4283 @node Custom agenda views, , Agenda commands, Agenda views
4284 @section Custom agenda views
4285 @cindex custom agenda views
4286 @cindex agenda views, custom
4287
4288 Custom agenda commands serve two purposes: to store and quickly access
4289 frequently used TODO and tags searches, and to create special composite
4290 agenda buffers. Custom agenda commands will be accessible through the
4291 dispatcher (@pxref{Agenda dispatcher}), just like the default commands.
4292
4293 @menu
4294 * Storing searches:: Type once, use often
4295 * Block agenda:: All the stuff you need in a single buffer
4296 * Setting Options:: Changing the rules
4297 * Batch processing:: Agenda views from the command line
4298 @end menu
4299
4300 @node Storing searches, Block agenda, Custom agenda views, Custom agenda views
4301 @subsection Storing searches
4302
4303 The first application of custom searches is the definition of keyboard
4304 shortcuts for frequently used searches, either creating an agenda
4305 buffer, or a sparse tree (the latter covering of course only the current
4306 buffer).
4307 @kindex C-c a C
4308 Custom commands are configured in the variable
4309 @code{org-agenda-custom-commands}. You can customize this variable, for
4310 example by pressing @kbd{C-c a C}. You can also directly set it with
4311 Emacs Lisp in @file{.emacs}. The following example contains all valid
4312 search types:
4313
4314 @lisp
4315 @group
4316 (setq org-agenda-custom-commands
4317 '(("w" todo "WAITING")
4318 ("W" todo-tree "WAITING")
4319 ("u" tags "+BOSS-URGENT")
4320 ("v" tags-todo "+BOSS-URGENT")
4321 ("U" tags-tree "+BOSS-URGENT")
4322 ("f" occur-tree "\\<FIXME\\>")))
4323 @end group
4324 @end lisp
4325
4326 @noindent
4327 The initial single-character string in each entry defines the character
4328 you have to press after the dispatcher command @kbd{C-c a} in order to
4329 access the command. The second parameter is the search type, followed
4330 by the string or regular expression to be used for the matching. The
4331 example above will therefore define:
4332
4333 @table @kbd
4334 @item C-c a w
4335 as a global search for TODO entries with @samp{WAITING} as the TODO
4336 keyword
4337 @item C-c a W
4338 as the same search, but only in the current buffer and displaying the
4339 results as a sparse tree
4340 @item C-c a u
4341 as a global tags search for headlines marked @samp{:BOSS:} but not
4342 @samp{:URGENT:}
4343 @item C-c a v
4344 as the same search as @kbd{C-c a u}, but limiting the search to
4345 headlines that are also TODO items
4346 @item C-c a U
4347 as the same search as @kbd{C-c a u}, but only in the current buffer and
4348 displaying the result as a sparse tree
4349 @item C-c a f
4350 to create a sparse tree (again: current buffer only) with all entries
4351 containing the word @samp{FIXME}.
4352 @end table
4353
4354 @node Block agenda, Setting Options, Storing searches, Custom agenda views
4355 @subsection Block agenda
4356 @cindex block agenda
4357 @cindex agenda, with block views
4358
4359 Another possibility is the construction of agenda views that comprise
4360 the results of @emph{several} commands, each of which creates a block in
4361 the agenda buffer. The available commands include @code{agenda} for the
4362 daily or weekly agenda (as created with @kbd{C-c a a}), @code{alltodo}
4363 for the global todo list (as constructed with @kbd{C-c a t}), and the
4364 matching commands discussed above: @code{todo}, @code{tags}, and
4365 @code{tags-todo}. Here are two examples:
4366
4367 @lisp
4368 @group
4369 (setq org-agenda-custom-commands
4370 '(("h" "Agenda and Home-related tasks"
4371 ((agenda)
4372 (tags-todo "HOME")
4373 (tags "GARDEN")))
4374 ("o" "Agenda and Office-related tasks"
4375 ((agenda)
4376 (tags-todo "WORK")
4377 (tags "OFFICE")))))
4378 @end group
4379 @end lisp
4380
4381 @noindent
4382 This will define @kbd{C-c a h} to create a multi-block view for stuff
4383 you need to attend to at home. The resulting agenda buffer will contain
4384 your agenda for the current week, all TODO items that carry the tag
4385 @samp{HOME}, and also all lines tagged with @samp{GARDEN}. Finally the
4386 command @kbd{C-c a o} provides a similar view for office tasks.
4387
4388
4389 @node Setting Options, Batch processing, Block agenda, Custom agenda views
4390 @subsection Setting Options for custom commands
4391 @cindex options, for custom agenda views
4392
4393 Org-mode contains a number of variables regulating agenda construction
4394 and display. The global variables define the behavior for all agenda
4395 commands, including the custom commands. However, if you want to change
4396 some settings just for a single custom view, you can do so. Setting
4397 options requires inserting a list of variable names and values at the
4398 right spot in @code{org-agenda-custom-commands}. For example:
4399
4400 @lisp
4401 @group
4402 (setq org-agenda-custom-commands
4403 '(("w" todo "WAITING"
4404 ((org-agenda-sorting-strategy '(priority-down))
4405 (org-agenda-prefix-format " Mixed: ")))
4406 ("U" tags-tree "+BOSS-URGENT"
4407 ((org-show-following-heading nil)
4408 (org-show-hierarchy-above nil)))))
4409 @end group
4410 @end lisp
4411
4412 @noindent
4413 Now the @kbd{C-c a w} command will sort the collected entries only by
4414 priority, and the prefix format is modified to just say @samp{ Mixed:}
4415 instead of giving the category of the entry. The sparse tags tree of
4416 @kbd{C-c a U} will now turn out ultra-compact, because neither the
4417 headline hierarchy above the match, nor the headline following the match
4418 will be shown.
4419
4420 For command sets creating a block agenda,
4421 @code{org-agenda-custom-commands} has two separate spots for setting
4422 options. You can add options that should be valid for just a single
4423 command in the set, and options that should be valid for all commands in
4424 the set. The former are just added to the command entry, the latter
4425 must come after the list of command entries. Going back to the block
4426 agenda example (@pxref{Block agenda}), let's change the sorting strategy
4427 for the @kbd{C-c a h} commands to @code{priority-down}, but let's sort
4428 the results for GARDEN tags query in the opposite order,
4429 @code{priority-up}. This would look like this:
4430
4431 @lisp
4432 @group
4433 (setq org-agenda-custom-commands
4434 '(("h" "Agenda and Home-related tasks"
4435 ((agenda)
4436 (tags-todo "HOME")
4437 (tags "GARDEN" ((org-agenda-sorting-strategy '(priority-up)))))
4438 ((org-agenda-sorting-strategy '(priority-down))))
4439 ("o" "Agenda and Office-related tasks"
4440 ((agenda)
4441 (tags-todo "WORK")
4442 (tags "OFFICE")))))
4443 @end group
4444 @end lisp
4445
4446 As you see, the values and parenthesis setting is a little complex.
4447 When in doubt, use the customize interface to set this variable - it
4448 fully supports its structure. Just one caveat: When setting options in
4449 this interface, the @emph{values} are just lisp expressions. So if the
4450 value is a string, you need to add the double quotes around the value
4451 yourself.
4452
4453 @node Batch processing, , Setting Options, Custom agenda views
4454 @subsection Creating agenda views in batch processing
4455 @cindex agenda, batch production
4456
4457 If you want to print or otherwise reprocess agenda views, it can be
4458 useful to create an agenda from the command line. This is the purpose
4459 of the function @code{org-batch-agenda}. It takes as a parameter one of
4460 the strings that are the keys in @code{org-agenda-custom-commands}. For
4461 example, to directly print the current TODO list, you could use
4462
4463 @example
4464 emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
4465 @end example
4466
4467 @noindent
4468 You may also modify parameters on the fly like this:
4469
4470 @example
4471 emacs -batch -l ~/.emacs \
4472 -eval '(org-batch-agenda "a" \
4473 org-agenda-ndays 300 \
4474 org-agenda-include-diary nil \
4475 org-agenda-files (quote ("~/org/project.org")))' \
4476 | lpr
4477 @end example
4478
4479 @noindent
4480 which will produce a 300 day agenda, fully restricted to the Org file
4481 @file{~/org/projects.org}, not even including the diary.
4482
4483 @node Embedded LaTeX, Exporting, Agenda views, Top
4484 @chapter Embedded LaTeX
4485 @cindex @TeX{} interpretation
4486 @cindex La@TeX{} interpretation
4487
4488 Plain ASCII is normally sufficient for almost all note taking. One
4489 exception, however, are scientific notes which need to be able to
4490 contain mathematical symbols and the occasional formula.
4491 La@TeX{}@footnote{La@TeX{} is a macro system based on Donald E. Knuth's
4492 @TeX{} system. Many of the features described here as ``La@TeX{}'' are
4493 really from @TeX{}, but for simplicity I am blurring this distinction.}
4494 is widely used to typeset scientific documents. Org-mode supports
4495 embedding La@TeX{} code into its files, because many academics are used
4496 to read La@TeX{} source code, and because it can be readily processed
4497 into images for HTML production.
4498
4499 It is not necessary to mark La@TeX{} macros and code in any special way.
4500 If you observe a few conventions, Org-mode knows how to find it and what
4501 to do with it.
4502
4503 @menu
4504 * Math symbols:: TeX macros for symbols and Greek letters
4505 * Subscripts and Superscripts:: Simple syntax for raising/lowering text
4506 * LaTeX fragments:: Complex formulas made easy
4507 * Processing LaTeX fragments:: Previewing LaTeX processing
4508 * CDLaTeX mode:: Speed up entering of formulas
4509 @end menu
4510
4511 @node Math symbols, Subscripts and Superscripts, Embedded LaTeX, Embedded LaTeX
4512 @section Math symbols
4513 @cindex math symbols
4514 @cindex TeX macros
4515
4516 You can use La@TeX{} macros to insert special symbols like @samp{\alpha}
4517 to indicate the Greek letter, or @samp{\to} to indicate an arrow.
4518 Completion for these macros is available, just type @samp{\} and maybe a
4519 few letters, and press @kbd{M-@key{TAB}} to see possible completions.
4520 Unlike La@TeX{} code, Org-mode allows these macros to be present
4521 without surrounding math delimiters, for example:
4522
4523 @example
4524 Angles are written as Greek letters \alpha, \beta and \gamma.
4525 @end example
4526
4527 During HTML export (@pxref{HTML export}), these symbols are translated
4528 into the proper syntax for HTML, for the above examples this is
4529 @samp{&alpha;} and @samp{&rarr;}, respectively.
4530
4531 @node Subscripts and Superscripts, LaTeX fragments, Math symbols, Embedded LaTeX
4532 @section Subscripts and Superscripts
4533 @cindex subscript
4534 @cindex superscript
4535
4536 Just like in La@TeX{}, @samp{^} and @samp{_} are used to indicate super-
4537 and subscripts. Again, these can be used without embedding them in
4538 math-mode delimiters. To increase the readability of ASCII text, it is
4539 not necessary (but OK) to surround multi-character sub- and superscripts
4540 with curly braces. For example
4541
4542 @example
4543 The mass if the sun is M_sun = 1.989 x 10^30 kg. The radius of
4544 the sun is R_@{sun@} = 6.96 x 10^8 m.
4545 @end example
4546
4547 To avoid interpretation as raised or lowered text, you can quote
4548 @samp{^} and @samp{_} with a backslash: @samp{\_} and @samp{\^}.
4549
4550 During HTML export (@pxref{HTML export}), subscript and superscripts
4551 are surrounded with @code{<sub>} and @code{<sup>} tags, respectively.
4552
4553 @node LaTeX fragments, Processing LaTeX fragments, Subscripts and Superscripts, Embedded LaTeX
4554 @section LaTeX fragments
4555 @cindex LaTeX fragments
4556
4557 With symbols, sub- and superscripts, HTML is pretty much at its end when
4558 it comes to representing mathematical formulas@footnote{Yes, there is
4559 MathML, but that is not yet fully supported by many browsers, and there
4560 is no decent converter for turning LaTeX of ASCII representations of
4561 formulas into MathML. So for the time being, converting formulas into
4562 images seems the way to go.}. More complex
4563 expressions need a dedicated formula processor. To this end, Org-mode
4564 can contain arbitrary La@TeX{} fragments. It provides commands to
4565 preview the typeset result of these fragments, and upon export to HTML,
4566 all fragments will be converted to images and inlined into the HTML
4567 document. For this to work you need to be on a system with a working
4568 La@TeX{} installation. You also need the @file{dvipng} program,
4569 available at @url{http://sourceforge.net/projects/dvipng/}.
4570
4571 La@TeX{} fragments don't need any special marking at all. The following
4572 snippets will be identified as LaTeX source code:
4573 @itemize @bullet
4574 @item
4575 Environments of any kind. The only requirement is that the
4576 @code{\begin} statement appears on a new line, preceded by only
4577 whitespace.
4578 @item
4579 Text within the usual La@TeX{} math delimiters. To avoid conflicts with
4580 currency specifications, single @samp{$} characters are only recognized
4581 as math delimiters if the enclosed text contains at most two line breaks,
4582 is directly attached to the @samp{$} characters with no whitespace in
4583 between, and if the closing @samp{$} is followed by whitespace or
4584 punctuation. For the other delimiters, there is no such restriction, so
4585 when in doubt, use @samp{\(...\)} as inline math delimiters.
4586 @end itemize
4587
4588 @noindent For example:
4589
4590 @example
4591 \begin@{equation@} % arbitrary environments,
4592 x=\sqrt@{b@} % even tables, figures
4593 \end@{equation@} % etc
4594
4595 If $a^2=b$ and \( b=2 \), then the solution must be
4596 either $$ a=+\sqrt@{2@} $$ or \[ a=-\sqrt@{2@} \].
4597 @end example
4598
4599 @noindent
4600 If you need any of the delimiter ASCII sequences for other purposes, you
4601 can configure the option @code{org-format-latex-options} to deselect the
4602 ones you do not wish to have interpreted by the La@TeX{} converter.
4603
4604 @node Processing LaTeX fragments, CDLaTeX mode, LaTeX fragments, Embedded LaTeX
4605 @section Processing LaTeX fragments
4606 @cindex LaTeX fragments, preview
4607
4608 La@TeX{} fragments can be processed to produce a preview images of the
4609 typeset expressions:
4610
4611 @table @kbd
4612 @kindex C-c C-x C-l
4613 @item C-c C-x C-l
4614 Produce a preview image of the La@TeX{} fragment at point and overlay it
4615 over the source code. If there is no fragment at point, process all
4616 fragments in the current entry (between two headlines). When called
4617 with a prefix argument, process the entire subtree. When called with
4618 two prefix arguments, or when the cursor is before the first headline,
4619 process the entire buffer.
4620 @kindex C-c C-c
4621 @item C-c C-c
4622 Remove the overlay preview images.
4623 @end table
4624
4625 During HTML export (@pxref{HTML export}), all La@TeX{} fragments are
4626 converted into images and inlined into the document if the following
4627 setting is active:
4628
4629 @lisp
4630 (setq org-export-with-LaTeX-fragments t)
4631 @end lisp
4632
4633 @node CDLaTeX mode, , Processing LaTeX fragments, Embedded LaTeX
4634 @section Using CDLaTeX to enter math
4635 @cindex CDLaTeX
4636
4637 CDLaTeX-mode is a minor mode that is normally used in combination with a
4638 major LaTeX mode like AUCTeX in order to speed-up insertion of
4639 environments and math templates. Inside Org-mode, you can make use of
4640 some of the features of cdlatex-mode. You need to install
4641 @file{cdlatex.el} and @file{texmathp.el} (the latter comes also with
4642 AUCTeX) from @url{http://www.astro.uva.nl/~dominik/Tools/cdlatex}.
4643 Don't turn cdlatex-mode itself under Org-mode, but use the light
4644 version @code{org-cdlatex-mode} that comes as part of Org-mode. Turn it
4645 on for the current buffer with @code{M-x org-cdlatex-mode}, or for all
4646 Org-mode files with
4647
4648 @lisp
4649 (add-hook 'org-mode-hook 'turn-on-org-cdlatex)
4650 @end lisp
4651
4652 When this mode is enabled, the following features are present (for more
4653 details see the documentation of cdlatex-mode):
4654 @itemize @bullet
4655 @kindex C-c @{
4656 @item
4657 Environment templates can be inserted with @kbd{C-c @{}.
4658 @item
4659 @kindex @key{TAB}
4660 The @key{TAB} key will do template expansion if the cursor is inside a
4661 LaTeX fragment@footnote{Org-mode has a method to test if the cursor is
4662 inside such a fragment, see the documentation of the function
4663 @code{org-inside-LaTeX-fragment-p}.}. For example, @key{TAB} will
4664 expand @code{fr} to @code{\frac@{@}@{@}} and position the cursor
4665 correctly inside the first brace. Another @key{TAB} will get you into
4666 the second brace. Even outside fragments, @key{TAB} will expand
4667 environment abbreviations at the beginning of a line. For example, if
4668 you write @samp{equ} at the beginning of a line and press @key{TAB},
4669 this abbreviation will be expanded to an @code{equation} environment.
4670 To get a list of all abbreviations, type @kbd{M-x cdlatex-command-help}.
4671 @item
4672 @kindex _
4673 @kindex ^
4674 Pressing @kbd{_} and @kbd{^} inside a LaTeX fragment will insert these
4675 characters together with a pair of braces. If you use @key{TAB} to move
4676 out of the braces, and if the braces surround only a single character or
4677 macro, they are removed again (depending on the variable
4678 @code{cdlatex-simplify-sub-super-scripts}).
4679 @item
4680 @kindex `
4681 Pressing the backquote @kbd{`} followed by a character inserts math
4682 macros, also outside LaTeX fragments. If you wait more than 1.5 seconds
4683 after the backquote, a help window will pop up.
4684 @item
4685 @kindex '
4686 Pressing the normal quote @kbd{'} followed by another character modifies
4687 the symbol before point with an accent or a font. If you wait more than
4688 1.5 seconds after the backquote, a help window will pop up. Character
4689 modification will work only inside La@TeX{} fragments, outside the quote
4690 is normal.
4691 @end itemize
4692
4693 @node Exporting, Publishing, Embedded LaTeX, Top
4694 @chapter Exporting
4695 @cindex exporting
4696
4697 Org-mode documents can be exported into a variety of other formats. For
4698 printing and sharing of notes, ASCII export produces a readable and
4699 simple version of an Org-mode file. HTML export allows you to publish a
4700 notes file on the web, while the XOXO format provides a solid base for
4701 exchange with a broad range of other applications. To incorporate
4702 entries with associated times like deadlines or appointments into a
4703 desktop calendar program like iCal, Org-mode can also produce extracts
4704 in the iCalendar format. Currently Org-mode only supports export, not
4705 import of these different formats.
4706
4707 When exporting, Org-mode uses special conventions to enrich the output
4708 produced. @xref{Text interpretation}, for more details.
4709
4710 @table @kbd
4711 @kindex C-c C-e
4712 @item C-c C-e
4713 Dispatcher for export and publishing commands. Displays a help-window
4714 listing the additional key(s) needed to launch an export or publishing
4715 command.
4716 @end table
4717
4718 @menu
4719 * ASCII export:: Exporting to plain ASCII
4720 * HTML export:: Exporting to HTML
4721 * XOXO export:: Exporting to XOXO
4722 * iCalendar export:: Exporting in iCalendar format
4723 * Text interpretation:: How the exporter looks at the file
4724 @end menu
4725
4726 @node ASCII export, HTML export, Exporting, Exporting
4727 @section ASCII export
4728 @cindex ASCII export
4729
4730 ASCII export produces a simple and very readable version of an Org-mode
4731 file.
4732
4733 @cindex region, active
4734 @cindex active region
4735 @cindex transient-mark-mode
4736 @table @kbd
4737 @kindex C-c C-e a
4738 @item C-c C-e a
4739 Export as ASCII file. If there is an active region, only the region
4740 will be exported. For an org file @file{myfile.org}, the ASCII file
4741 will be @file{myfile.txt}. The file will be overwritten without
4742 warning.
4743 @kindex C-c C-e v a
4744 @item C-c C-e v a
4745 Export only the visible part of the document.
4746 @end table
4747
4748 @cindex headline levels, for exporting
4749 In the exported version, the first 3 outline levels will become
4750 headlines, defining a general document structure. Additional levels
4751 will be exported as itemized lists. If you want that transition to occur
4752 at a different level, specify it with a prefix argument. For example,
4753
4754 @example
4755 @kbd{C-1 C-c C-e a}
4756 @end example
4757
4758 @noindent
4759 creates only top level headlines and does the rest as items. When
4760 headlines are converted to items, the indentation of the text following
4761 the headline is changed to fit nicely under the item. This is done with
4762 the assumption that the first bodyline indicates the base indentation of
4763 the body text. Any indentation larger than this is adjusted to preserve
4764 the layout relative to the first line. Should there be lines with less
4765 indentation than the first, these are left alone.
4766
4767 @node HTML export, XOXO export, ASCII export, Exporting
4768 @section HTML export
4769 @cindex HTML export
4770
4771 Org-mode contains an HTML (XHTML 1.0 strict) exporter with extensive
4772 HTML formatting, in ways similar to John Grubers @emph{markdown}
4773 language, but with additional support for tables.
4774
4775 @menu
4776 * Export commands:: How to invode HTML export
4777 * Quoting HTML tags:: Using direct HTML in Org-mode
4778 * Links:: How hyperlinks get transferred to HTML
4779 * Images:: To inline or not to inline?
4780 * CSS support:: Style specifications
4781 @end menu
4782
4783 @node Export commands, Quoting HTML tags, HTML export, HTML export
4784 @subsection HTML export commands
4785
4786 @cindex region, active
4787 @cindex active region
4788 @cindex transient-mark-mode
4789 @table @kbd
4790 @kindex C-c C-e h
4791 @item C-c C-e h
4792 Export as HTML file @file{myfile.html}.
4793 @kindex C-c C-e b
4794 @item C-c C-e b
4795 Export as HTML file and open it with a browser.
4796 @kindex C-c C-e v h
4797 @kindex C-c C-e v b
4798 @item C-c C-e v h
4799 @item C-c C-e v b
4800 Export only the visible part of the document.
4801 @end table
4802
4803 @cindex headline levels, for exporting
4804 In the exported version, the first 3 outline levels will become
4805 headlines, defining a general document structure. Additional levels
4806 will be exported as itemized lists. If you want that transition to occur
4807 at a different level, specify it with a prefix argument. For example,
4808
4809 @example
4810 @kbd{C-2 C-c C-e b}
4811 @end example
4812
4813 @noindent
4814 creates two levels of headings and does the rest as items.
4815
4816 @node Quoting HTML tags, Links, Export commands, HTML export
4817 @subsection Quoting HTML tags
4818
4819 Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
4820 @samp{&gt;} in HTML export. If you want to include simple HTML tags
4821 which should be interpreted as such, mark them with @samp{@@} as in
4822 @samp{@@<b>bold text@@</b>}. Note that this really works only for
4823 simple tags. For more extensive HTML that should be copied verbatim to
4824 the exported file use either
4825
4826 @example
4827 #+HTML: Literal HTML code for export
4828 @end example
4829
4830 @noindent or
4831
4832 @example
4833 #+BEGIN_HTML
4834 All lines between these markers are exported literally
4835 #+END_HTML
4836 @end example
4837
4838
4839 @node Links, Images, Quoting HTML tags, HTML export
4840 @subsection Links
4841
4842 @cindex links, in HTML export
4843 @cindex internal links, in HTML export
4844 @cindex external links, in HTML export
4845 Internal links (@pxref{Internal links}) will continue to work in HTML
4846 files only if they match a dedicated @samp{<<target>>}. Automatic links
4847 created by radio targets (@pxref{Radio targets}) will also work in the
4848 HTML file. Links to external files will still work if the HTML file is
4849 in the same directory as the Org-mode file. Links to other @file{.org}
4850 files will be translated into HTML links under the assumption that an
4851 HTML version also exists of the linked file. For information related to
4852 linking files while publishing them to a publishing directory see
4853 @ref{Publishing links}.
4854
4855 @node Images, CSS support, Links, HTML export
4856 @subsection Images
4857
4858 @cindex images, inline in HTML
4859 @cindex inlining images in HTML
4860 HTML export can inline images given as links in the Org-mode file, and
4861 it can make an image the clickable part of a link. By
4862 default@footnote{but see the variable
4863 @code{org-export-html-inline-images}}, images are inlined if a link does
4864 not have a description. So @samp{[[file:myimg.jpg]]} will be inlined,
4865 while @samp{[[file:myimg.jpg][the image]]} will just produce a link
4866 @samp{the image} that points to the image. If the description part
4867 itself is a @code{file:} link or a @code{http:} URL pointing to an
4868 image, this image will be inlined and activated so that clicking on the
4869 image will activate the link. For example, to include a thumbnail that
4870 will link to a high resolution version of the image, you could use:
4871
4872 @example
4873 [[file:highres.jpg][file:thumb.jpg]]
4874 @end example
4875
4876 @noindent
4877 and you could use @code{http} addresses just as well.
4878
4879 @node CSS support, , Images, HTML export
4880 @subsection CSS support
4881
4882 You can also give style information for the exported file. The HTML
4883 exporter assigns the following CSS classes to appropriate parts of the
4884 document - your style specifications may change these:
4885 @example
4886 .todo @r{TODO keywords}
4887 .done @r{the DONE keyword}
4888 .timestamp @r{time stamp}
4889 .timestamp-kwd @r{keyword associated with a time stamp, like SCHEDULED}
4890 .tag @r{tag in a headline}
4891 .target @r{target for links}
4892 @end example
4893
4894 The default style specification can be configured through the option
4895 @code{org-export-html-style}. If you want to use a file-local style,
4896 you may use file variables, best wrapped into a COMMENT section at the
4897 end of the outline tree. For example@footnote{Under Emacs 21, the
4898 continuation lines for a variable value should have no @samp{#} at the
4899 start of the line.}:
4900
4901 @example
4902 * COMMENT html style specifications
4903
4904 # Local Variables:
4905 # org-export-html-style: " <style type=\"text/css\">
4906 # p @{font-weight: normal; color: gray; @}
4907 # h1 @{color: black; @}
4908 # </style>"
4909 # End:
4910 @end example
4911
4912 Remember to execute @kbd{M-x normal-mode} after changing this to make
4913 the new style visible to Emacs. This command restarts org-mode for the
4914 current buffer and forces Emacs to re-evaluate the local variables
4915 section in the buffer.
4916
4917 @c FIXME: More about header and footer styles
4918 @c FIXME: Talk about links and targets.
4919
4920 @node XOXO export, iCalendar export, HTML export, Exporting
4921 @section XOXO export
4922 @cindex XOXO export
4923
4924 Org-mode contains an exporter that produces XOXO-style output.
4925 Currently, this exporter only handles the general outline structure and
4926 does not interpret any additional Org-mode features.
4927
4928 @table @kbd
4929 @kindex C-c C-e x
4930 @item C-c C-e x
4931 Export as XOXO file @file{myfile.html}.
4932 @kindex C-c C-e v
4933 @item C-c C-e v x
4934 Export only the visible part of the document.
4935 @end table
4936
4937 @node iCalendar export, Text interpretation, XOXO export, Exporting
4938 @section iCalendar export
4939 @cindex iCalendar export
4940
4941 Some people like to use Org-mode for keeping track of projects, but
4942 still prefer a standard calendar application for anniversaries and
4943 appointments. In this case it can be useful to have deadlines and
4944 other time-stamped items in Org-mode files show up in the calendar
4945 application. Org-mode can export calendar information in the standard
4946 iCalendar format. If you also want to have TODO entries included in the
4947 export, configure the variable @code{org-icalendar-include-todo}.
4948
4949 @table @kbd
4950 @kindex C-c C-e i
4951 @item C-c C-e i
4952 Create iCalendar entries for the current file and store them in the same
4953 directory, using a file extension @file{.ics}.
4954 @kindex C-c C-e I
4955 @item C-c C-e I
4956 Like @kbd{C-c C-e i}, but do this for all files in
4957 @code{org-agenda-files}. For each of these files, a separate iCalendar
4958 file will be written.
4959 @kindex C-c C-e c
4960 @item C-c C-e c
4961 Create a single large iCalendar file from all files in
4962 @code{org-agenda-files} and write it to the file given by
4963 @code{org-combined-agenda-icalendar-file}.
4964 @end table
4965
4966 How this calendar is best read and updated, depends on the application
4967 you are using. The FAQ covers this issue.
4968
4969
4970 @node Text interpretation, , iCalendar export, Exporting
4971 @section Text interpretation by the exporter
4972
4973 The exporter backends interpret additional structure in the Org-mode file
4974 in order to produce better output.
4975
4976 @menu
4977 * Comment lines:: Some lines will not be exported
4978 * Enhancing text:: Subscripts, symbols and more
4979 * Export options:: How to influence the export settings
4980 @end menu
4981
4982 @node Comment lines, Enhancing text, Text interpretation, Text interpretation
4983 @subsection Comment lines
4984 @cindex comment lines
4985 @cindex exporting, not
4986
4987 Lines starting with @samp{#} in column zero are treated as comments
4988 and will never be exported. Also entire subtrees starting with the
4989 word @samp{COMMENT} will never be exported. Finally, any text before
4990 the first headline will not be exported either.
4991
4992 @table @kbd
4993 @kindex C-c ;
4994 @item C-c ;
4995 Toggle the COMMENT keyword at the beginning of an entry.
4996 @end table
4997
4998 @node Enhancing text, Export options, Comment lines, Text interpretation
4999 @subsection Enhancing text for export
5000 @cindex enhancing text
5001 @cindex richer text
5002
5003 Some of the export backends of Org-mode allow for sophisticated text
5004 formatting, this is true in particular for the HTML backend. Org-mode
5005 has a number of typing conventions that allow to produce a richly
5006 formatted output.
5007
5008 @itemize @bullet
5009
5010 @cindex hand-formatted lists
5011 @cindex lists, hand-formatted
5012 @item
5013 Plain lists @samp{-}, @samp{*} or @samp{+} as bullet, or with @samp{1.}
5014 or @samp{2)} as enumerator will be recognized and transformed if the
5015 backend supports lists. See @xref{Plain lists}.
5016
5017 @cindex underlined text
5018 @cindex bold text
5019 @cindex italic text
5020 @item
5021 You can make words @b{*bold*}, @i{/italic/}, _underlined_,
5022 @code{=code=}, and @samp{+strikethrough+}.
5023
5024 @cindex horizontal rules, in exported files
5025 @item
5026 A line consisting of only dashes, and at least 5 of them, will be
5027 exported as a horizontal line (@samp{<hr/>} in HTML).
5028
5029 @cindex LaTeX fragments, export
5030 @cindex TeX macros, export
5031 @item
5032 Many @TeX{} macros and entire La@TeX{} fragments are converted into HTML
5033 entities or images (@pxref{Embedded LaTeX}).
5034
5035 @cindex tables, export
5036 @item
5037 Tables are transformed into native tables under the exporter, if the
5038 export backend supports this. Data fields before the first horizontal
5039 separator line will be formatted as table header fields.
5040
5041 @cindex fixed width
5042 @item
5043 If a headline starts with the word @samp{QUOTE}, the text below the
5044 headline will be typeset as fixed-width, to allow quoting of computer
5045 codes etc. Lines starting with @samp{:} are also typeset in
5046 fixed-width font.
5047 @table @kbd
5048 @kindex C-c :
5049 @item C-c :
5050 Toggle fixed-width for entry (QUOTE) or region, see below.
5051 @end table
5052
5053 @cindex linebreak, forced
5054 @item
5055 A double backslash @emph{at the end of a line} enforces a line break at
5056 this position.
5057 @end itemize
5058
5059 If these conversions conflict with your habits of typing ASCII text,
5060 they can all be turned off with corresponding variables (see the
5061 customization group @code{org-export-general}, and the following section
5062 which explains how to set export options with special lines in a
5063 buffer.
5064
5065
5066 @node Export options, , Enhancing text, Text interpretation
5067 @subsection Export options
5068 @cindex options, for export
5069
5070 @cindex completion, of option keywords
5071 The exporter recognizes special lines in the buffer which provide
5072 additional information. These lines may be put anywhere in the file.
5073 The whole set of lines can be inserted into the buffer with @kbd{C-c
5074 C-e t}. For individual lines, a good way to make sure the keyword is
5075 correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
5076 (@pxref{Completion}).
5077
5078 @table @kbd
5079 @kindex C-c C-e t
5080 @item C-c C-e t
5081 Insert template with export options, see example below.
5082 @end table
5083
5084 @example
5085 #+TITLE: the title to be shown (default is the buffer name)
5086 #+AUTHOR: the author (default taken from @code{user-full-name})
5087 #+EMAIL: his/her email address (default from @code{user-mail-address})
5088 #+LANGUAGE: language for HTML, e.g. @samp{en} (@code{org-export-default-language})
5089 #+TEXT: Some descriptive text to be inserted at the beginning.
5090 #+TEXT: Several lines may be given.
5091 #+OPTIONS: H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t *:nil TeX:t LaTeX:t
5092 @end example
5093
5094 @noindent
5095 The OPTIONS line is a compact form to specify export settings. Here
5096 you can:
5097 @cindex headline levels
5098 @cindex section-numbers
5099 @cindex table of contents
5100 @cindex linebreak preservation
5101 @cindex quoted HTML tags
5102 @cindex fixed-width sections
5103 @cindex tables
5104 @cindex @TeX{}-like syntax for sub- and superscripts
5105 @cindex emphasized text
5106 @cindex @TeX{} macros
5107 @cindex La@TeX{} fragments
5108 @example
5109 H: @r{set the number of headline levels for export}
5110 num: @r{turn on/off section-numbers}
5111 toc: @r{turn on/off table of contents, or set level limit (integer)}
5112 \n: @r{turn on/off linebreak-preservation}
5113 @@: @r{turn on/off quoted HTML tags}
5114 :: @r{turn on/off fixed-width sections}
5115 |: @r{turn on/off tables}
5116 ^: @r{turn on/off @TeX{}-like syntax for sub- and superscripts.}
5117 *: @r{turn on/off emphasized text (bold, italic, underlined)}
5118 TeX: @r{turn on/off simple @TeX{} macros in plain text}
5119 LaTeX: @r{turn on/off La@TeX{} fragments}
5120 @end example
5121
5122 @node Publishing, Miscellaneous, Exporting, Top
5123 @chapter Publishing
5124 @cindex publishing
5125
5126 Org-mode includes@footnote{@file{org-publish.el} is not yet part of
5127 Emacs, so if you are using @file{org.el} as it comes with Emacs, you
5128 need to download this file separately. Also make sure org.el is at
5129 least version 4.27.} a publishing management system
5130 that allows you to configure automatic HTML conversion of
5131 @emph{projects} composed of interlinked org files. This system is
5132 called @emph{org-publish}. You can also configure org-publish to
5133 automatically upload your exported HTML pages and related attachments,
5134 such as images and source code files, to a web server. Org-publish turns
5135 org-mode into a web-site authoring tool.
5136
5137 Org-publish has been contributed to Org-mode by David O'Toole.
5138
5139 @menu
5140 * Configuration:: Defining projects
5141 * Sample configuration:: Example projects
5142 * Triggering publication:: Publication commands
5143 @end menu
5144
5145 @node Configuration, Sample configuration, Publishing, Publishing
5146 @section Configuration
5147
5148 Publishing needs significant configuration to specify files, destination
5149 and many other properties of a project.
5150
5151 @menu
5152 * Project alist:: The central configuration variable
5153 * Sources and destinations:: From here to there
5154 * Selecting files:: What files are part of the project?
5155 * Publishing action:: Setting the function doing the publishing
5156 * Publishing options:: Tweaking HTML export
5157 * Publishing links:: Which links keep working after publishing?
5158 * Project page index:: Publishing a list of project files
5159 @end menu
5160
5161 @node Project alist, Sources and destinations, Configuration, Configuration
5162 @subsection The variable @code{org-publish-project-alist}
5163 @cindex org-publish-project-alist
5164 @cindex projects, for publishing
5165
5166 Org-publish is configured almost entirely through setting the value of
5167 one variable, called @code{org-publish-project-alist}.
5168 Each element of the list configures one project, and may be in one of
5169 the two following forms:
5170
5171 @lisp
5172 ("project-name" :property value :property value ...)
5173
5174 @r{or}
5175
5176 ("project-name" :components ("project-name" "project-name" ...))
5177
5178 @end lisp
5179
5180 In both cases, projects are configured by specifying property values.
5181 A project defines the set of files that will be published, as well as
5182 the publishing configuration to use when publishing those files. When
5183 a project takes the second form listed above, the individual members
5184 of the ``components'' property are taken to be components of the
5185 project, which group together files requiring different publishing
5186 options. When you publish such a ``meta-project'' all the components
5187 will also publish.
5188
5189 @node Sources and destinations, Selecting files, Project alist, Configuration
5190 @subsection Sources and destinations for files
5191 @cindex directories, for publishing
5192
5193 Most properties are optional, but some should always be set. In
5194 particular, org-publish needs to know where to look for source files,
5195 and where to put published files.
5196
5197 @multitable @columnfractions 0.3 0.7
5198 @item @code{:base-directory}
5199 @tab Directory containing publishing source files
5200 @item @code{:publishing-directory}
5201 @tab Directory (possibly remote) where output files will be published.
5202 @item @code{:preparation-function}
5203 @tab Function called before starting publishing process, for example to
5204 run @code{make} for updating files to be published.
5205 @end multitable
5206 @noindent
5207
5208 @node Selecting files, Publishing action, Sources and destinations, Configuration
5209 @subsection Selecting files
5210 @cindex files, selecting for publishing
5211
5212 By default, all files with extension @file{.org} in the base directory
5213 are considered part of the project. This can be modified by setting the
5214 properties
5215 @multitable @columnfractions 0.25 0.75
5216 @item @code{:base-extension}
5217 @tab Extension (without the dot!) of source files. This actually is a
5218 regular expression.
5219
5220 @item @code{:exclude}
5221 @tab Regular expression to match file names that should not be
5222 published, even though they have been selected on the basis of their
5223 extension.
5224
5225 @item @code{:include}
5226 @tab List of files to be included regardless of @code{:base-extension}
5227 and @code{:exclude}.
5228 @end multitable
5229
5230 @node Publishing action, Publishing options, Selecting files, Configuration
5231 @subsection Publishing Action
5232 @cindex action, for publishing
5233
5234 Publishing means that a file is copied to the destination directory and
5235 possibly transformed in the process. The default transformation is to
5236 export Org-mode files as HTML files, and this is done by the function
5237 @code{org-publish-org-to-html} which calls the HTML exporter
5238 (@pxref{HTML export}). Other files like images only need to be copied
5239 to the publishing destination. For non-Org-mode files, you need to
5240 specify the publishing function.
5241
5242 @multitable @columnfractions 0.3 0.7
5243 @item @code{:publishing-function}
5244 @tab Function executing the publication of a file. This may also be a
5245 list of functions, which will all be called in turn.
5246 @end multitable
5247
5248 The function must accept two arguments: a property list containing at
5249 least a @code{:publishing-directory} property, and the name of the file
5250 to be published. It should take the specified file, make the necessary
5251 transformation (if any) and place the result into the destination folder.
5252 You can write your own publishing function, but @code{org-publish}
5253 provides one for attachments (files that only need to be copied):
5254 @code{org-publish-attachment}.
5255
5256 @node Publishing options, Publishing links, Publishing action, Configuration
5257 @subsection Options for the HTML exporter
5258 @cindex options, for publishing
5259
5260 The property list can be used to set many export options for the HTML
5261 exporter. In most cases, these properties correspond to user variables
5262 in Org-mode. The table below lists these properties along with the
5263 variable they belong to. See the documentation string for the
5264 respective variable for details.
5265
5266 @multitable @columnfractions 0.3 0.7
5267 @item @code{:language} @tab @code{org-export-default-language}
5268 @item @code{:headline-levels} @tab @code{org-export-headline-levels}
5269 @item @code{:section-numbers} @tab @code{org-export-with-section-numbers}
5270 @item @code{:table-of-contents} @tab @code{org-export-with-toc}
5271 @item @code{:archived-trees} @tab @code{org-export-with-archived-trees}
5272 @item @code{:emphasize} @tab @code{org-export-with-emphasize}
5273 @item @code{:sub-superscript} @tab @code{org-export-with-sub-superscripts}
5274 @item @code{:TeX-macros} @tab @code{org-export-with-TeX-macros}
5275 @item @code{:LaTeX-fragments} @tab @code{org-export-with-LaTeX-fragments}
5276 @item @code{:fixed-width} @tab @code{org-export-with-fixed-width}
5277 @item @code{:timestamps} .@tab @code{org-export-with-timestamps}
5278 @item @code{:tags} .@tab @code{org-export-with-tags}
5279 @item @code{:tables} @tab @code{org-export-with-tables}
5280 @item @code{:table-auto-headline} @tab @code{org-export-highlight-first-table-line}
5281 @item @code{:style} @tab @code{org-export-html-style}
5282 @item @code{:convert-org-links} @tab @code{org-export-html-link-org-files-as-html}
5283 @item @code{:inline-images} @tab @code{org-export-html-inline-images}
5284 @item @code{:expand-quoted-html} @tab @code{org-export-html-expand}
5285 @item @code{:timestamp} @tab @code{org-export-html-with-timestamp}
5286 @item @code{:publishing-directory} @tab @code{org-export-publishing-directory}
5287 @item @code{:preamble} @tab @code{org-export-html-preamble}
5288 @item @code{:postamble} @tab @code{org-export-html-postamble}
5289 @item @code{:auto-preamble} @tab @code{org-export-html-auto-preamble}
5290 @item @code{:auto-postamble} @tab @code{org-export-html-auto-postamble}
5291 @item @code{:author} @tab @code{user-full-name}
5292 @item @code{:email} @tab @code{user-mail-address}
5293 @end multitable
5294
5295 When a property is given a value in org-publish-project-alist, its
5296 setting overrides the value of the corresponding user variable (if any)
5297 during publishing. options set within a file (@pxref{Export
5298 options}), however, override everything.
5299
5300 @node Publishing links, Project page index, Publishing options, Configuration
5301 @subsection Links between published files
5302 @cindex links, publishing
5303
5304 To create a link from one Org-mode file to another, you would use
5305 something like @samp{[[file:foo.org][The foo]]} or simply
5306 @samp{file:foo.org.} (@pxref{Hyperlinks}). Upon publishing this link
5307 becomes a link to @file{foo.html}. In this way, you can interlink the
5308 pages of your "org web" project and the links will work as expected when
5309 you publish them to HTML.
5310
5311 You may also link to related files, such as images. Provided you are
5312 careful with relative pathnames, and provided you have also configured
5313 org-publish to upload the related files, these links will work
5314 too. @ref{Complex example} for an example of this usage.
5315
5316 Sometime an Org-mode file to be published may contain links that are
5317 only valid in your production environment, but not in the publishing
5318 location. In this case, use the property
5319
5320 @multitable @columnfractions 0.4 0.6
5321 @item @code{:link-validation-function}
5322 @tab Function to validate links
5323 @end multitable
5324
5325 @noindent
5326 to define a function for checking link validity. This function must
5327 accept two arguments, the file name and a directory relative to which
5328 the file name is interpreted in the production environment. If this
5329 function returns @code{nil}, then the HTML generator will only insert a
5330 description into the HTML file, but no link. One option for this
5331 function is @code{org-publish-validate-link} which checks if the given
5332 file is part of any project in @code{org-publish-project-alist}.
5333
5334 @node Project page index, , Publishing links, Configuration
5335 @subsection Project page index
5336 @cindex index, of published pages
5337
5338 The following properties may be used to control publishing of an
5339 index of files or summary page for a given project.
5340
5341 @multitable @columnfractions 0.25 0.75
5342 @item @code{:auto-index}
5343 @tab When non-nil, publish an index during org-publish-current-project or
5344 org-publish-all.
5345
5346 @item @code{:index-filename}
5347 @tab Filename for output of index. Defaults to @file{index.org} (which
5348 becomes @file{index.html}).
5349
5350 @item @code{:index-title}
5351 @tab Title of index page. Defaults to name of file.
5352
5353 @item @code{:index-function}
5354 @tab Plugin function to use for generation of index.
5355 Defaults to @code{org-publish-org-index}, which generates a plain list
5356 of links to all files in the project.
5357 @end multitable
5358
5359 @node Sample configuration, Triggering publication, Configuration, Publishing
5360 @section Sample configuration
5361
5362 Below we provide two example configurations. The first one is a simple
5363 project publishing only a set of Org-mode files. The second example is
5364 more complex, with a multi-component project.
5365
5366 @menu
5367 * Simple example:: One-component publishing
5368 * Complex example:: A multi-component publishing example
5369 @end menu
5370
5371 @node Simple example, Complex example, Sample configuration, Sample configuration
5372 @subsection Example: simple publishing configuration
5373
5374 This example publishes a set of Org-mode files to the @file{public_html}
5375 directory on the local machine.
5376
5377 @lisp
5378 (setq org-publish-project-alist
5379 '(("org"
5380 :base-directory "~/org/"
5381 :publishing-directory "~/public_html"
5382 :section-numbers nil
5383 :table-of-contents nil
5384 :style "<link rel=stylesheet
5385 href=\"../other/mystyle.css\"
5386 type=\"text/css\">")))
5387 @end lisp
5388
5389 @node Complex example, , Simple example, Sample configuration
5390 @subsection Example: complex publishing configuration
5391
5392 This more complicated example publishes an entire website, including
5393 org files converted to HTML, image files, emacs lisp source code, and
5394 stylesheets. The publishing-directory is remote and private files are
5395 excluded.
5396
5397 To ensure that links are preserved, care should be taken to replicate
5398 your directory structure on the web server, and to use relative file
5399 paths. For example, if your org files are kept in @file{~/org} and your
5400 publishable images in @file{~/images}, you'd link to an image with
5401 @c
5402 @example
5403 file:../images/myimage.png
5404 @end example
5405 @c
5406 On the web server, the relative path to the image should be the
5407 same. You can accomplish this by setting up an "images" folder in the
5408 right place on the webserver, and publishing images to it.
5409
5410 @lisp
5411 (setq org-publish-project-alist
5412 '(("orgfiles"
5413 :base-directory "~/org/"
5414 :base-extension "org"
5415 :publishing-directory "/ssh:user@@host:~/html/notebook/"
5416 :publishing-function org-publish-org-to-html
5417 :exclude "PrivatePage.org" ;; regexp
5418 :headline-levels 3
5419 :section-numbers nil
5420 :table-of-contents nil
5421 :style "<link rel=stylesheet
5422 href=\"../other/mystyle.css\" type=\"text/css\">"
5423 :auto-preamble t
5424 :auto-postamble nil)
5425
5426 ("images"
5427 :base-directory "~/images/"
5428 :base-extension "jpg\\|gif\\|png"
5429 :publishing-directory "/ssh:user@@host:~/html/images/"
5430 :publishing-function org-publish-attachment)
5431
5432 ("other"
5433 :base-directory "~/other/"
5434 :base-extension "css\\|el"
5435 :publishing-directory "/ssh:user@@host:~/html/other/"
5436 :publishing-function org-publish-attachment)
5437 ("website" :components ("orgfiles" "images" "other"))))
5438 @end lisp
5439
5440 @node Triggering publication, , Sample configuration, Publishing
5441 @section Triggering publication
5442
5443 Once org-publish is properly configured, you can publish with the
5444 following functions:
5445
5446 @table @kbd
5447 @item C-c C-e c
5448 Prompt for a specific project and publish all files that belong to it.
5449 @item C-c C-e p
5450 Publish the project containing the current file.
5451 @item C-c C-e f
5452 Publish only the current file.
5453 @item C-c C-e a
5454 Publish all projects.
5455 @end table
5456
5457 Org uses timestamps to track when a file has changed. The above
5458 functions normally only publish changed files. You can override this and
5459 force publishing of all files by giving a prefix argument.
5460
5461 @node Miscellaneous, Extensions and Hacking, Publishing, Top
5462 @chapter Miscellaneous
5463
5464 @menu
5465 * Completion:: M-TAB knows what you need
5466 * Customization:: Adapting Org-mode to your taste
5467 * In-buffer settings:: Overview of the #+KEYWORDS
5468 * The very busy C-c C-c key:: When in doubt, press C-c C-c
5469 * Clean view:: Getting rid of leading stars in the outline
5470 * TTY keys:: Using Org-mode on a tty
5471 * Interaction:: Other Emacs packages
5472 * Bugs:: Things which do not work perfectly
5473 @end menu
5474
5475 @node Completion, Customization, Miscellaneous, Miscellaneous
5476 @section Completion
5477 @cindex completion, of @TeX{} symbols
5478 @cindex completion, of TODO keywords
5479 @cindex completion, of dictionary words
5480 @cindex completion, of option keywords
5481 @cindex completion, of tags
5482 @cindex completion, of link abbreviations
5483 @cindex @TeX{} symbol completion
5484 @cindex TODO keywords completion
5485 @cindex dictionary word completion
5486 @cindex option keyword completion
5487 @cindex tag completion
5488 @cindex link abbreviations, completion of
5489
5490 Org-mode supports in-buffer completion. This type of completion does
5491 not make use of the minibuffer. You simply type a few letters into
5492 the buffer and use the key to complete text right there.
5493
5494 @table @kbd
5495 @kindex M-@key{TAB}
5496 @item M-@key{TAB}
5497 Complete word at point
5498 @itemize @bullet
5499 @item
5500 At the beginning of a headline, complete TODO keywords.
5501 @item
5502 After @samp{\}, complete @TeX{} symbols supported by the exporter.
5503 @item
5504 After @samp{*}, complete headlines in the current buffer so that they
5505 can be used in search links like @samp{[[*find this headline]]}.
5506 @item
5507 After @samp{:}, complete tags. The list of tags is taken from the
5508 variable @code{org-tag-alist} (possibly set through the @samp{#+TAGS}
5509 in-buffer option, @pxref{Setting tags}), or it is created dynamically
5510 from all tags used in the current buffer.
5511 @item
5512 After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}).
5513 @item
5514 After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
5515 @samp{OPTIONS} which set file-specific options for Org-mode. When the
5516 option keyword is already complete, pressing @kbd{M-@key{TAB}} again
5517 will insert example settings for this keyword.
5518 @item
5519 In the line after @samp{#+STARTUP: }, complete startup keywords,
5520 i.e. valid keys for this line.
5521 @item
5522 Elsewhere, complete dictionary words using ispell.
5523 @end itemize
5524 @end table
5525
5526 @node Customization, In-buffer settings, Completion, Miscellaneous
5527 @section Customization
5528 @cindex customization
5529 @cindex options, for customization
5530 @cindex variables, for customization
5531
5532 There are more than 180 variables that can be used to customize
5533 Org-mode. For the sake of compactness of the manual, I am not
5534 describing the variables here. A structured overview of customization
5535 variables is available with @kbd{M-x org-customize}. Or select
5536 @code{Browse Org Group} from the @code{Org->Customization} menu. Many
5537 settings can also be activated on a per-file basis, by putting special
5538 lines into the buffer (@pxref{In-buffer settings}).
5539
5540 @node In-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
5541 @section Summary of in-buffer settings
5542 @cindex in-buffer settings
5543 @cindex special keywords
5544
5545 Org-mode uses special lines in the buffer to define settings on a
5546 per-file basis. These lines start with a @samp{#+} followed by a
5547 keyword, a colon, and then individual words defining a setting. Several
5548 setting words can be in the same line, but you can also have multiple
5549 lines for the keyword. While these settings are described throughout
5550 the manual, here is a summary. After changing any of those lines in the
5551 buffer, press @kbd{C-c C-c} with the cursor still in the line to
5552 activate the changes immediately. Otherwise they become effective only
5553 when the file is visited again in a new Emacs session.
5554
5555 @table @kbd
5556 @item #+STARTUP:
5557 This line sets options to be used at startup of org-mode, when an
5558 Org-mode file is being visited. The first set of options deals with the
5559 initial visibility of the outline tree. The corresponding variable for
5560 global default settings is @code{org-startup-folded}, with a default
5561 value @code{t}, which means @code{overview}.
5562 @cindex @code{overview}, STARTUP keyword
5563 @cindex @code{content}, STARTUP keyword
5564 @cindex @code{showall}, STARTUP keyword
5565 @example
5566 overview @r{top-level headlines only}
5567 content @r{all headlines}
5568 showall @r{no folding at all, show everything}
5569 @end example
5570 Then there are options for aligning tables upon visiting a file. This
5571 is useful in files containing narrowed table columns. The corresponding
5572 variable is @code{org-startup-align-all-tables}, with a default value
5573 @code{nil}.
5574 @cindex @code{align}, STARTUP keyword
5575 @cindex @code{noalign}, STARTUP keyword
5576 @example
5577 align @r{align all tables}
5578 noalign @r{don't align tables on startup}
5579 @end example
5580 Logging TODO state changes and clock intervals (variable
5581 @code{org-log-done}) can be configured using these options.
5582 @cindex @code{logdone}, STARTUP keyword
5583 @cindex @code{nologging}, STARTUP keyword
5584 @cindex @code{lognotedone}, STARTUP keyword
5585 @cindex @code{lognoteclock-out}, STARTUP keyword
5586 @cindex @code{lognotestate}, STARTUP keyword
5587 @example
5588 logging @r{record a timestamp when an item is marked DONE}
5589 nologging @r{don't record when items are marked DONE}
5590 lognotedone @r{record timestamp and a note when DONE}
5591 lognotestate @r{record timestamp, note when TODO state changes}
5592 lognoteclock-out @r{record timestamp and a note when clocking out}
5593 @end example
5594 Here are the options for hiding leading stars in outline headings. The
5595 corresponding variables are @code{org-hide-leading-stars} and
5596 @code{org-odd-levels-only}, both with a default setting @code{nil}
5597 (meaning @code{showstars} and @code{oddeven}).
5598 @cindex @code{hidestars}, STARTUP keyword
5599 @cindex @code{showstars}, STARTUP keyword
5600 @cindex @code{odd}, STARTUP keyword
5601 @cindex @code{even}, STARTUP keyword
5602 @example
5603 hidestars @r{make all but one of the stars starting a headline invisible.}
5604 showstars @r{show all stars starting a headline}
5605 odd @r{allow only odd outline levels (1,3,...)}
5606 oddeven @r{allow all outline levels}
5607 @end example
5608 To turn on custom format overlays over time stamps (variables
5609 @code{org-put-time-stamp-overlays} and
5610 @code{org-time-stamp-overlay-formats}), use
5611 @cindex @code{customtime}, STARTUP keyword
5612 @example
5613 customtime @r{overlay custom time format}
5614 @end example
5615 @item #+SEQ_TODO: #+TYP_TODO:
5616 These lines set the TODO keywords and their interpretation in the
5617 current file. The corresponding variables are @code{org-todo-keywords}
5618 and @code{org-todo-interpretation}.
5619 @item #+TAGS: TAG1(c1) TAG2(c2)
5620 These lines (several such lines are allowed) specify the legal tags in
5621 this file, and (potentially) the corresponding @emph{fast tag selection}
5622 keys. The corresponding variable is @code{org-tag-alist}.
5623 @item #+LINK: linkword replace
5624 These lines (several are allowed) specify link abbreviations.
5625 @xref{Link abbreviations}. The corresponding variable is
5626 @code{org-link-abbrev-alist}.
5627 @item #+CATEGORY:
5628 This line sets the category for the agenda file. The category applies
5629 for all subsequent lines until the next @samp{#+CATEGORY} line, or the
5630 end of the file. The first such line also applies to any entries before it.
5631 @item #+ARCHIVE: %s_done::
5632 This line sets the archive location for the agenda file. It applies for
5633 all subsequent lines until the next @samp{#+CATEGORY} line, or the end
5634 of the file. The first such line also applies to any entries before it.
5635 The corresponding variable is @code{org-archive-location}.
5636 @item #+TBLFM:
5637 This line contains the formulas for the table directly above the line.
5638 @item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS:
5639 These lines provide settings for exporting files. For more details see
5640 @ref{Export options}.
5641 @end table
5642
5643 @node The very busy C-c C-c key, Clean view, In-buffer settings, Miscellaneous
5644 @section The very busy C-c C-c key
5645 @kindex C-c C-c
5646 @cindex C-c C-c, overview
5647
5648 The key @kbd{C-c C-c} has many purposes in org-mode, which are all
5649 mentioned scattered throughout this manual. One specific function of
5650 this key is to add @emph{tags} to a headline (@pxref{Tags}). In many
5651 other circumstances it means something like @emph{Hey Org-mode, look
5652 here and update according to what you see here}. Here is a summary of
5653 what this means in different contexts.
5654
5655 @itemize @minus
5656 @item
5657 If there are highlights in the buffer from the creation of a sparse
5658 tree, or from clock display, remove these highlights.
5659 @item
5660 If the cursor is in one of the special @code{#+KEYWORD} lines, this
5661 triggers scanning the buffer for these lines and updating the
5662 information.
5663 @item
5664 If the cursor is inside a table, realign the table. This command
5665 works even if the automatic table editor has been turned off.
5666 @item
5667 If the cursor is on a @code{#+TBLFM} line, re-apply the formulas to
5668 the entire table.
5669 @item
5670 If the cursor is inside a table created by the @file{table.el} package,
5671 activate that table.
5672 @item
5673 If the current buffer is a remember buffer, close the note and file it.
5674 With a prefix argument, file it, without further interaction, to the
5675 default location.
5676 @item
5677 If the cursor is on a @code{<<<target>>>}, update radio targets and
5678 corresponding links in this buffer.
5679 @item
5680 If the cursor is in a plain list item with a checkbox, toggle the status
5681 of the checkbox.
5682 @item
5683 If the cursor is on a numbered item in a plain list, renumber the
5684 ordered list.
5685 @end itemize
5686
5687 @node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous
5688 @section A cleaner outline view
5689 @cindex hiding leading stars
5690 @cindex clean outline view
5691
5692 Some people find it noisy and distracting that the Org-mode headlines
5693 are starting with a potentially large number of stars. For example
5694 the tree from @ref{Headlines}:
5695
5696 @example
5697 * Top level headline
5698 ** Second level
5699 *** 3rd level
5700 some text
5701 *** 3rd level
5702 more text
5703 * Another top level headline
5704 @end example
5705
5706 @noindent
5707 Unfortunately this is deeply ingrained into the code of Org-mode and
5708 cannot be easily changed. You can, however, modify the display in such
5709 a way that all leading stars become invisible and the outline more easy
5710 to read. To do this, customize the variable
5711 @code{org-hide-leading-stars} like this:
5712
5713 @lisp
5714 (setq org-hide-leading-stars t)
5715 @end lisp
5716
5717 @noindent
5718 or change this on a per-file basis with one of the lines (anywhere in
5719 the buffer)
5720
5721 @example
5722 #+STARTUP: showstars
5723 #+STARTUP: hidestars
5724 @end example
5725
5726 @noindent
5727 Press @kbd{C-c C-c} with the cursor in a @samp{STARTUP} line to activate
5728 the modifications.
5729
5730 With stars hidden, the tree becomes:
5731
5732 @example
5733 * Top level headline
5734 * Second level
5735 * 3rd level
5736 some text
5737 * 3rd level
5738 more text
5739 * Another top level headline
5740 @end example
5741
5742 @noindent
5743 Note that the leading stars are not truly replaced by whitespace, they
5744 are only fontified with the face @code{org-hide} that uses the
5745 background color as font color. If you are not using either white or
5746 black background, you may have to customize this face to get the wanted
5747 effect. Another possibility is to set this font such that the extra
5748 stars are @i{almost} invisible, for example using the color
5749 @code{grey90} on a white background.
5750
5751 Things become cleaner still if you skip all the even levels and use only
5752 odd levels 1, 3, 5..., effectively adding two stars to go from one
5753 outline level to the next:
5754
5755 @example
5756 * Top level headline
5757 * Second level
5758 * 3rd level
5759 some text
5760 * 3rd level
5761 more text
5762 * Another top level headline
5763 @end example
5764
5765 @noindent
5766 In order to make the structure editing and export commands handle this
5767 convention correctly, use
5768
5769 @lisp
5770 (setq org-odd-levels-only t)
5771 @end lisp
5772
5773 @noindent
5774 or set this on a per-file basis with one of the following lines (don't
5775 forget to press @kbd{C-c C-c} with the cursor in the startup line to
5776 activate changes immediately).
5777
5778 @example
5779 #+STARTUP: odd
5780 #+STARTUP: oddeven
5781 @end example
5782
5783 You can convert an Org-mode file from single-star-per-level to the
5784 double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
5785 RET} in that file. The reverse operation is @kbd{M-x
5786 org-convert-to-oddeven-levels}.
5787
5788 @node TTY keys, Interaction, Clean view, Miscellaneous
5789 @section Using org-mode on a tty
5790 @cindex tty keybindings
5791
5792 Org-mode uses a number of keys that are not accessible on a tty. This
5793 applies to most special keys like cursor keys, @key{TAB} and
5794 @key{RET}, when these are combined with modifier keys like @key{Meta}
5795 and/or @key{Shift}. Org-mode uses these bindings because it needs to
5796 provide keys for a large number of commands, and because these keys
5797 appeared particularly easy to remember. In order to still be able to
5798 access the core functionality of Org-mode on a tty, alternative
5799 bindings are provided. Here is a complete list of these bindings,
5800 which are obviously more cumbersome to use. Note that sometimes a
5801 work-around can be better. For example changing a time stamp is
5802 really only fun with @kbd{S-@key{cursor}} keys. On a tty you would
5803 rather use @kbd{C-c .} to re-insert the timestamp.
5804
5805 @multitable @columnfractions 0.15 0.2 0.2
5806 @item @b{Default} @tab @b{Alternative 1} @tab @b{Alternative 2}
5807 @item @kbd{S-@key{TAB}} @tab @kbd{C-u @key{TAB}} @tab
5808 @item @kbd{M-@key{left}} @tab @kbd{C-c C-x l} @tab @kbd{@key{Esc} @key{left}}
5809 @item @kbd{M-S-@key{left}} @tab @kbd{C-c C-x L} @tab
5810 @item @kbd{M-@key{right}} @tab @kbd{C-c C-x r} @tab @kbd{@key{Esc} @key{right}}
5811 @item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R} @tab
5812 @item @kbd{M-@key{up}} @tab @kbd{C-c C-x u} @tab @kbd{@key{Esc} @key{up}}
5813 @item @kbd{M-S-@key{up}} @tab @kbd{C-c C-x U} @tab
5814 @item @kbd{M-@key{down}} @tab @kbd{C-c C-x d} @tab @kbd{@key{Esc} @key{down}}
5815 @item @kbd{M-S-@key{down}} @tab @kbd{C-c C-x D} @tab
5816 @item @kbd{S-@key{RET}} @tab @kbd{C-c C-x c} @tab
5817 @item @kbd{M-@key{RET}} @tab @kbd{C-c C-x m} @tab @kbd{@key{Esc} @key{RET}}
5818 @item @kbd{M-S-@key{RET}} @tab @kbd{C-c C-x M} @tab
5819 @item @kbd{S-@key{left}} @tab @kbd{C-c C-x @key{left}} @tab
5820 @item @kbd{S-@key{right}} @tab @kbd{C-c C-x @key{right}} @tab
5821 @item @kbd{S-@key{up}} @tab @kbd{C-c C-x @key{up}} @tab
5822 @item @kbd{S-@key{down}} @tab @kbd{C-c C-x @key{down}} @tab
5823 @end multitable
5824
5825 @node Interaction, Bugs, TTY keys, Miscellaneous
5826 @section Interaction with other packages
5827 @cindex packages, interaction with other
5828 Org-mode lives in the world of GNU Emacs and interacts in various ways
5829 with other code out there.
5830
5831 @menu
5832 * Cooperation:: Packages Org-mode cooperates with
5833 * Conflicts:: Packages that lead to conflicts
5834 @end menu
5835
5836 @node Cooperation, Conflicts, Interaction, Interaction
5837 @subsection Packages that Org-mode cooperates with
5838
5839 @table @asis
5840 @cindex @file{calc.el}
5841 @item @file{calc.el} by Dave Gillespie
5842 Org-mode uses the calc package for implementing spreadsheet
5843 functionality in its tables (@pxref{The spreadsheet}). Org-mode
5844 checks for the availability of calc by looking for the function
5845 @code{calc-eval} which should be autoloaded in your setup if calc has
5846 been installed properly. As of Emacs 22, calc is part of the Emacs
5847 distribution. Another possibility for interaction between the two
5848 packages is using calc for embedded calculations. @xref{Embedded Mode,
5849 , Embedded Mode, calc, GNU Emacs Calc Manual}.
5850 @cindex @file{constants.el}
5851 @item @file{constants.el} by Carsten Dominik
5852 In a table formula (@pxref{The spreadsheet}), it is possible to use
5853 names for natural constants or units. Instead of defining your own
5854 constants in the variable @code{org-table-formula-constants}, install
5855 the @file{constants} package which defines a large number of constants
5856 and units, and lets you use unit prefixes like @samp{M} for
5857 @samp{Mega} etc. You will need version 2.0 of this package, available
5858 at @url{http://www.astro.uva.nl/~dominik/Tools}. Org-mode checks for
5859 the function @code{constants-get}, which has to be autoloaded in your
5860 setup. See the installation instructions in the file
5861 @file{constants.el}.
5862 @item @file{cdlatex.el} by Carsten Dominik
5863 @cindex @file{cdlatex.el}
5864 Org-mode can make use of the cdlatex package to efficiently enter
5865 La@TeX{} fragments into Org-mode files. See @ref{CDLaTeX mode}.
5866 @item @file{remember.el} by John Wiegley
5867 @cindex @file{remember.el}
5868 Org mode cooperates with remember, see @ref{Remember}.
5869 @file{Remember.el} is not part of Emacs, find it on the web.
5870 @cindex @file{table.el}
5871 @item @file{table.el} by Takaaki Ota
5872 @kindex C-c C-c
5873 @cindex table editor, @file{table.el}
5874 @cindex @file{table.el}
5875
5876 Complex ASCII tables with automatic line wrapping, column- and
5877 row-spanning, and alignment can be created using the Emacs table
5878 package by Takaaki Ota (@uref{http://sourceforge.net/projects/table},
5879 and also part of Emacs 22).
5880 When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org-mode
5881 will call @command{table-recognize-table} and move the cursor into the
5882 table. Inside a table, the keymap of Org-mode is inactive. In order
5883 to execute Org-mode-related commands, leave the table.
5884
5885 @table @kbd
5886 @kindex C-c C-c
5887 @item C-c C-c
5888 Recognize @file{table.el} table. Works when the cursor is in a
5889 table.el table.
5890
5891 @kindex C-c ~
5892 @item C-c ~
5893 Insert a table.el table. If there is already a table at point, this
5894 command converts it between the table.el format and the Org-mode
5895 format. See the documentation string of the command
5896 @code{org-convert-table} for the restrictions under which this is
5897 possible.
5898 @end table
5899 @file{table.el} is part of Emacs 22.
5900 @end table
5901
5902 @node Conflicts, , Cooperation, Interaction
5903 @subsection Packages that lead to conflicts with Org-mode
5904
5905 @table @asis
5906
5907 @cindex @file{allout.el}
5908 @item @file{allout.el} by Ken Manheimer
5909 Startup of Org-mode may fail with the error message
5910 @code{(wrong-type-argument keymapp nil)} when there is an outdated
5911 version @file{allout.el} on the load path, for example the version
5912 distributed with Emacs 21.x. Upgrade to Emacs 22 and this problem will
5913 disappear. If for some reason you cannot do this, make sure that org.el
5914 is loaded @emph{before} @file{allout.el}, for example by putting
5915 @code{(require 'org)} early enough into your @file{.emacs} file.
5916
5917 @cindex @file{CUA.el}
5918 @item @file{CUA.el} by Kim. F. Storm
5919 Keybindings in Org-mode conflict with the @kbd{S-<cursor>} keys
5920 used by CUA-mode (as well as pc-select-mode and s-region-mode) to
5921 select and extend the region. If you want to use one of these
5922 packages along with Org-mode, configure the variable
5923 @code{org-CUA-compatible}. When set, Org-mode will move the following
5924 keybindings in org-mode files, and in the agenda buffer (but not
5925 during date selection).
5926
5927 @example
5928 S-UP -> M-p S-DOWN -> M-n
5929 S-LEFT -> M-- S-RIGHT -> M-+
5930 S-RET -> C-S-RET
5931 @end example
5932
5933 Yes, these are unfortunately more difficult to remember. If you want
5934 to have other replacement keys, look at the variable
5935 @code{org-disputed-keys}.
5936 @item @file{windmove.el} by Hovav Shacham
5937 @cindex @file{windmove.el}
5938 Also this package uses the @kbd{S-<cursor>} keys, so everything written
5939 in the paragraph above about CUA mode also applies here.
5940 @end table
5941
5942
5943 @node Bugs, , Interaction, Miscellaneous
5944 @section Bugs
5945 @cindex bugs
5946
5947 Here is a list of things that should work differently, but which I
5948 have found too hard to fix.
5949
5950 @itemize @bullet
5951 @item
5952 If a table field starts with a link, and if the corresponding table
5953 column is narrowed (@pxref{Narrow columns}) to a width too small to
5954 display the link, the field would look entirely empty even though it is
5955 not. To prevent this, Org-mode throws an error. The work-around is to
5956 make the column wide enough to fit the link, or to add some text (at
5957 least 2 characters) before the link in the same field.
5958 @item
5959 Narrowing table columns does not work on XEmacs, because the
5960 @code{format} function does not transport text properties.
5961 @item
5962 Text in an entry protected with the @samp{QUOTE} keyword should not
5963 autowrap.
5964 @item
5965 When the application called by @kbd{C-c C-o} to open a file link fails
5966 (for example because the application does not exist or refuses to open
5967 the file), it does so silently. No error message is displayed.
5968 @item
5969 Recalculating a table line applies the formulas from left to right.
5970 If a formula uses @emph{calculated} fields further down the row,
5971 multiple recalculation may be needed to get all fields consistent. You
5972 may use the command @code{org-table-iterate} (@kbd{C-u C-c *}) to
5973 recalculate until convergence.
5974 @item
5975 A single letter cannot be made bold, for example @samp{*a*}.
5976 @item
5977 The exporters work well, but could be made more efficient.
5978 @end itemize
5979
5980
5981 @node Extensions and Hacking, History and Acknowledgments, Miscellaneous, Top
5982 @appendix Extensions, Hooks and Hacking
5983
5984 This appendix lists extensions for Org-mode written by other authors.
5985 It also covers some aspects where users can extend the functionality of
5986 Org-mode.
5987
5988 @menu
5989 * Extensions:: Existing 3rd-part extensions
5990 * Tables in arbitrary syntax:: Orgtbl for LaTeX and other programs
5991 * Dynamic blocks:: Automatically filled blocks
5992 * Special agenda views:: Customized views
5993 @end menu
5994
5995 @node Extensions, Tables in arbitrary syntax, Extensions and Hacking, Extensions and Hacking
5996 @section Third-party extensions for Org-mode
5997 @cindex extension, third-party
5998
5999 The following extensions for Org-mode have been written by other people:
6000
6001 @table @asis
6002 @cindex @file{org-publish.el}
6003 @item @file{org-publish.el} by David O'Toole
6004 This package provides facilities for publishing related sets of Org-mode
6005 files together with linked files like images as webpages. It is
6006 highly configurable and can be used for other publishing purposes as
6007 well. As of Org-mode version 4.30, @file{org-publish.el} is part of the
6008 Org-mode distribution. It is not yet part of Emacs, however, a delay
6009 caused by the preparations for the 22.1 release. In the mean time,
6010 @file{org-publish.el} can be downloaded from David's site:
6011 @url{http://dto.freeshell.org/e/org-publish.el}.
6012 @cindex @file{org-mouse.el}
6013 @item @file{org-mouse.el} by Piotr Zielinski
6014 This package implements extended mouse functionality for Org-mode. It
6015 allows you to cycle visibility and to edit the document structure with
6016 the mouse. Best of all, it provides a context-sensitive menu on
6017 @key{mouse-3} that changes depending on the context of a mouse-click.
6018 As of Org-mode version 4.53, @file{org-mouse.el} is part of the
6019 Org-mode distribution. It is not yet part of Emacs, however, a delay
6020 caused by the preparations for the 22.1 release. In the mean time,
6021 @file{org-mouse.el} can be downloaded from Piotr's site:
6022 @url{http://www.cl.cam.ac.uk/~pz215/files/org-mouse.el}.
6023 @cindex @file{org-blog.el}
6024 @item @file{org-blog.el} by David O'Toole
6025 A blogging plug-in for @file{org-publish.el}.@*
6026 @url{http://dto.freeshell.org/notebook/OrgMode.html}.
6027 @cindex @file{blorg.el}
6028 @item @file{blorg.el} by Bastien Guerry
6029 Publish Org-mode files as
6030 blogs. @url{http://www.cognition.ens.fr/~guerry/blorg.html}.
6031 @cindex @file{org2rem.el}
6032 @item @file{org2rem.el} by Bastien Guerry
6033 Translates Org-mode files into something readable by
6034 Remind. @url{http://www.cognition.ens.fr/~guerry/u/org2rem.el}.
6035 @end table
6036
6037 @page
6038
6039 @node Tables in arbitrary syntax, Dynamic blocks, Extensions, Extensions and Hacking
6040 @section Tables in arbitrary syntax
6041 @cindex tables, in other modes
6042 @cindex orgtbl-mode
6043
6044 Since Orgtbl-mode can be used as a minor mode in arbitrary buffers, a
6045 frequent feature request has been to make it work with native tables in
6046 specific languages, for example LaTeX. However, this is extremely hard
6047 to do in a general way, would lead to a customization nightmare, and
6048 would take away much of the simplicity of the Orgtbl-mode table editor.
6049
6050 This appendix describes a different approach. We keep the Orgtbl-mode
6051 table in its native format (the @i{source table}), and use a custom
6052 function to @i{translate} the table to the correct syntax, and to
6053 @i{install} it in the right location (the @i{target table}). This puts
6054 the burden of writing conversion functions on the user, but it allows
6055 for a very flexible system.
6056
6057 @menu
6058 * Radio tables:: Sending and receiving
6059 * A LaTeX example:: Step by step, almost a tutorial
6060 * Translator functions:: Copy and modify
6061 @end menu
6062
6063 @node Radio tables, A LaTeX example, Tables in arbitrary syntax, Tables in arbitrary syntax
6064 @subsection Radio tables
6065 @cindex radio tables
6066
6067 To define the location of the target table, you first need to create two
6068 lines that are comments in the current mode, but contain magic words for
6069 Orgtbl-mode to find. Orgtbl-mode will insert the translated table
6070 between these lines, replacing whatever was there before. For example:
6071
6072 @example
6073 /* BEGIN RECEIVE ORGTBL table_name */
6074 /* END RECEIVE ORGTBL table_name */
6075 @end example
6076
6077 @noindent
6078 Just above the source table, we put a special line that tells
6079 Orgtbl-mode how to translate this table and where to install it. For
6080 example:
6081 @example
6082 #+ORGTBL: SEND table_name translation_function arguments....
6083 @end example
6084
6085 @noindent
6086 @code{table_name} is the reference name for the table that is also used
6087 in the receiver lines. @code{translation_function} is the Lisp function
6088 that does the translation. Furthermore, the line can contain a list of
6089 arguments (alternating key and value) at the end. The arguments will be
6090 passed as a property list to the translation function for
6091 interpretation. A few standard parameters are already recognized and
6092 acted upon before the translation function is called:
6093
6094 @table @code
6095 @item :skip N
6096 Skip the first N lines of the table. Hlines do count!
6097 @item :skipcols (n1 n2 ...)
6098 List of columns that should be skipped. If the table has a column with
6099 calculation marks, that column is automatically discarded as well.
6100 Please note that the translator function sees the table @emph{after} the
6101 removal of these columns, the function never knows that there have been
6102 additional columns.
6103 @end table
6104
6105 @noindent
6106 The one problem remaining is how to keep the source table in the buffer
6107 without disturbing the normal workings of the file, for example during
6108 compilation of a C file or processing of a LaTeX file. There are a
6109 number of different solutions:
6110
6111 @itemize @bullet
6112 @item
6113 The table could be placed in a block comment if that is supported by the
6114 language. For example, in C-mode you could wrap the table between
6115 @samp{/*} and @samp{*/} lines.
6116 @item
6117 Sometimes it is possible to put the table after some kind of @i{END}
6118 statement, for example @samp{\bye} in TeX and @samp{\end@{document@}}
6119 in LaTeX.
6120 @item
6121 You can just comment the table line by line whenever you want to process
6122 the file, and uncomment it whenever you need to edit the table. This
6123 only sounds tedious - the command @kbd{M-x orgtbl-toggle-comment} does
6124 make this comment-toggling very easy, in particular if you bind it to a
6125 key.
6126 @end itemize
6127
6128 @node A LaTeX example, Translator functions, Radio tables, Tables in arbitrary syntax
6129 @subsection A LaTeX example
6130 @cindex LaTeX, and orgtbl-mode
6131
6132 The best way to wrap the source table in LaTeX is to use the
6133 @code{comment} environment provided by @file{comment.sty}. It has to be
6134 activated by placing @code{\usepackage@{comment@}} into the document
6135 header. Orgtbl-mode can insert a radio table skeleton@footnote{By
6136 default this works only for LaTeX, HTML, and TeXInfo. Configure the
6137 variable @code{orgtbl-radio-tables} to install templates for other
6138 modes.} with the command @kbd{M-x orgtbl-insert-radio-table}. You will
6139 be prompted for a table name, lets say we use @samp{salesfigures}. You
6140 will then get the following template:
6141
6142 @example
6143 % BEGIN RECEIVE ORGTBL salesfigures
6144 % END RECEIVE ORGTBL salesfigures
6145 \begin@{comment@}
6146 #+ORGTBL: SEND salesfigures orgtbl-to-latex
6147 | | |
6148 \end@{comment@}
6149 @end example
6150
6151 @noindent
6152 The @code{#+ORGTBL: SEND} line tells orgtbl-mode to use the function
6153 @code{orgtbl-to-latex} to convert the table into LaTeX and to put it
6154 into the receiver location with name @code{salesfigures}. You may now
6155 fill in the table, feel free to use the spreadsheet features@footnote{If
6156 the @samp{#+TBLFM} line contains an odd number of dollar characters,
6157 this may cause problems with font-lock in latex-mode. As shown in the
6158 example you can fix this by adding an extra line inside the
6159 @code{comment} environment that is used to balance the dollar
6160 expressions. If you are using AUCTeX with the font-latex library, a
6161 much better solution is to add the @code{comment} environment to the
6162 variable @code{LaTeX-verbatim-environments}.}:
6163
6164 @example
6165 % BEGIN RECEIVE ORGTBL salesfigures
6166 % END RECEIVE ORGTBL salesfigures
6167 \begin@{comment@}
6168 #+ORGTBL: SEND salesfigures orgtbl-to-latex
6169 | Month | Days | Nr sold | per day |
6170 |-------+------+---------+---------|
6171 | Jan | 23 | 55 | 2.4 |
6172 | Feb | 21 | 16 | 0.8 |
6173 | March | 22 | 278 | 12.6 |
6174 #+TBLFM: $4=$3/$2;%.1f
6175 % $ (optional extra dollar to keep font-lock happy, see footnote)
6176 \end@{comment@}
6177 @end example
6178
6179 @noindent
6180 When you are done, press @kbd{C-c C-c} in the table to get the converted
6181 table inserted between the two marker lines.
6182
6183 Now lets assume you want to make the table header by hand, because you
6184 want to control how columns are aligned etc. In this case we make sure
6185 that the table translator does skip the first 2 lines of the source
6186 table, and tell the command to work as a @i{splice}, i.e. to not produce
6187 header and footer commands of the target table:
6188
6189 @example
6190 \begin@{tabular@}@{lrrr@}
6191 Month & \multicolumn@{1@}@{c@}@{Days@} & Nr.\ sold & per day\\
6192 % BEGIN RECEIVE ORGTBL salesfigures
6193 % END RECEIVE ORGTBL salesfigures
6194 \end@{tabular@}
6195 %
6196 \begin@{comment@}
6197 #+ORGTBL: SEND salesfigures orgtbl-to-latex :splice t :skip 2
6198 | Month | Days | Nr sold | per day |
6199 |-------+------+---------+---------|
6200 | Jan | 23 | 55 | 2.4 |
6201 | Feb | 21 | 16 | 0.8 |
6202 | March | 22 | 278 | 12.6 |
6203 #+TBLFM: $4=$3/$2;%.1f
6204 \end@{comment@}
6205 @end example
6206
6207 The LaTeX translator function @code{orgtbl-to-latex} is already part of
6208 Orgtbl-mode. It uses a @code{tabular} environment to typeset the table
6209 and marks horizontal lines with @code{\hline}. Furthermore, it
6210 interprets the following parameters:
6211
6212 @table @code
6213 @item :splice nil/t
6214 When set to t, return only table body lines, don't wrap them into a
6215 tabular environment. Default is nil.
6216
6217 @item :fmt fmt
6218 A format to be used to wrap each field, should contain @code{%s} for the
6219 original field value. For example, to wrap each field value in dollars,
6220 you could use @code{:fmt "$%s$"}. This may also be a property list with
6221 column numbers and formats. for example @code{:fmt (2 "$%s$" 4 "%s\\%%")}.
6222
6223 @item :efmt efmt
6224 Use this format to print numbers with exponentials. The format should
6225 have @code{%s} twice for inserting mantissa and exponent, for example
6226 @code{"%s\\times10^@{%s@}"}. The default is @code{"%s\\,(%s)"}. This
6227 may also be a property list with column numbers and formats, for example
6228 @code{:efmt (2 "$%s\\times10^@{%s@}$" 4 "$%s\\cdot10^@{%s@}$")}. After
6229 @code{efmt} has been applied to a value, @code{fmt} will also be
6230 applied.
6231 @end table
6232
6233 @node Translator functions, , A LaTeX example, Tables in arbitrary syntax
6234 @subsection Translator functions
6235 @cindex HTML, and orgtbl-mode
6236 @cindex translator function
6237
6238 Orgtbl-mode has several translator functions built-in:
6239 @code{orgtbl-to-latex}, @code{orgtbl-to-html}, and
6240 @code{orgtbl-to-texinfo}. Except for @code{orgtbl-to-html}@footnote{The
6241 HTML translator uses the same code that produces tables during HTML
6242 export.}, these all use a generic translator, @code{orgtbl-to-generic}.
6243 For example, @code{orgtbl-to-latex} itself is a very short function that
6244 computes the column definitions for the @code{tabular} environment,
6245 defines a few field and line separators and then hands over to the
6246 generic translator. Here is the entire code:
6247
6248 @lisp
6249 @group
6250 (defun orgtbl-to-latex (table params)
6251 "Convert the orgtbl-mode TABLE to LaTeX."
6252 (let* ((alignment (mapconcat (lambda (x) (if x "r" "l"))
6253 org-table-last-alignment ""))
6254 (params2
6255 (list
6256 :tstart (concat "\\begin@{tabular@}@{" alignment "@}")
6257 :tend "\\end@{tabular@}"
6258 :lstart "" :lend " \\\\" :sep " & "
6259 :efmt "%s\\,(%s)" :hline "\\hline")))
6260 (orgtbl-to-generic table (org-combine-plists params2 params))))
6261 @end group
6262 @end lisp
6263
6264 As you can see, the properties passed into the function (variable
6265 @var{PARAMS}) are combined with the ones newly defined in the function
6266 (variable @var{PARAMS2}). The ones passed into the function (i.e. the
6267 ones set by the @samp{ORGTBL SEND} line) take precedence. So if you
6268 would like to use the LaTeX translator, but wanted the line endings to
6269 be @samp{\\[2mm]} instead of the default @samp{\\}, you could just
6270 overrule the default with
6271
6272 @example
6273 #+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]"
6274 @end example
6275
6276 For a new language, you can either write your own converter function in
6277 analogy with the LaTeX translator, or you can use the generic function
6278 directly. For example, if you have a language where a table is started
6279 with @samp{!BTBL!}, ended with @samp{!ETBL!}, and where table lines are
6280 started with @samp{!BL!}, ended with @samp{!EL!} and where the field
6281 separator is a TAB, you could call the generic translator like this (on
6282 a single line!):
6283
6284 @example
6285 #+ORGTBL: SEND test orgtbl-to-generic :tstart "!BTBL!" :tend "!ETBL!"
6286 :lstart "!BL! " :lend " !EL!" :sep "\t"
6287 @end example
6288
6289 @noindent
6290 Please check the documentation string of the function
6291 @code{orgtbl-to-generic} for a full list of parameters understood by
6292 that function and remember that you can pass each of them into
6293 @code{orgtbl-to-latex}, @code{orgtbl-to-texinfo}, and any other function
6294 using the generic function.
6295
6296 Of course you can also write a completely new function doing complicated
6297 things the generic translator cannot do. A translator function takes
6298 two arguments. The first argument is the table, a list of lines, each
6299 line either the symbol @code{hline} or a list of fields. The second
6300 argument is the property list containing all parameters specified in the
6301 @samp{#+ORGTBL: SEND} line. The function must return a single string
6302 containing the formatted table. If you write a generally useful
6303 translator, please post it on @code{emacs-orgmode@@gnu.org} so that
6304 others can benefit from your work.
6305
6306 @node Dynamic blocks, Special agenda views, Tables in arbitrary syntax, Extensions and Hacking
6307 @section Dynamic blocks
6308 @cindex dynamic blocks
6309
6310 Org-mode documents can contain @emph{dynamic blocks}. These are
6311 specially marked regions that are updated by some user-written function.
6312 A good example for such a block is the clock table inserted by the
6313 command @kbd{C-c C-x C-r} (@pxref{Clocking work time}).
6314
6315 Dynamic block are enclosed by a BEGIN-END structure that assigns a name
6316 to the block and can also specify parameters for the function producing
6317 the content of the block.
6318
6319 @example
6320 #+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
6321
6322 #+END:
6323 @end example
6324
6325 Dynamic blocks are updated with the following commands
6326
6327 @table @kbd
6328 @kindex C-c C-x C-u
6329 @item C-c C-x C-u
6330 Update dynamic block at point.
6331 @kindex C-u C-c C-x C-u
6332 @item C-u C-c C-x C-u
6333 Update all dynamic blocks in the current file.
6334 @end table
6335
6336 Updating a dynamic block means to remove all the text between BEGIN and
6337 END, parse the BEGIN line for parameters and then call the specific
6338 writer function for this block to insert the new content. For a block
6339 with name @code{myblock}, the writer function is
6340 @code{org-dblock-write:myblock} with as only parameter a property list
6341 with the parameters given in the begin line. Here is a trivial example
6342 of a block that keeps track of when the block update function was last
6343 run:
6344
6345 @example
6346 #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
6347
6348 #+END:
6349 @end example
6350
6351 @noindent
6352 The corresponding block writer function could look like this:
6353
6354 @lisp
6355 (defun org-dblock-write:block-update-time (params)
6356 (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
6357 (insert "Last block update at: "
6358 (format-time-string fmt (current-time)))))
6359 @end lisp
6360
6361 If you want to make sure that all dynamic blocks are always up-to-date,
6362 you could add the function @code{org-update-all-dblocks} to a hook, for
6363 example @code{before-save-hook}. @code{org-update-all-dblocks} is
6364 written in a way that is does nothing in buffers that are not in Org-mode.
6365
6366 @node Special agenda views, , Dynamic blocks, Extensions and Hacking
6367 @section Special Agenda Views
6368 @cindex agenda views, user-defined
6369
6370 Org-mode provides a special hook that can be used to narrow down the
6371 selection made by any of the agenda views. You may specify a function
6372 that is used at each match to verify if the match should indeed be part
6373 of the agenda view, and if not, how much should be skipped.
6374
6375 Let's say you want to produce a list of projects that contain a WAITING
6376 tag anywhere in the project tree. Let's further assume that you have
6377 marked all tree headings that define a project with the todo keyword
6378 PROJECT. In this case you would run a todo search for the keyword
6379 PROJECT, but skip the match unless there is a WAITING tag anywhere in
6380 the subtree belonging to the project line.
6381
6382 To achieve this, you must write a function that searches the subtree for
6383 the tag. If the tag is found, the function must return @code{nil} to
6384 indicate that this match should not be skipped. If there is no such
6385 tag, return the location of the end of the subtree, to indicate that
6386 search should continue from there.
6387
6388 @lisp
6389 (defun my-skip-unless-waiting ()
6390 "Skip trees that are not waiting"
6391 (let ((subtree-end (save-excursion (org-end-of-subtree t))))
6392 (if (re-search-forward ":WAITING:" subtree-end t)
6393 nil ; tag found, do not skip
6394 subtree-end))) ; tag not found, continue after end of subtree
6395 @end lisp
6396
6397 Furthermore you must write a command that uses @code{let} to temporarily
6398 put this function into the variable @code{org-agenda-skip-function},
6399 sets the header string for the agenda buffer, and calls the todo-list
6400 generator while asking for the specific TODO keyword PROJECT. The
6401 function must also accept one argument MATCH, but it can choose to
6402 ignore it@footnote{MATCH must be present in case you want to define a
6403 custom command for producing this special list. Custom commands always
6404 supply the MATCH argument, but it can be empty if you do not specify it
6405 while defining the command(@pxref{Custom agenda
6406 views}).} (as we do in the example below). Here is the example:
6407
6408 @lisp
6409 (defun my-org-waiting-projects (&optional match)
6410 "Produce a list of projects that contain a WAITING tag.
6411 MATCH is being ignored."
6412 (interactive)
6413 (let ((org-agenda-skip-function 'my-skip-unless-waiting)
6414 (org-agenda-overriding-header "Projects waiting for something: "))
6415 ;; make the list
6416 (org-todo-list "PROJECT")))
6417 @end lisp
6418
6419
6420 @node History and Acknowledgments, GNU Free Documentation License, Extensions and Hacking, Top
6421 @appendix History and Acknowledgments
6422 @cindex acknowledgments
6423 @cindex history
6424 @cindex thanks
6425
6426 Org-mode was borne in 2003, out of frustration over the user interface
6427 of the Emacs outline-mode. I was trying to organize my notes and
6428 projects, and using Emacs seemed to be the natural way to go. However,
6429 having to remember eleven different commands with two or three keys per
6430 command, only to hide and unhide parts of the outline tree, that seemed
6431 entirely unacceptable to me. Also, when using outlines to take notes, I
6432 constantly want to restructure the tree, organizing it parallel to my
6433 thoughts and plans. @emph{Visibility cycling} and @emph{structure
6434 editing} were originally implemented in the package
6435 @file{outline-magic.el}, but quickly moved to the more general
6436 @file{org.el}. As this environment became comfortable for project
6437 planning, the next step was adding @emph{TODO entries}, basic @emph{time
6438 stamps}, and @emph{table support}. These areas highlight the two main
6439 goals that Org-mode still has today: To create a new, outline-based,
6440 plain text mode with innovative and intuitive editing features, and to
6441 incorporate project planning functionality directly into a notes file.
6442
6443 Since the first release, hundreds of emails to me or on
6444 @code{emacs-orgmode@@gnu.org} have provided a constant stream of bug
6445 reports, feedback, new ideas, and sometimes patches and add-on code.
6446 Many thanks to everyone who has helped to improve this package. I am
6447 trying to keep here a list of the people who had significant influence
6448 in shaping one or more aspects of Org-mode. The list may not be
6449 complete, if I have forgotten someone, please accept my apologies and
6450 let me know.
6451
6452 @itemize @bullet
6453
6454 @item
6455 @i{Thomas Baumann} contributed the code for links to the MH-E email
6456 system.
6457 @item
6458 @i{Alex Bochannek} provided a patch for rounding time stamps.
6459 @item
6460 @i{Charles Cave}'s suggestion sparked the implementation of templates
6461 for Remember.
6462 @item
6463 @i{Pavel Chalmoviansky} influenced the agenda treatment of items with
6464 specified time.
6465 @item
6466 @i{Gregory Chernov} patched support for lisp forms into table
6467 calculations and improved XEmacs compatibility, in particular by porting
6468 @file{nouline.el} to XEmacs.
6469 @item
6470 @i{Sacha Chua} suggested to copy some linking code from Planner.
6471 @item
6472 @i{Eddward DeVilla} proposed and tested checkbox statistics.
6473 @item
6474 @i{Kees Dullemond} used to edit projects lists directly in HTML and so
6475 inspired some of the early development, including HTML export. He also
6476 asked for a way to narrow wide table columns.
6477 @item
6478 @i{Christian Egli} converted the documentation into TeXInfo format,
6479 patched CSS formatting into the HTML exporter, and inspired the agenda.
6480 @item
6481 @i{Nic Ferrier} contributed mailcap and XOXO support.
6482 @item
6483 @i{John Foerch} figured out how to make incremental search show context
6484 around a match in a hidden outline tree.
6485 @item
6486 @i{Niels Giessen} had the idea to automatically archive DONE trees.
6487 @item
6488 @i{Bastien Guerry} provided extensive feedback and some patches, and
6489 translated David O'Toole's tutorial into French.
6490 @item
6491 @i{Kai Grossjohann} pointed out key-binding conflicts with other packages.
6492 @item
6493 @i{Shidai Liu} (``Leo'') provided extensive feedback and some patches.
6494 @item
6495 @i{Leon Liu} asked for embedded LaTeX and tested it.
6496 @item
6497 @i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler
6498 happy.
6499 @item
6500 @i{Todd Neal} provided patches for links to Info files and elisp forms.
6501 @item
6502 @i{Tim O'Callaghan} suggested in-file links, search options for general
6503 file links, and TAGS.
6504 @item
6505 @i{Takeshi Okano} translated the manual and David O'Toole's tutorial
6506 into Japanese.
6507 @item
6508 @i{Oliver Oppitz} suggested multi-state TODO items.
6509 @item
6510 @i{Scott Otterson} sparked the introduction of descriptive text for
6511 links, among other things.
6512 @item
6513 @i{Pete Phillips} helped during the development of the TAGS feature, and
6514 provided frequent feedback.
6515 @item
6516 @i{T.V. Raman} reported bugs and suggested improvements.
6517 @item
6518 @i{Matthias Rempe} (Oelde) provided ideas, Windows support, and quality
6519 control.
6520 @item
6521 @i{Kevin Rogers} contributed code to access VM files on remote hosts.
6522 @item
6523 @i{Frank Ruell} solved the mystery of the @code{keymapp nil} bug, a
6524 conflict with @file{allout.el}.
6525 @item
6526 @i{Jason Riedy} sent a patch to fix a bug with export of TODO keywords.
6527 @item
6528 @i{Philip Rooke} created the Org-mode reference card and provided lots
6529 of feedback.
6530 @item
6531 @i{Christian Schlauer} proposed angular brackets around links, among
6532 other things.
6533 @item
6534 Linking to VM/BBDB/GNUS was inspired by @i{Tom Shannon}'s
6535 @file{organizer-mode.el}.
6536 @item
6537 @i{Daniel Sinder} came up with the idea of internal archiving by locking
6538 subtrees.
6539 @item
6540 @i{Dale Smith} proposed link abbreviations.
6541 @item
6542 @i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
6543 chapter about publishing.
6544 @item
6545 @i{J@"urgen Vollmer} contributed code generating the table of contents
6546 in HTML output.
6547 @item
6548 @i{Chris Wallace} provided a patch implementing the @samp{QUOTE}
6549 keyword.
6550 @item
6551 @i{David Wainberg} suggested archiving, and improvements to the linking
6552 system.
6553 @item
6554 @i{John Wiegley} wrote @file{emacs-wiki.el} and @file{planner.el}. The
6555 development of Org-mode was fully independent, and both systems are
6556 really different beasts in their basic ideas and implementation details.
6557 I later looked at John's code, however, and learned from his
6558 implementation of (i) links where the link itself is hidden and only a
6559 description is shown, and (ii) popping up a calendar to select a date.
6560 @item
6561 @i{Carsten Wimmer} suggested some changes and helped fix a bug in
6562 linking to GNUS.
6563 @item
6564 @i{Roland Winkler} requested additional keybindings to make Org-mode
6565 work on a tty.
6566 @item
6567 @i{Piotr Zielinski} wrote @file{org-mouse.el}, proposed agenda blocks
6568 and contributed various ideas and code snippets.
6569 @end itemize
6570
6571 @node GNU Free Documentation License, Index, History and Acknowledgments, Top
6572 @appendix GNU Free Documentation License
6573 @include doclicense.texi
6574
6575
6576 @node Index, Key Index, GNU Free Documentation License, Top
6577 @unnumbered Index
6578
6579 @printindex cp
6580
6581 @node Key Index, , Index, Top
6582 @unnumbered Key Index
6583
6584 @printindex ky
6585
6586 @bye
6587
6588 @ignore
6589 arch-tag: 7893d1fe-cc57-4d13-b5e5-f494a1bcc7ac
6590 @end ignore