3 @setfilename ../../info/org
4 @settitle The Org Manual
11 * Org Mode: (org). Outline-based notes management and organizer
14 @c Version and Contact Info
15 @set MAINTAINERSITE @uref{http://orgmode.org,maintainers webpage}
16 @set AUTHOR Carsten Dominik
17 @set MAINTAINER Carsten Dominik
18 @set MAINTAINEREMAIL @email{carsten at orgmode dot org}
19 @set MAINTAINERCONTACT @uref{mailto:carsten at orgmode dot org,contact the maintainer}
25 @c Subheadings inside a table.
26 @macro tsubheading{text}
36 This manual is for Org (version @value{VERSION}).
38 Copyright @copyright{} 2004, 2005, 2006, 2007, 2008 Free Software Foundation
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
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.''
58 @subtitle Release @value{VERSION}
59 @author by Carsten Dominik
61 @c The following two commands start the copyright page.
63 @vskip 0pt plus 1filll
67 @c Output the table of contents at the beginning.
71 @node Top, Introduction, (dir), (dir)
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 * Tags:: Tagging headlines and matching sets of tags
84 * Properties and Columns:: Storing information about an entry
85 * Dates and Times:: Making items useful for planning
86 * Remember:: Quickly adding nodes to the outline tree
87 * Agenda Views:: Collecting information into views
88 * Embedded LaTeX:: LaTeX fragments and formulas
89 * Exporting:: Sharing and publishing of notes
90 * Publishing:: Create a web site of linked Org files
91 * Miscellaneous:: All the rest which did not fit elsewhere
92 * Extensions and Hacking:: It is possible to write add-on code
93 * History and Acknowledgments:: How Org came into being
94 * Main Index:: An index of Org's concepts and features
95 * Key Index:: Key bindings and where they are described
98 --- The Detailed Node Listing ---
102 * Summary:: Brief summary of what Org does
103 * Installation:: How to install a downloaded version of Org
104 * Activation:: How to activate Org for certain buffers
105 * Feedback:: Bug reports, ideas, patches etc.
106 * Conventions:: Type-setting conventions in the manual
110 * Outlines:: Org is based on Outline mode
111 * Headlines:: How to typeset Org tree headlines
112 * Visibility cycling:: Show and hide, much simplified
113 * Motion:: Jumping to other headlines
114 * Structure editing:: Changing sequence and level of headlines
115 * Archiving:: Move done task trees to a different place
116 * Sparse trees:: Matches embedded in context
117 * Plain lists:: Additional structure within an entry
118 * Drawers:: Tucking stuff away
119 * Orgstruct mode:: Structure editing outside Org
123 * ARCHIVE tag:: Marking a tree as inactive
124 * Moving subtrees:: Moving a tree to an archive file
128 * Built-in table editor:: Simple tables
129 * Narrow columns:: Stop wasting space in tables
130 * Column groups:: Grouping to trigger vertical lines
131 * Orgtbl mode:: The table editor as minor mode
132 * The spreadsheet:: The table editor has spreadsheet capabilities
136 * References:: How to refer to another field or range
137 * Formula syntax for Calc:: Using Calc to compute stuff
138 * Formula syntax for Lisp:: Writing formulas in Emacs Lisp
139 * Field formulas:: Formulas valid for a single field
140 * Column formulas:: Formulas valid for an entire column
141 * Editing and debugging formulas:: Fixing formulas
142 * Updating the table:: Recomputing all dependent fields
143 * Advanced features:: Field names, parameters and automatic recalc
147 * Link format:: How links in Org are formatted
148 * Internal links:: Links to other places in the current file
149 * External links:: URL-like links to the world
150 * Handling links:: Creating, inserting and following
151 * Using links outside Org:: Linking from my C source code?
152 * Link abbreviations:: Shortcuts for writing complex links
153 * Search options:: Linking to a specific location
154 * Custom searches:: When the default search is not enough
158 * Radio targets:: Make targets trigger links in plain text
162 * TODO basics:: Marking and displaying TODO entries
163 * TODO extensions:: Workflow and assignments
164 * Progress logging:: Dates and notes for progress
165 * Priorities:: Some things are more important than others
166 * Breaking down tasks:: Splitting a task into manageable pieces
167 * Checkboxes:: Tick-off lists
169 Extended use of TODO keywords
171 * Workflow states:: From TODO to DONE in steps
172 * TODO types:: I do this, Fred does the rest
173 * Multiple sets in one file:: Mixing it all, and still finding your way
174 * Fast access to TODO states:: Single letter selection of a state
175 * Per-file keywords:: Different files, different requirements
176 * Faces for TODO keywords:: Highlighting states
180 * Closing items:: When was this entry marked DONE?
181 * Tracking TODO state changes:: When did the status change?
185 * Tag inheritance:: Tags use the tree structure of the outline
186 * Setting tags:: How to assign tags to a headline
187 * Tag searches:: Searching for combinations of tags
189 Properties and Columns
191 * Property syntax:: How properties are spelled out
192 * Special properties:: Access to other Org mode features
193 * Property searches:: Matching property values
194 * Property inheritance:: Passing values down the tree
195 * Column view:: Tabular viewing and editing
196 * Property API:: Properties for Lisp programmers
200 * Defining columns:: The COLUMNS format property
201 * Using column view:: How to create and use column view
202 * Capturing column view:: A dynamic block for column view
206 * Scope of column definitions:: Where defined, where valid?
207 * Column attributes:: Appearance and content of a column
211 * Timestamps:: Assigning a time to a tree entry
212 * Creating timestamps:: Commands which insert timestamps
213 * Deadlines and scheduling:: Planning your work
214 * Clocking work time:: Tracking how long you spend on a task
215 * Effort estimates:: Planning work effort in advance
219 * The date/time prompt:: How Org mode helps you entering date and time
220 * Custom time format:: Making dates look different
222 Deadlines and scheduling
224 * Inserting deadline/schedule:: Planning items
225 * Repeated tasks:: Items that show up again and again
229 * Setting up Remember:: Some code for .emacs to get things going
230 * Remember templates:: Define the outline of different note types
231 * Storing notes:: Directly get the note to where it belongs
232 * Refiling notes:: Moving a note or task to a project
236 * Agenda files:: Files being searched for agenda information
237 * Agenda dispatcher:: Keyboard access to agenda views
238 * Built-in agenda views:: What is available out of the box?
239 * Presentation and sorting:: How agenda items are prepared for display
240 * Agenda commands:: Remote editing of Org trees
241 * Custom agenda views:: Defining special searches and views
242 * Agenda column view:: Using column view for collected entries
244 The built-in agenda views
246 * Weekly/daily agenda:: The calendar page with current tasks
247 * Global TODO list:: All unfinished action items
248 * Matching tags and properties:: Structured information with fine-tuned search
249 * Timeline:: Time-sorted view for single file
250 * Keyword search:: Finding entries by keyword
251 * Stuck projects:: Find projects you need to review
253 Presentation and sorting
255 * Categories:: Not all tasks are equal
256 * Time-of-day specifications:: How the agenda knows the time
257 * Sorting of agenda items:: The order of things
261 * Storing searches:: Type once, use often
262 * Block agenda:: All the stuff you need in a single buffer
263 * Setting Options:: Changing the rules
264 * Exporting Agenda Views:: Writing agendas to files
265 * Using the agenda elsewhere:: Using agenda information in other programs
269 * Math symbols:: TeX macros for symbols and Greek letters
270 * Subscripts and superscripts:: Simple syntax for raising/lowering text
271 * LaTeX fragments:: Complex formulas made easy
272 * Processing LaTeX fragments:: Previewing LaTeX processing
273 * CDLaTeX mode:: Speed up entering of formulas
277 * ASCII export:: Exporting to plain ASCII
278 * HTML export:: Exporting to HTML
279 * LaTeX export:: Exporting to LaTeX
280 * XOXO export:: Exporting to XOXO
281 * iCalendar export:: Exporting in iCalendar format
282 * Text interpretation:: How the exporter looks at the file
286 * HTML Export commands:: How to invoke LaTeX export
287 * Quoting HTML tags:: Using direct HTML in Org mode
288 * Links:: Transformation of links for HTML
289 * Images:: How to include images
290 * CSS support:: Changing the appearance of the output
291 * Javascript support:: Info and Folding in a web browser
295 * LaTeX export commands:: How to invoke LaTeX export
296 * Quoting LaTeX code:: Incorporating literal LaTeX code
297 * Sectioning structure:: Changing sectioning in LaTeX output
299 Text interpretation by the exporter
301 * Comment lines:: Some lines will not be exported
302 * Initial text:: Text before the first headline
303 * Footnotes:: Numbers like [1]
304 * Quoted examples:: Inserting quoted chunks of text
305 * Enhancing text:: Subscripts, symbols and more
306 * Export options:: How to influence the export settings
310 * Configuration:: Defining projects
311 * Sample configuration:: Example projects
312 * Triggering publication:: Publication commands
316 * Project alist:: The central configuration variable
317 * Sources and destinations:: From here to there
318 * Selecting files:: What files are part of the project?
319 * Publishing action:: Setting the function doing the publishing
320 * Publishing options:: Tweaking HTML export
321 * Publishing links:: Which links keep working after publishing?
322 * Project page index:: Publishing a list of project files
326 * Simple example:: One-component publishing
327 * Complex example:: A multi-component publishing example
331 * Completion:: M-TAB knows what you need
332 * Customization:: Adapting Org to your taste
333 * In-buffer settings:: Overview of the #+KEYWORDS
334 * The very busy C-c C-c key:: When in doubt, press C-c C-c
335 * Clean view:: Getting rid of leading stars in the outline
336 * TTY keys:: Using Org on a tty
337 * Interaction:: Other Emacs packages
338 * Bugs:: Things which do not work perfectly
340 Interaction with other packages
342 * Cooperation:: Packages Org cooperates with
343 * Conflicts:: Packages that lead to conflicts
345 Extensions, Hooks and Hacking
347 * Extensions:: Existing 3rd-party extensions
348 * Adding hyperlink types:: New custom link types
349 * Tables in arbitrary syntax:: Orgtbl for LaTeX and other programs
350 * Dynamic blocks:: Automatically filled blocks
351 * Special agenda views:: Customized views
352 * Using the property API:: Writing programs that use entry properties
354 Tables and lists in arbitrary syntax
356 * Radio tables:: Sending and receiving
357 * A LaTeX example:: Step by step, almost a tutorial
358 * Translator functions:: Copy and modify
359 * Radio lists:: Doing the same for lists
364 @node Introduction, Document Structure, Top, Top
365 @chapter Introduction
369 * Summary:: Brief summary of what Org does
370 * Installation:: How to install a downloaded version of Org
371 * Activation:: How to activate Org for certain buffers
372 * Feedback:: Bug reports, ideas, patches etc.
373 * Conventions:: Type-setting conventions in the manual
376 @node Summary, Installation, Introduction, Introduction
380 Org is a mode for keeping notes, maintaining TODO lists, and doing
381 project planning with a fast and effective plain-text system.
383 Org develops organizational tasks around NOTES files that contain
384 lists or information about projects as plain text. Org is
385 implemented on top of Outline mode, which makes it possible to keep the
386 content of large files well structured. Visibility cycling and
387 structure editing help to work with the tree. Tables are easily created
388 with a built-in table editor. Org supports TODO items, deadlines,
389 time stamps, and scheduling. It dynamically compiles entries into an
390 agenda that utilizes and smoothly integrates much of the Emacs calendar
391 and diary. Plain text URL-like links connect to websites, emails,
392 Usenet messages, BBDB entries, and any files related to the projects.
393 For printing and sharing of notes, an Org file can be exported as a
394 structured ASCII file, as HTML, or (TODO and agenda items only) as an
395 iCalendar file. It can also serve as a publishing tool for a set of
398 An important design aspect that distinguishes Org from for example
399 Planner/Muse is that it encourages to store every piece of information
400 only once. In Planner, you have project pages, day pages and possibly
401 other files, duplicating some information such as tasks. In Org,
402 you only have notes files. In your notes you mark entries as tasks,
403 label them with tags and timestamps. All necessary lists like a
404 schedule for the day, the agenda for a meeting, tasks lists selected by
405 tags etc are created dynamically when you need them.
407 Org keeps simple things simple. When first fired up, it should
408 feel like a straightforward, easy to use outliner. Complexity is not
409 imposed, but a large amount of functionality is available when you need
410 it. Org is a toolbox and can be used in different ways, for
414 @r{@bullet{} outline extension with visibility cycling and structure editing}
415 @r{@bullet{} ASCII system and table editor for taking structured notes}
416 @r{@bullet{} ASCII table editor with spreadsheet-like capabilities}
417 @r{@bullet{} TODO list editor}
418 @r{@bullet{} full agenda and planner with deadlines and work scheduling}
419 @r{@bullet{} environment to implement David Allen's GTD system}
420 @r{@bullet{} a basic database application}
421 @r{@bullet{} simple hypertext system, with HTML and LaTeX export}
422 @r{@bullet{} publishing tool to create a set of interlinked webpages}
425 Org's automatic, context sensitive table editor with spreadsheet
426 capabilities can be integrated into any major mode by activating the
427 minor Orgtbl mode. Using a translation step, it can be used to maintain
428 tables in arbitrary file types, for example in La@TeX{}. The structure
429 editing and list creation capabilities can be used outside Org with
430 the minor Orgstruct mode.
433 There is a website for Org which provides links to the newest
434 version of Org, as well as additional information, frequently asked
435 questions (FAQ), links to tutorials etc. This page is located at
436 @uref{http://orgmode.org}.
441 @node Installation, Activation, Summary, Introduction
442 @section Installation
446 @b{Important:} @i{If Org is part of the Emacs distribution or an
447 XEmacs package, please skip this section and go directly to
450 If you have downloaded Org from the Web, either as a distribution @file{.zip}
451 or @file{.tar} file, or as a GIT archive, you must take the following steps
452 to install it: Go into the unpacked Org distribution directory and edit the
453 top section of the file @file{Makefile}. You must set the name of the Emacs
454 binary (likely either @file{emacs} or @file{xemacs}), and the paths to the
455 directories where local Lisp and Info files are kept. If you don't have
456 access to the system-wide directories, you can simply run Org directly from
457 the distribution directory by adding the @file{lisp} subdirectory to the
458 Emacs load path. To do this, add the following line to @file{.emacs}:
461 (setq load-path (cons "~/path/to/orgdir/lisp" load-path))
465 If you plan to use code from the @file{contrib} subdirectory, do a similar
466 step for this directory:
469 (setq load-path (cons "~/path/to/orgdir/contrib/lisp" load-path))
472 @b{XEmacs users now need to install the file @file{noutline.el} from
473 the @file{xemacs} sub-directory of the Org distribution. Use the
477 @b{make install-noutline}
480 @noindent Now byte-compile the Lisp files with the shell command:
486 @noindent If you are running Org from the distribution directory, this is
487 all. If you want to install into the system directories, use
494 @noindent Then add to @file{.emacs}:
497 ;; This line only if Org is not part of the X/Emacs distribution.
498 (require 'org-install)
502 @node Activation, Feedback, Installation, Introduction
506 @cindex global key bindings
507 @cindex key bindings, global
510 @b{Important:} @i{If you use copy-and-paste to copy lisp code from the
511 PDF documentation as viewed by Acrobat reader to your .emacs file, the
512 single quote character comes out incorrectly and the code will not work.
513 You need to fix the single quotes by hand, or copy from Info
517 Add the following lines to your @file{.emacs} file. The last two lines
518 define @emph{global} keys for the commands @command{org-store-link},
519 @command{org-agenda}, and @command{org-iswitchb} - please choose suitable
523 ;; The following lines are always needed. Choose your own keys.
524 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
525 (global-set-key "\C-cl" 'org-store-link)
526 (global-set-key "\C-ca" 'org-agenda)
527 (global-set-key "\C-cb" 'org-iswitchb)
530 Furthermore, you must activate @code{font-lock-mode} in Org
531 buffers, because significant functionality depends on font-locking being
532 active. You can do this with either one of the following two lines
533 (XEmacs user must use the second option):
535 (global-font-lock-mode 1) ; for all buffers
536 (add-hook 'org-mode-hook 'turn-on-font-lock) ; Org buffers only
539 @cindex Org mode, turning on
540 With this setup, all files with extension @samp{.org} will be put
541 into Org mode. As an alternative, make the first line of a file look
545 MY PROJECTS -*- mode: org; -*-
548 @noindent which will select Org mode for this buffer no matter what
549 the file's name is. See also the variable
550 @code{org-insert-mode-line-in-empty-file}.
552 @node Feedback, Conventions, Activation, Introduction
559 If you find problems with Org, or if you have questions, remarks,
560 or ideas about it, please contact the maintainer @value{MAINTAINER} at
561 @value{MAINTAINEREMAIL}.
563 For bug reports, please provide as much information as possible,
564 including the version information of Emacs (@kbd{C-h v emacs-version
565 @key{RET}}) and Org (@kbd{C-h v org-version @key{RET}}), as well as
566 the Org related setup in @file{.emacs}. If an error occurs, a
567 backtrace can be very useful (see below on how to create one). Often a
568 small example file helps, along with clear information about:
571 @item What exactly did you do?
572 @item What did you expect to happen?
573 @item What happened instead?
575 @noindent Thank you for helping to improve this mode.
577 @subsubheading How to create a useful backtrace
579 @cindex backtrace of an error
580 If working with Org produces an error with a message you don't
581 understand, you may have hit a bug. The best way to report this is by
582 providing, in addition to what was mentioned above, a @emph{Backtrace}.
583 This is information from the built-in debugger about where and how the
584 error occurred. Here is how to produce a useful backtrace:
588 Start a fresh Emacs or XEmacs, and make sure that it will load the
589 original Lisp code in @file{org.el} instead of the compiled version in
590 @file{org.elc}. The backtrace contains much more information if it is
591 produced with uncompiled code. To do this, either rename @file{org.elc}
592 to something else before starting Emacs, or ask Emacs explicitly to load
593 @file{org.el} by using the command line
595 emacs -l /path/to/org.el
598 Go to the @code{Options} menu and select @code{Enter Debugger on Error}
599 (XEmacs has this option in the @code{Troubleshooting} sub-menu).
601 Do whatever you have to do to hit the error. Don't forget to
602 document the steps you take.
604 When you hit the error, a @file{*Backtrace*} buffer will appear on the
605 screen. Save this buffer to a file (for example using @kbd{C-x C-w}) and
606 attach it to your bug report.
609 @node Conventions, , Feedback, Introduction
610 @section Typesetting conventions used in this manual
612 Org uses three types of keywords: TODO keywords, tags, and property
613 names. In this manual we use the following conventions:
618 TODO keywords are written with all capitals, even if they are
622 User-defined tags are written in lowercase; built-in tags with special
623 meaning are written with all capitals.
626 User-defined properties are capitalized; built-in properties with
627 special meaning are written with all capitals.
630 @node Document Structure, Tables, Introduction, Top
631 @chapter Document Structure
632 @cindex document structure
633 @cindex structure of document
635 Org is based on outline mode and provides flexible commands to
636 edit the structure of the document.
639 * Outlines:: Org is based on Outline mode
640 * Headlines:: How to typeset Org tree headlines
641 * Visibility cycling:: Show and hide, much simplified
642 * Motion:: Jumping to other headlines
643 * Structure editing:: Changing sequence and level of headlines
644 * Archiving:: Move done task trees to a different place
645 * Sparse trees:: Matches embedded in context
646 * Plain lists:: Additional structure within an entry
647 * Drawers:: Tucking stuff away
648 * Orgstruct mode:: Structure editing outside Org
651 @node Outlines, Headlines, Document Structure, Document Structure
656 Org is implemented on top of Outline mode. Outlines allow a
657 document to be organized in a hierarchical structure, which (at least
658 for me) is the best representation of notes and thoughts. An overview
659 of this structure is achieved by folding (hiding) large parts of the
660 document to show only the general document structure and the parts
661 currently being worked on. Org greatly simplifies the use of
662 outlines by compressing the entire show/hide functionality into a single
663 command @command{org-cycle}, which is bound to the @key{TAB} key.
665 @node Headlines, Visibility cycling, Outlines, Document Structure
670 Headlines define the structure of an outline tree. The headlines in
671 Org start with one or more stars, on the left margin@footnote{See
672 the variable @code{org-special-ctrl-a/e} to configure special behavior
673 of @kbd{C-a} and @kbd{C-e} in headlines.}. For example:
683 * Another top level headline
686 @noindent Some people find the many stars too noisy and would prefer an
687 outline that has whitespace followed by a single star as headline
688 starters. @ref{Clean view} describes a setup to realize this.
690 An empty line after the end of a subtree is considered part of it and
691 will be hidden when the subtree is folded. However, if you leave at
692 least two empty lines, one empty line will remain visible after folding
693 the subtree, in order to structure the collapsed view. See the
694 variable @code{org-cycle-separator-lines} to modify this behavior.
696 @node Visibility cycling, Motion, Headlines, Document Structure
697 @section Visibility cycling
698 @cindex cycling, visibility
699 @cindex visibility cycling
700 @cindex trees, visibility
701 @cindex show hidden text
704 Outlines make it possible to hide parts of the text in the buffer.
705 Org uses just two commands, bound to @key{TAB} and
706 @kbd{S-@key{TAB}} to change the visibility in the buffer.
708 @cindex subtree visibility states
709 @cindex subtree cycling
710 @cindex folded, subtree visibility state
711 @cindex children, subtree visibility state
712 @cindex subtree, subtree visibility state
716 @emph{Subtree cycling}: Rotate current subtree among the states
719 ,-> FOLDED -> CHILDREN -> SUBTREE --.
720 '-----------------------------------'
723 The cursor must be on a headline for this to work@footnote{see, however,
724 the option @code{org-cycle-emulate-tab}.}. When the cursor is at the
725 beginning of the buffer and the first line is not a headline, then
726 @key{TAB} actually runs global cycling (see below)@footnote{see the
727 option @code{org-cycle-global-at-bob}.}. Also when called with a prefix
728 argument (@kbd{C-u @key{TAB}}), global cycling is invoked.
730 @cindex global visibility states
731 @cindex global cycling
732 @cindex overview, global visibility state
733 @cindex contents, global visibility state
734 @cindex show all, global visibility state
738 @emph{Global cycling}: Rotate the entire buffer among the states
741 ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
742 '--------------------------------------'
745 When @kbd{S-@key{TAB}} is called with a numeric prefix argument N, the
746 CONTENTS view up to headlines of level N will be shown. Note that inside
747 tables, @kbd{S-@key{TAB}} jumps to the previous field.
749 @cindex show all, command
755 Reveal context around point, showing the current entry, the following heading
756 and the hierarchy above. Useful for working near a location that has been
757 exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda command
758 (@pxref{Agenda commands}). With a prefix argument show, on each
759 level, all sibling headings.
762 Show the current subtree in an indirect buffer@footnote{The indirect
765 (@pxref{Indirect Buffers,,,emacs,GNU Emacs Manual})
768 (see the Emacs manual for more information about indirect buffers)
770 will contain the entire buffer, but will be narrowed to the current
771 tree. Editing the indirect buffer will also change the original buffer,
772 but without affecting visibility in that buffer.}. With a numeric
773 prefix argument N, go up to level N and then take that tree. If N is
774 negative then go up that many levels. With a @kbd{C-u} prefix, do not remove
775 the previously used indirect buffer.
778 When Emacs first visits an Org file, the global state is set to
779 OVERVIEW, i.e. only the top level headlines are visible. This can be
780 configured through the variable @code{org-startup-folded}, or on a
781 per-file basis by adding one of the following lines anywhere in the
790 @node Motion, Structure editing, Visibility cycling, Document Structure
792 @cindex motion, between headlines
793 @cindex jumping, to headlines
794 @cindex headline navigation
795 The following commands jump to other headlines in the buffer.
806 Next heading same level.
809 Previous heading same level.
812 Backward to higher level heading.
815 Jump to a different place without changing the current outline
816 visibility. Shows the document structure in a temporary buffer, where
817 you can use the following keys to find your destination:
819 @key{TAB} @r{Cycle visibility.}
820 @key{down} / @key{up} @r{Next/previous visible headline.}
821 n / p @r{Next/previous visible headline.}
822 f / b @r{Next/previous headline same level.}
824 0-9 @r{Digit argument.}
825 @key{RET} @r{Select this location.}
829 @node Structure editing, Archiving, Motion, Document Structure
830 @section Structure editing
831 @cindex structure editing
832 @cindex headline, promotion and demotion
833 @cindex promotion, of subtrees
834 @cindex demotion, of subtrees
835 @cindex subtree, cut and paste
836 @cindex pasting, of subtrees
837 @cindex cutting, of subtrees
838 @cindex copying, of subtrees
839 @cindex subtrees, cut and paste
844 Insert new heading with same level as current. If the cursor is in a
845 plain list item, a new item is created (@pxref{Plain lists}). To force
846 creation of a new headline, use a prefix argument, or first press @key{RET}
847 to get to the beginning of the next line. When this command is used in
848 the middle of a line, the line is split and the rest of the line becomes
849 the new headline@footnote{If you do not want the line to be split,
850 customize the variable @code{org-M-RET-may-split-line}.}. If the
851 command is used at the beginning of a headline, the new headline is
852 created before the current line. If at the beginning of any other line,
853 the content of that line is made the new heading. If the command is
854 used at the end of a folded subtree (i.e. behind the ellipses at the end
855 of a headline), then a headline like the current one will be inserted
856 after the end of the subtree.
859 Insert a new heading after the current subtree, same level as the
860 current headline. This command works from anywhere in the entry.
861 @kindex M-S-@key{RET}
863 Insert new TODO entry with same level as current heading.
866 Promote current heading by one level.
867 @kindex M-@key{right}
869 Demote current heading by one level.
870 @kindex M-S-@key{left}
872 Promote the current subtree by one level.
873 @kindex M-S-@key{right}
874 @item M-S-@key{right}
875 Demote the current subtree by one level.
878 Move subtree up (swap with previous subtree of same
880 @kindex M-S-@key{down}
882 Move subtree down (swap with next subtree of same level).
887 Kill subtree, i.e. remove it from buffer but save in kill ring.
888 With a numeric prefix argument N, kill N sequential subtrees.
891 Copy subtree to kill ring. With a numeric prefix argument N, copy the N
895 Yank subtree from kill ring. This does modify the level of the subtree to
896 make sure the tree fits in nicely at the yank position. The yank level can
897 also be specified with a numeric prefix argument, or by yanking after a
898 headline marker like @samp{****}.
901 Refile entry to a different location. @xref{Refiling notes}.
904 Sort same-level entries. When there is an active region, all entries in the
905 region will be sorted. Otherwise the children of the current headline are
906 sorted. The command prompts for the sorting method, which can be
907 alphabetically, numerically, by time (using the first time stamp in each
908 entry), by priority, or by TODO keyword (in the sequence the keywords have
909 been defined in the setup). Reverse sorting is possible as well. You can
910 also supply your own function to extract the sorting key. With a @kbd{C-u}
911 prefix, sorting will be case-sensitive. With two @kbd{C-u C-u} prefixes,
912 duplicate entries will also be removed.
915 Turn a normal line or plain list item into a headline (so that it
916 becomes a subheading at its location). Also turn a headline into a
917 normal line by removing the stars. If there is an active region, turn
918 all lines in the region into headlines. Or, if the first line is a
919 headline, remove the stars from all headlines in the region.
922 @cindex region, active
923 @cindex active region
924 @cindex Transient mark mode
925 When there is an active region (Transient mark mode), promotion and
926 demotion work on all headlines in the region. To select a region of
927 headlines, it is best to place both point and mark at the beginning of a
928 line, mark at the beginning of the first headline, and point at the line
929 just after the last headline to change. Note that when the cursor is
930 inside a table (@pxref{Tables}), the Meta-Cursor keys have different
933 @node Archiving, Sparse trees, Structure editing, Document Structure
937 When a project represented by a (sub)tree is finished, you may want
938 to move the tree out of the way and to stop it from contributing to the
939 agenda. Org mode knows two ways of archiving. You can mark a tree with
940 the ARCHIVE tag, or you can move an entire (sub)tree to a different
944 * ARCHIVE tag:: Marking a tree as inactive
945 * Moving subtrees:: Moving a tree to an archive file
948 @node ARCHIVE tag, Moving subtrees, Archiving, Archiving
949 @subsection The ARCHIVE tag
950 @cindex internal archiving
952 A headline that is marked with the ARCHIVE tag (@pxref{Tags}) stays at
953 its location in the outline tree, but behaves in the following way:
956 It does not open when you attempt to do so with a visibility cycling
957 command (@pxref{Visibility cycling}). You can force cycling archived
958 subtrees with @kbd{C-@key{TAB}}, or by setting the option
959 @code{org-cycle-open-archived-trees}. Also normal outline commands like
960 @code{show-all} will open archived subtrees.
962 During sparse tree construction (@pxref{Sparse trees}), matches in
963 archived subtrees are not exposed, unless you configure the option
964 @code{org-sparse-tree-open-archived-trees}.
966 During agenda view construction (@pxref{Agenda Views}), the content of
967 archived trees is ignored unless you configure the option
968 @code{org-agenda-skip-archived-trees}.
970 Archived trees are not exported (@pxref{Exporting}), only the headline
971 is. Configure the details using the variable
972 @code{org-export-with-archived-trees}.
975 The following commands help managing the ARCHIVE tag:
980 Toggle the ARCHIVE tag for the current headline. When the tag is set,
981 the headline changes to a shadowed face, and the subtree below it is
983 @kindex C-u C-c C-x a
985 Check if any direct children of the current headline should be archived.
986 To do this, each subtree is checked for open TODO entries. If none are
987 found, the command offers to set the ARCHIVE tag for the child. If the
988 cursor is @emph{not} on a headline when this command is invoked, the
989 level 1 trees will be checked.
992 Cycle a tree even if it is tagged with ARCHIVE.
995 @node Moving subtrees, , ARCHIVE tag, Archiving
996 @subsection Moving subtrees
997 @cindex external archiving
999 Once an entire project is finished, you may want to move it to a different
1000 location. Org can move it to an @emph{Attic Sibling} in the same tree, to a
1001 different tree in the current file, or to a different file, the archive file.
1006 Move the curent entry to the @emph{Attic Sibling}. This is a sibling of the
1007 entry with the heading @samp{Attic} and the tag @samp{ARCHIVE}
1008 (@pxref{ARCHIVE tag}). The entry becomes a child of that sibling and in this
1009 way retains a lot of its original context, including inherited tags and
1010 approximate position in the outline.
1013 Archive the subtree starting at the cursor position to the location
1014 given by @code{org-archive-location}. Context information that could be
1015 lost like the file name, the category, inherited tags, and the TODO
1016 state will be store as properties in the entry.
1017 @kindex C-u C-c C-x C-s
1018 @item C-u C-c C-x C-s
1019 Check if any direct children of the current headline could be moved to
1020 the archive. To do this, each subtree is checked for open TODO entries.
1021 If none are found, the command offers to move it to the archive
1022 location. If the cursor is @emph{not} on a headline when this command
1023 is invoked, the level 1 trees will be checked.
1026 @cindex archive locations
1027 The default archive location is a file in the same directory as the
1028 current file, with the name derived by appending @file{_archive} to the
1029 current file name. For information and examples on how to change this,
1030 see the documentation string of the variable
1031 @code{org-archive-location}. There is also an in-buffer option for
1032 setting this variable, for example@footnote{For backward compatibility,
1033 the following also works: If there are several such lines in a file,
1034 each specifies the archive location for the text below it. The first
1035 such line also applies to any text before its definition. However,
1036 using this method is @emph{strongly} deprecated as it is incompatible
1037 with the outline structure of the document. The correct method for
1038 setting multiple archive locations in a buffer is using a property.}:
1041 #+ARCHIVE: %s_done::
1045 If you would like to have a special ARCHIVE location for a single entry
1046 or a (sub)tree, give the entry an @code{:ARCHIVE:} property with the
1047 location as the value (@pxref{Properties and Columns}).
1049 When a subtree is moved, it receives a number of special properties that
1050 record context information like the file from where the entry came, it's
1051 outline path the archiving time etc. Configure the variable
1052 @code{org-archive-save-context-info} to adjust the amount of information
1055 @node Sparse trees, Plain lists, Archiving, Document Structure
1056 @section Sparse trees
1057 @cindex sparse trees
1058 @cindex trees, sparse
1059 @cindex folding, sparse trees
1060 @cindex occur, command
1062 An important feature of Org mode is the ability to construct
1063 @emph{sparse trees} for selected information in an outline tree, so that
1064 the entire document is folded as much as possible, but the selected
1065 information is made visible along with the headline structure above
1066 it@footnote{See also the variables @code{org-show-hierarchy-above},
1067 @code{org-show-following-heading}, and @code{org-show-siblings} for
1068 detailed control on how much context is shown around each match.}. Just
1069 try it out and you will see immediately how it works.
1071 Org mode contains several commands creating such trees, all these
1072 commands can be accessed through a dispatcher:
1077 This prompts for an extra key to select a sparse-tree creating command.
1080 Occur. Prompts for a regexp and shows a sparse tree with all matches.
1081 If the match is in a headline, the headline is made visible. If the
1082 match is in the body of an entry, headline and body are made visible.
1083 In order to provide minimal context, also the full hierarchy of
1084 headlines above the match is shown, as well as the headline following
1085 the match. Each match is also highlighted; the highlights disappear
1086 when the buffer is changed by an editing command, or by pressing
1087 @kbd{C-c C-c}. When called with a @kbd{C-u} prefix argument, previous
1088 highlights are kept, so several calls to this command can be stacked.
1092 For frequently used sparse trees of specific search strings, you can
1093 use the variable @code{org-agenda-custom-commands} to define fast
1094 keyboard access to specific sparse trees. These commands will then be
1095 accessible through the agenda dispatcher (@pxref{Agenda dispatcher}).
1099 (setq org-agenda-custom-commands
1100 '(("f" occur-tree "FIXME")))
1103 @noindent will define the key @kbd{C-c a f} as a shortcut for creating
1104 a sparse tree matching the string @samp{FIXME}.
1106 The other sparse tree commands select headings based on TODO keywords,
1107 tags, or properties and will be discussed later in this manual.
1110 @cindex printing sparse trees
1111 @cindex visible text, printing
1112 To print a sparse tree, you can use the Emacs command
1113 @code{ps-print-buffer-with-faces} which does not print invisible parts
1114 of the document @footnote{This does not work under XEmacs, because
1115 XEmacs uses selective display for outlining, not text properties.}.
1116 Or you can use the command @kbd{C-c C-e v} to export only the visible
1117 part of the document and print the resulting file.
1119 @node Plain lists, Drawers, Sparse trees, Document Structure
1120 @section Plain lists
1122 @cindex lists, plain
1123 @cindex lists, ordered
1124 @cindex ordered lists
1126 Within an entry of the outline tree, hand-formatted lists can provide
1127 additional structure. They also provide a way to create lists of
1128 checkboxes (@pxref{Checkboxes}). Org supports editing such lists,
1129 and the HTML exporter (@pxref{Exporting}) parses and formats them.
1131 Org knows ordered lists, unordered lists, and description lists.
1134 @emph{Unordered} list items start with @samp{-}, @samp{+}, or
1135 @samp{*}@footnote{When using @samp{*} as a bullet, lines must be indented or
1136 they will be seen as top-level headlines. Also, when you are hiding leading
1137 stars to get a clean outline view, plain list items starting with a star are
1138 visually indistinguishable from true headlines. In short: even though
1139 @samp{*} is supported, it may be better to not use it for plain list items.}
1142 @emph{Ordered} list items start with a numeral followed by either a period or
1143 a right parenthesis, such as @samp{1.} or @samp{1)}.
1145 @emph{Description} list items are like unordered list items, but contain the
1146 separator @samp{ :: } to separate the description @emph{term} from the
1150 Items belonging to the same list must have the same indentation on the first
1151 line. In particular, if an ordered list reaches number @samp{10.}, then the
1152 2--digit numbers must be written left-aligned with the other numbers in the
1153 list. Indentation also determines the end of a list item. It ends before
1154 the next line that is indented like the bullet/number, or less. Empty lines
1155 are part of the previous item, so you can have several paragraphs in one
1156 item. If you would like an empty line to terminate all currently open plain
1157 lists, configure the variable @code{org-empty-line-terminates-plain-lists}.
1162 ** Lord of the Rings
1163 My favorite scenes are (in this order)
1164 1. The attack of the Rohirrim
1165 2. Eowyns fight with the witch king
1166 + this was already my favorite scene in the book
1167 + I really like Miranda Otto.
1168 3. Peter Jackson being shot by Legolas
1170 He makes a really funny face when it happens.
1171 But in the end, not individual scenes matter but the film as a whole.
1172 Important actors in this film are:
1173 - @b{Elijah Wood} :: He plays the Frodo
1174 - @b{Sean Austin} :: He plays the Sam, Frodos friend. I still remember
1175 him very well from his role as Mikey Walsh a in the Goonies.
1179 Org supports these lists by tuning filling and wrapping commands to
1180 deal with them correctly@footnote{Org only changes the filling
1181 settings for Emacs. For XEmacs, you should use Kyle E. Jones'
1182 @file{filladapt.el}. To turn this on, put into @file{.emacs}:
1183 @code{(require 'filladapt)}}, and by exporting them properly
1184 (@pxref{Exporting}).
1186 The following commands act on items when the cursor is in the first line
1187 of an item (the line with the bullet or number).
1192 Items can be folded just like headline levels if you set the variable
1193 @code{org-cycle-include-plain-lists}. The level of an item is then
1194 given by the indentation of the bullet/number. Items are always
1195 subordinate to real headlines, however; the hierarchies remain
1196 completely separated.
1198 If @code{org-cycle-include-plain-lists} has not been set, @key{TAB}
1199 fixes the indentation of the current line in a heuristic way.
1202 Insert new item at current level. With a prefix argument, force a new
1203 heading (@pxref{Structure editing}). If this command is used in the middle
1204 of a line, the line is @emph{split} and the rest of the line becomes the new
1205 item@footnote{If you do not want the line to be split, customize the variable
1206 @code{org-M-RET-may-split-line}.}. If this command is executed in the
1207 @emph{whitespace before a bullet or number}, the new item is created
1208 @emph{before} the current item. If the command is executed in the white
1209 space before the text that is part of an item but does not contain the
1210 bullet, a bullet is added to the current line.
1211 @kindex M-S-@key{RET}
1213 Insert a new item with a checkbox (@pxref{Checkboxes}).
1215 @kindex S-@key{down}
1218 Jump to the previous/next item in the current list.
1219 @kindex M-S-@key{up}
1220 @kindex M-S-@key{down}
1222 @itemx M-S-@key{down}
1223 Move the item including subitems up/down (swap with previous/next item
1224 of same indentation). If the list is ordered, renumbering is
1226 @kindex M-S-@key{left}
1227 @kindex M-S-@key{right}
1228 @item M-S-@key{left}
1229 @itemx M-S-@key{right}
1230 Decrease/increase the indentation of the item, including subitems.
1231 Initially, the item tree is selected based on current indentation.
1232 When these commands are executed several times in direct succession,
1233 the initially selected region is used, even if the new indentation
1234 would imply a different hierarchy. To use the new hierarchy, break
1235 the command chain with a cursor motion or so.
1238 If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the
1239 state of the checkbox. If not, this command makes sure that all the
1240 items on this list level use the same bullet. Furthermore, if this is
1241 an ordered list, make sure the numbering is OK.
1244 Cycle the entire list level through the different itemize/enumerate bullets
1245 (@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}). With a numeric prefix
1246 argument N, select the Nth bullet from this list. If there is an active
1247 region when calling this, all lines will be converted to list items. If the
1248 first line already was a list item, any item markers will be removed from the
1249 list. Finally, even without an active region, a normal line will be
1250 converted into a list item.
1253 @node Drawers, Orgstruct mode, Plain lists, Document Structure
1256 @cindex visibility cycling, drawers
1258 Sometimes you want to keep information associated with an entry, but you
1259 normally don't want to see it. For this, Org mode has @emph{drawers}.
1260 Drawers need to be configured with the variable
1261 @code{org-drawers}@footnote{You can define drawers on a per-file basis
1262 with a line like @code{#+DRAWERS: HIDDEN PROPERTIES STATE}}. Drawers
1266 ** This is a headline
1267 Still outside the drawer
1269 This is inside the drawer.
1274 Visibility cycling (@pxref{Visibility cycling}) on the headline will
1275 hide and show the entry, but keep the drawer collapsed to a single line.
1276 In order to look inside the drawer, you need to move the cursor to the
1277 drawer line and press @key{TAB} there. Org mode uses a drawer for
1278 storing properties (@pxref{Properties and Columns}), and another one for
1279 storing clock times (@pxref{Clocking work time}).
1281 @node Orgstruct mode, , Drawers, Document Structure
1282 @section The Orgstruct minor mode
1283 @cindex Orgstruct mode
1284 @cindex minor mode for structure editing
1286 If you like the intuitive way the Org mode structure editing and list
1287 formatting works, you might want to use these commands in other modes
1288 like Text mode or Mail mode as well. The minor mode Orgstruct mode
1289 makes this possible. You can always toggle the mode with @kbd{M-x
1290 orgstruct-mode}. To turn it on by default, for example in Mail mode,
1294 (add-hook 'mail-mode-hook 'turn-on-orgstruct)
1297 When this mode is active and the cursor is on a line that looks to
1298 Org like a headline of the first line of a list item, most
1299 structure editing commands will work, even if the same keys normally
1300 have different functionality in the major mode you are using. If the
1301 cursor is not in one of those special lines, Orgstruct mode lurks
1302 silently in the shadow.
1304 @node Tables, Hyperlinks, Document Structure, Top
1307 @cindex editing tables
1309 Org comes with a fast and intuitive table editor. Spreadsheet-like
1310 calculations are supported in connection with the Emacs @file{calc}
1313 (@pxref{Top,Calc,,Calc,Gnu Emacs Calculator Manual}).
1316 (see the Emacs Calculator manual for more information about the Emacs
1321 * Built-in table editor:: Simple tables
1322 * Narrow columns:: Stop wasting space in tables
1323 * Column groups:: Grouping to trigger vertical lines
1324 * Orgtbl mode:: The table editor as minor mode
1325 * The spreadsheet:: The table editor has spreadsheet capabilities
1328 @node Built-in table editor, Narrow columns, Tables, Tables
1329 @section The built-in table editor
1330 @cindex table editor, built-in
1332 Org makes it easy to format tables in plain ASCII. Any line with
1333 @samp{|} as the first non-whitespace character is considered part of a
1334 table. @samp{|} is also the column separator. A table might look like
1338 | Name | Phone | Age |
1339 |-------+-------+-----|
1340 | Peter | 1234 | 17 |
1341 | Anna | 4321 | 25 |
1344 A table is re-aligned automatically each time you press @key{TAB} or
1345 @key{RET} or @kbd{C-c C-c} inside the table. @key{TAB} also moves to
1346 the next field (@key{RET} to the next row) and creates new table rows
1347 at the end of the table or before horizontal lines. The indentation
1348 of the table is set by the first line. Any line starting with
1349 @samp{|-} is considered as a horizontal separator line and will be
1350 expanded on the next re-align to span the whole table width. So, to
1351 create the above table, you would only type
1358 @noindent and then press @key{TAB} to align the table and start filling in
1361 When typing text into a field, Org treats @key{DEL},
1362 @key{Backspace}, and all character keys in a special way, so that
1363 inserting and deleting avoids shifting other fields. Also, when
1364 typing @emph{immediately after the cursor was moved into a new field
1365 with @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the
1366 field is automatically made blank. If this behavior is too
1367 unpredictable for you, configure the variables
1368 @code{org-enable-table-editor} and @code{org-table-auto-blank-field}.
1371 @tsubheading{Creation and conversion}
1374 Convert the active region to table. If every line contains at least one
1375 TAB character, the function assumes that the material is tab separated.
1376 If every line contains a comma, comma-separated values (CSV) are assumed.
1377 If not, lines are split at whitespace into fields. You can use a prefix
1378 argument to force a specific separator: @kbd{C-u} forces CSV, @kbd{C-u
1379 C-u} forces TAB, and a numeric argument N indicates that at least N
1380 consecutive spaces, or alternatively a TAB will be the separator.
1382 If there is no active region, this command creates an empty Org
1383 table. But it's easier just to start typing, like
1384 @kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}.
1386 @tsubheading{Re-aligning and field motion}
1389 Re-align the table without moving the cursor.
1393 Re-align the table, move to the next field. Creates a new row if
1398 Re-align, move to previous field.
1402 Re-align the table and move down to next row. Creates a new row if
1403 necessary. At the beginning or end of a line, @key{RET} still does
1404 NEWLINE, so it can be used to split a table.
1406 @tsubheading{Column and row editing}
1407 @kindex M-@key{left}
1408 @kindex M-@key{right}
1410 @itemx M-@key{right}
1411 Move the current column left/right.
1413 @kindex M-S-@key{left}
1414 @item M-S-@key{left}
1415 Kill the current column.
1417 @kindex M-S-@key{right}
1418 @item M-S-@key{right}
1419 Insert a new column to the left of the cursor position.
1422 @kindex M-@key{down}
1425 Move the current row up/down.
1427 @kindex M-S-@key{up}
1429 Kill the current row or horizontal line.
1431 @kindex M-S-@key{down}
1432 @item M-S-@key{down}
1433 Insert a new row above the current row. With a prefix argument, the line is
1434 created below the current one.
1438 Insert a horizontal line below current row. With a prefix argument, the line
1439 is created above the current line.
1443 Sort the table lines in the region. The position of point indicates the
1444 column to be used for sorting, and the range of lines is the range
1445 between the nearest horizontal separator lines, or the entire table. If
1446 point is before the first column, you will be prompted for the sorting
1447 column. If there is an active region, the mark specifies the first line
1448 and the sorting column, while point should be in the last line to be
1449 included into the sorting. The command prompts for the sorting type
1450 (alphabetically, numerically, or by time). When called with a prefix
1451 argument, alphabetic sorting will be case-sensitive.
1453 @tsubheading{Regions}
1456 Copy a rectangular region from a table to a special clipboard. Point
1457 and mark determine edge fields of the rectangle. The process ignores
1458 horizontal separator lines.
1462 Copy a rectangular region from a table to a special clipboard, and
1463 blank all fields in the rectangle. So this is the ``cut'' operation.
1467 Paste a rectangular region into a table.
1468 The upper right corner ends up in the current field. All involved fields
1469 will be overwritten. If the rectangle does not fit into the present table,
1470 the table is enlarged as needed. The process ignores horizontal separator
1477 Wrap several fields in a column like a paragraph. If there is an active
1478 region, and both point and mark are in the same column, the text in the
1479 column is wrapped to minimum width for the given number of lines. A numeric
1480 prefix argument may be used to change the number of desired lines. If there
1481 is no region, the current field is split at the cursor position and the text
1482 fragment to the right of the cursor is prepended to the field one line
1483 down. If there is no region, but you specify a prefix argument, the current
1484 field is made blank, and the content is appended to the field above.
1486 @tsubheading{Calculations}
1487 @cindex formula, in tables
1488 @cindex calculations, in tables
1489 @cindex region, active
1490 @cindex active region
1491 @cindex Transient mark mode
1494 Sum the numbers in the current column, or in the rectangle defined by
1495 the active region. The result is shown in the echo area and can
1496 be inserted with @kbd{C-y}.
1500 When current field is empty, copy from first non-empty field above.
1501 When not empty, copy current field down to next row and move cursor
1502 along with it. Depending on the variable
1503 @code{org-table-copy-increment}, integer field values will be
1504 incremented during copy. This key is also used by CUA mode
1505 (@pxref{Cooperation}).
1507 @tsubheading{Miscellaneous}
1510 Edit the current field in a separate window. This is useful for fields
1511 that are not fully visible (@pxref{Narrow columns}). When called with a
1512 @kbd{C-u} prefix, just make the full field visible, so that it can be
1515 @item M-x org-table-import
1516 Import a file as a table. The table should be TAB- or whitespace
1517 separated. Useful, for example, to import a spreadsheet table or data
1518 from a database, because these programs generally can write
1519 TAB-separated text files. This command works by inserting the file into
1520 the buffer and then converting the region to a table. Any prefix
1521 argument is passed on to the converter, which uses it to determine the
1524 Tables can also be imported by pasting tabular text into the Org
1525 buffer, selecting the pasted text with @kbd{C-x C-x} and then using the
1526 @kbd{C-c |} command (see above under @i{Creation and conversion}.
1528 @item M-x org-table-export
1529 Export the table, by default as a TAB-separated file. Useful for data
1530 exchange with, for example, spreadsheet or database programs. The format
1531 used to export the file can be configured in the variable
1532 @code{org-table-export-default-format}. You may also use properties
1533 @code{TABLE_EXPORT_FILE} and @code{TABLE_EXPORT_FORMAT} to specify the file
1534 name and the format for table export in a subtree.
1537 If you don't like the automatic table editor because it gets in your
1538 way on lines which you would like to start with @samp{|}, you can turn
1542 (setq org-enable-table-editor nil)
1545 @noindent Then the only table command that still works is
1546 @kbd{C-c C-c} to do a manual re-align.
1548 @node Narrow columns, Column groups, Built-in table editor, Tables
1549 @section Narrow columns
1550 @cindex narrow columns in tables
1552 The width of columns is automatically determined by the table editor.
1553 Sometimes a single field or a few fields need to carry more text,
1554 leading to inconveniently wide columns. To limit@footnote{This feature
1555 does not work on XEmacs.} the width of a column, one field anywhere in
1556 the column may contain just the string @samp{<N>} where @samp{N} is an
1557 integer specifying the width of the column in characters. The next
1558 re-align will then set the width of this column to no more than this
1563 |---+------------------------------| |---+--------|
1565 | 1 | one | | 1 | one |
1566 | 2 | two | ----\ | 2 | two |
1567 | 3 | This is a long chunk of text | ----/ | 3 | This=> |
1568 | 4 | four | | 4 | four |
1569 |---+------------------------------| |---+--------|
1574 Fields that are wider become clipped and end in the string @samp{=>}.
1575 Note that the full text is still in the buffer, it is only invisible.
1576 To see the full text, hold the mouse over the field - a tool-tip window
1577 will show the full content. To edit such a field, use the command
1578 @kbd{C-c `} (that is @kbd{C-c} followed by the backquote). This will
1579 open a new window with the full field. Edit it and finish with @kbd{C-c
1582 When visiting a file containing a table with narrowed columns, the
1583 necessary character hiding has not yet happened, and the table needs to
1584 be aligned before it looks nice. Setting the option
1585 @code{org-startup-align-all-tables} will realign all tables in a file
1586 upon visiting, but also slow down startup. You can also set this option
1587 on a per-file basis with:
1594 @node Column groups, Orgtbl mode, Narrow columns, Tables
1595 @section Column groups
1596 @cindex grouping columns in tables
1598 When Org exports tables, it does so by default without vertical
1599 lines because that is visually more satisfying in general. Occasionally
1600 however, vertical lines can be useful to structure a table into groups
1601 of columns, much like horizontal lines can do for groups of rows. In
1602 order to specify column groups, you can use a special row where the
1603 first field contains only @samp{/}. The further fields can either
1604 contain @samp{<} to indicate that this column should start a group,
1605 @samp{>} to indicate the end of a column, or @samp{<>} to make a column
1606 a group of its own. Boundaries between column groups will upon export be
1607 marked with vertical lines. Here is an example:
1610 | | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
1611 |---+----+-----+-----+-----+---------+------------|
1612 | / | <> | < | | > | < | > |
1613 | # | 1 | 1 | 1 | 1 | 1 | 1 |
1614 | # | 2 | 4 | 8 | 16 | 1.4142 | 1.1892 |
1615 | # | 3 | 9 | 27 | 81 | 1.7321 | 1.3161 |
1616 |---+----+-----+-----+-----+---------+------------|
1617 #+TBLFM: $3=$2^2::$4=$2^3::$5=$2^4::$6=sqrt($2)::$7=sqrt(sqrt(($2))
1620 It is also sufficient to just insert the column group starters after
1621 every vertical line you'd like to have:
1624 | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
1625 |----+-----+-----+-----+---------+------------|
1629 @node Orgtbl mode, The spreadsheet, Column groups, Tables
1630 @section The Orgtbl minor mode
1632 @cindex minor mode for tables
1634 If you like the intuitive way the Org table editor works, you
1635 might also want to use it in other modes like Text mode or Mail mode.
1636 The minor mode Orgtbl mode makes this possible. You can always toggle
1637 the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for
1638 example in mail mode, use
1641 (add-hook 'mail-mode-hook 'turn-on-orgtbl)
1644 Furthermore, with some special setup, it is possible to maintain tables
1645 in arbitrary syntax with Orgtbl mode. For example, it is possible to
1646 construct La@TeX{} tables with the underlying ease and power of
1647 Orgtbl mode, including spreadsheet capabilities. For details, see
1648 @ref{Tables in arbitrary syntax}.
1650 @node The spreadsheet, , Orgtbl mode, Tables
1651 @section The spreadsheet
1652 @cindex calculations, in tables
1653 @cindex spreadsheet capabilities
1654 @cindex @file{calc} package
1656 The table editor makes use of the Emacs @file{calc} package to implement
1657 spreadsheet-like capabilities. It can also evaluate Emacs Lisp forms to
1658 derive fields from other fields. While fully featured, Org's
1659 implementation is not identical to other spreadsheets. For example,
1660 Org knows the concept of a @emph{column formula} that will be
1661 applied to all non-header fields in a column without having to copy the
1662 formula to each relevant field.
1665 * References:: How to refer to another field or range
1666 * Formula syntax for Calc:: Using Calc to compute stuff
1667 * Formula syntax for Lisp:: Writing formulas in Emacs Lisp
1668 * Field formulas:: Formulas valid for a single field
1669 * Column formulas:: Formulas valid for an entire column
1670 * Editing and debugging formulas:: Fixing formulas
1671 * Updating the table:: Recomputing all dependent fields
1672 * Advanced features:: Field names, parameters and automatic recalc
1675 @node References, Formula syntax for Calc, The spreadsheet, The spreadsheet
1676 @subsection References
1679 To compute fields in the table from other fields, formulas must
1680 reference other fields or ranges. In Org, fields can be referenced
1681 by name, by absolute coordinates, and by relative coordinates. To find
1682 out what the coordinates of a field are, press @kbd{C-c ?} in that
1683 field, or press @kbd{C-c @}} to toggle the display of a grid.
1685 @subsubheading Field references
1686 @cindex field references
1687 @cindex references, to fields
1689 Formulas can reference the value of another field in two ways. Like in
1690 any other spreadsheet, you may reference fields with a letter/number
1691 combination like @code{B3}, meaning the 2nd field in the 3rd row.
1692 @c Such references are always fixed to that field, they don't change
1693 @c when you copy and paste a formula to a different field. So
1694 @c Org's @code{B3} behaves like @code{$B$3} in other spreadsheets.
1697 Org also uses another, more general operator that looks like this:
1703 Column references can be absolute like @samp{1}, @samp{2},...@samp{N},
1704 or relative to the current column like @samp{+1} or @samp{-2}.
1706 The row specification only counts data lines and ignores horizontal
1707 separator lines (hlines). You can use absolute row numbers
1708 @samp{1}...@samp{N}, and row numbers relative to the current row like
1709 @samp{+3} or @samp{-1}. Or specify the row relative to one of the
1710 hlines: @samp{I} refers to the first hline@footnote{Note that only
1711 hlines are counted that @emph{separate} table lines. If the table
1712 starts with a hline above the header, it does not count.}, @samp{II} to
1713 the second etc. @samp{-I} refers to the first such line above the
1714 current line, @samp{+I} to the first such line below the current line.
1715 You can also write @samp{III+2} which is the second data line after the
1716 third hline in the table. Relative row numbers like @samp{-3} will not
1717 cross hlines if the current line is too close to the hline. Instead,
1718 the value directly at the hline is used.
1720 @samp{0} refers to the current row and column. Also, if you omit
1721 either the column or the row part of the reference, the current
1722 row/column is implied.
1724 Org's references with @emph{unsigned} numbers are fixed references
1725 in the sense that if you use the same reference in the formula for two
1726 different fields, the same field will be referenced each time.
1727 Org's references with @emph{signed} numbers are floating
1728 references because the same reference operator can reference different
1729 fields depending on the field being calculated by the formula.
1731 Here are a few examples:
1734 @@2$3 @r{2nd row, 3rd column}
1735 C2 @r{same as previous}
1736 $5 @r{column 5 in the current row}
1737 E& @r{same as previous}
1738 @@2 @r{current column, row 2}
1739 @@-1$-3 @r{the field one row up, three columns to the left}
1740 @@-I$2 @r{field just under hline above current row, column 2}
1743 @subsubheading Range references
1744 @cindex range references
1745 @cindex references, to ranges
1747 You may reference a rectangular range of fields by specifying two field
1748 references connected by two dots @samp{..}. If both fields are in the
1749 current row, you may simply use @samp{$2..$7}, but if at least one field
1750 is in a different row, you need to use the general @code{@@row$column}
1751 format at least for the first field (i.e the reference must start with
1752 @samp{@@} in order to be interpreted correctly). Examples:
1755 $1..$3 @r{First three fields in the current row.}
1756 $P..$Q @r{Range, using column names (see under Advanced)}
1757 @@2$1..@@4$3 @r{6 fields between these two fields.}
1758 A2..C4 @r{Same as above.}
1759 @@-1$-2..@@-1 @r{3 numbers from the column to the left, 2 up to current row}
1762 @noindent Range references return a vector of values that can be fed
1763 into Calc vector functions. Empty fields in ranges are normally
1764 suppressed, so that the vector contains only the non-empty fields (but
1765 see the @samp{E} mode switch below). If there are no non-empty fields,
1766 @samp{[0]} is returned to avoid syntax errors in formulas.
1768 @subsubheading Named references
1769 @cindex named references
1770 @cindex references, named
1771 @cindex name, of column or field
1772 @cindex constants, in calculations
1774 @samp{$name} is interpreted as the name of a column, parameter or
1775 constant. Constants are defined globally through the variable
1776 @code{org-table-formula-constants}, and locally (for the file) through a
1780 #+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6
1784 Also properties (@pxref{Properties and Columns}) can be used as
1785 constants in table formulas: For a property @samp{:Xyz:} use the name
1786 @samp{$PROP_Xyz}, and the property will be searched in the current
1787 outline entry and in the hierarchy above it. If you have the
1788 @file{constants.el} package, it will also be used to resolve constants,
1789 including natural constants like @samp{$h} for Planck's constant, and
1790 units like @samp{$km} for kilometers@footnote{@file{Constant.el} can
1791 supply the values of constants in two different unit systems, @code{SI}
1792 and @code{cgs}. Which one is used depends on the value of the variable
1793 @code{constants-unit-system}. You can use the @code{#+STARTUP} options
1794 @code{constSI} and @code{constcgs} to set this value for the current
1795 buffer.}. Column names and parameters can be specified in special table
1796 lines. These are described below, see @ref{Advanced features}. All
1797 names must start with a letter, and further consist of letters and
1800 @node Formula syntax for Calc, Formula syntax for Lisp, References, The spreadsheet
1801 @subsection Formula syntax for Calc
1802 @cindex formula syntax, Calc
1803 @cindex syntax, of formulas
1805 A formula can be any algebraic expression understood by the Emacs
1806 @file{Calc} package. @b{Note that @file{calc} has the
1807 non-standard convention that @samp{/} has lower precedence than
1808 @samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.} Before
1809 evaluation by @code{calc-eval} (@pxref{Calling Calc from
1810 Your Programs,calc-eval,Calling Calc from Your Lisp Programs,Calc,GNU
1811 Emacs Calc Manual}),
1812 @c FIXME: The link to the Calc manual in HTML does not work.
1813 variable substitution takes place according to the rules described above.
1814 @cindex vectors, in table calculations
1815 The range vectors can be directly fed into the Calc vector functions
1816 like @samp{vmean} and @samp{vsum}.
1818 @cindex format specifier
1819 @cindex mode, for @file{calc}
1820 A formula can contain an optional mode string after a semicolon. This
1821 string consists of flags to influence Calc and other modes during
1822 execution. By default, Org uses the standard Calc modes (precision
1823 12, angular units degrees, fraction and symbolic modes off. The display
1824 format, however, has been changed to @code{(float 5)} to keep tables
1825 compact. The default settings can be configured using the variable
1826 @code{org-calc-default-modes}.
1829 p20 @r{switch the internal precision to 20 digits}
1830 n3 s3 e2 f4 @r{normal, scientific, engineering, or fixed display format}
1831 D R @r{angle modes: degrees, radians}
1832 F S @r{fraction and symbolic modes}
1833 N @r{interpret all fields as numbers, use 0 for non-numbers}
1834 T @r{force text interpretation}
1835 E @r{keep empty fields in ranges}
1839 In addition, you may provide a @code{printf} format specifier to
1840 reformat the final result. A few examples:
1843 $1+$2 @r{Sum of first and second field}
1844 $1+$2;%.2f @r{Same, format result to two decimals}
1845 exp($2)+exp($1) @r{Math functions can be used}
1846 $0;%.1f @r{Reformat current cell to 1 decimal}
1847 ($3-32)*5/9 @r{Degrees F -> C conversion}
1848 $c/$1/$cm @r{Hz -> cm conversion, using @file{constants.el}}
1849 tan($1);Dp3s1 @r{Compute in degrees, precision 3, display SCI 1}
1850 sin($1);Dp3%.1e @r{Same, but use printf specifier for display}
1851 vmean($2..$7) @r{Compute column range mean, using vector function}
1852 vmean($2..$7);EN @r{Same, but treat empty fields as 0}
1853 taylor($3,x=7,2) @r{taylor series of $3, at x=7, second degree}
1856 Calc also contains a complete set of logical operations. For example
1859 if($1<20,teen,string("")) @r{``teen'' if age $1 less than 20, else empty}
1862 @node Formula syntax for Lisp, Field formulas, Formula syntax for Calc, The spreadsheet
1863 @subsection Emacs Lisp forms as formulas
1864 @cindex Lisp forms, as table formulas
1866 It is also possible to write a formula in Emacs Lisp; this can be useful
1867 for string manipulation and control structures, if the Calc's
1868 functionality is not enough. If a formula starts with a single quote
1869 followed by an opening parenthesis, then it is evaluated as a lisp form.
1870 The evaluation should return either a string or a number. Just as with
1871 @file{calc} formulas, you can specify modes and a printf format after a
1872 semicolon. With Emacs Lisp forms, you need to be conscious about the way
1873 field references are interpolated into the form. By default, a
1874 reference will be interpolated as a Lisp string (in double quotes)
1875 containing the field. If you provide the @samp{N} mode switch, all
1876 referenced elements will be numbers (non-number fields will be zero) and
1877 interpolated as Lisp numbers, without quotes. If you provide the
1878 @samp{L} flag, all fields will be interpolated literally, without quotes.
1879 I.e., if you want a reference to be interpreted as a string by the Lisp
1880 form, enclose the reference operator itself in double quotes, like
1881 @code{"$3"}. Ranges are inserted as space-separated fields, so you can
1882 embed them in list or vector syntax. A few examples, note how the
1883 @samp{N} mode is used when we do computations in lisp.
1886 @r{Swap the first two characters of the content of column 1}
1887 '(concat (substring $1 1 2) (substring $1 0 1) (substring $1 2))
1888 @r{Add columns 1 and 2, equivalent to the Calc's @code{$1+$2}}
1890 @r{Compute the sum of columns 1-4, like Calc's @code{vsum($1..$4)}}
1891 '(apply '+ '($1..$4));N
1894 @node Field formulas, Column formulas, Formula syntax for Lisp, The spreadsheet
1895 @subsection Field formulas
1896 @cindex field formula
1897 @cindex formula, for individual table field
1899 To assign a formula to a particular field, type it directly into the
1900 field, preceded by @samp{:=}, for example @samp{:=$1+$2}. When you
1901 press @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in
1902 the field, the formula will be stored as the formula for this field,
1903 evaluated, and the current field replaced with the result.
1905 Formulas are stored in a special line starting with @samp{#+TBLFM:}
1906 directly below the table. If you typed the equation in the 4th field of
1907 the 3rd data line in the table, the formula will look like
1908 @samp{@@3$4=$1+$2}. When inserting/deleting/swapping column and rows
1909 with the appropriate commands, @i{absolute references} (but not relative
1910 ones) in stored formulas are modified in order to still reference the
1911 same field. Of cause this is not true if you edit the table structure
1912 with normal editing commands - then you must fix the equations yourself.
1914 Instead of typing an equation into the field, you may also use the
1920 Install a new formula for the current field. The command prompts for a
1921 formula, with default taken from the @samp{#+TBLFM:} line, applies
1922 it to the current field and stores it.
1925 @node Column formulas, Editing and debugging formulas, Field formulas, The spreadsheet
1926 @subsection Column formulas
1927 @cindex column formula
1928 @cindex formula, for table column
1930 Often in a table, the same formula should be used for all fields in a
1931 particular column. Instead of having to copy the formula to all fields
1932 in that column, Org allows to assign a single formula to an entire
1933 column. If the table contains horizontal separator hlines, everything
1934 before the first such line is considered part of the table @emph{header}
1935 and will not be modified by column formulas.
1937 To assign a formula to a column, type it directly into any field in the
1938 column, preceded by an equal sign, like @samp{=$1+$2}. When you press
1939 @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in the
1940 field, the formula will be stored as the formula for the current column,
1941 evaluated and the current field replaced with the result. If the field
1942 contains only @samp{=}, the previously stored formula for this column is
1943 used. For each column, Org will only remember the most recently
1944 used formula. In the @samp{TBLFM:} line, column formulas will look like
1947 Instead of typing an equation into the field, you may also use the
1953 Install a new formula for the current column and replace current field with
1954 the result of the formula. The command prompts for a formula, with default
1955 taken from the @samp{#+TBLFM} line, applies it to the current field and
1956 stores it. With a numeric prefix argument(e.g. @kbd{C-5 C-c =}) the command
1957 will apply it to that many consecutive fields in the current column.
1960 @node Editing and debugging formulas, Updating the table, Column formulas, The spreadsheet
1961 @subsection Editing and debugging formulas
1962 @cindex formula editing
1963 @cindex editing, of table formulas
1965 You can edit individual formulas in the minibuffer or directly in the
1966 field. Org can also prepare a special buffer with all active
1967 formulas of a table. When offering a formula for editing, Org
1968 converts references to the standard format (like @code{B3} or @code{D&})
1969 if possible. If you prefer to only work with the internal format (like
1970 @code{@@3$2} or @code{$4}), configure the variable
1971 @code{org-table-use-standard-references}.
1978 Edit the formula associated with the current column/field in the
1979 minibuffer. See @ref{Column formulas} and @ref{Field formulas}.
1980 @kindex C-u C-u C-c =
1982 Re-insert the active formula (either a
1983 field formula, or a column formula) into the current field, so that you
1984 can edit it directly in the field. The advantage over editing in the
1985 minibuffer is that you can use the command @kbd{C-c ?}.
1988 While editing a formula in a table field, highlight the field(s)
1989 referenced by the reference at the cursor position in the formula.
1992 Toggle the display of row and column numbers for a table, using
1993 overlays. These are updated each time the table is aligned, you can
1994 force it with @kbd{C-c C-c}.
1997 Toggle the formula debugger on and off. See below.
2000 Edit all formulas for the current table in a special buffer, where the
2001 formulas will be displayed one per line. If the current field has an
2002 active formula, the cursor in the formula editor will mark it.
2003 While inside the special buffer, Org will automatically highlight
2004 any field or range reference at the cursor position. You may edit,
2005 remove and add formulas, and use the following commands:
2011 Exit the formula editor and store the modified formulas. With @kbd{C-u}
2012 prefix, also apply the new formulas to the entire table.
2015 Exit the formula editor without installing changes.
2018 Toggle all references in the formula editor between standard (like
2019 @code{B3}) and internal (like @code{@@3$2}).
2022 Pretty-print or indent lisp formula at point. When in a line containing
2023 a lisp formula, format the formula according to Emacs Lisp rules.
2024 Another @key{TAB} collapses the formula back again. In the open
2025 formula, @key{TAB} re-indents just like in Emacs lisp mode.
2028 Complete Lisp symbols, just like in Emacs lisp mode.
2030 @kindex S-@key{down}
2031 @kindex S-@key{left}
2032 @kindex S-@key{right}
2033 @item S-@key{up}/@key{down}/@key{left}/@key{right}
2034 Shift the reference at point. For example, if the reference is
2035 @code{B3} and you press @kbd{S-@key{right}}, it will become @code{C3}.
2036 This also works for relative references, and for hline references.
2037 @kindex M-S-@key{up}
2038 @kindex M-S-@key{down}
2039 @item M-S-@key{up}/@key{down}
2040 Move the test line for column formulas in the Org buffer up and
2043 @kindex M-@key{down}
2044 @item M-@key{up}/@key{down}
2045 Scroll the window displaying the table.
2048 Turn the coordinate grid in the table on and off.
2052 Making a table field blank does not remove the formula associated with
2053 the field, because that is stored in a different line (the @samp{TBLFM}
2054 line) - during the next recalculation the field will be filled again.
2055 To remove a formula from a field, you have to give an empty reply when
2056 prompted for the formula, or to edit the @samp{#+TBLFM} line.
2059 You may edit the @samp{#+TBLFM} directly and re-apply the changed
2060 equations with @kbd{C-c C-c} in that line, or with the normal
2061 recalculation commands in the table.
2063 @subsubheading Debugging formulas
2064 @cindex formula debugging
2065 @cindex debugging, of table formulas
2066 When the evaluation of a formula leads to an error, the field content
2067 becomes the string @samp{#ERROR}. If you would like see what is going
2068 on during variable substitution and calculation in order to find a bug,
2069 turn on formula debugging in the @code{Tbl} menu and repeat the
2070 calculation, for example by pressing @kbd{C-u C-u C-c = @key{RET}} in a
2071 field. Detailed information will be displayed.
2073 @node Updating the table, Advanced features, Editing and debugging formulas, The spreadsheet
2074 @subsection Updating the table
2075 @cindex recomputing table fields
2076 @cindex updating, table
2078 Recalculation of a table is normally not automatic, but needs to be
2079 triggered by a command. See @ref{Advanced features} for a way to make
2080 recalculation at least semi-automatically.
2082 In order to recalculate a line of a table or the entire table, use the
2088 Recalculate the current row by first applying the stored column formulas
2089 from left to right, and all field formulas in the current row.
2095 Recompute the entire table, line by line. Any lines before the first
2096 hline are left alone, assuming that these are part of the table header.
2098 @kindex C-u C-u C-c *
2099 @kindex C-u C-u C-c C-c
2101 @itemx C-u C-u C-c C-c
2102 Iterate the table by recomputing it until no further changes occur.
2103 This may be necessary if some computed fields use the value of other
2104 fields that are computed @i{later} in the calculation sequence.
2107 @node Advanced features, , Updating the table, The spreadsheet
2108 @subsection Advanced features
2110 If you want the recalculation of fields to happen automatically, or if
2111 you want to be able to assign @i{names} to fields and columns, you need
2112 to reserve the first column of the table for special marking characters.
2116 Rotate the calculation mark in first column through the states @samp{},
2117 @samp{#}, @samp{*}, @samp{!}, @samp{$}. The meaning of these characters
2118 is discussed below. When there is an active region, change all marks in
2122 Here is an example of a table that collects exam results of students and
2123 makes use of these features:
2127 |---+---------+--------+--------+--------+-------+------|
2128 | | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
2129 |---+---------+--------+--------+--------+-------+------|
2130 | ! | | P1 | P2 | P3 | Tot | |
2131 | # | Maximum | 10 | 15 | 25 | 50 | 10.0 |
2132 | ^ | | m1 | m2 | m3 | mt | |
2133 |---+---------+--------+--------+--------+-------+------|
2134 | # | Peter | 10 | 8 | 23 | 41 | 8.2 |
2135 | # | Sara | 6 | 14 | 19 | 39 | 7.8 |
2136 | # | Sam | 2 | 4 | 3 | 9 | 1.8 |
2137 |---+---------+--------+--------+--------+-------+------|
2138 | | Average | | | | 29.7 | |
2139 | ^ | | | | | at | |
2140 | $ | max=50 | | | | | |
2141 |---+---------+--------+--------+--------+-------+------|
2142 #+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(@@-II..@@-I);%.1f
2146 @noindent @b{Important}: Please note that for these special tables,
2147 recalculating the table with @kbd{C-u C-c *} will only affect rows that
2148 are marked @samp{#} or @samp{*}, and fields that have a formula assigned
2149 to the field itself. The column formulas are not applied in rows with
2152 @cindex marking characters, tables
2153 The marking characters have the following meaning:
2156 The fields in this line define names for the columns, so that you may
2157 refer to a column as @samp{$Tot} instead of @samp{$6}.
2159 This row defines names for the fields @emph{above} the row. With such
2160 a definition, any formula in the table may use @samp{$m1} to refer to
2161 the value @samp{10}. Also, if you assign a formula to a names field, it
2162 will be stored as @samp{$name=...}.
2164 Similar to @samp{^}, but defines names for the fields in the row
2167 Fields in this row can define @emph{parameters} for formulas. For
2168 example, if a field in a @samp{$} row contains @samp{max=50}, then
2169 formulas in this table can refer to the value 50 using @samp{$max}.
2170 Parameters work exactly like constants, only that they can be defined on
2173 Fields in this row are automatically recalculated when pressing
2174 @key{TAB} or @key{RET} or @kbd{S-@key{TAB}} in this row. Also, this row
2175 is selected for a global recalculation with @kbd{C-u C-c *}. Unmarked
2176 lines will be left alone by this command.
2178 Selects this line for global recalculation with @kbd{C-u C-c *}, but
2179 not for automatic recalculation. Use this when automatic
2180 recalculation slows down editing too much.
2182 Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}.
2183 All lines that should be recalculated should be marked with @samp{#}
2186 Do not export this line. Useful for lines that contain the narrowing
2190 Finally, just to whet your appetite on what can be done with the
2191 fantastic @file{calc} package, here is a table that computes the Taylor
2192 series of degree @code{n} at location @code{x} for a couple of
2197 |---+-------------+---+-----+--------------------------------------|
2198 | | Func | n | x | Result |
2199 |---+-------------+---+-----+--------------------------------------|
2200 | # | exp(x) | 1 | x | 1 + x |
2201 | # | exp(x) | 2 | x | 1 + x + x^2 / 2 |
2202 | # | exp(x) | 3 | x | 1 + x + x^2 / 2 + x^3 / 6 |
2203 | # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 |
2204 | # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2 |
2205 | * | tan(x) | 3 | x | 0.0175 x + 1.77e-6 x^3 |
2206 |---+-------------+---+-----+--------------------------------------|
2207 #+TBLFM: $5=taylor($2,$4,$3);n3
2211 @node Hyperlinks, TODO Items, Tables, Top
2215 Like HTML, Org provides links inside a file, external links to
2216 other files, Usenet articles, emails, and much more.
2219 * Link format:: How links in Org are formatted
2220 * Internal links:: Links to other places in the current file
2221 * External links:: URL-like links to the world
2222 * Handling links:: Creating, inserting and following
2223 * Using links outside Org:: Linking from my C source code?
2224 * Link abbreviations:: Shortcuts for writing complex links
2225 * Search options:: Linking to a specific location
2226 * Custom searches:: When the default search is not enough
2229 @node Link format, Internal links, Hyperlinks, Hyperlinks
2230 @section Link format
2232 @cindex format, of links
2234 Org will recognize plain URL-like links and activate them as
2235 clickable links. The general link format, however, looks like this:
2238 [[link][description]] @r{or alternatively} [[link]]
2241 Once a link in the buffer is complete (all brackets present), Org
2242 will change the display so that @samp{description} is displayed instead
2243 of @samp{[[link][description]]} and @samp{link} is displayed instead of
2244 @samp{[[link]]}. Links will be highlighted in the face @code{org-link},
2245 which by default is an underlined face. You can directly edit the
2246 visible part of a link. Note that this can be either the @samp{link}
2247 part (if there is no description) or the @samp{description} part. To
2248 edit also the invisible @samp{link} part, use @kbd{C-c C-l} with the
2251 If you place the cursor at the beginning or just behind the end of the
2252 displayed text and press @key{BACKSPACE}, you will remove the
2253 (invisible) bracket at that location. This makes the link incomplete
2254 and the internals are again displayed as plain text. Inserting the
2255 missing bracket hides the link internals again. To show the
2256 internal structure of all links, use the menu entry
2257 @code{Org->Hyperlinks->Literal links}.
2259 @node Internal links, External links, Link format, Hyperlinks
2260 @section Internal links
2261 @cindex internal links
2262 @cindex links, internal
2263 @cindex targets, for links
2265 If the link does not look like a URL, it is considered to be internal in
2266 the current file. Links such as @samp{[[My Target]]} or @samp{[[My
2267 Target][Find my target]]} lead to a text search in the current file.
2268 The link can be followed with @kbd{C-c C-o} when the cursor is on the
2269 link, or with a mouse click (@pxref{Handling links}). The preferred
2270 match for such a link is a dedicated target: the same string in double
2271 angular brackets. Targets may be located anywhere; sometimes it is
2272 convenient to put them into a comment line. For example
2278 @noindent In HTML export (@pxref{HTML export}), such targets will become
2279 named anchors for direct access through @samp{http} links@footnote{Note
2280 that text before the first headline is usually not exported, so the
2281 first such target should be after the first headline.}.
2283 If no dedicated target exists, Org will search for the words in the
2284 link. In the above example the search would be for @samp{my target}.
2285 Links starting with a star like @samp{*My Target} restrict the search to
2286 headlines. When searching, Org mode will first try an exact match, but
2287 then move on to more and more lenient searches. For example, the link
2288 @samp{[[*My Targets]]} will find any of the following:
2292 ** TODO my targets are bright
2293 ** my 20 targets are
2296 To insert a link targeting a headline, in-buffer completion can be used.
2297 Just type a star followed by a few optional letters into the buffer and
2298 press @kbd{M-@key{TAB}}. All headlines in the current buffer will be
2299 offered as completions. @xref{Handling links}, for more commands
2302 Following a link pushes a mark onto Org's own mark ring. You can
2303 return to the previous position with @kbd{C-c &}. Using this command
2304 several times in direct succession goes back to positions recorded
2308 * Radio targets:: Make targets trigger links in plain text
2311 @node Radio targets, , Internal links, Internal links
2312 @subsection Radio targets
2313 @cindex radio targets
2314 @cindex targets, radio
2315 @cindex links, radio targets
2317 Org can automatically turn any occurrences of certain target names
2318 in normal text into a link. So without explicitly creating a link, the
2319 text connects to the target radioing its position. Radio targets are
2320 enclosed by triple angular brackets. For example, a target @samp{<<<My
2321 Target>>>} causes each occurrence of @samp{my target} in normal text to
2322 become activated as a link. The Org file is scanned automatically
2323 for radio targets only when the file is first loaded into Emacs. To
2324 update the target list during editing, press @kbd{C-c C-c} with the
2325 cursor on or at a target.
2327 @node External links, Handling links, Internal links, Hyperlinks
2328 @section External links
2329 @cindex links, external
2330 @cindex external links
2331 @cindex links, external
2339 @cindex WANDERLUST links
2341 @cindex USENET links
2346 Org supports links to files, websites, Usenet and email messages,
2347 BBDB database entries and links to both IRC conversations and their
2348 logs. External links are URL-like locators. They start with a short
2349 identifying string followed by a colon. There can be no space after
2350 the colon. The following list shows examples for each link type.
2353 http://www.astro.uva.nl/~dominik @r{on the web}
2354 file:/home/dominik/images/jupiter.jpg @r{file, absolute path}
2355 file:papers/last.pdf @r{file, relative path}
2356 news:comp.emacs @r{Usenet link}
2357 mailto:adent@@galaxy.net @r{Mail link}
2358 vm:folder @r{VM folder link}
2359 vm:folder#id @r{VM message link}
2360 vm://myself@@some.where.org/folder#id @r{VM on remote machine}
2361 wl:folder @r{WANDERLUST folder link}
2362 wl:folder#id @r{WANDERLUST message link}
2363 mhe:folder @r{MH-E folder link}
2364 mhe:folder#id @r{MH-E message link}
2365 rmail:folder @r{RMAIL folder link}
2366 rmail:folder#id @r{RMAIL message link}
2367 gnus:group @r{Gnus group link}
2368 gnus:group#id @r{Gnus article link}
2369 bbdb:Richard Stallman @r{BBDB link}
2370 irc:/irc.com/#emacs/bob @r{IRC link}
2371 shell:ls *.org @r{A shell command}
2372 elisp:(find-file-other-frame "Elisp.org") @r{An elisp form to evaluate}
2375 A link should be enclosed in double brackets and may contain a
2376 descriptive text to be displayed instead of the URL (@pxref{Link
2377 format}), for example:
2380 [[http://www.gnu.org/software/emacs/][GNU Emacs]]
2384 If the description is a file name or URL that points to an image, HTML
2385 export (@pxref{HTML export}) will inline the image as a clickable
2386 button. If there is no description at all and the link points to an
2388 that image will be inlined into the exported HTML file.
2390 @cindex angular brackets, around links
2391 @cindex plain text external links
2392 Org also finds external links in the normal text and activates them
2393 as links. If spaces must be part of the link (for example in
2394 @samp{bbdb:Richard Stallman}), or if you need to remove ambiguities
2395 about the end of the link, enclose them in angular brackets.
2397 @node Handling links, Using links outside Org, External links, Hyperlinks
2398 @section Handling links
2399 @cindex links, handling
2401 Org provides methods to create a link in the correct syntax, to
2402 insert it into an Org file, and to follow the link.
2406 @cindex storing links
2408 Store a link to the current location. This is a @emph{global} command
2409 which can be used in any buffer to create a link. The link will be
2410 stored for later insertion into an Org buffer (see below). For
2411 Org files, if there is a @samp{<<target>>} at the cursor, the
2412 link points to the target. Otherwise it points to the current
2413 headline. For VM, Rmail, Wanderlust, MH-E, Gnus and BBDB buffers, the
2414 link will indicate the current article/entry. For W3 and W3M buffers,
2415 the link goes to the current URL. For IRC links, if you set the
2416 variable @code{org-irc-link-to-logs} to non-nil then @kbd{C-c l} will
2417 store a @samp{file:/} style link to the relevant point in the logs for
2418 the current conversation. Otherwise an @samp{irc:/} style link to the
2419 user/channel/server under the point will be stored. For any other
2420 files, the link will point to the file, with a search string
2421 (@pxref{Search options}) pointing to the contents of the current line.
2422 If there is an active region, the selected words will form the basis
2423 of the search string. If the automatically created link is not
2424 working correctly or accurately enough, you can write custom functions
2425 to select the search string and to do the search for particular file
2426 types - see @ref{Custom searches}. The key binding @kbd{C-c l} is
2427 only a suggestion - see @ref{Installation}.
2430 @cindex link completion
2431 @cindex completion, of links
2432 @cindex inserting links
2434 Insert a link. This prompts for a link to be inserted into the buffer. You
2435 can just type a link, using text for an internal link, or one of the link
2436 type prefixes mentioned in the examples above. All links stored during the
2437 current session are part of the history for this prompt, so you can access
2438 them with @key{up} and @key{down} (or @kbd{M-p/n}). Completion, on the other
2439 hand, will help you to insert valid link prefixes like @samp{http:} or
2440 @samp{ftp:}, including the prefixes defined through link abbreviations
2441 (@pxref{Link abbreviations}). The link will be inserted into the
2442 buffer@footnote{After insertion of a stored link, the link will be removed
2443 from the list of stored links. To keep it in the list later use, use a
2444 triple @kbd{C-u} prefix argument to @kbd{C-c C-l}, or configure the option
2445 @code{org-keep-stored-link-after-insertion}.}, along with a descriptive text.
2446 If some text was selected when this command is called, the selected text
2447 becomes the default description.@* Note that you don't have to use this
2448 command to insert a link. Links in Org are plain text, and you can type
2449 or paste them straight into the buffer. By using this command, the links are
2450 automatically enclosed in double brackets, and you will be asked for the
2451 optional descriptive text.
2453 @c If the link is a @samp{file:} link and
2454 @c the linked file is located in the same directory as the current file or
2455 @c a subdirectory of it, the path of the file will be inserted relative to
2456 @c the current directory.
2459 @cindex file name completion
2460 @cindex completion, of file names
2462 When @kbd{C-c C-l} is called with a @kbd{C-u} prefix argument, a link to
2463 a file will be inserted and you may use file name completion to select
2464 the name of the file. The path to the file is inserted relative to the
2465 directory of the current org file, if the linked file is in the current
2466 directory or in a sub-directory of it, or if the path is written relative
2467 to the current directory using @samp{../}. Otherwise an absolute path
2468 is used, if possible with @samp{~/} for your home directory. You can
2469 force an absolute path with two @kbd{C-u} prefixes.
2471 @item C-c C-l @r{(with cursor on existing link)}
2472 When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit the
2473 link and description parts of the link.
2475 @cindex following links
2478 Open link at point. This will launch a web browser for URLs (using
2479 @command{browse-url-at-point}), run VM/MH-E/Wanderlust/Rmail/Gnus/BBDB
2480 for the corresponding links, and execute the command in a shell link.
2481 When the cursor is on an internal link, this commands runs the
2482 corresponding search. When the cursor is on a TAG list in a headline,
2483 it creates the corresponding TAGS view. If the cursor is on a time
2484 stamp, it compiles the agenda for that date. Furthermore, it will visit
2485 text and remote files in @samp{file:} links with Emacs and select a
2486 suitable application for local non-text files. Classification of files
2487 is based on file extension only. See option @code{org-file-apps}. If
2488 you want to override the default application and visit the file with
2489 Emacs, use a @kbd{C-u} prefix.
2495 On links, @kbd{mouse-2} will open the link just as @kbd{C-c C-o}
2496 would. Under Emacs 22, also @kbd{mouse-1} will follow a link.
2500 Like @kbd{mouse-2}, but force file links to be opened with Emacs, and
2501 internal links to be displayed in another window@footnote{See the
2502 variable @code{org-display-internal-link-with-indirect-buffer}}.
2507 Push the current position onto the mark ring, to be able to return
2508 easily. Commands following an internal link do this automatically.
2510 @cindex links, returning to
2513 Jump back to a recorded position. A position is recorded by the
2514 commands following internal links, and by @kbd{C-c %}. Using this
2515 command several times in direct succession moves through a ring of
2516 previously recorded positions.
2520 @cindex links, finding next/previous
2523 Move forward/backward to the next link in the buffer. At the limit of
2524 the buffer, the search fails once, and then wraps around. The key
2525 bindings for this are really too long, you might want to bind this also
2526 to @kbd{C-n} and @kbd{C-p}
2528 (add-hook 'org-load-hook
2530 (define-key 'org-mode-map "\C-n" 'org-next-link)
2531 (define-key 'org-mode-map "\C-p" 'org-previous-link)))
2535 @node Using links outside Org, Link abbreviations, Handling links, Hyperlinks
2536 @section Using links outside Org
2538 You can insert and follow links that have Org syntax not only in
2539 Org, but in any Emacs buffer. For this, you should create two
2540 global commands, like this (please select suitable global keys
2544 (global-set-key "\C-c L" 'org-insert-link-global)
2545 (global-set-key "\C-c o" 'org-open-at-point-global)
2548 @node Link abbreviations, Search options, Using links outside Org, Hyperlinks
2549 @section Link abbreviations
2550 @cindex link abbreviations
2551 @cindex abbreviation, links
2553 Long URLs can be cumbersome to type, and often many similar links are
2554 needed in a document. For this you can use link abbreviations. An
2555 abbreviated link looks like this
2558 [[linkword:tag][description]]
2562 where the tag is optional. Such abbreviations are resolved according to
2563 the information in the variable @code{org-link-abbrev-alist} that
2564 relates the linkwords to replacement text. Here is an example:
2568 (setq org-link-abbrev-alist
2569 '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
2570 ("google" . "http://www.google.com/search?q=")
2571 ("ads" . "http://adsabs.harvard.edu/cgi-bin/
2572 nph-abs_connect?author=%s&db_key=AST")))
2576 If the replacement text contains the string @samp{%s}, it will be
2577 replaced with the tag. Otherwise the tag will be appended to the string
2578 in order to create the link. You may also specify a function that will
2579 be called with the tag as the only argument to create the link.
2581 With the above setting, you could link to a specific bug with
2582 @code{[[bugzilla:129]]}, search the web for @samp{OrgMode} with
2583 @code{[[google:OrgMode]]} and find out what the Org author is
2584 doing besides Emacs hacking with @code{[[ads:Dominik,C]]}.
2586 If you need special abbreviations just for a single Org buffer, you
2587 can define them in the file with
2590 #+LINK: bugzilla http://10.1.2.9/bugzilla/show_bug.cgi?id=
2591 #+LINK: google http://www.google.com/search?q=%s
2595 In-buffer completion @pxref{Completion} can be used after @samp{[} to
2596 complete link abbreviations.
2598 @node Search options, Custom searches, Link abbreviations, Hyperlinks
2599 @section Search options in file links
2600 @cindex search option in file links
2601 @cindex file links, searching
2603 File links can contain additional information to make Emacs jump to a
2604 particular location in the file when following a link. This can be a
2605 line number or a search option after a double@footnote{For backward
2606 compatibility, line numbers can also follow a single colon.} colon. For
2607 example, when the command @kbd{C-c l} creates a link (@pxref{Handling
2608 links}) to a file, it encodes the words in the current line as a search
2609 string that can be used to find this line back later when following the
2610 link with @kbd{C-c C-o}.
2612 Here is the syntax of the different ways to attach a search to a file
2613 link, together with an explanation:
2616 [[file:~/code/main.c::255]]
2617 [[file:~/xx.org::My Target]]
2618 [[file:~/xx.org::*My Target]]
2619 [[file:~/xx.org::/regexp/]]
2626 Search for a link target @samp{<<My Target>>}, or do a text search for
2627 @samp{my target}, similar to the search in internal links, see
2628 @ref{Internal links}. In HTML export (@pxref{HTML export}), such a file
2629 link will become an HTML reference to the corresponding named anchor in
2632 In an Org file, restrict search to headlines.
2634 Do a regular expression search for @code{regexp}. This uses the Emacs
2635 command @code{occur} to list all matches in a separate window. If the
2636 target file is in Org mode, @code{org-occur} is used to create a
2637 sparse tree with the matches.
2638 @c If the target file is a directory,
2639 @c @code{grep} will be used to search all files in the directory.
2642 As a degenerate case, a file link with an empty file name can be used
2643 to search the current file. For example, @code{[[file:::find me]]} does
2644 a search for @samp{find me} in the current file, just as
2645 @samp{[[find me]]} would.
2647 @node Custom searches, , Search options, Hyperlinks
2648 @section Custom Searches
2649 @cindex custom search strings
2650 @cindex search strings, custom
2652 The default mechanism for creating search strings and for doing the
2653 actual search related to a file link may not work correctly in all
2654 cases. For example, BibTeX database files have many entries like
2655 @samp{year="1993"} which would not result in good search strings,
2656 because the only unique identification for a BibTeX entry is the
2659 If you come across such a problem, you can write custom functions to set
2660 the right search string for a particular file type, and to do the search
2661 for the string in the file. Using @code{add-hook}, these functions need
2662 to be added to the hook variables
2663 @code{org-create-file-search-functions} and
2664 @code{org-execute-file-search-functions}. See the docstring for these
2665 variables for more information. Org actually uses this mechanism
2666 for Bib@TeX{} database files, and you can use the corresponding code as
2667 an implementation example. Search for @samp{BibTeX links} in the source
2672 @node TODO Items, Tags, Hyperlinks, Top
2676 Org mode does not maintain TODO lists as separate documents. Instead,
2677 TODO items are an integral part of the notes file, because TODO items
2678 usually come up while taking notes! With Org mode, simply mark any
2679 entry in a tree as being a TODO item. In this way, information is not
2680 duplicated, and the entire context from which the TODO item emerged is
2683 Of course, this technique for managing TODO items scatters them
2684 throughout your notes file. Org mode compensates for this by providing
2685 methods to give you an overview of all the things that you have to do.
2688 * TODO basics:: Marking and displaying TODO entries
2689 * TODO extensions:: Workflow and assignments
2690 * Progress logging:: Dates and notes for progress
2691 * Priorities:: Some things are more important than others
2692 * Breaking down tasks:: Splitting a task into manageable pieces
2693 * Checkboxes:: Tick-off lists
2696 @node TODO basics, TODO extensions, TODO Items, TODO Items
2697 @section Basic TODO functionality
2699 Any headline becomes a TODO item when it starts with the word
2700 @samp{TODO}, for example:
2703 *** TODO Write letter to Sam Fortune
2707 The most important commands to work with TODO entries are:
2711 @cindex cycling, of TODO states
2713 Rotate the TODO state of the current item among
2716 ,-> (unmarked) -> TODO -> DONE --.
2717 '--------------------------------'
2720 The same rotation can also be done ``remotely'' from the timeline and
2721 agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
2725 Select a specific keyword using completion or (if it has been set up)
2726 the fast selection interface. For the latter, you need to assign keys
2727 to TODO states, see @ref{Per-file keywords} and @ref{Setting tags} for
2730 @kindex S-@key{right}
2731 @kindex S-@key{left}
2734 Select the following/preceding TODO state, similar to cycling. Useful
2735 mostly if more than two TODO states are possible (@pxref{TODO
2739 @cindex sparse tree, for TODO
2742 View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}). Folds
2743 the entire buffer, but shows all TODO items and the headings hierarchy
2744 above them. With a prefix argument, search for a specific TODO. You will be
2745 prompted for the keyword, and you can also give a list of keywords like
2746 @code{KWD1|KWD2|...}. With numeric prefix argument N, show the tree for the
2747 Nth keyword in the variable @code{org-todo-keywords}. With two prefix
2748 arguments, find all TODO and DONE entries.
2751 Show the global TODO list. Collects the TODO items from all agenda
2752 files (@pxref{Agenda Views}) into a single buffer. The new buffer will
2753 be in @code{agenda-mode}, which provides commands to examine and
2754 manipulate the TODO entries from the new buffer (@pxref{Agenda
2755 commands}). @xref{Global TODO list}, for more information.
2756 @kindex S-M-@key{RET}
2758 Insert a new TODO entry below the current one.
2761 @node TODO extensions, Progress logging, TODO basics, TODO Items
2762 @section Extended use of TODO keywords
2763 @cindex extended TODO keywords
2765 By default, marked TODO entries have one of only two states: TODO and
2766 DONE. Org mode allows you to classify TODO items in more complex ways
2767 with @emph{TODO keywords} (stored in @code{org-todo-keywords}). With
2768 special setup, the TODO keyword system can work differently in different
2771 Note that @i{tags} are another way to classify headlines in general and
2772 TODO items in particular (@pxref{Tags}).
2775 * Workflow states:: From TODO to DONE in steps
2776 * TODO types:: I do this, Fred does the rest
2777 * Multiple sets in one file:: Mixing it all, and still finding your way
2778 * Fast access to TODO states:: Single letter selection of a state
2779 * Per-file keywords:: Different files, different requirements
2780 * Faces for TODO keywords:: Highlighting states
2783 @node Workflow states, TODO types, TODO extensions, TODO extensions
2784 @subsection TODO keywords as workflow states
2785 @cindex TODO workflow
2786 @cindex workflow states as TODO keywords
2788 You can use TODO keywords to indicate different @emph{sequential} states
2789 in the process of working on an item, for example@footnote{Changing
2790 this variable only becomes effective after restarting Org mode in a
2794 (setq org-todo-keywords
2795 '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
2798 The vertical bar separates the TODO keywords (states that @emph{need
2799 action}) from the DONE states (which need @emph{no further action}. If
2800 you don't provide the separator bar, the last state is used as the DONE
2802 @cindex completion, of TODO keywords
2803 With this setup, the command @kbd{C-c C-t} will cycle an entry from TODO
2804 to FEEDBACK, then to VERIFY, and finally to DONE and DELEGATED. You may
2805 also use a numeric prefix argument to quickly select a specific state. For
2806 example @kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
2807 Or you can use @kbd{S-left} to go backward through the sequence. If you
2808 define many keywords, you can use in-buffer completion
2809 (@pxref{Completion}) or even a special one-key selection scheme
2810 (@pxref{Fast access to TODO states}) to insert these words into the
2811 buffer. Changing a TODO state can be logged with a timestamp, see
2812 @ref{Tracking TODO state changes} for more information.
2814 @node TODO types, Multiple sets in one file, Workflow states, TODO extensions
2815 @subsection TODO keywords as types
2817 @cindex names as TODO keywords
2818 @cindex types as TODO keywords
2820 The second possibility is to use TODO keywords to indicate different
2821 @emph{types} of action items. For example, you might want to indicate
2822 that items are for ``work'' or ``home''. Or, when you work with several
2823 people on a single project, you might want to assign action items
2824 directly to persons, by using their names as TODO keywords. This would
2825 be set up like this:
2828 (setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))
2831 In this case, different keywords do not indicate a sequence, but rather
2832 different types. So the normal work flow would be to assign a task to a
2833 person, and later to mark it DONE. Org mode supports this style by adapting
2834 the workings of the command @kbd{C-c C-t}@footnote{This is also true for the
2835 @kbd{t} command in the timeline and agenda buffers.}. When used several
2836 times in succession, it will still cycle through all names, in order to first
2837 select the right type for a task. But when you return to the item after some
2838 time and execute @kbd{C-c C-t} again, it will switch from any name directly
2839 to DONE. Use prefix arguments or completion to quickly select a specific
2840 name. You can also review the items of a specific TODO type in a sparse tree
2841 by using a numeric prefix to @kbd{C-c C-v}. For example, to see all things
2842 Lucy has to do, you would use @kbd{C-3 C-c C-v}. To collect Lucy's items
2843 from all agenda files into a single buffer, you would use the numeric prefix
2844 argument as well when creating the global TODO list: @kbd{C-3 C-c t}.
2846 @node Multiple sets in one file, Fast access to TODO states, TODO types, TODO extensions
2847 @subsection Multiple keyword sets in one file
2848 @cindex TODO keyword sets
2850 Sometimes you may want to use different sets of TODO keywords in
2851 parallel. For example, you may want to have the basic
2852 @code{TODO}/@code{DONE}, but also a workflow for bug fixing, and a
2853 separate state indicating that an item has been canceled (so it is not
2854 DONE, but also does not require action). Your setup would then look
2858 (setq org-todo-keywords
2859 '((sequence "TODO" "|" "DONE")
2860 (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED")
2861 (sequence "|" "CANCELED")))
2864 The keywords should all be different, this helps Org mode to keep track
2865 of which subsequence should be used for a given entry. In this setup,
2866 @kbd{C-c C-t} only operates within a subsequence, so it switches from
2867 @code{DONE} to (nothing) to @code{TODO}, and from @code{FIXED} to
2868 (nothing) to @code{REPORT}. Therefore you need a mechanism to initially
2869 select the correct sequence. Besides the obvious ways like typing a
2870 keyword or using completion, you may also apply the following commands:
2873 @kindex C-S-@key{right}
2874 @kindex C-S-@key{left}
2875 @item C-S-@key{right}
2876 @itemx C-S-@key{left}
2877 These keys jump from one TODO subset to the next. In the above example,
2878 @kbd{C-S-@key{right}} would jump from @code{TODO} or @code{DONE} to
2879 @code{REPORT}, and any of the words in the second row to @code{CANCELED}.
2880 @kindex S-@key{right}
2881 @kindex S-@key{left}
2884 @kbd{S-@key{<left>}} and @kbd{S-@key{<right>}} and walk through
2885 @emph{all} keywords from all sets, so for example @kbd{S-@key{<right>}}
2886 would switch from @code{DONE} to @code{REPORT} in the example above.
2889 @node Fast access to TODO states, Per-file keywords, Multiple sets in one file, TODO extensions
2890 @subsection Fast access to TODO states
2892 If you would like to quickly change an entry to an arbitrary TODO state
2893 instead of cycling through the states, you can set up keys for
2894 single-letter access to the states. This is done by adding the section
2895 key after each keyword, in parenthesis. For example:
2898 (setq org-todo-keywords
2899 '((sequence "TODO(t)" "|" "DONE(d)")
2900 (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
2901 (sequence "|" "CANCELED(c)")))
2904 If you then press @code{C-u C-c C-t} followed by the selection key, the
2905 entry will be switched to this state. @key{SPC} can be used to remove
2906 any TODO keyword from an entry. Should you like this way of selecting
2907 TODO states a lot, you might want to set the variable
2908 @code{org-use-fast-todo-selection} to @code{t} and make this behavior
2909 the default. Check also the variable
2910 @code{org-fast-tag-selection-include-todo}, it allows to change the TODO
2911 state through the tags interface (@pxref{Setting tags}), in case you
2912 like to mingle the two concepts.
2914 @node Per-file keywords, Faces for TODO keywords, Fast access to TODO states, TODO extensions
2915 @subsection Setting up keywords for individual files
2916 @cindex keyword options
2917 @cindex per-file keywords
2919 It can be very useful to use different aspects of the TODO mechanism in
2920 different files. For file-local settings, you need to add special lines
2921 to the file which set the keywords and interpretation for that file
2922 only. For example, to set one of the two examples discussed above, you
2923 need one of the following lines, starting in column zero anywhere in the
2927 #+SEQ_TODO: TODO FEEDBACK VERIFY | DONE CANCELED
2931 #+TYP_TODO: Fred Sara Lucy Mike | DONE
2934 A setup for using several sets in parallel would be:
2937 #+SEQ_TODO: TODO | DONE
2938 #+SEQ_TODO: REPORT BUG KNOWNCAUSE | FIXED
2939 #+SEQ_TODO: | CANCELED
2942 @cindex completion, of option keywords
2944 @noindent To make sure you are using the correct keyword, type
2945 @samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
2947 @cindex DONE, final TODO keyword
2948 Remember that the keywords after the vertical bar (or the last keyword
2949 if no bar is there) must always mean that the item is DONE (although you
2950 may use a different word). After changing one of these lines, use
2951 @kbd{C-c C-c} with the cursor still in the line to make the changes
2952 known to Org mode@footnote{Org mode parses these lines only when
2953 Org mode is activated after visiting a file. @kbd{C-c C-c} with the
2954 cursor in a line starting with @samp{#+} is simply restarting Org mode
2955 for the current buffer.}.
2957 @node Faces for TODO keywords, , Per-file keywords, TODO extensions
2958 @subsection Faces for TODO keywords
2959 @cindex faces, for TODO keywords
2961 Org mode highlights TODO keywords with special faces: @code{org-todo}
2962 for keywords indicating that an item still has to be acted upon, and
2963 @code{org-done} for keywords indicating that an item is finished. If
2964 you are using more than 2 different states, you might want to use
2965 special faces for some of them. This can be done using the variable
2966 @code{org-todo-keyword-faces}. For example:
2969 (setq org-todo-keyword-faces
2970 '(("TODO" . org-warning)
2971 ("DEFERRED" . shadow)
2972 ("CANCELED" . (:foreground "blue" :weight bold))))
2975 While using a list with face properties as shown for CANCELED
2976 @emph{should} work, this does not aways seem to be the case. If
2977 necessary, define a special face and use that.
2980 @node Progress logging, Priorities, TODO extensions, TODO Items
2981 @section Progress logging
2982 @cindex progress logging
2983 @cindex logging, of progress
2985 Org mode can automatically record a time stamp and possibly a note when
2986 you mark a TODO item as DONE, or even each time you change the state of
2987 a TODO item. This system is highly configurable, settings can be on a
2988 per-keyword basis and can be localized to a file or even a subtree. For
2989 information on how to clock working time for a task, see @ref{Clocking
2993 * Closing items:: When was this entry marked DONE?
2994 * Tracking TODO state changes:: When did the status change?
2997 @node Closing items, Tracking TODO state changes, Progress logging, Progress logging
2998 @subsection Closing items
3000 The most basic logging is to keep track of @emph{when} a certain TODO
3001 item was finished. This is achieved with@footnote{The corresponding
3002 in-buffer setting is: @code{#+STARTUP: logdone}}.
3005 (setq org-log-done 'time)
3009 Then each time you turn an entry from a TODO (not-done) state into any
3010 of the DONE states, a line @samp{CLOSED: [timestamp]} will be inserted
3011 just after the headline. If you turn the entry back into a TODO item
3012 through further state cycling, that line will be removed again. If you
3013 want to record a note along with the timestamp, use@footnote{The
3014 corresponding in-buffer setting is: @code{#+STARTUP: lognotedone}}
3017 (setq org-log-done 'note)
3021 You will then be prompted for a note, and that note will be stored below
3022 the entry with a @samp{Closing Note} heading.
3024 In the timeline (@pxref{Timeline}) and in the agenda
3025 (@pxref{Weekly/daily agenda}), you can then use the @kbd{l} key to
3026 display the TODO items with a @samp{CLOSED} timestamp on each day,
3027 giving you an overview of what has been done.
3029 @node Tracking TODO state changes, , Closing items, Progress logging
3030 @subsection Tracking TODO state changes
3032 When TODO keywords are used as workflow states (@pxref{Workflow
3033 states}), you might want to keep track of when a state change occurred
3034 and maybe take a note about this change. Since it is normally too much
3035 to record a note for every state, Org mode expects configuration on a
3036 per-keyword basis for this. This is achieved by adding special markers
3037 @samp{!} (for a time stamp) and @samp{@@} (for a note) in parenthesis
3038 after each keyword. For example, with the setting
3041 (setq org-todo-keywords
3042 '((sequence "TODO(t)" "WAIT(w@@/!)" "|" "DONE(d!)" "CANCELED(c@@)")))
3046 you not only define global TODO keywords and fast access keys, but also
3047 request that a time is recorded when the entry is turned into
3048 DONE@footnote{It is possible that Org mode will record two time stamps
3049 when you are using both @code{org-log-done} and state change logging.
3050 However, it will never prompt for two notes - if you have configured
3051 both, the state change recording note will take precedence and cancel
3052 the @samp{Closing Note}.}, and that a note is recorded when switching to
3053 WAIT or CANCELED. The setting for WAIT is even more special: The
3054 @samp{!} after the slash means that in addition to the note taken when
3055 entering the state, a time stamp should be recorded when @i{leaving} the
3056 WAIT state, if and only if the @i{target} state does not configure
3057 logging for entering it. So it has no effect when switching from WAIT
3058 to DONE, because DONE is configured to record a timestamp only. But
3059 when switching from WAIT back to TODO, the @samp{/!} in the WAIT
3060 setting now triggers a timestamp even though TODO has no logging
3063 You can use the exact same syntax for setting logging preferences local
3066 #+SEQ_TODO: TODO(t) WAIT(w@@/!) | DONE(d!) CANCELED(c@@)
3069 In order to define logging settings that are local to a subtree or a
3070 single item, define a LOGGING property in this entry. Any non-empty
3071 LOGGING property resets all logging settings to nil. You may then turn
3072 on logging for this specific tree using STARTUP keywords like
3073 @code{lognotedone} or @code{logrepeat}, as well as adding state specific
3074 settings like @code{TODO(!)}. For example
3077 * TODO Log each state with only a time
3079 :LOGGING: TODO(!) WAIT(!) DONE(!) CANCELED(!)
3081 * TODO Only log when switching to WAIT, and when repeating
3083 :LOGGING: WAIT(@@) logrepeat
3085 * TODO No logging at all
3092 @node Priorities, Breaking down tasks, Progress logging, TODO Items
3096 If you use Org mode extensively, you may end up enough TODO items that
3097 it starts to make sense to prioritize them. Prioritizing can be done by
3098 placing a @emph{priority cookie} into the headline of a TODO item, like
3102 *** TODO [#A] Write letter to Sam Fortune
3106 By default, Org mode supports three priorities: @samp{A}, @samp{B}, and
3107 @samp{C}. @samp{A} is the highest priority. An entry without a cookie
3108 is treated as priority @samp{B}. Priorities make a difference only in
3109 the agenda (@pxref{Weekly/daily agenda}); outside the agenda, they have
3110 no inherent meaning to Org mode.
3112 Priorities can be attached to any outline tree entries; they do not need
3118 Set the priority of the current headline. The command prompts for a
3119 priority character @samp{A}, @samp{B} or @samp{C}. When you press
3120 @key{SPC} instead, the priority cookie is removed from the headline.
3121 The priorities can also be changed ``remotely'' from the timeline and
3122 agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
3125 @kindex S-@key{down}
3128 Increase/decrease priority of current headline@footnote{See also the
3129 option @code{org-priority-start-cycle-with-default'}.}. Note that these
3130 keys are also used to modify time stamps (@pxref{Creating timestamps}).
3131 Furthermore, these keys are also used by CUA mode (@pxref{Conflicts}).
3134 You can change the range of allowed priorities by setting the variables
3135 @code{org-highest-priority}, @code{org-lowest-priority}, and
3136 @code{org-default-priority}. For an individual buffer, you may set
3137 these values (highest, lowest, default) like this (please make sure that
3138 the highest priority is earlier in the alphabet than the lowest
3145 @node Breaking down tasks, Checkboxes, Priorities, TODO Items
3146 @section Breaking tasks down into subtasks
3147 @cindex tasks, breaking down
3149 It is often advisable to break down large tasks into smaller, manageable
3150 subtasks. You can do this by creating an outline tree below a TODO
3151 item, with detailed subtasks on the tree@footnote{To keep subtasks out
3152 of the global TODO list, see the
3153 @code{org-agenda-todo-list-sublevels}.}. Another possibility is the use
3154 of checkboxes to identify (a hierarchy of) a large number of subtasks
3155 (@pxref{Checkboxes}).
3158 @node Checkboxes, , Breaking down tasks, TODO Items
3162 Every item in a plain list (@pxref{Plain lists}) can be made into a
3163 checkbox by starting it with the string @samp{[ ]}. This feature is
3164 similar to TODO items (@pxref{TODO Items}), but is more lightweight.
3165 Checkboxes are not included into the global TODO list, so they are often
3166 great to split a task into a number of simple steps. Or you can use
3167 them in a shopping list. To toggle a checkbox, use @kbd{C-c C-c}, or
3168 use the mouse (thanks to Piotr Zielinski's @file{org-mouse.el}).
3170 Here is an example of a checkbox list.
3173 * TODO Organize party [2/4]
3174 - [-] call people [1/3]
3179 - [ ] think about what music to play
3180 - [X] talk to the neighbors
3183 Checkboxes work hierarchically, so if a checkbox item has children that
3184 are checkboxes, toggling one of the children checkboxes will make the
3185 parent checkbox reflect if none, some, or all of the children are
3188 @cindex statistics, for checkboxes
3189 @cindex checkbox statistics
3190 The @samp{[2/4]} and @samp{[1/3]} in the first and second line are
3191 cookies indicating how many checkboxes present in this entry have been
3192 checked off, and the total number of checkboxes are present. This can
3193 give you an idea on how many checkboxes remain, even without opening a
3194 folded entry. The cookies can be placed into a headline or into (the
3195 first line of) a plain list item. Each cookie covers all checkboxes
3196 structurally below the headline/item on which the cookie appear. You
3197 have to insert the cookie yourself by typing either @samp{[/]} or
3198 @samp{[%]}. With @samp{[/]} you get an @samp{n out of m} result, as in
3199 the examples above. With @samp{[%]} you get information about the
3200 percentage of checkboxes checked (in the above example, this would be
3201 @samp{[50%]} and @samp{[33%]}, respectively).
3203 @noindent The following commands work with checkboxes:
3208 Toggle checkbox at point. With a prefix argument, set it to @samp{[-]},
3209 which is considered to be an intermediate state.
3212 Toggle checkbox at point.
3215 If there is an active region, toggle the first checkbox in the region
3216 and set all remaining boxes to the same status as the first. If you
3217 want to toggle all boxes in the region independently, use a prefix
3220 If the cursor is in a headline, toggle checkboxes in the region between
3221 this headline and the next (so @emph{not} the entire subtree).
3223 If there is no active region, just toggle the checkbox at point.
3225 @kindex M-S-@key{RET}
3227 Insert a new item with a checkbox.
3228 This works only if the cursor is already in a plain list item
3229 (@pxref{Plain lists}).
3232 Update the checkbox statistics in the current outline entry. When
3233 called with a @kbd{C-u} prefix, update the entire file. Checkbox
3234 statistic cookies are updated automatically if you toggle checkboxes
3235 with @kbd{C-c C-c} and make new ones with @kbd{M-S-@key{RET}}. If you
3236 delete boxes or add/change them by hand, use this command to get things
3237 back into synch. Or simply toggle any checkbox twice with @kbd{C-c C-c}.
3240 @node Tags, Properties and Columns, TODO Items, Top
3243 @cindex headline tagging
3244 @cindex matching, tags
3245 @cindex sparse tree, tag based
3247 An excellent way to implement labels and contexts for cross-correlating
3248 information is to assign @i{tags} to headlines. Org mode has extensive
3251 Every headline can contain a list of tags; they occur at the end of the
3252 headline. Tags are normal words containing letters, numbers, @samp{_},
3253 and @samp{@@}. Tags must be preceded and followed by a single colon,
3254 e.g., @samp{:WORK:}. Several tags can be specified, as in
3255 @samp{:work:URGENT:}.
3258 * Tag inheritance:: Tags use the tree structure of the outline
3259 * Setting tags:: How to assign tags to a headline
3260 * Tag searches:: Searching for combinations of tags
3263 @node Tag inheritance, Setting tags, Tags, Tags
3264 @section Tag inheritance
3265 @cindex tag inheritance
3266 @cindex inheritance, of tags
3267 @cindex sublevels, inclusion into tags match
3269 @i{Tags} make use of the hierarchical structure of outline trees. If a
3270 heading has a certain tag, all subheadings will inherit the tag as
3271 well. For example, in the list
3274 * Meeting with the French group :work:
3275 ** Summary by Frank :boss:notes:
3276 *** TODO Prepare slides for him :action:
3280 the final heading will have the tags @samp{:work:}, @samp{:boss:},
3281 @samp{:notes:}, and @samp{:action:} even though the final heading is not
3282 explicitly marked with those tags. When executing tag searches and
3283 Org mode finds that a certain headline matches the search criterion, it
3284 will not check any sublevel headline, assuming that these also match and
3285 that the list of matches could become very long because of that. If you
3286 do want the sublevels be tested and listed as well, you may set the
3287 variable @code{org-tags-match-list-sublevels}. To limit tag inheritance
3288 to specific tags, or to turn it off entirely, use the variable
3289 @code{org-use-tag-inheritance}.
3291 @node Setting tags, Tag searches, Tag inheritance, Tags
3292 @section Setting tags
3293 @cindex setting tags
3294 @cindex tags, setting
3297 Tags can simply be typed into the buffer at the end of a headline.
3298 After a colon, @kbd{M-@key{TAB}} offers completion on tags. There is
3299 also a special command for inserting tags:
3304 @cindex completion, of tags
3305 Enter new tags for the current headline. Org mode will either offer
3306 completion or a special single-key interface for setting tags, see
3307 below. After pressing @key{RET}, the tags will be inserted and aligned
3308 to @code{org-tags-column}. When called with a @kbd{C-u} prefix, all
3309 tags in the current buffer will be aligned to that column, just to make
3310 things look nice. TAGS are automatically realigned after promotion,
3311 demotion, and TODO state changes (@pxref{TODO basics}).
3314 Org will support tag insertion based on a @emph{list of tags}. By
3315 default this list is constructed dynamically, containing all tags
3316 currently used in the buffer. You may also globally specify a hard list
3317 of tags with the variable @code{org-tag-alist}. Finally you can set
3318 the default tags for a given file with lines like
3321 #+TAGS: @@work @@home @@tennisclub
3322 #+TAGS: laptop car pc sailboat
3325 If you have globally defined your preferred set of tags using the
3326 variable @code{org-tag-alist}, but would like to use a dynamic tag list
3327 in a specific file, add an empty TAGS option line to that file:
3333 By default Org mode uses the standard minibuffer completion facilities for
3334 entering tags. However, it also implements another, quicker, tag selection
3335 method called @emph{fast tag selection}. This allows you to select and
3336 deselect tags with just a single key press. For this to work well you should
3337 assign unique letters to most of your commonly used tags. You can do this
3338 globally by configuring the variable @code{org-tag-alist} in your
3339 @file{.emacs} file. For example, you may find the need to tag many items in
3340 different files with @samp{:@@home:}. In this case you can set something
3344 (setq org-tag-alist '(("@@work" . ?w) ("@@home" . ?h) ("laptop" . ?l)))
3347 @noindent If the tag is only relevant to the file you are working on then you
3348 can, instead, set the TAGS option line as:
3351 #+TAGS: @@work(w) @@home(h) @@tennisclub(t) laptop(l) pc(p)
3355 You can also group together tags that are mutually exclusive. By using
3359 #+TAGS: @{ @@work(w) @@home(h) @@tennisclub(t) @} laptop(l) pc(p)
3362 @noindent you indicate that at most one of @samp{@@work}, @samp{@@home},
3363 and @samp{@@tennisclub} should be selected. Multiple such groups are allowed.
3365 @noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
3366 these lines to activate any changes.
3369 To set these mutually exclusive groups in the variable @code{org-mode-alist}
3370 you must use the dummy tags @code{:startgroup} and @code{:endgroup} instead
3371 of the braces. The previous example would be set globally by the following
3375 (setq org-tag-alist '((:startgroup . nil)
3376 ("@@work" . ?w) ("@@home" . ?h)
3377 ("@@tennisclub" . ?t)
3379 ("laptop" . ?l) ("pc" . ?p)))
3382 If at least one tag has a selection key then pressing @kbd{C-c C-c} will
3383 automatically present you with a special interface, listing inherited tags,
3384 the tags of the current headline, and a list of all valid tags with
3385 corresponding keys@footnote{Keys will automatically be assigned to tags which
3386 have no configured keys.}. In this interface, you can use the following
3391 Pressing keys assigned to tags will add or remove them from the list of
3392 tags in the current line. Selecting a tag in a group of mutually
3393 exclusive tags will turn off any other tags from that group.
3396 Enter a tag in the minibuffer, even if the tag is not in the predefined
3397 list. You will be able to complete on all tags present in the buffer.
3400 Clear all tags for this line.
3403 Accept the modified set.
3405 Abort without installing changes.
3407 If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}.
3409 Turn off groups of mutually exclusive tags. Use this to (as an
3410 exception) assign several tags from such a group.
3412 Toggle auto-exit after the next change (see below).
3413 If you are using expert mode, the first @kbd{C-c} will display the
3418 This method lets you assign tags to a headline with very few keys. With
3419 the above setup, you could clear the current tags and set @samp{@@home},
3420 @samp{laptop} and @samp{pc} tags with just the following keys: @kbd{C-c
3421 C-c @key{SPC} h l p @key{RET}}. Switching from @samp{@@home} to
3422 @samp{@@work} would be done with @kbd{C-c C-c w @key{RET}} or
3423 alternatively with @kbd{C-c C-c C-c w}. Adding the non-predefined tag
3424 @samp{Sarah} could be done with @kbd{C-c C-c @key{TAB} S a r a h
3425 @key{RET} @key{RET}}.
3427 If you find that most of the time, you need only a single key press to
3428 modify your list of tags, set the variable
3429 @code{org-fast-tag-selection-single-key}. Then you no longer have to
3430 press @key{RET} to exit fast tag selection - it will immediately exit
3431 after the first change. If you then occasionally need more keys, press
3432 @kbd{C-c} to turn off auto-exit for the current tag selection process
3433 (in effect: start selection with @kbd{C-c C-c C-c} instead of @kbd{C-c
3434 C-c}). If you set the variable to the value @code{expert}, the special
3435 window is not even shown for single-key tag selection, it comes up only
3436 when you press an extra @kbd{C-c}.
3438 @node Tag searches, , Setting tags, Tags
3439 @section Tag searches
3440 @cindex tag searches
3441 @cindex searching for tags
3443 Once a system of tags has been set up, it can be used to collect related
3444 information into special lists.
3451 Create a sparse tree with all headlines matching a tags search. With a
3452 @kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
3455 Create a global list of tag matches from all agenda files.
3456 @xref{Matching tags and properties}.
3459 Create a global list of tag matches from all agenda files, but check
3460 only TODO items and force checking subitems (see variable
3461 @code{org-tags-match-list-sublevels}).
3464 @cindex Boolean logic, for tag searches
3465 A @i{tags} search string can use Boolean operators @samp{&} for AND and
3466 @samp{|} for OR. @samp{&} binds more strongly than @samp{|}.
3467 Parenthesis are currently not implemented. A tag may also be preceded
3468 by @samp{-}, to select against it, and @samp{+} is syntactic sugar for
3469 positive selection. The AND operator @samp{&} is optional when @samp{+}
3470 or @samp{-} is present. Examples:
3474 Select headlines tagged @samp{:work:}, but discard those also tagged
3477 Selects lines tagged @samp{:work:} or @samp{:laptop:}.
3478 @item work|laptop&night
3479 Like before, but require the @samp{:laptop:} lines to be tagged also
3483 @cindex TODO keyword matching, with tags search
3484 If you are using multi-state TODO keywords (@pxref{TODO extensions}), it
3485 can be useful to also match on the TODO keyword. This can be done by
3486 adding a condition after a slash to a tags match. The syntax is similar
3487 to the tag matches, but should be applied with consideration: For
3488 example, a positive selection on several TODO keywords can not
3489 meaningfully be combined with boolean AND. However, @emph{negative
3490 selection} combined with AND can be meaningful. To make sure that only
3491 lines are checked that actually have any TODO keyword, use @kbd{C-c a
3492 M}, or equivalently start the TODO part after the slash with @samp{!}.
3497 Select @samp{:work:}-tagged TODO lines with the specific TODO
3498 keyword @samp{WAITING}.
3499 @item work/!-WAITING-NEXT
3500 Select @samp{:work:}-tagged TODO lines that are neither @samp{WAITING}
3502 @item work/+WAITING|+NEXT
3503 Select @samp{:work:}-tagged TODO lines that are either @samp{WAITING} or
3507 @cindex regular expressions, with tags search
3508 Any element of the tag/todo match can be a regular expression - in this
3509 case it must be enclosed in curly braces. For example,
3510 @samp{work+@{^boss.*@}} matches headlines that contain the tag
3511 @samp{:work:} and any tag @i{starting} with @samp{boss}.
3513 @cindex level, require for tags/property match
3514 @cindex category, require for tags/property match
3515 You can also require a headline to be of a certain level or category, by
3516 writing instead of any TAG an expression like @samp{LEVEL=3} or
3517 @samp{CATEGORY="work"}, respectively. For example, a search
3518 @samp{+LEVEL=3+boss/-DONE} lists all level three headlines that have the
3519 tag @samp{boss} and are @emph{not} marked with the TODO keyword DONE.
3521 @node Properties and Columns, Dates and Times, Tags, Top
3522 @chapter Properties and Columns
3525 Properties are a set of key-value pairs associated with an entry. There
3526 are two main applications for properties in Org mode. First, properties
3527 are like tags, but with a value. Second, you can use properties to
3528 implement (very basic) database capabilities in an Org buffer. For
3529 an example of the first application, imagine maintaining a file where
3530 you document bugs and plan releases of a piece of software. Instead of
3531 using tags like @code{:release_1:}, @code{:release_2:}, one can use a
3532 property, say @code{:Release:}, that in different subtrees has different
3533 values, such as @code{1.0} or @code{2.0}. For an example of the second
3534 application of properties, imagine keeping track of your music CD's,
3535 where properties could be things such as the album artist, date of
3536 release, number of tracks, and so on.
3538 Properties can be conveniently edited and viewed in column view
3539 (@pxref{Column view}).
3541 Properties are like tags, but with a value. For example, in a file
3542 where you document bugs and plan releases of a piece of software,
3543 instead of using tags like @code{:release_1:}, @code{:release_2:}, it
3544 can be more efficient to use a property @code{:Release:} with a value
3545 @code{1.0} or @code{2.0}. Second, you can use properties to implement
3546 (very basic) database capabilities in an Org buffer, for example to
3547 create a list of Music CD's you own. You can edit and view properties
3548 conveniently in column view (@pxref{Column view}).
3551 * Property syntax:: How properties are spelled out
3552 * Special properties:: Access to other Org mode features
3553 * Property searches:: Matching property values
3554 * Property inheritance:: Passing values down the tree
3555 * Column view:: Tabular viewing and editing
3556 * Property API:: Properties for Lisp programmers
3559 @node Property syntax, Special properties, Properties and Columns, Properties and Columns
3560 @section Property syntax
3561 @cindex property syntax
3562 @cindex drawer, for properties
3564 Properties are key-value pairs. They need to be inserted into a special
3565 drawer (@pxref{Drawers}) with the name @code{PROPERTIES}. Each property
3566 is specified on a single line, with the key (surrounded by colons)
3567 first, and the value after it. Here is an example:
3572 *** Goldberg Variations
3574 :Title: Goldberg Variations
3575 :Composer: J.S. Bach
3577 :Publisher: Deutsche Grammphon
3582 You may define the allowed values for a particular property @samp{:Xyz:}
3583 by setting a property @samp{:Xyz_ALL:}. This special property is
3584 @emph{inherited}, so if you set it in a level 1 entry, it will apply to
3585 the entire tree. When allowed values are defined, setting the
3586 corresponding property becomes easier and is less prone to typing
3587 errors. For the example with the CD collection, we can predefine
3588 publishers and the number of disks in a box like this:
3593 :NDisks_ALL: 1 2 3 4
3594 :Publisher_ALL: "Deutsche Grammophon" Phillips EMI
3598 If you want to set properties that can be inherited by any entry in a
3599 file, use a line like
3602 #+PROPERTY: NDisks_ALL 1 2 3 4
3605 Property values set with the global variable
3606 @code{org-global-properties} can be inherited by all entries in all
3610 The following commands help to work with properties:
3615 After an initial colon in a line, complete property keys. All keys used
3616 in the current file will be offered as possible completions.
3619 Set a property. This prompts for a property name and a value. If
3620 necessary, the property drawer is created as well.
3621 @item M-x org-insert-property-drawer
3622 Insert a property drawer into the current entry. The drawer will be
3623 inserted early in the entry, but after the lines with planning
3624 information like deadlines.
3627 With the cursor in a property drawer, this executes property commands.
3629 Set a property in the current entry. Both the property and the value
3630 can be inserted using completion.
3631 @kindex S-@key{right}
3632 @kindex S-@key{left}
3633 @item S-@key{left}/@key{right}
3634 Switch property at point to the next/previous allowed value.
3636 Remove a property from the current entry.
3638 Globally remove a property, from all entries in the current file.
3640 Compute the property at point, using the operator and scope from the
3641 nearest column format definition.
3644 @node Special properties, Property searches, Property syntax, Properties and Columns
3645 @section Special properties
3646 @cindex properties, special
3648 Special properties provide alternative access method to Org mode
3649 features discussed in the previous chapters, like the TODO state or the
3650 priority of an entry. This interface exists so that you can include
3651 these states into columns view (@pxref{Column view}), or to use them in
3652 queries. The following property names are special and should not be
3653 used as keys in the properties drawer:
3656 TODO @r{The TODO keyword of the entry.}
3657 TAGS @r{The tags defined directly in the headline.}
3658 ALLTAGS @r{All tags, including inherited ones.}
3659 PRIORITY @r{The priority of the entry, a string with a single letter.}
3660 DEADLINE @r{The deadline time string, without the angular brackets.}
3661 SCHEDULED @r{The scheduling time stamp, without the angular brackets.}
3662 TIMESTAMP @r{The first keyword-less time stamp in the entry.}
3663 TIMESTAMP_IA @r{The first inactive time stamp in the entry.}
3664 CLOCKSUM @r{The sum of CLOCK intervals in the subtree. @code{org-clock-sum}}
3665 @r{must be run first to compute the values.}
3668 @node Property searches, Property inheritance, Special properties, Properties and Columns
3669 @section Property searches
3670 @cindex properties, searching
3671 @cindex searching, of properties
3673 To create sparse trees and special lists with selection based on properties,
3674 the same commands are used as for tag searches (@pxref{Tag searches}), and
3675 the same logic applies. For example, here is a search string:
3678 +work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2+With=@{Sarah\|Denny@}
3682 If the comparison value is a plain number, a numerical comparison is done,
3683 and the allowed operators are @samp{<}, @samp{=}, @samp{>}, @samp{<=},
3684 @samp{>=}, and @samp{<>}. If the comparison value is enclosed in double
3685 quotes, a string comparison is done, and the same operators are allowed. If
3686 the comparison value is enclosed in curly braces, a regexp match is
3687 performed, with @samp{=} meaning that the regexp matches the property value,
3688 and @samp{<>} meaning that it does not match. So the search string in the
3689 example finds entries tagged @samp{:work:} but not @samp{:boss:}, which also
3690 have a priority value @samp{A}, a @samp{:Coffee:} property with the value
3691 @samp{unlimited}, an @samp{Effort} property that is numerically smaller than
3692 2, and a @samp{:With:} property that is matched by the regular expression
3693 @samp{Sarah\|Denny}.
3695 You can configure Org mode to use property inheritance during a search, but
3696 beware that this can slow down searches considerably. See @ref{Property
3697 inheritance} for details.
3699 There is also a special command for creating sparse trees based on a
3705 Create a sparse tree based on the value of a property. This first
3706 prompts for the name of a property, and then for a value. A sparse tree
3707 is created with all entries that define this property with the given
3708 value. If you enclose the value into curly braces, it is interpreted as
3709 a regular expression and matched against the property values.
3712 @node Property inheritance, Column view, Property searches, Properties and Columns
3713 @section Property Inheritance
3714 @cindex properties, inheritance
3715 @cindex inheritance, of properties
3717 The outline structure of Org mode documents lends itself for an
3718 inheritance model of properties: If the parent in a tree has a certain
3719 property, the children can inherit this property. Org mode does not
3720 turn this on by default, because it can slow down property searches
3721 significantly and is often not needed. However, if you find inheritance
3722 useful, you can turn it on by setting the variable
3723 @code{org-use-property-inheritance}. It may be set to @code{t}, to make
3724 all properties inherited from the parent, to a list of properties
3725 that should be inherited, or to a regular expression that matches
3726 inherited properties.
3728 Org mode has a few properties for which inheritance is hard-coded, at
3729 least for the special applications for which they are used:
3733 The @code{:COLUMNS:} property defines the format of column view
3734 (@pxref{Column view}). It is inherited in the sense that the level
3735 where a @code{:COLUMNS:} property is defined is used as the starting
3736 point for a column view table, independently of the location in the
3737 subtree from where columns view is turned on.
3739 For agenda view, a category set through a @code{:CATEGORY:} property
3740 applies to the entire subtree.
3742 For archiving, the @code{:ARCHIVE:} property may define the archive
3743 location for the entire subtree (@pxref{Moving subtrees}).
3745 The LOGGING property may define logging settings for an entry or a
3746 subtree (@pxref{Tracking TODO state changes}).
3749 @node Column view, Property API, Property inheritance, Properties and Columns
3750 @section Column view
3752 A great way to view and edit properties in an outline tree is
3753 @emph{column view}. In column view, each outline item is turned into a
3754 table row. Columns in this table provide access to properties of the
3755 entries. Org mode implements columns by overlaying a tabular structure
3756 over the headline of each item. While the headlines have been turned
3757 into a table row, you can still change the visibility of the outline
3758 tree. For example, you get a compact table by switching to CONTENTS
3759 view (@kbd{S-@key{TAB} S-@key{TAB}}, or simply @kbd{c} while column view
3760 is active), but you can still open, read, and edit the entry below each
3761 headline. Or, you can switch to column view after executing a sparse
3762 tree command and in this way get a table only for the selected items.
3763 Column view also works in agenda buffers (@pxref{Agenda Views}) where
3764 queries have collected selected items, possibly from a number of files.
3767 * Defining columns:: The COLUMNS format property
3768 * Using column view:: How to create and use column view
3769 * Capturing column view:: A dynamic block for column view
3772 @node Defining columns, Using column view, Column view, Column view
3773 @subsection Defining columns
3774 @cindex column view, for properties
3775 @cindex properties, column view
3777 Setting up a column view first requires defining the columns. This is
3778 done by defining a column format line.
3781 * Scope of column definitions:: Where defined, where valid?
3782 * Column attributes:: Appearance and content of a column
3785 @node Scope of column definitions, Column attributes, Defining columns, Defining columns
3786 @subsubsection Scope of column definitions
3788 To define a column format for an entire file, use a line like
3791 #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
3794 To specify a format that only applies to a specific tree, add a
3795 @code{:COLUMNS:} property to the top node of that tree, for example:
3798 ** Top node for columns view
3800 :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
3804 If a @code{:COLUMNS:} property is present in an entry, it defines columns
3805 for the entry itself, and for the entire subtree below it. Since the
3806 column definition is part of the hierarchical structure of the document,
3807 you can define columns on level 1 that are general enough for all
3808 sublevels, and more specific columns further down, when you edit a
3809 deeper part of the tree.
3811 @node Column attributes, , Scope of column definitions, Defining columns
3812 @subsubsection Column attributes
3813 A column definition sets the attributes of a column. The general
3814 definition looks like this:
3817 %[width]property[(title)][@{summary-type@}]
3821 Except for the percent sign and the property name, all items are
3822 optional. The individual parts have the following meaning:
3825 width @r{An integer specifying the width of the column in characters.}
3826 @r{If omitted, the width will be determined automatically.}
3827 property @r{The property that should be edited in this column.}
3828 (title) @r{The header text for the column. If omitted, the}
3829 @r{property name is used.}
3830 @{summary-type@} @r{The summary type. If specified, the column values for}
3831 @r{parent nodes are computed from the children.}
3832 @r{Supported summary types are:}
3833 @{+@} @r{Sum numbers in this column.}
3834 @{+;%.1f@} @r{Like @samp{+}, but format result with @samp{%.1f}.}
3835 @{$@} @r{Currency, short for @samp{+;%.2f}.}
3836 @{:@} @r{Sum times, HH:MM:SS, plain numbers are hours.}
3837 @{X@} @r{Checkbox status, [X] if all children are [X].}
3838 @{X/@} @r{Checkbox status, [n/m].}
3839 @{X%@} @r{Checkbox status, [n%].}
3843 Here is an example for a complete columns definition, along with allowed
3847 :COLUMNS: %20ITEM %9Approved(Approved?)@{X@} %Owner %11Status \@footnote{Please note that the COLUMNS definition must be on a single line - it is wrapped here only because of formatting constraints.}
3848 %10Time_Estimate@{:@} %CLOCKSUM
3849 :Owner_ALL: Tammy Mark Karl Lisa Don
3850 :Status_ALL: "In progress" "Not started yet" "Finished" ""
3851 :Approved_ALL: "[ ]" "[X]"
3854 The first column, @samp{%25ITEM}, means the first 25 characters of the
3855 item itself, i.e. of the headline. You probably always should start the
3856 column definition with the @samp{ITEM} specifier. The other specifiers
3857 create columns @samp{Owner} with a list of names as allowed values, for
3858 @samp{Status} with four different possible values, and for a checkbox
3859 field @samp{Approved}. When no width is given after the @samp{%}
3860 character, the column will be exactly as wide as it needs to be in order
3861 to fully display all values. The @samp{Approved} column does have a
3862 modified title (@samp{Approved?}, with a question mark). Summaries will
3863 be created for the @samp{Time_Estimate} column by adding time duration
3864 expressions like HH:MM, and for the @samp{Approved} column, by providing
3865 an @samp{[X]} status if all children have been checked. The
3866 @samp{CLOCKSUM} column is special, it lists the sum of CLOCK intervals
3869 @node Using column view, Capturing column view, Defining columns, Column view
3870 @subsection Using column view
3873 @tsubheading{Turning column view on and off}
3876 Create the column view for the local environment. This command searches
3877 the hierarchy, up from point, for a @code{:COLUMNS:} property that defines
3878 a format. When one is found, the column view table is established for
3879 the entire tree, starting from the entry that contains the @code{:COLUMNS:}
3880 property. If none is found, the format is taken from the @code{#+COLUMNS}
3881 line or from the variable @code{org-columns-default-format}, and column
3882 view is established for the current entry and its subtree.
3885 Recreate the column view, to include recent changes made in the buffer.
3892 @tsubheading{Editing values}
3893 @item @key{left} @key{right} @key{up} @key{down}
3894 Move through the column view from field to field.
3895 @kindex S-@key{left}
3896 @kindex S-@key{right}
3897 @item S-@key{left}/@key{right}
3898 Switch to the next/previous allowed value of the field. For this, you
3899 have to have specified allowed values for a property.
3903 Same as @kbd{S-@key{left}/@key{right}}
3906 Edit the property at point. For the special properties, this will
3907 invoke the same interface that you normally use to change that
3908 property. For example, when editing a TAGS property, the tag completion
3909 or fast selection interface will pop up.
3912 When there is a checkbox at point, toggle it.
3915 View the full value of this property. This is useful if the width of
3916 the column is smaller than that of the value.
3919 Edit the list of allowed values for this property. If the list is found
3920 in the hierarchy, the modified values is stored there. If no list is
3921 found, the new value is stored in the first entry that is part of the
3922 current column view.
3923 @tsubheading{Modifying the table structure}
3927 Make the column narrower/wider by one character.
3928 @kindex S-M-@key{right}
3929 @item S-M-@key{right}
3930 Insert a new column, to the right of the current column.
3931 @kindex S-M-@key{left}
3932 @item S-M-@key{left}
3933 Delete the current column.
3936 @node Capturing column view, , Using column view, Column view
3937 @subsection Capturing column view
3939 Since column view is just an overlay over a buffer, it cannot be
3940 exported or printed directly. If you want to capture a column view, use
3941 this @code{columnview} dynamic block (@pxref{Dynamic blocks}). The frame
3942 of this block looks like this:
3946 #+BEGIN: columnview :hlines 1 :id "label"
3951 @noindent This dynamic block has the following parameters:
3955 This is most important parameter. Column view is a feature that is
3956 often localized to a certain (sub)tree, and the capture block might be
3957 in a different location in the file. To identify the tree whose view to
3958 capture, you can use 3 values:
3960 local @r{use the tree in which the capture block is located}
3961 global @r{make a global view, including all headings in the file}
3962 "label" @r{call column view in the tree that has and @code{:ID:}}
3963 @r{property with the value @i{label}}
3966 When @code{t}, insert a hline after every line. When a number N, insert
3967 a hline before each headline with level @code{<= N}.
3969 When set to @code{t}, enforce column groups to get vertical lines.
3971 When set to a number, don't capture entries below this level.
3972 @item :skip-empty-rows
3973 When set to @code{t}, skip row where the only non-empty specifier of the
3974 column view is @code{ITEM}.
3979 The following commands insert or update the dynamic block:
3984 Insert a dynamic block capturing a column view. You will be prompted
3985 for the scope or id of the view.
3990 Update dynamical block at point. The cursor needs to be in the
3991 @code{#+BEGIN} line of the dynamic block.
3992 @kindex C-u C-c C-x C-u
3993 @item C-u C-c C-x C-u
3994 Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
3995 you have several clock table blocks in a buffer.
3998 @node Property API, , Column view, Properties and Columns
3999 @section The Property API
4000 @cindex properties, API
4001 @cindex API, for properties
4003 There is a full API for accessing and changing properties. This API can
4004 be used by Emacs Lisp programs to work with properties and to implement
4005 features based on them. For more information see @ref{Using the
4008 @node Dates and Times, Remember, Properties and Columns, Top
4009 @chapter Dates and Times
4015 To assist project planning, TODO items can be labeled with a date and/or
4016 a time. The specially formatted string carrying the date and time
4017 information is called a @emph{timestamp} in Org mode. This may be a
4018 little confusing because timestamp is often used as indicating when
4019 something was created or last changed. However, in Org mode this term
4020 is used in a much wider sense.
4023 * Timestamps:: Assigning a time to a tree entry
4024 * Creating timestamps:: Commands which insert timestamps
4025 * Deadlines and scheduling:: Planning your work
4026 * Clocking work time:: Tracking how long you spend on a task
4027 * Effort estimates:: Planning work effort in advance
4031 @node Timestamps, Creating timestamps, Dates and Times, Dates and Times
4032 @section Timestamps, deadlines and scheduling
4034 @cindex ranges, time
4039 A time stamp is a specification of a date (possibly with time or a range
4040 of times) in a special format, either @samp{<2003-09-16 Tue>} or
4041 @samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue
4042 12:00-12:30>}@footnote{This is the standard ISO date/time format. To
4043 use an alternative format, see @ref{Custom time format}.}. A time stamp
4044 can appear anywhere in the headline or body of an Org tree entry. Its
4045 presence causes entries to be shown on specific dates in the agenda
4046 (@pxref{Weekly/daily agenda}). We distinguish:
4049 @item Plain time stamp; Event; Appointment
4051 A simple time stamp just assigns a date/time to an item. This is just
4052 like writing down an appointment or event in a paper agenda. In the
4053 timeline and agenda displays, the headline of an entry associated with a
4054 plain time stamp will be shown exactly on that date.
4057 * Meet Peter at the movies <2006-11-01 Wed 19:15>
4058 * Discussion on climate change <2006-11-02 Thu 20:00-22:00>
4061 @item Time stamp with repeater interval
4062 @cindex timestamp, with repeater interval
4063 A time stamp may contain a @emph{repeater interval}, indicating that it
4064 applies not only on the given date, but again and again after a certain
4065 interval of N days (d), weeks (w), months(m), or years(y). The
4066 following will show up in the agenda every Wednesday:
4069 * Pick up Sam at school <2007-05-16 Wed 12:30 +1w>
4072 @item Diary-style sexp entries
4073 For more complex date specifications, Org mode supports using the
4074 special sexp diary entries implemented in the Emacs calendar/diary
4075 package. For example
4078 * The nerd meeting on every 2nd Thursday of the month
4079 <%%(diary-float t 4 2)>
4082 @item Time/Date range
4085 Two time stamps connected by @samp{--} denote a range. The headline
4086 will be shown on the first and last day of the range, and on any dates
4087 that are displayed and fall in the range. Here is an example:
4090 ** Meeting in Amsterdam
4091 <2004-08-23 Mon>--<2004-08-26 Thu>
4094 @item Inactive time stamp
4095 @cindex timestamp, inactive
4096 @cindex inactive timestamp
4097 Just like a plain time stamp, but with square brackets instead of
4098 angular ones. These time stamps are inactive in the sense that they do
4099 @emph{not} trigger an entry to show up in the agenda.
4102 * Gillian comes late for the fifth time [2006-11-01 Wed]
4107 @node Creating timestamps, Deadlines and scheduling, Timestamps, Dates and Times
4108 @section Creating timestamps
4109 @cindex creating timestamps
4110 @cindex timestamps, creating
4112 For Org mode to recognize time stamps, they need to be in the specific
4113 format. All commands listed below produce time stamps in the correct
4119 Prompt for a date and insert a corresponding time stamp. When the
4120 cursor is at a previously used time stamp, it is updated to NOW. When
4121 this command is used twice in succession, a time range is inserted.
4125 Like @kbd{C-c .}, but use the alternative format which contains date
4126 and time. The default time can be rounded to multiples of 5 minutes,
4127 see the option @code{org-time-stamp-rounding-minutes}.
4131 Like @kbd{C-c .}, but insert an inactive time stamp that will not cause
4136 Insert a time stamp corresponding to the cursor date in the Calendar.
4140 Access the Emacs calendar for the current date. If there is a
4141 timestamp in the current line, go to the corresponding date
4146 Access the agenda for the date given by the time stamp or -range at
4147 point (@pxref{Weekly/daily agenda}).
4149 @kindex S-@key{left}
4150 @kindex S-@key{right}
4152 @itemx S-@key{right}
4153 Change date at cursor by one day. These key bindings conflict with
4154 CUA mode (@pxref{Conflicts}).
4157 @kindex S-@key{down}
4160 Change the item under the cursor in a timestamp. The cursor can be on a
4161 year, month, day, hour or minute. Note that if the cursor is in a
4162 headline and not at a time stamp, these same keys modify the priority of
4163 an item. (@pxref{Priorities}). The key bindings also conflict with
4164 CUA mode (@pxref{Conflicts}).
4167 @cindex evaluate time range
4169 Evaluate a time range by computing the difference between start and end.
4170 With a prefix argument, insert result after the time range (in a table: into
4171 the following column).
4176 * The date/time prompt:: How Org mode helps you entering date and time
4177 * Custom time format:: Making dates look different
4180 @node The date/time prompt, Custom time format, Creating timestamps, Creating timestamps
4181 @subsection The date/time prompt
4182 @cindex date, reading in minibuffer
4183 @cindex time, reading in minibuffer
4185 When Org mode prompts for a date/time, the default is shown as an ISO
4186 date, and the prompt therefore seems to ask for an ISO date. But it
4187 will in fact accept any string containing some date and/or time
4188 information, and it is really smart about interpreting your input. You
4189 can, for example, use @kbd{C-y} to paste a (possibly multi-line) string
4190 copied from an email message. Org mode will find whatever information
4191 is in there and derive anything you have not specified from the
4192 @emph{default date and time}. The default is usually the current date
4193 and time, but when modifying an existing time stamp, or when entering
4194 the second stamp of a range, it is taken from the stamp in the buffer.
4195 When filling in information, Org mode assumes that most of the time you
4196 will want to enter a date in the future: If you omit the month/year and
4197 the given day/month is @i{before} today, it will assume that you mean a
4198 future date@footnote{See the variable
4199 @code{org-read-date-prefer-future}.}.
4201 For example, lets assume that today is @b{June 13, 2006}. Here is how
4202 various inputs will be interpreted, the items filled in by Org mode are
4206 3-2-5 --> 2003-02-05
4207 14 --> @b{2006}-@b{06}-14
4208 12 --> @b{2006}-@b{07}-12
4209 Fri --> nearest Friday (defaultdate or later)
4210 sep 15 --> @b{2006}-11-15
4211 feb 15 --> @b{2007}-02-15
4212 sep 12 9 --> 2009-09-12
4213 12:45 --> @b{2006}-@b{06}-@b{13} 12:45
4214 22 sept 0:34 --> @b{2006}-09-22 0:34
4215 w4 --> ISO week for of the current year @b{2006}
4216 2012 w4 fri --> Friday of ISO week 4 in 2012
4217 2012-w04-5 --> Same as above
4220 Furthermore you can specify a relative date by giving, as the
4221 @emph{first} thing in the input: a plus/minus sign, a number and a
4222 letter [dwmy] to indicate change in days weeks, months, years. With a
4223 single plus or minus, the date is always relative to today. With a
4224 double plus or minus, it is relative to the default date. If instead of
4225 a single letter, you use the abbreviation of day name, the date will be
4226 the nth such day. E.g.
4231 +4d --> four days from today
4232 +4 --> same as above
4233 +2w --> two weeks from today
4234 ++5 --> five days from default date
4235 +2tue --> second tuesday from now.
4238 The function understands English month and weekday abbreviations. If
4239 you want to use unabbreviated names and/or other languages, configure
4240 the variables @code{parse-time-months} and @code{parse-time-weekdays}.
4242 @cindex calendar, for selecting date
4243 Parallel to the minibuffer prompt, a calendar is popped up@footnote{If
4244 you don't need/want the calendar, configure the variable
4245 @code{org-popup-calendar-for-date-prompt}.}. When you exit the date
4246 prompt, either by clicking on a date in the calendar, or by pressing
4247 @key{RET}, the date selected in the calendar will be combined with the
4248 information entered at the prompt. You can control the calendar fully
4249 from the minibuffer:
4254 @kindex S-@key{right}
4255 @kindex S-@key{left}
4256 @kindex S-@key{down}
4258 @kindex M-S-@key{right}
4259 @kindex M-S-@key{left}
4262 > / < @r{Scroll calendar forward/backward by one month.}
4263 mouse-1 @r{Select date by clicking on it.}
4264 S-@key{right}/@key{left} @r{One day forward/backward.}
4265 S-@key{down}/@key{up} @r{One week forward/backward.}
4266 M-S-@key{right}/@key{left} @r{One month forward/backward.}
4267 @key{RET} @r{Choose date in calendar.}
4270 The actions of the date/time prompt may seem complex, but I assure you they
4271 will grow on you, and you will start getting annoyed by pretty much any other
4272 way of entering a date/time out there. To help you understand what is going
4273 on, the current interpretation of your input will be displayed live in the
4274 minibuffer@footnote{If you find this distracting, turn the display of with
4275 @code{org-read-date-display-live}.}.
4277 @node Custom time format, , The date/time prompt, Creating timestamps
4278 @subsection Custom time format
4279 @cindex custom date/time format
4280 @cindex time format, custom
4281 @cindex date format, custom
4283 Org mode uses the standard ISO notation for dates and times as it is
4284 defined in ISO 8601. If you cannot get used to this and require another
4285 representation of date and time to keep you happy, you can get it by
4286 customizing the variables @code{org-display-custom-times} and
4287 @code{org-time-stamp-custom-formats}.
4292 Toggle the display of custom formats for dates and times.
4296 Org mode needs the default format for scanning, so the custom date/time
4297 format does not @emph{replace} the default format - instead it is put
4298 @emph{over} the default format using text properties. This has the
4299 following consequences:
4302 You cannot place the cursor onto a time stamp anymore, only before or
4305 The @kbd{S-@key{up}/@key{down}} keys can no longer be used to adjust
4306 each component of a time stamp. If the cursor is at the beginning of
4307 the stamp, @kbd{S-@key{up}/@key{down}} will change the stamp by one day,
4308 just like @kbd{S-@key{left}/@key{right}}. At the end of the stamp, the
4309 time will be changed by one minute.
4311 If the time stamp contains a range of clock times or a repeater, these
4312 will not be overlayed, but remain in the buffer as they were.
4314 When you delete a time stamp character-by-character, it will only
4315 disappear from the buffer after @emph{all} (invisible) characters
4316 belonging to the ISO timestamp have been removed.
4318 If the custom time stamp format is longer than the default and you are
4319 using dates in tables, table alignment will be messed up. If the custom
4320 format is shorter, things do work as expected.
4324 @node Deadlines and scheduling, Clocking work time, Creating timestamps, Dates and Times
4325 @section Deadlines and scheduling
4327 A time stamp may be preceded by special keywords to facilitate planning:
4331 @cindex DEADLINE keyword
4333 Meaning: the task (most likely a TODO item, though not necessarily) is supposed
4334 to be finished on that date.
4336 On the deadline date, the task will be listed in the agenda. In
4337 addition, the agenda for @emph{today} will carry a warning about the
4338 approaching or missed deadline, starting
4339 @code{org-deadline-warning-days} before the due date, and continuing
4340 until the entry is marked DONE. An example:
4343 *** TODO write article about the Earth for the Guide
4344 The editor in charge is [[bbdb:Ford Prefect]]
4345 DEADLINE: <2004-02-29 Sun>
4348 You can specify a different lead time for warnings for a specific
4349 deadlines using the following syntax. Here is an example with a warning
4350 period of 5 days @code{DEADLINE: <2004-02-29 Sun -5d>}.
4353 @cindex SCHEDULED keyword
4355 Meaning: you are planning to start working on that task on the given
4358 The headline will be listed under the given date@footnote{It will still
4359 be listed on that date after it has been marked DONE. If you don't like
4360 this, set the variable @code{org-agenda-skip-scheduled-if-done}.}. In
4361 addition, a reminder that the scheduled date has passed will be present
4362 in the compilation for @emph{today}, until the entry is marked DONE.
4363 I.e., the task will automatically be forwarded until completed.
4366 *** TODO Call Trillian for a date on New Years Eve.
4367 SCHEDULED: <2004-12-25 Sat>
4371 @b{Important:} Scheduling an item in Org mode should @i{not} be
4372 understood in the same way that we understand @i{scheduling a meeting}.
4373 Setting a date for a meeting is just a simple appointment, you should
4374 mark this entry with a simple plain time stamp, to get this item shown
4375 on the date where it applies. This is a frequent mis-understanding from
4376 Org-users. In Org mode, @i{scheduling} means setting a date when you
4377 want to start working on an action item.
4380 You may use time stamps with repeaters in scheduling and deadline
4381 entries. Org mode will issue early and late warnings based on the
4382 assumption that the time stamp represents the @i{nearest instance} of
4383 the repeater. However, the use of diary sexp entries like
4385 @code{<%%(diary-float t 42)>}
4387 in scheduling and deadline timestamps is limited. Org mode does not
4388 know enough about the internals of each sexp function to issue early and
4389 late warnings. However, it will show the item on each day where the
4393 * Inserting deadline/schedule:: Planning items
4394 * Repeated tasks:: Items that show up again and again
4397 @node Inserting deadline/schedule, Repeated tasks, Deadlines and scheduling, Deadlines and scheduling
4398 @subsection Inserting deadlines or schedules
4400 The following commands allow to quickly insert a deadline or to schedule
4407 Insert @samp{DEADLINE} keyword along with a stamp. The insertion will
4408 happen in the line directly following the headline. When called with a
4409 prefix arg, an existing deadline will be removed from the entry.
4410 @c FIXME Any CLOSED timestamp will be removed.????????
4413 @cindex sparse tree, for deadlines
4415 Create a sparse tree with all deadlines that are either past-due, or
4416 which will become due within @code{org-deadline-warning-days}.
4417 With @kbd{C-u} prefix, show all deadlines in the file. With a numeric
4418 prefix, check that many days. For example, @kbd{C-1 C-c / d} shows
4419 all deadlines due tomorrow.
4423 Insert @samp{SCHEDULED} keyword along with a stamp. The insertion will
4424 happen in the line directly following the headline. Any CLOSED
4425 timestamp will be removed. When called with a prefix argument, remove
4426 the scheduling date from the entry.
4429 @node Repeated tasks, , Inserting deadline/schedule, Deadlines and scheduling
4430 @subsection Repeated tasks
4432 Some tasks need to be repeated again and again. Org mode helps to
4433 organize such tasks using a so-called repeater in a DEADLINE, SCHEDULED,
4434 or plain time stamp. In the following example
4436 ** TODO Pay the rent
4437 DEADLINE: <2005-10-01 Sat +1m>
4439 the @code{+1m} is a repeater; the intended interpretation is that the
4440 task has a deadline on <2005-10-01> and repeats itself every (one) month
4441 starting from that time. If you need both a repeater and a special
4442 warning period in a deadline entry, the repeater comes first and the
4443 warning period last: @code{DEADLINE: <2005-10-01 Sat +1m -3d>}.
4445 Deadlines and scheduled items produce entries in the agenda when they
4446 are over-due, so it is important to be able to mark such an entry as
4447 completed once you have done so. When you mark a DEADLINE or a SCHEDULE
4448 with the TODO keyword DONE, it will no longer produce entries in the
4449 agenda. The problem with this is, however, that then also the
4450 @emph{next} instance of the repeated entry will not be active. Org mode
4451 deals with this in the following way: When you try to mark such an entry
4452 DONE (using @kbd{C-c C-t}), it will shift the base date of the repeating
4453 time stamp by the repeater interval, and immediately set the entry state
4454 back to TODO. In the example above, setting the state to DONE would
4455 actually switch the date like this:
4458 ** TODO Pay the rent
4459 DEADLINE: <2005-11-01 Tue +1m>
4462 A timestamp@footnote{You can change this using the option
4463 @code{org-log-repeat}, or the @code{#+STARTUP} options @code{logrepeat},
4464 @code{lognoterepeat}, and @code{nologrepeat}. With @code{lognoterepeat}, you
4465 will aslo be prompted for a note.} will be added under the deadline, to keep
4466 a record that you actually acted on the previous instance of this deadline.
4468 As a consequence of shifting the base date, this entry will no longer be
4469 visible in the agenda when checking past dates, but all future instances
4472 With the @samp{+1m} cookie, the date shift will always be exactly one
4473 month. So if you have not payed the rent for three months, marking this
4474 entry DONE will still keep it as an overdue deadline. Depending on the
4475 task, this may not be the best way to handle it. For example, if you
4476 forgot to call you father for 3 weeks, it does not make sense to call
4477 him 3 times in a single day to make up for it. Finally, there are tasks
4478 like changing batteries which should always repeat a certain time
4479 @i{after} the last time you did it. For these tasks, Org mode has
4480 special repeaters markers with @samp{++} and @samp{.+}. For example:
4484 DEADLINE: <2008-02-10 Sun ++1w>
4485 Marking this DONE will shift the date by at least one week,
4486 but also by as many weeks as it takes to get this date into
4487 the future. However, it stays on a Sunday, even if you called
4488 and marked it done on Saturday.
4489 ** TODO Check the batteries in the smoke detectors
4490 DEADLINE: <2005-11-01 Tue .+1m>
4491 Marking this DONE will shift the date to one month after
4495 You may have both scheduling and deadline information for a specific
4496 task - just make sure that the repeater intervals on both are the same.
4498 @node Clocking work time, Effort estimates, Deadlines and scheduling, Dates and Times
4499 @section Clocking work time
4501 Org mode allows you to clock the time you spent on specific tasks in a
4502 project. When you start working on an item, you can start the clock.
4503 When you stop working on that task, or when you mark the task done, the
4504 clock is stopped and the corresponding time interval is recorded. It
4505 also computes the total time spent on each subtree of a project.
4510 Start the clock on the current item (clock-in). This inserts the CLOCK
4511 keyword together with a timestamp. If this is not the first clocking of
4512 this item, the multiple CLOCK lines will be wrapped into a
4513 @code{:CLOCK:} drawer (see also the variable
4514 @code{org-clock-into-drawer}). When called with a @kbd{C-u} prefix argument,
4515 select the task from a list of recently clocked tasks. With two @kbd{C-u
4516 C-u} prefixes, clock into the task at point and mark it as the default task.
4517 The default task will always be available when selecting a clocking task,
4518 with letter @kbd{d}.
4521 Stop the clock (clock-out). The inserts another timestamp at the same
4522 location where the clock was last started. It also directly computes
4523 the resulting time in inserts it after the time range as @samp{=>
4524 HH:MM}. See the variable @code{org-log-note-clock-out} for the
4525 possibility to record an additional note together with the clock-out
4526 time stamp@footnote{The corresponding in-buffer setting is:
4527 @code{#+STARTUP: lognoteclock-out}}.
4530 Recompute the time interval after changing one of the time stamps. This
4531 is only necessary if you edit the time stamps directly. If you change
4532 them with @kbd{S-@key{cursor}} keys, the update is automatic.
4535 Changing the TODO state of an item to DONE automatically stops the clock
4536 if it is running in this same item.
4539 Cancel the current clock. This is useful if a clock was started by
4540 mistake, or if you ended up working on something else.
4543 Jump to the entry that contains the currently running clock. With a
4544 @kbd{C-u} prefix arg, select the target task from a list of recently clocked
4548 Display time summaries for each subtree in the current buffer. This
4549 puts overlays at the end of each headline, showing the total time
4550 recorded under that heading, including the time of any subheadings. You
4551 can use visibility cycling to study the tree, but the overlays disappear
4552 when you change the buffer (see variable
4553 @code{org-remove-highlights-with-change}) or press @kbd{C-c C-c}.
4556 Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock
4557 report as an Org mode table into the current file. When the cursor is
4558 at an existing clock table, just update it. When called with a prefix
4559 argument, jump to the first clock report in the current document and
4562 #+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
4566 If such a block already exists at point, its content is replaced by the
4567 new table. The @samp{BEGIN} line can specify options:
4569 :maxlevel @r{Maximum level depth to which times are listed in the table.}
4570 :emphasize @r{When @code{t}, emphasize level one and level two items}
4571 :scope @r{The scope to consider. This can be any of the following:}
4572 nil @r{the current buffer or narrowed region}
4573 file @r{the full current buffer}
4574 subtree @r{the subtree where the clocktable is located}
4575 treeN @r{the surrounding level N tree, for example @code{tree3}}
4576 tree @r{the surrounding level 1 tree}
4577 agenda @r{all agenda files}
4578 ("file"..) @r{scan these files}
4579 file-with-archives @r{current file and its archives}
4580 agenda-with-archives @r{all agenda files, including archives}
4581 :block @r{The time block to consider. This block is specified either}
4582 @r{absolute, or relative to the current time and may be any of}
4584 2007-12-31 @r{New year eve 2007}
4585 2007-12 @r{December 2007}
4586 2007-W50 @r{ISO-week 50 in 2007}
4587 2007 @r{the year 2007}
4588 today, yesterday, today-N @r{a relative day}
4589 thisweek, lastweek, thisweek-N @r{a relative week}
4590 thismonth, lastmonth, thismonth-N @r{a relative month}
4591 thisyear, lastyear, thisyear-N @r{a relative year}
4592 @r{Use @kbd{S-@key{left}/@key{right}} keys to shift the time interval.}
4593 :tstart @r{A time string specifying when to start considering times}
4594 :tend @r{A time string specifying when to stop considering times}
4595 :step @r{@code{week} or @code{day}, to split the table into chunks.}
4596 @r{To use this, @code{:block} or @code{:tstart}, @code{:tend} are needed.}
4597 :link @r{Link the item headlines in the table to their origins}
4599 So to get a clock summary of the current level 1 tree, for the current
4600 day, you could write
4602 #+BEGIN: clocktable :maxlevel 2 :block today :scope tree1 :link t
4605 and to use a specific time range you could write@footnote{Note that all
4606 parameters must be specified in a single line - the line is broken here
4607 only to fit it onto the manual.}
4609 #+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>"
4610 :tend "<2006-08-10 Thu 12:00>"
4617 Update dynamical block at point. The cursor needs to be in the
4618 @code{#+BEGIN} line of the dynamic block.
4619 @kindex C-u C-c C-x C-u
4620 @item C-u C-c C-x C-u
4621 Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
4622 you have several clock table blocks in a buffer.
4623 @kindex S-@key{left}
4624 @kindex S-@key{right}
4626 @itemx S-@key{right}
4627 Shift the current @code{:block} interval and update the table. The cursor
4628 needs to be in the @code{#+BEGIN: clocktable} line for this command. If
4629 @code{:block} is @code{today}, it will be shifted to @code{today-1} etc.
4632 The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
4633 the agenda (@pxref{Weekly/daily agenda}) to show which tasks have been
4634 worked on or closed during a day.
4636 @node Effort estimates
4637 @section Effort estimates
4638 @cindex Effort estimates
4640 If you want to plan your work in a very detailed way, or if you need to
4641 produce offers with quotations of the estimated work effort, you may want to
4642 assign effort estimates to entries. If you are also clocking your work, you
4643 may later want to compare the planned effort with the actual working time, a
4644 great way to improve planning estimates. Effort estimates are stored in a
4645 special property @samp{Effort}@footnote{You may change the property being
4646 used with the variable @code{org-effort-property}.}. Clearly the best way to
4647 work with effort estimates is through column view (@pxref{Column view}). You
4648 should start by setting up discrete values for effort estimates, and a
4649 @code{COLUMNS} format that displays these values together with clock sums (if
4650 you want to clock your time). For a specific buffer you can use
4653 #+PROPERTY: Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 8:00
4654 #+COLUMNS: %40ITEM(Task) %17Effort(Estimated Effort)@{:@} %CLOCKSUM
4658 or you can set up these values globally by customizing the variables
4659 @code{org-global-properties} and @code{org-columns-default-format}. In
4660 particular if you want to use this setup also in the agenda, a global setup
4663 The way to assign estimates to individual items is then to switch to column
4664 mode, and to use @kbd{S-@key{right}} and @kbd{S-@key{left}} to change the
4665 value. The values you enter will immediately be summed up in the hierarchy.
4666 In the column next to it, any clocked time will be displayed.
4668 If you switch to column view in the daily/weekly agenda, the effort column
4669 will summarize the estimated work effort for each day@footnote{Please note
4670 the pitfalls of summing hierarchical data in a flat list (@pxref{Agenda
4671 column view}.}, and you can use this to find space in your schedule. To get
4672 an overview of the entire part of the day that is committed, you can set the
4673 option @code{org-agenda-columns-add-appointments-to-effort-sum}. The
4674 appointments on a day that take place over a specified time interval will
4675 then also be added to the load estimate of the day.
4677 @node Remember, Agenda Views, Dates and Times, Top
4679 @cindex @file{remember.el}
4681 The @i{Remember} package by John Wiegley lets you store quick notes with
4682 little interruption of your work flow. See
4683 @uref{http://www.emacswiki.org/cgi-bin/wiki/RememberMode} for more
4684 information. It is an excellent way to add new notes and tasks to
4685 Org files. Org significantly expands the possibilities of
4686 @i{remember}: You may define templates for different note types, and
4687 associate target files and headlines with specific templates. It also
4688 allows you to select the location where a note should be stored
4689 interactively, on the fly.
4692 * Setting up Remember:: Some code for .emacs to get things going
4693 * Remember templates:: Define the outline of different note types
4694 * Storing notes:: Directly get the note to where it belongs
4695 * Refiling notes:: Moving a note or task to a project
4698 @node Setting up Remember, Remember templates, Remember, Remember
4699 @section Setting up Remember
4701 The following customization will tell @i{remember} to use org files as
4702 target, and to create annotations compatible with Org links.
4705 (org-remember-insinuate)
4706 (setq org-directory "~/path/to/my/orgfiles/")
4707 (setq org-default-notes-file (concat org-directory "/notes.org"))
4708 (define-key global-map "\C-cr" 'org-remember)
4711 The last line binds the command @code{org-remember} to a global
4712 key@footnote{Please select your own key, @kbd{C-c r} is only a
4713 suggestion.}. @code{org-remember} basically just calls @code{remember},
4714 but it makes a few things easier: If there is an active region, it will
4715 automatically copy the region into the remember buffer. It also allows
4716 to jump to the buffer and location where remember notes are being
4717 stored: Just call @code{org-remember} with a prefix argument. If you
4718 use two prefix arguments, Org jumps to the location where the last
4719 remember note was stored.
4721 @node Remember templates, Storing notes, Setting up Remember, Remember
4722 @section Remember templates
4723 @cindex templates, for remember
4725 In combination with Org, you can use templates to generate
4726 different types of @i{remember} notes. For example, if you would like
4727 to use one template to create general TODO entries, another one for
4728 journal entries, and a third one for collecting random ideas, you could
4732 (setq org-remember-templates
4733 '(("Todo" ?t "* TODO %?\n %i\n %a" "~/org/TODO.org" "Tasks")
4734 ("Journal" ?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org")
4735 ("Idea" ?i "* %^@{Title@}\n %i\n %a" "~/org/JOURNAL.org" "New Ideas")))
4738 @noindent In these entries, the first string is just a name, and the
4739 character specifies how to select the template. It is useful if the
4740 character is also the first letter of the name. The next string
4741 specifies the template. Two more (optional) strings give the file in
4742 which, and the headline under which the new note should be stored. The
4743 file (if not present or @code{nil}) defaults to
4744 @code{org-default-notes-file}, the heading to
4745 @code{org-remember-default-headline}. If the file name is not an
4746 absolute path, it will be interpreted relative to @code{org-directory}.
4748 An optional sixth element specifies the contexts in which the user can
4749 select the template. This element can be either a list of major modes
4750 or a function. @code{org-remember} will first check whether the function
4751 returns @code{t} or if we are in any of the listed major mode, and select
4752 the template accordingly.
4757 (setq org-remember-templates
4758 '(("Bug" ?b "* BUG %?\n %i\n %a" "~/org/BUGS.org" "Bugs" (emacs-lisp-mode))
4759 ("Journal" ?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org" my-check)
4760 ("Idea" ?i "* %^@{Title@}\n %i\n %a" "~/org/JOURNAL.org" "New Ideas")))
4763 The first template will only be available when invoking @code{org-remember}
4764 from an buffer in @code{emacs-lisp-mode}. The second template will only be
4765 available when the function @code{my-check} returns @code{t}. The third
4766 template will be proposed in any context.
4768 When you call @kbd{M-x org-remember} (or @kbd{M-x remember}) to remember
4769 something, Org will prompt for a key to select the template (if you have
4770 more than one template) and then prepare the buffer like
4773 [[file:link to where you called remember]]
4777 During expansion of the template, special @kbd{%}-escapes allow dynamic
4778 insertion of content:
4780 %^@{prompt@} @r{prompt the user for a string and replace this sequence with it.}
4781 @r{You may specify a default value and a completion table with}
4782 @r{%^@{prompt|default|completion2|completion3...@}}
4783 @r{The arrow keys access a prompt-specific history.}
4784 %t @r{time stamp, date only}
4785 %T @r{time stamp with date and time}
4786 %u, %U @r{like the above, but inactive time stamps}
4787 %^t @r{like @code{%t}, but prompt for date. Similarly @code{%^T}, @code{%^u}, @code{%^U}}
4788 @r{You may define a prompt like @code{%^@{Birthday@}t}}
4789 %n @r{user name (taken from @code{user-full-name})}
4790 %a @r{annotation, normally the link created with @code{org-store-link}}
4791 %A @r{like @code{%a}, but prompt for the description part}
4792 %i @r{initial content, the region when remember is called with C-u.}
4793 @r{The entire text will be indented like @code{%i} itself.}
4794 %c @r{Current kill ring head.}
4795 %x @r{Content of the X clipboard.}
4796 %^C @r{Interactive selection of which kill or clip to use.}
4797 %^L @r{Like @code{%^C}, but insert as link.}
4798 %^g @r{prompt for tags, with completion on tags in target file.}
4799 %^G @r{prompt for tags, with completion all tags in all agenda files.}
4800 %:keyword @r{specific information for certain link types, see below}
4801 %[pathname] @r{insert the contents of the file given by @code{pathname}}
4802 %(sexp) @r{evaluate elisp @code{(sexp)} and replace with the result}
4803 %! @r{immediately store note after completing the template}
4804 @r{(skipping the @kbd{C-c C-c} that normally triggers storing)}
4808 For specific link types, the following keywords will be
4809 defined@footnote{If you define your own link types (@pxref{Adding
4810 hyperlink types}), any property you store with
4811 @code{org-store-link-props} can be accessed in remember templates in a
4815 Link type | Available keywords
4816 -------------------+----------------------------------------------
4817 bbdb | %:name %:company
4818 bbdb | %::server %:port %:nick
4819 vm, wl, mh, rmail | %:type %:subject %:message-id
4820 | %:from %:fromname %:fromaddress
4821 | %:to %:toname %:toaddress
4822 | %: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}.}}
4823 gnus | %:group, @r{for messages also all email fields}
4825 info | %:file %:node
4830 To place the cursor after template expansion use:
4833 %? @r{After completing the template, position cursor here.}
4837 If you change your mind about which template to use, call
4838 @code{org-remember} in the remember buffer. You may then select a new
4839 template that will be filled with the previous context information.
4841 @node Storing notes, Refiling notes, Remember templates, Remember
4842 @section Storing notes
4844 When you are finished preparing a note with @i{remember}, you have to press
4845 @kbd{C-c C-c} to file the note away. If you have started the clock in the
4846 remember buffer, you will first be asked if you want to clock out
4847 now@footnote{To avoid this query, configure the variable
4848 @code{org-remember-clock-out-on-exit}.}. If you answer @kbd{n}, the clock
4849 will continue to run after the note is filed away.
4851 The handler will then store the note in the file and under the headline
4852 specified in the template, or it will use the default file and headlines.
4853 The window configuration will be restored, sending you back to the working
4854 context before the call to @code{remember}. To re-use the location found
4855 during the last call to @code{remember}, exit the remember buffer with
4856 @kbd{C-u C-u C-c C-c}, i.e. specify a double prefix argument to @kbd{C-c
4859 If you want to store the note directly to a different place, use
4860 @kbd{C-u C-c C-c} instead to exit remember@footnote{Configure the
4861 variable @code{org-remember-store-without-prompt} to make this behavior
4862 the default.}. The handler will then first prompt for a target file -
4863 if you press @key{RET}, the value specified for the template is used.
4864 Then the command offers the headings tree of the selected file, with the
4865 cursor position at the default headline (if you had specified one in the
4866 template). You can either immediately press @key{RET} to get the note
4867 placed there. Or you can use the following keys to find a different
4870 @key{TAB} @r{Cycle visibility.}
4871 @key{down} / @key{up} @r{Next/previous visible headline.}
4872 n / p @r{Next/previous visible headline.}
4873 f / b @r{Next/previous headline same level.}
4875 @c 0-9 @r{Digit argument.}
4878 Pressing @key{RET} or @key{left} or @key{right}
4879 then leads to the following result.
4881 @multitable @columnfractions 0.2 0.15 0.65
4882 @item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted}
4883 @item on headline @tab @key{RET} @tab as sublevel of the heading at cursor, first or last
4884 @item @tab @tab depending on @code{org-reverse-note-order}.
4885 @item @tab @key{left}/@key{right} @tab as same level, before/after current heading
4886 @item buffer-start @tab @key{RET} @tab as level 2 heading at end of file or level 1 at beginning
4887 @item @tab @tab depending on @code{org-reverse-note-order}.
4888 @item not on headline @tab @key{RET}
4889 @tab at cursor position, level taken from context.
4892 Before inserting the text into a tree, the function ensures that the
4893 text has a headline, i.e. a first line that starts with a @samp{*}. If
4894 not, a headline is constructed from the current date and some additional
4895 data. If you have indented the text of the note below the headline, the
4896 indentation will be adapted if inserting the note into the tree requires
4897 demotion from level 1.
4899 @node Refiling notes, , Storing notes, Remember
4900 @section Refiling notes
4901 @cindex refiling notes
4903 Remember is usually used to quickly capture notes and tasks into one or
4904 a few capture lists. When reviewing the captured data, you may want to
4905 refile some of the entries into a different list, for example into a
4906 project. Cutting, finding the right location and then pasting the note
4907 is cumbersome. To simplify this process, you can use the following
4913 Refile the entry at point. This command offers possible locations for
4914 refiling the entry and lets you select one with completion. The item is
4915 filed below the target heading as a subitem. Depending on
4916 @code{org-reverse-note-order}, it will be either the first of last
4917 subitem.@* By default, all level 1 headlines in the current buffer are
4918 considered to be targets, but you can have more complex definitions
4919 across a number of files. See the variable @code{org-refile-targets}
4923 Use the refile interface to jump to a heading.
4924 @kindex C-u C-u C-c C-w
4925 @item C-u C-u C-c C-w
4926 Jump to the location where @code{org-refile} last moved a tree to.
4929 @node Agenda Views, Embedded LaTeX, Remember, Top
4930 @chapter Agenda Views
4931 @cindex agenda views
4933 Due to the way Org works, TODO items, time-stamped items, and
4934 tagged headlines can be scattered throughout a file or even a number of
4935 files. To get an overview of open action items, or of events that are
4936 important for a particular date, this information must be collected,
4937 sorted and displayed in an organized way.
4939 Org can select items based on various criteria, and display them
4940 in a separate buffer. Seven different view types are provided:
4944 an @emph{agenda} that is like a calendar and shows information
4947 a @emph{TODO list} that covers all unfinished
4950 a @emph{tags view}, showings headlines based on
4951 the tags associated with them,
4953 a @emph{timeline view} that shows all events in a single Org file,
4954 in time-sorted view,
4956 a @emph{keyword search view} that shows all entries from multiple files
4957 that contain specified keywords.
4959 a @emph{stuck projects view} showing projects that currently don't move
4962 @emph{custom views} that are special tag/keyword searches and
4963 combinations of different views.
4967 The extracted information is displayed in a special @emph{agenda
4968 buffer}. This buffer is read-only, but provides commands to visit the
4969 corresponding locations in the original Org files, and even to
4970 edit these files remotely.
4972 Two variables control how the agenda buffer is displayed and whether the
4973 window configuration is restored when the agenda exits:
4974 @code{org-agenda-window-setup} and
4975 @code{org-agenda-restore-windows-after-quit}.
4978 * Agenda files:: Files being searched for agenda information
4979 * Agenda dispatcher:: Keyboard access to agenda views
4980 * Built-in agenda views:: What is available out of the box?
4981 * Presentation and sorting:: How agenda items are prepared for display
4982 * Agenda commands:: Remote editing of Org trees
4983 * Custom agenda views:: Defining special searches and views
4984 * Agenda column view:: Using column view for collected entries
4987 @node Agenda files, Agenda dispatcher, Agenda Views, Agenda Views
4988 @section Agenda files
4989 @cindex agenda files
4990 @cindex files for agenda
4992 The information to be shown is normally collected from all @emph{agenda
4993 files}, the files listed in the variable
4994 @code{org-agenda-files}@footnote{If the value of that variable is not a
4995 list, but a single file name, then the list of agenda files will be
4996 maintained in that external file.}. If a directory is part of this list,
4997 all files with the extension @file{.org} in this directory will be part
5000 Thus even if you only work with a single Org file, this file should
5001 be put into that list@footnote{When using the dispatcher, pressing
5002 @kbd{<} before selecting a command will actually limit the command to
5003 the current file, and ignore @code{org-agenda-files} until the next
5004 dispatcher command.}. You can customize @code{org-agenda-files}, but
5005 the easiest way to maintain it is through the following commands
5007 @cindex files, adding to agenda list
5011 Add current file to the list of agenda files. The file is added to
5012 the front of the list. If it was already in the list, it is moved to
5013 the front. With a prefix argument, file is added/moved to the end.
5016 Remove current file from the list of agenda files.
5021 Cycle through agenda file list, visiting one file after the other.
5022 @kindex M-x org-iswitchb
5023 @item M-x org-iswitchb
5024 Command to use an @code{iswitchb}-like interface to switch to and between Org
5029 The Org menu contains the current list of files and can be used
5030 to visit any of them.
5032 If you would like to focus the agenda temporarily onto a file not in
5033 this list, or onto just one file in the list or even only a subtree in a
5034 file, this can be done in different ways. For a single agenda command,
5035 you may press @kbd{<} once or several times in the dispatcher
5036 (@pxref{Agenda dispatcher}). To restrict the agenda scope for an
5037 extended period, use the following commands:
5042 Permanently restrict the agenda to the current subtree. When with a
5043 prefix argument, or with the cursor before the first headline in a file,
5044 the agenda scope is set to the entire file. This restriction remains in
5045 effect until removed with @kbd{C-c C-x >}, or by typing either @kbd{<}
5046 or @kbd{>} in the agenda dispatcher. If there is a window displaying an
5047 agenda view, the new restriction takes effect immediately.
5050 Remove the permanent restriction created by @kbd{C-c C-x <}.
5054 When working with @file{Speedbar}, you can use the following commands in
5058 @item < @r{in the speedbar frame}
5059 Permanently restrict the agenda to the item at the cursor in the
5060 Speedbar frame, either an Org file or a subtree in such a file.
5061 If there is a window displaying an agenda view, the new restriction takes
5064 @item > @r{in the speedbar frame}
5065 Lift the restriction again.
5068 @node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda Views
5069 @section The agenda dispatcher
5070 @cindex agenda dispatcher
5071 @cindex dispatching agenda commands
5072 The views are created through a dispatcher that should be bound to a
5073 global key, for example @kbd{C-c a} (@pxref{Installation}). In the
5074 following we will assume that @kbd{C-c a} is indeed how the dispatcher
5075 is accessed and list keyboard access to commands accordingly. After
5076 pressing @kbd{C-c a}, an additional letter is required to execute a
5077 command. The dispatcher offers the following default commands:
5080 Create the calendar-like agenda (@pxref{Weekly/daily agenda}).
5082 Create a list of all TODO items (@pxref{Global TODO list}).
5084 Create a list of headlines matching a TAGS expression (@pxref{Matching
5085 tags and properties}).
5087 Create the timeline view for the current buffer (@pxref{Timeline}).
5089 Create a list of entries selected by a boolean expression of keywords
5090 and/or regular expressions that must or must not occur in the entry.
5092 Search for a regular expression in all agenda files and additionally in
5093 the files listed in @code{org-agenda-multi-occur-extra-files}. This
5094 uses the Emacs command @code{multi-occur}. A prefix argument can be
5095 used to specify the number of context lines for each match, default is
5098 Create a list of stuck projects (@pxref{Stuck projects}).
5100 Restrict an agenda command to the current buffer@footnote{For backward
5101 compatibility, you can also press @kbd{1} to restrict to the current
5102 buffer.}. After pressing @kbd{<}, you still need to press the character
5103 selecting the command.
5105 If there is an active region, restrict the following agenda command to
5106 the region. Otherwise, restrict it to the current subtree@footnote{For
5107 backward compatibility, you can also press @kbd{0} to restrict to the
5108 current buffer.}. After pressing @kbd{< <}, you still need to press the
5109 character selecting the command.
5112 You can also define custom commands that will be accessible through the
5113 dispatcher, just like the default commands. This includes the
5114 possibility to create extended agenda buffers that contain several
5115 blocks together, for example the weekly agenda, the global TODO list and
5116 a number of special tags matches. @xref{Custom agenda views}.
5118 @node Built-in agenda views, Presentation and sorting, Agenda dispatcher, Agenda Views
5119 @section The built-in agenda views
5121 In this section we describe the built-in views.
5124 * Weekly/daily agenda:: The calendar page with current tasks
5125 * Global TODO list:: All unfinished action items
5126 * Matching tags and properties:: Structured information with fine-tuned search
5127 * Timeline:: Time-sorted view for single file
5128 * Keyword search:: Finding entries by keyword
5129 * Stuck projects:: Find projects you need to review
5132 @node Weekly/daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views
5133 @subsection The weekly/daily agenda
5135 @cindex weekly agenda
5136 @cindex daily agenda
5138 The purpose of the weekly/daily @emph{agenda} is to act like a page of a
5139 paper agenda, showing all the tasks for the current week or day.
5142 @cindex org-agenda, command
5145 Compile an agenda for the current week from a list of org files. The
5146 agenda shows the entries for each day. With a numeric
5147 prefix@footnote{For backward compatibility, the universal prefix
5148 @kbd{C-u} causes all TODO entries to be listed before the agenda. This
5149 feature is deprecated, use the dedicated TODO list, or a block agenda
5150 instead.} (like @kbd{C-u 2 1 C-c a a}) you may set the number of days
5151 to be displayed (see also the variable @code{org-agenda-ndays})
5154 Remote editing from the agenda buffer means, for example, that you can
5155 change the dates of deadlines and appointments from the agenda buffer.
5156 The commands available in the Agenda buffer are listed in @ref{Agenda
5159 @subsubheading Calendar/Diary integration
5160 @cindex calendar integration
5161 @cindex diary integration
5163 Emacs contains the calendar and diary by Edward M. Reingold. The
5164 calendar displays a three-month calendar with holidays from different
5165 countries and cultures. The diary allows you to keep track of
5166 anniversaries, lunar phases, sunrise/set, recurrent appointments
5167 (weekly, monthly) and more. In this way, it is quite complementary to
5168 Org. It can be very useful to combine output from Org with
5171 In order to include entries from the Emacs diary into Org mode's
5172 agenda, you only need to customize the variable
5175 (setq org-agenda-include-diary t)
5178 @noindent After that, everything will happen automatically. All diary
5179 entries including holidays, anniversaries etc will be included in the
5180 agenda buffer created by Org mode. @key{SPC}, @key{TAB}, and
5181 @key{RET} can be used from the agenda buffer to jump to the diary
5182 file in order to edit existing diary entries. The @kbd{i} command to
5183 insert new entries for the current date works in the agenda buffer, as
5184 well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display
5185 Sunrise/Sunset times, show lunar phases and to convert to other
5186 calendars, respectively. @kbd{c} can be used to switch back and forth
5187 between calendar and agenda.
5189 If you are using the diary only for sexp entries and holidays, it is
5190 faster to not use the above setting, but instead to copy or even move
5191 the entries into an Org file. Org mode evaluates diary-style sexp
5192 entries, and does it faster because there is no overhead for first
5193 creating the diary display. Note that the sexp entries must start at
5194 the left margin, no white space is allowed before them. For example,
5195 the following segment of an Org file will be processed and entries
5196 will be made in the agenda:
5199 * Birthdays and similar stuff
5201 %%(org-calendar-holiday) ; special function for holiday names
5203 %%(diary-anniversary 14 5 1956) Arthur Dent is %d years old
5204 %%(diary-anniversary 2 10 1869) Mahatma Gandhi would be %d years old
5207 @subsubheading Appointment reminders
5208 @cindex @file{appt.el}
5209 @cindex appointment reminders
5211 Org can interact with Emacs appointments notification facility.
5213 To add all the appointments of your agenda files, use the command
5214 @code{org-agenda-to-appt}. This commands also lets you filter through
5215 the list of your appointments and add only those belonging to a specific
5216 category or matching a regular expression. See the docstring for
5219 @node Global TODO list, Matching tags and properties, Weekly/daily agenda, Built-in agenda views
5220 @subsection The global TODO list
5221 @cindex global TODO list
5222 @cindex TODO list, global
5224 The global TODO list contains all unfinished TODO items, formatted and
5225 collected into a single place.
5230 Show the global TODO list. This collects the TODO items from all
5231 agenda files (@pxref{Agenda Views}) into a single buffer. The buffer is in
5232 @code{agenda-mode}, so there are commands to examine and manipulate
5233 the TODO entries directly from that buffer (@pxref{Agenda commands}).
5236 @cindex TODO keyword matching
5237 Like the above, but allows selection of a specific TODO keyword. You
5238 can also do this by specifying a prefix argument to @kbd{C-c a t}. With
5239 a @kbd{C-u} prefix you are prompted for a keyword, and you may also
5240 specify several keywords by separating them with @samp{|} as boolean OR
5241 operator. With a numeric prefix, the Nth keyword in
5242 @code{org-todo-keywords} is selected.
5244 The @kbd{r} key in the agenda buffer regenerates it, and you can give
5245 a prefix argument to this command to change the selected TODO keyword,
5246 for example @kbd{3 r}. If you often need a search for a specific
5247 keyword, define a custom command for it (@pxref{Agenda dispatcher}).@*
5248 Matching specific TODO keywords can also be done as part of a tags
5249 search (@pxref{Tag searches}).
5252 Remote editing of TODO items means that you can change the state of a
5253 TODO entry with a single key press. The commands available in the
5254 TODO list are described in @ref{Agenda commands}.
5256 @cindex sublevels, inclusion into TODO list
5257 Normally the global TODO list simply shows all headlines with TODO
5258 keywords. This list can become very long. There are two ways to keep
5262 Some people view a TODO item that has been @emph{scheduled} for
5263 execution (@pxref{Timestamps}) as no longer @emph{open}. Configure the
5264 variable @code{org-agenda-todo-ignore-scheduled} to exclude scheduled
5265 items from the global TODO list.
5267 TODO items may have sublevels to break up the task into subtasks. In
5268 such cases it may be enough to list only the highest level TODO headline
5269 and omit the sublevels from the global list. Configure the variable
5270 @code{org-agenda-todo-list-sublevels} to get this behavior.
5273 @node Matching tags and properties, Timeline, Global TODO list, Built-in agenda views
5274 @subsection Matching tags and properties
5275 @cindex matching, of tags
5276 @cindex matching, of properties
5279 If headlines in the agenda files are marked with @emph{tags}
5280 (@pxref{Tags}), you can select headlines based on the tags that apply
5281 to them and collect them into an agenda buffer.
5286 Produce a list of all headlines that match a given set of tags. The
5287 command prompts for a selection criterion, which is a boolean logic
5288 expression with tags, like @samp{+work+urgent-withboss} or
5289 @samp{work|home} (@pxref{Tags}). If you often need a specific search,
5290 define a custom command for it (@pxref{Agenda dispatcher}).
5293 Like @kbd{C-c a m}, but only select headlines that are also TODO items
5294 and force checking subitems (see variable
5295 @code{org-tags-match-list-sublevels}). Matching specific TODO keywords
5296 together with a tags match is also possible, see @ref{Tag searches}.
5299 The commands available in the tags list are described in @ref{Agenda
5302 @node Timeline, Keyword search, Matching tags and properties, Built-in agenda views
5303 @subsection Timeline for a single file
5304 @cindex timeline, single file
5305 @cindex time-sorted view
5307 The timeline summarizes all time-stamped items from a single Org mode
5308 file in a @emph{time-sorted view}. The main purpose of this command is
5309 to give an overview over events in a project.
5314 Show a time-sorted view of the org file, with all time-stamped items.
5315 When called with a @kbd{C-u} prefix, all unfinished TODO entries
5316 (scheduled or not) are also listed under the current date.
5320 The commands available in the timeline buffer are listed in
5321 @ref{Agenda commands}.
5323 @node Keyword search, Stuck projects, Timeline, Built-in agenda views
5324 @subsection Keyword search
5325 @cindex keyword search
5326 @cindex searching, for keywords
5328 This agenda view is a general text search facility for Org mode entries.
5329 It is particularly useful to find notes.
5334 This is a special search that lets you select entries by keywords or
5335 regular expression, using a boolean logic. For example, the search
5339 +computer +wifi -ethernet -@{8\.11[bg]@}
5343 will search for note entries that contain the keywords @code{computer}
5344 and @code{wifi}, but not the keyword @code{ethernet}, and which are also
5345 not matched by the regular expression @code{8\.11[bg]}, meaning to
5346 exclude both 8.11b and 8.11g.
5348 Note that in addition to the agenda files, this command will also search
5349 the files listed in @code{org-agenda-text-search-extra-files}.
5352 @node Stuck projects, , Keyword search, Built-in agenda views
5353 @subsection Stuck projects
5355 If you are following a system like David Allen's GTD to organize your
5356 work, one of the ``duties'' you have is a regular review to make sure
5357 that all projects move along. A @emph{stuck} project is a project that
5358 has no defined next actions, so it will never show up in the TODO lists
5359 Org mode produces. During the review, you need to identify such
5360 projects and define next actions for them.
5365 List projects that are stuck.
5368 Customize the variable @code{org-stuck-projects} to define what a stuck
5369 project is and how to find it.
5372 You almost certainly will have to configure this view before it will
5373 work for you. The built-in default assumes that all your projects are
5374 level-2 headlines, and that a project is not stuck if it has at least
5375 one entry marked with a TODO keyword TODO or NEXT or NEXTACTION.
5377 Lets assume that you, in your own way of using Org mode, identify
5378 projects with a tag PROJECT, and that you use a TODO keyword MAYBE to
5379 indicate a project that should not be considered yet. Lets further
5380 assume that the TODO keyword DONE marks finished projects, and that NEXT
5381 and TODO indicate next actions. The tag @@SHOP indicates shopping and
5382 is a next action even without the NEXT tag. Finally, if the project
5383 contains the special word IGNORE anywhere, it should not be listed
5384 either. In this case you would start by identifying eligible projects
5385 with a tags/todo match @samp{+PROJECT/-MAYBE-DONE}, and then check for
5386 TODO, NEXT, @@SHOP, and IGNORE in the subtree to identify projects that
5387 are not stuck. The correct customization for this is
5390 (setq org-stuck-projects
5391 '("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@@SHOP")
5396 @node Presentation and sorting, Agenda commands, Built-in agenda views, Agenda Views
5397 @section Presentation and sorting
5398 @cindex presentation, of agenda items
5400 Before displaying items in an agenda view, Org mode visually prepares
5401 the items and sorts them. Each item occupies a single line. The line
5402 starts with a @emph{prefix} that contains the @emph{category}
5403 (@pxref{Categories}) of the item and other important information. You can
5404 customize the prefix using the option @code{org-agenda-prefix-format}.
5405 The prefix is followed by a cleaned-up version of the outline headline
5406 associated with the item.
5409 * Categories:: Not all tasks are equal
5410 * Time-of-day specifications:: How the agenda knows the time
5411 * Sorting of agenda items:: The order of things
5414 @node Categories, Time-of-day specifications, Presentation and sorting, Presentation and sorting
5415 @subsection Categories
5418 The category is a broad label assigned to each agenda item. By default,
5419 the category is simply derived from the file name, but you can also
5420 specify it with a special line in the buffer, like this@footnote{For
5421 backward compatibility, the following also works: If there are several
5422 such lines in a file, each specifies the category for the text below it.
5423 The first category also applies to any text before the first CATEGORY
5424 line. However, using this method is @emph{strongly} deprecated as it is
5425 incompatible with the outline structure of the document. The correct
5426 method for setting multiple categories in a buffer is using a
5434 If you would like to have a special CATEGORY for a single entry or a
5435 (sub)tree, give the entry a @code{:CATEGORY:} property with the location
5436 as the value (@pxref{Properties and Columns}).
5439 The display in the agenda buffer looks best if the category is not
5440 longer than 10 characters.
5442 @node Time-of-day specifications, Sorting of agenda items, Categories, Presentation and sorting
5443 @subsection Time-of-day specifications
5444 @cindex time-of-day specification
5446 Org mode checks each agenda item for a time-of-day specification. The
5447 time can be part of the time stamp that triggered inclusion into the
5448 agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}. Time
5449 ranges can be specified with two time stamps, like
5451 @w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
5453 In the headline of the entry itself, a time(range) may also appear as
5454 plain text (like @samp{12:45} or a @samp{8:30-1pm}. If the agenda
5455 integrates the Emacs diary (@pxref{Weekly/daily agenda}), time
5456 specifications in diary entries are recognized as well.
5458 For agenda display, Org mode extracts the time and displays it in a
5459 standard 24 hour format as part of the prefix. The example times in
5460 the previous paragraphs would end up in the agenda like this:
5463 8:30-13:00 Arthur Dent lies in front of the bulldozer
5464 12:45...... Ford Prefect arrives and takes Arthur to the pub
5465 19:00...... The Vogon reads his poem
5466 20:30-22:15 Marwin escorts the Hitchhikers to the bridge
5470 If the agenda is in single-day mode, or for the display of today, the
5471 timed entries are embedded in a time grid, like
5474 8:00...... ------------------
5475 8:30-13:00 Arthur Dent lies in front of the bulldozer
5476 10:00...... ------------------
5477 12:00...... ------------------
5478 12:45...... Ford Prefect arrives and takes Arthur to the pub
5479 14:00...... ------------------
5480 16:00...... ------------------
5481 18:00...... ------------------
5482 19:00...... The Vogon reads his poem
5483 20:00...... ------------------
5484 20:30-22:15 Marwin escorts the Hitchhikers to the bridge
5487 The time grid can be turned on and off with the variable
5488 @code{org-agenda-use-time-grid}, and can be configured with
5489 @code{org-agenda-time-grid}.
5491 @node Sorting of agenda items, , Time-of-day specifications, Presentation and sorting
5492 @subsection Sorting of agenda items
5493 @cindex sorting, of agenda items
5494 @cindex priorities, of agenda items
5495 Before being inserted into a view, the items are sorted. How this is
5496 done depends on the type of view.
5499 For the daily/weekly agenda, the items for each day are sorted. The
5500 default order is to first collect all items containing an explicit
5501 time-of-day specification. These entries will be shown at the beginning
5502 of the list, as a @emph{schedule} for the day. After that, items remain
5503 grouped in categories, in the sequence given by @code{org-agenda-files}.
5504 Within each category, items are sorted by priority (@pxref{Priorities}),
5505 which is composed of the base priority (2000 for priority @samp{A}, 1000
5506 for @samp{B}, and 0 for @samp{C}), plus additional increments for
5507 overdue scheduled or deadline items.
5509 For the TODO list, items remain in the order of categories, but within
5510 each category, sorting takes place according to priority
5511 (@pxref{Priorities}).
5513 For tags matches, items are not sorted at all, but just appear in the
5514 sequence in which they are found in the agenda files.
5517 Sorting can be customized using the variable
5518 @code{org-agenda-sorting-strategy}, and may also include criteria based on
5519 the estimated effort of an entry.
5520 @c FIXME: link!!!!!!!!
5523 @node Agenda commands, Custom agenda views, Presentation and sorting, Agenda Views
5524 @section Commands in the agenda buffer
5525 @cindex commands, in agenda buffer
5527 Entries in the agenda buffer are linked back to the org file or diary
5528 file where they originate. You are not allowed to edit the agenda
5529 buffer itself, but commands are provided to show and jump to the
5530 original entry location, and to edit the org-files ``remotely'' from
5531 the agenda buffer. In this way, all information is stored only once,
5532 removing the risk that your agenda and note files may diverge.
5534 Some commands can be executed with mouse clicks on agenda lines. For
5535 the other commands, the cursor needs to be in the desired line.
5538 @tsubheading{Motion}
5539 @cindex motion commands in agenda
5542 Next line (same as @key{up} and @kbd{C-p}).
5545 Previous line (same as @key{down} and @kbd{C-n}).
5546 @tsubheading{View/Go to org file}
5551 Display the original location of the item in another window.
5555 Display original location and recenter that window.
5563 Go to the original location of the item in another window. Under Emacs
5564 22, @kbd{mouse-1} will also works for this.
5568 Go to the original location of the item and delete other windows.
5572 Toggle Follow mode. In Follow mode, as you move the cursor through
5573 the agenda buffer, the other window always shows the corresponding
5574 location in the org file. The initial setting for this mode in new
5575 agenda buffers can be set with the variable
5576 @code{org-agenda-start-with-follow-mode}.
5580 Display the entire subtree of the current item in an indirect buffer. With a
5581 numeric prefix argument N, go up to level N and then take that tree. If N is
5582 negative, go up that many levels. With a @kbd{C-u} prefix, do not remove the
5583 previously used indirect buffer.
5587 Toggle Logbook mode. In Logbook mode, entries that where marked DONE while
5588 logging was on (variable @code{org-log-done}) are shown in the agenda,
5589 as are entries that have been clocked on that day.
5593 Toggle Clockreport mode. In clockreport mode, the daily/weekly agenda will
5594 always show a table with the clocked times for the timespan and file scope
5595 covered by the current agenda view. The initial setting for this mode in new
5596 agenda buffers can be set with the variable
5597 @code{org-agenda-start-with-clockreport-mode}.
5599 @tsubheading{Change display}
5600 @cindex display changing, in agenda
5603 Delete other windows.
5610 Switch to day/week/month/year view. When switching to day or week view,
5611 this setting becomes the default for subsequent agenda commands. Since
5612 month and year views are slow to create, they do not become the default.
5613 A numeric prefix argument may be used to jump directly to a specific day
5614 of the year, ISO week, month, or year, respectively. For example,
5615 @kbd{32 d} jumps to February 1st, @kbd{9 w} to ISO week number 9. When
5616 setting day, week, or month view, a year may be encoded in the prefix
5617 argument as well. For example, @kbd{200712 w} will jump to week 12 in
5618 2007. If such a year specification has only one or two digits, it will
5619 be mapped to the interval 1938-2037.
5623 Toggle the inclusion of diary entries. See @ref{Weekly/daily agenda}.
5627 Toggle the time grid on and off. See also the variables
5628 @code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
5632 Recreate the agenda buffer, for example to reflect the changes
5633 after modification of the time stamps of items with S-@key{left} and
5634 S-@key{right}. When the buffer is the global TODO list, a prefix
5635 argument is interpreted to create a selective list for a specific TODO
5645 Save all Org buffers in the current Emacs session.
5649 Display the following @code{org-agenda-ndays} days. For example, if
5650 the display covers a week, switch to the following week. With prefix
5651 arg, go forward that many times @code{org-agenda-ndays} days.
5655 Display the previous dates.
5663 Invoke column view (@pxref{Column view}) in the agenda buffer. The column
5664 view format is taken from the entry at point, or (if there is no entry at
5665 point), from the first entry in the agenda view. So whatever the format for
5666 that entry would be in the original buffer (taken from a property, from a
5667 @code{#+COLUMNS} line, or from the default variable
5668 @code{org-columns-default-format}), will be used in the agenda.
5670 @tsubheading{Query editing}
5671 @cindex query editing, in agenda
5678 In the @i{search view} (@pxref{Keyword search}), these keys add new
5679 search words (@kbd{[} and @kbd{]}) or new regular expressions (@kbd{@{}
5680 and @kbd{@}}) to the query string. The opening bracket/brace will add a
5681 positive search term prefixed by @samp{+}, indicating that this search
5682 term @i{must} occur/match in the entry. Closing bracket/brace add a
5683 negative search term which @i{must not} occur/match in the entry for it
5687 @tsubheading{Remote editing}
5688 @cindex remote editing, from agenda
5693 @cindex undoing remote-editing events
5694 @cindex remote editing, undo
5697 Undo a change due to a remote editing command. The change is undone
5698 both in the agenda buffer and in the remote buffer.
5702 Change the TODO state of the item, both in the agenda and in the
5707 Delete the current agenda item along with the entire subtree belonging
5708 to it in the original Org file. If the text to be deleted remotely
5709 is longer than one line, the kill needs to be confirmed by the user. See
5710 variable @code{org-agenda-confirm-kill}.
5714 Toggle the ARCHIVE tag for the current headline.
5718 Move the subtree corresponding to the current entry to its @emph{Archive
5723 Archive the subtree corresponding to the current headline. This means the
5724 entry will be moved to the configured archive location, most likely a
5729 Show all tags associated with the current item. Because of
5730 inheritance, this may be more than the tags listed in the line itself.
5734 Set tags for the current headline. If there is an active region in the
5735 agenda, change a tag for all headings in the region.
5739 Set the priority for the current item. Org mode prompts for the
5740 priority character. If you reply with @key{SPC}, the priority cookie
5741 is removed from the entry.
5745 Display weighted priority of current item.
5751 Increase the priority of the current item. The priority is changed in
5752 the original buffer, but the agenda is not resorted. Use the @kbd{r}
5756 @kindex S-@key{down}
5759 Decrease the priority of the current item.
5767 Set a deadline for this item.
5769 @kindex S-@key{right}
5771 Change the time stamp associated with the current line by one day into the
5772 future. With a numeric prefix argument, change it by that many days. For
5773 example, @kbd{3 6 5 S-@key{right}} will change it by a year. The stamp is
5774 changed in the original org file, but the change is not directly reflected in
5775 the agenda buffer. Use the @kbd{r} key to update the buffer.
5777 @kindex S-@key{left}
5779 Change the time stamp associated with the current line by one day
5784 Change the time stamp associated with the current line to today.
5785 The key @kbd{>} has been chosen, because it is the same as @kbd{S-.}
5790 Start the clock on the current item. If a clock is running already, it
5795 Stop the previously started clock.
5799 Cancel the currently running clock.
5803 Jump to the running clock in another window.
5805 @tsubheading{Calendar commands}
5806 @cindex calendar commands, from agenda
5809 Open the Emacs calendar and move to the date at the agenda cursor.
5812 When in the calendar, compute and show the Org mode agenda for the
5815 @cindex diary entries, creating from agenda
5818 Insert a new entry into the diary. Prompts for the type of entry
5819 (day, weekly, monthly, yearly, anniversary, cyclic) and creates a new
5820 entry in the diary, just as @kbd{i d} etc. would do in the calendar.
5821 The date is taken from the cursor position.
5825 Show the phases of the moon for the three months around current date.
5829 Show sunrise and sunset times. The geographical location must be set
5830 with calendar variables, see documentation of the Emacs calendar.
5834 Convert the date at cursor into many other cultural and historic
5839 Show holidays for three month around the cursor date.
5841 @item M-x org-export-icalendar-combine-agenda-files
5842 Export a single iCalendar file containing entries from all agenda files.
5843 This is a globally available command, and also available in the agenda menu.
5845 @tsubheading{Exporting to a file}
5848 @cindex exporting agenda views
5849 @cindex agenda views, exporting
5850 Write the agenda view to a file. Depending on the extension of the
5851 selected file name, the view will be exported as HTML (extension
5852 @file{.html} or @file{.htm}), Postscript (extension @file{.ps}), or
5853 plain text (any other extension). Use the variable
5854 @code{org-agenda-exporter-settings} to set options for @file{ps-print}
5855 and for @file{htmlize} to be used during export.
5857 @tsubheading{Quit and Exit}
5860 Quit agenda, remove the agenda buffer.
5863 @cindex agenda files, removing buffers
5865 Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
5866 for the compilation of the agenda. Buffers created by the user to
5867 visit org files will not be removed.
5871 @node Custom agenda views, Agenda column view, Agenda commands, Agenda Views
5872 @section Custom agenda views
5873 @cindex custom agenda views
5874 @cindex agenda views, custom
5876 Custom agenda commands serve two purposes: to store and quickly access
5877 frequently used TODO and tags searches, and to create special composite
5878 agenda buffers. Custom agenda commands will be accessible through the
5879 dispatcher (@pxref{Agenda dispatcher}), just like the default commands.
5882 * Storing searches:: Type once, use often
5883 * Block agenda:: All the stuff you need in a single buffer
5884 * Setting Options:: Changing the rules
5885 * Exporting Agenda Views:: Writing agendas to files
5886 * Using the agenda elsewhere:: Using agenda information in other programs
5889 @node Storing searches, Block agenda, Custom agenda views, Custom agenda views
5890 @subsection Storing searches
5892 The first application of custom searches is the definition of keyboard
5893 shortcuts for frequently used searches, either creating an agenda
5894 buffer, or a sparse tree (the latter covering of course only the current
5897 Custom commands are configured in the variable
5898 @code{org-agenda-custom-commands}. You can customize this variable, for
5899 example by pressing @kbd{C-c a C}. You can also directly set it with
5900 Emacs Lisp in @file{.emacs}. The following example contains all valid
5905 (setq org-agenda-custom-commands
5906 '(("w" todo "WAITING")
5907 ("W" todo-tree "WAITING")
5908 ("u" tags "+boss-urgent")
5909 ("v" tags-todo "+boss-urgent")
5910 ("U" tags-tree "+boss-urgent")
5911 ("f" occur-tree "\\<FIXME\\>")
5912 ("h" . "HOME+Name tags searches") ; description for "h" prefix
5913 ("hl" tags "+home+Lisa")
5914 ("hp" tags "+home+Peter")
5915 ("hk" tags "+home+Kim")))
5920 The initial string in each entry defines the keys you have to press
5921 after the dispatcher command @kbd{C-c a} in order to access the command.
5922 Usually this will be just a single character, but if you have many
5923 similar commands, you can also define two-letter combinations where the
5924 first character is the same in several combinations and serves as a
5925 prefix key@footnote{You can provide a description for a prefix key by
5926 inserting a cons cell with the prefix and the description.}. The second
5927 parameter is the search type, followed by the string or regular
5928 expression to be used for the matching. The example above will
5933 as a global search for TODO entries with @samp{WAITING} as the TODO
5936 as the same search, but only in the current buffer and displaying the
5937 results as a sparse tree
5939 as a global tags search for headlines marked @samp{:boss:} but not
5942 as the same search as @kbd{C-c a u}, but limiting the search to
5943 headlines that are also TODO items
5945 as the same search as @kbd{C-c a u}, but only in the current buffer and
5946 displaying the result as a sparse tree
5948 to create a sparse tree (again: current buffer only) with all entries
5949 containing the word @samp{FIXME}
5951 as a prefix command for a HOME tags search where you have to press an
5952 additional key (@kbd{l}, @kbd{p} or @kbd{k}) to select a name (Lisa,
5953 Peter, or Kim) as additional tag to match.
5956 @node Block agenda, Setting Options, Storing searches, Custom agenda views
5957 @subsection Block agenda
5958 @cindex block agenda
5959 @cindex agenda, with block views
5961 Another possibility is the construction of agenda views that comprise
5962 the results of @emph{several} commands, each of which creates a block in
5963 the agenda buffer. The available commands include @code{agenda} for the
5964 daily or weekly agenda (as created with @kbd{C-c a a}), @code{alltodo}
5965 for the global TODO list (as constructed with @kbd{C-c a t}), and the
5966 matching commands discussed above: @code{todo}, @code{tags}, and
5967 @code{tags-todo}. Here are two examples:
5971 (setq org-agenda-custom-commands
5972 '(("h" "Agenda and Home-related tasks"
5976 ("o" "Agenda and Office-related tasks"
5984 This will define @kbd{C-c a h} to create a multi-block view for stuff
5985 you need to attend to at home. The resulting agenda buffer will contain
5986 your agenda for the current week, all TODO items that carry the tag
5987 @samp{home}, and also all lines tagged with @samp{garden}. Finally the
5988 command @kbd{C-c a o} provides a similar view for office tasks.
5990 @node Setting Options, Exporting Agenda Views, Block agenda, Custom agenda views
5991 @subsection Setting options for custom commands
5992 @cindex options, for custom agenda views
5994 Org mode contains a number of variables regulating agenda construction
5995 and display. The global variables define the behavior for all agenda
5996 commands, including the custom commands. However, if you want to change
5997 some settings just for a single custom view, you can do so. Setting
5998 options requires inserting a list of variable names and values at the
5999 right spot in @code{org-agenda-custom-commands}. For example:
6003 (setq org-agenda-custom-commands
6004 '(("w" todo "WAITING"
6005 ((org-agenda-sorting-strategy '(priority-down))
6006 (org-agenda-prefix-format " Mixed: ")))
6007 ("U" tags-tree "+boss-urgent"
6008 ((org-show-following-heading nil)
6009 (org-show-hierarchy-above nil)))
6011 ((org-agenda-files '("~org/notes.org"))
6012 (org-agenda-text-search-extra-files nil)))))
6017 Now the @kbd{C-c a w} command will sort the collected entries only by
6018 priority, and the prefix format is modified to just say @samp{ Mixed: }
6019 instead of giving the category of the entry. The sparse tags tree of
6020 @kbd{C-c a U} will now turn out ultra-compact, because neither the
6021 headline hierarchy above the match, nor the headline following the match
6022 will be shown. The command @kbd{C-c a N} will do a text search limited
6023 to only a single file.
6025 For command sets creating a block agenda,
6026 @code{org-agenda-custom-commands} has two separate spots for setting
6027 options. You can add options that should be valid for just a single
6028 command in the set, and options that should be valid for all commands in
6029 the set. The former are just added to the command entry, the latter
6030 must come after the list of command entries. Going back to the block
6031 agenda example (@pxref{Block agenda}), let's change the sorting strategy
6032 for the @kbd{C-c a h} commands to @code{priority-down}, but let's sort
6033 the results for GARDEN tags query in the opposite order,
6034 @code{priority-up}. This would look like this:
6038 (setq org-agenda-custom-commands
6039 '(("h" "Agenda and Home-related tasks"
6043 ((org-agenda-sorting-strategy '(priority-up)))))
6044 ((org-agenda-sorting-strategy '(priority-down))))
6045 ("o" "Agenda and Office-related tasks"
6052 As you see, the values and parenthesis setting is a little complex.
6053 When in doubt, use the customize interface to set this variable - it
6054 fully supports its structure. Just one caveat: When setting options in
6055 this interface, the @emph{values} are just lisp expressions. So if the
6056 value is a string, you need to add the double quotes around the value
6060 @node Exporting Agenda Views, Using the agenda elsewhere, Setting Options, Custom agenda views
6061 @subsection Exporting Agenda Views
6062 @cindex agenda views, exporting
6064 If you are away from your computer, it can be very useful to have a
6065 printed version of some agenda views to carry around. Org mode can
6066 export custom agenda views as plain text, HTML@footnote{You need to
6067 install Hrvoje Niksic' @file{htmlize.el}.} postscript, and iCalendar
6068 files. If you want to do this only occasionally, use the command
6073 @cindex exporting agenda views
6074 @cindex agenda views, exporting
6075 Write the agenda view to a file. Depending on the extension of the
6076 selected file name, the view will be exported as HTML (extension
6077 @file{.html} or @file{.htm}), Postscript (extension @file{.ps}),
6078 iCalendar (extension @file{.ics}), or plain text (any other extension).
6079 Use the variable @code{org-agenda-exporter-settings} to
6080 set options for @file{ps-print} and for @file{htmlize} to be used during
6084 (setq org-agenda-exporter-settings
6085 '((ps-number-of-columns 2)
6086 (ps-landscape-mode t)
6087 (htmlize-output-type 'css)))
6091 If you need to export certain agenda views frequently, you can associate
6092 any custom agenda command with a list of output file names
6093 @footnote{If you want to store standard views like the weekly agenda
6094 or the global TODO list as well, you need to define custom commands for
6095 them in order to be able to specify file names.}. Here is an example
6096 that first does define custom commands for the agenda and the global
6097 todo list, together with a number of files to which to export them.
6098 Then we define two block agenda commands and specify file names for them
6099 as well. File names can be relative to the current working directory,
6104 (setq org-agenda-custom-commands
6105 '(("X" agenda "" nil ("agenda.html" "agenda.ps"))
6106 ("Y" alltodo "" nil ("todo.html" "todo.txt" "todo.ps"))
6107 ("h" "Agenda and Home-related tasks"
6112 ("~/views/home.html"))
6113 ("o" "Agenda and Office-related tasks"
6118 ("~/views/office.ps" "~/calendars/office.ics"))))
6122 The extension of the file name determines the type of export. If it is
6123 @file{.html}, Org mode will use the @file{htmlize.el} package to convert
6124 the buffer to HTML and save it to this file name. If the extension is
6125 @file{.ps}, @code{ps-print-buffer-with-faces} is used to produce
6126 postscript output. If the extension is @file{.ics}, iCalendar export is
6127 run export over all files that were used to construct the agenda, and
6128 limit the export to entries listed in the agenda now. Any other
6129 extension produces a plain ASCII file.
6131 The export files are @emph{not} created when you use one of those
6132 commands interactively because this might use too much overhead.
6133 Instead, there is a special command to produce @emph{all} specified
6139 Export all agenda views that have export file names associated with
6143 You can use the options section of the custom agenda commands to also
6144 set options for the export commands. For example:
6147 (setq org-agenda-custom-commands
6149 ((ps-number-of-columns 2)
6150 (ps-landscape-mode t)
6151 (org-agenda-prefix-format " [ ] ")
6152 (org-agenda-with-colors nil)
6153 (org-agenda-remove-tags t))
6158 This command sets two options for the postscript exporter, to make it
6159 print in two columns in landscape format - the resulting page can be cut
6160 in two and then used in a paper agenda. The remaining settings modify
6161 the agenda prefix to omit category and scheduling information, and
6162 instead include a checkbox to check off items. We also remove the tags
6163 to make the lines compact, and we don't want to use colors for the
6164 black-and-white printer. Settings specified in
6165 @code{org-agenda-exporter-settings} will also apply, but the settings
6166 in @code{org-agenda-custom-commands} take precedence.
6169 From the command line you may also use
6171 emacs -f org-batch-store-agenda-views -kill
6174 or, if you need to modify some parameters
6176 emacs -eval '(org-batch-store-agenda-views \
6177 org-agenda-ndays 30 \
6178 org-agenda-start-day "2007-11-01" \
6179 org-agenda-include-diary nil \
6180 org-agenda-files (quote ("~/org/project.org")))' \
6184 which will create the agenda views restricted to the file
6185 @file{~/org/project.org}, without diary entries and with 30 days
6188 @node Using the agenda elsewhere, , Exporting Agenda Views, Custom agenda views
6189 @subsection Using agenda information outside of Org
6190 @cindex agenda, pipe
6191 @cindex Scripts, for agenda processing
6193 Org provides commands to access agenda information for the command
6194 line in emacs batch mode. This extracted information can be sent
6195 directly to a printer, or it can be read by a program that does further
6196 processing of the data. The first of these commands is the function
6197 @code{org-batch-agenda}, that produces an agenda view and sends it as
6198 ASCII text to STDOUT. The command takes a single string as parameter.
6199 If the string has length 1, it is used as a key to one of the commands
6200 you have configured in @code{org-agenda-custom-commands}, basically any
6201 key you can use after @kbd{C-c a}. For example, to directly print the
6202 current TODO list, you could use
6205 emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
6208 If the parameter is a string with 2 or more characters, it is used as a
6209 tags/todo match string. For example, to print your local shopping list
6210 (all items with the tag @samp{shop}, but excluding the tag
6211 @samp{NewYork}), you could use
6214 emacs -batch -l ~/.emacs \
6215 -eval '(org-batch-agenda "+shop-NewYork")' | lpr
6219 You may also modify parameters on the fly like this:
6222 emacs -batch -l ~/.emacs \
6223 -eval '(org-batch-agenda "a" \
6224 org-agenda-ndays 30 \
6225 org-agenda-include-diary nil \
6226 org-agenda-files (quote ("~/org/project.org")))' \
6231 which will produce a 30 day agenda, fully restricted to the Org file
6232 @file{~/org/projects.org}, not even including the diary.
6234 If you want to process the agenda data in more sophisticated ways, you
6235 can use the command @code{org-batch-agenda-csv} to get a comma-separated
6236 list of values for each agenda item. Each line in the output will
6237 contain a number of fields separated by commas. The fields in a line
6241 category @r{The category of the item}
6242 head @r{The headline, without TODO kwd, TAGS and PRIORITY}
6243 type @r{The type of the agenda entry, can be}
6244 todo @r{selected in TODO match}
6245 tagsmatch @r{selected in tags match}
6246 diary @r{imported from diary}
6247 deadline @r{a deadline}
6248 scheduled @r{scheduled}
6249 timestamp @r{appointment, selected by timestamp}
6250 closed @r{entry was closed on date}
6251 upcoming-deadline @r{warning about nearing deadline}
6252 past-scheduled @r{forwarded scheduled item}
6253 block @r{entry has date block including date}
6254 todo @r{The TODO keyword, if any}
6255 tags @r{All tags including inherited ones, separated by colons}
6256 date @r{The relevant date, like 2007-2-14}
6257 time @r{The time, like 15:00-16:50}
6258 extra @r{String with extra planning info}
6259 priority-l @r{The priority letter if any was given}
6260 priority-n @r{The computed numerical priority}
6264 Time and date will only be given if a timestamp (or deadline/scheduled)
6265 lead to the selection of the item.
6267 A CSV list like this is very easy to use in a post processing script.
6268 For example, here is a Perl program that gets the TODO list from
6269 Emacs/Org and prints all the items, preceded by a checkbox:
6275 # define the Emacs command to run
6276 $cmd = "emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv \"t\")'";
6278 # run it and capture the output
6279 $agenda = qx@{$cmd 2>/dev/null@};
6281 # loop over all lines
6282 foreach $line (split(/\n/,$agenda)) @{
6284 # get the individual values
6285 ($category,$head,$type,$todo,$tags,$date,$time,$extra,
6286 $priority_l,$priority_n) = split(/,/,$line);
6288 # proccess and print
6289 print "[ ] $head\n";
6294 @node Agenda column view, , Custom agenda views, Agenda Views
6295 @section Using column view in the agenda
6296 @cindex column view, in agenda
6297 @cindex agenda, column view
6299 Column view (@pxref{Column view}) is normally used to view and edit
6300 properties embedded in the hierarchical structure of an Org file. It can be
6301 quite useful to use column view also from the agenda, where entries are
6302 collected by certain criteria.
6307 Turn on column view in the agenda.
6310 To understand how to use this properly, it is important to realize that the
6311 entries in the agenda are no longer in their proper outline environment.
6312 This causes the following issues:
6316 Org needs to make a decision which @code{COLUMNS} format to use. Since the
6317 entries in the agenda are collected from different files, and different files
6318 may have different @code{COLUMNS} formats, this is a non-trivial problem.
6319 Org first checks if the variable @code{org-overriding-columns-format} is
6320 currently set, and if yes takes the format from there. Otherwise it takes
6321 the format associated with the first item in the agenda, or, if that item
6322 does not have a specific format (defined in a property, or in it's file), it
6323 uses @code{org-columns-default-format}.
6325 If any of the columns has a summary type defined (@pxref{Column attributes}),
6326 turning on column view in the agenda will visit all relevant agenda files and
6327 make sure that the computations of this property are up to date. This is
6328 also true for the special @code{CLOCKSUM} property. Org will then sum the
6329 values displayed in the agenda. In the daily/weekly agenda, the sums will
6330 cover a single day, in all other views they cover the entire block. It is
6331 vital to realize that the agenda may show the same entry @emph{twice} (for
6332 example as scheduled and as a deadline), and it may show two entries from the
6333 same hierarchy (for example a @emph{parent} and it's @emph{child}). In these
6334 cases, the summation in the agenda will lead to incorrect results because
6335 some values will count double.
6337 When the column view in the agenda shows the @code{CLOCKSUM}, that is always
6338 the entire clocked time for this item. So even in the daily/weekly agenda,
6339 the clocksum listed in column view may originate from times outside the
6340 current view. This has the advantage that you can compare these values with
6341 a column listing the planned total effort for a task - one of the major
6342 applications for column view in the agenda. If you want information about
6343 clocked time in the displayed period use clock table mode (press @kbd{R} in
6348 @node Embedded LaTeX, Exporting, Agenda Views, Top
6349 @chapter Embedded LaTeX
6350 @cindex @TeX{} interpretation
6351 @cindex La@TeX{} interpretation
6353 Plain ASCII is normally sufficient for almost all note taking. One
6354 exception, however, are scientific notes which need to be able to contain
6355 mathematical symbols and the occasional formula. La@TeX{}@footnote{La@TeX{}
6356 is a macro system based on Donald E. Knuth's @TeX{} system. Many of the
6357 features described here as ``La@TeX{}'' are really from @TeX{}, but for
6358 simplicity I am blurring this distinction.} is widely used to typeset
6359 scientific documents. Org mode supports embedding La@TeX{} code into its
6360 files, because many academics are used to reading La@TeX{} source code, and
6361 because it can be readily processed into images for HTML production.
6363 It is not necessary to mark La@TeX{} macros and code in any special way.
6364 If you observe a few conventions, Org mode knows how to find it and what
6368 * Math symbols:: TeX macros for symbols and Greek letters
6369 * Subscripts and superscripts:: Simple syntax for raising/lowering text
6370 * LaTeX fragments:: Complex formulas made easy
6371 * Processing LaTeX fragments:: Previewing LaTeX processing
6372 * CDLaTeX mode:: Speed up entering of formulas
6375 @node Math symbols, Subscripts and superscripts, Embedded LaTeX, Embedded LaTeX
6376 @section Math symbols
6377 @cindex math symbols
6380 You can use La@TeX{} macros to insert special symbols like @samp{\alpha}
6381 to indicate the Greek letter, or @samp{\to} to indicate an arrow.
6382 Completion for these macros is available, just type @samp{\} and maybe a
6383 few letters, and press @kbd{M-@key{TAB}} to see possible completions.
6384 Unlike La@TeX{} code, Org mode allows these macros to be present
6385 without surrounding math delimiters, for example:
6388 Angles are written as Greek letters \alpha, \beta and \gamma.
6391 During HTML export (@pxref{HTML export}), these symbols are translated
6392 into the proper syntax for HTML, for the above examples this is
6393 @samp{α} and @samp{→}, respectively.
6395 @node Subscripts and superscripts, LaTeX fragments, Math symbols, Embedded LaTeX
6396 @section Subscripts and superscripts
6400 Just like in La@TeX{}, @samp{^} and @samp{_} are used to indicate super-
6401 and subscripts. Again, these can be used without embedding them in
6402 math-mode delimiters. To increase the readability of ASCII text, it is
6403 not necessary (but OK) to surround multi-character sub- and superscripts
6404 with curly braces. For example
6407 The mass if the sun is M_sun = 1.989 x 10^30 kg. The radius of
6408 the sun is R_@{sun@} = 6.96 x 10^8 m.
6411 To avoid interpretation as raised or lowered text, you can quote
6412 @samp{^} and @samp{_} with a backslash: @samp{\_} and @samp{\^}.
6414 During HTML export (@pxref{HTML export}), subscript and superscripts
6415 are surrounded with @code{<sub>} and @code{<sup>} tags, respectively.
6417 @node LaTeX fragments, Processing LaTeX fragments, Subscripts and superscripts, Embedded LaTeX
6418 @section LaTeX fragments
6419 @cindex LaTeX fragments
6421 With symbols, sub- and superscripts, HTML is pretty much at its end when
6422 it comes to representing mathematical formulas@footnote{Yes, there is
6423 MathML, but that is not yet fully supported by many browsers, and there
6424 is no decent converter for turning La@TeX{} or ASCII representations of
6425 formulas into MathML. So for the time being, converting formulas into
6426 images seems the way to go.}. More complex expressions need a dedicated
6427 formula processor. To this end, Org mode can contain arbitrary La@TeX{}
6428 fragments. It provides commands to preview the typeset result of these
6429 fragments, and upon export to HTML, all fragments will be converted to
6430 images and inlined into the HTML document@footnote{The La@TeX{} export
6431 will not use images for displaying La@TeX{} fragments but include these
6432 fragments directly into the La@TeX{} code.}. For this to work you
6433 need to be on a system with a working La@TeX{} installation. You also
6434 need the @file{dvipng} program, available at
6435 @url{http://sourceforge.net/projects/dvipng/}. The La@TeX{} header that
6436 will be used when processing a fragment can be configured with the
6437 variable @code{org-format-latex-header}.
6439 La@TeX{} fragments don't need any special marking at all. The following
6440 snippets will be identified as La@TeX{} source code:
6443 Environments of any kind. The only requirement is that the
6444 @code{\begin} statement appears on a new line, preceded by only
6447 Text within the usual La@TeX{} math delimiters. To avoid conflicts with
6448 currency specifications, single @samp{$} characters are only recognized
6449 as math delimiters if the enclosed text contains at most two line breaks,
6450 is directly attached to the @samp{$} characters with no whitespace in
6451 between, and if the closing @samp{$} is followed by whitespace or
6452 punctuation. For the other delimiters, there is no such restriction, so
6453 when in doubt, use @samp{\(...\)} as inline math delimiters.
6456 @noindent For example:
6459 \begin@{equation@} % arbitrary environments,
6460 x=\sqrt@{b@} % even tables, figures
6461 \end@{equation@} % etc
6463 If $a^2=b$ and \( b=2 \), then the solution must be
6464 either $$ a=+\sqrt@{2@} $$ or \[ a=-\sqrt@{2@} \].
6468 If you need any of the delimiter ASCII sequences for other purposes, you
6469 can configure the option @code{org-format-latex-options} to deselect the
6470 ones you do not wish to have interpreted by the La@TeX{} converter.
6472 @node Processing LaTeX fragments, CDLaTeX mode, LaTeX fragments, Embedded LaTeX
6473 @section Processing LaTeX fragments
6474 @cindex LaTeX fragments, preview
6476 La@TeX{} fragments can be processed to produce a preview images of the
6477 typeset expressions:
6482 Produce a preview image of the La@TeX{} fragment at point and overlay it
6483 over the source code. If there is no fragment at point, process all
6484 fragments in the current entry (between two headlines). When called
6485 with a prefix argument, process the entire subtree. When called with
6486 two prefix arguments, or when the cursor is before the first headline,
6487 process the entire buffer.
6490 Remove the overlay preview images.
6493 During HTML export (@pxref{HTML export}), all La@TeX{} fragments are
6494 converted into images and inlined into the document if the following
6498 (setq org-export-with-LaTeX-fragments t)
6501 @node CDLaTeX mode, , Processing LaTeX fragments, Embedded LaTeX
6502 @section Using CDLaTeX to enter math
6505 CDLaTeX mode is a minor mode that is normally used in combination with a
6506 major La@TeX{} mode like AUCTeX in order to speed-up insertion of
6507 environments and math templates. Inside Org mode, you can make use of
6508 some of the features of CDLaTeX mode. You need to install
6509 @file{cdlatex.el} and @file{texmathp.el} (the latter comes also with
6510 AUCTeX) from @url{http://www.astro.uva.nl/~dominik/Tools/cdlatex}.
6511 Don't use CDLaTeX mode itself under Org mode, but use the light
6512 version @code{org-cdlatex-mode} that comes as part of Org mode. Turn it
6513 on for the current buffer with @code{M-x org-cdlatex-mode}, or for all
6517 (add-hook 'org-mode-hook 'turn-on-org-cdlatex)
6520 When this mode is enabled, the following features are present (for more
6521 details see the documentation of CDLaTeX mode):
6525 Environment templates can be inserted with @kbd{C-c @{}.
6528 The @key{TAB} key will do template expansion if the cursor is inside a
6529 La@TeX{} fragment@footnote{Org mode has a method to test if the cursor is
6530 inside such a fragment, see the documentation of the function
6531 @code{org-inside-LaTeX-fragment-p}.}. For example, @key{TAB} will
6532 expand @code{fr} to @code{\frac@{@}@{@}} and position the cursor
6533 correctly inside the first brace. Another @key{TAB} will get you into
6534 the second brace. Even outside fragments, @key{TAB} will expand
6535 environment abbreviations at the beginning of a line. For example, if
6536 you write @samp{equ} at the beginning of a line and press @key{TAB},
6537 this abbreviation will be expanded to an @code{equation} environment.
6538 To get a list of all abbreviations, type @kbd{M-x cdlatex-command-help}.
6542 Pressing @kbd{_} and @kbd{^} inside a La@TeX{} fragment will insert these
6543 characters together with a pair of braces. If you use @key{TAB} to move
6544 out of the braces, and if the braces surround only a single character or
6545 macro, they are removed again (depending on the variable
6546 @code{cdlatex-simplify-sub-super-scripts}).
6549 Pressing the backquote @kbd{`} followed by a character inserts math
6550 macros, also outside La@TeX{} fragments. If you wait more than 1.5 seconds
6551 after the backquote, a help window will pop up.
6554 Pressing the normal quote @kbd{'} followed by another character modifies
6555 the symbol before point with an accent or a font. If you wait more than
6556 1.5 seconds after the backquote, a help window will pop up. Character
6557 modification will work only inside La@TeX{} fragments, outside the quote
6561 @node Exporting, Publishing, Embedded LaTeX, Top
6565 Org mode documents can be exported into a variety of other formats. For
6566 printing and sharing of notes, ASCII export produces a readable and
6567 simple version of an Org file. HTML export allows you to publish a
6568 notes file on the web, while the XOXO format provides a solid base for
6569 exchange with a broad range of other applications. La@TeX{} export lets
6570 you use Org mode and its structured editing functions to easily create
6571 La@TeX{} files. To incorporate entries with associated times like
6572 deadlines or appointments into a desktop calendar program like iCal,
6573 Org mode can also produce extracts in the iCalendar format. Currently
6574 Org mode only supports export, not import of these different formats.
6576 When exporting, Org mode uses special conventions to enrich the output
6577 produced. @xref{Text interpretation}, for more details.
6582 Dispatcher for export and publishing commands. Displays a help-window
6583 listing the additional key(s) needed to launch an export or publishing
6584 command. The prefix arg is passed through to the exporter. If the option
6585 @code{org-export-run-in-background} is set, Org will run the command in the
6586 background if that seems useful for the specific command (i.e. commands that
6588 @kindex C-u C-u C-c C-e
6589 @item C-u C-u C-c C-e
6590 Call an the exporter, but reverse the setting of
6591 @code{org-export-run-in-background}, i.e. request background processing if
6592 not set, or force processing in the current Emacs process if st.
6596 * ASCII export:: Exporting to plain ASCII
6597 * HTML export:: Exporting to HTML
6598 * LaTeX export:: Exporting to LaTeX
6599 * XOXO export:: Exporting to XOXO
6600 * iCalendar export:: Exporting in iCalendar format
6601 * Text interpretation:: How the exporter looks at the file
6604 @node ASCII export, HTML export, Exporting, Exporting
6605 @section ASCII export
6606 @cindex ASCII export
6608 ASCII export produces a simple and very readable version of an Org mode
6611 @cindex region, active
6612 @cindex active region
6613 @cindex Transient mark mode
6617 Export as ASCII file. For an org file @file{myfile.org}, the ASCII file
6618 will be @file{myfile.txt}. The file will be overwritten without
6619 warning. If there is an active region, only the region will be
6620 exported. If the selected region is a single tree, the tree head will
6621 become the document title. If the tree head entry has or inherits an
6622 @code{:EXPORT_FILE_NAME:} property, that name will be used for the
6626 Export only the visible part of the document.
6629 @cindex headline levels, for exporting
6630 In the exported version, the first 3 outline levels will become
6631 headlines, defining a general document structure. Additional levels
6632 will be exported as itemized lists. If you want that transition to occur
6633 at a different level, specify it with a prefix argument. For example,
6640 creates only top level headlines and does the rest as items. When
6641 headlines are converted to items, the indentation of the text following
6642 the headline is changed to fit nicely under the item. This is done with
6643 the assumption that the first body line indicates the base indentation of
6644 the body text. Any indentation larger than this is adjusted to preserve
6645 the layout relative to the first line. Should there be lines with less
6646 indentation than the first, these are left alone.
6648 @node HTML export, LaTeX export, ASCII export, Exporting
6649 @section HTML export
6652 Org mode contains an HTML (XHTML 1.0 strict) exporter with extensive
6653 HTML formatting, in ways similar to John Grubers @emph{markdown}
6654 language, but with additional support for tables.
6657 * HTML Export commands:: How to invoke LaTeX export
6658 * Quoting HTML tags:: Using direct HTML in Org mode
6659 * Links:: Transformation of links for HTML
6660 * Images:: How to include images
6661 * CSS support:: Changing the appearance of the output
6662 * Javascript support:: Info and Folding in a web browser
6665 @node HTML Export commands, Quoting HTML tags, HTML export, HTML export
6666 @subsection HTML export commands
6668 @cindex region, active
6669 @cindex active region
6670 @cindex Transient mark mode
6674 Export as HTML file @file{myfile.html}. For an org file
6675 @file{myfile.org}, the ASCII file will be @file{myfile.html}. The file
6676 will be overwritten without warning. If there is an active region, only
6677 the region will be exported. If the selected region is a single tree,
6678 the tree head will become the document title. If the tree head entry
6679 has or inherits an @code{:EXPORT_FILE_NAME:} property, that name will be
6680 used for the export.
6683 Export as HTML file and immediately open it with a browser.
6686 Export to a temporary buffer, do not create a file.
6689 Export the active region to a temporary buffer. With a prefix argument, do
6690 not produce the file header and footer, but just the plain HTML section for
6691 the region. This is good for cut-and-paste operations.
6700 Export only the visible part of the document.
6701 @item M-x org-export-region-as-html
6702 Convert the region to HTML under the assumption that it was Org mode
6703 syntax before. This is a global command that can be invoked in any
6705 @item M-x org-replace-region-by-HTML
6706 Replace the active region (assumed to be in Org mode syntax) by HTML
6710 @cindex headline levels, for exporting
6711 In the exported version, the first 3 outline levels will become headlines,
6712 defining a general document structure. Additional levels will be exported as
6713 itemized lists. If you want that transition to occur at a different level,
6714 specify it with a numeric prefix argument. For example,
6721 creates two levels of headings and does the rest as items.
6723 @node Quoting HTML tags, Links, HTML Export commands, HTML export
6724 @subsection Quoting HTML tags
6726 Plain @samp{<} and @samp{>} are always transformed to @samp{<} and
6727 @samp{>} in HTML export. If you want to include simple HTML tags
6728 which should be interpreted as such, mark them with @samp{@@} as in
6729 @samp{@@<b>bold text@@</b>}. Note that this really works only for
6730 simple tags. For more extensive HTML that should be copied verbatim to
6731 the exported file use either
6734 #+HTML: Literal HTML code for export
6741 All lines between these markers are exported literally
6746 @node Links, Images, Quoting HTML tags, HTML export
6749 @cindex links, in HTML export
6750 @cindex internal links, in HTML export
6751 @cindex external links, in HTML export
6752 Internal links (@pxref{Internal links}) will continue to work in HTML
6753 files only if they match a dedicated @samp{<<target>>}. Automatic links
6754 created by radio targets (@pxref{Radio targets}) will also work in the
6755 HTML file. Links to external files will still work if the HTML file is
6756 in the same directory as the Org file. Links to other @file{.org}
6757 files will be translated into HTML links under the assumption that an
6758 HTML version also exists of the linked file. For information related to
6759 linking files while publishing them to a publishing directory see
6760 @ref{Publishing links}.
6762 @node Images, CSS support, Links, HTML export
6765 @cindex images, inline in HTML
6766 @cindex inlining images in HTML
6767 HTML export can inline images given as links in the Org file, and
6768 it can make an image the clickable part of a link. By
6769 default@footnote{but see the variable
6770 @code{org-export-html-inline-images}}, images are inlined if a link does
6771 not have a description. So @samp{[[file:myimg.jpg]]} will be inlined,
6772 while @samp{[[file:myimg.jpg][the image]]} will just produce a link
6773 @samp{the image} that points to the image. If the description part
6774 itself is a @code{file:} link or a @code{http:} URL pointing to an
6775 image, this image will be inlined and activated so that clicking on the
6776 image will activate the link. For example, to include a thumbnail that
6777 will link to a high resolution version of the image, you could use:
6780 [[file:highres.jpg][file:thumb.jpg]]
6784 and you could use @code{http} addresses just as well.
6786 @node CSS support, Javascript support, Images, HTML export
6787 @subsection CSS support
6788 @cindex CSS, for HTML export
6789 @cindex HTML export, CSS
6791 You can also give style information for the exported file. The HTML
6792 exporter assigns the following CSS classes to appropriate parts of the
6793 document - your style specifications may change these:
6795 .todo @r{TODO keywords}
6796 .done @r{the DONE keyword}
6797 .timestamp @r{time stamp}
6798 .timestamp-kwd @r{keyword associated with a time stamp, like SCHEDULED}
6799 .tag @r{tag in a headline}
6800 .target @r{target for links}
6803 The default style specification can be configured through the option
6804 @code{org-export-html-style}. If you want to use a file-local style,
6805 you may use file variables, best wrapped into a COMMENT section at the
6806 end of the outline tree. For example@footnote{Under Emacs 21, the
6807 continuation lines for a variable value should have no @samp{#} at the
6808 start of the line.}:
6811 * COMMENT html style specifications
6814 # org-export-html-style: " <style type=\"text/css\">
6815 # p @{font-weight: normal; color: gray; @}
6816 # h1 @{color: black; @}
6821 Remember to execute @kbd{M-x normal-mode} after changing this to make
6822 the new style visible to Emacs. This command restarts Org mode for the
6823 current buffer and forces Emacs to re-evaluate the local variables
6824 section in the buffer.
6826 @c FIXME: More about header and footer styles
6827 @c FIXME: Talk about links and targets.
6829 @node Javascript support, , CSS support, HTML export
6830 @subsection Javascript supported display of web pages
6832 @emph{Sebastian Rose} has written a JavaScript program especially designed to
6833 enhance the web viewing experience of HTML files created with Org. This
6834 program allows to view large files in two different ways. The first one is
6835 an @emph{Info}-like mode where each section is displayed separately and
6836 navigation can be done with the @kbd{n} and @kbd{p} keys (and some other keys
6837 as well, press @kbd{?} for an overview of the available keys). The second
6838 view type is a @emph{folding} view much like Org provides it inside Emacs.
6839 The script is available at @url{http://orgmode.org/org-info.js} and you can
6840 find the documentation for it at @url{http://orgmode.org/org-infojs.html}.
6841 We are serving the script from our site, but if you use it a lot, you might
6842 not want to be dependent on @url{orgmode.org} and prefer to install a local
6843 copy on your own web server.
6845 To use the script, you need to make sure that the @file{org-infojs.el} module
6846 gets loaded. It should be loaded by default, try @kbd{M-x customize-variable
6847 @key{RET} org-modules @key{RET}} to convince yourself that this is indeed the
6848 case. All it then takes to make use of the program is adding a single line
6852 #+INFOSJ_OPT: view:info toc:nil
6856 If this line is found, the HTML header will automatically contain the code
6857 needed to invoke the script. Using the line above, you can set the following
6861 path: @r{The path to the script. The default is to grab the script from}
6862 @r{@url{http://orgmode.org/org-info.js}, but you might want to have}
6863 @r{a local copy and use a path like @samp{../scripts/org-info.js}.}
6864 view: @r{Initial view when website is first shown. Possible values are}
6865 info @r{Info-like interface with one section per page.}
6866 overview @r{Folding interface, initially showing only top-level.}
6867 content @r{Folding interface, starting with all headlines visible.}
6868 showall @r{Folding interface, all headlines and text visible.}
6869 sdepth: @r{Maximum headline level that will still become an independent}
6870 @r{section for info and folding modes. The default is taken from}
6871 @r{@code{org-headline-levels} (= the @code{H} switch in @code{#+OPTIONS}).}
6872 @r{If this is smaller than in @code{org-headline-levels}, each}
6873 @r{info/folding section can still contain children headlines.}
6874 toc: @r{Should the table of content @emph{initially} be visible?}
6875 @r{Even when @code{nil}, you can always get to the toc with @kbd{i}.}
6876 tdepth: @r{The depth of the table of contents. The defaults are taken from}
6877 @r{the variables @code{org-headline-levels} and @code{org-export-with-toc}.}
6878 ltoc: @r{Should there be short contents (children) in each section?}
6879 mouse: @r{Headings are highlighted when the mouse is over them. Should be}
6880 @r{@samp{underline} (default) or a background color like @samp{#cccccc}.}
6881 buttons: @r{Should view-toggle buttons be everywhere? When @code{nil} (the}
6882 @r{default), only one such button will be present.}
6885 You can choose default values for these options by customizing the variable
6886 @code{org-infojs-options}. If you always want to apply the script to your
6887 pages, configure the variable @code{org-export-html-use-infojs}.
6889 @node LaTeX export, XOXO export, HTML export, Exporting
6890 @section LaTeX export
6891 @cindex LaTeX export
6893 Org mode contains a La@TeX{} exporter written by Bastien Guerry.
6896 * LaTeX export commands:: How to invoke LaTeX export
6897 * Quoting LaTeX code:: Incorporating literal LaTeX code
6898 * Sectioning structure:: Changing sectioning in LaTeX output
6901 @node LaTeX export commands, Quoting LaTeX code, LaTeX export, LaTeX export
6902 @subsection LaTeX export commands
6907 Export as La@TeX{} file @file{myfile.tex}.
6910 Export to a temporary buffer, do not create a file.
6915 Export only the visible part of the document.
6916 @item M-x org-export-region-as-latex
6917 Convert the region to La@TeX{} under the assumption that it was Org mode
6918 syntax before. This is a global command that can be invoked in any
6920 @item M-x org-replace-region-by-latex
6921 Replace the active region (assumed to be in Org mode syntax) by La@TeX{}
6925 @cindex headline levels, for exporting
6926 In the exported version, the first 3 outline levels will become
6927 headlines, defining a general document structure. Additional levels
6928 will be exported as description lists. The exporter can ignore them or
6929 convert them to a custom string depending on
6930 @code{org-latex-low-levels}.
6932 If you want that transition to occur at a different level, specify it
6933 with a numeric prefix argument. For example,
6940 creates two levels of headings and does the rest as items.
6942 @node Quoting LaTeX code, Sectioning structure, LaTeX export commands, LaTeX export
6943 @subsection Quoting LaTeX code
6945 Embedded La@TeX{} as described in @ref{Embedded LaTeX} will be correctly
6946 inserted into the La@TeX{} file. Furthermore, you can add special code
6947 that should only be present in La@TeX{} export with the following
6951 #+LaTeX: Literal LaTeX code for export
6958 All lines between these markers are exported literally
6964 @node Sectioning structure, , Quoting LaTeX code, LaTeX export
6965 @subsection Sectioning structure
6967 @cindex LaTeX sectioning structure
6969 By default, the La@TeX{} output uses the class @code{article}.
6971 You can change this globally by setting a different value for
6972 @code{org-export-latex-default-class} or locally by adding an option
6973 like @code{#+LaTeX_CLASS: myclass} in your file. The class should be
6974 listed in @code{org-export-latex-classes}, where you can also define the
6975 sectioning structure for each class.
6978 @node XOXO export, iCalendar export, LaTeX export, Exporting
6979 @section XOXO export
6982 Org mode contains an exporter that produces XOXO-style output.
6983 Currently, this exporter only handles the general outline structure and
6984 does not interpret any additional Org mode features.
6989 Export as XOXO file @file{myfile.html}.
6992 Export only the visible part of the document.
6995 @node iCalendar export, Text interpretation, XOXO export, Exporting
6996 @section iCalendar export
6997 @cindex iCalendar export
6999 Some people like to use Org mode for keeping track of projects, but
7000 still prefer a standard calendar application for anniversaries and
7001 appointments. In this case it can be useful to have deadlines and
7002 other time-stamped items in Org files show up in the calendar
7003 application. Org mode can export calendar information in the standard
7004 iCalendar format. If you also want to have TODO entries included in the
7005 export, configure the variable @code{org-icalendar-include-todo}.
7010 Create iCalendar entries for the current file and store them in the same
7011 directory, using a file extension @file{.ics}.
7014 Like @kbd{C-c C-e i}, but do this for all files in
7015 @code{org-agenda-files}. For each of these files, a separate iCalendar
7016 file will be written.
7019 Create a single large iCalendar file from all files in
7020 @code{org-agenda-files} and write it to the file given by
7021 @code{org-combined-agenda-icalendar-file}.
7024 The export will honor SUMMARY, DESCRIPTION and LOCATION properties if
7025 the selected entries have them. If not, the summary will be derived
7026 from the headline, and the description from the body (limited to
7027 @code{org-icalendar-include-body} characters).
7029 How this calendar is best read and updated, depends on the application
7030 you are using. The FAQ covers this issue.
7033 @node Text interpretation, , iCalendar export, Exporting
7034 @section Text interpretation by the exporter
7036 The exporter backends interpret additional structure in the Org file
7037 in order to produce better output.
7040 * Comment lines:: Some lines will not be exported
7041 * Initial text:: Text before the first headline
7042 * Footnotes:: Numbers like [1]
7043 * Quoted examples:: Inserting quoted chunks of text
7044 * Enhancing text:: Subscripts, symbols and more
7045 * Export options:: How to influence the export settings
7048 @node Comment lines, Initial text, Text interpretation, Text interpretation
7049 @subsection Comment lines
7050 @cindex comment lines
7051 @cindex exporting, not
7053 Lines starting with @samp{#} in column zero are treated as comments
7054 and will never be exported. Also entire subtrees starting with the
7055 word @samp{COMMENT} will never be exported.
7060 Toggle the COMMENT keyword at the beginning of an entry.
7063 @node Initial text, Footnotes, Comment lines, Text interpretation
7064 @subsection Text before the first headline
7066 Org mode normally ignores any text before the first headline when
7067 exporting, leaving this region for internal links to speed up navigation
7068 etc. However, in publishing-oriented files, you might want to have some
7069 text before the first headline, like a small introduction, special HTML
7070 code with a navigation bar, etc. You can ask to have this part of the
7071 file exported as well by setting the variable
7072 @code{org-export-skip-text-before-1st-heading} to @code{nil}. On a
7073 per-file basis, you can get the same effect with
7079 The text before the first headline will be fully processed
7080 (@pxref{Enhancing text}), and the first non-comment line becomes the
7081 title of the exported document. If you need to include literal HTML,
7082 use the special constructs described in @ref{Quoting HTML tags}. The
7083 table of contents is normally inserted directly before the first
7084 headline of the file. If you would like to get it to a different
7085 location, insert the string @code{[TABLE-OF-CONTENTS]} on a line by
7086 itself at the desired location.
7088 Finally, if you want to use the space before the first headline for
7089 internal purposes, but @emph{still} want to place something before the
7090 first headline when exporting the file, you can use the @code{#+TEXT}
7095 #+TEXT: This text will go before the *first* headline.
7096 #+TEXT: We place the table of contents here:
7097 #+TEXT: [TABLE-OF-CONTENTS]
7098 #+TEXT: This goes between the table of contents and the first headline
7101 @node Footnotes, Quoted examples, Initial text, Text interpretation
7102 @subsection Footnotes
7104 @cindex @file{footnote.el}
7106 Numbers in square brackets are treated as footnotes, so that you can use
7107 the Emacs package @file{footnote.el} to create footnotes. For example:
7110 The Org homepage[1] clearly needs help from
7111 a good web designer.
7113 [1] The link is: http://orgmode.org
7118 Note that the @file{footnote} package uses @kbd{C-c !} to invoke its
7119 commands. This binding conflicts with the Org mode command for
7120 inserting inactive time stamps. You could use the variable
7121 @code{footnote-prefix} to switch footnotes commands to another key. Or,
7122 if you are too used to this binding, you could use
7123 @code{org-replace-disputed-keys} and @code{org-disputed-keys} to change
7124 the settings in Org.
7126 @node Quoted examples, Enhancing text, Footnotes, Text interpretation
7127 @subsection Quoted examples
7128 @cindex quoted examples
7129 @cindex examples, quoted
7130 @cindex text, fixed width
7131 @cindex fixed width text
7133 When writing technical documents, you often need to insert examples that
7134 are not further interpreted by Org mode. For historical reasons, there
7135 are several ways to do this:
7139 If a headline starts with the word @samp{QUOTE}, the text below the
7140 headline will be typeset as fixed-width, to allow quoting of computer
7143 Lines starting with @samp{:} are also typeset in fixed-width font.
7147 Toggle fixed-width for entry (QUOTE) or region, see below.
7150 Finally, text between
7156 will also be exported in this way.
7160 @node Enhancing text, Export options, Quoted examples, Text interpretation
7161 @subsection Enhancing text for export
7162 @cindex enhancing text
7165 Some of the export backends of Org mode allow for sophisticated text
7166 formatting, this is true in particular for the HTML and La@TeX{}
7167 backends. Org mode has a number of typing conventions that allow to
7168 produce a richly formatted output.
7172 @cindex hand-formatted lists
7173 @cindex lists, hand-formatted
7175 Plain lists @samp{-}, @samp{*} or @samp{+} as bullet, or with @samp{1.}
7176 or @samp{2)} as enumerator will be recognized and transformed if the
7177 backend supports lists. See @xref{Plain lists}.
7179 @cindex underlined text
7182 @cindex verbatim text
7184 You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=code=}
7185 and @code{~verbatim~}, and, if you must, @samp{+strikethrough+}. Text
7186 in the code and verbatim string is not processed for Org mode specific
7187 syntax, it is exported verbatim.
7189 @cindex horizontal rules, in exported files
7191 A line consisting of only dashes, and at least 5 of them, will be
7192 exported as a horizontal line (@samp{<hr/>} in HTML).
7194 @cindex LaTeX fragments, export
7195 @cindex TeX macros, export
7197 Many @TeX{} macros and entire La@TeX{} fragments are converted into HTML
7198 entities or images (@pxref{Embedded LaTeX}).
7200 @cindex tables, export
7202 Tables are transformed into native tables under the exporter, if the
7203 export backend supports this. Data fields before the first horizontal
7204 separator line will be formatted as table header fields.
7208 If a headline starts with the word @samp{QUOTE}, the text below the
7209 headline will be typeset as fixed-width, to allow quoting of computer
7210 codes etc. Lines starting with @samp{:} are also typeset in fixed-width
7215 Toggle fixed-width for entry (QUOTE) or region, see below.
7217 Finally, text between
7223 will also be exported in this way.
7225 @cindex linebreak, forced
7227 A double backslash @emph{at the end of a line} enforces a line break at
7230 @cindex HTML entities, LaTeX entities
7232 Strings like @code{\alpha} will be exported as @code{α}, in the
7233 HTML output. These strings are exported as @code{$\alpha$} in the
7234 La@TeX{} output. Similarly, @code{\nbsp} will become @code{ } in
7235 HTML and in La@TeX{}. This applies for a long list of entities, see
7236 the variable @code{org-html-entities} for the complete list.
7240 If these conversions conflict with your habits of typing ASCII text,
7241 they can all be turned off with corresponding variables. See the
7242 customization group @code{org-export-general}, and the following section
7243 which explains how to set export options with special lines in a
7247 @node Export options, , Enhancing text, Text interpretation
7248 @subsection Export options
7249 @cindex options, for export
7251 @cindex completion, of option keywords
7252 The exporter recognizes special lines in the buffer which provide
7253 additional information. These lines may be put anywhere in the file.
7254 The whole set of lines can be inserted into the buffer with @kbd{C-c
7255 C-e t}. For individual lines, a good way to make sure the keyword is
7256 correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
7257 (@pxref{Completion}).
7262 Insert template with export options, see example below.
7266 #+TITLE: the title to be shown (default is the buffer name)
7267 #+AUTHOR: the author (default taken from @code{user-full-name})
7268 #+DATE: A date, fixed, of a format string for @code{format-time-string}
7269 #+EMAIL: his/her email address (default from @code{user-mail-address})
7270 #+LANGUAGE: language for HTML, e.g. @samp{en} (@code{org-export-default-language})
7271 #+TEXT: Some descriptive text to be inserted at the beginning.
7272 #+TEXT: Several lines may be given.
7273 #+OPTIONS: H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t f:t TeX:t ...
7277 The OPTIONS line is a compact form to specify export settings. Here
7279 @cindex headline levels
7280 @cindex section-numbers
7281 @cindex table of contents
7282 @cindex linebreak preservation
7283 @cindex quoted HTML tags
7284 @cindex fixed-width sections
7286 @cindex @TeX{}-like syntax for sub- and superscripts
7288 @cindex special strings
7289 @cindex emphasized text
7290 @cindex @TeX{} macros
7291 @cindex La@TeX{} fragments
7292 @cindex author info, in export
7293 @cindex time info, in export
7295 H: @r{set the number of headline levels for export}
7296 num: @r{turn on/off section-numbers}
7297 toc: @r{turn on/off table of contents, or set level limit (integer)}
7298 \n: @r{turn on/off linebreak-preservation}
7299 @@: @r{turn on/off quoted HTML tags}
7300 :: @r{turn on/off fixed-width sections}
7301 |: @r{turn on/off tables}
7302 ^: @r{turn on/off @TeX{}-like syntax for sub- and superscripts. If}
7303 @r{you write "^:@{@}", @code{a_@{b@}} will be interpreted, but}
7304 @r{the simple @code{a_b} will be left as it is.}
7305 -: @r{turn on/off conversion of special strings.}
7306 f: @r{turn on/off foototes like this[1].}
7307 *: @r{turn on/off emphasized text (bold, italic, underlined)}
7308 TeX: @r{turn on/off simple @TeX{} macros in plain text}
7309 LaTeX: @r{turn on/off La@TeX{} fragments}
7310 skip: @r{turn on/off skipping the text before the first heading}
7311 author: @r{turn on/off inclusion of author name/email into exported file}
7312 timestamp: @r{turn on/off inclusion creation time into exported file}
7313 d: @r{turn on/off inclusion of drawers}
7316 These options take effect in both the HTML and La@TeX{} export, except
7317 for @code{TeX} and @code{LaTeX}, which are respectively @code{t} and
7318 @code{nil} for the La@TeX{} export.
7320 @node Publishing, Miscellaneous, Exporting, Top
7324 Org includes@footnote{@file{org-publish.el} is not distributed with
7325 Emacs 21, if you are still using Emacs 21, you need you need to download
7326 this file separately.} a publishing management system that allows you to
7327 configure automatic HTML conversion of @emph{projects} composed of
7328 interlinked org files. This system is called @emph{org-publish}. You can
7329 also configure org-publish to automatically upload your exported HTML
7330 pages and related attachments, such as images and source code files, to
7331 a web server. Org-publish turns Org into a web-site authoring tool.
7333 You can also use Org-publish to convert files into La@TeX{}, or even
7334 combine HTML and La@TeX{} conversion so that files are available in both
7335 formats on the server@footnote{Since La@TeX{} files on a server are not
7336 that helpful, you surely want to perform further conversion on them --
7337 e.g. convert them to @code{PDF} format.}.
7339 Org-publish has been contributed to Org by David O'Toole.
7342 * Configuration:: Defining projects
7343 * Sample configuration:: Example projects
7344 * Triggering publication:: Publication commands
7347 @node Configuration, Sample configuration, Publishing, Publishing
7348 @section Configuration
7350 Publishing needs significant configuration to specify files, destination
7351 and many other properties of a project.
7354 * Project alist:: The central configuration variable
7355 * Sources and destinations:: From here to there
7356 * Selecting files:: What files are part of the project?
7357 * Publishing action:: Setting the function doing the publishing
7358 * Publishing options:: Tweaking HTML export
7359 * Publishing links:: Which links keep working after publishing?
7360 * Project page index:: Publishing a list of project files
7363 @node Project alist, Sources and destinations, Configuration, Configuration
7364 @subsection The variable @code{org-publish-project-alist}
7365 @cindex org-publish-project-alist
7366 @cindex projects, for publishing
7368 Org-publish is configured almost entirely through setting the value of
7369 one variable, called @code{org-publish-project-alist}.
7370 Each element of the list configures one project, and may be in one of
7371 the two following forms:
7374 ("project-name" :property value :property value ...)
7378 ("project-name" :components ("project-name" "project-name" ...))
7382 In both cases, projects are configured by specifying property values.
7383 A project defines the set of files that will be published, as well as
7384 the publishing configuration to use when publishing those files. When
7385 a project takes the second form listed above, the individual members
7386 of the ``components'' property are taken to be components of the
7387 project, which group together files requiring different publishing
7388 options. When you publish such a ``meta-project'' all the components
7391 @node Sources and destinations, Selecting files, Project alist, Configuration
7392 @subsection Sources and destinations for files
7393 @cindex directories, for publishing
7395 Most properties are optional, but some should always be set. In
7396 particular, org-publish needs to know where to look for source files,
7397 and where to put published files.
7399 @multitable @columnfractions 0.3 0.7
7400 @item @code{:base-directory}
7401 @tab Directory containing publishing source files
7402 @item @code{:publishing-directory}
7403 @tab Directory (possibly remote) where output files will be published.
7404 @item @code{:preparation-function}
7405 @tab Function called before starting publishing process, for example to
7406 run @code{make} for updating files to be published.
7410 @node Selecting files, Publishing action, Sources and destinations, Configuration
7411 @subsection Selecting files
7412 @cindex files, selecting for publishing
7414 By default, all files with extension @file{.org} in the base directory
7415 are considered part of the project. This can be modified by setting the
7417 @multitable @columnfractions 0.25 0.75
7418 @item @code{:base-extension}
7419 @tab Extension (without the dot!) of source files. This actually is a
7422 @item @code{:exclude}
7423 @tab Regular expression to match file names that should not be
7424 published, even though they have been selected on the basis of their
7427 @item @code{:include}
7428 @tab List of files to be included regardless of @code{:base-extension}
7429 and @code{:exclude}.
7432 @node Publishing action, Publishing options, Selecting files, Configuration
7433 @subsection Publishing action
7434 @cindex action, for publishing
7436 Publishing means that a file is copied to the destination directory and
7437 possibly transformed in the process. The default transformation is to
7438 export Org files as HTML files, and this is done by the function
7439 @code{org-publish-org-to-html} which calls the HTML exporter
7440 (@pxref{HTML export}). But you also can publish your files in La@TeX{} by
7441 using the function @code{org-publish-org-to-latex} instead. Other files
7442 like images only need to be copied to the publishing destination. For
7443 non-Org files, you need to specify the publishing function.
7446 @multitable @columnfractions 0.3 0.7
7447 @item @code{:publishing-function}
7448 @tab Function executing the publication of a file. This may also be a
7449 list of functions, which will all be called in turn.
7452 The function must accept two arguments: a property list containing at
7453 least a @code{:publishing-directory} property, and the name of the file
7454 to be published. It should take the specified file, make the necessary
7455 transformation (if any) and place the result into the destination folder.
7456 You can write your own publishing function, but @code{org-publish}
7457 provides one for attachments (files that only need to be copied):
7458 @code{org-publish-attachment}.
7460 @node Publishing options, Publishing links, Publishing action, Configuration
7461 @subsection Options for the HTML/LaTeX exporters
7462 @cindex options, for publishing
7464 The property list can be used to set many export options for the HTML
7465 and La@TeX{} exporters. In most cases, these properties correspond to user
7466 variables in Org. The table below lists these properties along
7467 with the variable they belong to. See the documentation string for the
7468 respective variable for details.
7470 @multitable @columnfractions 0.3 0.7
7471 @item @code{:language} @tab @code{org-export-default-language}
7472 @item @code{:headline-levels} @tab @code{org-export-headline-levels}
7473 @item @code{:section-numbers} @tab @code{org-export-with-section-numbers}
7474 @item @code{:table-of-contents} @tab @code{org-export-with-toc}
7475 @item @code{:archived-trees} @tab @code{org-export-with-archived-trees}
7476 @item @code{:emphasize} @tab @code{org-export-with-emphasize}
7477 @item @code{:sub-superscript} @tab @code{org-export-with-sub-superscripts}
7478 @item @code{:special-strings} @tab @code{org-export-with-special-strings}
7479 @item @code{:TeX-macros} @tab @code{org-export-with-TeX-macros}
7480 @item @code{:LaTeX-fragments} @tab @code{org-export-with-LaTeX-fragments}
7481 @item @code{:fixed-width} @tab @code{org-export-with-fixed-width}
7482 @item @code{:timestamps} .@tab @code{org-export-with-timestamps}
7483 @item @code{:tags} .@tab @code{org-export-with-tags}
7484 @item @code{:tables} @tab @code{org-export-with-tables}
7485 @item @code{:table-auto-headline} @tab @code{org-export-highlight-first-table-line}
7486 @item @code{:style} @tab @code{org-export-html-style}
7487 @item @code{:convert-org-links} @tab @code{org-export-html-link-org-files-as-html}
7488 @item @code{:inline-images} @tab @code{org-export-html-inline-images}
7489 @item @code{:expand-quoted-html} @tab @code{org-export-html-expand}
7490 @item @code{:timestamp} @tab @code{org-export-html-with-timestamp}
7491 @item @code{:publishing-directory} @tab @code{org-export-publishing-directory}
7492 @item @code{:preamble} @tab @code{org-export-html-preamble}
7493 @item @code{:postamble} @tab @code{org-export-html-postamble}
7494 @item @code{:auto-preamble} @tab @code{org-export-html-auto-preamble}
7495 @item @code{:auto-postamble} @tab @code{org-export-html-auto-postamble}
7496 @item @code{:author} @tab @code{user-full-name}
7497 @item @code{:email} @tab @code{user-mail-address}
7500 If you use several email addresses, separate them by a semi-column.
7502 Most of the @code{org-export-with-*} variables have the same effect in
7503 both HTML and La@TeX{} exporters, except for @code{:TeX-macros} and
7504 @code{:LaTeX-fragments}, respectively @code{nil} and @code{t} in the
7507 When a property is given a value in @code{org-publish-project-alist},
7508 its setting overrides the value of the corresponding user variable (if
7509 any) during publishing. Options set within a file (@pxref{Export
7510 options}), however, override everything.
7512 @node Publishing links, Project page index, Publishing options, Configuration
7513 @subsection Links between published files
7514 @cindex links, publishing
7516 To create a link from one Org file to another, you would use
7517 something like @samp{[[file:foo.org][The foo]]} or simply
7518 @samp{file:foo.org.} (@pxref{Hyperlinks}). Upon publishing this link
7519 becomes a link to @file{foo.html}. In this way, you can interlink the
7520 pages of your "org web" project and the links will work as expected when
7521 you publish them to HTML.
7523 You may also link to related files, such as images. Provided you are
7524 careful with relative pathnames, and provided you have also configured
7525 @code{org-publish} to upload the related files, these links will work
7526 too. @ref{Complex example} for an example of this usage.
7528 Sometime an Org file to be published may contain links that are
7529 only valid in your production environment, but not in the publishing
7530 location. In this case, use the property
7532 @multitable @columnfractions 0.4 0.6
7533 @item @code{:link-validation-function}
7534 @tab Function to validate links
7538 to define a function for checking link validity. This function must
7539 accept two arguments, the file name and a directory relative to which
7540 the file name is interpreted in the production environment. If this
7541 function returns @code{nil}, then the HTML generator will only insert a
7542 description into the HTML file, but no link. One option for this
7543 function is @code{org-publish-validate-link} which checks if the given
7544 file is part of any project in @code{org-publish-project-alist}.
7546 @node Project page index, , Publishing links, Configuration
7547 @subsection Project page index
7548 @cindex index, of published pages
7550 The following properties may be used to control publishing of an
7551 index of files or summary page for a given project.
7553 @multitable @columnfractions 0.25 0.75
7554 @item @code{:auto-index}
7555 @tab When non-nil, publish an index during org-publish-current-project or
7558 @item @code{:index-filename}
7559 @tab Filename for output of index. Defaults to @file{index.org} (which
7560 becomes @file{index.html}).
7562 @item @code{:index-title}
7563 @tab Title of index page. Defaults to name of file.
7565 @item @code{:index-function}
7566 @tab Plug-in function to use for generation of index.
7567 Defaults to @code{org-publish-org-index}, which generates a plain list
7568 of links to all files in the project.
7571 @node Sample configuration, Triggering publication, Configuration, Publishing
7572 @section Sample configuration
7574 Below we provide two example configurations. The first one is a simple
7575 project publishing only a set of Org files. The second example is
7576 more complex, with a multi-component project.
7579 * Simple example:: One-component publishing
7580 * Complex example:: A multi-component publishing example
7583 @node Simple example, Complex example, Sample configuration, Sample configuration
7584 @subsection Example: simple publishing configuration
7586 This example publishes a set of Org files to the @file{public_html}
7587 directory on the local machine.
7590 (setq org-publish-project-alist
7592 :base-directory "~/org/"
7593 :publishing-directory "~/public_html"
7594 :section-numbers nil
7595 :table-of-contents nil
7596 :style "<link rel=stylesheet
7597 href=\"../other/mystyle.css\"
7598 type=\"text/css\">")))
7601 @node Complex example, , Simple example, Sample configuration
7602 @subsection Example: complex publishing configuration
7604 This more complicated example publishes an entire website, including
7605 org files converted to HTML, image files, emacs lisp source code, and
7606 style sheets. The publishing-directory is remote and private files are
7609 To ensure that links are preserved, care should be taken to replicate
7610 your directory structure on the web server, and to use relative file
7611 paths. For example, if your org files are kept in @file{~/org} and your
7612 publishable images in @file{~/images}, you'd link to an image with
7615 file:../images/myimage.png
7618 On the web server, the relative path to the image should be the
7619 same. You can accomplish this by setting up an "images" folder in the
7620 right place on the web server, and publishing images to it.
7623 (setq org-publish-project-alist
7625 :base-directory "~/org/"
7626 :base-extension "org"
7627 :publishing-directory "/ssh:user@@host:~/html/notebook/"
7628 :publishing-function org-publish-org-to-html
7629 :exclude "PrivatePage.org" ;; regexp
7631 :section-numbers nil
7632 :table-of-contents nil
7633 :style "<link rel=stylesheet
7634 href=\"../other/mystyle.css\" type=\"text/css\">"
7636 :auto-postamble nil)
7639 :base-directory "~/images/"
7640 :base-extension "jpg\\|gif\\|png"
7641 :publishing-directory "/ssh:user@@host:~/html/images/"
7642 :publishing-function org-publish-attachment)
7645 :base-directory "~/other/"
7646 :base-extension "css\\|el"
7647 :publishing-directory "/ssh:user@@host:~/html/other/"
7648 :publishing-function org-publish-attachment)
7649 ("website" :components ("orgfiles" "images" "other"))))
7652 @node Triggering publication, , Sample configuration, Publishing
7653 @section Triggering publication
7655 Once org-publish is properly configured, you can publish with the
7656 following functions:
7660 Prompt for a specific project and publish all files that belong to it.
7662 Publish the project containing the current file.
7664 Publish only the current file.
7666 Publish all projects.
7669 Org uses timestamps to track when a file has changed. The above
7670 functions normally only publish changed files. You can override this and
7671 force publishing of all files by giving a prefix argument.
7673 @node Miscellaneous, Extensions and Hacking, Publishing, Top
7674 @chapter Miscellaneous
7677 * Completion:: M-TAB knows what you need
7678 * Customization:: Adapting Org to your taste
7679 * In-buffer settings:: Overview of the #+KEYWORDS
7680 * The very busy C-c C-c key:: When in doubt, press C-c C-c
7681 * Clean view:: Getting rid of leading stars in the outline
7682 * TTY keys:: Using Org on a tty
7683 * Interaction:: Other Emacs packages
7684 * Bugs:: Things which do not work perfectly
7687 @node Completion, Customization, Miscellaneous, Miscellaneous
7689 @cindex completion, of @TeX{} symbols
7690 @cindex completion, of TODO keywords
7691 @cindex completion, of dictionary words
7692 @cindex completion, of option keywords
7693 @cindex completion, of tags
7694 @cindex completion, of property keys
7695 @cindex completion, of link abbreviations
7696 @cindex @TeX{} symbol completion
7697 @cindex TODO keywords completion
7698 @cindex dictionary word completion
7699 @cindex option keyword completion
7700 @cindex tag completion
7701 @cindex link abbreviations, completion of
7703 Org supports in-buffer completion. This type of completion does
7704 not make use of the minibuffer. You simply type a few letters into
7705 the buffer and use the key to complete text right there.
7710 Complete word at point
7713 At the beginning of a headline, complete TODO keywords.
7715 After @samp{\}, complete @TeX{} symbols supported by the exporter.
7717 After @samp{*}, complete headlines in the current buffer so that they
7718 can be used in search links like @samp{[[*find this headline]]}.
7720 After @samp{:} in a headline, complete tags. The list of tags is taken
7721 from the variable @code{org-tag-alist} (possibly set through the
7722 @samp{#+TAGS} in-buffer option, @pxref{Setting tags}), or it is created
7723 dynamically from all tags used in the current buffer.
7725 After @samp{:} and not in a headline, complete property keys. The list
7726 of keys is constructed dynamically from all keys used in the current
7729 After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}).
7731 After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
7732 @samp{OPTIONS} which set file-specific options for Org mode. When the
7733 option keyword is already complete, pressing @kbd{M-@key{TAB}} again
7734 will insert example settings for this keyword.
7736 In the line after @samp{#+STARTUP: }, complete startup keywords,
7737 i.e. valid keys for this line.
7739 Elsewhere, complete dictionary words using Ispell.
7743 @node Customization, In-buffer settings, Completion, Miscellaneous
7744 @section Customization
7745 @cindex customization
7746 @cindex options, for customization
7747 @cindex variables, for customization
7749 There are more than 180 variables that can be used to customize
7750 Org. For the sake of compactness of the manual, I am not
7751 describing the variables here. A structured overview of customization
7752 variables is available with @kbd{M-x org-customize}. Or select
7753 @code{Browse Org Group} from the @code{Org->Customization} menu. Many
7754 settings can also be activated on a per-file basis, by putting special
7755 lines into the buffer (@pxref{In-buffer settings}).
7757 @node In-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
7758 @section Summary of in-buffer settings
7759 @cindex in-buffer settings
7760 @cindex special keywords
7762 Org mode uses special lines in the buffer to define settings on a
7763 per-file basis. These lines start with a @samp{#+} followed by a
7764 keyword, a colon, and then individual words defining a setting. Several
7765 setting words can be in the same line, but you can also have multiple
7766 lines for the keyword. While these settings are described throughout
7767 the manual, here is a summary. After changing any of those lines in the
7768 buffer, press @kbd{C-c C-c} with the cursor still in the line to
7769 activate the changes immediately. Otherwise they become effective only
7770 when the file is visited again in a new Emacs session.
7773 @item #+ARCHIVE: %s_done::
7774 This line sets the archive location for the agenda file. It applies for
7775 all subsequent lines until the next @samp{#+ARCHIVE} line, or the end
7776 of the file. The first such line also applies to any entries before it.
7777 The corresponding variable is @code{org-archive-location}.
7779 This line sets the category for the agenda file. The category applies
7780 for all subsequent lines until the next @samp{#+CATEGORY} line, or the
7781 end of the file. The first such line also applies to any entries before it.
7782 @item #+COLUMNS: %25ITEM .....
7783 Set the default format for columns view. This format applies when
7784 columns view is invoked in location where no @code{COLUMNS} property
7786 @item #+CONSTANTS: name1=value1 ...
7787 Set file-local values for constants to be used in table formulas. This
7788 line set the local variable @code{org-table-formula-constants-local}.
7789 The global version of this variable is
7790 @code{org-table-formula-constants}.
7791 @item #+DRAWERS: NAME1 .....
7792 Set the file-local set of drawers. The corresponding global variable is
7794 @item #+LINK: linkword replace
7795 These lines (several are allowed) specify link abbreviations.
7796 @xref{Link abbreviations}. The corresponding variable is
7797 @code{org-link-abbrev-alist}.
7798 @item #+PRIORITIES: highest lowest default
7799 This line sets the limits and the default for the priorities. All three
7800 must be either letters A-Z or numbers 0-9. The highest priority must
7801 have a lower ASCII number that the lowest priority.
7802 @item #+PROPERTY: Property_Name Value
7803 This line sets a default inheritance value for entries in the current
7804 buffer, most useful for specifying the allowed values of a property.
7806 This line sets options to be used at startup of Org mode, when an
7807 Org file is being visited. The first set of options deals with the
7808 initial visibility of the outline tree. The corresponding variable for
7809 global default settings is @code{org-startup-folded}, with a default
7810 value @code{t}, which means @code{overview}.
7811 @cindex @code{overview}, STARTUP keyword
7812 @cindex @code{content}, STARTUP keyword
7813 @cindex @code{showall}, STARTUP keyword
7815 overview @r{top-level headlines only}
7816 content @r{all headlines}
7817 showall @r{no folding at all, show everything}
7819 Then there are options for aligning tables upon visiting a file. This
7820 is useful in files containing narrowed table columns. The corresponding
7821 variable is @code{org-startup-align-all-tables}, with a default value
7823 @cindex @code{align}, STARTUP keyword
7824 @cindex @code{noalign}, STARTUP keyword
7826 align @r{align all tables}
7827 noalign @r{don't align tables on startup}
7829 Logging closing and reinstating TODO items, and clock intervals
7830 (variables @code{org-log-done}, @code{org-log-note-clock-out}, and
7831 @code{org-log-repeat}) can be configured using these options.
7832 @cindex @code{logdone}, STARTUP keyword
7833 @cindex @code{lognotedone}, STARTUP keyword
7834 @cindex @code{nologdone}, STARTUP keyword
7835 @cindex @code{lognoteclock-out}, STARTUP keyword
7836 @cindex @code{nolognoteclock-out}, STARTUP keyword
7837 @cindex @code{logrepeat}, STARTUP keyword
7838 @cindex @code{lognoterepeat}, STARTUP keyword
7839 @cindex @code{nologrepeat}, STARTUP keyword
7841 logdone @r{record a timestamp when an item is marked DONE}
7842 lognotedone @r{record timestamp and a note when DONE}
7843 nologdone @r{don't record when items are marked DONE}
7844 logrepeat @r{record a time when reinstating a repeating item}
7845 lognoterepeat @r{record a note when reinstating a repeating item}
7846 nologrepeat @r{do not record when reinstating repeating item}
7847 lognoteclock-out @r{record a note when clocking out}
7848 nolognoteclock-out @r{don't record a note when clocking out}
7850 Here are the options for hiding leading stars in outline headings. The
7851 corresponding variables are @code{org-hide-leading-stars} and
7852 @code{org-odd-levels-only}, both with a default setting @code{nil}
7853 (meaning @code{showstars} and @code{oddeven}).
7854 @cindex @code{hidestars}, STARTUP keyword
7855 @cindex @code{showstars}, STARTUP keyword
7856 @cindex @code{odd}, STARTUP keyword
7857 @cindex @code{even}, STARTUP keyword
7859 hidestars @r{make all but one of the stars starting a headline invisible.}
7860 showstars @r{show all stars starting a headline}
7861 odd @r{allow only odd outline levels (1,3,...)}
7862 oddeven @r{allow all outline levels}
7864 To turn on custom format overlays over time stamps (variables
7865 @code{org-put-time-stamp-overlays} and
7866 @code{org-time-stamp-overlay-formats}), use
7867 @cindex @code{customtime}, STARTUP keyword
7869 customtime @r{overlay custom time format}
7871 The following options influence the table spreadsheet (variable
7872 @code{constants-unit-system}).
7873 @cindex @code{constcgs}, STARTUP keyword
7874 @cindex @code{constSI}, STARTUP keyword
7876 constcgs @r{@file{constants.el} should use the c-g-s unit system}
7877 constSI @r{@file{constants.el} should use the SI unit system}
7879 @item #+TAGS: TAG1(c1) TAG2(c2)
7880 These lines (several such lines are allowed) specify the valid tags in
7881 this file, and (potentially) the corresponding @emph{fast tag selection}
7882 keys. The corresponding variable is @code{org-tag-alist}.
7884 This line contains the formulas for the table directly above the line.
7885 @item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS, #+DATE:
7886 These lines provide settings for exporting files. For more details see
7887 @ref{Export options}.
7888 @item #+SEQ_TODO: #+TYP_TODO:
7889 These lines set the TODO keywords and their interpretation in the
7890 current file. The corresponding variables are @code{org-todo-keywords}
7891 and @code{org-todo-interpretation}.
7894 @node The very busy C-c C-c key, Clean view, In-buffer settings, Miscellaneous
7895 @section The very busy C-c C-c key
7897 @cindex C-c C-c, overview
7899 The key @kbd{C-c C-c} has many purposes in Org, which are all
7900 mentioned scattered throughout this manual. One specific function of
7901 this key is to add @emph{tags} to a headline (@pxref{Tags}). In many
7902 other circumstances it means something like @emph{Hey Org, look
7903 here and update according to what you see here}. Here is a summary of
7904 what this means in different contexts.
7908 If there are highlights in the buffer from the creation of a sparse
7909 tree, or from clock display, remove these highlights.
7911 If the cursor is in one of the special @code{#+KEYWORD} lines, this
7912 triggers scanning the buffer for these lines and updating the
7915 If the cursor is inside a table, realign the table. This command
7916 works even if the automatic table editor has been turned off.
7918 If the cursor is on a @code{#+TBLFM} line, re-apply the formulas to
7921 If the cursor is inside a table created by the @file{table.el} package,
7922 activate that table.
7924 If the current buffer is a remember buffer, close the note and file it.
7925 With a prefix argument, file it, without further interaction, to the
7928 If the cursor is on a @code{<<<target>>>}, update radio targets and
7929 corresponding links in this buffer.
7931 If the cursor is in a property line or at the start or end of a property
7932 drawer, offer property commands.
7934 If the cursor is in a plain list item with a checkbox, toggle the status
7937 If the cursor is on a numbered item in a plain list, renumber the
7940 If the cursor is on the @code{#+BEGIN} line of a dynamical block, the
7944 @node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous
7945 @section A cleaner outline view
7946 @cindex hiding leading stars
7947 @cindex clean outline view
7949 Some people find it noisy and distracting that the Org headlines
7950 are starting with a potentially large number of stars. For example
7951 the tree from @ref{Headlines}:
7954 * Top level headline
7960 * Another top level headline
7964 Unfortunately this is deeply ingrained into the code of Org and
7965 cannot be easily changed. You can, however, modify the display in such
7966 a way that all leading stars become invisible and the outline more easy
7967 to read. To do this, customize the variable
7968 @code{org-hide-leading-stars} like this:
7971 (setq org-hide-leading-stars t)
7975 or change this on a per-file basis with one of the lines (anywhere in
7979 #+STARTUP: showstars
7980 #+STARTUP: hidestars
7984 Press @kbd{C-c C-c} with the cursor in a @samp{STARTUP} line to activate
7987 With stars hidden, the tree becomes:
7990 * Top level headline
7996 * Another top level headline
8000 Note that the leading stars are not truly replaced by whitespace, they
8001 are only fontified with the face @code{org-hide} that uses the
8002 background color as font color. If you are not using either white or
8003 black background, you may have to customize this face to get the wanted
8004 effect. Another possibility is to set this font such that the extra
8005 stars are @i{almost} invisible, for example using the color
8006 @code{grey90} on a white background.
8008 Things become cleaner still if you skip all the even levels and use only
8009 odd levels 1, 3, 5..., effectively adding two stars to go from one
8010 outline level to the next:
8013 * Top level headline
8019 * Another top level headline
8023 In order to make the structure editing and export commands handle this
8024 convention correctly, use
8027 (setq org-odd-levels-only t)
8031 or set this on a per-file basis with one of the following lines (don't
8032 forget to press @kbd{C-c C-c} with the cursor in the startup line to
8033 activate changes immediately).
8040 You can convert an Org file from single-star-per-level to the
8041 double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
8042 RET} in that file. The reverse operation is @kbd{M-x
8043 org-convert-to-oddeven-levels}.
8045 @node TTY keys, Interaction, Clean view, Miscellaneous
8046 @section Using Org on a tty
8047 @cindex tty key bindings
8049 Because Org contains a large number of commands, by default much of
8050 Org's core commands are bound to keys that are generally not
8051 accessible on a tty, such as the cursor keys (@key{left}, @key{right},
8052 @key{up}, @key{down}), @key{TAB} and @key{RET}, in particular when used
8053 together with modifiers like @key{Meta} and/or @key{Shift}. To access
8054 these commands on a tty when special keys are unavailable, the following
8055 alternative bindings can be used. The tty bindings below will likely be
8056 more cumbersome; you may find for some of the bindings below that a
8057 customized work-around suits you better. For example, changing a time
8058 stamp is really only fun with @kbd{S-@key{cursor}} keys, whereas on a
8059 tty you would rather use @kbd{C-c .} to re-insert the timestamp.
8061 @multitable @columnfractions 0.15 0.2 0.2
8062 @item @b{Default} @tab @b{Alternative 1} @tab @b{Alternative 2}
8063 @item @kbd{S-@key{TAB}} @tab @kbd{C-u @key{TAB}} @tab
8064 @item @kbd{M-@key{left}} @tab @kbd{C-c C-x l} @tab @kbd{@key{Esc} @key{left}}
8065 @item @kbd{M-S-@key{left}} @tab @kbd{C-c C-x L} @tab
8066 @item @kbd{M-@key{right}} @tab @kbd{C-c C-x r} @tab @kbd{@key{Esc} @key{right}}
8067 @item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R} @tab
8068 @item @kbd{M-@key{up}} @tab @kbd{C-c C-x u} @tab @kbd{@key{Esc} @key{up}}
8069 @item @kbd{M-S-@key{up}} @tab @kbd{C-c C-x U} @tab
8070 @item @kbd{M-@key{down}} @tab @kbd{C-c C-x d} @tab @kbd{@key{Esc} @key{down}}
8071 @item @kbd{M-S-@key{down}} @tab @kbd{C-c C-x D} @tab
8072 @item @kbd{S-@key{RET}} @tab @kbd{C-c C-x c} @tab
8073 @item @kbd{M-@key{RET}} @tab @kbd{C-c C-x m} @tab @kbd{@key{Esc} @key{RET}}
8074 @item @kbd{M-S-@key{RET}} @tab @kbd{C-c C-x M} @tab
8075 @item @kbd{S-@key{left}} @tab @kbd{C-c @key{left}} @tab
8076 @item @kbd{S-@key{right}} @tab @kbd{C-c @key{right}} @tab
8077 @item @kbd{S-@key{up}} @tab @kbd{C-c @key{up}} @tab
8078 @item @kbd{S-@key{down}} @tab @kbd{C-c @key{down}} @tab
8079 @item @kbd{C-S-@key{left}} @tab @kbd{C-c C-x @key{left}} @tab
8080 @item @kbd{C-S-@key{right}} @tab @kbd{C-c C-x @key{right}} @tab
8083 @node Interaction, Bugs, TTY keys, Miscellaneous
8084 @section Interaction with other packages
8085 @cindex packages, interaction with other
8086 Org lives in the world of GNU Emacs and interacts in various ways
8087 with other code out there.
8090 * Cooperation:: Packages Org cooperates with
8091 * Conflicts:: Packages that lead to conflicts
8094 @node Cooperation, Conflicts, Interaction, Interaction
8095 @subsection Packages that Org cooperates with
8098 @cindex @file{calc.el}
8099 @item @file{calc.el} by Dave Gillespie
8100 Org uses the Calc package for implementing spreadsheet
8101 functionality in its tables (@pxref{The spreadsheet}). Org
8102 checks for the availability of Calc by looking for the function
8103 @code{calc-eval} which should be autoloaded in your setup if Calc has
8104 been installed properly. As of Emacs 22, Calc is part of the Emacs
8105 distribution. Another possibility for interaction between the two
8106 packages is using Calc for embedded calculations. @xref{Embedded Mode,
8107 , Embedded Mode, Calc, GNU Emacs Calc Manual}.
8108 @cindex @file{constants.el}
8109 @item @file{constants.el} by Carsten Dominik
8110 In a table formula (@pxref{The spreadsheet}), it is possible to use
8111 names for natural constants or units. Instead of defining your own
8112 constants in the variable @code{org-table-formula-constants}, install
8113 the @file{constants} package which defines a large number of constants
8114 and units, and lets you use unit prefixes like @samp{M} for
8115 @samp{Mega} etc. You will need version 2.0 of this package, available
8116 at @url{http://www.astro.uva.nl/~dominik/Tools}. Org checks for
8117 the function @code{constants-get}, which has to be autoloaded in your
8118 setup. See the installation instructions in the file
8119 @file{constants.el}.
8120 @item @file{cdlatex.el} by Carsten Dominik
8121 @cindex @file{cdlatex.el}
8122 Org mode can make use of the CDLaTeX package to efficiently enter
8123 La@TeX{} fragments into Org files. See @ref{CDLaTeX mode}.
8124 @item @file{imenu.el} by Ake Stenhoff and Lars Lindberg
8125 @cindex @file{imenu.el}
8126 Imenu allows menu access to an index of items in a file. Org mode
8127 supports Imenu - all you need to do to get the index is the following:
8129 (add-hook 'org-mode-hook
8130 (lambda () (imenu-add-to-menubar "Imenu")))
8132 By default the index is two levels deep - you can modify the depth using
8133 the option @code{org-imenu-depth}.
8134 @item @file{remember.el} by John Wiegley
8135 @cindex @file{remember.el}
8136 Org cooperates with remember, see @ref{Remember}.
8137 @file{Remember.el} is not part of Emacs, find it on the web.
8138 @item @file{speedbar.el} by Eric M. Ludlam
8139 @cindex @file{speedbar.el}
8140 Speedbar is a package that creates a special frame displaying files and
8141 index items in files. Org mode supports Speedbar and allows you to
8142 drill into Org files directly from the Speedbar. It also allows to
8143 restrict the scope of agenda commands to a file or a subtree by using
8144 the command @kbd{<} in the Speedbar frame.
8145 @cindex @file{table.el}
8146 @item @file{table.el} by Takaaki Ota
8148 @cindex table editor, @file{table.el}
8149 @cindex @file{table.el}
8151 Complex ASCII tables with automatic line wrapping, column- and
8152 row-spanning, and alignment can be created using the Emacs table
8153 package by Takaaki Ota (@uref{http://sourceforge.net/projects/table},
8154 and also part of Emacs 22).
8155 When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org mode
8156 will call @command{table-recognize-table} and move the cursor into the
8157 table. Inside a table, the keymap of Org mode is inactive. In order
8158 to execute Org mode-related commands, leave the table.
8163 Recognize @file{table.el} table. Works when the cursor is in a
8168 Insert a table.el table. If there is already a table at point, this
8169 command converts it between the table.el format and the Org mode
8170 format. See the documentation string of the command
8171 @code{org-convert-table} for the restrictions under which this is
8174 @file{table.el} is part of Emacs 22.
8175 @cindex @file{footnote.el}
8176 @item @file{footnote.el} by Steven L. Baur
8177 Org mode recognizes numerical footnotes as provided by this package
8178 (@pxref{Footnotes}).
8181 @node Conflicts, , Cooperation, Interaction
8182 @subsection Packages that lead to conflicts with Org mode
8186 @cindex @file{allout.el}
8187 @item @file{allout.el} by Ken Manheimer
8188 Startup of Org may fail with the error message
8189 @code{(wrong-type-argument keymapp nil)} when there is an outdated
8190 version @file{allout.el} on the load path, for example the version
8191 distributed with Emacs 21.x. Upgrade to Emacs 22 and this problem will
8192 disappear. If for some reason you cannot do this, make sure that org.el
8193 is loaded @emph{before} @file{allout.el}, for example by putting
8194 @code{(require 'org)} early enough into your @file{.emacs} file.
8196 @cindex @file{CUA.el}
8197 @item @file{CUA.el} by Kim. F. Storm
8198 Key bindings in Org conflict with the @kbd{S-<cursor>} keys used by
8199 CUA mode (as well as pc-select-mode and s-region-mode) to select and
8200 extend the region. If you want to use one of these packages along with
8201 Org, configure the variable @code{org-replace-disputed-keys}. When
8202 set, Org will move the following key bindings in Org files, and
8203 in the agenda buffer (but not during date selection).
8206 S-UP -> M-p S-DOWN -> M-n
8207 S-LEFT -> M-- S-RIGHT -> M-+
8210 Yes, these are unfortunately more difficult to remember. If you want
8211 to have other replacement keys, look at the variable
8212 @code{org-disputed-keys}.
8213 @item @file{windmove.el} by Hovav Shacham
8214 @cindex @file{windmove.el}
8215 Also this package uses the @kbd{S-<cursor>} keys, so everything written
8216 in the paragraph above about CUA mode also applies here.
8218 @cindex @file{footnote.el}
8219 @item @file{footnote.el} by Steven L. Baur
8220 Org supports the syntax of the footnote package, but only the
8221 numerical footnote markers. Also, the default key for footnote
8222 commands, @kbd{C-c !} is already used by Org. You could use the
8223 variable @code{footnote-prefix} to switch footnotes commands to another
8224 key. Or, you could use @code{org-replace-disputed-keys} and
8225 @code{org-disputed-keys} to change the settings in Org.
8230 @node Bugs, , Interaction, Miscellaneous
8234 Here is a list of things that should work differently, but which I
8235 have found too hard to fix.
8239 If a table field starts with a link, and if the corresponding table
8240 column is narrowed (@pxref{Narrow columns}) to a width too small to
8241 display the link, the field would look entirely empty even though it is
8242 not. To prevent this, Org throws an error. The work-around is to
8243 make the column wide enough to fit the link, or to add some text (at
8244 least 2 characters) before the link in the same field.
8246 Narrowing table columns does not work on XEmacs, because the
8247 @code{format} function does not transport text properties.
8249 Text in an entry protected with the @samp{QUOTE} keyword should not
8252 When the application called by @kbd{C-c C-o} to open a file link fails
8253 (for example because the application does not exist or refuses to open
8254 the file), it does so silently. No error message is displayed.
8256 Recalculating a table line applies the formulas from left to right.
8257 If a formula uses @emph{calculated} fields further down the row,
8258 multiple recalculation may be needed to get all fields consistent. You
8259 may use the command @code{org-table-iterate} (@kbd{C-u C-c *}) to
8260 recalculate until convergence.
8262 A single letter cannot be made bold, for example @samp{*a*}.
8264 The exporters work well, but could be made more efficient.
8268 @node Extensions and Hacking, History and Acknowledgments, Miscellaneous, Top
8269 @appendix Extensions, Hooks and Hacking
8271 This appendix lists extensions for Org written by other authors.
8272 It also covers some aspects where users can extend the functionality of
8276 * Extensions:: Existing 3rd-party extensions
8277 * Adding hyperlink types:: New custom link types
8278 * Tables in arbitrary syntax:: Orgtbl for LaTeX and other programs
8279 * Dynamic blocks:: Automatically filled blocks
8280 * Special agenda views:: Customized views
8281 * Using the property API:: Writing programs that use entry properties
8284 @node Extensions, Adding hyperlink types, Extensions and Hacking, Extensions and Hacking
8285 @section Third-party extensions for Org
8286 @cindex extension, third-party
8288 There are lots of extensions that have been written by other people. Most of
8289 them have either been integrated into Org by now, or they can be found in the
8290 Org distribution, in the @file{contrib} directory. The list has gotten too
8291 long to cover in any detail here, but there is a seaparate manual for these
8294 @node Adding hyperlink types, Tables in arbitrary syntax, Extensions, Extensions and Hacking
8295 @section Adding hyperlink types
8296 @cindex hyperlinks, adding new types
8298 Org has a large number of hyperlink types built-in
8299 (@pxref{Hyperlinks}). If you would like to add new link types, it
8300 provides an interface for doing so. Lets look at an example file
8301 @file{org-man.el} that will add support for creating links like
8302 @samp{[[man:printf][The printf manpage]]} to show Unix manual pages inside
8306 ;;; org-man.el - Support for links to manpages in Org
8310 (org-add-link-type "man" 'org-man-open)
8311 (add-hook 'org-store-link-functions 'org-man-store-link)
8313 (defcustom org-man-command 'man
8314 "The Emacs command to be used to display a man page."
8316 :type '(choice (const man) (const woman)))
8318 (defun org-man-open (path)
8319 "Visit the manpage on PATH.
8320 PATH should be a topic that can be thrown at the man command."
8321 (funcall org-man-command path))
8323 (defun org-man-store-link ()
8324 "Store a link to a manpage."
8325 (when (memq major-mode '(Man-mode woman-mode))
8326 ;; This is a man page, we do make this link
8327 (let* ((page (org-man-get-page-name))
8328 (link (concat "man:" page))
8329 (description (format "Manpage for %s" page)))
8330 (org-store-link-props
8333 :description description))))
8335 (defun org-man-get-page-name ()
8336 "Extract the page name from the buffer name."
8337 ;; This works for both `Man-mode' and `woman-mode'.
8338 (if (string-match " \\(\\S-+\\)\\*" (buffer-name))
8339 (match-string 1 (buffer-name))
8340 (error "Cannot create link to this man page")))
8344 ;;; org-man.el ends here
8348 You would activate this new link type in @file{.emacs} with
8355 Lets go through the file and see what it does.
8358 It does @code{(require 'org)} to make sure that @file{org.el} has been
8361 The next line calls @code{org-add-link-type} to define a new link type
8362 with prefix @samp{man}. The call also contains the name of a function
8363 that will be called to follow such a link.
8365 The next line adds a function to @code{org-store-link-functions}, in
8366 order to allow the command @kbd{C-c l} to record a useful link in a
8367 buffer displaying a man page.
8370 The rest of the file defines the necessary variables and functions.
8371 First there is a customization variable that determines which emacs
8372 command should be used to display man pages. There are two options,
8373 @code{man} and @code{woman}. Then the function to follow a link is
8374 defined. It gets the link path as an argument - in this case the link
8375 path is just a topic for the manual command. The function calls the
8376 value of @code{org-man-command} to display the man page.
8378 Finally the function @code{org-man-store-link} is defined. When you try
8379 to store a link with @kbd{C-c l}, also this function will be called to
8380 try to make a link. The function must first decide if it is supposed to
8381 create the link for this buffer type, we do this by checking the value
8382 of the variable @code{major-mode}. If not, the function must exit and
8383 return the value @code{nil}. If yes, the link is created by getting the
8384 manual topic from the buffer name and prefixing it with the string
8385 @samp{man:}. Then it must call the command @code{org-store-link-props}
8386 and set the @code{:type} and @code{:link} properties. Optionally you
8387 can also set the @code{:description} property to provide a default for
8388 the link description when the link is later inserted into an Org
8389 buffer with @kbd{C-c C-l}.
8391 @node Tables in arbitrary syntax, Dynamic blocks, Adding hyperlink types, Extensions and Hacking
8392 @section Tables and lists in arbitrary syntax
8393 @cindex tables, in other modes
8394 @cindex lists, in other modes
8397 Since Orgtbl mode can be used as a minor mode in arbitrary buffers, a
8398 frequent feature request has been to make it work with native tables in
8399 specific languages, for example La@TeX{}. However, this is extremely
8400 hard to do in a general way, would lead to a customization nightmare,
8401 and would take away much of the simplicity of the Orgtbl mode table
8405 This appendix describes a different approach. We keep the Orgtbl mode
8406 table in its native format (the @i{source table}), and use a custom
8407 function to @i{translate} the table to the correct syntax, and to
8408 @i{install} it in the right location (the @i{target table}). This puts
8409 the burden of writing conversion functions on the user, but it allows
8410 for a very flexible system.
8412 Bastien added the ability to do the same with lists. You can use Org's
8413 facilities to edit and structure lists by turning @code{orgstruct-mode}
8414 on, then locally exporting such lists in another format (HTML, La@TeX{}
8419 * Radio tables:: Sending and receiving
8420 * A LaTeX example:: Step by step, almost a tutorial
8421 * Translator functions:: Copy and modify
8422 * Radio lists:: Doing the same for lists
8425 @node Radio tables, A LaTeX example, Tables in arbitrary syntax, Tables in arbitrary syntax
8426 @subsection Radio tables
8427 @cindex radio tables
8429 To define the location of the target table, you first need to create two
8430 lines that are comments in the current mode, but contain magic words for
8431 Orgtbl mode to find. Orgtbl mode will insert the translated table
8432 between these lines, replacing whatever was there before. For example:
8435 /* BEGIN RECEIVE ORGTBL table_name */
8436 /* END RECEIVE ORGTBL table_name */
8440 Just above the source table, we put a special line that tells
8441 Orgtbl mode how to translate this table and where to install it. For
8444 #+ORGTBL: SEND table_name translation_function arguments....
8448 @code{table_name} is the reference name for the table that is also used
8449 in the receiver lines. @code{translation_function} is the Lisp function
8450 that does the translation. Furthermore, the line can contain a list of
8451 arguments (alternating key and value) at the end. The arguments will be
8452 passed as a property list to the translation function for
8453 interpretation. A few standard parameters are already recognized and
8454 acted upon before the translation function is called:
8458 Skip the first N lines of the table. Hlines do count!
8459 @item :skipcols (n1 n2 ...)
8460 List of columns that should be skipped. If the table has a column with
8461 calculation marks, that column is automatically discarded as well.
8462 Please note that the translator function sees the table @emph{after} the
8463 removal of these columns, the function never knows that there have been
8468 The one problem remaining is how to keep the source table in the buffer
8469 without disturbing the normal workings of the file, for example during
8470 compilation of a C file or processing of a La@TeX{} file. There are a
8471 number of different solutions:
8475 The table could be placed in a block comment if that is supported by the
8476 language. For example, in C mode you could wrap the table between
8477 @samp{/*} and @samp{*/} lines.
8479 Sometimes it is possible to put the table after some kind of @i{END}
8480 statement, for example @samp{\bye} in TeX and @samp{\end@{document@}}
8483 You can just comment the table line by line whenever you want to process
8484 the file, and uncomment it whenever you need to edit the table. This
8485 only sounds tedious - the command @kbd{M-x orgtbl-toggle-comment} does
8486 make this comment-toggling very easy, in particular if you bind it to a
8490 @node A LaTeX example, Translator functions, Radio tables, Tables in arbitrary syntax
8491 @subsection A LaTeX example of radio tables
8492 @cindex LaTeX, and Orgtbl mode
8494 The best way to wrap the source table in La@TeX{} is to use the
8495 @code{comment} environment provided by @file{comment.sty}. It has to be
8496 activated by placing @code{\usepackage@{comment@}} into the document
8497 header. Orgtbl mode can insert a radio table skeleton@footnote{By
8498 default this works only for La@TeX{}, HTML, and Texinfo. Configure the
8499 variable @code{orgtbl-radio-tables} to install templates for other
8500 modes.} with the command @kbd{M-x orgtbl-insert-radio-table}. You will
8501 be prompted for a table name, lets say we use @samp{salesfigures}. You
8502 will then get the following template:
8505 % BEGIN RECEIVE ORGTBL salesfigures
8506 % END RECEIVE ORGTBL salesfigures
8508 #+ORGTBL: SEND salesfigures orgtbl-to-latex
8514 The @code{#+ORGTBL: SEND} line tells Orgtbl mode to use the function
8515 @code{orgtbl-to-latex} to convert the table into La@TeX{} and to put it
8516 into the receiver location with name @code{salesfigures}. You may now
8517 fill in the table, feel free to use the spreadsheet features@footnote{If
8518 the @samp{#+TBLFM} line contains an odd number of dollar characters,
8519 this may cause problems with font-lock in LaTeX mode. As shown in the
8520 example you can fix this by adding an extra line inside the
8521 @code{comment} environment that is used to balance the dollar
8522 expressions. If you are using AUCTeX with the font-latex library, a
8523 much better solution is to add the @code{comment} environment to the
8524 variable @code{LaTeX-verbatim-environments}.}:
8527 % BEGIN RECEIVE ORGTBL salesfigures
8528 % END RECEIVE ORGTBL salesfigures
8530 #+ORGTBL: SEND salesfigures orgtbl-to-latex
8531 | Month | Days | Nr sold | per day |
8532 |-------+------+---------+---------|
8533 | Jan | 23 | 55 | 2.4 |
8534 | Feb | 21 | 16 | 0.8 |
8535 | March | 22 | 278 | 12.6 |
8536 #+TBLFM: $4=$3/$2;%.1f
8537 % $ (optional extra dollar to keep font-lock happy, see footnote)
8542 When you are done, press @kbd{C-c C-c} in the table to get the converted
8543 table inserted between the two marker lines.
8545 Now lets assume you want to make the table header by hand, because you
8546 want to control how columns are aligned etc. In this case we make sure
8547 that the table translator does skip the first 2 lines of the source
8548 table, and tell the command to work as a @i{splice}, i.e. to not produce
8549 header and footer commands of the target table:
8552 \begin@{tabular@}@{lrrr@}
8553 Month & \multicolumn@{1@}@{c@}@{Days@} & Nr.\ sold & per day\\
8554 % BEGIN RECEIVE ORGTBL salesfigures
8555 % END RECEIVE ORGTBL salesfigures
8559 #+ORGTBL: SEND salesfigures orgtbl-to-latex :splice t :skip 2
8560 | Month | Days | Nr sold | per day |
8561 |-------+------+---------+---------|
8562 | Jan | 23 | 55 | 2.4 |
8563 | Feb | 21 | 16 | 0.8 |
8564 | March | 22 | 278 | 12.6 |
8565 #+TBLFM: $4=$3/$2;%.1f
8569 The La@TeX{} translator function @code{orgtbl-to-latex} is already part of
8570 Orgtbl mode. It uses a @code{tabular} environment to typeset the table
8571 and marks horizontal lines with @code{\hline}. Furthermore, it
8572 interprets the following parameters:
8576 When set to t, return only table body lines, don't wrap them into a
8577 tabular environment. Default is nil.
8580 A format to be used to wrap each field, should contain @code{%s} for the
8581 original field value. For example, to wrap each field value in dollars,
8582 you could use @code{:fmt "$%s$"}. This may also be a property list with
8583 column numbers and formats. for example @code{:fmt (2 "$%s$" 4 "%s\\%%")}.
8584 A function of one argument can be used in place of the strings; the
8585 function must return a formatted string.
8588 Use this format to print numbers with exponentials. The format should
8589 have @code{%s} twice for inserting mantissa and exponent, for example
8590 @code{"%s\\times10^@{%s@}"}. The default is @code{"%s\\,(%s)"}. This
8591 may also be a property list with column numbers and formats, for example
8592 @code{:efmt (2 "$%s\\times10^@{%s@}$" 4 "$%s\\cdot10^@{%s@}$")}. After
8593 @code{efmt} has been applied to a value, @code{fmt} will also be
8594 applied. Similar to @code{fmt}, functions of two arguments can be
8595 supplied instead of strings.
8598 @node Translator functions, Radio lists, A LaTeX example, Tables in arbitrary syntax
8599 @subsection Translator functions
8600 @cindex HTML, and Orgtbl mode
8601 @cindex translator function
8603 Orgtbl mode has several translator functions built-in:
8604 @code{orgtbl-to-latex}, @code{orgtbl-to-html}, and
8605 @code{orgtbl-to-texinfo}. Except for @code{orgtbl-to-html}@footnote{The
8606 HTML translator uses the same code that produces tables during HTML
8607 export.}, these all use a generic translator, @code{orgtbl-to-generic}.
8608 For example, @code{orgtbl-to-latex} itself is a very short function that
8609 computes the column definitions for the @code{tabular} environment,
8610 defines a few field and line separators and then hands over to the
8611 generic translator. Here is the entire code:
8615 (defun orgtbl-to-latex (table params)
8616 "Convert the Orgtbl mode TABLE to LaTeX."
8617 (let* ((alignment (mapconcat (lambda (x) (if x "r" "l"))
8618 org-table-last-alignment ""))
8621 :tstart (concat "\\begin@{tabular@}@{" alignment "@}")
8622 :tend "\\end@{tabular@}"
8623 :lstart "" :lend " \\\\" :sep " & "
8624 :efmt "%s\\,(%s)" :hline "\\hline")))
8625 (orgtbl-to-generic table (org-combine-plists params2 params))))
8629 As you can see, the properties passed into the function (variable
8630 @var{PARAMS}) are combined with the ones newly defined in the function
8631 (variable @var{PARAMS2}). The ones passed into the function (i.e. the
8632 ones set by the @samp{ORGTBL SEND} line) take precedence. So if you
8633 would like to use the La@TeX{} translator, but wanted the line endings to
8634 be @samp{\\[2mm]} instead of the default @samp{\\}, you could just
8635 overrule the default with
8638 #+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]"
8641 For a new language, you can either write your own converter function in
8642 analogy with the La@TeX{} translator, or you can use the generic function
8643 directly. For example, if you have a language where a table is started
8644 with @samp{!BTBL!}, ended with @samp{!ETBL!}, and where table lines are
8645 started with @samp{!BL!}, ended with @samp{!EL!} and where the field
8646 separator is a TAB, you could call the generic translator like this (on
8650 #+ORGTBL: SEND test orgtbl-to-generic :tstart "!BTBL!" :tend "!ETBL!"
8651 :lstart "!BL! " :lend " !EL!" :sep "\t"
8655 Please check the documentation string of the function
8656 @code{orgtbl-to-generic} for a full list of parameters understood by
8657 that function and remember that you can pass each of them into
8658 @code{orgtbl-to-latex}, @code{orgtbl-to-texinfo}, and any other function
8659 using the generic function.
8661 Of course you can also write a completely new function doing complicated
8662 things the generic translator cannot do. A translator function takes
8663 two arguments. The first argument is the table, a list of lines, each
8664 line either the symbol @code{hline} or a list of fields. The second
8665 argument is the property list containing all parameters specified in the
8666 @samp{#+ORGTBL: SEND} line. The function must return a single string
8667 containing the formatted table. If you write a generally useful
8668 translator, please post it on @code{emacs-orgmode@@gnu.org} so that
8669 others can benefit from your work.
8671 @node Radio lists, , Translator functions, Tables in arbitrary syntax
8672 @subsection Radio lists
8674 @cindex org-list-insert-radio-list
8676 Sending and receiving radio lists works exactly the same way than
8677 sending and receiving radio tables (@pxref{Radio tables}) @footnote{You
8678 need to load the @code{org-export-latex.el} package to use radio lists
8679 since the relevant code is there for now.}. As for radio tables, you
8680 can insert radio lists templates in HTML, La@TeX{} and Texinfo modes by
8681 calling @code{org-list-insert-radio-list}.
8683 Here are the differences with radio tables:
8687 Use @code{ORGLST} instead of @code{ORGTBL}.
8689 The available translation functions for radio lists don't take
8692 `C-c C-c' will work when pressed on the first item of the list.
8695 Here is a La@TeX{} example. Let's say that you have this in your
8699 % BEGIN RECEIVE ORGLST to-buy
8700 % END RECEIVE ORGLST to-buy
8702 #+ORGLIST: SEND to-buy orgtbl-to-latex
8711 Pressing `C-c C-c' on @code{a new house} and will insert the converted
8712 La@TeX{} list between the two marker lines.
8714 @node Dynamic blocks, Special agenda views, Tables in arbitrary syntax, Extensions and Hacking
8715 @section Dynamic blocks
8716 @cindex dynamic blocks
8718 Org documents can contain @emph{dynamic blocks}. These are
8719 specially marked regions that are updated by some user-written function.
8720 A good example for such a block is the clock table inserted by the
8721 command @kbd{C-c C-x C-r} (@pxref{Clocking work time}).
8723 Dynamic block are enclosed by a BEGIN-END structure that assigns a name
8724 to the block and can also specify parameters for the function producing
8725 the content of the block.
8728 #+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
8733 Dynamic blocks are updated with the following commands
8738 Update dynamic block at point.
8739 @kindex C-u C-c C-x C-u
8740 @item C-u C-c C-x C-u
8741 Update all dynamic blocks in the current file.
8744 Updating a dynamic block means to remove all the text between BEGIN and
8745 END, parse the BEGIN line for parameters and then call the specific
8746 writer function for this block to insert the new content. If you want
8747 to use the original content in the writer function, you can use the
8748 extra parameter @code{:content}.
8750 For a block with name @code{myblock}, the writer function is
8751 @code{org-dblock-write:myblock} with as only parameter a property list
8752 with the parameters given in the begin line. Here is a trivial example
8753 of a block that keeps track of when the block update function was last
8757 #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
8763 The corresponding block writer function could look like this:
8766 (defun org-dblock-write:block-update-time (params)
8767 (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
8768 (insert "Last block update at: "
8769 (format-time-string fmt (current-time)))))
8772 If you want to make sure that all dynamic blocks are always up-to-date,
8773 you could add the function @code{org-update-all-dblocks} to a hook, for
8774 example @code{before-save-hook}. @code{org-update-all-dblocks} is
8775 written in a way that is does nothing in buffers that are not in
8778 @node Special agenda views, Using the property API, Dynamic blocks, Extensions and Hacking
8779 @section Special agenda views
8780 @cindex agenda views, user-defined
8782 Org provides a special hook that can be used to narrow down the
8783 selection made by any of the agenda views. You may specify a function
8784 that is used at each match to verify if the match should indeed be part
8785 of the agenda view, and if not, how much should be skipped.
8787 Let's say you want to produce a list of projects that contain a WAITING
8788 tag anywhere in the project tree. Let's further assume that you have
8789 marked all tree headings that define a project with the TODO keyword
8790 PROJECT. In this case you would run a TODO search for the keyword
8791 PROJECT, but skip the match unless there is a WAITING tag anywhere in
8792 the subtree belonging to the project line.
8794 To achieve this, you must write a function that searches the subtree for
8795 the tag. If the tag is found, the function must return @code{nil} to
8796 indicate that this match should not be skipped. If there is no such
8797 tag, return the location of the end of the subtree, to indicate that
8798 search should continue from there.
8801 (defun my-skip-unless-waiting ()
8802 "Skip trees that are not waiting"
8803 (let ((subtree-end (save-excursion (org-end-of-subtree t))))
8804 (if (re-search-forward ":waiting:" subtree-end t)
8805 nil ; tag found, do not skip
8806 subtree-end))) ; tag not found, continue after end of subtree
8809 Now you may use this function in an agenda custom command, for example
8813 (org-add-agenda-custom-command
8814 '("b" todo "PROJECT"
8815 ((org-agenda-skip-function 'my-org-waiting-projects)
8816 (org-agenda-overriding-header "Projects waiting for something: "))))
8819 Note that this also binds @code{org-agenda-overriding-header} to get a
8820 meaningful header in the agenda view.
8822 A general way to create custom searches is to base them on a search for
8823 entries with a certain level limit. If you want to study all entries with
8824 your custom search function, simply do a search for @samp{LEVEL>0}, and then
8825 use @code{org-agenda-skip-function} to select the entries you really want to
8828 You may also put a Lisp form into @code{org-agenda-skip-function}. In
8829 particular, you may use the functions @code{org-agenda-skip-entry-if}
8830 and @code{org-agenda-skip-subtree-if} in this form, for example:
8833 @item '(org-agenda-skip-entry-if 'scheduled)
8834 Skip current entry if it has been scheduled.
8835 @item '(org-agenda-skip-entry-if 'notscheduled)
8836 Skip current entry if it has not been scheduled.
8837 @item '(org-agenda-skip-entry-if 'deadline)
8838 Skip current entry if it has a deadline.
8839 @item '(org-agenda-skip-entry-if 'scheduled 'deadline)
8840 Skip current entry if it has a deadline, or if it is scheduled.
8841 @item '(org-agenda-skip-entry 'regexp "regular expression")
8842 Skip current entry if the regular expression matches in the entry.
8843 @item '(org-agenda-skip-entry 'notregexp "regular expression")
8844 Skip current entry unless the regular expression matches.
8845 @item '(org-agenda-skip-subtree-if 'regexp "regular expression")
8846 Same as above, but check and skip the entire subtree.
8849 Therefore we could also have written the search for WAITING projects
8850 like this, even without defining a special function:
8853 (org-add-agenda-custom-command
8854 '("b" todo "PROJECT"
8855 ((org-agenda-skip-function '(org-agenda-skip-subtree-if
8856 'regexp ":waiting:"))
8857 (org-agenda-overriding-header "Projects waiting for something: "))))
8860 @node Using the property API, , Special agenda views, Extensions and Hacking
8861 @section Using the property API
8862 @cindex API, for properties
8863 @cindex properties, API
8865 Here is a description of the functions that can be used to work with
8868 @defun org-entry-properties &optional pom which
8869 Get all properties of the entry at point-or-marker POM.
8870 This includes the TODO keyword, the tags, time strings for deadline,
8871 scheduled, and clocking, and any additional properties defined in the
8872 entry. The return value is an alist, keys may occur multiple times
8873 if the property key was used several times.
8874 POM may also be nil, in which case the current entry is used.
8875 If WHICH is nil or `all', get all properties. If WHICH is
8876 `special' or `standard', only get that subclass.
8878 @defun org-entry-get pom property &optional inherit
8879 Get value of PROPERTY for entry at point-or-marker POM. By default,
8880 this only looks at properties defined locally in the entry. If INHERIT
8881 is non-nil and the entry does not have the property, then also check
8882 higher levels of the hierarchy. If INHERIT is the symbol
8883 @code{selective}, use inheritance if and only if the setting of
8884 @code{org-use-property-inheritance} selects PROPERTY for inheritance.
8887 @defun org-entry-delete pom property
8888 Delete the property PROPERTY from entry at point-or-marker POM.
8891 @defun org-entry-put pom property value
8892 Set PROPERTY to VALUE for entry at point-or-marker POM.
8895 @defun org-buffer-property-keys &optional include-specials
8896 Get all property keys in the current buffer.
8899 @defun org-insert-property-drawer
8900 Insert a property drawer at point.
8903 @defun org-entry-add-to-multivalued-property pom property value
8904 Treat the value of the property PROPERTY as a whitespace-separated list of
8905 values and make sure that VALUE is in this list.
8908 @defun org-entry-remove-from-multivalued-property pom property value
8909 Treat the value of the property PROPERTY as a whitespace-separated list of
8910 values and make sure that VALUE is @emph{not} in this list.
8913 @defun org-entry-member-in-multivalued-property pom property value
8914 Treat the value of the property PROPERTY as a whitespace-separated list of
8915 values and check if VALUE is in this list.
8918 @node History and Acknowledgments, Main Index, Extensions and Hacking, Top
8919 @appendix History and Acknowledgments
8920 @cindex acknowledgments
8924 Org was borne in 2003, out of frustration over the user interface
8925 of the Emacs Outline mode. I was trying to organize my notes and
8926 projects, and using Emacs seemed to be the natural way to go. However,
8927 having to remember eleven different commands with two or three keys per
8928 command, only to hide and show parts of the outline tree, that seemed
8929 entirely unacceptable to me. Also, when using outlines to take notes, I
8930 constantly want to restructure the tree, organizing it parallel to my
8931 thoughts and plans. @emph{Visibility cycling} and @emph{structure
8932 editing} were originally implemented in the package
8933 @file{outline-magic.el}, but quickly moved to the more general
8934 @file{org.el}. As this environment became comfortable for project
8935 planning, the next step was adding @emph{TODO entries}, basic @emph{time
8936 stamps}, and @emph{table support}. These areas highlight the two main
8937 goals that Org still has today: To create a new, outline-based,
8938 plain text mode with innovative and intuitive editing features, and to
8939 incorporate project planning functionality directly into a notes file.
8941 A special thanks goes to @i{Bastien Guerry} who has not only writen a large
8942 number of extensions to Org (most of them integrated into the core by now),
8943 but has also helped the development and maintenance of Org so much that he
8944 should be considered co-author of this package.
8946 Since the first release, literally thousands of emails to me or on
8947 @code{emacs-orgmode@@gnu.org} have provided a constant stream of bug
8948 reports, feedback, new ideas, and sometimes patches and add-on code.
8949 Many thanks to everyone who has helped to improve this package. I am
8950 trying to keep here a list of the people who had significant influence
8951 in shaping one or more aspects of Org. The list may not be
8952 complete, if I have forgotten someone, please accept my apologies and
8958 @i{Russel Adams} came up with the idea for drawers.
8960 @i{Thomas Baumann} wrote @file{org-bbdb.el} and @file{org-mhe.el}.
8962 @i{Alex Bochannek} provided a patch for rounding time stamps.
8964 @i{Charles Cave}'s suggestion sparked the implementation of templates
8967 @i{Pavel Chalmoviansky} influenced the agenda treatment of items with
8970 @i{Gregory Chernov} patched support for lisp forms into table
8971 calculations and improved XEmacs compatibility, in particular by porting
8972 @file{nouline.el} to XEmacs.
8974 @i{Sacha Chua} suggested to copy some linking code from Planner.
8976 @i{Eddward DeVilla} proposed and tested checkbox statistics. He also
8977 came up with the idea of properties, and that there should be an API for
8980 @i{Kees Dullemond} used to edit projects lists directly in HTML and so
8981 inspired some of the early development, including HTML export. He also
8982 asked for a way to narrow wide table columns.
8984 @i{Christian Egli} converted the documentation into Texinfo format,
8985 patched CSS formatting into the HTML exporter, and inspired the agenda.
8987 @i{David Emery} provided a patch for custom CSS support in exported
8990 @i{Nic Ferrier} contributed mailcap and XOXO support.
8992 @i{Miguel A. Figueroa-Villanueva} implemented hierarchical checkboxes.
8994 @i{John Foerch} figured out how to make incremental search show context
8995 around a match in a hidden outline tree.
8997 @i{Niels Giesen} had the idea to automatically archive DONE trees.
8999 @i{Bastien Guerry} wrote the La@TeX{} exporter and @file{org-bibtex.el}, and
9000 has been prolific with patches, ideas, and bug reports.
9002 @i{Kai Grossjohann} pointed out key-binding conflicts with other packages.
9004 @i{Bernt Hansen} has driven much of the support for auto-repeating tasks,
9005 task state change logging, and the clocktable. His clear explanations have
9006 been critical when we started to adopt the GIT version control system.
9008 @i{Phil Jackson} wrote @file{org-irc.el}.
9010 @i{Scott Jaderholm} proposed footnotes, control over whitespace between
9011 folded entries, and column view for properties.
9013 @i{Tokuya Kameshima} wrote @file{org-wl.el} and @file{org-mew.el}.
9015 @i{Shidai Liu} ("Leo") asked for embedded La@TeX{} and tested it. He also
9016 provided frequent feedback and some patches.
9018 @i{Jason F. McBrayer} suggested agenda export to CSV format.
9020 @i{Max Mikhanosha} came up with the idea of refiling.
9022 @i{Dmitri Minaev} sent a patch to set priority limits on a per-file
9025 @i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler
9028 @i{Rick Moynihan} proposed to allow multiple TODO sequences in a file
9029 and to be able to quickly restrict the agenda to a subtree.
9031 @i{Todd Neal} provided patches for links to Info files and elisp forms.
9033 @i{Tim O'Callaghan} suggested in-file links, search options for general
9034 file links, and TAGS.
9036 @i{Takeshi Okano} translated the manual and David O'Toole's tutorial
9039 @i{Oliver Oppitz} suggested multi-state TODO items.
9041 @i{Scott Otterson} sparked the introduction of descriptive text for
9042 links, among other things.
9044 @i{Pete Phillips} helped during the development of the TAGS feature, and
9045 provided frequent feedback.
9047 @i{T.V. Raman} reported bugs and suggested improvements.
9049 @i{Matthias Rempe} (Oelde) provided ideas, Windows support, and quality
9052 @i{Kevin Rogers} contributed code to access VM files on remote hosts.
9054 @i{Sebastian Rose} wrote @file{org-info.js}, a Java script for displaying
9055 webpages derived from Org using an Info-like, or a folding interface with
9056 single key navigation.
9058 @i{Frank Ruell} solved the mystery of the @code{keymapp nil} bug, a
9059 conflict with @file{allout.el}.
9061 @i{Jason Riedy} generalized the send-receive mechanism for orgtbl tables with
9064 @i{Philip Rooke} created the Org reference card, provided lots
9065 of feedback, developed and applied standards to the Org documentation and
9066 wrote the manual for the contributed packages.
9068 @i{Christian Schlauer} proposed angular brackets around links, among
9071 Linking to VM/BBDB/Gnus was first inspired by @i{Tom Shannon}'s
9072 @file{organizer-mode.el}.
9074 @i{Ilya Shlyakhter} proposed the Archive Sibling.
9076 @i{Daniel Sinder} came up with the idea of internal archiving by locking
9079 @i{Dale Smith} proposed link abbreviations.
9081 @i{Adam Spiers} asked for global linking commands and inspired the link
9082 extension system. support mairix.
9084 @i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
9085 chapter about publishing.
9087 @i{J@"urgen Vollmer} contributed code generating the table of contents
9090 @i{Chris Wallace} provided a patch implementing the @samp{QUOTE}
9093 @i{David Wainberg} suggested archiving, and improvements to the linking
9096 @i{John Wiegley} wrote @file{emacs-wiki.el}, @file{planner.el}, and
9097 @file{muse.el}, which have similar goals as Org. Initially the development
9098 of Org was fully independent because I was not aware of the existence of
9099 these packages. But with time I have accasionally looked at John's code and
9100 learned a lot from it. John has also contributed a number of great ideas and
9101 patches directly to Org, including the file @code{org-mac-message.el}'
9103 @i{Carsten Wimmer} suggested some changes and helped fix a bug in
9106 @i{Roland Winkler} requested additional key bindings to make Org
9109 @i{Piotr Zielinski} wrote @file{org-mouse.el}, proposed agenda blocks
9110 and contributed various ideas and code snippets.
9114 @node Main Index, Key Index, History and Acknowledgments, Top
9115 @unnumbered The Main Index
9119 @node Key Index, , Main Index, Top
9120 @unnumbered Key Index
9127 arch-tag: 7893d1Fe-cc57-4d13-b5e5-f494a1CBC7ac
9131 @c ispell-local-dictionary: "en_US-w_accents"
9132 @c ispell-local-pdict: "./.aspell.org.pws"