aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Dominik2007-02-25 06:40:58 +0000
committerCarsten Dominik2007-02-25 06:40:58 +0000
commit06341a67988e740b4f0b69aae68a27f7a4697c29 (patch)
treeba2e9d5be97b72af3d43d590e76c0719d27c3813
parentd3f4dbe852fe27c5cab55ef90ae8bbbb834d98e7 (diff)
downloademacs-06341a67988e740b4f0b69aae68a27f7a4697c29.tar.gz
emacs-06341a67988e740b4f0b69aae68a27f7a4697c29.zip
(The spreadsheet): Renamed from "Table calculations".
Completely reorganized and rewritten. (CamelCase links): Section removed. (Repeating items): New section. (Tracking TODO state changes): New section. (Agenda views): Chapter reorganized and rewritten. (HTML export): Section rewritten. (Tables in arbitrary syntax): New section. (Summary): Better feature summary. (Activation): Document problem with cut-and-paste of Lisp code from PDF files. (Visibility cycling): Document indirect buffer use. (Structure editing): Document sorting. (Remember): Section rewritten. (Time stamps): Better description of time stamp types. (Tag searches): DOcument regular expression search for tags. (Stuck projects): New section. (In-buffer settings): New keywods. (History and Acknowledgments): Updated description.
-rw-r--r--man/org.texi1919
1 files changed, 1411 insertions, 508 deletions
diff --git a/man/org.texi b/man/org.texi
index f47e559a372..4b484f25409 100644
--- a/man/org.texi
+++ b/man/org.texi
@@ -3,12 +3,12 @@
3@setfilename ../info/org 3@setfilename ../info/org
4@settitle Org Mode Manual 4@settitle Org Mode Manual
5 5
6@set VERSION 4.56 6@set VERSION 4.67
7@set DATE November 2006 7@set DATE February 2007
8 8
9@dircategory Emacs 9@dircategory Emacs
10@direntry 10@direntry
11* Org Mode: (org). outline-based notes management and organizer 11* Org Mode: (org). Outline-based notes management and organizer
12@end direntry 12@end direntry
13 13
14@c Version and Contact Info 14@c Version and Contact Info
@@ -35,7 +35,7 @@
35@copying 35@copying
36This manual is for Org-mode (version @value{VERSION}). 36This manual is for Org-mode (version @value{VERSION}).
37 37
38Copyright @copyright{} 2004, 2005, 2006, 2007 Free Software Foundation, Inc. 38Copyright @copyright{} 2004, 2005, 2006, 2007 Free Software Foundation
39 39
40@quotation 40@quotation
41Permission is granted to copy, distribute and/or modify this document 41Permission is granted to copy, distribute and/or modify this document
@@ -122,19 +122,19 @@ Tables
122 122
123* Built-in table editor:: Simple tables 123* Built-in table editor:: Simple tables
124* Narrow columns:: Stop wasting space in tables 124* Narrow columns:: Stop wasting space in tables
125* Table calculations:: Compute a field from other fields
126* orgtbl-mode:: The table editor as minor mode 125* orgtbl-mode:: The table editor as minor mode
127* table.el:: Complex tables 126* The spreadsheet:: The table editor has spreadsheet capabilities.
128 127
129Calculations in tables 128The spreadsheet
130 129
131* Formula syntax:: How to write a formula 130* References:: How to refer to another field or range
132* Lisp formulas:: An alternative way to write formulas 131* Formula syntax for Calc:: Using Calc to compute stuff
133* Column formulas:: Formulas valid for all fields in a column 132* Formula syntax for Lisp:: Writing formulas in Emacs Lisp
133* Field formulas:: Formulas valid for a single field
134* Column formulas:: Formulas valid for an entire column
135* Editing and debugging formulas:: Fixing formulas
136* Updating the table:: Recomputing all dependent fields
134* Advanced features:: Field names, parameters and automatic recalc 137* Advanced features:: Field names, parameters and automatic recalc
135* Named-field formulas:: Formulas valid in single fields
136* Editing/debugging formulas:: Changing a stored formula
137* Appetizer:: Taste the power of calc
138 138
139Hyperlinks 139Hyperlinks
140 140
@@ -150,7 +150,12 @@ Hyperlinks
150Internal links 150Internal links
151 151
152* Radio targets:: Make targets trigger links in plain text. 152* Radio targets:: Make targets trigger links in plain text.
153* CamelCase links:: Activating CamelCase words as links 153
154Remember
155
156* Setting up remember:: Some code for .emacs to get things going
157* Remember templates:: Define the outline of different note types
158* Storing notes:: Directly get the note to where it belongs
154 159
155TODO items 160TODO items
156 161
@@ -171,6 +176,7 @@ Timestamps
171* Time stamps:: Assigning a time to a tree entry 176* Time stamps:: Assigning a time to a tree entry
172* Creating timestamps:: Commands which insert timestamps 177* Creating timestamps:: Commands which insert timestamps
173* Custom time format:: If you cannot work with the ISO format 178* Custom time format:: If you cannot work with the ISO format
179* Repeating items:: Deadlines that come back again and again
174* Progress logging:: Documenting when what work was done. 180* Progress logging:: Documenting when what work was done.
175 181
176Creating timestamps 182Creating timestamps
@@ -180,6 +186,7 @@ Creating timestamps
180Progress Logging 186Progress Logging
181 187
182* Closing items:: When was this entry marked DONE? 188* Closing items:: When was this entry marked DONE?
189* Tracking TODO state changes:: When did the status change?
183* Clocking work time:: When exactly did you work on this item? 190* Clocking work time:: When exactly did you work on this item?
184 191
185Tags 192Tags
@@ -192,17 +199,18 @@ Agenda Views
192 199
193* Agenda files:: Files being searched for agenda information 200* Agenda files:: Files being searched for agenda information
194* Agenda dispatcher:: Keyboard access to agenda views 201* Agenda dispatcher:: Keyboard access to agenda views
195* Weekly/Daily agenda:: The calendar page with current tasks 202* Built-in agenda views:: What is available out of the box?
196* Global TODO list:: All unfinished action items
197* Matching headline tags:: Structured information with fine-tuned search
198* Timeline:: Time-sorted view for single file
199* Presentation and sorting:: How agenda items are prepared for display 203* Presentation and sorting:: How agenda items are prepared for display
200* Agenda commands:: Remote editing of org trees 204* Agenda commands:: Remote editing of org trees
201* Custom agenda views:: Defining special searches and views 205* Custom agenda views:: Defining special searches and views
202 206
203The weekly/daily agenda 207The built-in agenda views
204 208
205* Calendar/Diary integration:: Integrating Anniversaries and more 209* Weekly/Daily agenda:: The calendar page with current tasks
210* Global TODO list:: All unfinished action items
211* Matching headline tags:: Structured information with fine-tuned search
212* Timeline:: Time-sorted view for single file
213* Stuck projects:: Find projects you need to review
206 214
207Presentation and sorting 215Presentation and sorting
208 216
@@ -233,6 +241,14 @@ Exporting
233* iCalendar export:: Exporting in iCalendar format 241* iCalendar export:: Exporting in iCalendar format
234* Text interpretation:: How the exporter looks at the file 242* Text interpretation:: How the exporter looks at the file
235 243
244HTML export
245
246* Export commands:: How to invode HTML export
247* Quoting HTML tags:: Using direct HTML in Org-mode
248* Links:: How hyperlinks get transferred to HTML
249* Images:: To inline or not to inline?
250* CSS support:: Style specifications
251
236Text interpretation by the exporter 252Text interpretation by the exporter
237 253
238* Comment lines:: Some lines will not be exported 254* Comment lines:: Some lines will not be exported
@@ -279,7 +295,15 @@ Interaction with other packages
279Extensions, Hooks and Hacking 295Extensions, Hooks and Hacking
280 296
281* Extensions:: Existing 3rd-part extensions 297* Extensions:: Existing 3rd-part extensions
298* Tables in arbitrary syntax:: Orgtbl for LaTeX and other programs
282* Dynamic blocks:: Automatically filled blocks 299* Dynamic blocks:: Automatically filled blocks
300* Special agenda views:: Customized views
301
302Tables in arbitrary syntax
303
304* Radio tables:: Sending and receiving
305* A LaTeX example:: Step by step, almost a tutorial
306* Translator functions:: Copy and modify
283 307
284@end detailmenu 308@end detailmenu
285@end menu 309@end menu
@@ -318,7 +342,7 @@ iCalendar file. It can also serve as a publishing tool for a set of
318linked webpages. 342linked webpages.
319 343
320An important design aspect that distinguishes Org-mode from for example 344An important design aspect that distinguishes Org-mode from for example
321Planner/Muse is that it encougages to store every piece of information 345Planner/Muse is that it encourages to store every piece of information
322only once. In Planner, you have project pages, day pages and possibly 346only once. In Planner, you have project pages, day pages and possibly
323other files, duplicating some information such as tasks. In Org-mode, 347other files, duplicating some information such as tasks. In Org-mode,
324you only have notes files. In your notes you mark entries as tasks, 348you only have notes files. In your notes you mark entries as tasks,
@@ -330,21 +354,23 @@ Org-mode keeps simple things simple. When first fired up, it should
330feel like a straightforward, easy to use outliner. Complexity is not 354feel like a straightforward, easy to use outliner. Complexity is not
331imposed, but a large amount of functionality is available when you need 355imposed, but a large amount of functionality is available when you need
332it. Org-mode can be used on different levels and in different ways, for 356it. Org-mode can be used on different levels and in different ways, for
333example: 357example as:
334 358
335@example 359@example
336@r{@bullet{} as an outline extension with visibility cycling and structure editing} 360@r{@bullet{} outline extension with visibility cycling and structure editing}
337@r{@bullet{} as an ASCII system and table editor for taking structured notes} 361@r{@bullet{} ASCII system and table editor for taking structured notes}
338@r{@bullet{} as an ASCII table editor with spreadsheet-like capabilities} 362@r{@bullet{} ASCII table editor with spreadsheet-like capabilities}
339@r{@bullet{} as a TODO list editor} 363@r{@bullet{} TODO list editor}
340@r{@bullet{} as a full agenda and planner with deadlines and work scheduling} 364@r{@bullet{} full agenda and planner with deadlines and work scheduling}
341@r{@bullet{} as an environment to implement David Allen's GTD system} 365@r{@bullet{} environment to implement David Allen's GTD system}
342@r{@bullet{} as a simple hypertext system, with HTML export} 366@r{@bullet{} simple hypertext system, with HTML export}
343@r{@bullet{} as a publishing tool to create a set of interlinked webpages} 367@r{@bullet{} publishing tool to create a set of interlinked webpages}
344@end example 368@end example
345 369
346Org-mode's automatic, context sensitive table editor can be integrated 370Org-mode's automatic, context sensitive table editor with spreadsheet
347into any major mode by activating the minor Orgtbl-mode. 371capabilities can be integrated into any major mode by activating the
372minor Orgtbl-mode. Using a translation step, it can be used to maintain
373tables in arbitray file types, for example in LaTeX.
348 374
349@cindex FAQ 375@cindex FAQ
350There is a website for Org-mode which provides links to the newest 376There is a website for Org-mode which provides links to the newest
@@ -354,14 +380,15 @@ questions (FAQ), links to tutorials etc. This page is located at
354 380
355@page 381@page
356 382
383
357@node Installation, Activation, Summary, Introduction 384@node Installation, Activation, Summary, Introduction
358@section Installation 385@section Installation
359@cindex installation 386@cindex installation
360@cindex XEmacs 387@cindex XEmacs
361 388
362@b{Important:} If Org-mode is part of the Emacs distribution or an 389@b{Important:} @i{If Org-mode is part of the Emacs distribution or an
363XEmacs package, please skip this section and go directly to 390XEmacs package, please skip this section and go directly to
364@ref{Activation}. 391@ref{Activation}.}
365 392
366If you have downloaded Org-mode from the Web, you must take the 393If you have downloaded Org-mode from the Web, you must take the
367following steps to install it: Go into the Org-mode distribution 394following steps to install it: Go into the Org-mode distribution
@@ -413,6 +440,13 @@ make install-info
413@cindex global keybindings 440@cindex global keybindings
414@cindex keybindings, global 441@cindex keybindings, global
415 442
443@iftex
444@b{Important:} @i{If you use copy-and-paste to copy lisp code from the
445PDF documentation to your .emacs file, the single quote character comes
446out incorrectly and the code will not work. You need to fix the single
447quotes by hand, or copy from Info documentation.}
448@end iftex
449
416Add the following lines to your @file{.emacs} file. The last two lines 450Add the following lines to your @file{.emacs} file. The last two lines
417define @emph{global} keys for the commands @command{org-store-link} and 451define @emph{global} keys for the commands @command{org-store-link} and
418@command{org-agenda} - please choose suitable keys yourself. 452@command{org-agenda} - please choose suitable keys yourself.
@@ -609,6 +643,8 @@ argument (@kbd{C-u @key{TAB}}), global cycling is invoked.
609'--------------------------------------' 643'--------------------------------------'
610@end example 644@end example
611 645
646When @kbd{S-@key{TAB}} is called with a numerical prefix N, the CONTENTS
647view up to headlines of level N will be shown.
612Note that inside tables, @kbd{S-@key{TAB}} jumps to the previous field. 648Note that inside tables, @kbd{S-@key{TAB}} jumps to the previous field.
613 649
614@cindex show all, command 650@cindex show all, command
@@ -620,7 +656,18 @@ Show all.
620Reveal context around point, showing the current entry, the following 656Reveal context around point, showing the current entry, the following
621heading and the hierarchy above. Useful for working near a location 657heading and the hierarchy above. Useful for working near a location
622exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda 658exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda
623command (@pxref{Agenda commands}). 659command (@pxref{Agenda commands}). With prefix arg show, on each
660level, all sibling headings.
661@kindex C-c C-x b
662@item C-c C-x b
663Show the current subtree in an indirect buffer@footnote{The indirect
664buffer (@pxref{Indirect Buffers,Indirect Buffers,Indirect
665Buffers,emacs,GNU Emacs Manual}) will contain the entire buffer, but
666will be narrowed to the current tree. Editing the indirect buffer will
667also change the original buffer, but without affecting visibility in
668that buffer.}. With numerical prefix ARG, go up to this level and then
669take that tree. If ARG is negative, go up that many levels. With
670@kbd{C-u} prefix, do not remove the previously used indirect buffer.
624@end table 671@end table
625 672
626When Emacs first visits an Org-mode file, the global state is set to 673When Emacs first visits an Org-mode file, the global state is set to
@@ -730,6 +777,15 @@ Yank subtree from kill ring. This does modify the level of the subtree to
730make sure the tree fits in nicely at the yank position. The yank 777make sure the tree fits in nicely at the yank position. The yank
731level can also be specified with a prefix arg, or by yanking after a 778level can also be specified with a prefix arg, or by yanking after a
732headline marker like @samp{****}. 779headline marker like @samp{****}.
780@kindex C-c ^
781@item C-c ^
782Sort same-level entries. When there is an active region, all entries in
783the region will be sorted. Otherwise the children of the current
784headline are sorted. The command prompts for the sorting method, which
785can be alphabetically, numerically, by time (using the first time stamp
786in each entry), and each of these in reverse order. With a @kbd{C-u}
787prefix, sorting will be case-sensitive. With two @kbd{C-u C-u}
788prefixes, duplicate entries will also be removed.
733@end table 789@end table
734 790
735@cindex region, active 791@cindex region, active
@@ -814,12 +870,12 @@ different location, either in the current file, or even in a different
814file, the archive file. 870file, the archive file.
815 871
816@table @kbd 872@table @kbd
817@kindex C-c $ 873@kindex C-c C-x C-s
818@item C-c $ 874@item C-c C-x C-s
819Archive the subtree starting at the cursor position to the location 875Archive the subtree starting at the cursor position to the location
820given by @code{org-archive-location}. 876given by @code{org-archive-location}.
821@kindex C-u C-c $ 877@kindex C-u C-c C-x C-s
822@item C-u C-c $ 878@item C-u C-c C-x C-s
823Check if any direct children of the current headline could be moved to 879Check if any direct children of the current headline could be moved to
824the archive. To do this, each subtree is checked for open TODO entries. 880the archive. To do this, each subtree is checked for open TODO entries.
825If none are found, the command offers to move it to the archive 881If none are found, the command offers to move it to the archive
@@ -832,7 +888,17 @@ The default archive location is a file in the same directory as the
832current file, with the name derived by appending @file{_archive} to the 888current file, with the name derived by appending @file{_archive} to the
833current file name. For information and examples on how to change this, 889current file name. For information and examples on how to change this,
834see the documentation string of the variable 890see the documentation string of the variable
835@code{org-archive-location}. 891@code{org-archive-location}. There is also an in-buffer option for
892setting this variable, for example
893
894@example
895#+ARCHIVE: %s_done::
896@end example
897
898@noindent
899You may have several such lines in the buffer, they will then be valid
900for the entries following the line (the first will also apply to any
901text before it).
836 902
837@node Sparse trees, Plain lists, Archiving, Document structure 903@node Sparse trees, Plain lists, Archiving, Document structure
838@section Sparse trees 904@section Sparse trees
@@ -846,9 +912,10 @@ An important feature of Org-mode is the ability to construct
846sparse tree means that the entire document is folded as much as 912sparse tree means that the entire document is folded as much as
847possible, but the selected information is made visible along with the 913possible, but the selected information is made visible along with the
848headline structure above it@footnote{See also the variables 914headline structure above it@footnote{See also the variables
849@code{org-show-hierarchy-above} and 915@code{org-show-hierarchy-above}, @code{org-show-following-heading}, and
850@code{org-show-following-heading}.}. Just try it out and you will see 916@code{org-show-siblings} for detailed control on how much context is
851immediately how it works. 917shown around each match.}. Just try it out and you will see immediately
918how it works.
852 919
853Org-mode contains several commands creating such trees. The most 920Org-mode contains several commands creating such trees. The most
854basic one is @command{org-occur}: 921basic one is @command{org-occur}:
@@ -862,7 +929,7 @@ match is in the body of an entry, headline and body are made visible.
862In order to provide minimal context, also the full hierarchy of 929In order to provide minimal context, also the full hierarchy of
863headlines above the match is shown, as well as the headline following 930headlines above the match is shown, as well as the headline following
864the match. Each match is also highlighted; the highlights disappear 931the match. Each match is also highlighted; the highlights disappear
865when the bufer is changes an editing command, or by pressing @kbd{C-c 932when the buffer is changes an editing command, or by pressing @kbd{C-c
866C-c}. When called with a @kbd{C-u} prefix argument, previous highlights 933C-c}. When called with a @kbd{C-u} prefix argument, previous highlights
867are kept, so several calls to this command can be stacked. 934are kept, so several calls to this command can be stacked.
868@end table 935@end table
@@ -1010,14 +1077,13 @@ Emacs @file{calc} package.
1010@menu 1077@menu
1011* Built-in table editor:: Simple tables 1078* Built-in table editor:: Simple tables
1012* Narrow columns:: Stop wasting space in tables 1079* Narrow columns:: Stop wasting space in tables
1013* Table calculations:: Compute a field from other fields
1014* orgtbl-mode:: The table editor as minor mode 1080* orgtbl-mode:: The table editor as minor mode
1015* table.el:: Complex tables 1081* The spreadsheet:: The table editor has spreadsheet capabilities.
1016@end menu 1082@end menu
1017 1083
1018@node Built-in table editor, Narrow columns, Tables, Tables 1084@node Built-in table editor, Narrow columns, Tables, Tables
1019@section The built-in table editor 1085@section The built-in table editor
1020@cindex table editor, builtin 1086@cindex table editor, built-in
1021 1087
1022Org-mode makes it easy to format tables in plain ASCII. Any line with 1088Org-mode makes it easy to format tables in plain ASCII. Any line with
1023@samp{|} as the first non-white character is considered part of a 1089@samp{|} as the first non-white character is considered part of a
@@ -1126,10 +1192,15 @@ is created above the current line.
1126 1192
1127@kindex C-c ^ 1193@kindex C-c ^
1128@item C-c ^ 1194@item C-c ^
1129Sort the table lines in the region. Point and mark must be in the first 1195Sort the table lines in the region. The position of point indicates the
1130and last line to be included, and must be in the column that should be 1196column to be used for sorting, and the range of lines is the range
1131used for sorting. The command prompts for numerical versus 1197between the nearest horizontal separator lines, or the entire table. If
1132alphanumerical sorting. 1198point is before the first column, you will be prompted for the sorting
1199column. If there is an active region, the mark specifies the first line
1200and the sorting column, while point should be in the last line to be
1201included into the sorting. The command prompts for the sorting type
1202(alphabetically, numerically, or by time). When called with a prefix
1203argument, alphabetic sorting will be case-sensitive.
1133 1204
1134@tsubheading{Regions} 1205@tsubheading{Regions}
1135@kindex C-c C-x M-w 1206@kindex C-c C-x M-w
@@ -1163,40 +1234,6 @@ above.
1163@tsubheading{Calculations} 1234@tsubheading{Calculations}
1164@cindex formula, in tables 1235@cindex formula, in tables
1165@cindex calculations, in tables 1236@cindex calculations, in tables
1166@kindex C-c =
1167@item C-c =
1168Install a new formula for the current column and replace current field
1169with the result of the formula.
1170
1171@kindex C-u C-c =
1172@item C-u C-c =
1173Install a new formula for the current field, which must be a named
1174field. Evaluate the formula and replace the field content with the
1175result.
1176
1177@kindex C-c '
1178@item C-c '
1179Edit all formulas associated with the current table in a separate
1180buffer.
1181
1182@kindex C-c *
1183@item C-c *
1184Recalculate the current row by applying the stored formulas from left
1185to right. When called with a @kbd{C-u} prefix, recalculate the
1186entire table, starting with the first non-header line (i.e. below the
1187first horizontal separator line). For details, see @ref{Table calculations}.
1188
1189@kindex C-#
1190@item C-#
1191Rotate the calculation mark in first column through the states
1192@samp{}, @samp{#}, @samp{*}, @samp{!}, @samp{$}. For the meaning of
1193these marks see @ref{Advanced features}. When there is an active
1194region, change all marks in the region.
1195
1196@kindex C-c ?
1197@item C-c ?
1198Which table column is the cursor in? Displays number >0 in echo
1199area.
1200 1237
1201@cindex region, active 1238@cindex region, active
1202@cindex active region 1239@cindex active region
@@ -1254,7 +1291,7 @@ it off with
1254@noindent Then the only table command that still works is 1291@noindent Then the only table command that still works is
1255@kbd{C-c C-c} to do a manual re-align. 1292@kbd{C-c C-c} to do a manual re-align.
1256 1293
1257@node Narrow columns, Table calculations, Built-in table editor, Tables 1294@node Narrow columns, orgtbl-mode, Built-in table editor, Tables
1258@section Narrow columns 1295@section Narrow columns
1259@cindex narrow columns in tables 1296@cindex narrow columns in tables
1260 1297
@@ -1268,6 +1305,7 @@ re-align will then set the width of this column to no more than this
1268value. 1305value.
1269 1306
1270@example 1307@example
1308@group
1271|---+------------------------------| |---+--------| 1309|---+------------------------------| |---+--------|
1272| | | | | <6> | 1310| | | | | <6> |
1273| 1 | one | | 1 | one | 1311| 1 | one | | 1 | one |
@@ -1275,6 +1313,7 @@ value.
1275| 3 | This is a long chunk of text | ----/ | 3 | This=> | 1313| 3 | This is a long chunk of text | ----/ | 3 | This=> |
1276| 4 | four | | 4 | four | 1314| 4 | four | | 4 | four |
1277|---+------------------------------| |---+--------| 1315|---+------------------------------| |---+--------|
1316@end group
1278@end example 1317@end example
1279 1318
1280@noindent 1319@noindent
@@ -1298,64 +1337,132 @@ on a per-file basis with:
1298#+STARTUP: noalign 1337#+STARTUP: noalign
1299@end example 1338@end example
1300 1339
1301@node Table calculations, orgtbl-mode, Narrow columns, Tables 1340@node orgtbl-mode, The spreadsheet, Narrow columns, Tables
1302@section Calculations in tables 1341@section The Orgtbl minor mode
1342@cindex orgtbl-mode
1343@cindex minor mode for tables
1344
1345If you like the intuitive way the Org-mode table editor works, you
1346might also want to use it in other modes like text-mode or mail-mode.
1347The minor mode Orgtbl-mode makes this possible. You can always toggle
1348the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for
1349example in mail mode, use
1350
1351@lisp
1352(add-hook 'mail-mode-hook 'turn-on-orgtbl)
1353@end lisp
1354
1355Furthermore, with some special setup, it is possible to maintain tables
1356in arbitrary syntax with Orgtbl-mode. For example, it is possible to
1357construct LaTeX tables with the underlying ease and power of
1358Orgtbl-mode, including spreadsheet capabulities. For details, see
1359@ref{Tables in arbitrary syntax}.
1360
1361@node The spreadsheet, , orgtbl-mode, Tables
1362@section The spreadsheet
1303@cindex calculations, in tables 1363@cindex calculations, in tables
1304@cindex spreadsheet capabilities 1364@cindex spreadsheet capabilities
1305@cindex @file{calc} package 1365@cindex @file{calc} package
1306 1366
1307The table editor makes use of the Emacs @file{calc} package to implement 1367The table editor makes use of the Emacs @file{calc} package to implement
1308spreadsheet-like capabilities. It can also evaluate Emacs Lisp forms to 1368spreadsheet-like capabilities. It can also evaluate Emacs Lisp forms to
1309derive fields from other fields. Org-mode has two levels of complexity 1369derive fields from other fields.
1310for table calculations. On the basic level, tables do only horizontal
1311computations, so a field can be computed from other fields @emph{in the
1312same row}, and Org-mode assumes that there is only one formula for each
1313column. This is very efficient to work with and enough for many tasks.
1314On the complex level, columns and individual fields can be named for
1315easier referencing in formulas, individual named fields can have their
1316own formula associated with them, and recalculation can be automated.
1317
1318@menu 1370@menu
1319* Formula syntax:: How to write a formula 1371* References:: How to refer to another field or range
1320* Lisp formulas:: An alternative way to write formulas 1372* Formula syntax for Calc:: Using Calc to compute stuff
1321* Column formulas:: Formulas valid for all fields in a column 1373* Formula syntax for Lisp:: Writing formulas in Emacs Lisp
1374* Field formulas:: Formulas valid for a single field
1375* Column formulas:: Formulas valid for an entire column
1376* Editing and debugging formulas:: Fixing formulas
1377* Updating the table:: Recomputing all dependent fields
1322* Advanced features:: Field names, parameters and automatic recalc 1378* Advanced features:: Field names, parameters and automatic recalc
1323* Named-field formulas:: Formulas valid in single fields
1324* Editing/debugging formulas:: Changing a stored formula
1325* Appetizer:: Taste the power of calc
1326@end menu 1379@end menu
1327 1380
1328@node Formula syntax, Lisp formulas, Table calculations, Table calculations 1381@node References, Formula syntax for Calc, The spreadsheet, The spreadsheet
1329@subsection Formula syntax 1382@subsection References
1330@cindex formula syntax 1383@cindex references
1331@cindex syntax, of formulas
1332 1384
1333A formula can be any algebraic expression understood by the Emacs 1385To compute fields in the table from other fields, formulas must
1334@file{calc} package. Note that @file{calc} has the slightly 1386reference other fields or ranges. In Org-mode, fields can be referenced
1335non-standard convention that @samp{/} has lower precedence than 1387by name, by absolute coordinates, and by relative coordinates. To find
1336@samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}. Before 1388out what the coordinates of a field are, press @kbd{C-c ?} in that
1337evaluation by @code{calc-eval} (@pxref{Calling Calc from Your 1389field.
1338Programs,calc-eval,Calling calc from Your Lisp Programs,calc,GNU Emacs
1339Calc Manual}), variable substitution takes place:
1340 1390
1391@subsubheading Field references
1392@cindex field references
1393@cindex references, to fields
1394
1395Formulas can reference the value of another field with the operator
1341@example 1396@example
1342 $ @r{refers to the current field} 1397@@row$column
1343 $3 @r{refers to the field in column 3 of the current row}
1344 $3..$7 @r{a vector of the fields in columns 3-7 of current row}
1345 $P1..$P3 @r{vector of column range, using column names}
1346 &2 @r{second data field above the current, in same column}
1347 &5-2 @r{vector from fifth to second field above current}
1348 &III-II @r{vector of fields between 2nd and 3rd hline above}
1349 &III @r{vector of fields between third hline above and current field}
1350 $name @r{a named field, parameter or constant}
1351@end example 1398@end example
1352 1399
1353@cindex vectors, in table calculations 1400Column references can be absolute like @samp{1}, @samp{2},...@samp{N},
1354The range vectors can be directly fed into the calc vector functions 1401or relative to the current column like @samp{+1} or @samp{-2}.
1355like @samp{vmean} and @samp{vsum}. 1402
1403The row specification only counts data lines and ignores horizontal
1404separator lines (hlines). You can use absolute row numbers
1405@samp{1}...@samp{N}, and row numbers relative to the current row like
1406@samp{+3} or @samp{-1}. Or specify the row relative to one of the
1407hlines: @samp{I} refers to the first hline, @samp{II} to the second etc.
1408@samp{-I} refers to the first such line above the current line,
1409@samp{+I} to the first such line below the current line. You can also
1410write @samp{III+2} which is the second data line after the third hline
1411in the table. Relative row numbers like @samp{-3} will not cross hlines
1412if the current line is too close to the hline. Instead, the value
1413directly at the hline is used.
1414
1415@samp{0} refers to the current row and column. Also, if you omit
1416either the column or the row part of the reference, the current
1417row/column is implied.
1418
1419Org-mode's references with @emph{positive} numbers correspond to fixed
1420references in other spreadsheet programs. For example, @code{@@3$28}
1421corresponds to @code{$AB$3}. Org-mode's references with @emph{negative}
1422numbers behave similar to non-fixed references in other spreadsheet
1423programs, because when the same formula is used in several fields,
1424different fields are referenced each time.
1425
1426Here are a few examples:
1427
1428@example
1429@@2$3 @r{2nd row, 3rd column}
1430$5 @r{column 5 in the current row}
1431@@2 @r{current column, row 2}
1432@@-1$-3 @r{the field one row up, three columns to the left}
1433@@-I$2 @r{field just under hline above current row, column 2}
1434@end example
1435
1436@subsubheading Range references
1437@cindex range references
1438@cindex references, to ranges
1439
1440You may reference a rectangular range of fields by specifying two field
1441references connected by two dots @samp{..}. If both fields are in the
1442current row, you may simply use @samp{$2..$7}, but if at least one field
1443is in a different row, you need to use the general @code{@@row$column}
1444format at least for the first field (i.e the reference must start with
1445@samp{@@} in order to be interpreted correctly). Examples:
1446
1447@example
1448$1..$3 @r{First three fields in the current row.}
1449$P..$Q @r{Range, using column names (see under Advanced)}
1450@@2$1..@@4$3 @r{6 fields between these two fields.}
1451@@-1$-2..@@-1 @r{3 numbers from the column to the left, 2 up to current row}
1452@end example
1356 1453
1454@noindent Range references return a vector of values that can be fed
1455into Calc vector functions. Empty fields in ranges are normally
1456suppressed, so that the vector contains only the non-empty fields (but
1457see the @samp{E} mode switch below). If there are no non-empty fields,
1458@samp{[0]} is returned to avoid syntax errors in formulas.
1459
1460@subsubheading Named references
1461@cindex named references
1462@cindex references, named
1357@cindex name, of column or field 1463@cindex name, of column or field
1358@cindex constants, in calculations 1464@cindex constants, in calculations
1465
1359@samp{$name} is interpreted as the name of a column, parameter or 1466@samp{$name} is interpreted as the name of a column, parameter or
1360constant. Constants are defined globally through the variable 1467constant. Constants are defined globally through the variable
1361@code{org-table-formula-constants}. If you have the 1468@code{org-table-formula-constants}. If you have the
@@ -1365,21 +1472,46 @@ constant, and units like @samp{$km} for kilometers. Column names and
1365parameters can be specified in special table lines. These are 1472parameters can be specified in special table lines. These are
1366described below, see @ref{Advanced features}. 1473described below, see @ref{Advanced features}.
1367 1474
1475@node Formula syntax for Calc, Formula syntax for Lisp, References, The spreadsheet
1476@subsection Formula syntax for Calc
1477@cindex formula syntax, Calc
1478@cindex syntax, of formulas
1479
1480A formula can be any algebraic expression understood by the Emacs
1481@file{Calc} package. Note that @file{calc} has the slightly
1482non-standard convention that @samp{/} has lower precedence than
1483@samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}. Before
1484evaluation by @code{calc-eval} (@pxref{Calling Calc from
1485Your Programs,calc-eval,Calling calc from Your Lisp Programs,calc,GNU
1486Emacs Calc Manual}),
1487variable substitution takes place according to the rules described above.
1488@cindex vectors, in table calculations
1489The range vectors can be directly fed into the calc vector functions
1490like @samp{vmean} and @samp{vsum}.
1491
1368@cindex format specifier 1492@cindex format specifier
1369@cindex mode, for @file{calc} 1493@cindex mode, for @file{calc}
1370A formula can contain an optional mode string after a semicolon. This 1494A formula can contain an optional mode string after a semicolon. This
1371string consists of flags to influence calc's modes@footnote{By 1495string consists of flags to influence Calc and other modes during
1372default, Org-mode uses the standard calc modes (precision 12, angular 1496execution. By default, Org-mode uses the standard calc modes (precision
1373units degrees, fraction and symbolic modes off). The display format, 149712, angular units degrees, fraction and symbolic modes off. The display
1374however, has been changed to @code{(float 5)} to keep tables compact. 1498format, however, has been changed to @code{(float 5)} to keep tables
1375The default settings can be configured using the variable 1499compact. The default settings can be configured using the variable
1376@code{org-calc-default-modes}.} during execution, e.g. @samp{p20} to 1500@code{org-calc-default-modes}.
1377switch the internal precision to 20 digits, @samp{n3}, @samp{s3}, 1501
1378@samp{e2} or @samp{f4} to switch to normal, scientific, engineering, 1502@example
1379or fixed display format, respectively, and @samp{D}, @samp{R}, @samp{F}, 1503p20 @r{switch the internal precision to 20 digits}
1380and @samp{S} to turn on degrees, radians, fraction and symbolic modes, 1504n3 s3 e2 f4 @r{normal, scientific, engineering, or fixed display format}
1381respectively. In addition, you may provide a @code{printf} format 1505D R @r{angle modes: degrees, radians}
1382specifier to reformat the final result. A few examples: 1506F S @r{fraction and symbolic modes}
1507N @r{interpret all fields as numbers, use 0 for non-numbers}
1508T @r{force text interpretation}
1509E @r{keep empty fields in ranges}
1510@end example
1511
1512@noindent
1513In addition, you may provide a @code{printf} format specifier to
1514reformat the final result. A few examples:
1383 1515
1384@example 1516@example
1385$1+$2 @r{Sum of first and second field} 1517$1+$2 @r{Sum of first and second field}
@@ -1391,74 +1523,243 @@ $c/$1/$cm @r{Hz -> cm conversion, using @file{constants.el}}
1391tan($1);Dp3s1 @r{Compute in degrees, precision 3, display SCI 1} 1523tan($1);Dp3s1 @r{Compute in degrees, precision 3, display SCI 1}
1392sin($1);Dp3%.1e @r{Same, but use printf specifier for display} 1524sin($1);Dp3%.1e @r{Same, but use printf specifier for display}
1393vmean($2..$7) @r{Compute column range mean, using vector function} 1525vmean($2..$7) @r{Compute column range mean, using vector function}
1394vsum(&III) @r{Sum numbers from 3rd hline above, up to here} 1526vmean($2..$7);EN @r{Same, but treat empty fields as 0}
1395taylor($3,x=7,2) @r{taylor series of $3, at x=7, second degree} 1527taylor($3,x=7,2) @r{taylor series of $3, at x=7, second degree}
1396@end example 1528@end example
1397 1529
1398@node Lisp formulas, Column formulas, Formula syntax, Table calculations 1530@node Formula syntax for Lisp, Field formulas, Formula syntax for Calc, The spreadsheet
1399@subsection Emacs Lisp forms as formulas 1531@subsection Emacs Lisp forms as formulas
1400@cindex Lisp forms, as table formulas 1532@cindex Lisp forms, as table formulas
1401 1533
1402It is also possible to write a formula in Emacs lisp; this can be useful 1534It is also possible to write a formula in Emacs Lisp; this can be useful
1403for string manipulation and control structures. If a formula starts 1535for string manipulation and control structures. If a formula starts
1404with a single quote followed by an opening parenthesis, then it is 1536with a single quote followed by an opening parenthesis, then it is
1405evaluated as a lisp form. The evaluation should return either a string 1537evaluated as a lisp form. The evaluation should return either a string
1406or a number. Just as with @file{calc} formulas, you can provide a 1538or a number. Just as with @file{calc} formulas, you can specify modes
1407format specifier after a semicolon. A few examples: 1539and a printf format after a semicolon. A reference will be replaced
1540with a string (in double quotes) containing the field. If you provide
1541the @samp{N} mode switch, all referenced elements will be numbers.
1542Ranges are inserted as space-separated fields, so you can embed them in
1543list or vector syntax. A few examples, note how the @samp{N} mode is
1544used when we do computations in lisp.
1408 1545
1409@example 1546@example
1410@r{swap the first two characters of the content of column 1} 1547@r{Swap the first two characters of the content of column 1}
1411'(concat (substring "$1" 1 2) (substring "$1" 0 1) (substring "$1" 2)) 1548 '(concat (substring $1 1 2) (substring $1 0 1) (substring $1 2))
1412@r{Add columns 1 and 2, equivalent to the calc's @code{$1+$2}} 1549@r{Add columns 1 and 2, equivalent to the Calc's @code{$1+$2}}
1413'(+ $1 $2) 1550 '(+ $1 $2);N
1551@r{Compute the sum of columns 1-4, like Calc's @code{vsum($1..$4)}}
1552 '(apply '+ '($1..$4));N
1414@end example 1553@end example
1415 1554
1416@node Column formulas, Advanced features, Lisp formulas, Table calculations 1555@node Field formulas, Column formulas, Formula syntax for Lisp, The spreadsheet
1556@subsection Field formulas
1557@cindex field formula
1558@cindex formula, for individual table field
1559
1560To assign a formula to a particular field, type it directly into the
1561field, preceded by @samp{:=}, for example @samp{:=$1+$2}. When you
1562press @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in
1563the field, the formula will be stored as the formula for this field,
1564evaluated, and the current field replaced with the result.
1565
1566Formulas are stored in a special line starting with @samp{#+TBLFM:}
1567directly below the table. If you typed the equation in the 4th field of
1568the 3rd data line in the table, the formula will look like
1569@samp{@@3$2=$1+$2}. When inserting/deleting/swapping column and rows
1570with the appropriate commands, @i{absolute references} (but not relative
1571ones) in stored formulas are modified in order to
1572still reference the same field. Of cause this is not true if you edit
1573the table structure with normal editing commands - then you must go and
1574fix equations yourself.
1575
1576Instead of typing an equation into the field, you may also use the
1577following command
1578
1579@table @kbd
1580@kindex C-u C-c =
1581@item C-u C-c =
1582Install a new formula for the current field. The command prompts for a
1583formula, with default taken from the @samp{#+TBLFM:} line, applies
1584it to the current field and stores it.
1585@end table
1586
1587@node Column formulas, Editing and debugging formulas, Field formulas, The spreadsheet
1417@subsection Column formulas 1588@subsection Column formulas
1418@cindex column formula 1589@cindex column formula
1419@cindex formula, for table column 1590@cindex formula, for table column
1420 1591
1421To apply a formula to a field, type it directly into the field, 1592Often in a table, the same formula should be used for all fields in a
1422preceded by an equal sign, like @samp{=$1+$2}. When you press 1593particular column. Instead of having to copy the formula to all fields
1594in that column, org-mode allows to assign a single formula to an entire
1595column.
1596
1597To assign a formula to a column, type it directly into any field in the
1598column, preceded by an equal sign, like @samp{=$1+$2}. When you press
1423@key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in the 1599@key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in the
1424field, the formula will be stored as the formula for the current 1600field, the formula will be stored as the formula for the current column,
1425column, evaluated and the current field replaced with the result. If 1601evaluated and the current field replaced with the result. If the field
1426the field contains only @samp{=}, the previously stored formula for 1602contains only @samp{=}, the previously stored formula for this column is
1427this column is used. 1603used. For each column, Org-mode will only remember the most recently
1428 1604used formula. In the @samp{TBLFM:} line, column formulas will look like
1429For each column, Org-mode will remember the most recently used 1605@samp{$4=$1+$2}.
1430formula. The information is stored in a special line starting with
1431@samp{#+TBLFM} directly below the table. When adding/deleting/moving
1432columns with the appropriate commands, the stored equations will be
1433modified accordingly. When a column used in a calculation is removed,
1434references to this column become invalid and will cause an error upon
1435applying the equation.
1436 1606
1437Instead of typing an equation into the field, you may also use the 1607Instead of typing an equation into the field, you may also use the
1438command @kbd{C-c =}. It prompts for a formula (with default taken 1608following command:
1439from the @samp{#+TBLFM:} line) and applies it to the current field. A 1609
1440numerical prefix (e.g. @kbd{C-5 C-c =}) will apply it to that many 1610@table @kbd
1441consecutive fields in the current column. 1611@kindex C-c =
1612@item C-c =
1613Install a new formula for the current column and replace current field
1614with the result of the formula. The command prompts for a formula, with
1615default taken from the @samp{#+TBLFM} line, applies it to the current
1616field and stores it. With a numerical prefix (e.g. @kbd{C-5 C-c =})
1617will apply it to that many consecutive fields in the current column.
1618@end table
1619
1620
1621@node Editing and debugging formulas, Updating the table, Column formulas, The spreadsheet
1622@subsection Editing and Debugging formulas
1623@cindex formula editing
1624@cindex editing, of table formulas
1442 1625
1626You can edit individual formulas in the minibuffer or directly in the
1627field. Org-mode can also prepare a special buffer with all active
1628formulas of a table.
1629
1630@table @kbd
1631@kindex C-c =
1632@kindex C-u C-c =
1633@item C-c =
1634@itemx C-u C-c =
1635Edit the formula associated with the current column/field in the
1636minibuffer. See @ref{Column formulas} and @ref{Field formulas}.
1637@kindex C-u C-u C-c =
1638@item C-u C-u C-c =
1639Re-insert the active formula (either a
1640field formula, or a column formula) into the current field, so that you
1641can edit it directly in the field. The advantage over editing in the
1642minibuffer is that you can use the command @kbd{C-c ?}.
1643@kindex C-c ?
1644@item C-c ?
1645While editing a formula in a table field, highlight the field(s)
1646referenced by the reference at the cursor position in the formula.
1647@kindex C-c '
1648@item C-c '
1649Edit all formulas for the current table in a special buffer, where the
1650formulas will be displayed one per line.
1651While inside the special buffer, Org-mode will automatically highlight
1652any field or range reference at the cursor position. You may edit,
1653remove and add formulas, and use the following commands:
1654@table @kbd
1655@kindex C-c C-c
1656@item C-c C-c
1657Exit the buffer and store the modified formulas. With @kbd{C-u} prefix,
1658also apply the new formulas to the entire table.
1659@kindex C-c C-q
1660@item C-c C-q
1661Exit the buffer without installing changes.
1662@kindex @key{TAB}
1663@item @key{TAB}
1664Pretty-print or indent lisp formula at point. When in a line containing
1665a lisp formula, format the formula according to Emacs Lisp rules.
1666Another @key{TAB} collapses the formula back again. In the open
1667formula, @key{TAB} re-indents just like in Emacs-lisp-mode.
1668@kindex M-@key{TAB}
1669@item M-@key{TAB}
1670Complete Lisp symbols, just like in Emacs-lisp-mode.
1671@kindex S-@key{up}
1672@kindex S-@key{down}
1673@item S-@key{up}/@key{down}
1674Move the reference line in the Org-mode buffer up and down. This is
1675important for highlighting the references of column formulas for
1676different rows.
1677@kindex M-@key{up}
1678@kindex M-@key{down}
1679@item M-@key{up}/@key{down}
1680Scroll the window displaying the table.
1681@end table
1682@kindex C-c @}
1683@item C-c @}
1684Toggle the display of row and column numbers for a table, using
1685overlays. These are uptated each time the table is aligned, you can
1686force it with @kbd{C-c C-c}.
1687@kindex C-c @{
1688@item C-c @{
1689Toggle the formula debugger on and off. See below.
1690@end table
1691
1692Making a table field blank does not remove the formula associated with
1693the field, because that is stored in a different line (the @samp{TBLFM}
1694line) - during the next recalculation the field will be filled again.
1695To remove a formula from a field, you have to give an empty reply when
1696prompted for the formula, or to edit the @samp{#+TBLFM} line.
1697
1698@kindex C-c C-c
1699You may edit the @samp{#+TBLFM} directly and re-apply the changed
1700equations with @kbd{C-c C-c} in that line, or with the normal
1701recalculation commands in the table.
1702
1703@subsubheading Debugging formulas
1704@cindex formula debugging
1705@cindex debugging, of table formulas
1706When the evaluation of a formula leads to an error, the field content
1707becomes the string @samp{#ERROR}. If you would like see what is going
1708on during variable substitution and calculation in order to find a bug,
1709turn on formula debugging in the @code{Tbl} menu and repeat the
1710calculation, for example by pressing @kbd{C-c = @key{RET}} in a field.
1711Detailed information will be displayed.
1712
1713@node Updating the table, Advanced features, Editing and debugging formulas, The spreadsheet
1714@subsection Updating the Table
1443@cindex recomputing table fields 1715@cindex recomputing table fields
1444To recompute all the fields in a line, use the command @kbd{C-c *}. 1716@cindex updating, table
1445It re-applies all stored equations to the current row, from left to 1717
1446right. With a @kbd{C-u} prefix, this will be done to every line in 1718Recalculation of a table is normally not automatic, but needs to be
1447the table, so use this command it you want to make sure the entire 1719triggered by a command. See @ref{Advanced features} for a way to make
1448table is up-to-date. @kbd{C-u C-c C-c} is another way to update the 1720recalculation at least semi-automatically.
1449entire table. Global updating does not touch the line(s) above the 1721
1450first horizontal separator line, assuming that this is the table 1722In order to recalculate a line of a table or the entire table, use the
1451header. 1723following commands:
1452 1724
1453@node Advanced features, Named-field formulas, Column formulas, Table calculations 1725@table @kbd
1726@kindex C-c *
1727@item C-c *
1728Recalculate the current row by first applying the stored column formulas
1729from left to right, and all field formulas in the current row.
1730
1731@kindex C-u C-c *
1732@item C-u C-c *
1733@kindex C-u C-c C-c
1734@itemx C-u C-c C-c
1735Recompute the entire table, line by line. Any lines before the first
1736hline are left alone, assuming that these are part of the table header.
1737
1738@kindex C-u C-u C-c *
1739@item C-u C-u C-c *
1740Iterate the table by recomputing it until no further changes occur.
1741This may be necessary if some computed fields use the value of other
1742fields that are computed @i{later} in the calculation sequence.
1743@end table
1744
1745
1746@node Advanced features, , Updating the table, The spreadsheet
1454@subsection Advanced features 1747@subsection Advanced features
1455 1748
1456If you want the recalculation of fields to happen automatically, 1749If you want the recalculation of fields to happen automatically, or if
1457or if you want to be able to assign a formula to an individual field 1750you want to be able to assign @i{names} to fields and columns, you need
1458(instead of an entire column) you need to reserve the first column of 1751to reserve the first column of the table for special marking characters.
1459the table for special marking characters. Here is an example of a 1752@table @kbd
1460table that collects exam results of students and makes use of these 1753@kindex C-#
1461features: 1754@item C-#
1755Rotate the calculation mark in first column through the states @samp{},
1756@samp{#}, @samp{*}, @samp{!}, @samp{$}. The meaning of these characters
1757is discussed below. When there is an active region, change all marks in
1758the region.
1759@end table
1760
1761Here is an example of a table that collects exam results of students and
1762makes use of these features:
1462 1763
1463@example 1764@example
1464@group 1765@group
@@ -1477,14 +1778,15 @@ features:
1477| ^ | | | | | at | | 1778| ^ | | | | | at | |
1478| $ | max=50 | | | | | | 1779| $ | max=50 | | | | | |
1479|---+---------+--------+--------+--------+-------+------| 1780|---+---------+--------+--------+--------+-------+------|
1480#+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(&II);%.1f 1781#+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(@@-II..@@-I);%.1f
1481@end group 1782@end group
1482@end example 1783@end example
1483 1784
1484@noindent @b{Important}: Please note that for these special tables, 1785@noindent @b{Important}: Please note that for these special tables,
1485recalculating the table with @kbd{C-u C-c *} will only affect rows 1786recalculating the table with @kbd{C-u C-c *} will only affect rows that
1486that are marked @samp{#} or @samp{*}, and named fields. The column 1787are marked @samp{#} or @samp{*}, and fields that have a formula assigned
1487formulas are not applied in rows with empty first field. 1788to the field itself. The column formulas are not applied in rows with
1789empty first field.
1488 1790
1489@cindex marking characters, tables 1791@cindex marking characters, tables
1490The marking characters have the following meaning: 1792The marking characters have the following meaning:
@@ -1495,8 +1797,8 @@ refer to a column as @samp{$Tot} instead of @samp{$6}.
1495@item ^ 1797@item ^
1496This row defines names for the fields @emph{above} the row. With such 1798This row defines names for the fields @emph{above} the row. With such
1497a definition, any formula in the table may use @samp{$m1} to refer to 1799a definition, any formula in the table may use @samp{$m1} to refer to
1498the value @samp{10}. Also, named fields can have their own formula 1800the value @samp{10}. Also, if you assign a formula to a names field, it
1499associated with them. 1801will be stored as @samp{$name=...}.
1500@item _ 1802@item _
1501Similar to @samp{^}, but defines names for the fields in the row 1803Similar to @samp{^}, but defines names for the fields in the row
1502@emph{below}. 1804@emph{below}.
@@ -1505,8 +1807,7 @@ Fields in this row can define @emph{parameters} for formulas. For
1505example, if a field in a @samp{$} row contains @samp{max=50}, then 1807example, if a field in a @samp{$} row contains @samp{max=50}, then
1506formulas in this table can refer to the value 50 using @samp{$max}. 1808formulas in this table can refer to the value 50 using @samp{$max}.
1507Parameters work exactly like constants, only that they can be defined on 1809Parameters work exactly like constants, only that they can be defined on
1508a per-table basis. Changing a parameter and then recalculating the 1810a per-table basis.
1509table can be useful.
1510@item # 1811@item #
1511Fields in this row are automatically recalculated when pressing 1812Fields in this row are automatically recalculated when pressing
1512@key{TAB} or @key{RET} or @kbd{S-@key{TAB}} in this row. Also, this row 1813@key{TAB} or @key{RET} or @kbd{S-@key{TAB}} in this row. Also, this row
@@ -1520,69 +1821,15 @@ recalculation slows down editing too much.
1520Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}. 1821Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}.
1521All lines that should be recalculated should be marked with @samp{#} 1822All lines that should be recalculated should be marked with @samp{#}
1522or @samp{*}. 1823or @samp{*}.
1824@item /
1825Do not export this line. Useful for lines that contain the narrowing
1826@samp{<N>} markers.
1523@end table 1827@end table
1524 1828
1525@node Named-field formulas, Editing/debugging formulas, Advanced features, Table calculations 1829Finally, just to whet your appetite on what can be done with the
1526@subsection Named-field formulas 1830fantastic @file{calc} package, here is a table that computes the Taylor
1527@cindex named field formula 1831series of degree @code{n} at location @code{x} for a couple of functions
1528@cindex formula, for named table field 1832(homework: try that with Excel :-)
1529
1530A named field can have its own formula associated with it. In the
1531example above, this is used for the @samp{at} field that contains
1532the average result of the students. To enter a formula for a named
1533field, just type it into the buffer, preceded by @samp{:=}. Or use
1534@kbd{C-u C-c =}. This equation will be stored below the table like
1535@samp{$name=...}. Any recalculation in the table (even if only
1536requested for the current line) will also update all named field
1537formulas.
1538
1539@node Editing/debugging formulas, Appetizer, Named-field formulas, Table calculations
1540@subsection Editing and debugging formulas
1541@cindex formula editing
1542@cindex editing, of table formulas
1543
1544To edit a column or field formula, use the commands @kbd{C-c
1545=} and @kbd{C-u C-c =}, respectively. The currently active expression
1546is then presented as default in the minibuffer, where it may be edited.
1547
1548Note that making a table field blank does not remove the formula
1549associated with the field - during the next recalculation the field
1550will be filled again. To remove a formula from a field, you have to
1551give an empty reply when prompted for the formula, or to edit the
1552@samp{#+TBLFM} line.
1553
1554@kindex C-c C-c
1555You may edit the @samp{#+TBLFM} directly and re-apply
1556the changed equations with @kbd{C-c C-c} in that line, or with the
1557normal recalculation commands in the table.
1558
1559@kindex C-c '
1560@kindex C-c C-c
1561@kindex C-c C-q
1562@kindex C-c ?
1563In particular for large tables with many formulas, it is convenient to
1564use the command @kbd{C-c '} to edit the formulas of the current table
1565in a separate buffer. That buffer will show the formulas one per
1566line, and you are free to edit, add and remove formulas. Press
1567@kbd{C-c ?} on a @samp{$...} expression to get information about its
1568interpretation. Exiting the buffer with @kbd{C-c C-c} only stores the
1569modified formulas below the table. Exiting with @kbd{C-u C-c C-c}
1570also applies them to the entire table. @kbd{C-c C-q} exits without
1571installing the changes.
1572
1573When the evaluation of a formula leads to an error, the field content
1574becomes the string @samp{#ERROR}. If you would like see what is going
1575on during variable substitution and calculation in order to find a
1576bug, turn on formula debugging in the menu and repeat the calculation,
1577for example by pressing @kbd{C-c = @key{RET}} in a field.
1578Detailed information will be displayed.
1579
1580@node Appetizer, , Editing/debugging formulas, Table calculations
1581@subsection Appetizer
1582
1583Finally, just to whet your appetite on what can be done with the fantastic
1584@file{calc} package, here is a table that computes the Taylor series
1585for a couple of functions (homework: try that with Excel :-)
1586 1833
1587@example 1834@example
1588@group 1835@group
@@ -1600,51 +1847,6 @@ for a couple of functions (homework: try that with Excel :-)
1600@end group 1847@end group
1601@end example 1848@end example
1602 1849
1603@node orgtbl-mode, table.el, Table calculations, Tables
1604@section The Orgtbl minor mode
1605@cindex orgtbl-mode
1606@cindex minor mode for tables
1607
1608If you like the intuitive way the Org-mode table editor works, you
1609might also want to use it in other modes like text-mode or mail-mode.
1610The minor mode Orgtbl-mode makes this possible. You can always toggle
1611the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for
1612example in mail mode, use
1613
1614@lisp
1615(add-hook 'mail-mode-hook 'turn-on-orgtbl)
1616@end lisp
1617
1618@node table.el, , orgtbl-mode, Tables
1619@section The @file{table.el} package
1620@kindex C-c C-c
1621@cindex table editor, @file{table.el}
1622@cindex @file{table.el}
1623
1624Complex ASCII tables with automatic line wrapping, column- and
1625row-spanning, and alignment can be created using the Emacs table
1626package by Takaaki Ota (@uref{http://sourceforge.net/projects/table},
1627and also part of Emacs 22).
1628When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org-mode
1629will call @command{table-recognize-table} and move the cursor into the
1630table. Inside a table, the keymap of Org-mode is inactive. In order
1631to execute Org-mode-related commands, leave the table.
1632
1633@table @kbd
1634@kindex C-c C-c
1635@item C-c C-c
1636Recognize @file{table.el} table. Works when the cursor is in a
1637table.el table.
1638
1639@kindex C-c ~
1640@item C-c ~
1641Insert a table.el table. If there is already a table at point, this
1642command converts it between the table.el format and the Org-mode
1643format. See the documentation string of the command
1644@code{org-convert-table} for the restrictions under which this is
1645possible.
1646@end table
1647
1648@node Hyperlinks, TODO items, Tables, Top 1850@node Hyperlinks, TODO items, Tables, Top
1649@chapter Hyperlinks 1851@chapter Hyperlinks
1650@cindex hyperlinks 1852@cindex hyperlinks
@@ -1697,7 +1899,6 @@ internal structure of all links, use the menu entry
1697@section Internal links 1899@section Internal links
1698@cindex internal links 1900@cindex internal links
1699@cindex links, internal 1901@cindex links, internal
1700@cindex CamelCase links
1701@cindex targets, for links 1902@cindex targets, for links
1702 1903
1703If the link does not look like a URL, it is considered to be internal in 1904If the link does not look like a URL, it is considered to be internal in
@@ -1706,7 +1907,7 @@ Target][Find my target]]} lead to a text search in the current file.
1706The link can be followed with @kbd{C-c C-o} when the cursor is on the 1907The link can be followed with @kbd{C-c C-o} when the cursor is on the
1707link, or with a mouse click (@pxref{Handling links}). The preferred 1908link, or with a mouse click (@pxref{Handling links}). The preferred
1708match for such a link is a dedicated target: the same string in double 1909match for such a link is a dedicated target: the same string in double
1709angular brackets. Targets may be located anywhere; often it is 1910angular brackets. Targets may be located anywhere; sometimes it is
1710convenient to put them into a comment line. For example 1911convenient to put them into a comment line. For example
1711 1912
1712@example 1913@example
@@ -1744,10 +1945,9 @@ earlier.
1744 1945
1745@menu 1946@menu
1746* Radio targets:: Make targets trigger links in plain text. 1947* Radio targets:: Make targets trigger links in plain text.
1747* CamelCase links:: Activating CamelCase words as links
1748@end menu 1948@end menu
1749 1949
1750@node Radio targets, CamelCase links, Internal links, Internal links 1950@node Radio targets, , Internal links, Internal links
1751@subsection Radio targets 1951@subsection Radio targets
1752@cindex radio targets 1952@cindex radio targets
1753@cindex targets, radio 1953@cindex targets, radio
@@ -1763,19 +1963,6 @@ scanned automatically for radio targets only when the file is first
1763loaded into Emacs. To update the target list during editing, press 1963loaded into Emacs. To update the target list during editing, press
1764@kbd{C-c C-c} with the cursor on or at a target. 1964@kbd{C-c C-c} with the cursor on or at a target.
1765 1965
1766@node CamelCase links, , Radio targets, Internal links
1767@subsection CamelCase words as links
1768@cindex completion, of CamelCase links
1769@cindex CamelCase links, completion of
1770
1771Org-mode also supports CamelCase words as links. This feature is not
1772turned on by default because of the inconsistencies this system suffers
1773from. It is also possible that this feature will disappear entirely in
1774a future version of Org-mode. To activate CamelCase words as links, you
1775need to customize the option @code{org-activate-links}. A CamelCase
1776word then leads to a text search such that @samp{CamelCaseLink} is
1777equivalent to @samp{[[camel case link]]}.
1778
1779@node External links, Handling links, Internal links, Hyperlinks 1966@node External links, Handling links, Internal links, Hyperlinks
1780@section External links 1967@section External links
1781@cindex links, external 1968@cindex links, external
@@ -1830,12 +2017,19 @@ format}), for example:
1830[[http://www.gnu.org/software/emacs/][GNU Emacs]] 2017[[http://www.gnu.org/software/emacs/][GNU Emacs]]
1831@end example 2018@end example
1832 2019
2020@noindent
2021If the description is a file name or URL that points to an image, HTML
2022export (@pxref{HTML export}) will inline the image as a clickable
2023button. If there is no description at all and the link points to an
2024image,
2025that image will be inlined into the exported HTML file.
2026
1833@cindex angular brackets, around links 2027@cindex angular brackets, around links
1834@cindex plain text external links 2028@cindex plain text external links
1835Org-mode also finds external links in the normal text and activates them 2029Org-mode also finds external links in the normal text and activates them
1836as links. If spaces must be part of the link (for example in 2030as links. If spaces must be part of the link (for example in
1837@samp{bbdb:Richard Stallman}), or you need to remove ambiguities about the end of 2031@samp{bbdb:Richard Stallman}), or if you need to remove ambiguities
1838the link, enclose them in angular brackets. 2032about the end of the link, enclose them in angular brackets.
1839 2033
1840@node Handling links, Link abbreviations, External links, Hyperlinks 2034@node Handling links, Link abbreviations, External links, Hyperlinks
1841@section Handling links 2035@section Handling links
@@ -1871,20 +2065,25 @@ The key binding @kbd{C-c l} is only a suggestion - see @ref{Installation}.
1871@item C-c C-l 2065@item C-c C-l
1872Insert a link. This prompts for a link to be inserted into the buffer. 2066Insert a link. This prompts for a link to be inserted into the buffer.
1873You can just type a link, using text for an internal link, or one of the 2067You can just type a link, using text for an internal link, or one of the
1874link type prefixes mentioned in the examples above. Through completion, 2068link type prefixes mentioned in the examples above. All links stored
1875all links stored during the current session can be 2069during the current session are part of the history for this prompt, so
1876accessed@footnote{After insertion of a stored link, the link will be 2070you can access them with @key{up} and @key{down}, or with
2071completion@footnote{After insertion of a stored link, the link will be
1877removed from the list of stored links. To keep it in the list later 2072removed from the list of stored links. To keep it in the list later
1878use, use a triple @kbd{C-u} prefix to @kbd{C-c C-l}, or configure the 2073use, use a triple @kbd{C-u} prefix to @kbd{C-c C-l}, or configure the
1879option @code{org-keep-stored-link-after-insertion}.}. The link 2074option @code{org-keep-stored-link-after-insertion}.}. The link will be
1880will be inserted into the buffer, along with a descriptive text. Note 2075inserted into the buffer, along with a descriptive text. If some text
1881that you don't have to use this command to insert a link. Links in 2076was selected when this command is called, the selected text becomes the
1882Org-mode are plain text, and you can type or paste them straight into 2077default description.@* Note that you don't have to use this command to
1883the buffer. By using this command, the links are automatically enclosed 2078insert a link. Links in Org-mode are plain text, and you can type or
1884in double brackets, and you will be asked for the optional descriptive 2079paste them straight into the buffer. By using this command, the links
1885text. If the link is a @samp{file:} link and the linked file is located 2080are automatically enclosed in double brackets, and you will be asked for
1886in the same directory as the current file or a subdirectory of it, the 2081the optional descriptive text.
1887path of the file will be inserted relative to the current directory. 2082
2083@c If the link is a @samp{file:} link and
2084@c the linked file is located in the same directory as the current file or
2085@c a subdirectory of it, the path of the file will be inserted relative to
2086@c the current directory.
1888 2087
1889@kindex C-u C-c C-l 2088@kindex C-u C-c C-l
1890@cindex file name completion 2089@cindex file name completion
@@ -1945,10 +2144,26 @@ Jump back to a recorded position. A position is recorded by the
1945commands following internal links, and by @kbd{C-c %}. Using this 2144commands following internal links, and by @kbd{C-c %}. Using this
1946command several times in direct succession moves through a ring of 2145command several times in direct succession moves through a ring of
1947previously recorded positions. 2146previously recorded positions.
2147
2148@kindex C-c C-x C-n
2149@kindex C-c C-x C-p
2150@cindex links, finding next/previous
2151@item C-c C-x C-n
2152@itemx C-c C-x C-p
2153Move forward/backward to the next link in the buffer. At the limit of
2154the buffer, the search fails once, and then wraps around. The key
2155bindings for this are really too long, you might want to bind this also
2156to @kbd{C-n} and @kbd{C-p}
2157@lisp
2158(add-hook 'org-load-hook
2159 (lambda ()
2160 (define-key 'org-mode-map "\C-n" 'org-next-link)
2161 (define-key 'org-mode-map "\C-p" 'org-previous-link)))
2162@end lisp
1948@end table 2163@end table
1949 2164
1950@node Link abbreviations, Search options, Handling links, Hyperlinks 2165@node Link abbreviations, Search options, Handling links, Hyperlinks
1951@section Link abbreviatons 2166@section Link abbreviations
1952@cindex link abbreviations 2167@cindex link abbreviations
1953@cindex abbreviation, links 2168@cindex abbreviation, links
1954 2169
@@ -1957,7 +2172,7 @@ needed in a document. For this you can use link abbreviations. An
1957abbreviated link looks like this 2172abbreviated link looks like this
1958 2173
1959@example 2174@example
1960[[linkword::tag][description]] 2175[[linkword:tag][description]]
1961@end example 2176@end example
1962 2177
1963@noindent 2178@noindent
@@ -1981,9 +2196,9 @@ in order to create the link. You may also specify a function that will
1981be called with the tag as the only argument to create the link. 2196be called with the tag as the only argument to create the link.
1982 2197
1983With the above setting, you could link to a specific bug with 2198With the above setting, you could link to a specific bug with
1984@code{[[bugzilla::129]]}, search the web for OrgMode with 2199@code{[[bugzilla:129]]}, search the web for @samp{OrgMode} with
1985@code{[[google::OrgMode]]} and find out what the Org-mode author is 2200@code{[[google:OrgMode]]} and find out what the Org-mode author is
1986doing besides Emacs hacking with @code{[[ads::Dominik,C]]}. 2201doing besides Emacs hacking with @code{[[ads:Dominik,C]]}.
1987 2202
1988If you need special abbreviations just for a single Org-mode buffer, you 2203If you need special abbreviations just for a single Org-mode buffer, you
1989can define them in the file with 2204can define them in the file with
@@ -2042,7 +2257,7 @@ sparse tree with the matches.
2042@end table 2257@end table
2043 2258
2044As a degenerate case, a file link with an empty file name can be used 2259As a degenerate case, a file link with an empty file name can be used
2045to search the current file. For example, @code{<file:::find me>} does 2260to search the current file. For example, @code{[[file:::find me]]} does
2046a search for @samp{find me} in the current file, just as 2261a search for @samp{find me} in the current file, just as
2047@samp{[[find me]]} would. 2262@samp{[[find me]]} would.
2048 2263
@@ -2075,15 +2290,27 @@ file.
2075@cindex @file{remember.el} 2290@cindex @file{remember.el}
2076 2291
2077Another way to create org entries with links to other files is through 2292Another way to create org entries with links to other files is through
2078the @emph{Remember} package by John Wiegley. @emph{Remember} lets you 2293the @i{remember} package by John Wiegley. @i{Remember} lets you store
2079store quick notes with little interruption of your work flow. See 2294quick notes with little interruption of your work flow. See
2080@uref{http://www.emacswiki.org/cgi-bin/wiki/RememberMode} for more 2295@uref{http://www.emacswiki.org/cgi-bin/wiki/RememberMode} for more
2081information. The notes produced by @emph{Remember} can be stored in 2296information. The notes produced by @i{Remember} can be stored in
2082different ways, and Org-mode files are a good target. Org-mode allows 2297different ways, and Org-mode files are a good target. Org-mode
2083you to file away notes either to a default file, or directly to the correct 2298significantly expands the possibilities of @i{remember}: You may define
2084location in your Org-mode outline tree. The following customization 2299templates for different note types, and to associate target files and
2085will tell @emph{Remember} to use org files as target, and to create 2300headlines with specific templates. It also allows you to select the
2086annotations compatible with Org-mode links. 2301location where a note should be stored interactively, on the fly.
2302
2303@menu
2304* Setting up remember:: Some code for .emacs to get things going
2305* Remember templates:: Define the outline of different note types
2306* Storing notes:: Directly get the note to where it belongs
2307@end menu
2308
2309@node Setting up remember, Remember templates, Remember, Remember
2310@subsection Setting up remember
2311
2312The following customization will tell @i{remember} to use org files as
2313target, and to create annotations compatible with Org-mode links.
2087 2314
2088@example 2315@example
2089(setq org-directory "~/path/to/my/orgfiles/") 2316(setq org-directory "~/path/to/my/orgfiles/")
@@ -2093,28 +2320,38 @@ annotations compatible with Org-mode links.
2093(add-hook 'remember-mode-hook 'org-remember-apply-template) 2320(add-hook 'remember-mode-hook 'org-remember-apply-template)
2094@end example 2321@end example
2095 2322
2323@node Remember templates, Storing notes, Setting up remember, Remember
2324@subsection Remember templates
2096@cindex templates, for remember 2325@cindex templates, for remember
2326
2097In combination with Org-mode, you can use templates to generate 2327In combination with Org-mode, you can use templates to generate
2098different types of remember notes. For example, if you would like to 2328different types of @i{remember} notes. For example, if you would like
2099use one template to create general TODO entries, and another one for 2329to use one template to create general TODO entries, another one for
2100journal entries, you could use: 2330journal entries, and a third one for collecting random ideas, you could
2331use:
2101 2332
2102@example 2333@example
2103(setq org-remember-templates 2334(setq org-remember-templates
2104 '((?t "* TODO %?\n %i\n %a" "~/org/TODO.org") 2335 '((?t "* TODO %?\n %i\n %a" "~/org/TODO.org")
2105 (?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org"))) 2336 (?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org")
2337 (?i "* %^@{Title@}\n %i\n %a" "~/org/JOURNAL.org" "New Ideas")))
2106@end example 2338@end example
2107 2339
2108@noindent In these entries, the character specifies how to select the 2340@noindent In these entries, the character specifies how to select the
2109template, the first string specifies the template, and the (optional) 2341template. The first string specifies the template. Two more (optional)
2110second string specifies a default file (overruling 2342strings give the file in which, and the headline under which the new
2111@code{org-default-notes-file}) as a target for this note. 2343note should be stored. The file defaults to
2112 2344@code{org-default-notes-file}, the heading to
2113When you call @kbd{M-x remember} to remember something, org will prompt 2345@code{org-remember-default-headline}. Both defaults help to get to the
2114for a key to select the template and then prepare the buffer like 2346storing location quickly, but you can change the location interactively
2347while storing the note.
2348
2349When you call @kbd{M-x remember} (or @kbd{M-x org-remember}) to remember
2350something, org will prompt for a key to select the template (if you have
2351more than one template) and then prepare the buffer like
2115@example 2352@example
2116* TODO 2353* TODO
2117 <file:link to where you called remember> 2354 [[file:link to where you called remember]]
2118@end example 2355@end example
2119 2356
2120@noindent or 2357@noindent or
@@ -2122,20 +2359,69 @@ for a key to select the template and then prepare the buffer like
2122@example 2359@example
2123* [2006-03-21 Tue 15:37] 2360* [2006-03-21 Tue 15:37]
2124 2361
2125 <file:link to where you called remember> 2362 [[file:link to where you called remember]]
2363@end example
2364
2365@noindent
2366During expansion of the template, special @kbd{%}-escapes allow dynamic
2367insertion of content:
2368@example
2369%^@{prompt@} @r{prompt the user for a string and replace this sequence with it.}
2370%t @r{time stamp, date only}
2371%T @r{time stamp with date and time}
2372%u, %U @r{like the above, but inactive time stamps}
2373%^t @r{like @code{%t}, but prompt for date. Similarly @code{%^T}, @code{%^u}, @code{%^U}}
2374 @r{You may define a prompt like @code{%^@{Birthday@}t}}
2375%n @r{user name (taken from @code{user-full-name})}
2376%a @r{annotation, normally the link created with @code{org-store-link}}
2377%i @r{initial content, the region when remember is called with C-u.}
2378 @r{The entire text will be indented like @code{%i} itself.}
2379%:keyword @r{specific information for certain link types, see below}
2380@end example
2381
2382@noindent
2383For specific link types, the following keywords will be defined:
2384
2385@example
2386Link type | Available keywords
2387-------------------+----------------------------------------------
2388bbdb | %:name %:company
2389vm, wl, mh, rmail | %:type %:subject %:message-id
2390 | %:from %:fromname %:fromaddress
2391 | %:to %:toname %:toaddress
2392 | %: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}.}}
2393gnus | %:group, @r{for messages also all email fields}
2394w3, w3m | %:url
2395info | %:file %:node
2396calendar | %:date"
2397@end example
2398
2399@noindent
2400If you would like to have the cursor in a specific position after the
2401template has been expanded:
2402
2403@example
2404%? @r{After completing the template, position cursor here.}
2126@end example 2405@end example
2127 2406
2128@noindent See the variable @code{org-remember-templates} for more details. 2407@noindent
2408If you change you mind about which template to use, call
2409@code{org-remember} in the remember buffer. You may then select a new
2410template that will be filled with the previoous context information.
2411
2412@node Storing notes, , Remember templates, Remember
2413@subsection Storing notes
2129 2414
2130When you are finished composing a note with remember, you have to press 2415When you are finished preparing a note with @i{remember}, you have to press
2131@kbd{C-c C-c} to file the note away. The handler first prompts for a 2416@kbd{C-c C-c} to file the note away. The handler first prompts for a
2132target file - if you press @key{RET}, the value of 2417target file - if you press @key{RET}, the value specified for the
2133@code{org-default-notes-file} is used. Then the command offers the 2418template is used. Then the command offers the headings tree of the
2134headings tree of the selected file. You can either immediately press 2419selected file, with the cursor position at the default headline (if you
2135@key{RET} to get the note appended to the file. Or you can use vertical 2420had specified one in the template). You can either immediately press
2136cursor motion (@key{up} and @key{down}) and visibility cycling 2421@key{RET} to get the note placed there. Or you can use vertical cursor
2137(@key{TAB}) to find a better place. Pressing @key{RET} or @key{left} or 2422motion (@key{up} and @key{down}) and visibility cycling (@key{TAB}) to
2138@key{right} leads to the following result. 2423find a better place. Pressing @key{RET} or @key{left} or @key{right}
2424then leads to the following result.
2139 2425
2140@multitable @columnfractions 0.2 0.1 0.7 2426@multitable @columnfractions 0.2 0.1 0.7
2141@item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted} 2427@item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted}
@@ -2148,11 +2434,10 @@ cursor motion (@key{up} and @key{down}) and visibility cycling
2148 Or use prefix arg to specify level manually. 2434 Or use prefix arg to specify level manually.
2149@end multitable 2435@end multitable
2150 2436
2151So a fast way to store the note is to press @kbd{C-c C-c @key{RET} 2437So a fast way to store the note to its default location is to press
2152@key{RET}} to append it to the default file. Even shorter would be 2438@kbd{C-c C-c @key{RET} @key{RET}}. Even shorter would be @kbd{C-u C-c
2153@kbd{C-u C-c C-c}, which does the same without even showing the tree. 2439C-c}, which does the same without even asking for a file or showing the
2154But with little extra effort, you can push it directly to the correct 2440tree.
2155location.
2156 2441
2157Before inserting the text into a tree, the function ensures that the 2442Before inserting the text into a tree, the function ensures that the
2158text has a headline, i.e. a first line that starts with a @samp{*}. 2443text has a headline, i.e. a first line that starts with a @samp{*}.
@@ -2277,7 +2562,9 @@ TODO to FEEDBACK, then to VERIFY, and finally to DONE. You may also
2277use a prefix argument to quickly select a specific state. For example 2562use a prefix argument to quickly select a specific state. For example
2278@kbd{C-3 C-c C-t} will change the state immediately to VERIFY. 2563@kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
2279If you define many keywords, you can use in-buffer completion (see 2564If you define many keywords, you can use in-buffer completion (see
2280@ref{Completion}) to insert these words into the buffer. 2565@ref{Completion}) to insert these words into the buffer. Changing a todo
2566state can be logged with a timestamp, see @ref{Tracking TODO state
2567changes} for more information.
2281 2568
2282@node TODO types, Per file keywords, Workflow states, TODO extensions 2569@node TODO types, Per file keywords, Workflow states, TODO extensions
2283@subsection TODO keywords as types 2570@subsection TODO keywords as types
@@ -2333,7 +2620,7 @@ anywhere in the file:
2333#+TYP_TODO: Fred Sara Lucy Mike DONE 2620#+TYP_TODO: Fred Sara Lucy Mike DONE
2334@end example 2621@end example
2335 2622
2336@cindex Completion, of option keywords 2623@cindex completion, of option keywords
2337@kindex M-@key{TAB} 2624@kindex M-@key{TAB}
2338@noindent To make sure you are using the correct keyword, type 2625@noindent To make sure you are using the correct keyword, type
2339@samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion. 2626@samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
@@ -2493,6 +2780,7 @@ planning.
2493* Time stamps:: Assigning a time to a tree entry 2780* Time stamps:: Assigning a time to a tree entry
2494* Creating timestamps:: Commands which insert timestamps 2781* Creating timestamps:: Commands which insert timestamps
2495* Custom time format:: If you cannot work with the ISO format 2782* Custom time format:: If you cannot work with the ISO format
2783* Repeating items:: Deadlines that come back again and again
2496* Progress logging:: Documenting when what work was done. 2784* Progress logging:: Documenting when what work was done.
2497@end menu 2785@end menu
2498 2786
@@ -2554,10 +2842,12 @@ example:
2554If a time stamp is preceded by the word @samp{SCHEDULED:}, it means you 2842If a time stamp is preceded by the word @samp{SCHEDULED:}, it means you
2555are planning to start working on that task on the given date. So this is 2843are planning to start working on that task on the given date. So this is
2556not about recording an event, but about planning your work. The 2844not about recording an event, but about planning your work. The
2557headline will be listed under the given date. In addition, a reminder 2845headline will be listed under the given date@footnote{It will still be
2558that the scheduled date has passed will be present in the compilation 2846listed on that date after it has been marked DONE. If you don't like
2559for @emph{today}, until the entry is marked DONE. I.e., the task will 2847this, set the variable @code{org-agenda-skip-scheduled-if-done}.}. In
2560automatically be forwarded until completed. 2848addition, a reminder that the scheduled date has passed will be present
2849in the compilation for @emph{today}, until the entry is marked DONE.
2850I.e., the task will automatically be forwarded until completed.
2561 2851
2562@example 2852@example
2563*** TODO Call Trillian for a date on New Years Eve. 2853*** TODO Call Trillian for a date on New Years Eve.
@@ -2575,7 +2865,7 @@ continuing until the entry is marked DONE. An example:
2575 2865
2576@example 2866@example
2577*** TODO write article about the Earth for the Guide 2867*** TODO write article about the Earth for the Guide
2578 The editor in charge is <bbdb:Ford Prefect> 2868 The editor in charge is [[bbdb:Ford Prefect]]
2579 DEADLINE: <2004-02-29 Sun> 2869 DEADLINE: <2004-02-29 Sun>
2580@end example 2870@end example
2581@item Time stamp with CLOSED keyword 2871@item Time stamp with CLOSED keyword
@@ -2707,6 +2997,7 @@ specified with the current date and time. For example:
2707 22 sept 0:34 --> currentyear-09-22 0:34 2997 22 sept 0:34 --> currentyear-09-22 0:34
2708 12 --> currentyear-currentmonth-12 2998 12 --> currentyear-currentmonth-12
2709 Fri --> nearest Friday (today or later) 2999 Fri --> nearest Friday (today or later)
3000 +4 --> 4 days from now (if +N is the only thing given)
2710@end example 3001@end example
2711 3002
2712The function understands English month and weekday abbreviations. If 3003The function understands English month and weekday abbreviations. If
@@ -2716,8 +3007,11 @@ the variables @code{parse-time-months} and @code{parse-time-weekdays}.
2716@cindex calendar, for selecting date 3007@cindex calendar, for selecting date
2717Parallel to the minibuffer prompt, a calendar is popped up@footnote{If 3008Parallel to the minibuffer prompt, a calendar is popped up@footnote{If
2718you don't need/want the calendar, configure the variable 3009you don't need/want the calendar, configure the variable
2719@code{org-popup-calendar-for-date-prompt}.}. You can control the 3010@code{org-popup-calendar-for-date-prompt}.}. When you exit the date
2720calendar fully from the minibuffer: 3011prompt, either by clicking on a date in the calendar, or by pressing
3012@key{RET}, the date selected in the calendar will be combined with the
3013information entered at the prompt. You can control the calendar fully
3014from the minibuffer:
2721 3015
2722@table @kbd 3016@table @kbd
2723@kindex < 3017@kindex <
@@ -2752,7 +3046,7 @@ One month back.
2752Choose date in calendar (only if nothing was typed into minibuffer). 3046Choose date in calendar (only if nothing was typed into minibuffer).
2753@end table 3047@end table
2754 3048
2755@node Custom time format, Progress logging, Creating timestamps, Timestamps 3049@node Custom time format, Repeating items, Creating timestamps, Timestamps
2756@section Custom time format 3050@section Custom time format
2757@cindex custom date/time format 3051@cindex custom date/time format
2758@cindex time format, custom 3052@cindex time format, custom
@@ -2795,26 +3089,70 @@ using dates in tables, table alignment will be messed up. If the custom
2795format is shorter, things do work as expected. 3089format is shorter, things do work as expected.
2796@end itemize 3090@end itemize
2797 3091
2798@node Progress logging, , Custom time format, Timestamps 3092@node Repeating items, Progress logging, Custom time format, Timestamps
3093@section Repeating items
3094@cindex TODO items, repeating
3095@cindex deadlines, repeating
3096@cindex scheduling, repeating
3097
3098Org-mode integrates with the Emacs calendar and diary to display cyclic
3099appointments, anniversaries and other special entries in the agenda
3100(@pxref{Weekly/Daily agenda}). However, it can be useful to have
3101certain deadlines and scheduling items to auto-repeat. The advantage of
3102a deadline or scheduled item is that the they produce warnings ahead of
3103time and automatically forward themselves in the agenda until they are
3104done. The abstract difference is therefore between cyclic
3105@i{appointments} and cyclic @i{action items}. For appointments you
3106should use the diary, for actions you can uses an org-mode deadline or
3107scheduling time stamp together with a REPEAT cookie. For example:
3108
3109@example
3110* TODO Replace batteries in smoke detector REPEAT(+18m)
3111 SCHEDULED: <2007-01-01 Mon>
3112
3113* TODO Get dentist appointment REPEAT(+6m)
3114 SCHEDULED: <2006-12-19 Tue>
3115
3116* TODO Tax report to IRS REPEAT(+1y)
3117 DEADLINE: <2007-04-01 Sun>
3118@end example
3119
3120Each time you try to mark one of these entries DONE using @kbd{C-c C-t},
3121they will automatically switch back to the state TODO, and the
3122deadline/scheduling will be shifted accordingly. The time units
3123recognized by org-mode are year (y), month (m), week (w), and day (d).
3124Org-mode will also prompt you for a note and record the fact that you
3125have closed this item in a note under the headline.
3126
3127One unusual property of these repeating items is that only one instance
3128of each exist at any given time. So if you look back or ahead in the
3129agenda, you will not find past and future instances, only the current
3130one will show up. Use a cyclic diary entry if you need all past and
3131future instances to be visible in the agenda.
3132
3133@node Progress logging, , Repeating items, Timestamps
2799@section Progress Logging 3134@section Progress Logging
2800@cindex progress logging 3135@cindex progress logging
2801@cindex logging, of progress 3136@cindex logging, of progress
2802 3137
2803Org-mode can automatically record a time stamp when you mark a TODO item 3138Org-mode can automatically record a time stamp when you mark a TODO item
2804as DONE. You can also measure precisely the time you spent on specific 3139as DONE, or even each time when you change the state of a TODO item.
2805items in a project by starting and stopping a clock when you start and 3140You can also measure precisely the time you spent on specific items in a
2806stop working on an aspect of a project. 3141project by starting and stopping a clock when you start and stop working
3142on an aspect of a project.
2807 3143
2808@menu 3144@menu
2809* Closing items:: When was this entry marked DONE? 3145* Closing items:: When was this entry marked DONE?
3146* Tracking TODO state changes:: When did the status change?
2810* Clocking work time:: When exactly did you work on this item? 3147* Clocking work time:: When exactly did you work on this item?
2811@end menu 3148@end menu
2812 3149
2813@node Closing items, Clocking work time, Progress logging, Progress logging 3150@node Closing items, Tracking TODO state changes, Progress logging, Progress logging
2814@subsection Closing items 3151@subsection Closing items
2815 3152
2816If you want to keep track of @emph{when} a certain TODO item was 3153If you want to keep track of @emph{when} a certain TODO item was
2817finished, turn on logging with 3154finished, turn on logging with@footnote{The corresponding in-buffer
3155setting is: @code{#+STARTUP: logdone}}
2818 3156
2819@lisp 3157@lisp
2820(setq org-log-done t) 3158(setq org-log-done t)
@@ -2823,16 +3161,44 @@ finished, turn on logging with
2823@noindent 3161@noindent
2824Then each time you turn a TODO entry into DONE using either @kbd{C-c 3162Then each time you turn a TODO entry into DONE using either @kbd{C-c
2825C-t} in the Org-mode buffer or @kbd{t} in the agenda buffer, a line 3163C-t} in the Org-mode buffer or @kbd{t} in the agenda buffer, a line
2826@samp{CLOSED: [timestamp]} will be inserted just after the headline. 3164@samp{CLOSED: [timestamp]} will be inserted just after the headline. If
2827If you turn the entry back into a TODO item again through further 3165you turn the entry back into a TODO item through further state cycling,
2828state cycling, that line will be removed again. In the timeline 3166that line will be removed again. In the timeline (@pxref{Timeline}) and
2829(@pxref{Timeline}) and in the agenda (@pxref{Weekly/Daily agenda}), 3167in the agenda (@pxref{Weekly/Daily agenda}), you can then use the
2830you can then use the @kbd{l} key to display the TODO items closed on 3168@kbd{l} key to display the TODO items closed on each day, giving you an
2831each day, giving you an overview of what has been done on a day. 3169overview of what has been done on a day. If you want to record a note
2832See the variable @code{org-log-done} for the possibility to record an 3170along with the timestamp, use@footnote{The corresponding in-buffer
2833additional note together with a timestamp. 3171setting is: @code{#+STARTUP: lognotedone}}
2834 3172
2835@node Clocking work time, , Closing items, Progress logging 3173@lisp
3174(setq org-log-done '(done))
3175@end lisp
3176
3177@node Tracking TODO state changes, Clocking work time, Closing items, Progress logging
3178@subsection Tracking TODO state changes
3179
3180When TODO keywords are used as workflow states (@pxref{Workflow
3181states}), you might want to keep track of when a state change occurred,
3182and you may even want to attach notes to that state change. With the
3183setting
3184
3185@lisp
3186(setq org-log-done '(state))
3187@end lisp
3188
3189@noindent
3190each state change will prompt you for a note that will be attached to
3191the current headline. Very likely you do not want this verbose tracking
3192all the time, so it is probably better to configure this behavior with
3193in-buffer options. For example, if you are tracking purchases, put
3194these into a separate file that starts with:
3195
3196@example
3197#+SEQ_TODO: TODO ORDERED INVOICE PAYED RECEIVED SENT
3198#+STARTUP: lognotestate
3199@end example
3200
3201@node Clocking work time, , Tracking TODO state changes, Progress logging
2836@subsection Clocking work time 3202@subsection Clocking work time
2837 3203
2838Org-mode allows you to clock the time you spent on specific tasks in a 3204Org-mode allows you to clock the time you spent on specific tasks in a
@@ -2852,7 +3218,9 @@ Stop the clock (clock-out). The inserts another timestamp at the same
2852location where the clock was last started. It also directly computes 3218location where the clock was last started. It also directly computes
2853the resulting time in inserts it after the time range as @samp{=> 3219the resulting time in inserts it after the time range as @samp{=>
2854HH:MM}. See the variable @code{org-log-done} for the possibility to 3220HH:MM}. See the variable @code{org-log-done} for the possibility to
2855record an additional note together with the clock-out time stamp. 3221record an additional note together with the clock-out time
3222stamp@footnote{The corresponding in-buffer setting is: @code{#+STARTUP:
3223lognoteclock-out}}.
2856@kindex C-c C-y 3224@kindex C-c C-y
2857@item C-c C-y 3225@item C-c C-y
2858Recompute the time interval after changing one of the time stamps. This 3226Recompute the time interval after changing one of the time stamps. This
@@ -3073,6 +3441,8 @@ Turn off groups of mutually exclusive tags. Use this to (as an
3073exception) assign several tags from such a group. 3441exception) assign several tags from such a group.
3074@item C-c 3442@item C-c
3075Toggle auto-exit after the next change (see below). 3443Toggle auto-exit after the next change (see below).
3444If you are using expert mode, the first @kbd{C-c} will display the
3445selection window.
3076@end table 3446@end table
3077 3447
3078@noindent 3448@noindent
@@ -3090,7 +3460,11 @@ modify your list of tags, set the variable
3090@code{org-fast-tag-selection-single-key}. Then you no longer have to 3460@code{org-fast-tag-selection-single-key}. Then you no longer have to
3091press @key{RET} to exit fast tag selection - it will immediately exit 3461press @key{RET} to exit fast tag selection - it will immediately exit
3092after the first change. If you then occasionally need more keys, press 3462after the first change. If you then occasionally need more keys, press
3093@kbd{C-c} to turn off auto-exit for the current tag selection process. 3463@kbd{C-c} to turn off auto-exit for the current tag selection process
3464(in effect: start selection with @kbd{C-c C-c C-c} instead of @kbd{C-c
3465C-c}). If you set the variable to the value @code{expert}, the special
3466window is not even shown for single-key tag selection, it comes up only
3467when you press an extra @kbd{C-c}.
3094 3468
3095@node Tag searches, , Setting tags, Tags 3469@node Tag searches, , Setting tags, Tags
3096@section Tag searches 3470@section Tag searches
@@ -3103,7 +3477,8 @@ information into special lists.
3103@table @kbd 3477@table @kbd
3104@kindex C-c \ 3478@kindex C-c \
3105@item C-c \ 3479@item C-c \
3106Create a sparse tree with all headlines matching a tags search. 3480Create a sparse tree with all headlines matching a tags search. With a
3481@kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
3107@kindex C-c a m 3482@kindex C-c a m
3108@item C-c a m 3483@item C-c a m
3109Create a global list of tag matches from all agenda files. 3484Create a global list of tag matches from all agenda files.
@@ -3125,13 +3500,13 @@ or @samp{-} is present. Examples:
3125 3500
3126@table @samp 3501@table @samp
3127@item +WORK-BOSS 3502@item +WORK-BOSS
3128Select all headlines that are tagged @samp{:WORK:}, but discard those also tagged 3503Select headlines tagged @samp{:WORK:}, but discard those also tagged
3129@samp{:BOSS:}. 3504@samp{:BOSS:}.
3130@item WORK|LAPTOP 3505@item WORK|LAPTOP
3131Selects lines tagged @samp{:WORK:} or @samp{:LAPTOP:}. 3506Selects lines tagged @samp{:WORK:} or @samp{:LAPTOP:}.
3132@item WORK|LAPTOP&NIGHT 3507@item WORK|LAPTOP&NIGHT
3133Like the previous example, but require the @samp{:LAPTOP:} lines to be 3508Like before, but require the @samp{:LAPTOP:} lines to be tagged also
3134tagged also @samp{NIGHT}. 3509@samp{NIGHT}.
3135@end table 3510@end table
3136 3511
3137@cindex TODO keyword matching, with tags search 3512@cindex TODO keyword matching, with tags search
@@ -3141,13 +3516,16 @@ adding a condition after a slash to a tags match. The syntax is similar
3141to the tag matches, but should be applied with consideration: For 3516to the tag matches, but should be applied with consideration: For
3142example, a positive selection on several TODO keywords can not 3517example, a positive selection on several TODO keywords can not
3143meaningfully be combined with boolean AND. However, @emph{negative 3518meaningfully be combined with boolean AND. However, @emph{negative
3144selection} combined with AND can be meaningful. Examples: 3519selection} combined with AND can be meaningful. To make sure that only
3520lines are checked that actually have any TODO keyword, use @kbd{C-c a
3521M}, or equivalently start the todo part after the slash with @samp{!}.
3522Examples:
3145 3523
3146@table @samp 3524@table @samp
3147@item WORK/WAITING 3525@item WORK/WAITING
3148Select @samp{:WORK:}-tagged TODO lines with the specific TODO 3526Select @samp{:WORK:}-tagged TODO lines with the specific TODO
3149keyword @samp{WAITING}. 3527keyword @samp{WAITING}.
3150@item WORK/-WAITING-NEXT 3528@item WORK/!-WAITING-NEXT
3151Select @samp{:WORK:}-tagged TODO lines that are neither @samp{WAITING} 3529Select @samp{:WORK:}-tagged TODO lines that are neither @samp{WAITING}
3152nor @samp{NEXT} 3530nor @samp{NEXT}
3153@item WORK/+WAITING|+NEXT 3531@item WORK/+WAITING|+NEXT
@@ -3155,6 +3533,18 @@ Select @samp{:WORK:}-tagged TODO lines that are either @samp{WAITING} or
3155@samp{NEXT}. 3533@samp{NEXT}.
3156@end table 3534@end table
3157 3535
3536@cindex regular expressions, with tags search
3537Any element of the tag/todo match can be a regular expression - in this
3538case it must be enclosed in curly braces. For example,
3539@samp{WORK+@{^BOSS.*@}} matches headlines that contain the tag
3540@samp{WORK} and any tag @i{starting} with @samp{BOSS}.
3541
3542@cindex level, require for tags match
3543You can also require a headline to be of a certain level, by writing
3544instead of any TAG an expression like @samp{LEVEL=3}. For example, a
3545search @samp{+LEVEL=3+BOSS/-DONE} lists all level three headlines that
3546have the tag BOSS and are @emph{not} marked with the todo keyword DONE.
3547
3158@node Agenda views, Embedded LaTeX, Tags, Top 3548@node Agenda views, Embedded LaTeX, Tags, Top
3159@chapter Agenda Views 3549@chapter Agenda Views
3160@cindex agenda views 3550@cindex agenda views
@@ -3166,23 +3556,26 @@ are important for a particular date, this information must be collected,
3166sorted and displayed in an organized way. 3556sorted and displayed in an organized way.
3167 3557
3168Org-mode can select items based on various criteria, and display them 3558Org-mode can select items based on various criteria, and display them
3169in a separate buffer. Five different view types are provided: 3559in a separate buffer. Six different view types are provided:
3170 3560
3171@itemize @bullet 3561@itemize @bullet
3172@item 3562@item
3173an @emph{agenda} that is like a calendar and shows information 3563an @emph{agenda} that is like a calendar and shows information
3174for specific dates 3564for specific dates,
3175@item 3565@item
3176a @emph{TODO list} that covers all unfinished 3566a @emph{TODO list} that covers all unfinished
3177action items, 3567action items,
3178@item 3568@item
3179a @emph{tags view} that shows information based on 3569a @emph{tags view}, showings headlines based on
3180the tags associated with headlines in the outline tree, 3570the tags associated with them,
3181@item 3571@item
3182a @emph{timeline view} that shows all events in a single Org-mode file, 3572a @emph{timeline view} that shows all events in a single Org-mode file,
3183in time-sorted view 3573in time-sorted view,
3184@item 3574@item
3185@emph{custom views} that are special tag and keyword searches and 3575a @emph{stuck projects view} showing projects that currently don't move
3576along, and
3577@item
3578@emph{custom views} that are special tag/keyword searches and
3186combinations of different views. 3579combinations of different views.
3187@end itemize 3580@end itemize
3188 3581
@@ -3200,10 +3593,7 @@ window configuration is restored when the agenda exits:
3200@menu 3593@menu
3201* Agenda files:: Files being searched for agenda information 3594* Agenda files:: Files being searched for agenda information
3202* Agenda dispatcher:: Keyboard access to agenda views 3595* Agenda dispatcher:: Keyboard access to agenda views
3203* Weekly/Daily agenda:: The calendar page with current tasks 3596* Built-in agenda views:: What is available out of the box?
3204* Global TODO list:: All unfinished action items
3205* Matching headline tags:: Structured information with fine-tuned search
3206* Timeline:: Time-sorted view for single file
3207* Presentation and sorting:: How agenda items are prepared for display 3597* Presentation and sorting:: How agenda items are prepared for display
3208* Agenda commands:: Remote editing of org trees 3598* Agenda commands:: Remote editing of org trees
3209* Custom agenda views:: Defining special searches and views 3599* Custom agenda views:: Defining special searches and views
@@ -3236,7 +3626,9 @@ the front. With prefix arg, file is added/moved to the end.
3236@item C-c ] 3626@item C-c ]
3237Remove current file from the list of agenda files. 3627Remove current file from the list of agenda files.
3238@kindex C-, 3628@kindex C-,
3629@kindex C-'
3239@item C-, 3630@item C-,
3631@itemx C-'
3240Cycle through agenda file list, visiting one file after the other. 3632Cycle through agenda file list, visiting one file after the other.
3241@end table 3633@end table
3242 3634
@@ -3244,7 +3636,7 @@ Cycle through agenda file list, visiting one file after the other.
3244The Org menu contains the current list of files and can be used 3636The Org menu contains the current list of files and can be used
3245to visit any of them. 3637to visit any of them.
3246 3638
3247@node Agenda dispatcher, Weekly/Daily agenda, Agenda files, Agenda views 3639@node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda views
3248@section The agenda dispatcher 3640@section The agenda dispatcher
3249@cindex agenda dispatcher 3641@cindex agenda dispatcher
3250@cindex dispatching agenda commands 3642@cindex dispatching agenda commands
@@ -3257,13 +3649,15 @@ command. The dispatcher offers the following default commands:
3257@table @kbd 3649@table @kbd
3258@item a 3650@item a
3259Create the calendar-like agenda (@pxref{Weekly/Daily agenda}). 3651Create the calendar-like agenda (@pxref{Weekly/Daily agenda}).
3260@item t / T 3652@item t @r{/} T
3261Create a list of all TODO items (@pxref{Global TODO list}). 3653Create a list of all TODO items (@pxref{Global TODO list}).
3262@item m / M 3654@item m @r{/} M
3263Create a list of headlines matching a TAGS expression (@pxref{Matching 3655Create a list of headlines matching a TAGS expression (@pxref{Matching
3264headline tags}). 3656headline tags}).
3265@item L 3657@item L
3266Create the timeline view for the current buffer (@pxref{Timeline}). 3658Create the timeline view for the current buffer (@pxref{Timeline}).
3659@item # @r{/} !
3660Create a list of stuck projects (@pxref{Stuck projects}).
3267@item 1 3661@item 1
3268Restrict an agenda command to the current buffer. After pressing 3662Restrict an agenda command to the current buffer. After pressing
3269@kbd{1}, you still need to press the character selecting the command. 3663@kbd{1}, you still need to press the character selecting the command.
@@ -3280,8 +3674,21 @@ possibility to create extended agenda buffers that contain several
3280blocks together, for example the weekly agenda, the global TODO list and 3674blocks together, for example the weekly agenda, the global TODO list and
3281a number of special tags matches. @xref{Custom agenda views}. 3675a number of special tags matches. @xref{Custom agenda views}.
3282 3676
3283@node Weekly/Daily agenda, Global TODO list, Agenda dispatcher, Agenda views 3677@node Built-in agenda views, Presentation and sorting, Agenda dispatcher, Agenda views
3284@section The weekly/daily agenda 3678@section The built-in agenda views
3679
3680In this section we describe the built-in views.
3681
3682@menu
3683* Weekly/Daily agenda:: The calendar page with current tasks
3684* Global TODO list:: All unfinished action items
3685* Matching headline tags:: Structured information with fine-tuned search
3686* Timeline:: Time-sorted view for single file
3687* Stuck projects:: Find projects you need to review
3688@end menu
3689
3690@node Weekly/Daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views
3691@subsection The weekly/daily agenda
3285@cindex agenda 3692@cindex agenda
3286@cindex weekly agenda 3693@cindex weekly agenda
3287@cindex daily agenda 3694@cindex daily agenda
@@ -3305,13 +3712,7 @@ change the dates of deadlines and appointments from the agenda buffer.
3305The commands available in the Agenda buffer are listed in @ref{Agenda 3712The commands available in the Agenda buffer are listed in @ref{Agenda
3306commands}. 3713commands}.
3307 3714
3308@menu 3715@subsubheading Calendar/Diary integration
3309* Calendar/Diary integration:: Integrating Anniversaries and more
3310@end menu
3311
3312
3313@node Calendar/Diary integration, , Weekly/Daily agenda, Weekly/Daily agenda
3314@subsection Calendar/Diary integration
3315@cindex calendar integration 3716@cindex calendar integration
3316@cindex diary integration 3717@cindex diary integration
3317 3718
@@ -3342,8 +3743,8 @@ calendars, respectively. @kbd{c} can be used to switch back and forth
3342between calendar and agenda. 3743between calendar and agenda.
3343 3744
3344 3745
3345@node Global TODO list, Matching headline tags, Weekly/Daily agenda, Agenda views 3746@node Global TODO list, Matching headline tags, Weekly/Daily agenda, Built-in agenda views
3346@section The global TODO list 3747@subsection The global TODO list
3347@cindex global TODO list 3748@cindex global TODO list
3348@cindex TODO list, global 3749@cindex TODO list, global
3349 3750
@@ -3394,8 +3795,8 @@ and omit the sublevels from the global list. Configure the variable
3394@code{org-agenda-todo-list-sublevels} to get this behavior. 3795@code{org-agenda-todo-list-sublevels} to get this behavior.
3395@end itemize 3796@end itemize
3396 3797
3397@node Matching headline tags, Timeline, Global TODO list, Agenda views 3798@node Matching headline tags, Timeline, Global TODO list, Built-in agenda views
3398@section Matching headline tags 3799@subsection Matching headline tags
3399@cindex matching, of tags 3800@cindex matching, of tags
3400@cindex tags view 3801@cindex tags view
3401 3802
@@ -3422,8 +3823,8 @@ together with a tags match is also possible, see @ref{Tag searches}.
3422The commands available in the tags list are described in @ref{Agenda 3823The commands available in the tags list are described in @ref{Agenda
3423commands}. 3824commands}.
3424 3825
3425@node Timeline, Presentation and sorting, Matching headline tags, Agenda views 3826@node Timeline, Stuck projects, Matching headline tags, Built-in agenda views
3426@section Timeline for a single file 3827@subsection Timeline for a single file
3427@cindex timeline, single file 3828@cindex timeline, single file
3428@cindex time-sorted view 3829@cindex time-sorted view
3429 3830
@@ -3444,7 +3845,49 @@ The commands available in the timeline buffer are listed in
3444@ref{Agenda commands}. 3845@ref{Agenda commands}.
3445 3846
3446 3847
3447@node Presentation and sorting, Agenda commands, Timeline, Agenda views 3848@node Stuck projects, , Timeline, Built-in agenda views
3849@subsection Stuck projects
3850
3851If you are following a system like David Allen's GTD to organize your
3852work, one of the ``duties'' you have is a regular review to make sure
3853that all projects move along. A @emph{stuck} project is a project that
3854has no defined next actions, so it will never show up in the TODO lists
3855Org-mode produces. During the review, you need to identify such
3856projects and define next actions for them.
3857
3858@table @kbd
3859@kindex C-c a #
3860@item C-c a #
3861List projects that are stuck.
3862@kindex C-c a !
3863@item C-c a !
3864Customize the variable @code{org-stuck-projects} to define what a stuck
3865project is and how to find it.
3866@end table
3867
3868You almost certainly will have to configure this view before it will
3869work for you. The built-in default assumes that all your projects are
3870level-2 headlines, and that a project is not stuck if it has at least
3871one entry marked with a todo keyword TODO or NEXT or NEXTACTION.
3872
3873Lets assume that you, in your own way of using Org-mode, identify
3874projects with a tag PROJECT, and that you use a todo keyword MAYBE to
3875indicate a project that should not be considered yet. Lets further
3876assume that the todo keyword DONE marks finished projects, and that NEXT
3877and TODO indicate next actions. Finally, the tag @@SHOP indicates
3878shopping and is a next action even without the NEXT tag. In this case
3879you would start by identifying eligible projects with a tags/todo match
3880@samp{+PROJECT/-MAYBE-DONE}, and then check for TODO, NEXT and @@SHOP in
3881the subtree to identify projects that are not stuck. The correct
3882customization for this is
3883
3884@lisp
3885(setq org-stuck-projects
3886 ("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@@SHOP")))
3887@end lisp
3888
3889
3890@node Presentation and sorting, Agenda commands, Built-in agenda views, Agenda views
3448@section Presentation and sorting 3891@section Presentation and sorting
3449@cindex presentation, of agenda items 3892@cindex presentation, of agenda items
3450 3893
@@ -3492,7 +3935,7 @@ ranges can be specified with two time stamps, like
3492 3935
3493In the headline of the entry itself, a time(range) may also appear as 3936In the headline of the entry itself, a time(range) may also appear as
3494plain text (like @samp{12:45} or a @samp{8:30-1pm}. If the agenda 3937plain text (like @samp{12:45} or a @samp{8:30-1pm}. If the agenda
3495integrates the Emacs diary (@pxref{Calendar/Diary integration}), time 3938integrates the Emacs diary (@pxref{Weekly/Daily agenda}), time
3496specifications in diary entries are recognized as well. 3939specifications in diary entries are recognized as well.
3497 3940
3498For agenda display, Org-mode extracts the time and displays it in a 3941For agenda display, Org-mode extracts the time and displays it in a
@@ -3613,6 +4056,13 @@ location in the org file. The initial setting for this mode in new
3613agenda buffers can be set with the variable 4056agenda buffers can be set with the variable
3614@code{org-agenda-start-with-follow-mode}. 4057@code{org-agenda-start-with-follow-mode}.
3615 4058
4059@kindex b
4060@item b
4061Display the entire subtree of the current item in an indirect buffer.
4062With numerical prefix ARG, go up to this level and then take that tree.
4063If ARG is negative, go up that many levels. With @kbd{C-u} prefix, do
4064not remove the previously used indirect buffer.
4065
3616@kindex l 4066@kindex l
3617@item l 4067@item l
3618Toggle Logbook mode. In Logbook mode, entries that where marked DONE while 4068Toggle Logbook mode. In Logbook mode, entries that where marked DONE while
@@ -3635,7 +4085,7 @@ Switch to daily view (just one day displayed).
3635 4085
3636@kindex D 4086@kindex D
3637@item D 4087@item D
3638Toggle the inclusion of diary entries. See @ref{Calendar/Diary integration}. 4088Toggle the inclusion of diary entries. See @ref{Weekly/Daily agenda}.
3639 4089
3640@kindex g 4090@kindex g
3641@item g 4091@item g
@@ -3674,6 +4124,13 @@ Goto today.
3674@item 0-9 4124@item 0-9
3675Digit argument. 4125Digit argument.
3676 4126
4127@cindex undoing remote-editing events
4128@cindex remote editing, undo
4129@kindex C-_
4130@item C-_
4131Undo a change due to a remote editing command. The change is undone
4132both in the agenda buffer and in the remote buffer.
4133
3677@kindex t 4134@kindex t
3678@item t 4135@item t
3679Change the TODO state of the item, both in the agenda and in the 4136Change the TODO state of the item, both in the agenda and in the
@@ -3686,6 +4143,10 @@ to it in the original Org-mode file. If the text to be deleted remotely
3686is longer than one line, the kill needs to be confirmed by the user. See 4143is longer than one line, the kill needs to be confirmed by the user. See
3687variable @code{org-agenda-confirm-kill}. 4144variable @code{org-agenda-confirm-kill}.
3688 4145
4146@kindex $
4147@item $
4148Archive the subtree corresponding to the current headline.
4149
3689@kindex T 4150@kindex T
3690@item T 4151@item T
3691Show all tags associated with the current item. Because of 4152Show all tags associated with the current item. Because of
@@ -3706,7 +4167,7 @@ priority character. If you reply with @key{SPC}, the priority cookie
3706is removed from the entry. 4167is removed from the entry.
3707 4168
3708@kindex P 4169@kindex P
3709@item p 4170@item P
3710Display weighted priority of current item. 4171Display weighted priority of current item.
3711 4172
3712@kindex + 4173@kindex +
@@ -4310,6 +4771,17 @@ Org-mode contains an HTML (XHTML 1.0 strict) exporter with extensive
4310HTML formatting, in ways similar to John Grubers @emph{markdown} 4771HTML formatting, in ways similar to John Grubers @emph{markdown}
4311language, but with additional support for tables. 4772language, but with additional support for tables.
4312 4773
4774@menu
4775* Export commands:: How to invode HTML export
4776* Quoting HTML tags:: Using direct HTML in Org-mode
4777* Links:: How hyperlinks get transferred to HTML
4778* Images:: To inline or not to inline?
4779* CSS support:: Style specifications
4780@end menu
4781
4782@node Export commands, Quoting HTML tags, HTML export, HTML export
4783@subsection HTML export commands
4784
4313@cindex region, active 4785@cindex region, active
4314@cindex active region 4786@cindex active region
4315@cindex transient-mark-mode 4787@cindex transient-mark-mode
@@ -4340,10 +4812,31 @@ at a different level, specify it with a prefix argument. For example,
4340@noindent 4812@noindent
4341creates two levels of headings and does the rest as items. 4813creates two levels of headings and does the rest as items.
4342 4814
4343If you want to include HTML tags which should be interpreted as such, 4815@node Quoting HTML tags, Links, Export commands, HTML export
4344mark them with @samp{@@} as in @samp{@@<b>bold text@@</b>}. 4816@subsection Quoting HTML tags
4817
4345Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and 4818Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
4346@samp{&gt;} in HTML export. 4819@samp{&gt;} in HTML export. If you want to include simple HTML tags
4820which should be interpreted as such, mark them with @samp{@@} as in
4821@samp{@@<b>bold text@@</b>}. Note that this really works only for
4822simple tags. For more extensive HTML that should be copied verbatim to
4823the exported file use either
4824
4825@example
4826#+HTML: Literal HTML code for export
4827@end example
4828
4829@noindent or
4830
4831@example
4832#+BEGIN_HTML
4833All lines between these markers are exported literally
4834#+END_HTML
4835@end example
4836
4837
4838@node Links, Images, Quoting HTML tags, HTML export
4839@subsection Links
4347 4840
4348@cindex links, in HTML export 4841@cindex links, in HTML export
4349@cindex internal links, in HTML export 4842@cindex internal links, in HTML export
@@ -4358,6 +4851,33 @@ HTML version also exists of the linked file. For information related to
4358linking files while publishing them to a publishing directory see 4851linking files while publishing them to a publishing directory see
4359@ref{Publishing links}. 4852@ref{Publishing links}.
4360 4853
4854@node Images, CSS support, Links, HTML export
4855@subsection Images
4856
4857@cindex images, inline in HTML
4858@cindex inlining images in HTML
4859HTML export can inline images given as links in the Org-mode file, and
4860it can make an image the clickable part of a link. By
4861default@footnote{but see the variable
4862@code{org-export-html-inline-images}}, images are inlined if a link does
4863not have a description. So @samp{[[file:myimg.jpg]]} will be inlined,
4864while @samp{[[file:myimg.jpg][the image]]} will just produce a link
4865@samp{the image} that points to the image. If the description part
4866itself is a @code{file:} link or a @code{http:} URL pointing to an
4867image, this image will be inlined and activated so that clicking on the
4868image will activate the link. For example, to include a thumbnail that
4869will link to a high resolution version of the image, you could use:
4870
4871@example
4872[[file:highres.jpg][file:thumb.jpg]]
4873@end example
4874
4875@noindent
4876and you could use @code{http} addresses just as well.
4877
4878@node CSS support, , Images, HTML export
4879@subsection CSS support
4880
4361You can also give style information for the exported file. The HTML 4881You can also give style information for the exported file. The HTML
4362exporter assigns the following CSS classes to appropriate parts of the 4882exporter assigns the following CSS classes to appropriate parts of the
4363document - your style specifications may change these: 4883document - your style specifications may change these:
@@ -4373,10 +4893,12 @@ document - your style specifications may change these:
4373The default style specification can be configured through the option 4893The default style specification can be configured through the option
4374@code{org-export-html-style}. If you want to use a file-local style, 4894@code{org-export-html-style}. If you want to use a file-local style,
4375you may use file variables, best wrapped into a COMMENT section at the 4895you may use file variables, best wrapped into a COMMENT section at the
4376end of the outline tree. For example: 4896end of the outline tree. For example@footnote{Under Emacs 21, the
4897continuation lines for a variable value should have no @samp{#} at the
4898start of the line.}:
4377 4899
4378@example 4900@example
4379* COMMENT HTML style specifications 4901* COMMENT html style specifications
4380 4902
4381# Local Variables: 4903# Local Variables:
4382# org-export-html-style: " <style type=\"text/css\"> 4904# org-export-html-style: " <style type=\"text/css\">
@@ -4420,7 +4942,8 @@ still prefer a standard calendar application for anniversaries and
4420appointments. In this case it can be useful to have deadlines and 4942appointments. In this case it can be useful to have deadlines and
4421other time-stamped items in Org-mode files show up in the calendar 4943other time-stamped items in Org-mode files show up in the calendar
4422application. Org-mode can export calendar information in the standard 4944application. Org-mode can export calendar information in the standard
4423iCalendar format. 4945iCalendar format. If you also want to have TODO entries included in the
4946export, configure the variable @code{org-icalendar-include-todo}.
4424 4947
4425@table @kbd 4948@table @kbd
4426@kindex C-c C-e i 4949@kindex C-c C-e i
@@ -4440,25 +4963,8 @@ Create a single large iCalendar file from all files in
4440@end table 4963@end table
4441 4964
4442How this calendar is best read and updated, depends on the application 4965How this calendar is best read and updated, depends on the application
4443you are using. For example, when using iCal under Apple MacOS X, you 4966you are using. The FAQ covers this issue.
4444could create a new calendar @samp{OrgMode} (the default name for the 4967
4445calendar created by @kbd{C-c C-e c}, see the variables
4446@code{org-icalendar-combined-name} and
4447@code{org-combined-agenda-icalendar-file}). Then set Org-mode to
4448overwrite the corresponding file
4449@file{~/Library/Calendars/OrgMode.ics}. You may even use AppleScript
4450to make iCal re-read the calendar files each time a new version of
4451@file{OrgMode.ics} is produced. Here is the setup needed for this:
4452
4453@cindex applescript, for calendar update
4454@lisp
4455(setq org-combined-agenda-icalendar-file
4456 "~/Library/Calendars/OrgMode.ics")
4457(add-hook 'org-after-save-iCalendar-file-hook
4458 (lambda ()
4459 (shell-command
4460 "osascript -e 'tell application \"iCal\" to reload calendars'")))
4461@end lisp
4462 4968
4463@node Text interpretation, , iCalendar export, Exporting 4969@node Text interpretation, , iCalendar export, Exporting
4464@section Text interpretation by the exporter 4970@section Text interpretation by the exporter
@@ -4514,6 +5020,11 @@ backend supports lists. See @xref{Plain lists}.
4514You can make words @b{*bold*}, @i{/italic/}, _underlined_, 5020You can make words @b{*bold*}, @i{/italic/}, _underlined_,
4515@code{=code=}, and @samp{+strikethrough+}. 5021@code{=code=}, and @samp{+strikethrough+}.
4516 5022
5023@cindex horizontal rules, in exported files
5024@item
5025A line consisting of only dashes, and at least 5 of them, will be
5026exported as a horizontal line (@samp{<hr/>} in HTML).
5027
4517@cindex LaTeX fragments, export 5028@cindex LaTeX fragments, export
4518@cindex TeX macros, export 5029@cindex TeX macros, export
4519@item 5030@item
@@ -4596,7 +5107,7 @@ you can:
4596@example 5107@example
4597H: @r{set the number of headline levels for export} 5108H: @r{set the number of headline levels for export}
4598num: @r{turn on/off section-numbers} 5109num: @r{turn on/off section-numbers}
4599toc: @r{turn on/off table of contents} 5110toc: @r{turn on/off table of contents, or set level limit (integer)}
4600\n: @r{turn on/off linebreak-preservation} 5111\n: @r{turn on/off linebreak-preservation}
4601@@: @r{turn on/off quoted HTML tags} 5112@@: @r{turn on/off quoted HTML tags}
4602:: @r{turn on/off fixed-width sections} 5113:: @r{turn on/off fixed-width sections}
@@ -4966,14 +5477,14 @@ force publishing of all files by giving a prefix argument.
4966@cindex completion, of TODO keywords 5477@cindex completion, of TODO keywords
4967@cindex completion, of dictionary words 5478@cindex completion, of dictionary words
4968@cindex completion, of option keywords 5479@cindex completion, of option keywords
4969@cindex completion, of CamelCase links
4970@cindex completion, of tags 5480@cindex completion, of tags
5481@cindex completion, of link abbreviations
4971@cindex @TeX{} symbol completion 5482@cindex @TeX{} symbol completion
4972@cindex TODO keywords completion 5483@cindex TODO keywords completion
4973@cindex dictionary word completion 5484@cindex dictionary word completion
4974@cindex option keyword completion 5485@cindex option keyword completion
4975@cindex CamelCase link completion
4976@cindex tag completion 5486@cindex tag completion
5487@cindex link abbreviations, completion of
4977 5488
4978Org-mode supports in-buffer completion. This type of completion does 5489Org-mode supports in-buffer completion. This type of completion does
4979not make use of the minibuffer. You simply type a few letters into 5490not make use of the minibuffer. You simply type a few letters into
@@ -5017,8 +5528,8 @@ Elsewhere, complete dictionary words using ispell.
5017@cindex options, for customization 5528@cindex options, for customization
5018@cindex variables, for customization 5529@cindex variables, for customization
5019 5530
5020There are more than 100 variables that can be used to customize 5531There are more than 180 variables that can be used to customize
5021Org-mode. For the sake of compactness of the manual, we are not 5532Org-mode. For the sake of compactness of the manual, I am not
5022describing the variables here. A structured overview of customization 5533describing the variables here. A structured overview of customization
5023variables is available with @kbd{M-x org-customize}. Or select 5534variables is available with @kbd{M-x org-customize}. Or select
5024@code{Browse Org Group} from the @code{Org->Customization} menu. Many 5535@code{Browse Org Group} from the @code{Org->Customization} menu. Many
@@ -5047,6 +5558,9 @@ Org-mode file is being visited. The first set of options deals with the
5047initial visibility of the outline tree. The corresponding variable for 5558initial visibility of the outline tree. The corresponding variable for
5048global default settings is @code{org-startup-folded}, with a default 5559global default settings is @code{org-startup-folded}, with a default
5049value @code{t}, which means @code{overview}. 5560value @code{t}, which means @code{overview}.
5561@cindex @code{overview}, STARTUP keyword
5562@cindex @code{content}, STARTUP keyword
5563@cindex @code{showall}, STARTUP keyword
5050@example 5564@example
5051overview @r{top-level headlines only} 5565overview @r{top-level headlines only}
5052content @r{all headlines} 5566content @r{all headlines}
@@ -5056,20 +5570,34 @@ Then there are options for aligning tables upon visiting a file. This
5056is useful in files containing narrowed table columns. The corresponding 5570is useful in files containing narrowed table columns. The corresponding
5057variable is @code{org-startup-align-all-tables}, with a default value 5571variable is @code{org-startup-align-all-tables}, with a default value
5058@code{nil}. 5572@code{nil}.
5573@cindex @code{align}, STARTUP keyword
5574@cindex @code{noalign}, STARTUP keyword
5059@example 5575@example
5060align @r{align all tables} 5576align @r{align all tables}
5061noalign @r{don't align tables on startup} 5577noalign @r{don't align tables on startup}
5062@end example 5578@end example
5063Logging when a TODO item is marked DONE (variable @code{org-log-done}) 5579Logging TODO state changes and clock intervals (variable
5064can be configured using these options. 5580@code{org-log-done}) can be configured using these options.
5581@cindex @code{logdone}, STARTUP keyword
5582@cindex @code{nologging}, STARTUP keyword
5583@cindex @code{lognotedone}, STARTUP keyword
5584@cindex @code{lognoteclock-out}, STARTUP keyword
5585@cindex @code{lognotestate}, STARTUP keyword
5065@example 5586@example
5066logging @r{record a timestamp when an item is marked DONE} 5587logging @r{record a timestamp when an item is marked DONE}
5067nologging @r{don't record when items are marked DONE} 5588nologging @r{don't record when items are marked DONE}
5589lognotedone @r{record timestamp and a note when DONE}
5590lognotestate @r{record timestamp, note when TODO state changes}
5591lognoteclock-out @r{record timestamp and a note when clocking out}
5068@end example 5592@end example
5069Here are the options for hiding leading stars in outline headings. The 5593Here are the options for hiding leading stars in outline headings. The
5070corresponding variables are @code{org-hide-leading-stars} and 5594corresponding variables are @code{org-hide-leading-stars} and
5071@code{org-odd-levels-only}, both with a default setting @code{nil} 5595@code{org-odd-levels-only}, both with a default setting @code{nil}
5072(meaning @code{showstars} and @code{oddeven}). 5596(meaning @code{showstars} and @code{oddeven}).
5597@cindex @code{hidestars}, STARTUP keyword
5598@cindex @code{showstars}, STARTUP keyword
5599@cindex @code{odd}, STARTUP keyword
5600@cindex @code{even}, STARTUP keyword
5073@example 5601@example
5074hidestars @r{make all but one of the stars starting a headline invisible.} 5602hidestars @r{make all but one of the stars starting a headline invisible.}
5075showstars @r{show all stars starting a headline} 5603showstars @r{show all stars starting a headline}
@@ -5079,6 +5607,7 @@ oddeven @r{allow all outline levels}
5079To turn on custom format overlays over time stamps (variables 5607To turn on custom format overlays over time stamps (variables
5080@code{org-put-time-stamp-overlays} and 5608@code{org-put-time-stamp-overlays} and
5081@code{org-time-stamp-overlay-formats}), use 5609@code{org-time-stamp-overlay-formats}), use
5610@cindex @code{customtime}, STARTUP keyword
5082@example 5611@example
5083customtime @r{overlay custom time format} 5612customtime @r{overlay custom time format}
5084@end example 5613@end example
@@ -5097,7 +5626,12 @@ These lines (several are allowed) specify link abbreviations.
5097@item #+CATEGORY: 5626@item #+CATEGORY:
5098This line sets the category for the agenda file. The category applies 5627This line sets the category for the agenda file. The category applies
5099for all subsequent lines until the next @samp{#+CATEGORY} line, or the 5628for all subsequent lines until the next @samp{#+CATEGORY} line, or the
5100end of the file. 5629end of the file. The first such line also applies to any entries before it.
5630@item #+ARCHIVE: %s_done::
5631This line sets the archive location for the agenda file. It applies for
5632all subsequent lines until the next @samp{#+CATEGORY} line, or the end
5633of the file. The first such line also applies to any entries before it.
5634The corresponding variable is @code{org-archive-location}.
5101@item #+TBLFM: 5635@item #+TBLFM:
5102This line contains the formulas for the table directly above the line. 5636This line contains the formulas for the table directly above the line.
5103@item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS: 5637@item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS:
@@ -5305,7 +5839,7 @@ with other code out there.
5305@cindex @file{calc.el} 5839@cindex @file{calc.el}
5306@item @file{calc.el} by Dave Gillespie 5840@item @file{calc.el} by Dave Gillespie
5307Org-mode uses the calc package for implementing spreadsheet 5841Org-mode uses the calc package for implementing spreadsheet
5308functionality in its tables (@pxref{Table calculations}). Org-modes 5842functionality in its tables (@pxref{The spreadsheet}). Org-mode
5309checks for the availability of calc by looking for the function 5843checks for the availability of calc by looking for the function
5310@code{calc-eval} which should be autoloaded in your setup if calc has 5844@code{calc-eval} which should be autoloaded in your setup if calc has
5311been installed properly. As of Emacs 22, calc is part of the Emacs 5845been installed properly. As of Emacs 22, calc is part of the Emacs
@@ -5314,7 +5848,7 @@ packages is using calc for embedded calculations. @xref{Embedded Mode,
5314, Embedded Mode, calc, GNU Emacs Calc Manual}. 5848, Embedded Mode, calc, GNU Emacs Calc Manual}.
5315@cindex @file{constants.el} 5849@cindex @file{constants.el}
5316@item @file{constants.el} by Carsten Dominik 5850@item @file{constants.el} by Carsten Dominik
5317In a table formula (@pxref{Table calculations}), it is possible to use 5851In a table formula (@pxref{The spreadsheet}), it is possible to use
5318names for natural constants or units. Instead of defining your own 5852names for natural constants or units. Instead of defining your own
5319constants in the variable @code{org-table-formula-constants}, install 5853constants in the variable @code{org-table-formula-constants}, install
5320the @file{constants} package which defines a large number of constants 5854the @file{constants} package which defines a large number of constants
@@ -5334,8 +5868,34 @@ Org mode cooperates with remember, see @ref{Remember}.
5334@file{Remember.el} is not part of Emacs, find it on the web. 5868@file{Remember.el} is not part of Emacs, find it on the web.
5335@cindex @file{table.el} 5869@cindex @file{table.el}
5336@item @file{table.el} by Takaaki Ota 5870@item @file{table.el} by Takaaki Ota
5337Org mode cooperates with table.el, see @ref{table.el}. @file{table.el} 5871@kindex C-c C-c
5338is part of Emacs 22. 5872@cindex table editor, @file{table.el}
5873@cindex @file{table.el}
5874
5875Complex ASCII tables with automatic line wrapping, column- and
5876row-spanning, and alignment can be created using the Emacs table
5877package by Takaaki Ota (@uref{http://sourceforge.net/projects/table},
5878and also part of Emacs 22).
5879When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org-mode
5880will call @command{table-recognize-table} and move the cursor into the
5881table. Inside a table, the keymap of Org-mode is inactive. In order
5882to execute Org-mode-related commands, leave the table.
5883
5884@table @kbd
5885@kindex C-c C-c
5886@item C-c C-c
5887Recognize @file{table.el} table. Works when the cursor is in a
5888table.el table.
5889
5890@kindex C-c ~
5891@item C-c ~
5892Insert a table.el table. If there is already a table at point, this
5893command converts it between the table.el format and the Org-mode
5894format. See the documentation string of the command
5895@code{org-convert-table} for the restrictions under which this is
5896possible.
5897@end table
5898@file{table.el} is part of Emacs 22.
5339@end table 5899@end table
5340 5900
5341@node Conflicts, , Cooperation, Interaction 5901@node Conflicts, , Cooperation, Interaction
@@ -5405,14 +5965,11 @@ When the application called by @kbd{C-c C-o} to open a file link fails
5405(for example because the application does not exist or refuses to open 5965(for example because the application does not exist or refuses to open
5406the file), it does so silently. No error message is displayed. 5966the file), it does so silently. No error message is displayed.
5407@item 5967@item
5408The remote-editing commands in the agenda buffer cannot be undone with
5409@code{undo} called from within the agenda buffer. But you can go to
5410the corresponding buffer (using @key{TAB} or @key{RET} and execute
5411@code{undo} there.
5412@item
5413Recalculating a table line applies the formulas from left to right. 5968Recalculating a table line applies the formulas from left to right.
5414If a formula uses @emph{calculated} fields further down the row, 5969If a formula uses @emph{calculated} fields further down the row,
5415multiple recalculation may be needed to get all fields consistent. 5970multiple recalculation may be needed to get all fields consistent. You
5971may use the command @code{org-table-iterate} (@kbd{C-u C-c *}) to
5972recalculate until convergence.
5416@item 5973@item
5417A single letter cannot be made bold, for example @samp{*a*}. 5974A single letter cannot be made bold, for example @samp{*a*}.
5418@item 5975@item
@@ -5424,16 +5981,19 @@ The exporters work well, but could be made more efficient.
5424@appendix Extensions, Hooks and Hacking 5981@appendix Extensions, Hooks and Hacking
5425 5982
5426This appendix lists extensions for Org-mode written by other authors. 5983This appendix lists extensions for Org-mode written by other authors.
5427It also covers some aspects where users can easily extend the 5984It also covers some aspects where users can extend the functionality of
5428functionality of Org-mode. 5985Org-mode.
5429 5986
5430@menu 5987@menu
5431* Extensions:: Existing 3rd-part extensions 5988* Extensions:: Existing 3rd-part extensions
5989* Tables in arbitrary syntax:: Orgtbl for LaTeX and other programs
5432* Dynamic blocks:: Automatically filled blocks 5990* Dynamic blocks:: Automatically filled blocks
5991* Special agenda views:: Customized views
5433@end menu 5992@end menu
5434 5993
5435@node Extensions, Dynamic blocks, Extensions and Hacking, Extensions and Hacking 5994@node Extensions, Tables in arbitrary syntax, Extensions and Hacking, Extensions and Hacking
5436@section Third-party extensions for Org-mode 5995@section Third-party extensions for Org-mode
5996@cindex extension, third-party
5437 5997
5438The following extensions for Org-mode have been written by other people: 5998The following extensions for Org-mode have been written by other people:
5439 5999
@@ -5441,7 +6001,7 @@ The following extensions for Org-mode have been written by other people:
5441@cindex @file{org-publish.el} 6001@cindex @file{org-publish.el}
5442@item @file{org-publish.el} by David O'Toole 6002@item @file{org-publish.el} by David O'Toole
5443This package provides facilities for publishing related sets of Org-mode 6003This package provides facilities for publishing related sets of Org-mode
5444files together with linked files like images as a webpages. It is 6004files together with linked files like images as webpages. It is
5445highly configurable and can be used for other publishing purposes as 6005highly configurable and can be used for other publishing purposes as
5446well. As of Org-mode version 4.30, @file{org-publish.el} is part of the 6006well. As of Org-mode version 4.30, @file{org-publish.el} is part of the
5447Org-mode distribution. It is not yet part of Emacs, however, a delay 6007Org-mode distribution. It is not yet part of Emacs, however, a delay
@@ -5463,19 +6023,293 @@ caused by the preparations for the 22.1 release. In the mean time,
5463@item @file{org-blog.el} by David O'Toole 6023@item @file{org-blog.el} by David O'Toole
5464A blogging plug-in for @file{org-publish.el}.@* 6024A blogging plug-in for @file{org-publish.el}.@*
5465@url{http://dto.freeshell.org/notebook/OrgMode.html}. 6025@url{http://dto.freeshell.org/notebook/OrgMode.html}.
5466@cindex @file{org-blogging.el} 6026@cindex @file{blorg.el}
5467@item @file{org-blogging.el} by Bastien Guerry 6027@item @file{blorg.el} by Bastien Guerry
5468Publish Org-mode files as 6028Publish Org-mode files as
5469blogs. @url{http://www.cognition.ens.fr/~guerry/org-blogging.html}. 6029blogs. @url{http://www.cognition.ens.fr/~guerry/blorg.html}.
6030@cindex @file{org2rem.el}
6031@item @file{org2rem.el} by Bastien Guerry
6032Translates Org-mode files into something readable by
6033Remind. @url{http://www.cognition.ens.fr/~guerry/u/org2rem.el}.
5470@end table 6034@end table
5471 6035
5472@node Dynamic blocks, , Extensions, Extensions and Hacking 6036@page
6037
6038@node Tables in arbitrary syntax, Dynamic blocks, Extensions, Extensions and Hacking
6039@section Tables in arbitrary syntax
6040@cindex tables, in other modes
6041@cindex orgtbl-mode
6042
6043Since Orgtbl-mode can be used as a minor mode in arbitrary buffers, a
6044frequent feature request has been to make it work with native tables in
6045specific languages, for example LaTeX. However, this is extremely hard
6046to do in a general way, would lead to a customization nightmare, and
6047would take away much of the simplicity of the Orgtbl-mode table editor.
6048
6049This appendix describes a different approach. We keep the Orgtbl-mode
6050table in its native format (the @i{source table}), and use a custom
6051function to @i{translate} the table to the correct syntax, and to
6052@i{install} it in the right location (the @i{target table}). This puts
6053the burden of writing conversion functions on the user, but it allows
6054for a very flexible system.
6055
6056@menu
6057* Radio tables:: Sending and receiving
6058* A LaTeX example:: Step by step, almost a tutorial
6059* Translator functions:: Copy and modify
6060@end menu
6061
6062@node Radio tables, A LaTeX example, Tables in arbitrary syntax, Tables in arbitrary syntax
6063@subsection Radio tables
6064@cindex radio tables
6065
6066To define the location of the target table, you first need to create two
6067lines that are comments in the current mode, but contain magic words for
6068Orgtbl-mode to find. Orgtbl-mode will insert the translated table
6069between these lines, replacing whatever was there before. For example:
6070
6071@example
6072/* BEGIN RECEIVE ORGTBL table_name */
6073/* END RECEIVE ORGTBL table_name */
6074@end example
6075
6076@noindent
6077Just above the source table, we put a special line that tells
6078Orgtbl-mode how to translate this table and where to install it. For
6079example:
6080@example
6081#+ORGTBL: SEND table_name translation_function arguments....
6082@end example
6083
6084@noindent
6085@code{table_name} is the reference name for the table that is also used
6086in the receiver lines. @code{translation_function} is the Lisp function
6087that does the translation. Furthermore, the line can contain a list of
6088arguments (alternating key and value) at the end. The arguments will be
6089passed as a property list to the translation function for
6090interpretation. A few standard parameters are already recognized and
6091acted upon before the translation function is called:
6092
6093@table @code
6094@item :skip N
6095Skip the first N lines of the table. Hlines do count!
6096@item :skipcols (n1 n2 ...)
6097List of columns that should be skipped. If the table has a column with
6098calculation marks, that column is automatically discarded as well.
6099Please note that the translator function sees the table @emph{after} the
6100removal of these columns, the function never knows that there have been
6101additional columns.
6102@end table
6103
6104@noindent
6105The one problem remaining is how to keep the source table in the buffer
6106without disturbing the normal workings of the file, for example during
6107compilation of a C file or processing of a LaTeX file. There are a
6108number of different solutions:
6109
6110@itemize @bullet
6111@item
6112The table could be placed in a block comment if that is supported by the
6113language. For example, in C-mode you could wrap the table between
6114@samp{/*} and @samp{*/} lines.
6115@item
6116Sometimes it is possible to put the table after some kind of @i{END}
6117statement, for example @samp{\bye} in TeX and @samp{\end@{document@}}
6118in LaTeX.
6119@item
6120You can just comment the table line by line whenever you want to process
6121the file, and uncomment it whenever you need to edit the table. This
6122only sounds tedious - the command @kbd{M-x orgtbl-toggle-comment} does
6123make this comment-toggling very easy, in particular if you bind it to a
6124key.
6125@end itemize
6126
6127@node A LaTeX example, Translator functions, Radio tables, Tables in arbitrary syntax
6128@subsection A LaTeX example
6129@cindex LaTeX, and orgtbl-mode
6130
6131The best way to wrap the source table in LaTeX is to use the
6132@code{comment} environment provided by @file{comment.sty}. It has to be
6133activated by placing @code{\usepackage@{comment@}} into the document
6134header. Orgtbl-mode can insert a radio table skeleton@footnote{By
6135default this works only for LaTeX, HTML, and TeXInfo. Configure the
6136variable @code{orgtbl-radio-tables} to install templates for other
6137modes.} with the command @kbd{M-x orgtbl-insert-radio-table}. You will
6138be prompted for a table name, lets say we use @samp{salesfigures}. You
6139will then get the following template:
6140
6141@example
6142% BEGIN RECEIVE ORGTBL salesfigures
6143% END RECEIVE ORGTBL salesfigures
6144\begin@{comment@}
6145#+ORGTBL: SEND salesfigures orgtbl-to-latex
6146| | |
6147\end@{comment@}
6148@end example
6149
6150@noindent
6151The @code{#+ORGTBL: SEND} line tells orgtbl-mode to use the function
6152@code{orgtbl-to-latex} to convert the table into LaTeX and to put it
6153into the receiver location with name @code{salesfigures}. You may now
6154fill in the table, feel free to use the spreadsheet features@footnote{If
6155the @samp{#+TBLFM} line contains an odd number of dollar characters,
6156this may cause problems with font-lock in latex-mode. As shown in the
6157example you can fix this by adding an extra line inside the
6158@code{comment} environment that is used to balance the dollar
6159expressions. If you are using AUCTeX with the font-latex library, a
6160much better solution is to add the @code{comment} environment to the
6161variable @code{LaTeX-verbatim-environments}.}:
6162
6163@example
6164% BEGIN RECEIVE ORGTBL salesfigures
6165% END RECEIVE ORGTBL salesfigures
6166\begin@{comment@}
6167#+ORGTBL: SEND salesfigures orgtbl-to-latex
6168| Month | Days | Nr sold | per day |
6169|-------+------+---------+---------|
6170| Jan | 23 | 55 | 2.4 |
6171| Feb | 21 | 16 | 0.8 |
6172| March | 22 | 278 | 12.6 |
6173#+TBLFM: $4=$3/$2;%.1f
6174% $ (optional extra dollar to keep font-lock happy, see footnote)
6175\end@{comment@}
6176@end example
6177
6178@noindent
6179When you are done, press @kbd{C-c C-c} in the table to get the converted
6180table inserted between the two marker lines.
6181
6182Now lets assume you want to make the table header by hand, because you
6183want to control how columns are aligned etc. In this case we make sure
6184that the table translator does skip the first 2 lines of the source
6185table, and tell the command to work as a @i{splice}, i.e. to not produce
6186header and footer commands of the target table:
6187
6188@example
6189\begin@{tabular@}@{lrrr@}
6190Month & \multicolumn@{1@}@{c@}@{Days@} & Nr.\ sold & per day\\
6191% BEGIN RECEIVE ORGTBL salesfigures
6192% END RECEIVE ORGTBL salesfigures
6193\end@{tabular@}
6194%
6195\begin@{comment@}
6196#+ORGTBL: SEND salesfigures orgtbl-to-latex :splice t :skip 2
6197| Month | Days | Nr sold | per day |
6198|-------+------+---------+---------|
6199| Jan | 23 | 55 | 2.4 |
6200| Feb | 21 | 16 | 0.8 |
6201| March | 22 | 278 | 12.6 |
6202#+TBLFM: $4=$3/$2;%.1f
6203\end@{comment@}
6204@end example
6205
6206The LaTeX translator function @code{orgtbl-to-latex} is already part of
6207Orgtbl-mode. It uses a @code{tabular} environment to typeset the table
6208and marks horizontal lines with @code{\hline}. Furthermore, it
6209interprets the following parameters:
6210
6211@table @code
6212@item :splice nil/t
6213When set to t, return only table body lines, don't wrap them into a
6214tabular environment. Default is nil.
6215
6216@item :fmt fmt
6217A format to be used to wrap each field, should contain @code{%s} for the
6218original field value. For example, to wrap each field value in dollars,
6219you could use @code{:fmt "$%s$"}. This may also be a property list with
6220column numbers and formats. for example @code{:fmt (2 "$%s$" 4 "%s\\%%")}.
6221
6222@item :efmt efmt
6223Use this format to print numbers with exponentials. The format should
6224have @code{%s} twice for inserting mantissa and exponent, for example
6225@code{"%s\\times10^@{%s@}"}. The default is @code{"%s\\,(%s)"}. This
6226may also be a property list with column numbers and formats, for example
6227@code{:efmt (2 "$%s\\times10^@{%s@}$" 4 "$%s\\cdot10^@{%s@}$")}. After
6228@code{efmt} has been applied to a value, @code{fmt} will also be
6229applied.
6230@end table
6231
6232@node Translator functions, , A LaTeX example, Tables in arbitrary syntax
6233@subsection Translator functions
6234@cindex HTML, and orgtbl-mode
6235@cindex translator function
6236
6237Orgtbl-mode has several translator functions built-in:
6238@code{orgtbl-to-latex}, @code{orgtbl-to-html}, and
6239@code{orgtbl-to-texinfo}. Except for @code{orgtbl-to-html}@footnote{The
6240HTML translator uses the same code that produces tables during HTML
6241export.}, these all use a generic translator, @code{orgtbl-to-generic}.
6242For example, @code{orgtbl-to-latex} itself is a very short function that
6243computes the column definitions for the @code{tabular} environment,
6244defines a few field and line separators and then hands over to the
6245generic translator. Here is the entire code:
6246
6247@lisp
6248@group
6249(defun orgtbl-to-latex (table params)
6250 "Convert the orgtbl-mode TABLE to LaTeX."
6251 (let* ((alignment (mapconcat (lambda (x) (if x "r" "l"))
6252 org-table-last-alignment ""))
6253 (params2
6254 (list
6255 :tstart (concat "\\begin@{tabular@}@{" alignment "@}")
6256 :tend "\\end@{tabular@}"
6257 :lstart "" :lend " \\\\" :sep " & "
6258 :efmt "%s\\,(%s)" :hline "\\hline")))
6259 (orgtbl-to-generic table (org-combine-plists params2 params))))
6260@end group
6261@end lisp
6262
6263As you can see, the properties passed into the function (variable
6264@var{PARAMS}) are combined with the ones newly defined in the function
6265(variable @var{PARAMS2}). The ones passed into the function (i.e. the
6266ones set by the @samp{ORGTBL SEND} line) take precedence. So if you
6267would like to use the LaTeX translator, but wanted the line endings to
6268be @samp{\\[2mm]} instead of the default @samp{\\}, you could just
6269overrule the default with
6270
6271@example
6272#+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]"
6273@end example
6274
6275For a new language, you can either write your own converter function in
6276analogy with the LaTeX translator, or you can use the generic function
6277directly. For example, if you have a language where a table is started
6278with @samp{!BTBL!}, ended with @samp{!ETBL!}, and where table lines are
6279started with @samp{!BL!}, ended with @samp{!EL!} and where the field
6280separator is a TAB, you could call the generic translator like this (on
6281a single line!):
6282
6283@example
6284#+ORGTBL: SEND test orgtbl-to-generic :tstart "!BTBL!" :tend "!ETBL!"
6285 :lstart "!BL! " :lend " !EL!" :sep "\t"
6286@end example
6287
6288@noindent
6289Please check the documentation string of the function
6290@code{orgtbl-to-generic} for a full list of parameters understood by
6291that function and remember that you can pass each of them into
6292@code{orgtbl-to-latex}, @code{orgtbl-to-texinfo}, and any other function
6293using the generic function.
6294
6295Of course you can also write a completely new function doing complicated
6296things the generic translator cannot do. A translator function takes
6297two arguments. The first argument is the table, a list of lines, each
6298line either the symbol @code{hline} or a list of fields. The second
6299argument is the property list containing all parameters specified in the
6300@samp{#+ORGTBL: SEND} line. The function must return a single string
6301containing the formatted table. If you write a generally useful
6302translator, please post it on @code{emacs-orgmode@@gnu.org} so that
6303others can benefit from your work.
6304
6305@node Dynamic blocks, Special agenda views, Tables in arbitrary syntax, Extensions and Hacking
5473@section Dynamic blocks 6306@section Dynamic blocks
6307@cindex dynamic blocks
5474 6308
5475Org-mode documents can contain @emph{dynamic blocks}. These are 6309Org-mode documents can contain @emph{dynamic blocks}. These are
5476specially marked regions that are updated by some user-written 6310specially marked regions that are updated by some user-written function.
5477function. A good example for such a block is the clock table inserted 6311A good example for such a block is the clock table inserted by the
5478by the command @kbd{C-c C-x C-r} (@pxref{Clocking work time}). 6312command @kbd{C-c C-x C-r} (@pxref{Clocking work time}).
5479 6313
5480Dynamic block are enclosed by a BEGIN-END structure that assigns a name 6314Dynamic block are enclosed by a BEGIN-END structure that assigns a name
5481to the block and can also specify parameters for the function producing 6315to the block and can also specify parameters for the function producing
@@ -5528,6 +6362,60 @@ you could add the function @code{org-update-all-dblocks} to a hook, for
5528example @code{before-save-hook}. @code{org-update-all-dblocks} is 6362example @code{before-save-hook}. @code{org-update-all-dblocks} is
5529written in a way that is does nothing in buffers that are not in Org-mode. 6363written in a way that is does nothing in buffers that are not in Org-mode.
5530 6364
6365@node Special agenda views, , Dynamic blocks, Extensions and Hacking
6366@section Special Agenda Views
6367@cindex agenda views, user-defined
6368
6369Org-mode provides a special hook that can be used to narrow down the
6370selection made by any of the agenda views. You may specify a function
6371that is used at each match to verify if the match should indeed be part
6372of the agenda view, and if not, how much should be skipped.
6373
6374Let's say you want to produce a list of projects that contain a WAITING
6375tag anywhere in the project tree. Let's further assume that you have
6376marked all tree headings that define a project with the todo keyword
6377PROJECT. In this case you would run a todo search for the keyword
6378PROJECT, but skip the match unless there is a WAITING tag anywhere in
6379the subtree belonging to the project line.
6380
6381To achieve this, you must write a function that searches the subtree for
6382the tag. If the tag is found, the function must return @code{nil} to
6383indicate that this match should not be skipped. If there is no such
6384tag, return the location of the end of the subtree, to indicate that
6385search should continue from there.
6386
6387@lisp
6388(defun my-skip-unless-waiting ()
6389 "Skip trees that are not waiting"
6390 (let ((subtree-end (save-excursion (org-end-of-subtree t))))
6391 (if (re-search-forward ":WAITING:" subtree-end t)
6392 nil ; tag found, do not skip
6393 subtree-end))) ; tag not found, continue after end of subtree
6394@end lisp
6395
6396Furthermore you must write a command that uses @code{let} to temporarily
6397put this function into the variable @code{org-agenda-skip-function},
6398sets the header string for the agenda buffer, and calls the todo-list
6399generator while asking for the specific TODO keyword PROJECT. The
6400function must also accept one argument MATCH, but it can choose to
6401ignore it@footnote{MATCH must be present in case you want to define a
6402custom command for producing this special list. Custom commands always
6403supply the MATCH argument, but it can be empty if you do not specify it
6404while defining the command(@pxref{Custom agenda
6405views}).} (as we do in the example below). Here is the example:
6406
6407@lisp
6408(defun my-org-waiting-projects (&optional match)
6409 "Produce a list of projects that contain a WAITING tag.
6410MATCH is being ignored."
6411 (interactive)
6412 (let ((org-agenda-skip-function 'my-skip-unless-waiting)
6413 (org-agenda-overriding-header "Projects waiting for something: "))
6414 ;; make the list
6415 (org-todo-list "PROJECT")))
6416@end lisp
6417
6418
5531@node History and Acknowledgments, Index, Extensions and Hacking, Top 6419@node History and Acknowledgments, Index, Extensions and Hacking, Top
5532@appendix History and Acknowledgments 6420@appendix History and Acknowledgments
5533@cindex acknowledgments 6421@cindex acknowledgments
@@ -5535,25 +6423,29 @@ written in a way that is does nothing in buffers that are not in Org-mode.
5535@cindex thanks 6423@cindex thanks
5536 6424
5537Org-mode was borne in 2003, out of frustration over the user interface 6425Org-mode was borne in 2003, out of frustration over the user interface
5538of the Emacs outline-mode. All I wanted was to make working with an 6426of the Emacs outline-mode. I was trying to organize my notes and
5539outline tree possible without having to remember more than 10 commands 6427projects, and using Emacs seemed to be the natural way to go. However,
5540just for hiding and unhiding parts of the outline tree, and to allow to 6428having to remember eleven different commands with two or three keys per
5541restructure a tree easily. Visibility cycling and structure editing 6429command, only to hide and unhide parts of the outline tree, that seemed
5542were originally implemented in the package @file{outline-magic.el}, but 6430entirely unacceptable to me. Also, when using outlines to take notes, I
5543quickly moved to the more general @file{org.el}. TODO entries, basic 6431constantly want to restructure the tree, organizing it parallel to my
5544time stamps, and table support were added next, and highlight the two 6432thoughts and plans. @emph{Visibility cycling} and @emph{structure
5545main goals that Org-mode still has today: To create a new, 6433editing} were originally implemented in the package
5546outline-based, plain text mode with innovative and intuitive editing 6434@file{outline-magic.el}, but quickly moved to the more general
5547features, and to incorporate project planning functionality directly 6435@file{org.el}. As this environment became comfortable for project
5548into a notes file. 6436planning, the next step was adding @emph{TODO entries}, basic @emph{time
6437stamps}, and @emph{table support}. These areas highlight the two main
6438goals that Org-mode still has today: To create a new, outline-based,
6439plain text mode with innovative and intuitive editing features, and to
6440incorporate project planning functionality directly into a notes file.
5549 6441
5550Since the first release, hundreds of emails to me or on 6442Since the first release, hundreds of emails to me or on
5551@code{emacs-orgmode@@gnu.org} have provided a constant stream of bug 6443@code{emacs-orgmode@@gnu.org} have provided a constant stream of bug
5552reports, feedback, new ideas, and sometimes even patches and add-on 6444reports, feedback, new ideas, and sometimes patches and add-on code.
5553code. Many thanks to everyone who has helped to improve this package. 6445Many thanks to everyone who has helped to improve this package. I am
5554I am trying to keep here a list of the people who had significant 6446trying to keep here a list of the people who had significant influence
5555influence in shaping one or more aspects of Org-mode. The list may not 6447in shaping one or more aspects of Org-mode. The list may not be
5556be complete, if I have forgotten someone, please accept my apologies and 6448complete, if I have forgotten someone, please accept my apologies and
5557let me know. 6449let me know.
5558 6450
5559@itemize @bullet 6451@itemize @bullet
@@ -5578,19 +6470,27 @@ calculations and improved XEmacs compatibility, in particular by porting
5578@item 6470@item
5579@i{Eddward DeVilla} proposed and tested checkbox statistics. 6471@i{Eddward DeVilla} proposed and tested checkbox statistics.
5580@item 6472@item
5581@i{Kees Dullemond} inspired the use of narrowed tabled columns. 6473@i{Kees Dullemond} used to edit projects lists directly in HTML and so
6474inspired some of the early development, including HTML export. He also
6475asked for a way to narrow wide table columns.
5582@item 6476@item
5583@i{Christian Egli} converted the documentation into TeXInfo format, 6477@i{Christian Egli} converted the documentation into TeXInfo format,
5584patched CSS formatting into the HTML exporter, and inspired the agenda. 6478patched CSS formatting into the HTML exporter, and inspired the agenda.
5585@item 6479@item
5586@i{Nic Ferrier} contributed mailcap and XOXO support. 6480@i{Nic Ferrier} contributed mailcap and XOXO support.
5587@item 6481@item
6482@i{John Foerch} figured out how to make incremental search show context
6483around a match in a hidden outline tree.
6484@item
5588@i{Niels Giessen} had the idea to automatically archive DONE trees. 6485@i{Niels Giessen} had the idea to automatically archive DONE trees.
5589@item 6486@item
5590@i{Bastien Guerry} provided extensive feedback. 6487@i{Bastien Guerry} provided extensive feedback and some patches, and
6488translated David O'Toole's tutorial into French.
5591@item 6489@item
5592@i{Kai Grossjohann} pointed out key-binding conflicts with other packages. 6490@i{Kai Grossjohann} pointed out key-binding conflicts with other packages.
5593@item 6491@item
6492@i{Shidai Liu} (``Leo'') provided extensive feedback and some patches.
6493@item
5594@i{Leon Liu} asked for embedded LaTeX and tested it. 6494@i{Leon Liu} asked for embedded LaTeX and tested it.
5595@item 6495@item
5596@i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler 6496@i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler
@@ -5601,6 +6501,9 @@ happy.
5601@i{Tim O'Callaghan} suggested in-file links, search options for general 6501@i{Tim O'Callaghan} suggested in-file links, search options for general
5602file links, and TAGS. 6502file links, and TAGS.
5603@item 6503@item
6504@i{Takeshi Okano} translated the manual and David O'Toole's tutorial
6505into Japanese.
6506@item
5604@i{Oliver Oppitz} suggested multi-state TODO items. 6507@i{Oliver Oppitz} suggested multi-state TODO items.
5605@item 6508@item
5606@i{Scott Otterson} sparked the introduction of descriptive text for 6509@i{Scott Otterson} sparked the introduction of descriptive text for